fix: 主页告警状态饼图颜色分布颜色绘制不一致

This commit is contained in:
TsMask
2024-01-31 20:07:37 +08:00
parent 61b0f56e36
commit 7b9f0781f4

View File

@@ -30,12 +30,11 @@ echarts.use([
LabelLayout,
]);
/**字典数据 */
/**用户性别字典 */
/**网元状态字典数据 */
let indexColor = ref<DictType[]>([
{ label: 'normal', value: 'normal', elTagType: '', elTagClass: '#91cc75' },
{ label: 'Normal', value: 'normal', elTagType: '', elTagClass: '#91cc75' },
{
label: 'abnormal',
label: 'Abnormal',
value: 'abnormal',
elTagType: '',
elTagClass: '#ee6666',
@@ -200,10 +199,7 @@ function fnGetList(one: boolean) {
orient: 'vertical',
left: 'left',
},
color: [
'' + indexColor.value[0]['elTagClass'],
'' + indexColor.value[1]['elTagClass'],
],
color: indexColor.value.map(item => item.elTagClass),
series: [
{
name: t('views.index.realNeStatus'),
@@ -303,15 +299,17 @@ function fnLocale() {
}
onMounted(() => {
getDict('index_status').then(res => {
if (res.length > 0) {
indexColor.value = res;
}
});
//console.log(indexColor)
fnLocale();
fnGetList(true);
timer = setInterval(() => fnGetList(false), 10000); // 每隔10秒执行一次
getDict('index_status')
.then(res => {
if (res.length > 0) {
indexColor.value = res;
}
})
.finally(() => {
fnLocale();
fnGetList(true);
timer = setInterval(() => fnGetList(false), 10000); // 每隔10秒执行一次
});
});
// 在组件卸载之前清除定时器
@@ -405,7 +403,6 @@ onBeforeUnmount(() => {
nfInfo.obj
}}</a-descriptions-item>
<template v-if="nfInfo.obj === 'OMC'">
<a-descriptions-item :label="t('views.index.versionNum')">{{
nfInfo.version
}}</a-descriptions-item>