From e41a64966b7832baffe96c21d1ea77ef6adb2905 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 14 十月 2021 18:31:55 +0800
Subject: [PATCH] 2021-10-14

---
 src/tabviews/custom/index.jsx |  423 ++++++++++++++++++++++++++--------------------------
 1 files changed, 211 insertions(+), 212 deletions(-)

diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 7236e4d..420caa2 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -3,15 +3,13 @@
 import { connect } from 'react-redux'
 import { is, fromJS } from 'immutable'
 import { notification, Spin, Row, Col } from 'antd'
-import moment from 'moment'
-import md5 from 'md5'
 
 import Api from '@/api'
 import options from '@/store/options.js'
 import zhCN from '@/locales/zh-CN/main.js'
 import enUS from '@/locales/en-US/main.js'
 import Utils from '@/utils/utils.js'
-import UtilsDM from '@/utils/utils-datamanage.js'
+import UtilsDM, { getStructuredParams, getStructDefaultParam } from '@/utils/utils-datamanage.js'
 import asyncComponent from '@/utils/asyncComponent'
 import MKEmitter from '@/utils/events.js'
 import NotFount from '@/components/404'
@@ -26,17 +24,21 @@
 const DataCard = asyncComponent(() => import('./components/card/data-card'))
 const PropCard = asyncComponent(() => import('./components/card/prop-card'))
 const NormalForm = asyncComponent(() => import('./components/form/normal-form'))
+const TabForm = asyncComponent(() => import('./components/form/tab-form'))
 const CarouselDataCard = asyncComponent(() => import('./components/carousel/data-card'))
 const CarouselPropCard = asyncComponent(() => import('./components/carousel/prop-card'))
 const TableCard = asyncComponent(() => import('./components/card/table-card'))
 const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch'))
 const NormalTable = asyncComponent(() => import('./components/table/normal-table'))
+const EditTable = asyncComponent(() => import('./components/table/edit-table'))
 const NormalGroup = asyncComponent(() => import('./components/group/normal-group'))
 const BraftEditor = asyncComponent(() => import('./components/editor/braft-editor'))
 const SandBox = asyncComponent(() => import('./components/code/sand-box'))
 const NormalTree = asyncComponent(() => import('./components/tree/antd-tree'))
+const Balcony = asyncComponent(() => import('./components/card/balcony'))
 const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent'))
 const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
+const CustomChart = asyncComponent(() => import('./components/chart/custom-chart'))
 
 class CustomPage extends Component {
   static propTpyes = {
@@ -131,7 +133,9 @@
 
       // 鏉冮檺杩囨护
       let roleId = sessionStorage.getItem('role_id') || '' // 瑙掕壊ID
-      config.components = this.filterComponent(config.components, roleId, permAction, permMenus)
+      let balMap = new Map()
+      let skip = config.permission === 'false' || this.props.menuType === 'HS'
+      config.components = this.filterComponent(config.components, roleId, permAction, permMenus, balMap, skip)
       
       // 鑾峰彇涓绘悳绱㈡潯浠�
       let mainSearch = []
@@ -191,9 +195,11 @@
         })
       }
 
-      let isEmpty = mainSearch.filter(item => item.required && (!item.value || item.value.length === 0)).length > 0
+      config.components = this.formatSetting(config.components, params, mainSearch, inherit, regs, balMap)
 
-      config.components = this.formatSetting(config.components, params, mainSearch, inherit, regs, isEmpty)
+      if ([...balMap.keys()].length > 0) {
+        config.components = this.filterBalcony(config.components, balMap)
+      }
 
       this.setState({
         BID: BID,
@@ -284,6 +290,8 @@
         return
       }
 
+      item.MenuName = config.MenuName || ''
+
       inters.push(item)
     })
     
@@ -341,7 +349,7 @@
     })
 
     Api.directRequest(url, setting.method, param, setting.cross).then(res => {
-      if (typeof(res) !== 'object' || Array.isArray(res)) {
+      if (typeof(res) !== 'object') {
         let error = '鏈煡鐨勮繑鍥炵粨鏋滐紒'
 
         if (typeof(res) === 'string') {
@@ -356,6 +364,9 @@
 
         this.customCallbackRequest(_result, setting, inters)
       } else {
+        if (Array.isArray(res)) {
+          res = { data: res }
+        }
         res.mk_api_key = mkey
         this.customCallbackRequest(res, setting, inters)
       }
@@ -437,8 +448,18 @@
     })
   }
 
-  filterComponent = (components, roleId, permAction, permMenus) => {
+  filterComponent = (components, roleId, permAction, permMenus, balMap, skip) => {
     return components.filter(item => {
+      
+      if (item.style && item.style.boxShadow) {
+        delete item.style.hShadow
+        delete item.style.vShadow
+        delete item.style.shadowBlur
+        delete item.style.shadowColor
+      }
+
+      item.$menuname = this.props.MenuName + '-' + (item.name || '')
+
       if (item.type === 'tabs') {
         if (
           item.setting.blacklist && item.setting.blacklist.length > 0 &&
@@ -458,7 +479,7 @@
         })
 
         item.subtabs = item.subtabs.map(tab => {
-          tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus)
+          tab.components = this.filterComponent(tab.components, roleId, permAction, permMenus, balMap, skip)
           return tab
         })
 
@@ -481,8 +502,8 @@
           return false
         }
 
-        item.components = this.filterComponent(item.components, roleId, permAction, permMenus)
-      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter'].includes(item.type)) {
+        item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap, skip)
+      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
         if (
           item.plot.blacklist && item.plot.blacklist.length > 0 &&
           item.plot.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0
@@ -497,27 +518,24 @@
           return false
         }
       }
-      // 鎼滅储榛戝悕鍗曡繃婊�
+
+      // 鎼滅储鏉′欢鍒濆鍖�
       if (item.search && item.search.length > 0) {
-        item.search = item.search.map(cell => {
-          cell.oriInitval = cell.initval
-
-          if (!cell.blacklist || cell.blacklist.length === 0) return cell
-          if (cell.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
-            cell.Hide = 'true'
-          }
-
-          return item
-        })
+        item.search = Utils.initSearchVal(item.search)
       }
-      if (item.type === 'table' && item.subtype === 'normaltable') {
+
+      if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) {
         let statFields = []
         let getCols = (cols) => {
           return cols.filter(col => {
-            if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
-              return false
-            } else if (col.Hide === 'true') {
-              return false
+            if (item.subtype !== 'editable') {
+              if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
+                return false
+              } else if (col.Hide === 'true') {
+                return false
+              }
+            } else if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
+              col.Hide = 'true'
             }
             if (col.type === 'number' && col.sum === 'true' && !statFields.includes(col.field)) {
               statFields.push(col)
@@ -551,14 +569,14 @@
       }
 
       // 鏉冮檺杩囨护
-      let isHS = this.props.menuType === 'HS'
       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.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
           cell.$menuId = item.uuid
+          cell.$MenuID = this.props.MenuID
           cell.$tabId = tabId
           cell.$view = 'CustomPage'
 
@@ -571,26 +589,29 @@
             cell.style = {...cell.style, ...cell.btnstyle}
           }
 
-          return isHS || permAction[cell.uuid]
+          return skip || permAction[cell.uuid]
         })
       }
 
       if (item.type === 'card') {
-        item.subcards.forEach(card => {
+        item.subcards && item.subcards.forEach(card => {
           let _hasheight = card.style.height && card.style.height !== 'auto'
 
-          if (card.style.shadow) { // 鍗$墖闃村奖
-            card.style.boxShadow = '0 0 4px ' + card.style.shadow
-            delete card.style.shadow
+          if (card.style.boxShadow) {
+            delete card.style.hShadow
+            delete card.style.vShadow
+            delete card.style.shadowBlur
+            delete card.style.shadowColor
           }
 
           card.elements = card.elements.filter(cell => {
             if (cell.eleType === 'button') {
-              cell.logLabel = item.name + '-' + cell.label
-              cell.Ot = 'requiredSgl'
+              cell.logLabel = item.$menuname + '-' + cell.label
+              cell.Ot = cell.Ot || 'requiredSgl'
               cell.ContainerId = this.state.ContainerId
-              cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : ''
+              cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
               cell.$menuId = item.uuid
+              cell.$MenuID = this.props.MenuID
               cell.$tabId = tabId
               cell.$view = 'CustomPage'
 
@@ -605,15 +626,16 @@
               cell.innerHeight = 'auto'
             }
 
-            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
+            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
           })
           card.backElements = card.backElements.filter(cell => {
             if (cell.eleType === 'button') {
-              cell.logLabel = item.name + '-' + cell.label
-              cell.Ot = 'requiredSgl'
+              cell.logLabel = item.$menuname + '-' + cell.label
+              cell.Ot = cell.Ot || 'requiredSgl'
               cell.ContainerId = this.state.ContainerId
-              cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : ''
+              cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
               cell.$menuId = item.uuid
+              cell.$MenuID = this.props.MenuID
               cell.$tabId = tabId
               cell.$view = 'CustomPage'
 
@@ -627,26 +649,50 @@
             } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
               cell.innerHeight = 'auto'
             }
-            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
+            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
           })
         })
+      } else if (item.type === 'balcony') {
+        if (item.wrap.linkType === 'sync') {
+          item.wrap.syncModuleId = item.wrap.syncModule.pop()
+          balMap.set(item.wrap.syncModuleId, true)
+        }
+        item.elements = item.elements.filter(cell => {
+          if (cell.eleType === 'button') {
+            cell.logLabel = item.$menuname + '-' + cell.label
+            cell.ContainerId = this.state.ContainerId
+            cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
+            cell.$menuId = item.uuid
+            cell.$MenuID = this.props.MenuID
+            cell.$tabId = tabId
+            cell.$view = 'CustomPage'
+
+            if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃�
+              cell = this.getPrinter(cell, item.uuid)
+            }
+          } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) {
+            cell.innerHeight = 'auto'
+          }
+
+          return cell.eleType !== 'button' || skip || permAction[cell.uuid]
+        })
       } else if ((item.type === 'table' && item.subtype === 'tablecard') || item.type === 'carousel') {
-        item.subcards.forEach(card => {
+        item.subcards && item.subcards.forEach(card => {
           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.Ot = 'requiredSgl'
+              cell.logLabel = item.$menuname + '-' + cell.label
+              cell.Ot = cell.Ot || 'requiredSgl'
               cell.ContainerId = this.state.ContainerId
-              cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : ''
+              cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
               cell.$menuId = item.uuid
+              cell.$MenuID = this.props.MenuID
               cell.$tabId = tabId
               cell.$view = 'CustomPage'
 
               if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃�
                 cell = this.getPrinter(cell, item.uuid)
               }
-
               if (card.btnstyle) { // 鍏煎
                 card.style = card.style || {}
                 card.style = {...card.style, ...card.btnstyle}
@@ -654,18 +700,19 @@
             } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
               cell.innerHeight = 'auto'
             }
-            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
+            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
           })
         })
-      } else if (item.type === 'table' && item.subtype === 'normaltable') {
+      } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) {
         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.Ot = 'requiredSgl'
+            cell.logLabel = item.$menuname + '-' + cell.label
+            cell.Ot = cell.Ot || 'requiredSgl'
             cell.ContainerId = this.state.ContainerId
-            cell.syncComponentId = cell.syncComponent ? cell.syncComponent.pop() : ''
+            cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
             cell.$menuId = item.uuid
+            cell.$MenuID = this.props.MenuID
             cell.$tabId = tabId
             cell.$view = 'CustomPage'
 
@@ -678,10 +725,15 @@
               cell.style = {...cell.style, ...cell.btnstyle}
             }
 
-            return isHS || permAction[cell.uuid]
+            return skip || permAction[cell.uuid]
           })
           return col.elements.length !== 0
         })
+
+        if (item.subtype === 'editable') {
+          item.submit.logLabel = item.$menuname + '-鎻愪氦'
+          item.submit.$menuId = item.uuid
+        }
       } 
 
       if (item.setting && item.setting.supModule) {
@@ -696,6 +748,44 @@
         let index = item.action.findIndex((btn) => btn.uuid === item.wrap.doubleClick)
         if (index === -1) {
           item.wrap.doubleClick = ''
+        }
+      }
+      
+      return true
+    })
+  }
+
+  filterBalcony = (components, balMap) => {
+    return components.filter(item => {
+      if (item.type === 'tabs') {
+        item.subtabs = item.subtabs.map(tab => {
+          tab.components = this.filterBalcony(tab.components, balMap)
+          return tab
+        })
+      } else if (item.type === 'group') {
+        item.components = this.filterBalcony(item.components, balMap)
+      }
+
+      if (item.type === 'balcony' && item.wrap.linkType === 'sync') {
+        let conf = balMap.get(item.wrap.syncModuleId)
+
+        if (!conf || conf === true) {
+          return false
+        }
+        
+        item.syncConfig = {
+          uuid: conf.uuid,
+          wrap: conf.wrap,
+          setting: conf.setting,
+          columns: conf.columns
+        }
+
+        if (item.wrap.checkAll === 'show') {
+          if (conf.subtype === 'datacard' && conf.wrap.cardType !== 'checkbox') {
+            item.wrap.checkAll = 'hidden'
+          } else if (conf.subtype === 'normaltable' && conf.wrap.tableType !== 'checkbox') {
+            item.wrap.checkAll = 'hidden'
+          }
         }
       }
       
@@ -722,27 +812,34 @@
   }
 
   // 鏍煎紡鍖栭粯璁よ缃�
-  formatSetting = (components, params, mainSearch, inherit, regs, isEmpty) => {
+  formatSetting = (components, params, mainSearch, inherit, regs, balMap) => {
     return components.map(component => {
       if (component.type === 'tabs') {
         component.subtabs = component.subtabs.map(tab => {
-          tab.components = this.formatSetting(tab.components, [], [], inherit, regs)
+          tab.components = this.formatSetting(tab.components, null, null, inherit, regs, balMap)
           tab = {...tab, ...inherit}
           return tab
         })
         return component
       } else if (component.type === 'group') {
-        component.components = this.formatSetting(component.components, [], [], inherit, regs)
+        component.components = this.formatSetting(component.components, null, null, inherit, regs, balMap)
         component = {...component, ...inherit}
         return component
       }
 
-      if (['propcard', 'brafteditor', 'sandbox', 'stepform'].includes(component.subtype) && component.wrap.datatype === 'static') {
-        component.format = ''
+      if (component.setting) {
+        component.setting.useMSearch = component.setting.useMSearch === 'true'
+        component.setting.syncRefresh = (component.setting.useMSearch && component.setting.syncRefresh === 'true')
       }
 
-      if (!component.setting) return component // 涓嶄娇鐢ㄧ郴缁熷嚱鏁版椂
-      if (!component.format) return component  // 娌℃湁鍔ㄦ�佹暟鎹�  鏁版嵁鏍煎紡 array 鎴� object
+      if (component.wrap && component.wrap.datatype === 'static') {
+        component.format = ''
+        component.setting = component.setting || {}
+        component.setting.useMSearch = false
+        component.setting.syncRefresh = false
+      }
+
+      if (!component.setting || !component.format) return component  // 1銆佷笉浣跨敤绯荤粺鍑芥暟鏃讹紱2銆� 娌℃湁鍔ㄦ�佹暟鎹�  鏁版嵁鏍煎紡 array 鎴� object
       if (component.setting.interType !== 'system') { // 涓嶄娇鐢ㄧ郴缁熷嚱鏁版椂
         component.setting.sync = 'false'
         component.setting.laypage = component.setting.laypage === 'true'
@@ -758,7 +855,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 缁熶竴鏍煎紡
 
@@ -789,35 +886,33 @@
       // floor    缁勪欢鐨勫眰绾�
       // dataName 绯荤粺鐢熸垚鐨勬暟鎹簮鍚嶇О
       // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ
-      if (component.floor === 1 && component.dataName && (!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true' && component.setting.sync === 'true') {
-        if (isEmpty && component.setting.useMSearch === 'true') {
+      if (params && component.dataName && (!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true' && component.setting.sync === 'true') {
+        let searchlist = []
+        if (component.search && component.search.length > 0) {
+          searchlist = Utils.initMainSearch(component.search)
+        }
+        if (component.setting.useMSearch) {
+          let keys = searchlist.map(item => item.key)
+          mainSearch.forEach(item => {
+            if (!keys.includes(item.key)) {
+              searchlist.push(item)
+            }
+          })
+        }
+
+        if (searchlist.filter(item => item.required && item.value === '').length > 0) {
           component.setting.sync = 'false'
           component.setting.onload = 'false'
         } else {
-          let searchlist = []
-          if (component.search && component.search.length > 0) {
-            searchlist = Utils.initMainSearch(component.search)
-          }
-
-          let _empty = searchlist.filter(item => item.required && (!item.value || item.value.length === 0)).length > 0
-  
-          if (_empty) {
-            component.setting.sync = 'false'
-            component.setting.onload = 'false'
-          } else {
-            if (component.setting.useMSearch === 'true') {
-              let keys = searchlist.map(item => item.key)
-              mainSearch.forEach(item => {
-                if (!keys.includes(item.key)) {
-                  searchlist.push(item)
-                }
-              })
-            }
-            params.push(this.getDefaultParam(component, searchlist))
-          }
+          params.push(getStructDefaultParam(component, searchlist, params.length === 0))
         }
       } else if (component.floor === 1) {
         component.setting.sync = 'false'
+      }
+
+      if (balMap.has(component.uuid)) {
+        component.setting.$hasSyncModule = true
+        balMap.set(component.uuid, component)
       }
 
       return component
@@ -825,131 +920,10 @@
   }
 
   /**
-   * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼ sPC_Get_TableData 鐨勫弬鏁�
-   */
-  getDefaultParam = (component, searchlist) => {
-    const { columns, setting, dataName, format } = component
-
-    let arr_field = columns.map(col => col.field)
-    let _dataresource = setting.dataresource
-    let _customScript = setting.customScript
-
-    
-    if (setting.queryType === 'statistics' || _customScript) {
-      let allSearch = Utils.getAllSearchOptions(searchlist)
-      let regoptions = allSearch.map(item => {
-        return {
-          reg: new RegExp('@' + item.key + '@', 'ig'),
-          value: `'${item.value}'`
-        }
-      })
-
-      regoptions.forEach(item => {
-        if (_dataresource && setting.queryType === 'statistics') {
-          _dataresource = _dataresource.replace(item.reg, item.value)
-        }
-        _customScript = _customScript.replace(item.reg, item.value)
-      })
-    }
-
-    _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '')
-    _customScript = _customScript.replace(/@select\$|\$select@/ig, '')
-    _dataresource = _dataresource.replace(/\$sum@/ig, '/*')
-    _dataresource = _dataresource.replace(/@sum\$/ig, '*/')
-    _customScript = _customScript.replace(/\$sum@/ig, '/*')
-    _customScript = _customScript.replace(/@sum\$/ig, '*/')
-
-    let _search = ''
-    if (setting.queryType !== 'statistics' && _dataresource) {
-      _search = Utils.joinMainSearchkey(searchlist)
-      _search = _search ? 'where ' + _search : ''
-    }
-
-    if (setting.order && _dataresource) {
-      _dataresource = `select top 1000 ${arr_field.join(',')} from (select ${arr_field.join(',')} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows `
-    } else if (_dataresource) {
-      _dataresource = `select top 1000 ${arr_field.join(',')} from ${_dataresource} ${_search} `
-    }
-
-    // 娴嬭瘯绯荤粺鎵撳嵃鏌ヨ璇彞
-    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)
-    }
-
-    return {
-      name: dataName,
-      columns: columns,
-      par_tablename: '',
-      type: format === 'array' ? format : '',
-      primaryKey: setting.primaryKey || '',
-      foreign_key: '',
-      sql: _dataresource,
-      script: _customScript
-    }
-  }
-
-  /**
    * @description 涓昏〃鏁版嵁鍔犺浇
    */ 
   loadmaindata = (params) => {
-    const { config } = this.state
-    let LText_field = []
-    let diffUser = false
-    let userName = sessionStorage.getItem('User_Name') || ''
-    let fullName = sessionStorage.getItem('Full_Name') || ''
-    let city = sessionStorage.getItem('city') || ''
-
-    if (sessionStorage.getItem('isEditState') === 'true') {
-      userName = sessionStorage.getItem('CloudUserName') || ''
-      fullName = sessionStorage.getItem('CloudFullName') || ''
-    }
-    
-    let _LText = params.map((item, index) => {
-      let _script = item.script
-
-      if (index === 0) {
-        _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50)
-          select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @login_city='${city}'
-          ${_script}
-        `
-      }
-      if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) {
-        diffUser = true
-      }
-
-      item.columns.forEach(cell => {
-        LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`)
-      })
-      return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(item.sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort`
-    })
-
-    // 鎶婂ぇ鎺ュ彛sPC_Get_structured_data鐨刲text鎷嗘垚涓変唤锛岀涓�娈碉細@LText1锛岀浜屾@LText锛岀涓夋@LText2
-    let param = {
-      func: 'sPC_Get_structured_data',
-      LText: _LText.join(' union all '),
-      LText_field: LText_field.join(' union all '),
-      BID: this.state.BID || ''
-    }
-
-    let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText)
-
-    param.LText1 = LText1
-    param.LText = LText
-    param.LText2 = LText2
-    param.LText_field = Utils.formatOptions(param.LText_field)
-
-    if (config.cacheUseful === 'true') {
-      param.time_type = config.timeUnit
-      param.time_limit = config.cacheTime
-      if (diffUser) {
-        param.userid = sessionStorage.getItem('UserID')
-      }
-      param.data_md5 = md5(JSON.stringify(param))
-    }
-
-    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
+    let param = getStructuredParams(params, this.state.config, this.state.BID)
 
     this.setState({loading: true, loadingview: false})
 
@@ -1026,7 +1000,8 @@
       viewlost: false,      // 椤甸潰涓㈠け锛�1銆佹湭鑾峰彇鍒伴厤缃�-椤甸潰涓㈠け锛�2銆侀〉闈㈡湭鍚敤
       config: null,         // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷粍浠剁瓑
       loading: false,       // 鍒楄〃鏁版嵁鍔犺浇涓�
-      shortcuts: null
+      shortcuts: null,
+      data: ''
     }, () => {
       this.loadconfig()
     })
@@ -1074,22 +1049,28 @@
             <AntvDashboard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
-      } else if (item.type === 'form') {
+      } else if (item.type === 'form' && item.subtype === 'stepform') {
         return (
           <Col span={item.width} key={item.uuid}>
             <NormalForm config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
+      } else if (item.type === 'form' && item.subtype === 'tabform') {
+        return (
+          <Col span={item.width} key={item.uuid}>
+            <TabForm config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+          </Col>
+        )
       } else if (item.type === 'search') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <MainSearch config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} refreshdata={this.resetSearch} />
+            <MainSearch config={item} BID={BID} menuType={menuType} refreshdata={this.resetSearch} />
           </Col>
         )
       } else if (item.type === 'tabs') {
         return (
           <Col span={item.width} key={item.uuid}>
-            <AntvTabs config={item} mainSearch={mainSearch} />
+            <AntvTabs config={item} BID={BID} mainSearch={mainSearch} />
           </Col>
         )
       } else if (item.type === 'card' && item.subtype === 'datacard') {
@@ -1102,6 +1083,12 @@
         return (
           <Col span={item.width} key={item.uuid}>
             <PropCard config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+          </Col>
+        )
+      } else if (item.type === 'balcony') {
+        return (
+          <Col span={item.width} key={item.uuid}>
+            <Balcony config={item} data={data} BID={_bid} menuType={menuType} />
           </Col>
         )
       } else if (item.type === 'carousel' && item.subtype === 'datacard') {
@@ -1128,6 +1115,12 @@
             <NormalTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
+      } else if (item.type === 'table' && item.subtype === 'editable') {
+        return (
+          <Col span={item.width} key={item.uuid}>
+            <EditTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+          </Col>
+        )
       } else if (item.type === 'group' && item.subtype === 'normalgroup') {
         return (
           <Col span={item.width} key={item.uuid}>
@@ -1152,6 +1145,12 @@
             <SandBox config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
           </Col>
         )
+      } else if (item.type === 'chart') {
+        return (
+          <Col span={item.width} key={item.uuid}>
+            <CustomChart config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
+          </Col>
+        )
       } else {
         return null
       }
@@ -1166,7 +1165,7 @@
       <div className={'custom-page-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}>
         {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null}
         <Row>{this.getComponents()}</Row>
-        {menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
+        {menuType !== 'HS' && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
         {menuType !== 'HS' && shortcuts ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts} permAction={this.props.permAction}/> : null}
         {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
       </div>

--
Gitblit v1.8.0