From a13e65b39bcb814b58569501e4203731b76d602c Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Wed, 18 Oct 2023 10:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=80=A7=E8=83=BD=E6=B5=8B?= =?UTF-8?q?=E9=87=8F=E9=9B=86=E7=9A=84=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/neinfo.ts | 16 ++++++++++++++++ src/store/modules/user.ts | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/store/modules/neinfo.ts b/src/store/modules/neinfo.ts index 1d02fa5f..30d67b3c 100644 --- a/src/store/modules/neinfo.ts +++ b/src/store/modules/neinfo.ts @@ -3,6 +3,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { getNelistAll } from '@/api/configManage/neManage'; import { parseDataToOptions } from '@/utils/parse-tree-utils'; import { getNeTraceInterfaceAll } from '@/api/traceManage/task'; +import { getNePerformanceList } from '@/api/perfManage/taskManage'; /**网元信息类型 */ type NeInfo = { @@ -14,6 +15,8 @@ type NeInfo = { neSelectOtions: Record[]; /**跟踪接口列表 */ traceInterfaceList: Record[]; + /**性能测量数据集 */ + perMeasurementList: Record[]; }; const useNeInfoStore = defineStore('neinfo', { @@ -22,6 +25,7 @@ const useNeInfoStore = defineStore('neinfo', { neCascaderOtions: [], neSelectOtions: [], traceInterfaceList: [], + perMeasurementList: [], }), getters: { /** @@ -91,6 +95,18 @@ const useNeInfoStore = defineStore('neinfo', { } return res; }, + // 获取性能测量数据集列表 + async fnNeTaskPerformance() { + // 有数据不请求 + if (this.perMeasurementList.length > 0) { + return { code: 1, data: this.perMeasurementList, msg: 'success' }; + } + const res = await getNePerformanceList(); + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + this.perMeasurementList = res.data; + } + return res; + }, }, }); diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 8c03cb8e..a5b519f9 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -138,13 +138,13 @@ const useUserStore = defineStore('user', { } catch (error) { console.error(error); - this.profile = { + this.profile = {color:{ critical: '#FF5722', major: '#FFB800', minor: '#393D49', warning: '#009688', event: '#1E9FFF', - }; + }}; } // 验证返回的roles是否是一个非空数组