fix: 缓存网元类型获取级联数据判断

This commit is contained in:
TsMask
2023-12-08 18:20:21 +08:00
parent fafe604323
commit e6a4591fb6
11 changed files with 144 additions and 108 deletions

View File

@@ -12,7 +12,7 @@ import useNeInfoStore from '@/store/modules/neinfo';
import useI18n from '@/hooks/useI18n';
import { getGoldTitleByNE, goldData } from '@/api/perfManage/goldTarget';
import { parseDateToStr } from '@/utils/date-utils';
const neInfoStore = useNeInfoStore();
const { t, currentLocale } = useI18n();
/**网元参数 */
@@ -284,17 +284,24 @@ function fnDesign() {
onMounted(() => {
// 获取网元网元列表
useNeInfoStore()
neInfoStore
.fnNelist()
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
if (res.data.length > 0) {
// 过滤不可用的网元
neCascaderOptions.value = useNeInfoStore().getNeCascaderOtions.filter(
neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter(
(item: any) => {
return !['OMC'].includes(item.value);
}
);
if (neCascaderOptions.value.length === 0) {
message.warning({
content: t('common.noData'),
duration: 2,
});
return;
}
// 默认选择AMF
const item = neCascaderOptions.value.find(s => s.value === 'UPF');
if (item && item.children) {

View File

@@ -19,6 +19,7 @@ import {
taskStop,
taskRun,
} from '@/api/perfManage/taskManage';
const neInfoStore = useNeInfoStore();
const { t, currentLocale } = useI18n();
const generateOptions = (start: any, end: any) => {
@@ -378,7 +379,7 @@ function fnSelectPer(s: any, option: any) {
/**性能测量数据集选择初始 */
function fnSelectPerformanceInit(neType: string) {
//console.logg(currentLocale.value); //当前语言
const performance = useNeInfoStore().perMeasurementList.filter(
const performance = neInfoStore.perMeasurementList.filter(
i => i.neType === neType
);
//进行分组选择
@@ -692,9 +693,9 @@ onMounted(() => {
Promise.allSettled([
// 获取网元网元列表
useNeInfoStore().fnNelist(),
neInfoStore.fnNelist(),
// 获取性能测量集列表
useNeInfoStore().fnNeTaskPerformance(),
neInfoStore.fnNeTaskPerformance(),
]).finally(() => {
// 获取列表数据
fnGetList();
@@ -719,7 +720,7 @@ onMounted(() => {
>
<a-auto-complete
v-model:value="queryParams.neType"
:options="useNeInfoStore().getNeSelectOtions"
:options="neInfoStore.getNeSelectOtions"
allow-clear
:placeholder="t('views.traceManage.task.neTypePlease')"
/>
@@ -887,7 +888,7 @@ onMounted(() => {
>
<a-cascader
:value="modalState.neType"
:options="useNeInfoStore().getNeCascaderOtions"
:options="neInfoStore.getNeCascaderOptions"
disabled
/>
</a-form-item>
@@ -1002,7 +1003,7 @@ onMounted(() => {
>
<a-cascader
v-model:value="modalState.neType"
:options="useNeInfoStore().getNeCascaderOtions"
:options="neInfoStore.getNeCascaderOptions"
@change="fnNeChange"
:allow-clear="false"
:placeholder="t('views.traceManage.task.neTypePlease')"