Merge branch 'dev-3.6' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.7

This commit is contained in:
zhangyu
2023-03-06 16:17:13 +08:00
7 changed files with 19 additions and 6 deletions

View File

@@ -628,7 +628,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'}"
@@ -1083,6 +1083,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'
@@ -1348,6 +1349,7 @@ export default {
},
addThresholds () {
this.chartConfig.param.thresholds.push({
id: s8(),
value: undefined,
color: randomcolor()
})

View File

@@ -129,7 +129,7 @@
<script>
import { fromRoute } from '@/components/common/js/constants'
import editRigthBox from '@/components/common/mixin/editRigthBox'
import { resetZIndex, getUUID } from '@/components/common/js/common'
import { resetZIndex, getUUID, s8 } from '@/components/common/js/common'
import selectPanel from '@/components/common/popBox/selectPanel'
import chartConfig from '@/components/common/rightBox/chart/chartConfig'
import otherChartConfig from '@/components/common/rightBox/chart/otherChartConfig'
@@ -377,7 +377,7 @@ export default {
valueMapping: false,
visibility: false
},
thresholds: [{ value: undefined, color: '#eeeeeeff' }],
thresholds: [{ id: s8(), value: undefined, color: '#eeeeeeff' }],
showHeader: this.editChart.param.showHeader,
visibility: {
varName: '',
@@ -536,6 +536,10 @@ export default {
}
if (obj.param && !obj.param.thresholds) {
obj.param.thresholds = []
} else if (obj.param && obj.param.thresholds) {
obj.param.thresholds.forEach(item => {
item.id = s8()
})
}
if (obj.groupId === -1) {
obj.groupId = ''

View File

@@ -398,7 +398,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'}"