From 0bc8a5a777bd4c19750cae955c8a8e250d1f429e Mon Sep 17 00:00:00 2001 From: junjun Date: Wed, 26 Oct 2022 22:42:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=94=AF=E6=8C=81=E5=8D=A0=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/util.js | 2 ++ .../views/chart/components/drag-item/QuotaExtItem.vue | 9 +++++++-- .../src/views/chart/components/drag-item/QuotaItem.vue | 9 +++++++-- frontend/src/views/chart/view/ChartEdit.vue | 10 +++++++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/chart/chart/util.js b/frontend/src/views/chart/chart/util.js index b5915a81da..a7bab92044 100644 --- a/frontend/src/views/chart/chart/util.js +++ b/frontend/src/views/chart/chart/util.js @@ -3218,3 +3218,5 @@ export function getRemark(chart) { } return remark } + +export const quotaViews = ['label', 'richTextView', 'text', 'gauge', 'liquid'] diff --git a/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue b/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue index cbdccb70cb..c094712188 100644 --- a/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue +++ b/frontend/src/views/chart/components/drag-item/QuotaExtItem.vue @@ -175,7 +175,10 @@ :disabled="disableEditCompare" :command="beforeQuickCalc('setting')" >{{ $t('chart.yoy_label') }}... - {{ $t('chart.percent') }} + {{ $t('chart.percent') }} @@ -242,6 +245,7 @@ import { getItemType, getOriginFieldName } from '@/views/chart/components/drag-i import FieldErrorTips from '@/views/chart/components/drag-item/components/FieldErrorTips' import bus from '@/utils/bus' import { formatterItem } from '@/views/chart/chart/formatter' +import { quotaViews } from '@/views/chart/chart/util' export default { name: 'QuotaExtItem', @@ -277,7 +281,8 @@ export default { compareItem: compareItem, disableEditCompare: false, tagType: 'success', - formatterItem: formatterItem + formatterItem: formatterItem, + quotaViews: quotaViews } }, watch: { diff --git a/frontend/src/views/chart/components/drag-item/QuotaItem.vue b/frontend/src/views/chart/components/drag-item/QuotaItem.vue index 5843e847e6..f063550610 100644 --- a/frontend/src/views/chart/components/drag-item/QuotaItem.vue +++ b/frontend/src/views/chart/components/drag-item/QuotaItem.vue @@ -175,7 +175,10 @@ :disabled="disableEditCompare" :command="beforeQuickCalc('setting')" >{{ $t('chart.yoy_label') }}... - {{ $t('chart.percent') }} + {{ $t('chart.percent') }} @@ -242,6 +245,7 @@ import { getItemType, getOriginFieldName } from '@/views/chart/components/drag-i import FieldErrorTips from '@/views/chart/components/drag-item/components/FieldErrorTips' import bus from '@/utils/bus' import { formatterItem } from '@/views/chart/chart/formatter' +import { quotaViews } from '@/views/chart/chart/util' export default { name: 'QuotaItem', @@ -277,7 +281,8 @@ export default { compareItem: compareItem, disableEditCompare: false, tagType: 'success', - formatterItem: formatterItem + formatterItem: formatterItem, + quotaViews: quotaViews } }, watch: { diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 209ca9232c..0ee0dc0012 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -1589,6 +1589,7 @@ import ScrollCfg from '@/views/chart/components/senior/ScrollCfg' import ChartFieldEdit from '@/views/chart/view/ChartFieldEdit' import CalcChartFieldEdit from '@/views/chart/view/CalcChartFieldEdit' import { equalsAny } from '@/utils/StringUtils' +import { quotaViews } from '@/views/chart/chart/util' export default { name: 'ChartEdit', @@ -1748,7 +1749,6 @@ export default { tabActive: 'data', currentAreaCode: '', showStackCustomSort: false - } }, computed: { @@ -2094,6 +2094,10 @@ export default { if (!ele.compareCalc) { ele.compareCalc = compareItem } + if (quotaViews.indexOf(view.type) > -1) { + ele.compareCalc = compareItem + ele.formatterCfg.type = 'auto' + } }) if (view.type === 'chart-mix') { view.yaxisExt.forEach(function(ele) { @@ -2121,6 +2125,10 @@ export default { if (!ele.compareCalc) { ele.compareCalc = compareItem } + if (quotaViews.indexOf(view.type) > -1) { + ele.compareCalc = compareItem + ele.formatterCfg.type = 'auto' + } }) } view.extStack.forEach(function(ele) {