|
@ -159,14 +159,30 @@ export default { |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 递归查询字典名称对应的字典代码 |
|
|
// 递归查询字典名称对应的字典代码 |
|
|
getNode(tree, dicName) { |
|
|
|
|
|
for (let i = 0; i < tree.length; i++) { |
|
|
|
|
|
if (tree[i].dicName === dicName) { |
|
|
|
|
|
return tree[i] |
|
|
|
|
|
} else if (tree[i].childMenus) { |
|
|
|
|
|
return this.getNode(tree[i].childMenus, dicName) |
|
|
|
|
|
|
|
|
// getNode(tree, dicName) { |
|
|
|
|
|
// for (let i = 0; i < tree.length; i++) { |
|
|
|
|
|
// if (tree[i].dicName === dicName) { |
|
|
|
|
|
// return tree[i] |
|
|
|
|
|
// } else { |
|
|
|
|
|
// if (tree[i].childMenus) { |
|
|
|
|
|
// return this.getNode(tree[i].childMenus, dicName) |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// }, |
|
|
|
|
|
getNode(list, dicName) { |
|
|
|
|
|
let data; |
|
|
|
|
|
(list || []).map(item => { |
|
|
|
|
|
if (item.dicName === dicName) { |
|
|
|
|
|
data = [item] |
|
|
|
|
|
} else { |
|
|
|
|
|
const child = this.getNode(item.childMenus, dicName) |
|
|
|
|
|
if (child) { |
|
|
|
|
|
data = child |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
return data |
|
|
}, |
|
|
}, |
|
|
// 自动生成 |
|
|
// 自动生成 |
|
|
handleAuto() { |
|
|
handleAuto() { |
|
@ -180,7 +196,7 @@ export default { |
|
|
await FetchFindAllSubsetById({ id: fieldInfo.dictionaryConfigId.id }).then(res => { |
|
|
await FetchFindAllSubsetById({ id: fieldInfo.dictionaryConfigId.id }).then(res => { |
|
|
const option = this.getNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
const option = this.getNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
if (option) { |
|
|
if (option) { |
|
|
string += '' + option.dicCode + val.connector |
|
|
|
|
|
|
|
|
string += '' + option[0].dicCode + val.connector |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|