From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 27 八月 2023 18:37:36 +0800
Subject: [PATCH] 2023-08-27

---
 src/tabviews/commontable/index.jsx |   69 ++++++++++++++--------------------
 1 files changed, 29 insertions(+), 40 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index f9887fb..ab15b41 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -22,8 +22,6 @@
 const SubTable = asyncSpinComponent(() => import('@/tabviews/subtable'))
 const CardComponent = asyncSpinComponent(() => import('@/tabviews/zshare/cardcomponent'))
 const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent'))
-const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
-const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic'))
 const DebugTable = asyncComponent(() => import('@/tabviews/debugtable'))
 
 const { TabPane } = Tabs
@@ -47,7 +45,6 @@
     shortcuts: null,      // 蹇嵎閿�
     actions: null,        // 鎸夐挳闆�
     columns: null,        // 鏄剧ず鍒�
-    arr_field: '',        // 鏌ヨ瀛楁闆�
     setting: null,        // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑
     data: [],             // 鍒楄〃鏁版嵁闆�
     selectedData: [],     // 宸查�夎〃鏍兼暟鎹�
@@ -63,7 +60,6 @@
     statFields: [],       // 鍚堣瀛楁
     statFValue: [],       // 鍚堣鍊�
     absFields: [],        // 缁濆鍊煎瓧娈�
-    hasReqFields: false,
     autoMatic: null,
     visible: false
   }
@@ -117,7 +113,7 @@
       }
       
       // HS涓嶄娇鐢ㄨ嚜瀹氫箟璁剧疆
-      if (result.LongParamUser && !window.GLOB.mkHS) {
+      if (result.LongParamUser) {
         try { // 閰嶇疆淇℃伅瑙f瀽
           let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser)))
           if (userConfig && !userConfig.version) {
@@ -209,19 +205,13 @@
         chartId = config.charts[0] ? config.charts[0].uuid : ''
       }
 
-      config.search = Utils.initSearchVal(config.search)
+      Utils.initSearchVal(config)
 
       // 瀛楁閫忚鍙婂繀濉爣蹇�
-      let hasReqFields = false
       config.search = config.search.map(item => {
         if (['text', 'select', 'link'].includes(item.type) && param && param.$searchkey === item.field) {
           item.initval = param.$searchval
         }
-
-        if (item.required) {
-          hasReqFields = true
-        }
-
         return item
       })
 
@@ -263,10 +253,8 @@
         }
   
         if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
-          config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*')
-          config.setting.dataresource = config.setting.dataresource.replace(/@\$/ig, '*/')
-          config.setting.customScript = config.setting.customScript.replace(/\$@/ig, '/*')
-          config.setting.customScript = config.setting.customScript.replace(/@\$/ig, '*/')
+          config.setting.dataresource = config.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/')
+          config.setting.customScript = config.setting.customScript.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/')
         } else {
           config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '')
           config.setting.customScript = config.setting.customScript.replace(/@\$|\$@/ig, '')
@@ -274,11 +262,6 @@
 
         let userName = sessionStorage.getItem('User_Name') || ''
         let fullName = sessionStorage.getItem('Full_Name') || ''
-
-        if (sessionStorage.getItem('isEditState') === 'true') {
-          userName = sessionStorage.getItem('CloudUserName') || ''
-          fullName = sessionStorage.getItem('CloudFullName') || ''
-        }
 
         let regs = [
           { reg: /@userName@/ig, value: `'${userName}'` },
@@ -316,6 +299,16 @@
         item.$menuId = this.props.MenuID
         item.$old = true
         item.ContainerId = this.state.ContainerId
+
+        if (item.OpenType === 'excelOut') { // 瀵煎嚭
+          item.$menuName = MenuName
+    
+          if (!item.verify || !item.verify.columns || item.verify.columns.length === 0) {
+            item.errorType = 'error1'
+          } else if (item.intertype === 'system' && item.verify.dataType !== 'custom' && config.setting.interType !== 'system') {
+            item.errorType = 'error2'
+          }
+        }
 
         if (item.OpenType === 'funcbutton' && item.funcType === 'print' && item.verify) { // 鎵撳嵃鏈鸿缃�
           let _item = window.GLOB.UserCacheMap.get(this.props.MenuID + item.uuid)
@@ -454,7 +447,10 @@
         searchRatio: config.setting.searchRatio || '',
         searchLwidth: config.setting.searchLwidth,
         borderRadius: config.setting.borderRadius,
+        resetContrl: config.setting.resetContrl,
       }
+
+      config.setting.arr_field = _arrField.join(',')
 
       this.setState({
         pageSize: config.setting.pageSize || 10,
@@ -468,10 +464,8 @@
         setting: config.setting,
         actions: _actions,
         columns: _columns,
-        arr_field: _arrField.join(','),
         BID: param && param.$BID ? param.$BID : '',
-        search: Utils.initMainSearch(config.search),
-        hasReqFields
+        search: Utils.initMainSearch(config.search)
       }, () => {
         if (config.setting.onload !== 'false') { // 鍒濆鍖栧彲鍔犺浇
           this.loadData()
@@ -512,7 +506,6 @@
       let _shortcut = `${preKey}+${keyCode}`
 
       if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') {
-        window.debugger = false
         window.GLOB.breakpoint = false
         sessionStorage.removeItem('breakpoint')
         
@@ -539,14 +532,14 @@
 
   loadData = (id) => {
     const { MenuID } = this.props
-    const { setting, search, hasReqFields, ContainerId } = this.state
+    const { setting, search, config, ContainerId } = this.state
 
     this.setState({
       selectedData: []
     })
     MKEmitter.emit('changeTableLine', ContainerId, MenuID, '', '')
 
-    if (hasReqFields) {
+    if (config.$s_req) {
       let requireFields = search.filter(item => item.required && item.value === '')
 
       if (requireFields.length > 0) {
@@ -573,14 +566,14 @@
    * @description 涓昏〃鏁版嵁鍔犺浇
    */ 
   async loadmaindata (id) {
-    const { setting, arr_field, search, orderBy, BID, pageIndex, pageSize, absFields, autoMatic } = this.state
+    const { setting, search, orderBy, BID, pageIndex, pageSize, absFields, autoMatic } = this.state
 
     this.setState({
       loading: true
     })
 
     let _orderBy = orderBy || setting.order
-    let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID)
+    let param = UtilsDM.getQueryDataParams(setting, search, _orderBy, pageIndex, pageSize, BID)
 
     let result = await Api.genericInterface(param)
 
@@ -664,14 +657,14 @@
    * @description 鑾峰彇鍗曡鏁版嵁
    */ 
   async loadmainLinedata (id) {
-    const { setting, arr_field, search, orderBy, BID, pageIndex, pageSize, absFields } = this.state
+    const { setting, search, orderBy, BID, pageIndex, pageSize, absFields } = this.state
 
     this.setState({
       loading: true
     })
 
     let _orderBy = orderBy || setting.order
-    let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, id)
+    let param = UtilsDM.getQueryDataParams(setting, search, _orderBy, pageIndex, pageSize, BID, id)
 
     let result = await Api.genericInterface(param)
     if (result.status) {
@@ -863,16 +856,14 @@
    * @description 瀵煎嚭Excel鏃讹紝鑾峰彇椤甸潰鎼滅储鎺掑簭绛夊弬鏁�
    */
   queryModuleParam = (menuId, callback) => {
-    const { MenuName, MenuID } = this.props
-    const { arr_field, orderBy, search, setting} = this.state
+    const { MenuID } = this.props
+    const { orderBy, search, setting } = this.state
 
     if (MenuID !== menuId) return
 
     callback({
-      arr_field: arr_field,
       orderBy: orderBy || setting.order,
-      search: search,
-      menuName: MenuName
+      search: search
     })
   }
 
@@ -1005,12 +996,12 @@
 
   render() {
     const { MenuID } = this.props
-    const { BID, setting, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts, autoMatic } = this.state
+    const { BID, setting, pageSize, actions, columns, loadingview, viewlost, pickup, config, chartId, search, selectedData, shortcuts } = this.state
 
     return (
       <div className="commontable" id={this.state.ContainerId}>
         {loadingview ? <Spin size="large" /> : null}
-        {config.search && config.search.length ?
+        {config && config.search && config.search.length ?
           <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null
         }
         {setting && config.charts ? <Row className="chart-view" gutter={16}>
@@ -1143,8 +1134,6 @@
           </Tabs>))
         }
         {setting && window.GLOB.breakpoint ? <DebugTable /> : null}
-        {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null}
-        {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config}/> : null}
         {!window.GLOB.mkHS && setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null}
         {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
       </div>

--
Gitblit v1.8.0