From 53b9fb93d0376eb02bb996935f1720b4e95cd897 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 12 十月 2022 14:41:06 +0800
Subject: [PATCH] 2022-10-12

---
 src/menu/components/table/base-table/index.jsx |  103 +++------------------------------------------------
 1 files changed, 7 insertions(+), 96 deletions(-)

diff --git a/src/menu/components/table/base-table/index.jsx b/src/menu/components/table/base-table/index.jsx
index 480a7db..a99bb1c 100644
--- a/src/menu/components/table/base-table/index.jsx
+++ b/src/menu/components/table/base-table/index.jsx
@@ -21,7 +21,6 @@
 const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
 const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
 const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
-// const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
 const ColumnComponent = asyncComponent(() => import('./columns'))
 
 class TableCardEditComponent extends Component {
@@ -32,14 +31,12 @@
   }
 
   state = {
-    appType: sessionStorage.getItem('appType'),
     card: null,
     back: false
   }
 
   UNSAFE_componentWillMount () {
     const { card } = this.props
-    const { appType } = this.state
 
     if (card.isNew) {
       let _card = {
@@ -50,8 +47,8 @@
         format: 'array',    // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡
         pageable: true,     // 缁勪欢灞炴�� - 鏄惁鍙垎椤�
         switchable: true,   // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹�
-        dataName: card.dataName || '',
-        width: card.width || 24,
+        dataName: Utils.getdataName(),
+        width: 24,
         search: [
           { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text', match: 'like' },
           { origin: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'select', match: 'equal' }
@@ -64,7 +61,7 @@
         name: card.name,
         subtype: card.subtype,
         setting: { interType: 'system' },
-        wrap: { name: card.name, width: card.width || 24, bordered: 'true', tableType: 'checkbox', show: 'true' },
+        wrap: { name: card.name, 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: [],
@@ -74,7 +71,6 @@
           { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 },
         ],
         scripts: [],
-        btnlog: [],
         isNew: true
       }
 
@@ -124,17 +120,9 @@
         }
       }
 
-      if (appType === 'mob') {
-        _card.search = []
-        _card.action = _card.action.filter(a => !a.origin)
-      }
-
       this.updateComponent(_card)
     } else {
       let _card = fromJS(card).toJS()
-      if (appType === 'mob') {
-        _card.search = []
-      }
 
       this.setState({
         card: _card
@@ -144,7 +132,6 @@
 
   componentDidMount () {
     MKEmitter.addListener('submitModal', this.handleSave)
-    // MKEmitter.addListener('logButton', this.logButton)
     MKEmitter.addListener('completeSave', this.completeSave)
   }
 
@@ -160,7 +147,6 @@
       return
     }
     MKEmitter.removeListener('submitModal', this.handleSave)
-    // MKEmitter.removeListener('logButton', this.logButton)
     MKEmitter.removeListener('completeSave', this.completeSave)
   }
 
@@ -206,14 +192,9 @@
     if (!window.GLOB.styling || !card.errors) { // 鏍峰紡淇敼鏃朵笉鍋氱瓫鏌�
       card.errors = []
 
-      // let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
-      // if (supModule === 'empty') {
-      //   supModule = ''
-      // }
       let doubleClick = card.wrap.doubleClick || ''
   
       let columns = card.columns.map(c => c.field)
-      // let lowcols = card.columns.map(c => c.field.toLowerCase())
   
       if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) {
         card.errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'})
@@ -231,14 +212,6 @@
         if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
           if (!cell.modal || cell.modal.fields.length === 0) {
             card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`})
-          // } else {
-          //   cell.modal.fields.forEach(m => {
-          //     if (m.type === 'linkMain' && !supModule) {
-          //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
-          //     } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
-          //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟鈥�${m.label}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻})
-          //     }
-          //   })
           }
         }
         if (doubleClick === cell.uuid) {
@@ -252,14 +225,6 @@
             if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
               if (!cell.modal || cell.modal.fields.length === 0) {
                 card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟灏氭湭娣诲姞`})
-              // } else {
-              //   cell.modal.fields.forEach(m => {
-              //     if (m.type === 'linkMain' && !supModule) {
-              //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑鍏宠仈涓昏〃琛ㄥ崟鈥�${m.label}鈥濇棤鏁坄})
-              //     } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
-              //       card.errors.push({ level: 1, detail: `鎸夐挳鈥�${cell.label}鈥濅腑琛ㄥ崟鈥�${m.label}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻})
-              //     }
-              //   })
               }
             }
             if (doubleClick === cell.uuid) {
@@ -297,17 +262,6 @@
     
     this.props.updateConfig(_card)
   }
-
-  // logButton = (id, item) => {
-  //   const { card } = this.state
-
-  //   if (id !== card.uuid) return
-
-  //   let btnlog = card.btnlog || []
-  //   btnlog.push(item)
-
-  //   this.updateComponent({...card, btnlog})
-  // }
 
   changeStyle = () => {
     const { card } = this.state
@@ -385,13 +339,13 @@
   }
 
   setSubConfig = (item) => {
-    const { card, appType } = this.state
+    const { card } = this.state
     let btn = fromJS(item).toJS()
 
     if (btn.OpenType === 'pop' || btn.execMode === 'pop') {
       if (!btn.modal) {
         btn.modal = {
-          setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
+          setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
           tables: [],
           groups: [],
           fields: []
@@ -422,44 +376,6 @@
 
     this.updateComponent(card)
   }
-
-  // handleLog = (type, logs, item) => {
-  //   let card = fromJS(this.state.card).toJS()
-
-  //   if (type === 'revert') {
-  //     let done = false
-  //     if (item.$parentId) {
-  //       card.cols.forEach(col => {
-  //         if (col.type !== 'action') return
-  //         if (item.$parentId === col.uuid) {
-  //           col.elements = col.elements ? [...col.elements, item] : [item]
-  //           done = true
-  //         }
-  //       })
-  //     }
-
-  //     if (!done) {
-  //       card.action = card.action ? [...card.action, item] : [item]
-  //     }
-
-  //     card.btnlog = logs
-
-  //     this.updateComponent(card)
-  //     notification.success({
-  //       top: 92,
-  //       message: '鎭㈠鎴愬姛锛�',
-  //       duration: 2
-  //     })
-  //   } else {
-  //     card.btnlog = logs
-  //     this.updateComponent(card)
-  //     notification.success({
-  //       top: 92,
-  //       message: '娓呴櫎鎴愬姛锛�',
-  //       duration: 2
-  //     })
-  //   }
-  // }
 
   getWrapForms = () => {
     const { wrap, action, columns, cols } = this.state.card
@@ -499,13 +415,9 @@
   }
 
   render() {
-    const { card, appType } = this.state
+    const { card } = 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}>
@@ -513,7 +425,7 @@
         <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
           <div className="mk-popover-control">
             <PlusOutlined className="plus" title="娣诲姞鍒�" onClick={this.addColumns}/>
-            {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/> : null}
+            <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch}/>
             <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton}/>
             <NormalForm title="琛ㄦ牸璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
               <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/>
@@ -521,7 +433,6 @@
             <CopyComponent type="normaltable" card={card}/>
             <PasteComponent config={card} options={options} updateConfig={this.updateComponent} />
             <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/>
-            {/* <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> */}
             <UserComponent config={card}/>
             <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} />
             <SettingComponent config={card} updateConfig={this.updateComponent} />

--
Gitblit v1.8.0