From 9ee3d1f9a09a865188baffdffb85f6ad329c7b09 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 19 十二月 2021 01:09:20 +0800
Subject: [PATCH] 2021-12-19

---
 src/menu/components/table/normal-table/index.jsx |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx
index 075ebfa..85c8445 100644
--- a/src/menu/components/table/normal-table/index.jsx
+++ b/src/menu/components/table/normal-table/index.jsx
@@ -9,8 +9,6 @@
 import MKEmitter from '@/utils/events.js'
 import getWrapForm from './options'
 import Utils from '@/utils/utils.js'
-import zhCN from '@/locales/zh-CN/model.js'
-import enUS from '@/locales/en-US/model.js'
 
 import './index.scss'
 
@@ -33,7 +31,6 @@
   }
 
   state = {
-    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     appType: sessionStorage.getItem('appType'),
     card: null,
     back: false
@@ -41,6 +38,7 @@
 
   UNSAFE_componentWillMount () {
     const { card } = this.props
+    const { appType } = this.state
 
     if (card.isNew) {
       let _card = {
@@ -55,8 +53,8 @@
         dataName: card.dataName || '',
         width: card.width || 24,
         search: [
-          { origin: true, uuid: Utils.getuuid(), label: 'label', type: 'text', match: 'like' },
-          { origin: true, uuid: Utils.getuuid(), label: 'label', type: 'select', match: 'equal' }
+          { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text', match: 'like' },
+          { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'select', match: 'equal' }
         ],
         action: [
           { origin: true, uuid: Utils.getuuid(), label: '娣诲姞', intertype: 'system', OpenType: 'pop', execSuccess: 'grid', icon: 'plus', class: 'green', style: {color: 'rgb(255, 255, 255)', background: 'rgb(38, 194, 129)', marginRight: '15px'} },
@@ -66,7 +64,7 @@
         name: card.name,
         subtype: card.subtype,
         setting: { interType: 'system' },
-        wrap: { name: card.name, width: card.width || 24, bordered: 'true', tableType: 'checkbox' },
+        wrap: { name: card.name, width: card.width || 24, bordered: 'true', tableType: 'checkbox', show: 'true' },
         style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' },
         headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' },
         columns: [],
@@ -121,6 +119,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 +131,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 +258,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 +400,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 +419,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