From ef41583187d989915bd2135c59f2c25eb4aa6202 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 25 Jul 2022 10:07:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/ChartComponentG2.vue | 20 ++++- .../chart/components/ChartComponentS2.vue | 20 ++++- .../component-style/TitleSelectorAntV.vue | 84 +++++++++++++++++-- .../component-style/dialog/RemarkEditor.vue | 72 ++++++++++++++++ .../chart/components/normal/LabelNormal.vue | 29 +++++-- .../components/normal/LabelNormalText.vue | 28 +++++-- 6 files changed, 224 insertions(+), 29 deletions(-) create mode 100644 frontend/src/views/chart/components/component-style/dialog/RemarkEditor.vue diff --git a/frontend/src/views/chart/components/ChartComponentG2.vue b/frontend/src/views/chart/components/ChartComponentG2.vue index 1c22f98532..447faf672e 100644 --- a/frontend/src/views/chart/components/ChartComponentG2.vue +++ b/frontend/src/views/chart/components/ChartComponentG2.vue @@ -2,7 +2,10 @@
-

{{ chart.title }}

+
+

{{ chart.title }}

+ +
@@ -12,7 +15,7 @@ import { baseLiquid } from '@/views/chart/chart/liquid/liquid' import { uuid } from 'vue-uuid' import ViewTrackBar from '@/components/canvas/components/Editor/ViewTrackBar' -import { hexColorToRGBA } from '@/views/chart/chart/util' +import { getRemark, hexColorToRGBA } from '@/views/chart/chart/util' import { baseBarOptionAntV, hBaseBarOptionAntV } from '@/views/chart/chart/bar/bar_antv' import { baseAreaOptionAntV, baseLineOptionAntV } from '@/views/chart/chart/line/line_antv' import { basePieOptionAntV, basePieRoseOptionAntV } from '@/views/chart/chart/pie/pie_antv' @@ -23,10 +26,11 @@ import { baseTreemapOptionAntV } from '@/views/chart/chart/treemap/treemap_antv' import { baseRadarOptionAntV } from '@/views/chart/chart/radar/radar_antv' import { baseWaterfallOptionAntV } from '@/views/chart/chart/waterfall/waterfall' import { baseWordCloudOptionAntV } from '@/views/chart/chart/wordCloud/word_cloud' +import TitleRemark from '@/views/chart/view/TitleRemark' export default { name: 'ChartComponentG2', - components: { ViewTrackBar }, + components: { TitleRemark, ViewTrackBar }, props: { chart: { type: Object, @@ -84,7 +88,11 @@ export default { title_show: true, antVRenderStatus: false, linkageActiveParam: null, - linkageActiveHistory: false + linkageActiveHistory: false, + remarkCfg: { + show: false, + content: '' + } } }, @@ -320,6 +328,7 @@ export default { this.borderRadius = (customStyle.background.borderRadius || 0) + 'px' } } + this.initRemark() }, calcHeightRightNow() { @@ -337,6 +346,9 @@ export default { setTimeout(() => { this.calcHeightRightNow() }, 100) + }, + initRemark() { + this.remarkCfg = getRemark(this.chart) } } } diff --git a/frontend/src/views/chart/components/ChartComponentS2.vue b/frontend/src/views/chart/components/ChartComponentS2.vue index 489f6b8f20..39426a84c6 100644 --- a/frontend/src/views/chart/components/ChartComponentS2.vue +++ b/frontend/src/views/chart/components/ChartComponentS2.vue @@ -2,7 +2,10 @@
-

{{ chart.title }}

+
+

{{ chart.title }}

+ +
@@ -34,12 +37,13 @@ + + diff --git a/frontend/src/views/chart/components/normal/LabelNormal.vue b/frontend/src/views/chart/components/normal/LabelNormal.vue index aa39b60651..f1707beeac 100644 --- a/frontend/src/views/chart/components/normal/LabelNormal.vue +++ b/frontend/src/views/chart/components/normal/LabelNormal.vue @@ -1,6 +1,11 @@