调整后的黄金指标,首页状态颜色自定义

This commit is contained in:
lai
2023-12-08 19:19:06 +08:00
parent 3376d90b96
commit 51a190771d
3 changed files with 37 additions and 9 deletions

View File

@@ -14,6 +14,8 @@ import { PieChart } from 'echarts/charts';
import { LabelLayout } from 'echarts/features';
import { useRoute } from 'vue-router';
import useAppStore from '@/store/modules/app';
import useDictStore from '@/store/modules/dict';
const { getDict } = useDictStore();
const appStore = useAppStore();
const route = useRoute();
const { t } = useI18n();
@@ -28,6 +30,13 @@ echarts.use([
LabelLayout,
]);
/**字典数据 */
/**用户性别字典 */
let indexColor = ref<DictType[]>([
{ label: 'normal', value: 'normal', elTagType: '', elTagClass: '' },
{ label: 'abnormal', value: 'abnormal', elTagType: '', elTagClass: '' },
]);
/**表格字段列 */
//customRender(){} ----单元格处理
let tableColumns: ColumnsType = [
@@ -174,7 +183,10 @@ function fnGetList(one: boolean) {
orient: 'vertical',
left: 'left',
},
color: ['#91cc75', '#ee6666'],
color: [
'' + indexColor.value[0]['elTagClass'],
'' + indexColor.value[1]['elTagClass'],
],
series: [
{
name: t('views.index.realNeStatus'),
@@ -393,6 +405,12 @@ 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秒执行一次