From 5ddd0a034df5affdbd94f15f5b6b4b71b2b8b66d Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Wed, 11 Aug 2021 18:32:10 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E4=BB=AA=E8=A1=A8=E6=9D=BF=E6=94=AF?=
=?UTF-8?q?=E6=8C=81=E8=A7=86=E5=9B=BE=E4=B8=8B=E9=92=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../canvas/custom-component/UserView.vue | 27 +++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue
index 1d61d5893e..390de3af56 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') }}
-
+
@@ -37,6 +37,7 @@ import { BASE_CHART_STRING } from '@/views/chart/chart/chart'
import eventBus from '@/components/canvas/utils/eventBus'
import { deepCopy } from '@/components/canvas/utils/utils'
import { getToken, getLinkToken } from '@/utils/auth'
+
export default {
name: 'UserView',
components: { ChartComponent, TableNormal, LabelNormal },
@@ -77,7 +78,8 @@ export default {
refId: null,
chart: BASE_CHART_STRING,
requestStatus: 'waiting',
- message: null
+ message: null,
+ drillClickDimensionList: []
}
},
computed: {
@@ -85,6 +87,7 @@ export default {
const filter = {}
filter.filter = this.element.filters
filter.linkageFilters = this.element.linkageFilters
+ filter.drill = this.drillClickDimensionList
return filter
},
filters() {
@@ -191,6 +194,10 @@ export default {
// 将视图传入echart组件
if (response.success) {
this.chart = response.data
+ this.chart.drillFields = this.chart.drillFields ? JSON.parse(this.chart.drillFields) : []
+ if (!response.data.drill) {
+ this.drillClickDimensionList.splice(this.drillClickDimensionList.length - 1, 1)
+ }
this.requestStatus = 'merging'
this.mergeStyle()
this.requestStatus = 'success'
@@ -225,6 +232,22 @@ export default {
tableChart.customAttr = JSON.stringify(tableChart.customAttr)
tableChart.customStyle = JSON.stringify(tableChart.customStyle)
eventBus.$emit('openChartDetailsDialog', { chart: this.chart, tableChart: tableChart })
+ },
+
+ chartClick(param) {
+ debugger
+ if (this.drillClickDimensionList.length < this.chart.drillFields.length - 1) {
+ this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList })
+ this.getData(this.element.propValue.viewId)
+ }
+ },
+
+ resetDrill() {
+ this.drillClickDimensionList = []
+ },
+ drillJump(index) {
+ this.drillClickDimensionList = this.drillClickDimensionList.slice(0, index)
+ this.getData(this.element.propValue.viewId)
}
}
}