diff --git a/nezha-fronted/src/assets/css/components/page/dashboard/chartBox.scss b/nezha-fronted/src/assets/css/components/page/dashboard/chartBox.scss index a5514b755..81b25eb1d 100644 --- a/nezha-fronted/src/assets/css/components/page/dashboard/chartBox.scss +++ b/nezha-fronted/src/assets/css/components/page/dashboard/chartBox.scss @@ -149,5 +149,8 @@ .nz-icon{ color: $--color-text-regular; } + .activeLi .nz-icon { + color: $--color-primary; + } } diff --git a/nezha-fronted/src/components/common/js/common.js b/nezha-fronted/src/components/common/js/common.js index 5f6f569a5..2742f9a3a 100644 --- a/nezha-fronted/src/components/common/js/common.js +++ b/nezha-fronted/src/components/common/js/common.js @@ -16,6 +16,10 @@ export function getUUID () { return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4()) } +export function s8 () { + return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1) +} + export const chartCache = {} export function getChart (key) { diff --git a/nezha-fronted/src/components/common/nezhaColor.vue b/nezha-fronted/src/components/common/nezhaColor.vue index 515435a62..a571e0d77 100644 --- a/nezha-fronted/src/components/common/nezhaColor.vue +++ b/nezha-fronted/src/components/common/nezhaColor.vue @@ -19,7 +19,7 @@
-
{{item.name}}
+
{{item.name}}
diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index 4c5ada773..7ed1ac4f1 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -628,7 +628,7 @@ 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 = '' diff --git a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue index b0ccce0e6..9478b58bd 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue @@ -398,7 +398,7 @@