From 0aa2a69ff162f4b378424ebbebb8bec07f388867 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 14 Feb 2022 10:08:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF=E9=9B=86?= =?UTF-8?q?=E6=88=90=E6=8F=92=E4=BB=B6=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/custom-component/UserView.vue | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 74903dd566..a2f3bd3cd1 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -16,8 +16,15 @@ {{ $t('chart.chart_error_tips') }} + - +
@@ -82,10 +89,11 @@ import ChartComponentG2 from '@/views/chart/components/ChartComponentG2' import EditBarView from '@/components/canvas/components/Editor/EditBarView' import { customAttrTrans, customStyleTrans, recursionTransObj } from '@/components/canvas/utils/style' import ChartComponentS2 from '@/views/chart/components/ChartComponentS2' - +import { pluginTypes } from '@/api/chart/chart' +import PluginCom from '@/views/system/plugin/PluginCom' export default { name: 'UserView', - components: { ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 }, + components: { PluginCom, ChartComponentS2, EditBarView, ChartComponent, TableNormal, LabelNormal, DrillPath, ChartComponentG2 }, props: { element: { type: Object, @@ -108,6 +116,7 @@ export default { required: false, default: false }, + // eslint-disable-next-line vue/require-default-prop componentIndex: { type: Number, required: false @@ -153,7 +162,9 @@ export default { pre: null, preCanvasPanel: null, sourceCustomAttrStr: null, - sourceCustomStyleStr: null + sourceCustomStyleStr: null, + isPlugin: false, + plugins: [] } }, computed: { @@ -260,6 +271,7 @@ export default { }, watch: { + 'cfilters': { handler: function(val1, val2) { if (isChange(val1, val2) && !this.isFirstLoad) { @@ -320,6 +332,7 @@ export default { } }, 'chartType': function(newVal, oldVal) { + this.isPlugin = this.plugins.some(plugin => plugin.value === this.chart.type) if (newVal === 'map' && newVal !== oldVal) { this.initAreas() } @@ -334,6 +347,12 @@ export default { deep: true } }, + beforeCreate() { + pluginTypes().then(res => { + this.plugins = res.data + this.isPlugin = this.plugins.some(plugin => plugin.value === this.chart.type) + }) + }, created() { this.refId = uuid.v1 if (this.element && this.element.propValue && this.element.propValue.viewId) {