From 9ba7aeaedc3e26a5ea40fb3ea3f3e273926b85a9 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 5 May 2021 23:48:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/custom-component/UserView.vue | 50 +++++++++++++------ frontend/src/views/panel/index.vue | 2 +- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index ce94a8d5b4..32cbf340f6 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -1,6 +1,14 @@ @@ -8,6 +16,8 @@ import { post } from '@/api/panel/panel' import ChartComponent from '@/views/chart/components/ChartComponent.vue' +import TableNormal from '@/views/chart/components/table/TableNormal' + import { mapState } from 'vuex' import { deepCopy } from '@/components/canvas/utils/utils' @@ -25,7 +35,7 @@ import { export default { name: 'UserView', - components: { ChartComponent }, + components: { ChartComponent, TableNormal }, props: { element: { type: Object @@ -63,17 +73,6 @@ export default { computed: mapState([ 'canvasStyleData' ]), - // computed: mapState({ - // canvasStyleData: function(state) { - // debugger - // // this.chart.viewFirst == false 优先使用仪表盘样式 - // if (!this.chart.viewFirst) { - // this.chart.customAttr = state.canvasStyleData.chart.customAttr - // this.chart.customStyle = state.canvasStyleData.chart.customStyle - // } - // } - // - // }), data() { return { chart: { @@ -97,7 +96,9 @@ export default { background: DEFAULT_BACKGROUND_COLOR }, customFilter: [] - } + }, + requestStatus: 'waiting', + message: null } }, created() { @@ -109,9 +110,23 @@ export default { methods: { getData(id) { if (id) { + this.requestStatus = 'waiting' + this.message = null post('/chart/view/getData/' + id, this.filter).then(response => { // 将视图传入echart组件 - this.chart = response.data + debugger + if (response.success) { + this.chart = response.data + this.requestStatus = 'success' + } else { + this.requestStatus = 'error' + this.message = response.massage + } + return true + }).catch(err => { + this.requestStatus = 'error' + this.message = err + return true }) } } @@ -128,4 +143,7 @@ export default { .chart-class{ height: 100%; } +.table-class{ + height: 100%; +} diff --git a/frontend/src/views/panel/index.vue b/frontend/src/views/panel/index.vue index cc2d25bc39..32ca274ad3 100644 --- a/frontend/src/views/panel/index.vue +++ b/frontend/src/views/panel/index.vue @@ -1,5 +1,5 @@