From d9c7885c88909ef641f7374d7a9d7aef1caa15d9 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 12 Aug 2021 10:15:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BB=AA=E8=A1=A8=E6=9D=BF=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=A0=B9=E6=8D=AE=E4=B8=80=E4=B8=AA=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E5=A4=9A=E4=BA=8B=E4=BB=B6=E6=9D=A5?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=98=AF=E5=90=A6=E5=87=BA=E7=8E=B0=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=EF=BC=8C=E5=8D=95=E4=BA=8B=E4=BB=B6=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/custom-component/UserView.vue | 24 ++++++++++++++++--- .../views/chart/components/ChartComponent.vue | 4 ++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index f481795914..f0ef6e4f13 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -16,7 +16,7 @@ {{ $t('chart.chart_error_tips') }} - +
@@ -84,7 +84,8 @@ export default { requestStatus: 'waiting', message: null, drillClickDimensionList: [], - drillFilters: [] + drillFilters: [], + drillFields: [] } }, computed: { @@ -107,8 +108,23 @@ export default { console.log('linkageFilters:' + JSON.stringify(this.element.linkageFilters)) return JSON.parse(JSON.stringify(this.element.linkageFilters)) }, + trackMenu() { + const trackMenuInfo = [] + let linkageCount = 0 + this.chart.data.fields && this.chart.data.fields.forEach(item => { + const sourceInfo = this.chart.id + '#' + item.id + if (this.nowPanelTrackInfo[sourceInfo]) { + linkageCount++ + } + }) + linkageCount && trackMenuInfo.push('linkage') + this.drillFields.length && trackMenuInfo.push('drill') + console.log('trackMenuInfo' + JSON.stringify(trackMenuInfo)) + return trackMenuInfo + }, ...mapState([ - 'canvasStyleData' + 'canvasStyleData', + 'nowPanelTrackInfo' ]) }, @@ -200,10 +216,12 @@ export default { if (response.success) { this.chart = response.data this.chart.drillFields = this.chart.drillFields ? JSON.parse(this.chart.drillFields) : [] + debugger if (!response.data.drill) { this.drillClickDimensionList.splice(this.drillClickDimensionList.length - 1, 1) } this.drillFilters = JSON.parse(JSON.stringify(response.data.drillFilters)) + this.drillFields = JSON.parse(JSON.stringify(response.data.drillFields)) this.requestStatus = 'merging' this.mergeStyle() this.requestStatus = 'success' diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 6e91946a57..121fce342c 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -40,7 +40,7 @@ export default { type: Array, required: false, default: function() { - return ['drill', 'linkage'] + return ['drill'] } } }, @@ -97,7 +97,7 @@ export default { this.myChart.off('click') this.myChart.on('click', function(param) { that.pointParam = param - if (that.trackMenu.length === 1) { // 只有一个事件直接调用 + if (that.trackMenu.length < 2) { // 只有一个事件直接调用 that.trackClick(that.trackMenu[0]) } else { // 视图关联多个事件 that.trackBarStyle.left = param.event.offsetX + 'px'