From 7838dface216d62905d3cea4269b48990c245df3 Mon Sep 17 00:00:00 2001 From: junjie Date: Mon, 31 May 2021 16:20:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E3=80=81=E6=A0=B7=E5=BC=8F=E4=B8=AD=EF=BC=8C=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=94=BE=E5=88=B0=E5=A4=96=E9=9D=A2=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=88=99=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E5=B1=9E=E6=80=A7=E7=BC=96=E8=BE=91=EF=BC=9B=E5=A4=96?= =?UTF-8?q?=E4=BE=A7=E6=A0=87=E9=A2=98=E7=A7=BB=E5=85=A5=E5=88=B0=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component-style/LegendSelector.vue | 29 +++++++++++--- .../component-style/TitleSelector.vue | 40 +++++++++++++++---- .../component-style/XAxisSelector.vue | 31 +++++++++++--- .../component-style/YAxisSelector.vue | 31 +++++++++++--- .../components/shape-attr/LabelSelector.vue | 29 +++++++++++--- .../components/shape-attr/TooltipSelector.vue | 29 +++++++++++--- frontend/src/views/chart/view/ChartEdit.vue | 35 ++++++++-------- 7 files changed, 173 insertions(+), 51 deletions(-) diff --git a/frontend/src/views/chart/components/component-style/LegendSelector.vue b/frontend/src/views/chart/components/component-style/LegendSelector.vue index c5efed7e8d..476c4b5590 100644 --- a/frontend/src/views/chart/components/component-style/LegendSelector.vue +++ b/frontend/src/views/chart/components/component-style/LegendSelector.vue @@ -2,15 +2,16 @@
- - {{ $t('chart.show') }} - + + + - {{ $t('chart.legend') }} + + {{ $t('chart.legend') }} + +
@@ -80,7 +89,8 @@ export default { { name: this.$t('chart.line_symbol_roundRect'), value: 'roundRect' }, { name: this.$t('chart.line_symbol_triangle'), value: 'triangle' }, { name: this.$t('chart.line_symbol_diamond'), value: 'diamond' } - ] + ], + isSetting: false } }, watch: { @@ -116,6 +126,9 @@ export default { this.fontSize = arr }, changeLegendStyle() { + if (!this.legendForm.show) { + this.isSetting = false + } this.$emit('onLegendChange', this.legendForm) } } @@ -147,4 +160,10 @@ export default { .el-form-item{ margin-bottom: 6px; } + +.switch-style{ + position: absolute; + right: 10px; + margin-top: -4px; +} diff --git a/frontend/src/views/chart/components/component-style/TitleSelector.vue b/frontend/src/views/chart/components/component-style/TitleSelector.vue index 2b4424daf4..67938b87ea 100644 --- a/frontend/src/views/chart/components/component-style/TitleSelector.vue +++ b/frontend/src/views/chart/components/component-style/TitleSelector.vue @@ -2,14 +2,24 @@
- - {{ $t('chart.show') }} + + + + + @@ -39,7 +49,15 @@ - {{ $t('chart.title') }} + + {{ $t('chart.title') }} + +
@@ -59,7 +77,8 @@ export default { data() { return { titleForm: JSON.parse(JSON.stringify(DEFAULT_TITLE_STYLE)), - fontSize: [] + fontSize: [], + isSetting: false } }, watch: { @@ -76,13 +95,11 @@ export default { if (customStyle.text) { this.titleForm = customStyle.text } + this.titleForm.title = this.chart.title } } } }, - created() { - console.log(JSON.stringify(this.chart)) - }, mounted() { this.init() }, @@ -98,6 +115,9 @@ export default { this.fontSize = arr }, changeTitleStyle() { + if (!this.titleForm.show) { + this.isSetting = false + } this.$emit('onTextChange', this.titleForm) } } @@ -129,4 +149,10 @@ export default { .el-form-item{ margin-bottom: 6px; } + +.switch-style{ + position: absolute; + right: 10px; + margin-top: -4px; +} diff --git a/frontend/src/views/chart/components/component-style/XAxisSelector.vue b/frontend/src/views/chart/components/component-style/XAxisSelector.vue index c967201f7d..637f2355c6 100644 --- a/frontend/src/views/chart/components/component-style/XAxisSelector.vue +++ b/frontend/src/views/chart/components/component-style/XAxisSelector.vue @@ -2,15 +2,16 @@
- - {{ $t('chart.show') }} - + + + {{ $t('chart.text_pos_top') }} @@ -24,12 +25,20 @@ - + - {{ $t('chart.xAxis') }} + + {{ $t('chart.xAxis') }} + +
@@ -48,7 +57,8 @@ export default { }, data() { return { - axisForm: JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE)) + axisForm: JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE)), + isSetting: false } }, watch: { @@ -73,6 +83,9 @@ export default { }, methods: { changeXAxisStyle() { + if (!this.axisForm.show) { + this.isSetting = false + } this.$emit('onChangeXAxisForm', this.axisForm) } } @@ -104,4 +117,10 @@ export default { .el-form-item{ margin-bottom: 6px; } + +.switch-style{ + position: absolute; + right: 10px; + margin-top: -4px; +} diff --git a/frontend/src/views/chart/components/component-style/YAxisSelector.vue b/frontend/src/views/chart/components/component-style/YAxisSelector.vue index 8bfed38fa1..a986e78d86 100644 --- a/frontend/src/views/chart/components/component-style/YAxisSelector.vue +++ b/frontend/src/views/chart/components/component-style/YAxisSelector.vue @@ -2,15 +2,16 @@
- - {{ $t('chart.show') }} - + + + {{ $t('chart.text_pos_left') }} @@ -24,12 +25,20 @@ - + - {{ $t('chart.yAxis') }} + + {{ $t('chart.yAxis') }} + +
@@ -48,7 +57,8 @@ export default { }, data() { return { - axisForm: JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE)) + axisForm: JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE)), + isSetting: false } }, watch: { @@ -73,6 +83,9 @@ export default { }, methods: { changeYAxisStyle() { + if (!this.axisForm.show) { + this.isSetting = false + } this.$emit('onChangeYAxisForm', this.axisForm) } } @@ -104,4 +117,10 @@ export default { .el-form-item{ margin-bottom: 6px; } + +.switch-style{ + position: absolute; + right: 10px; + margin-top: -4px; +} diff --git a/frontend/src/views/chart/components/shape-attr/LabelSelector.vue b/frontend/src/views/chart/components/shape-attr/LabelSelector.vue index e9289037dc..b72b29c882 100644 --- a/frontend/src/views/chart/components/shape-attr/LabelSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/LabelSelector.vue @@ -2,15 +2,16 @@
- - {{ $t('chart.show') }} - + + + @@ -67,7 +68,15 @@ - {{ $t('chart.label') }} + + {{ $t('chart.label') }} + +
@@ -87,7 +96,8 @@ export default { data() { return { labelForm: JSON.parse(JSON.stringify(DEFAULT_LABEL)), - fontSize: [] + fontSize: [], + isSetting: false } }, watch: { @@ -123,6 +133,9 @@ export default { this.fontSize = arr }, changeLabelAttr() { + if (!this.labelForm.show) { + this.isSetting = false + } this.$emit('onLabelChange', this.labelForm) } } @@ -154,4 +167,10 @@ export default { .el-form-item{ margin-bottom: 6px; } + + .switch-style{ + position: absolute; + right: 10px; + margin-top: -4px; + } diff --git a/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue b/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue index 148a28aeb4..b509b7012f 100644 --- a/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue @@ -2,15 +2,16 @@
- - {{ $t('chart.show') }} - + + + {{ $t('chart.tooltip_item') }} @@ -54,7 +55,15 @@ - {{ $t('chart.tooltip') }} + + {{ $t('chart.tooltip') }} + +
@@ -74,7 +83,8 @@ export default { data() { return { tooltipForm: JSON.parse(JSON.stringify(DEFAULT_TOOLTIP)), - fontSize: [] + fontSize: [], + isSetting: false } }, watch: { @@ -110,6 +120,9 @@ export default { this.fontSize = arr }, changeTooltipAttr() { + if (!this.tooltipForm.show) { + this.isSetting = false + } this.$emit('onTooltipChange', this.tooltipForm) } } @@ -141,4 +154,10 @@ export default { .el-form-item{ margin-bottom: 6px; } + +.switch-style{ + position: absolute; + right: 10px; + margin-top: -4px; +} diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 4f48f557c8..5ae3dced7d 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -73,23 +73,23 @@ -
- - {{ $t('chart.title') }} - {{ $t('chart.confirm') }} - - - - - - -
+ + + + + + + + + + + + + + + + +
{{ $t('chart.chart_type') }} @@ -736,6 +736,7 @@ export default { onTextChange(val) { this.view.customStyle.text = val + this.view.title = val.title this.save() },