fix: 参数配置根据规则布尔类型转换

This commit is contained in:
TsMask
2023-12-11 19:21:32 +08:00
parent 4208ccc358
commit 9c27c32e26

View File

@@ -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,
});
}
});
});
</script>