From d5ce81026882ada34e5d49411be7c90ee96cc102 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 17 一月 2023 18:20:11 +0800
Subject: [PATCH] 2023-01-17

---
 src/tabviews/custom/index.jsx |   38 +++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 3a28d2d..39687e8 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -40,6 +40,7 @@
 const TimeLine = asyncComponent(() => import('./components/timeline/normal-timeline'))
 const AntvG6 = asyncComponent(() => import('./components/chart/antv-G6'))
 const Voucher = asyncComponent(() => import('./components/module/voucher'))
+const Account = asyncComponent(() => import('./components/module/account'))
 const Iframe = asyncComponent(() => import('./components/iframe'))
 const DebugTable = asyncComponent(() => import('@/tabviews/debugtable'))
 const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes'))
@@ -196,9 +197,10 @@
         popview = 'popview'
       }
 
-      config.interfaces = this.formatInterSetting(config.interfaces, regs)
+      config.$cache = config.cacheLocal === 'true'
 
-      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview)
+      config.interfaces = this.formatInterSetting(config.interfaces, regs)
+      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache)
       
       // 鑾峰彇涓绘悳绱㈡潯浠�
       let mainSearch = []
@@ -306,9 +308,10 @@
     }
   }
 
-  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview) => {
+  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache) => {
     return components.filter(item => {
       item.$pageId = pageId
+      item.$cache = cache
       
       if (item.style && item.style.boxShadow) {
         delete item.style.hShadow
@@ -392,7 +395,7 @@
         item.subtabs = item.subtabs.map(tab => {
           tab.$pageId = pageId
 
-          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview)
+          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
           return tab
         })
 
@@ -405,7 +408,7 @@
           return false
         }
 
-        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview)
+        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
 
         return true
       } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
@@ -838,6 +841,10 @@
 
       component.setting.useMSearch = component.setting.useMSearch === 'true'
 
+      if (component.wrap && component.wrap.goback === 'true') {
+        component.setting.sync = 'false'
+      }
+
       if (component.setting.interType !== 'system') { // 涓嶄娇鐢ㄧ郴缁熷嚱鏁版椂
         component.setting.sync = 'false'
         component.setting.laypage = component.setting.laypage === 'true'
@@ -983,7 +990,8 @@
    * @description 涓昏〃鏁版嵁鍔犺浇
    */ 
   loadmaindata = (params) => {
-    let param = getStructuredParams(params, this.state.config, this.state.BID || '')
+    const { config } = this.state
+    let param = getStructuredParams(params, config, this.state.BID || '')
 
     this.setState({loading: true, loadingview: false})
 
@@ -993,6 +1001,16 @@
         delete result.message
         delete result.ErrMesg
         delete result.ErrCode
+
+        if (config.$cache) {
+          params.forEach((item) => {
+            let _data = result[item.name] || ''
+            if (_data && !Array.isArray(_data)) {
+              _data = [_data]
+            }
+            Api.writeCacheConfig(item.uuid, _data)
+          })
+        }
 
         this.setState({
           data: result,
@@ -1272,6 +1290,12 @@
             <Voucher config={item}/>
           </Col>
         )
+      } else if (item.type === 'module' && item.subtype === 'account') {
+        return (
+          <Col span={item.width} style={style} key={item.uuid}>
+            <Account config={item}/>
+          </Col>
+        )
       } else if (item.type === 'iframe') {
         return (
           <Col span={item.width} style={style} key={item.uuid}>
@@ -1289,7 +1313,7 @@
 
     return (
       <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}
+        {(loadingview || (loading && !config.$cache)) ? <Spin className="view-spin" size="large" /> : null}
         <Row className="component-wrap">{this.getComponents()}</Row>
         {config && config.interfaces.length > 0 ? <MkInterfaces BID={BID} interfaces={config.interfaces}/> : null}
         {config && window.GLOB.breakpoint ? <DebugTable /> : null}

--
Gitblit v1.8.0