feat: 根据网元显示特有菜单
This commit is contained in:
@@ -19,8 +19,8 @@ import { SizeType } from 'ant-design-vue/es/config-provider';
|
||||
import { listKPIData, getKPITitle } from '@/api/perfManage/goldTarget';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import useNeInfoStore from '@/store/modules/neinfo';
|
||||
import dayjs from 'dayjs';
|
||||
import useNeListStore from '@/store/modules/ne_list';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { generateColorRGBA } from '@/utils/generate-utils';
|
||||
import { LineSeriesOption } from 'echarts/charts';
|
||||
@@ -30,9 +30,7 @@ import { useDebounceFn } from '@vueuse/core';
|
||||
import { LineOutlined } from '@ant-design/icons-vue';
|
||||
import { TableColumnType } from 'ant-design-vue';
|
||||
const { t, currentLocale } = useI18n();
|
||||
//test
|
||||
|
||||
const neInfoStore = useNeInfoStore();
|
||||
const neListStore = useNeListStore();
|
||||
//日期快捷选择
|
||||
const ranges = ref([
|
||||
{
|
||||
@@ -72,12 +70,13 @@ const ALL_NE_TYPES = [
|
||||
'cbc',
|
||||
] as const;
|
||||
type AllChartType = (typeof ALL_NE_TYPES)[number] & string;
|
||||
console.log( neInfoStore.getNeCascaderOptions)
|
||||
// 在 ALL_NE_TYPES 定义之后添加 小写转大写
|
||||
const neTypeOptions = neInfoStore.getNeCascaderOptions.map(v => ({
|
||||
label: v.value,
|
||||
value: v.label,
|
||||
}));
|
||||
const neTypeOptions = neListStore.getNeCascaderOptions
|
||||
.filter(v => ALL_NE_TYPES.includes(v.value.toLowerCase()))
|
||||
.map(v => ({
|
||||
label: v.label,
|
||||
value: v.value.toLowerCase(),
|
||||
}));
|
||||
|
||||
// 使用 ref 来使 networkElementTypes 变为响应式,并使用 ALL_NE_TYPES 初始化
|
||||
const networkElementTypes = ref<AllChartType[]>([...ALL_NE_TYPES]);
|
||||
@@ -300,7 +299,7 @@ const chartStates: Record<
|
||||
> = Object.fromEntries(
|
||||
networkElementTypes.value.map(type => [type, createChartState(type)])
|
||||
) as Record<AllChartType, ReturnType<typeof createChartState>>;
|
||||
|
||||
|
||||
// 日期选择器状态
|
||||
const rangePicker = reactive({
|
||||
...(Object.fromEntries(
|
||||
@@ -821,7 +820,7 @@ const fetchKPITitle = async (type: AllChartType) => {
|
||||
return dayjs(Number(text)).format('YYYY-MM-DD HH:mm:ss');
|
||||
},
|
||||
},
|
||||
...res.data.map((item:any) => {
|
||||
...res.data.map((item: any) => {
|
||||
const kpiId = item.kpiId;
|
||||
// 如果没有现有的颜色,生成新的颜色
|
||||
if (!existingColors.has(kpiId)) {
|
||||
@@ -1032,7 +1031,6 @@ const themeObserver = new MutationObserver(() => {
|
||||
// 在 onMounted 中添加题观察器
|
||||
onMounted(async () => {
|
||||
ws.value = new WS();
|
||||
await neInfoStore.fnNelist();
|
||||
|
||||
// 从本地存储中读取选中的网元类型
|
||||
const savedSelectedNeTypes = localStorage.getItem('selectedNeTypes');
|
||||
@@ -1342,7 +1340,9 @@ const handleTabChange = async (activeKey: string, type: AllChartType) => {
|
||||
<a-tooltip placement="bottom">
|
||||
<template #title>
|
||||
<span>
|
||||
{{ t('views.perfManage.kpiOverView.totalValueTip') }}
|
||||
{{
|
||||
t('views.perfManage.kpiOverView.totalValueTip')
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<InfoCircleOutlined />
|
||||
@@ -1355,7 +1355,9 @@ const handleTabChange = async (activeKey: string, type: AllChartType) => {
|
||||
<a-tooltip placement="bottom">
|
||||
<template #title>
|
||||
<span>
|
||||
{{ t('views.perfManage.kpiOverView.avgValueTip') }}
|
||||
{{
|
||||
t('views.perfManage.kpiOverView.avgValueTip')
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<InfoCircleOutlined />
|
||||
@@ -1368,7 +1370,9 @@ const handleTabChange = async (activeKey: string, type: AllChartType) => {
|
||||
<a-tooltip placement="bottom">
|
||||
<template #title>
|
||||
<span>
|
||||
{{ t('views.perfManage.kpiOverView.maxValueTip') }}
|
||||
{{
|
||||
t('views.perfManage.kpiOverView.maxValueTip')
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<InfoCircleOutlined />
|
||||
@@ -1381,7 +1385,9 @@ const handleTabChange = async (activeKey: string, type: AllChartType) => {
|
||||
<a-tooltip placement="bottom">
|
||||
<template #title>
|
||||
<span>
|
||||
{{ t('views.perfManage.kpiOverView.minValueTip') }}
|
||||
{{
|
||||
t('views.perfManage.kpiOverView.minValueTip')
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<InfoCircleOutlined />
|
||||
|
||||
Reference in New Issue
Block a user