refactor(视图): 快速计算占比切换至其他类型时重置数值格式

This commit is contained in:
junjun 2022-12-16 14:26:28 +08:00
parent a856e18215
commit 4b93aec122
2 changed files with 10 additions and 2 deletions

View File

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

View File

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