From 9c27c32e262dacd1aed2f30d9f4090612779a393 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 11 Dec 2023 19:21:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=A7=84=E5=88=99=E5=B8=83=E5=B0=94=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configParamTreeTable/index.vue | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/src/views/configManage/configParamTreeTable/index.vue b/src/views/configManage/configParamTreeTable/index.vue index 18dcb230..e6240911 100644 --- a/src/views/configManage/configParamTreeTable/index.vue +++ b/src/views/configManage/configParamTreeTable/index.vue @@ -434,8 +434,11 @@ function arrayAdd() { continue; } // 根据规则类型转值 - if(['enum', 'int'].includes(v.type)){ - v.value = Number(v.value) + if (['enum', 'int'].includes(v.type)) { + v.value = Number(v.value); + } + if ('bool' === v.type) { + v.value = Boolean(v.value); } row[v.name] = Object.assign({}, v); } @@ -1053,42 +1056,40 @@ function fnModalCancel() { onMounted(() => { // 获取网元网元列表 - neInfoStore - .fnNelist() - .then(res => { - if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { - if (res.data.length > 0) { - // 过滤不可用的网元 - 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; + neInfoStore.fnNelist().then(res => { + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { + if (res.data.length > 0) { + // 过滤不可用的网元 + neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( + (item: any) => { + return !['OMC'].includes(item.value); } - // 默认选择AMF - const item = neCascaderOptions.value.find(s => s.value === 'UPF'); - if (item && item.children) { - const info = item.children[0]; - neTypeSelect.value = [info.neType, info.neId]; - } else { - const info = neCascaderOptions.value[0].children[0]; - neTypeSelect.value = [info.neType, info.neId]; - } - fnGetParamConfigTopTab(); + ); + if (neCascaderOptions.value.length === 0) { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + return; } - } else { - message.warning({ - content: t('common.noData'), - duration: 2, - }); + // 默认选择AMF + const item = neCascaderOptions.value.find(s => s.value === 'UPF'); + if (item && item.children) { + const info = item.children[0]; + neTypeSelect.value = [info.neType, info.neId]; + } else { + const info = neCascaderOptions.value[0].children[0]; + neTypeSelect.value = [info.neType, info.neId]; + } + fnGetParamConfigTopTab(); } - }); + } else { + message.warning({ + content: t('common.noData'), + duration: 2, + }); + } + }); });