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) {