From b69b5f6329ca5f87932436b7a6c1ddfc3377e10f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 16 五月 2024 10:56:41 +0800
Subject: [PATCH] 2024-05-16

---
 src/tabviews/custom/index.jsx |  409 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 304 insertions(+), 105 deletions(-)

diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 195ad72..b56749d 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -2,6 +2,7 @@
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
 import { notification, Spin, Row, Col, Modal } from 'antd'
+import moment from 'moment'
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
@@ -41,9 +42,11 @@
 const AntvX6 = asyncComponent(() => import('./components/chart/antv-X6'))
 const Voucher = asyncComponent(() => import('./components/module/voucher'))
 const Account = asyncComponent(() => import('./components/module/account'))
+const Invoice = asyncComponent(() => import('./components/module/invoice'))
 const Iframe = asyncComponent(() => import('./components/iframe'))
 const Calendar = asyncComponent(() => import('./components/calendar'))
 const DebugTable = asyncComponent(() => import('@/tabviews/debugtable'))
+const FlowFloat = asyncComponent(() => import('@/tabviews/zshare/flowFloat'))
 const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes'))
 const MkInterfaces = asyncComponent(() => import('@/tabviews/custom/components/interfaces'))
 
@@ -62,7 +65,6 @@
     viewlost: false,      // 椤甸潰涓㈠け锛�1銆佹湭鑾峰彇鍒伴厤缃�-椤甸潰涓㈠け锛�2銆侀〉闈㈡湭鍚敤
     lostmsg: '',          // 椤甸潰涓㈠け鏃剁殑鎻愮ず淇℃伅
     config: null,         // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷粍浠剁瓑
-    userConfig: null,     // 鐢ㄦ埛鑷畾涔夎缃�
     loading: false,       // 鍒楄〃鏁版嵁鍔犺浇涓�
     visible: false,       // 鏍囩椤垫帶鍒�
     shortcuts: null,      // 蹇嵎閿�
@@ -75,7 +77,7 @@
    * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅
    */
   async loadconfig () {
-    const { MenuID, MenuName } = this.props
+    const { MenuID, MenuName, param } = this.props
 
     let _param = {
       func: 'sPC_Get_LongParam',
@@ -133,13 +135,56 @@
         return
       }
 
+      if (config.process === 'true') {
+        let unset = true
+        if (result.works_flow_code && result.works_long_param) {
+          try { // 娴佺▼淇℃伅瑙f瀽
+            let flowConfig = JSON.parse(window.decodeURIComponent(window.atob(result.works_long_param)))
+            flowConfig.flow_code = result.works_flow_code
+            flowConfig.flow_name = result.works_flow_name
+            config.flow_code = result.works_flow_code
+            config.flow_name = result.works_flow_name
+            unset = false
+            
+            window.GLOB.UserCacheMap.set('flow' + MenuID, flowConfig)
+          } catch (e) {
+            unset = true
+            console.warn('Parse Failure')
+          }
+        }
+        
+        if (unset) {
+          config.interfaces = []
+          this.setState({
+            config: config,
+            viewlost: true,
+            loadingview: false,
+            lostmsg: '鎶辨瓑锛屾偍璁块棶鐨勯〉闈㈡湭璁剧疆宸ヤ綔娴侊紝璇疯仈绯荤鐞嗗憳銆�'
+          })
+          return
+        }
+      } else if (result.works_flow_code) {
+        Api.getSystemConfig({
+          func: 's_works_flow_param_sso_menu_upt_v6',
+          upt_type: 'del',
+          works_flow_code: '',
+          works_flow_name: '',
+          long_param: '',
+          flow_id: '',
+          menuid: config.MenuID,
+          menuname: config.MenuName,
+          username: sessionStorage.getItem('User_Name') || '',
+          fullName: sessionStorage.getItem('Full_Name') || ''
+        })
+      }
+
       // HS涓嶄娇鐢ㄨ嚜瀹氫箟璁剧疆
-      if (result.LongParamUser && !window.GLOB.mkHS) {
+      if (result.LongParamUser) {
         try { // 閰嶇疆淇℃伅瑙f瀽
           let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser)))
           if (userConfig) {
-            shortcuts = userConfig.action
-            userConfig.printers.forEach(item => {
+            shortcuts = userConfig.action || []
+            userConfig.printers && userConfig.printers.forEach(item => {
               window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item)
             })
           }
@@ -160,9 +205,18 @@
       let roleId = sessionStorage.getItem('role_id') || '' // 瑙掕壊ID
       let balMap = new Map()
       let skip = config.permission === 'false' || window.GLOB.mkHS
-      let param = this.props.param || {} // url鍙傛暟
+      let urlparam = {} // url鍙傛暟
+      if (param) {
+        Object.keys(param).forEach(key => {
+          if (/^\$/.test(key)) {
+            urlparam[key] = param[key]
+          } else {
+            urlparam[key.toLowerCase()] = param[key]
+          }
+        })
+      }
 
-      window.GLOB.CacheData.set(MenuID, param)
+      window.GLOB.CacheData.set(MenuID, urlparam)
 
       let userName = sessionStorage.getItem('User_Name') || ''
       let fullName = sessionStorage.getItem('Full_Name') || ''
@@ -180,7 +234,7 @@
       }
       if (config.urlFields) {
         config.urlFields.forEach(field => {
-          let val = `'${param[field] || ''}'`
+          let val = `'${urlparam[field.toLowerCase()] || ''}'`
           regs.push({
             reg: new RegExp('@' + field + '@', 'ig'),
             value: val
@@ -188,16 +242,29 @@
         })
       }
 
+      if (config.flow_code) {
+        regs.push({ reg: /@works_flow_code@/ig, value: `'${config.flow_code}'` })
+      }
+
       config.$cache = config.cacheLocal === 'true'
       config.$time = config.localCacheTime || 0
 
+      if (window.GLOB.systemType !== 'production' && result.modifydate) {
+        let s = (new Date().getTime() - new Date(result.modifydate).getTime()) / (1000 * 60 * 60)
+        if (!isNaN(s) && s < 2) {
+          config.$cache = false
+          config.$time = 0
+          config.cacheUseful = 'false'
+        }
+      }
+
       let initInters = []
 
-      config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters)
-      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID)
+      config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters, config.MenuName)
+      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, urlparam, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID, config.process === 'true')
 
       let params = []
-      let BID = param.$BID || ''
+      let BID = urlparam.$BID || ''
       let inherit = {}
 
       if (config.cacheUseful === 'true') { // 缂撳瓨缁ф壙
@@ -210,18 +277,6 @@
       config.components.forEach(component => {
         if (component.type !== 'search') return
 
-        if (param.$searchkey) {
-          component.search = component.search.map(item => {
-            if (['text', 'select', 'link'].includes(item.type) && param.$searchkey === item.field) {
-              item.initval = param.$searchval
-            }
-  
-            return item
-          })
-
-          component.$searches = Utils.initMainSearch(component.search)
-        }
-
         window.GLOB.SearchBox.set(MenuID, component.$searches)
 
         if (component.$s_req) {
@@ -231,7 +286,7 @@
 
       config.components = this.formatSetting(config.components, params, inherit, regs, balMap)
 
-      if ([...balMap.keys()].length > 0) {
+      if (balMap.size > 0) {
         config.components = this.filterBalcony(config.components, balMap)
       }
 
@@ -325,14 +380,32 @@
     }
   }
 
-  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId) => {
+  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId, process) => {
     return components.filter(item => {
       item.$pageId = pageId
-      item.$cache = cache
-      item.$time = time
       item.$searchId = searchId
       item.$syncId = syncId
       
+      if (process) {
+        item.$process = process
+        item.$flowId = 'flow' + this.props.MenuID
+      }
+
+      if (cache) {
+        item.$cache = cache
+        item.$time = time
+
+        if (item.wrap && item.wrap.cacheLocal === 'false') {
+          item.$cache = false
+        } else if (item.plot && item.plot.cacheLocal === 'false') {
+          item.$cache = false
+        }
+
+        if (!item.$cache && item.setting && item.setting.sync === 'true') {
+          item.setting.sync = 'false'
+        }
+      }
+
       if (item.style && item.style.boxShadow) {
         delete item.style.hShadow
         delete item.style.vShadow
@@ -377,6 +450,8 @@
             }
           }
 
+          tab.$menuname = (MenuName || '') + '-' + (tab.label || '')
+
           return true
         })
 
@@ -385,12 +460,7 @@
 
           if (item.setting.supModule === 'preview') {
             item.setting.supModule = ''
-            let val = ''
-            Object.keys(urlparam).forEach(key => {
-              if (key.toLowerCase() === item.setting.controlField) {
-                val = urlparam[key]
-              }
-            })
+            let val = urlparam[item.setting.controlField] || ''
 
             item.subtabs = item.subtabs.filter(tab => {
               if (tab.$pass) return true
@@ -403,12 +473,7 @@
         if (item.setting.selectField) {
           item.setting.selectField = item.setting.selectField.toLowerCase()
 
-          let val = ''
-          Object.keys(urlparam).forEach(key => {
-            if (key.toLowerCase() === item.setting.selectField) {
-              val = urlparam[key]
-            }
-          })
+          let val = urlparam[item.setting.selectField] || ''
 
           let activeKey = ''
 
@@ -432,7 +497,7 @@
             _searchId = tab.uuid
           }
 
-          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, _searchId, tab.uuid)
+          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, _searchId, tab.uuid, process)
           
           if (_searchId === tab.uuid) {
             tab.components.forEach(cell => {
@@ -456,7 +521,7 @@
           return false
         }
 
-        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId)
+        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, cache, time, MenuName, searchId, syncId, process)
 
         return true
       } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart', 'antvG6', 'antvX6'].includes(item.type)) {
@@ -479,7 +544,8 @@
           if (!inter) {
             item.wrap.datatype = 'static'
           } else {
-            item.setting = inter.setting
+            item.setting = {...inter.setting}
+            item.$searchId = inter.$searchId
           }
         }
       }
@@ -488,21 +554,47 @@
         item.type = 'card'
       }
 
-      // 鎼滅储鏉′欢鍒濆鍖�
-      if (item.search) {
-        Utils.initSearchVal(item)
-
-        item.$searches = Utils.initMainSearch(item.search)
-      }
-
-      if (item.wrap && item.wrap.supType === 'multi') { // 鏁版嵁鍗″涓婄骇缁勪欢
-        item.setting.supModule = item.supNodes[0].componentId
+      if (item.wrap && item.wrap.supType === 'multi') { // 鏁版嵁鍗°�乼able澶氫笂绾х粍浠�
+        item.supNodes = item.supNodes.map(node => node.componentId)
+        if (item.supNodes[0]) {
+          item.setting.supModule = item.supNodes[0]
+        } else {
+          item.supNodes = null
+          item.setting.supModule = ''
+        }
       } else if (item.setting && item.setting.supModule && typeof(item.setting.supModule) !== 'string') {
         let pid = item.setting.supModule.pop()
         if (pid && pid !== 'empty') {
           item.setting.supModule = pid
         } else {
           item.setting.supModule = ''
+        }
+      } else if (item.type === 'search') {
+        if (item.wrap.supModule) {
+          item.wrap.supModule = item.wrap.supModule.pop()
+        }
+      }
+
+      // 鎼滅储鏉′欢鍒濆鍖�
+      if (item.search) {
+        Utils.initSearchVal(item)
+
+        if (urlparam.$searchkey) {
+          item.search.forEach(cell => {
+            if (urlparam.$searchkey === cell.field.toLowerCase() && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) {
+              cell.initval = urlparam.$searchval
+            }
+          })
+        }
+
+        item.$searches = Utils.initMainSearch(item.search)
+
+        if (item.type === 'search' && item.wrap.supModule) {
+          if (!item.checkBid) {
+            item.wrap.supModule = ''
+          } else {
+            window.GLOB.SearchBox.set(item.$searchId + 'checkBid', true)
+          }
         }
       }
 
@@ -525,12 +617,11 @@
             cell = this.getPrinter(cell, item.uuid)
           }
 
-          return pass || permAction[cell.uuid]
+          return pass || permAction[cell.uuid] || cell.permission === 'false'
         })
       }
 
       if (item.type === 'table') {
-        let statFields = []
         let getCols = (cols) => {
           return cols.filter(col => {
             if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
@@ -541,10 +632,10 @@
               col.type = 'custom'
             }
             
-            if (col.type === 'number') {
-              if (col.sum === 'true' && !statFields.includes(col.field)) {
-                statFields.push(col)
-              }
+            if (col.type === 'index') {
+              col.field = '$Index'
+              col.type = 'text'
+            } else if (col.type === 'number') {
               if (typeof(col.decimal) === 'number') {
                 col.round = Math.pow(10, col.decimal)
                 if (col.format === 'percent') {
@@ -571,7 +662,7 @@
                     cell = this.getPrinter(cell, item.uuid)
                   }
 
-                  return pass || permAction[cell.uuid]
+                  return pass || permAction[cell.uuid] || cell.permission === 'false'
                 } else {
                   cell = this.resetElement(cell)
                 }
@@ -585,9 +676,13 @@
       
             if (col.linkmenu && col.linkmenu.length > 0) {
               let menu_id = col.linkmenu.pop()
-              col.linkThdMenu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menu_id)[0] || ''
+              col.linkThdMenu = window.GLOB.mkThdMenus.get(menu_id) || ''
             } else {
               col.linkThdMenu = ''
+            }
+
+            if (col.marks && col.marks.length === 0) {
+              col.marks = null
             }
 
             return true
@@ -595,7 +690,13 @@
         }
         
         item.cols = getCols(item.cols)
-        item.statFields = statFields
+
+        if (item.hasExtend) {
+          item.setting.hasExtend = true
+          item.setting.tableMode = 'compatible'
+          item.setting.extendTime = moment().format('YYYY-MM-DD HH:mm:ss')
+          item.colsCtrls = null
+        }
 
         if (item.subtype === 'editable') {
           item.submit.logLabel = item.$menuname + '-鎻愪氦'
@@ -631,7 +732,7 @@
               cell = this.resetElement(cell)
             }
 
-            return cell.eleType !== 'button' || pass || permAction[cell.uuid]
+            return cell.eleType !== 'button' || pass || permAction[cell.uuid] || cell.permission === 'false'
           })
 
           if (card.setting.click === 'menus') {
@@ -673,7 +774,7 @@
               cell = this.resetElement(cell)
             }
 
-            return cell.eleType !== 'button' || pass || permAction[cell.uuid]
+            return cell.eleType !== 'button' || pass || permAction[cell.uuid] || cell.permission === 'false'
           })
         })
       } else if (item.type === 'balcony') {
@@ -697,34 +798,22 @@
             cell = this.resetElement(cell)
           }
 
-          return cell.eleType !== 'button' || pass || permAction[cell.uuid]
+          return cell.eleType !== 'button' || pass || permAction[cell.uuid] || cell.permission === 'false'
         })
       } else if (item.type === 'form') {
         item.subcards = item.subcards.map(group => {
           group.subButton.uuid = group.uuid
-          group.subButton.$menuId = group.uuid
-          group.subButton.$MenuID = this.props.MenuID
-          // group.subButton.$forbid = true // 涓嶅0鏄庢暟鎹簮鍙橀噺
           group.subButton.OpenType = 'formSubmit'
           group.subButton.execError = 'never'
-          group.subButton.logLabel = item.$menuname + '-' + group.subButton.label
-
           if (!group.subButton.Ot) {
             group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl'
           }
 
-          if (item.$cache && item.$time) {
+          group.subButton = this.resetButton(item, group.subButton)
+
+          if (item.$cache && item.$time) { // 琛ㄥ崟缂撳瓨
             group.$cache = item.$cache
             group.$time = item.$time
-          }
-
-          group.subButton.syncComponentId = group.subButton.syncComponent ? (group.subButton.syncComponent.pop() || '') : ''
-
-          if (group.subButton.syncComponentId && group.subButton.syncComponentId === item.setting.supModule) {
-            group.subButton.syncComponentId = ''
-            if (group.subButton.execSuccess === 'grid') {
-              group.subButton.execSuccess = 'mainline'
-            }
           }
 
           group.fields = group.fields.map(cell => {
@@ -806,6 +895,11 @@
     cell.$MenuID = this.props.MenuID
     cell.$view = 'popview'
 
+    if (item.$process) {
+      cell.$process = true
+      cell.$flowId = 'flow' + this.props.MenuID
+    }
+
     if (cell.btnstyle) { // 鍏煎
       cell.style = cell.style || {}
       cell.style = {...cell.style, ...cell.btnstyle}
@@ -820,7 +914,7 @@
     }
 
     if (cell.OpenType === 'excelOut') { // 瀵煎嚭
-      cell.$menuName = item.name
+      cell.$menuName = item.$menuname
 
       if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) {
         cell.errorType = 'error1'
@@ -837,10 +931,46 @@
       cell.modal.uuid = cell.uuid + 'pop'
     }
 
+    if (cell.verify && cell.verify.invalid === 'true') {
+      if (item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public')) {
+        cell.verify.invalid = 'false'
+      } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) {
+        cell.verify.invalid = 'false'
+      } else if (cell.intertype !== 'system' && cell.procMode !== 'system') {
+        cell.verify.invalid = 'false'
+      } else if (cell.sqlType === 'insert') {
+        cell.verify.invalid = 'false'
+      } else if (cell.Ot === 'notRequired') {
+        cell.verify.invalid = 'false'
+      }
+    }
+
+    if (cell.verify && cell.verify.preHandle === 'true') {
+      let script = cell.verify.pre_func
+      if (!/#position-/.test(script) || /#position-init/.test(script)) {
+        try {
+          // eslint-disable-next-line
+          let func = new Function('btn', 'position', 'systemType', script)
+          func(cell, 'init', window.GLOB.systemType)
+        } catch (e) {
+          console.warn(e)
+        }
+      }
+      if (/#position-inner/.test(script)) {
+        cell.$innerScript = script
+      }
+      if (/#position-outer/.test(script)) {
+        cell.$outerScript = script
+      }
+      if (/#position-callback/.test(script)) {
+        cell.$callbackScript = script
+      }
+    }
+
     if (cell.syncComponentId) {
       if (cell.syncComponentId === item.setting.supModule) {
         cell.syncComponentId = ''
-        if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
+        if (['line', 'grid', 'line_grid'].includes(cell.execSuccess)) {
           cell.execSuccess = 'mainline'
         }
       } else if (cell.syncComponentId === 'multiComponent') {
@@ -848,8 +978,17 @@
           return m.syncComId.pop() || ''
         })
 
-        if (item.setting.supModule && ids.includes(item.setting.supModule)) {
-          if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') {
+        if (item.supNodes) {
+          item.supNodes.forEach(node => {
+            if (!ids.includes(node)) return
+
+            if (['line', 'grid', 'line_grid'].includes(cell.execSuccess)) {
+              cell.execSuccess = 'mainline'
+            }
+            ids = ids.filter(id => id !== node)
+          })
+        } else if (item.setting.supModule && ids.includes(item.setting.supModule)) {
+          if (['line', 'grid', 'line_grid'].includes(cell.execSuccess)) {
             cell.execSuccess = 'mainline'
           }
           ids = ids.filter(id => id !== item.setting.supModule)
@@ -868,6 +1007,26 @@
 
   resetElement = (cell) => {
     cell.style = cell.style || {}
+
+    if (cell.style.display === 'inline-block') {
+      cell.style.verticalAlign = 'top'
+    }
+
+    if (cell.marks && cell.marks.length === 0) {
+      cell.marks = null
+    }
+    if (cell.anchors && cell.anchors.length === 0) {
+      cell.anchors = null
+    }
+
+    if (cell.linkmenu && cell.linkmenu.length > 0) {
+      let menu_id = cell.linkmenu.pop()
+      cell.linkThdMenu = window.GLOB.mkThdMenus.get(menu_id) || ''
+      if (!cell.linkThdMenu) {
+        cell.link = ''
+      }
+    }
+
     if (['text', 'number', 'formula'].includes(cell.eleType)) {
       if (!cell.height) {
         cell.innerHeight = 'auto'
@@ -906,6 +1065,8 @@
   getPrinter = (item, parentId) => {
     let _item = window.GLOB.UserCacheMap.get(parentId + item.uuid)
 
+    item.verify.logLabel = item.logLabel
+
     if (_item) {
       item.printer = _item.printer || ''
       item.verify.defaultPrinter = _item.printer || ''
@@ -936,9 +1097,6 @@
         component.components = this.formatSetting(component.components, params, null, regs, balMap)
         return component
       } else if (component.wrap && component.wrap.datatype === 'public') {
-        component.setting.useMSearch = false
-        component.setting.sync = 'false'
-
         return component
       } else if (component.wrap && component.wrap.datatype === 'static') {
         component.format = ''
@@ -953,11 +1111,19 @@
 
       component.setting.arr_field = component.columns ? component.columns.map(col => col.field).join(',') : ''
       component.setting.useMSearch = component.setting.useMSearch === 'true'
+      component.setting.laypage = component.setting.laypage === 'true'   // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡
+      
       if (component.setting.useMSearch) {
         if (!window.GLOB.SearchBox.has(component.$searchId)) {
           component.setting.useMSearch = false
-        } else if (window.GLOB.SearchBox.has(component.$searchId + 'required')) {
-          component.$s_req = true
+        } else {
+          if (window.GLOB.SearchBox.has(component.$searchId + 'required')) {
+            component.$s_req = true
+          }
+          if (window.GLOB.SearchBox.has(component.$searchId + 'checkBid')) {
+            component.checkBid = true
+            component.setting.checkBid = true
+          }
         }
       }
 
@@ -965,9 +1131,14 @@
         component.setting.sync = 'false'
       }
 
+      if (component.format === 'object') {
+        component.setting.laypage = false
+        component.setting.$top = true
+      }
+
       if (component.setting.interType !== 'system') { // 涓嶄娇鐢ㄧ郴缁熷嚱鏁版椂
         component.setting.sync = 'false'
-        component.setting.laypage = component.setting.laypage === 'true'
+        component.setting.dataresource = ''
         return component
       }
 
@@ -988,8 +1159,7 @@
       delete component.scripts
       component.setting.$name = component.$menuname || ''
       component.setting.execute = component.setting.execute !== 'false'  // 榛樿sql鏄惁鎵ц锛岃浆涓篵oolean 缁熶竴鏍煎紡
-      component.setting.laypage = component.setting.laypage === 'true'   // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡
-
+      
       if (!component.setting.execute) {
         component.setting.dataresource = ''
       }
@@ -1017,6 +1187,10 @@
       component.setting.tailScript = _tailScript     // 鍚庣疆鑷畾涔夎剼鏈�
 
       component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript)
+
+      if (!component.setting.execute || component.setting.custompage) {
+        component.forbidLine = true
+      }
 
       if (component.setting.sync === 'true') {
         // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ
@@ -1066,7 +1240,7 @@
   }
 
   // 鏍煎紡鍖栭粯璁よ缃�
-  formatInterSetting = (inters, regs, MenuID, initInters) => {
+  formatInterSetting = (inters, regs, MenuID, initInters, MenuName) => {
     if (!inters) return []
 
     let initlimit = false
@@ -1085,6 +1259,7 @@
     return interfaces.map(inter => {
       inter.MenuID = MenuID
       inter.setting.delay = delay
+      inter.$searchId = MenuID
       delay += 15
 
       if (inter.setting.supModule) {
@@ -1095,11 +1270,14 @@
           inter.setting.supModule = ''
         }
       }
-
+      
       if (initlimit && inter.setting.loadlevel !== 'init') {
         inter.setting.onload = 'false'
       }
 
+      inter.setting.laypage = false
+      inter.setting.$top = true
+      inter.setting.useMSearch = inter.setting.useMSearch === 'true'
       inter.setting.arr_field = inter.columns.map(col => col.field).join(',')
 
       if (inter.setting.interType !== 'system') return inter
@@ -1120,9 +1298,8 @@
       })
       delete inter.scripts
 
-      inter.setting.$name = '鍏叡鏁版嵁婧�-' + inter.setting.name
+      inter.setting.$name = (MenuName || '') + '-鍏叡鏁版嵁婧�-' + inter.setting.name
       inter.setting.execute = inter.setting.execute !== 'false'
-      inter.setting.laypage = true
 
       if (!inter.setting.execute) {
         inter.setting.dataresource = ''
@@ -1214,6 +1391,10 @@
         MKEmitter.emit('transferSyncData', MenuID)
 
         if (!result.message) return
+
+        if (/灏嗘埅鏂瓧绗︿覆鎴栦簩杩涘埗鏁版嵁/ig.test(result.message)) {
+          result.message = result.message + '璇锋鏌ュ瓧娈甸泦'
+        }
         if (result.ErrCode === 'N') {
           Modal.error({
             title: result.message,
@@ -1483,9 +1664,7 @@
         )
       } else if (item.type === 'group' && item.subtype === 'normalgroup') {
         return (
-          <Col span={item.width} style={style} key={item.uuid}>
-            <NormalGroup config={item}/>
-          </Col>
+          <NormalGroup config={item} style={style} key={item.uuid}/>
         )
       } else if (item.type === 'editor') {
         return (
@@ -1541,6 +1720,12 @@
             <Account config={item}/>
           </Col>
         )
+      } else if (item.type === 'module' && item.subtype === 'invoice') {
+        return (
+          <Col span={item.width} style={style} key={item.uuid}>
+            <Invoice config={item}/>
+          </Col>
+        )
       } else if (item.type === 'iframe') {
         return (
           <Col span={item.width} style={style} key={item.uuid}>
@@ -1556,15 +1741,29 @@
   render() {
     const { loadingview, viewlost, config, loading, shortcuts, BID } = this.state
 
+    if (!config || viewlost) {
+      return (
+        <div className="custom-page-wrap">
+          {loadingview ? <Spin className="view-spin" size="large" /> : null}
+          {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
+          <div className="user-tools">
+            {config && config.process === 'true' ? <FlowFloat init={true} config={config}/> : null}
+          </div>
+        </div>
+      )
+    }
+
     return (
-      <div className={`custom-page-wrap ${config && config.minWidth ? 'mk-scroll' : ''} ${loadingview || loading ? 'loading' : ''} ${config && config.mask === 'false' ? 'mk-no-mask' : ''}`} id={this.state.ContainerId} style={config ? config.style : null}>
-        {(loadingview || (loading && !config.$cache)) ? <Spin className="view-spin" size="large" /> : null}
-        <Row id={config ? 'menu' + config.uuid : ''} style={config && config.minWidth ? {minWidth: config.minWidth} : null} className="component-wrap">{this.getComponents()}</Row>
-        {config && config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null}
-        {config && window.GLOB.breakpoint ? <DebugTable /> : null}
-        {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <TableNodes config={config} /> : null}
-        {!window.GLOB.mkHS && config ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null}
-        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
+      <div className={`custom-page-wrap ${config.minWidth ? 'mk-scroll' : ''} ${loading ? 'loading' : ''} ${config.mask === 'false' ? 'mk-no-mask' : ''}`} id={this.state.ContainerId} style={config.style}>
+        {loading && !config.$cache ? <Spin className="view-spin" size="large" /> : null}
+        <Row id={'menu' + config.uuid} style={{minWidth: config.minWidth || 'unset'}} className="component-wrap">{this.getComponents()}</Row>
+        {config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null}
+        {window.GLOB.breakpoint ? <DebugTable /> : null}
+        <div className="user-tools">
+          {config.process === 'true' ? <FlowFloat config={config}/> : null}
+          <SettingComponent config={config} shortcuts={shortcuts || []}/>
+          <TableNodes config={config} />
+        </div>
       </div>
     )
   }

--
Gitblit v1.8.0