style: 已处理-UPF参数不统一

This commit is contained in:
TsMask
2023-10-19 17:41:28 +08:00
parent 154cd976c0
commit bb8bde9977
2 changed files with 72 additions and 72 deletions

View File

@@ -136,44 +136,44 @@ export async function getParamConfigInfo(
});
// 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);
}
}
}
}
// 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 = {