From 74e5d38d9a0e94421ceceea37c4677e5b57364ba Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 14 十月 2022 00:33:18 +0800
Subject: [PATCH] 2022-10-14

---
 src/menu/components/table/edit-table/index.jsx |   34 +++++++---------------------------
 1 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx
index 26803be..fcddc30 100644
--- a/src/menu/components/table/edit-table/index.jsx
+++ b/src/menu/components/table/edit-table/index.jsx
@@ -6,7 +6,7 @@
 
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
-import { resetStyle } from '@/utils/utils-custom.js'
+import { resetStyle, getTables } from '@/utils/utils-custom.js'
 import MKEmitter from '@/utils/events.js'
 import getWrapForm from './options'
 import Utils from '@/utils/utils.js'
@@ -51,7 +51,6 @@
         format: 'array',    // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡
         pageable: true,     // 缁勪欢灞炴�� - 鏄惁鍙垎椤�
         switchable: false,  // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹�
-        dataName: card.dataName || '',
         width: card.width || 24,
         search: [],
         action: [],
@@ -68,7 +67,6 @@
           { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 },
         ],
         scripts: [],
-        btnlog: [],
         submit: {intertype: 'system', default: 'true', innerFunc: '', execSuccess: 'grid', execError: 'never', scripts: [], uniques: []},
         isNew: true
       }
@@ -167,14 +165,8 @@
 
     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 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: '鏈缃暟鎹簮锛�'})
@@ -187,19 +179,15 @@
       } else if (!card.setting.supModule) {
         card.errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'})
       }
+
+      if (card.errors.length === 0) {
+        card.$tables = getTables(card)
+      }
   
       card.action.forEach(cell => {
         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}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻})
-          //     }
-          //   })
           }
         }
       })
@@ -210,14 +198,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}鈥濆ぇ灏忓啓涓庡瓧娈甸泦涓嶄竴鑷碻})
-              //     }
-              //   })
               }
             }
           })
@@ -423,7 +403,7 @@
           <ToolOutlined />
         </Popover>
         <SearchComponent config={card} updatesearch={this.updateComponent}/>
-        <ActionComponent type="editable" config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
+        <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
         <ColumnComponent config={card} updatecolumn={this.updateComponent}/>
         <div className="component-name">
           <div className="center">

--
Gitblit v1.8.0