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