Merge pull request #4114 from dataease/pr@dev@refactor_value_formatter

refactor(视图): 快速计算占比切换至其他类型时重置数值格式
This commit is contained in:
Junjun 2022-12-16 14:35:26 +08:00 committed by GitHub
commit 3ced575f63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -241,7 +241,7 @@
<script>
import { compareItem } from '@/views/chart/chart/compare'
import { getItemType, getOriginFieldName } from '@/views/chart/components/dragItem/utils'
import { getItemType, getOriginFieldName, resetValueFormatter } from '@/views/chart/components/dragItem/utils'
import FieldErrorTips from '@/views/chart/components/dragItem/components/FieldErrorTips'
import bus from '@/utils/bus'
import { formatterItem } from '@/views/chart/chart/formatter'
@ -383,10 +383,14 @@ export default {
quickCalc(param) {
switch (param.type) {
case 'none':
//
resetValueFormatter(this.item)
this.item.compareCalc.type = 'none'
this.$emit('onQuotaItemChange', this.item)
break
case 'setting':
//
resetValueFormatter(this.item)
this.editCompare()
break
case 'percent':

View File

@ -241,7 +241,7 @@
<script>
import { compareItem } from '@/views/chart/chart/compare'
import { getItemType, getOriginFieldName } from '@/views/chart/components/dragItem/utils'
import { getItemType, getOriginFieldName, resetValueFormatter } from '@/views/chart/components/dragItem/utils'
import FieldErrorTips from '@/views/chart/components/dragItem/components/FieldErrorTips'
import bus from '@/utils/bus'
import { formatterItem } from '@/views/chart/chart/formatter'
@ -380,10 +380,14 @@ export default {
quickCalc(param) {
switch (param.type) {
case 'none':
//
resetValueFormatter(this.item)
this.item.compareCalc.type = 'none'
this.$emit('onQuotaItemChange', this.item)
break
case 'setting':
//
resetValueFormatter(this.item)
this.editCompare()
break
case 'percent':