del: 移除旧的参数配置页面
This commit is contained in:
@@ -108,159 +108,6 @@ async function getParamConfigInfo(
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配置参数标签栏对应信息-表格处理
|
||||
* @param neType 网元类型
|
||||
* @param topTag
|
||||
* @param neId
|
||||
* @returns object
|
||||
*/
|
||||
export async function getParamConfigInfoTable(
|
||||
neType: string,
|
||||
topTag: string,
|
||||
neId: string
|
||||
) {
|
||||
const { wrRule, dataArr } = await getParamConfigInfo(neType, topTag, neId);
|
||||
|
||||
// UPF参数不统一
|
||||
// if (neType === 'UPF') {
|
||||
// if (Reflect.has(wrRule, 'list')) {
|
||||
// for (const arr of wrRule['list']) {
|
||||
// arr['name'] = parseFirstLower(arr['name']);
|
||||
// }
|
||||
// for (const item of dataArr) {
|
||||
// for (const k in item) {
|
||||
// item[parseFirstLower(k)] = item[k];
|
||||
// Reflect.deleteProperty(item, k);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (Reflect.has(wrRule, 'array')) {
|
||||
// for (const arr of wrRule['array']) {
|
||||
// if (Array.isArray(arr['array'])) {
|
||||
// for (const child of arr['array']) {
|
||||
// child['name'] = parseFirstLower(child['name']);
|
||||
// }
|
||||
// }
|
||||
// arr['name'] = parseFirstLower(arr['name']);
|
||||
// }
|
||||
// for (const item of dataArr) {
|
||||
// for (const k in item) {
|
||||
// // 处理子列表
|
||||
// if (Array.isArray(item[k])) {
|
||||
// for (const child of item[k]) {
|
||||
// for (const childKey in child) {
|
||||
// child[parseFirstLower(childKey)] = child[childKey];
|
||||
// Reflect.deleteProperty(child, childKey);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// item[parseFirstLower(k)] = item[k];
|
||||
// Reflect.deleteProperty(item, k);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 拼装数据
|
||||
const result = {
|
||||
code: RESULT_CODE_SUCCESS,
|
||||
msg: RESULT_MSG_SUCCESS,
|
||||
data: {
|
||||
type: 'list' as 'list' | 'array',
|
||||
data: [] as any[],
|
||||
dataRule: {},
|
||||
columns: [] as any[],
|
||||
},
|
||||
};
|
||||
|
||||
// kv单列表
|
||||
if (Reflect.has(wrRule, 'list')) {
|
||||
result.data.type = 'list';
|
||||
const ruleArr = Object.freeze(wrRule['list']);
|
||||
|
||||
// 列表项数据
|
||||
let dataList = [];
|
||||
for (const item of dataArr) {
|
||||
for (const key of Object.keys(item)) {
|
||||
// 规则为准
|
||||
for (const rule of ruleArr) {
|
||||
if (rule['name'] === key) {
|
||||
const ruleItem = Object.assign({ optional: 'true' }, rule, {
|
||||
value: item[key],
|
||||
});
|
||||
dataList.push(ruleItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
result.data.data = dataList;
|
||||
|
||||
// 列表字段
|
||||
result.data.columns = [
|
||||
{
|
||||
title: 'Key',
|
||||
dataIndex: 'display',
|
||||
align: 'left',
|
||||
width: '30%',
|
||||
},
|
||||
{
|
||||
title: 'Value',
|
||||
dataIndex: 'value',
|
||||
align: 'left',
|
||||
width: '70%',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
// 多列表
|
||||
if (Reflect.has(wrRule, 'array')) {
|
||||
result.data.type = 'array';
|
||||
const ruleArr = Object.freeze(wrRule['array']);
|
||||
|
||||
// 列表项数据
|
||||
const dataArray = [];
|
||||
for (const item of dataArr) {
|
||||
let record: Record<string, any> = {};
|
||||
for (const key of Object.keys(item)) {
|
||||
// 规则为准
|
||||
for (const rule of ruleArr) {
|
||||
if (rule['name'] === key) {
|
||||
const ruleItem = Object.assign({ optional: 'true' }, rule, {
|
||||
value: item[key],
|
||||
});
|
||||
record[ruleItem.name] = ruleItem;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dataArray.push(record);
|
||||
}
|
||||
result.data.data = dataArray;
|
||||
|
||||
// 无数据时,用于新增
|
||||
let dataRule: Record<string, any> = {};
|
||||
for (const rule of ruleArr) {
|
||||
dataRule[rule.name] = rule;
|
||||
}
|
||||
result.data.dataRule = dataRule;
|
||||
|
||||
// 列表字段
|
||||
const columns: Record<string, any>[] = [];
|
||||
for (const rule of ruleArr) {
|
||||
columns.push({
|
||||
title: rule.display,
|
||||
dataIndex: rule.name,
|
||||
align: 'left',
|
||||
width: 5,
|
||||
});
|
||||
}
|
||||
result.data.columns = columns;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配置参数标签栏对应信息-表单结构处理
|
||||
* @param neType 网元类型
|
||||
@@ -530,7 +377,7 @@ export async function getPCCRule(neId: any) {
|
||||
) {
|
||||
let itemData = itemV.data.data;
|
||||
itemData.forEach((item: any) => {
|
||||
pccJson.set(item.ruleId,{ value: item.ruleId, label: item.ruleId });
|
||||
pccJson.set(item.ruleId, { value: item.ruleId, label: item.ruleId });
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -544,7 +391,7 @@ export async function getPCCRule(neId: any) {
|
||||
) {
|
||||
let itemData = itemV.data.data;
|
||||
itemData.forEach((item: any) => {
|
||||
sessJson.set(item.ruleId,{ value: item.ruleId, label: item.ruleId });
|
||||
sessJson.set(item.ruleId, { value: item.ruleId, label: item.ruleId });
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -558,7 +405,7 @@ export async function getPCCRule(neId: any) {
|
||||
) {
|
||||
let itemData = itemV.data.data;
|
||||
itemData.forEach((item: any) => {
|
||||
qosJson.set(item.qosId,{ value: item.qosId, label: item.qosId });
|
||||
qosJson.set(item.qosId, { value: item.qosId, label: item.qosId });
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -572,7 +419,7 @@ export async function getPCCRule(neId: any) {
|
||||
) {
|
||||
let itemData = itemV.data.data;
|
||||
itemData.forEach((item: any) => {
|
||||
headerJson.set(item.templateName,{
|
||||
headerJson.set(item.templateName, {
|
||||
value: item.templateName,
|
||||
label: item.templateName,
|
||||
});
|
||||
@@ -589,7 +436,7 @@ export async function getPCCRule(neId: any) {
|
||||
) {
|
||||
let itemData = itemV.data.data;
|
||||
itemData.forEach((item: any) => {
|
||||
sarJson.set(item.name,{ value: item.name, label: item.name });
|
||||
sarJson.set(item.name, { value: item.name, label: item.name });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user