From 53b9fb93d0376eb02bb996935f1720b4e95cd897 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 12 十月 2022 14:41:06 +0800
Subject: [PATCH] 2022-10-12

---
 src/menu/components/chart/antv-dashboard/index.jsx |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/menu/components/chart/antv-dashboard/index.jsx b/src/menu/components/chart/antv-dashboard/index.jsx
index a950a8f..2e5d021 100644
--- a/src/menu/components/chart/antv-dashboard/index.jsx
+++ b/src/menu/components/chart/antv-dashboard/index.jsx
@@ -8,7 +8,7 @@
 import MKEmitter from '@/utils/events.js'
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
-import { resetStyle } from '@/utils/utils-custom.js'
+import { resetStyle, getTables } from '@/utils/utils-custom.js'
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 import './index.scss'
@@ -158,7 +158,6 @@
 
   componentDidMount () {
     MKEmitter.addListener('tabsChange', this.handleTabsChange)
-    MKEmitter.addListener('submitStyle', this.getStyle)
 
     setTimeout(() => {
       this.viewrender()
@@ -177,7 +176,6 @@
       return
     }
     MKEmitter.removeListener('tabsChange', this.handleTabsChange)
-    MKEmitter.removeListener('submitStyle', this.getStyle)
   }
 
   handleTabsChange = (parentId) => {
@@ -496,6 +494,10 @@
     } else if (!card.setting.supModule) {
       card.errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'})
     }
+
+    if (card.errors.length === 0) {
+      card.$tables = getTables(card)
+    }
     
     if (!card.plot.valueField) {
       card.errors.push({ level: 0, detail: '鏄剧ず鍊煎皻鏈缃紒'})
@@ -512,15 +514,11 @@
   changeStyle = () => {
     const { card } = this.state
 
-    MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], card.style)
+    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle)
   }
 
-  getStyle = (comIds, style) => {
-    const { card } = this.state
-
-    if (comIds[0] !== card.uuid || comIds.length > 1) return
-
-    let _card = {...card, style}
+  getStyle = (style) => {
+    let _card = {...this.state.card, style}
 
     this.updateComponent(_card)
   }

--
Gitblit v1.8.0