feat: 新增参数配置Tree/调整参数配置Form

This commit is contained in:
TsMask
2023-11-15 14:59:43 +08:00
parent 4f18fe2552
commit de6271df00
5 changed files with 1800 additions and 37 deletions

View File

@@ -57,6 +57,7 @@ async function getParamConfigInfo(
params: {
SQL: `SELECT param_json FROM param_config WHERE ne_type = '${neType}' AND top_tag='${topTag}'`,
},
timeout: 1_000,
}),
// 获取对应信息
request({
@@ -65,6 +66,7 @@ async function getParamConfigInfo(
params: {
ne_id: neId,
},
timeout: 1_000,
}),
]).then(resArr => {
let wrRule: Record<string, any> = {};
@@ -333,7 +335,7 @@ export async function getParamConfigInfoForm(
result.data.data = dataArray;
// 无数据时,用于新增
result.data.dataRule = { title: `Index-0`, key: 0, record : [ruleArr]} ;
result.data.dataRule = { title: `Index-0`, key: 0, record : ruleArr} ;
}
return result;
}

View File

@@ -429,6 +429,8 @@ export default {
addSure:'Are you sure to submit the new record of Index: [{value}]? '
},
configParamForm: {
treeTitle: "Navigation Configuration",
treeSelectTip: "Sélectionnez les informations sur les éléments de configuration dans la navigation de configuration de gauche !",
neType: 'NE Type',
neTypePleace: "Please select the network element type",
noConfigData: "No data on configuration items",

View File

@@ -429,6 +429,8 @@ export default {
addSure:'确认提交新增 Index :【{value}】 的记录吗?',
},
configParamForm: {
treeTitle: "配置导航",
treeSelectTip: "左侧配置导航中选择配置项信息!",
neType: "网元类型",
neTypePleace: "请选择网元类型",
noConfigData: "暂无配置项数据",

View File

@@ -61,32 +61,28 @@ function fnTabActiveTopTag(key: string | number) {
const neType = neTypeSelect.value[0];
const neId = neTypeSelect.value[1];
const topTag = tabState.tabActiveTopTag;
getParamConfigInfoForm(neType, topTag, neId)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data.type) {
tabState.tabActiveTopTag = topTag; // 激活当前数据项
tabState.loading = false;
tabState.tabType = res.data.type;
if (res.data.type === 'list') {
listState.data = res.data.data;
listEditClose();
}
if (res.data.type === 'array') {
arrayState.data = res.data.data;
arrayState.dataRule = res.data.dataRule;
arrayState.collapseActiveKey = [];
arrayEditClose();
}
} else {
message.warning({
content: t('common.noData'),
duration: 3,
});
getParamConfigInfoForm(neType, topTag, neId).then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data.type) {
tabState.tabActiveTopTag = topTag; // 激活当前数据项
tabState.loading = false;
tabState.tabType = res.data.type;
if (res.data.type === 'list') {
listState.data = res.data.data;
listEditClose();
}
})
.catch(err => {
console.log(err);
});
if (res.data.type === 'array') {
arrayState.data = res.data.data;
arrayState.dataRule = res.data.dataRule;
arrayState.collapseActiveKey = [];
arrayEditClose();
}
} else {
message.warning({
content: t('common.noData'),
duration: 3,
});
}
});
}
/**查询配置Tag标签 */
@@ -506,7 +502,7 @@ function arrayChildExpand(key: number | string, row: Record<string, any>) {
arrayChildState.dataRule = {
title: `Index-0`,
key: 0,
record: [ruleArr],
record: ruleArr,
};
arrayChildState.loc = `${loc}/${from['name']}`;
@@ -826,7 +822,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
if (valueInt < minInt || valueInt > maxInt) {
return [
false,
t('views.configParam.configParamForm.requireInt', {
t('views.configManage.configParamForm.requireInt', {
display,
filter,
}),
@@ -838,7 +834,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
if (!regExpIPv4.test(value)) {
return [
false,
t('views.configParam.configParamForm.requireIpv4', { display }),
t('views.configManage.configParamForm.requireIpv4', { display }),
];
}
break;
@@ -846,7 +842,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
if (!regExpIPv6.test(value)) {
return [
false,
t('views.configParam.configParamForm.requireIpv6', { display }),
t('views.configManage.configParamForm.requireIpv6', { display }),
];
}
break;
@@ -862,7 +858,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
if (!Object.keys(filterJson).includes(`${value}`)) {
return [
false,
t('views.configParam.configParamForm.requireEnum', { display }),
t('views.configManage.configParamForm.requireEnum', { display }),
];
}
}
@@ -879,7 +875,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
if (!Object.values(filterJson).includes(`${value}`)) {
return [
false,
t('views.configParam.configParamForm.requireBool', { display }),
t('views.configManage.configParamForm.requireBool', { display }),
];
}
}
@@ -894,7 +890,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
if (!rule.test(value)) {
return [
false,
t('views.configParam.configParamForm.requireString', { display }),
t('views.configManage.configParamForm.requireString', { display }),
];
}
} catch (error) {
@@ -910,7 +906,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
if (!regex.test(value)) {
return [
false,
t('views.configParam.configParamForm.requireString', { display }),
t('views.configManage.configParamForm.requireString', { display }),
];
}
} catch (error) {
@@ -922,7 +918,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
default:
return [
false,
t('views.configParam.configParamForm.requireUn', { display }),
t('views.configManage.configParamForm.requireUn', { display }),
];
}
return result;
@@ -997,10 +993,13 @@ onMounted(() => {
}
);
// 默认选择AMF
const item = neCascaderOtions.value.find(s => s.value === 'UPF');
if (item) {
const item = neCascaderOtions.value.find(s => s.value === 'AMF');
if (item && item.children) {
const info = item.children[0];
neTypeSelect.value = [info.neType, info.neId];
} else {
const info = neCascaderOtions.value[0].children[0];
neTypeSelect.value = [info.neType, info.neId];
}
fnGetParamConfigTopTab();
}
@@ -1286,6 +1285,7 @@ onMounted(() => {
:label="item.display"
:name="item.name"
:required="item.optional === 'false'"
style="margin-bottom: 2px"
>
<a-tooltip placement="topLeft">
<template #title v-if="item.comment">
@@ -1493,6 +1493,7 @@ onMounted(() => {
:label="item.display"
:name="item.name"
:required="item.optional === 'false'"
style="margin-bottom: 2px"
>
<a-tooltip placement="topLeft">
<template #title v-if="item.comment">
@@ -1631,6 +1632,7 @@ onMounted(() => {
:label="item.display"
:name="item.name"
:required="item.optional === 'false'"
style="margin-bottom: 2px"
>
<a-tooltip placement="topLeft">
<template #title v-if="item.comment">

File diff suppressed because it is too large Load Diff