NEZ-2635 fix: 创建Metrics的chart时设置Thresholds选择颜色有误

This commit is contained in:
zhangyu
2023-03-06 16:04:52 +08:00
parent 66c8991149
commit 68d602385b
5 changed files with 15 additions and 5 deletions

View File

@@ -484,7 +484,7 @@
<el-row v-if="chartConfig.param.enable.thresholds && isThresholdConfig(chartConfig.type)">
<el-form-item
v-for="(item,index) in chartConfig.param.thresholds"
:key="item.color + '' + index"
:key="item.id + '' + index"
class="thresholds-item"
:prop="'param.thresholds.' + index + '.value'"
:rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}"
@@ -939,6 +939,7 @@ import publicConfig from '@/components/common/rightBox/chart/publicConfig'
import chartTypeShow from '@/components/common/rightBox/chart/chartTypeShow'
import VueTagsInput from '@johmun/vue-tags-input'
import draggable from 'vuedraggable'
import { s8 } from '@/components/common/js/common'
import { randomcolor, ColorReverse } from '@/components/common/js/radomcolor/randomcolor'
import { isSankey } from '@/components/chart/chart/tools'
@@ -1248,6 +1249,7 @@ export default {
},
addThresholds () {
this.chartConfig.param.thresholds.push({
id: s8(),
value: undefined,
color: randomcolor()
})