From cb8c83978177a8d3de769fca12d2aa3642eb0275 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 16 十一月 2021 12:42:32 +0800
Subject: [PATCH] 2021-11-16

---
 src/menu/components/table/normal-table/index.jsx |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx
index fe363e0..2aaef69 100644
--- a/src/menu/components/table/normal-table/index.jsx
+++ b/src/menu/components/table/normal-table/index.jsx
@@ -41,6 +41,7 @@
 
   UNSAFE_componentWillMount () {
     const { card } = this.props
+    const { appType } = this.state
 
     if (card.isNew) {
       let _card = {
@@ -121,6 +122,11 @@
           _card.wrap.doubleClick = oriUids[_card.wrap.doubleClick] || ''
         }
       }
+
+      if (appType === 'mob') {
+        _card.search = []
+        _card.action = _card.action.filter(a => !a.origin)
+      }
       
       this.setState({
         card: _card
@@ -128,8 +134,13 @@
 
       this.filterOrigin(_card)
     } else {
+      let _card = fromJS(card).toJS()
+      if (appType === 'mob') {
+        _card.search = []
+      }
+
       this.setState({
-        card: fromJS(card).toJS()
+        card: _card
       })
     }
   }
@@ -250,11 +261,9 @@
   }
 
   addSearch = () => {
-    let card = fromJS(this.state.card).toJS()
+    const { card } = this.state
 
-    card.search.push({uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '='})
-
-    this.setState({card})
+    MKEmitter.emit('plusSearch', card.uuid, {uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '='}, 'simple')
   }
 
   addButton = () => {
@@ -394,11 +403,16 @@
 
   render() {
     const { card, appType } = this.state
+    let options = ['action', 'search', 'form', 'cols']
     let _style = resetStyle(card.style)
+    
+    if (appType === 'mob') {
+      options = ['action', 'cols']
+    }
 
     return (
       <div className="menu-normal-table-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}>
-        <NormalHeader defaultshow="hidden" hideSearch="true" config={card} updateComponent={this.updateComponent}/>
+        <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/>
         <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
           <div className="mk-popover-control">
             <Icon className="plus" title="娣诲姞鍒�" onClick={this.addColumns} type="plus" />
@@ -408,7 +422,7 @@
               <Icon type="edit" style={{color: '#1890ff'}} title="缂栬緫"/>
             </NormalForm>
             <CopyComponent type="normaltable" card={card}/>
-            <PasteComponent config={card} options={['action', 'search', 'form', 'cols']} updateConfig={this.updateComponent} />
+            <PasteComponent config={card} options={options} updateConfig={this.updateComponent} />
             <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" />
             <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} />
             <UserComponent config={card}/>

--
Gitblit v1.8.0