From 3edd250c9bc2e393eda7acbfd681edb0bb90c164 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 30 May 2022 15:18:55 +0800 Subject: [PATCH 01/13] =?UTF-8?q?refactor:=20=E8=A7=86=E5=9B=BE=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=BF=AB=E9=80=9F=E5=88=A0=E9=99=A4=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/drag-item/ChartDragItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/chart/components/drag-item/ChartDragItem.vue b/frontend/src/views/chart/components/drag-item/ChartDragItem.vue index 0f77f73cb9..134968c658 100644 --- a/frontend/src/views/chart/components/drag-item/ChartDragItem.vue +++ b/frontend/src/views/chart/components/drag-item/ChartDragItem.vue @@ -272,6 +272,6 @@ export default { margin-left: 4px; color: #878d9f; position: absolute; - right: 25px; + right: 40px; } From fa49b2763edb002439af698f8d5bef32dbb0f08d Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 30 May 2022 17:08:37 +0800 Subject: [PATCH 02/13] =?UTF-8?q?refactor:=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E8=AE=BE=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/custom-component/UserView.vue | 25 ++++++++++++------- frontend/src/views/chart/view/ChartEdit.vue | 17 +++++++------ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index bb6b9fd515..53fc6f05ff 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -545,14 +545,7 @@ export default { // 将视图传入echart组件 if (response.success) { this.chart = response.data - if (this.isEdit) { - this.componentViewsData[this.chart.id] = { - 'title': this.chart.title, - 'render': this.chart.render, - 'type': this.chart.type, - 'isPlugin': this.chart.isPlugin - } - } + this.getDataOnly(response.data) this.chart['position'] = this.inTab ? 'tab' : 'panel' // 记录当前数据 this.panelViewDetailsInfo[id] = JSON.stringify(this.chart) @@ -609,7 +602,6 @@ export default { tableChart.customStyle = JSON.stringify(tableChart.customStyle) eventBus.$emit('openChartDetailsDialog', { chart: this.chart, tableChart: tableChart }) }, - chartClick(param) { if (this.drillClickDimensionList.length < this.chart.drillFields.length - 1) { (this.chart.type === 'map' || this.chart.type === 'buddle-map') && this.sendToChildren(param) @@ -863,6 +855,21 @@ export default { } this.mergeScale() } + }, + getDataOnly(sourceResponseData) { + if (this.isEdit) { + if ((this.filter.filter && this.filter.filter.length) || (this.filter.linkageFilters && this.filter.linkageFilters.length)) { + viewData(this.chart.id, this.panelInfo.id, { + filter: [], + drill: [], + queryFrom: 'panel' + }).then(response => { + this.componentViewsData[this.chart.id] = response.data + }) + } else { + this.componentViewsData[this.chart.id] = sourceResponseData + } + } } } } diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 4874cd3f03..4ca7b6734e 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -1191,7 +1191,7 @@ export default { return this.chartConfig ? this.chartConfig.propertyInner : null }, chartType() { - return this.chart.type + return this.chart ? this.chart.type : null }, panelInfo() { return this.$store.state.panel.panelInfo @@ -1199,7 +1199,8 @@ export default { ...mapState([ 'curComponent', 'panelViewEditInfo', - 'allViewRender' + 'allViewRender', + 'componentViewsData' ]) /* pluginRenderOptions() { const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || [] @@ -1238,6 +1239,9 @@ export default { } }, created() { + this.bindPluginEvent() + this.initFromPanel() + this.chartInit() const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) if (plugins) { this.loadPluginType() @@ -1253,9 +1257,6 @@ export default { } }, mounted() { - this.bindPluginEvent() - this.initFromPanel() - this.chartInit() }, activated() { }, @@ -1282,7 +1283,9 @@ export default { this.resetDrill() this.initFromPanel() this.getChart(this.param.id) - this.getData(this.param.id) + if (this.componentViewsData[this.param.id]) { + this.chart = this.componentViewsData[this.param.id] + } }, bindPluginEvent() { bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter) @@ -1599,7 +1602,7 @@ export default { const view = this.buildParam(true, 'chart', false, switchType) if (!view) return viewEditSave(this.panelInfo.id, view).then(() => { - this.getData(this.param.id) + // this.getData(this.param.id) bus.$emit('view-in-cache', { type: 'propChange', viewId: this.param.id }) }) }, From ea3fa03350056f82af2650fb697671a19488a866 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 30 May 2022 17:53:55 +0800 Subject: [PATCH 03/13] =?UTF-8?q?refactor:=20=E8=A7=86=E5=9B=BE=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=BF=AB=E9=80=9F=E5=88=A0=E9=99=A4=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/drag-item/ChartDragItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/chart/components/drag-item/ChartDragItem.vue b/frontend/src/views/chart/components/drag-item/ChartDragItem.vue index 134968c658..1f0343777d 100644 --- a/frontend/src/views/chart/components/drag-item/ChartDragItem.vue +++ b/frontend/src/views/chart/components/drag-item/ChartDragItem.vue @@ -257,7 +257,7 @@ export default { .item-span-style{ display: inline-block; - width: 100px; + width: 80px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; From fefa99da662acc07f832601a670cdd79e30f1276 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 30 May 2022 17:54:21 +0800 Subject: [PATCH 04/13] =?UTF-8?q?revert:=20=E6=81=A2=E5=A4=8D=E8=AF=AF?= =?UTF-8?q?=E5=88=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/component-style/XAxisSelectorAntV.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/chart/components/component-style/XAxisSelectorAntV.vue b/frontend/src/views/chart/components/component-style/XAxisSelectorAntV.vue index fc352ee843..ae1c84dee0 100644 --- a/frontend/src/views/chart/components/component-style/XAxisSelectorAntV.vue +++ b/frontend/src/views/chart/components/component-style/XAxisSelectorAntV.vue @@ -71,7 +71,7 @@ - + From 57a7d491db1a14b67a556dc2d36f8346b879bdb4 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 30 May 2022 18:01:31 +0800 Subject: [PATCH 05/13] =?UTF-8?q?fix:=20=E5=A4=8D=E5=88=B6=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=EF=BC=8C=E6=8C=87=E6=A0=87=E5=8D=A1=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml | 2 ++ frontend/src/views/chart/chart/gauge/gauge.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml b/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml index 7fc57a374f..68b45e2614 100644 --- a/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml +++ b/backend/src/main/java/io/dataease/ext/ExtChartViewMapper.xml @@ -365,6 +365,7 @@ custom_filter, drill_fields, SNAPSHOT, + senior, data_from) SELECT pv_copy.chart_view_id AS id, `name`, @@ -392,6 +393,7 @@ custom_filter, drill_fields, SNAPSHOT, + senior, data_from FROM ( SELECT panel_id, diff --git a/frontend/src/views/chart/chart/gauge/gauge.js b/frontend/src/views/chart/chart/gauge/gauge.js index 477d155d4d..9c45f7f8d7 100644 --- a/frontend/src/views/chart/chart/gauge/gauge.js +++ b/frontend/src/views/chart/chart/gauge/gauge.js @@ -130,7 +130,7 @@ export function baseGaugeOption(chart_option, chart, scale = 1) { } } } - console.log(chart_option.series[0]) + // console.log(chart_option.series[0]) // console.log(chart_option); componentStyle(chart_option, chart) return chart_option From 8c6731bd87f1b86e9df45bc146fa2c99e26563a7 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 30 May 2022 18:10:57 +0800 Subject: [PATCH 06/13] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeDrag/index.vue | 3 +++ .../canvas/components/Editor/index.vue | 16 ++++++++++++++++ .../canvas/custom-component/UserView.vue | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index bf683a80d9..98add1ebf9 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -751,6 +751,9 @@ export default { } return [null, null] }, + triggerPluginEdit(e) { + this.elementMouseDown(e) + }, // 元素触摸按下 elementTouchDown(e) { eventsFor = events.touch diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index e48d8a95fc..c5c50d1b3e 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -100,6 +100,7 @@ :h="getShapeStyleIntDeDrag(item.style,'height')" :canvas-style-data="canvasStyleData" @input="handleInput" + @trigger-plugin-edit="pluginEditHandler" /> @@ -1067,6 +1068,21 @@ export default { created() { }, methods: { + pluginEditHandler({ e, id }) { + let index = -1 + for (let i = 0; i < this.componentData.length; i++) { + const item = this.componentData[i] + const itemId = item.id + if (id === itemId) { + index = i + break + } + } + if (index >= 0) { + const _this = this + _this.$refs.deDragRef && _this.$refs.deDragRef[index] && _this.$refs.deDragRef[index].triggerPluginEdit && _this.$refs.deDragRef[index].triggerPluginEdit(e) + } + }, linkageActiveCheck(item) { return this.linkageSettingStatus && item === this.curLinkageView }, diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index e0643d2f80..ddb9b58a5b 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -36,6 +36,7 @@ class="chart-class" @onChartClick="chartClick" @onJumpClick="jumpClick" + @trigger-edit-click="pluginEditHandler" /> Date: Mon, 30 May 2022 18:35:01 +0800 Subject: [PATCH 07/13] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=8D=A1=EF=BC=8C=E6=97=B6=E9=97=B4=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=86=85=E8=BE=B9=E8=B7=9D=E8=AE=BE=E7=BD=AE=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/custom-component/component-list.js | 3 +-- frontend/src/views/chart/components/normal/LabelNormalText.vue | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/component-list.js b/frontend/src/components/canvas/custom-component/component-list.js index dc16d07ba3..ca788f5547 100644 --- a/frontend/src/components/canvas/custom-component/component-list.js +++ b/frontend/src/components/canvas/custom-component/component-list.js @@ -411,8 +411,7 @@ const list = [ verticalAlign: 'middle', borderStyle: 'solid', borderColor: '#000000', - time_margin: 0, - padding: 10 + time_margin: 0 }, formatInfo: { openMode: '0', diff --git a/frontend/src/views/chart/components/normal/LabelNormalText.vue b/frontend/src/views/chart/components/normal/LabelNormalText.vue index b60dc5ac2e..5da713827e 100644 --- a/frontend/src/views/chart/components/normal/LabelNormalText.vue +++ b/frontend/src/views/chart/components/normal/LabelNormalText.vue @@ -1,5 +1,5 @@