From d0e8c7cb64d7d219f7cfec8bc87cf699b9cfe7b2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 08 十一月 2022 12:35:25 +0800
Subject: [PATCH] 2022-11-08

---
 src/templates/comtableconfig/updatetable/index.jsx |   39 +++++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/src/templates/comtableconfig/updatetable/index.jsx b/src/templates/comtableconfig/updatetable/index.jsx
index 9bac7bf..39b7c6c 100644
--- a/src/templates/comtableconfig/updatetable/index.jsx
+++ b/src/templates/comtableconfig/updatetable/index.jsx
@@ -20,6 +20,7 @@
   }
 
   state = {}
+  delButtons = []
 
   shouldComponentUpdate (nextProps, nextState) {
     return !is(fromJS(this.state), fromJS(nextState))
@@ -52,22 +53,19 @@
 
   execUpdate = (_resolve) => {
     const { config } = this.props
-
-    let uuid = config.uuid
-    let trail = md5(uuid).slice(-10) + 'mk'
-    uuid = uuid.replace(/.{12}$/, trail)
+    this.delButtons = []
 
     let _config = {
       version: 1.0,
-      uuid: uuid,
-      MenuID: uuid,
+      uuid: config.uuid,
+      MenuID: config.uuid,
       fstMenuId: config.fstMenuId,
       parentId: config.ParentId,
       Template: 'BaseTable',
       easyCode: config.easyCode,
       enabled: false,
-      MenuName: config.MenuName + '_new',
-      MenuNo: config.MenuNo + '_new',
+      MenuName: config.MenuName,
+      MenuNo: config.MenuNo,
       OpenType: 'newtab',
       tables: config.tables || [],
       urlFields: config.urlFields || [],
@@ -126,7 +124,7 @@
                 equalTab: n.equalTab && n.equalTab.length > 0 ? n.equalTab[0] : ''
               }
             ]}
-
+            this.delButtons.push(n.linkTab)
             oldtabs[n.uuid] = tab.components[0].uuid
 
             _tbs.push(tab.components[0])
@@ -688,13 +686,15 @@
       Api.getSystemConfig(param).then(res => {
         resolve(res)
       })
-    // }).then(res => { // 鍒犻櫎鍘熻彍鍗�
-    //   if (!res || !res.status) return res
+    }).then(res => { // 鍒犻櫎鍘熻彍鍗�
+      if (!res || !res.status) return res
 
-    //   return Api.getSystemConfig({
-    //     func: 'sPC_MainMenu_Del',
-    //     MenuID: this.props.config.uuid
-    //   })
+      if (this.delButtons.length === 0) return res
+
+      return Api.getSystemConfig({
+        func: 'sPC_MainMenu_Del',
+        MenuID: this.delButtons.join(',')
+      })
     }).then(res => {
       if (!res) return
 
@@ -714,9 +714,10 @@
 
         let _param = window.btoa(window.encodeURIComponent(JSON.stringify(urlparam)))
 
-        // window.history.replaceState(null, null, window.location.href.split('#')[0] + `#/tabledesign/${_param}`)
-        // window.location.reload()
-        window.open(`#/tabledesign/${_param}`)
+        setTimeout(() => {
+          window.history.replaceState(null, null, window.location.href.split('#')[0] + `#/tabledesign/${_param}`)
+          window.location.reload()
+        }, 2000)
       } else {
         notification.warning({
           top: 92,
@@ -968,6 +969,8 @@
       delete _btn.position
       delete _btn.linkTab
 
+      this.delButtons.push(btn.uuid)
+
       _btn.show = 'button'
 
       if (_btn.execSuccess === 'equaltab') {

--
Gitblit v1.8.0