From e36eb1999794bd71e76482b92a0b0b20f49d0032 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 05 三月 2021 19:37:03 +0800
Subject: [PATCH] 2021-03-05

---
 src/menu/popview/index.jsx |   47 ++++++++++++++++-------------------------------
 1 files changed, 16 insertions(+), 31 deletions(-)

diff --git a/src/menu/popview/index.jsx b/src/menu/popview/index.jsx
index fbd6208..58cf8cb 100644
--- a/src/menu/popview/index.jsx
+++ b/src/menu/popview/index.jsx
@@ -42,12 +42,10 @@
     MenuType: '',
     MenuId: '',
     MenuNo: '',
-    tableFields: [],
     delButtons: [],
     activeKey: 'basedata',
     menuloading: false,
     oriConfig: null,
-    openEdition: '',
     config: null,
     customComponents: []
   }
@@ -153,11 +151,9 @@
       return
     }
 
-    let _config = fromJS(config).toJS()
-    delete _config.tableFields
     const _this = this
 
-    if (!is(fromJS(oriConfig), fromJS(_config))) {
+    if (!is(fromJS(oriConfig), fromJS(config))) {
       confirm({
         title: '閰嶇疆宸蹭慨鏀癸紝鏀惧純淇濆瓨鍚楋紵',
         content: '',
@@ -214,10 +210,11 @@
           config.Template = 'CustomPage'
         }
 
+        config.open_edition = result.open_edition || ''
+
         this.setState({
           oriConfig: config,
-          config: fromJS(config).toJS(),
-          openEdition: result.open_edition || '',
+          config: fromJS(config).toJS()
         })
 
         this.props.modifyCustomMenu(config)
@@ -332,7 +329,7 @@
 
   submitConfig = () => {
     const { btn } = this.props
-    const { openEdition, delButtons } = this.state
+    const { delButtons } = this.state
     let config = fromJS(this.state.config).toJS()
 
     if ((config.cacheUseful === 'true' && !config.cacheTime) || !config.MenuNo || !config.MenuName) {
@@ -355,31 +352,25 @@
         config.enabled = false
       }
 
-      let _config = fromJS(config).toJS()
-      delete _config.tableFields
-
       let _name = (btn.component.name ? btn.component.name + '-' : '') + btn.label
 
       let param = {
         func: 'sPC_ButtonParam_AddUpt',
         ParentID: btn.config.uuid,
-        MenuID: _config.uuid,
-        MenuNo: _config.MenuNo || '',
+        MenuID: config.uuid,
+        MenuNo: config.MenuNo || '',
         Template: 'CustomPage',
         MenuName: _name,
         PageParam: JSON.stringify({Template: 'CustomPage'}),
-        LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
-      }
-
-      if (openEdition) { // 鐗堟湰绠$悊
-        param.open_edition = openEdition
+        LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config))),
+        open_edition: config.open_edition
       }
 
       let btnParam = {             // 娣诲姞鑿滃崟鎸夐挳
         func: 'sPC_Button_AddUpt',
         Type: 60,                  // 娣诲姞鑿滃崟涓嬬殑鎸夐挳type涓�40锛屾寜閽笅鐨勬寜閽畉ype涓�60
-        ParentID: _config.uuid,
-        MenuNo: _config.MenuNo,
+        ParentID: config.uuid,
+        MenuNo: config.MenuNo,
         Template: 'CustomPage',
         PageParam: '',
         LongParam: '',
@@ -427,9 +418,10 @@
         if (!res) return
 
         if (res.status) {
+          config.open_edition = res.open_edition || ''
+
           this.setState({
-            oriConfig: fromJS(_config).toJS(),
-            openEdition: res.open_edition || ''
+            oriConfig: fromJS(config).toJS()
           })
 
           if (btnParam.LText) {
@@ -540,15 +532,8 @@
   /**
    * @description 鏇存柊甯哥敤琛ㄤ俊鎭紝蹇嵎娣诲姞鍚庢洿鏂伴厤缃俊鎭�
    */
-  updatetable = (config, fields) => {
-    const { tableFields } = this.state
-
-    config.tableFields = fields ? fields : tableFields
-
-    this.setState({
-      tableFields: fields ? fields : tableFields,
-      config
-    })
+  updatetable = (config) => {
+    this.setState({ config })
 
     this.props.modifyCustomMenu(config)
   }

--
Gitblit v1.8.0