From 6f817bf3ae4e6f51f982c07b0713adb3caf9fac2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 02 二月 2023 17:14:16 +0800
Subject: [PATCH] 2023-02-02

---
 src/tabviews/custom/components/share/tabtransfer/index.jsx |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx
index 2df9942..aebf282 100644
--- a/src/tabviews/custom/components/share/tabtransfer/index.jsx
+++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -37,6 +37,7 @@
 const TimeLine = asyncComponent(() => import('@/tabviews/custom/components/timeline/normal-timeline'))
 const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart'))
 const MkBaseTable = asyncComponent(() => import('@/tabviews/custom/components/table/base-table'))
+const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6'))
 
 class TabTransfer extends Component {
   static propTpyes = {
@@ -123,14 +124,15 @@
    * @description 涓昏〃鏁版嵁鍔犺浇
    */ 
   loadmaindata = (params) => {
+    const { config } = this.props
     let BID = ''
-    let BData = window.GLOB.CacheData.get(this.props.config.$pageId)
+    let BData = window.GLOB.CacheData.get(config.$pageId)
 
     if (BData) {
       BID = BData.$BID || ''
     }
 
-    let param = getStructuredParams(params, this.props.config, BID)
+    let param = getStructuredParams(params, config, BID)
 
     Api.genericInterface(param).then(result => {
       if (result.status) {
@@ -138,6 +140,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
@@ -323,6 +335,12 @@
             <CustomChart config={item} data={data} mainSearch={mainSearch}/>
           </Col>
         )
+      } else if (item.type === 'antvG6') {
+        return (
+          <Col span={item.width} style={style} key={item.uuid}>
+            <AntvG6 config={item} data={data} mainSearch={mainSearch}/>
+          </Col>
+        )
       } else {
         return null
       }

--
Gitblit v1.8.0