From 27a03ffac131c044ac347b6236856bff2ee1e51f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 02 八月 2021 15:01:10 +0800
Subject: [PATCH] 2021-08-02

---
 src/tabviews/treepage/index.jsx                             |    5 +-
 src/utils/utils-datamanage.js                               |   20 +++++++---
 src/tabviews/custom/index.jsx                               |   18 +++++---
 src/tabviews/subtable/index.jsx                             |   13 ------
 src/tabviews/subtabtable/index.jsx                          |    9 ----
 src/tabviews/commontable/index.jsx                          |   13 ------
 src/tabviews/custom/components/table/normal-table/index.jsx |   12 ------
 src/tabviews/custom/components/card/data-card/index.jsx     |    4 --
 8 files changed, 31 insertions(+), 63 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index 763405f..fdaa284 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -90,6 +90,7 @@
         config.MenuID = this.props.MenuID
         config.MenuName = MenuName
         config.setting.MenuName = MenuName
+        config.setting.$name = MenuName
       } catch (e) {
         console.warn('Parse Failure')
         config = ''
@@ -665,10 +666,6 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType)
 
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = this.props.MenuName || ''
-    }
-
     let result = await Api.genericInterface(param)
 
     this.getStatFieldsValue()
@@ -725,10 +722,6 @@
 
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, id)
-
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = this.props.MenuName || ''
-    }
 
     let result = await Api.genericInterface(param)
     if (result.status) {
@@ -796,10 +789,6 @@
 
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType)
-
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = this.props.MenuName || ''
-    }
 
     Api.genericInterface(param).then(res => {
       if (res.status) {
diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index 9272285..3a65f13 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -382,10 +382,6 @@
     let _orderBy = config.setting.order || ''
     let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, pageIndex, config.setting.pageSize, BID, menuType, id)
 
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = config.name || ''
-    }
-
     let result = await Api.genericInterface(param)
     if (result.status) {
       let data = fromJS(this.state.data).toJS()
diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index 2c432a8..2c57e82 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -173,10 +173,6 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType)
 
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = config.name || ''
-    }
-
     let result = await Api.genericInterface(param)
     if (result.status) {
       MKEmitter.emit('resetSelectLine', config.uuid, '', '') // 骞挎挱鏁版嵁鍒囨崲
@@ -234,10 +230,6 @@
 
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType, id)
-
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = config.name || ''
-    }
 
     let result = await Api.genericInterface(param)
     if (result.status) {
@@ -317,10 +309,6 @@
 
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getStatQueryDataParams(setting, config.statFields, searches, _orderBy, BID, this.props.menuType)
-
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = config.name || ''
-    }
 
     Api.genericInterface(param).then(res => {
       if (res.status) {
diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 4b084e0..22c148f 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -281,6 +281,8 @@
         return
       }
 
+      item.MenuName = config.MenuName || ''
+
       inters.push(item)
     })
     
@@ -447,6 +449,8 @@
         delete item.style.shadowColor
       }
 
+      item.$menuname = this.props.MenuName + '-' + (item.name || '')
+
       if (item.type === 'tabs') {
         if (
           item.setting.blacklist && item.setting.blacklist.length > 0 &&
@@ -556,7 +560,7 @@
       let tabId = this.props.Tab ? this.props.Tab.uuid : '' // 寮圭獥鏍囩鎸夐挳Id
       if (item.action && item.action.length > 0) {
         item.action = item.action.filter(cell => {
-          cell.logLabel = item.name + '-' + cell.label
+          cell.logLabel = item.$menuname + '-' + cell.label
           cell.ContainerId = this.state.ContainerId
           cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
           cell.$menuId = item.uuid
@@ -589,7 +593,7 @@
 
           card.elements = card.elements.filter(cell => {
             if (cell.eleType === 'button') {
-              cell.logLabel = item.name + '-' + cell.label
+              cell.logLabel = item.$menuname + '-' + cell.label
               cell.Ot = 'requiredSgl'
               cell.ContainerId = this.state.ContainerId
               cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
@@ -612,7 +616,7 @@
           })
           card.backElements = card.backElements.filter(cell => {
             if (cell.eleType === 'button') {
-              cell.logLabel = item.name + '-' + cell.label
+              cell.logLabel = item.$menuname + '-' + cell.label
               cell.Ot = 'requiredSgl'
               cell.ContainerId = this.state.ContainerId
               cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
@@ -636,7 +640,7 @@
       } else if (item.type === 'balcony') {
         item.elements = item.elements.filter(cell => {
           if (cell.eleType === 'button') {
-            cell.logLabel = item.name + '-' + cell.label
+            cell.logLabel = item.$menuname + '-' + cell.label
             cell.ContainerId = this.state.ContainerId
             cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
             cell.$menuId = item.uuid
@@ -657,7 +661,7 @@
           let _hasheight = card.style.height && card.style.height !== 'auto'
           card.elements = card.elements.filter(cell => {
             if (cell.eleType === 'button') {
-              cell.logLabel = item.name + '-' + cell.label
+              cell.logLabel = item.$menuname + '-' + cell.label
               cell.Ot = 'requiredSgl'
               cell.ContainerId = this.state.ContainerId
               cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
@@ -683,7 +687,7 @@
         item.cols = item.cols.filter(col => {
           if (col.type !== 'action') return true
           col.elements = col.elements.filter(cell => {
-            cell.logLabel = item.name + '-' + cell.label
+            cell.logLabel = item.$menuname + '-' + cell.label
             cell.Ot = 'requiredSgl'
             cell.ContainerId = this.state.ContainerId
             cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
@@ -787,7 +791,7 @@
         }
       })
       delete component.scripts
-      component.setting.$name = component.name || ''
+      component.setting.$name = component.$menuname || ''
       component.setting.execute = component.setting.execute !== 'false'  // 榛樿sql鏄惁鎵ц锛岃浆涓篵oolean 缁熶竴鏍煎紡
       component.setting.laypage = component.setting.laypage === 'true'   // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡
 
diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index f917266..0a0b845 100644
--- a/src/tabviews/subtable/index.jsx
+++ b/src/tabviews/subtable/index.jsx
@@ -102,6 +102,7 @@
       try { // 閰嶇疆淇℃伅瑙f瀽
         config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
         config.setting.MenuName = Tab.label
+        config.setting.$name = Tab.label
       } catch (e) {
         console.warn('Parse Failure')
         config = ''
@@ -595,10 +596,6 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType)
 
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = this.props.Tab.label || ''
-    }
-
     let result = await Api.genericInterface(param)
 
     this.getStatFieldsValue(searches)
@@ -662,10 +659,6 @@
 
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType, id)
-
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = this.props.Tab.label || ''
-    }
 
     let result = await Api.genericInterface(param)
     if (result.status) {
@@ -736,10 +729,6 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getStatQueryDataParams(setting, statFields, searches, _orderBy, BID, this.props.menuType)
 
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = this.props.Tab.label || ''
-    }
-    
     Api.genericInterface(param).then(res => {
       if (res.status) {
         let _data = res.data[0]
diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx
index fdc900d..de85084 100644
--- a/src/tabviews/subtabtable/index.jsx
+++ b/src/tabviews/subtabtable/index.jsx
@@ -79,6 +79,7 @@
       try { // 閰嶇疆淇℃伅瑙f瀽
         config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
         config.setting.MenuName = Tab.label
+        config.setting.$name = Tab.label
       } catch (e) {
         console.warn('Parse Failure')
         config = ''
@@ -557,10 +558,6 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType)
 
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = this.props.Tab.label || ''
-    }
-
     let result = await Api.genericInterface(param)
 
     this.getStatFieldsValue(searches)
@@ -615,10 +612,6 @@
     let _orderBy = orderBy || setting.order
     let param = UtilsDM.getStatQueryDataParams(setting, statFields, searches, _orderBy, BID, this.props.menuType)
 
-    if (param.func === 'sPC_Get_TableData') {
-      param.menuname = this.props.Tab.label || ''
-    }
-    
     Api.genericInterface(param).then(res => {
       if (res.status) {
         let _data = res.data[0]
diff --git a/src/tabviews/treepage/index.jsx b/src/tabviews/treepage/index.jsx
index 835e4a3..6c49ffd 100644
--- a/src/tabviews/treepage/index.jsx
+++ b/src/tabviews/treepage/index.jsx
@@ -56,7 +56,7 @@
    * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅
    */
   async loadconfig () {
-    const { permAction, param } = this.props
+    const { permAction, param, MenuName } = this.props
 
     let _param = {
       func: 'sPC_Get_LongParam',
@@ -71,7 +71,8 @@
       try { // 閰嶇疆淇℃伅瑙f瀽
         config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam)))
         config.MenuID = this.props.MenuID
-        config.MenuName = this.props.MenuName
+        config.MenuName = MenuName
+        config.setting.$name = MenuName
       } catch (e) {
         console.warn('Parse Failure')
         config = ''
diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js
index 2584cd9..bfd8b07 100644
--- a/src/utils/utils-datamanage.js
+++ b/src/utils/utils-datamanage.js
@@ -189,8 +189,12 @@
 
     // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
     if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) {
-      _customScript &&  console.info(`${setting.$name ? `/*缁勪欢-${setting.$name} 鑷畾涔夎剼鏈�*/\n` : ''}${LText ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
-      LText &&  console.info(`${setting.$name ? `/*缁勪欢-${setting.$name} 鏁版嵁婧�*/\n` : ''}` + LText)
+      _customScript &&  console.info(`${setting.$name ? `/*${setting.$name} 鑷畾涔夎剼鏈�*/\n` : ''}${LText ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
+      LText &&  console.info(`${setting.$name ? `/*${setting.$name} 鏁版嵁婧�*/\n` : ''}` + LText)
+    }
+
+    if (setting.$name) {
+      param.menuname = setting.$name
     }
 
     param.custom_script = Utils.formatOptions(_customScript)
@@ -298,8 +302,12 @@
 
     // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
     if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) {
-      _customScript &&  console.info(`${setting.$name ? `/*缁勪欢-${setting.$name} 鑷畾涔夎剼鏈� 缁熻鏌ヨ*/\n` : ''}${LText ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
-      LText &&  console.info(`${setting.$name ? `/*缁勪欢-${setting.$name} 鏁版嵁婧� 缁熻鏌ヨ*/\n` : ''}` + LText)
+      _customScript &&  console.info(`${setting.$name ? `/*${setting.$name} 鑷畾涔夎剼鏈� 缁熻鏌ヨ*/\n` : ''}${LText ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
+      LText &&  console.info(`${setting.$name ? `/*${setting.$name} 鏁版嵁婧� 缁熻鏌ヨ*/\n` : ''}` + LText)
+    }
+
+    if (setting.$name) {
+      param.menuname = setting.$name
     }
     
     param.custom_script = Utils.formatOptions(_customScript)
@@ -626,8 +634,8 @@
 
   // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
   if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) {
-    _customScript &&  console.info(`${setting.$name ? `/*缁勪欢-${setting.$name} 鑷畾涔夎剼鏈�*/\n` : ''}${_dataresource ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
-    _dataresource &&  console.info(`${setting.$name ? `/*缁勪欢-${setting.$name} 鏁版嵁婧�*/\n` : ''}` + _dataresource)
+    _customScript &&  console.info(`${setting.$name ? `/*${setting.$name} 鑷畾涔夎剼鏈�*/\n` : ''}${_dataresource ? '' : '/*涓嶆墽琛岄粯璁ql*/\n'}${_customScript}`)
+    _dataresource &&  console.info(`${setting.$name ? `/*${setting.$name} 鏁版嵁婧�*/\n` : ''}` + _dataresource)
   }
 
   return {

--
Gitblit v1.8.0