From cdd5b449130ea4d7223fde4f414a11a7d0c33d6d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 三月 2024 17:52:16 +0800
Subject: [PATCH] 2024-03-07

---
 src/tabviews/custom/components/chart/antv-dashboard/index.jsx |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx
index e60f4cf..15cf833 100644
--- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx
@@ -3,7 +3,7 @@
 import { is, fromJS } from 'immutable'
 import { Chart, registerShape } from '@antv/g2'
 import { Spin, notification, Modal } from 'antd'
-import { DownloadOutlined } from '@ant-design/icons'
+// import { DownloadOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Api from '@/api'
@@ -91,7 +91,7 @@
         this.data = window.GLOB.SyncData.get(_config.dataName) || []
   
         if (_config.$cache) {
-          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS())
+          Api.writeCacheConfig(_config.uuid, fromJS(this.data).toJS(), BID)
         }
   
         _config.setting.sync = 'false'
@@ -120,7 +120,6 @@
     this.setState({
       config: _config,
       BID: BID || '',
-      arr_field: _config.columns.map(col => col.field).join(','),
       plot: _config.plot
     })
   }
@@ -169,12 +168,12 @@
   }
 
   initExec = () => {
-    const { config } = this.state
+    const { config, BID } = this.state
 
     if (config.$cache) {
       if (config.$time) {
         if (!this.loaded) {
-          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
+          Api.getLCacheConfig(config.uuid, config.$time, BID).then(res => {
             if (!res.valid && config.setting.onload === 'true') {
               setTimeout(() => {
                 this.loadData('init')
@@ -199,7 +198,7 @@
         }
       } else {
         if (!this.loaded) {
-          Api.getLCacheConfig(config.uuid, 0).then(res => {
+          Api.getLCacheConfig(config.uuid, 0, BID).then(res => {
             if (!res.data || this.loaded) return
     
             this.data = res.data
@@ -233,14 +232,14 @@
   }
 
   transferSyncData = (syncId) => {
-    const { config } = this.state
+    const { config, BID } = this.state
 
     if (config.$syncId !== syncId) return
 
     let _data = window.GLOB.SyncData.get(config.dataName) || []
 
     if (config.$cache) {
-      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS())
+      Api.writeCacheConfig(config.uuid, fromJS(_data).toJS(), BID)
     }
 
     if (config.subtype !== 'ratioboard') {
@@ -301,7 +300,7 @@
   }
 
   async loadData (type) {
-    const { config, arr_field, BID } = this.state
+    const { config, BID } = this.state
 
     if (config.setting.supModule && !BID) { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇�
       let _data = null
@@ -336,12 +335,12 @@
     }
 
     let _orderBy = config.setting.order || ''
-    let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, '', '', BID)
+    let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, '', '', BID)
 
     let result = await Api.genericInterface(param)
     if (result.status) {
       if (config.$cache && type === 'init') {
-        Api.writeCacheConfig(config.uuid, result.data || [])
+        Api.writeCacheConfig(config.uuid, result.data || [], BID)
       }
 
       this.loaded = true
@@ -351,7 +350,7 @@
         _data = result.data || []
       } else {
         _data = result.data && result.data[0] ? result.data && result.data[0] : {}
-        _data.value = _data.value[config.plot.valueField] || 0
+        _data.value = _data[config.plot.valueField] || 0
       }
 
       if (!is(fromJS(this.data), fromJS(_data))) {
@@ -732,7 +731,7 @@
         }
         <NormalHeader config={config} />
         <div className="canvas-wrap">
-          {config.plot.download === 'enable' && this.state.chart ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null}
+          {/* {config.plot.download === 'enable' && this.state.chart ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} */}
           <div className="canvas" id={this.state.chartId}></div>
         </div>
       </div>

--
Gitblit v1.8.0