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) {