|
|
@ -177,7 +177,9 @@ export default { |
|
|
|
label: 'partyOrgName', |
|
|
|
lazy: true, |
|
|
|
lazyLoad: (node, resolve) => { |
|
|
|
if(node.partyOrgLevel != 7){ |
|
|
|
this.handleNextOrgTreeClick(node, resolve) |
|
|
|
} |
|
|
|
}, |
|
|
|
isLeaf: (data, node) => { |
|
|
|
console.log(data); |
|
|
@ -339,19 +341,29 @@ export default { |
|
|
|
}, |
|
|
|
async getOrgTree() { |
|
|
|
try { |
|
|
|
const { data } = await requestGet('/actual/base/party/org/listPartyOrgTreeRoot4Select', { depth: 8 }) |
|
|
|
const { data } = await requestGet('/actual/base/party/org/listPartyOrgTreeRoot4Select', { depth: 8 }); |
|
|
|
this.formList.forEach(c => { |
|
|
|
for (let i of c.children) { |
|
|
|
if (i.formName == 'partyOrgId') { |
|
|
|
i.opction = [data]; |
|
|
|
c.children.forEach(i => { |
|
|
|
if (i.formName === 'partyOrgId') { |
|
|
|
// 深度克隆数据,避免直接修改原数据 |
|
|
|
const clonedData = JSON.parse(JSON.stringify(data)); |
|
|
|
// 调用递归函数处理把党小组这一层去掉 |
|
|
|
i.opction = [this.processTree(clonedData)]; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
} catch (error) { |
|
|
|
console.log(error); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
processTree(node) { |
|
|
|
if (node.partyOrgLevel === 7) { |
|
|
|
node.children = []; |
|
|
|
} else if (node.children && node.children.length > 0) { |
|
|
|
node.children = node.children.map(child => this.processTree(child)); |
|
|
|
} |
|
|
|
return node; |
|
|
|
} |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
computed: {}, |
|
|
|