|
|
|
@ -146,7 +146,9 @@ export class uploadQuestions {
|
|
|
|
|
defaultExpandedKeys = []; //展开指定的树节点 key值
|
|
|
|
|
defaultSelectedKeys = []; //指定选中的树节点 key值
|
|
|
|
|
renderData:any |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.nodeInit() |
|
|
|
|
let data = JSON.parse(sessionStorage.getItem("试卷id")) |
|
|
|
|
data.forEach(item => { |
|
|
|
|
item.children.forEach(i => { |
|
|
|
@ -155,6 +157,32 @@ export class uploadQuestions {
|
|
|
|
|
}) |
|
|
|
|
this.renderData = data |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
nodeTreeData:any = []; //处置节点tree
|
|
|
|
|
//节点初始化
|
|
|
|
|
nodeInit () { |
|
|
|
|
let treeData = [] |
|
|
|
|
this.data.node.forEach(element => { |
|
|
|
|
element.title = element.name //name
|
|
|
|
|
element.key = element.id //id
|
|
|
|
|
element.children = [] //children
|
|
|
|
|
if (element.sitePlanId || element.buildingAreaId) { //是数据节点
|
|
|
|
|
element.isLeaf = true |
|
|
|
|
element.isDataNode = true |
|
|
|
|
} else { //不是数据节点
|
|
|
|
|
element.isLeaf = false |
|
|
|
|
element.isDataNode = false |
|
|
|
|
} |
|
|
|
|
this.data.node.forEach(item=>{ |
|
|
|
|
item.parentId === element.id? element.children.push(item) : null |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
this.data.node.forEach(element=>{ |
|
|
|
|
!element.parentId? treeData.push(element) : null |
|
|
|
|
}) |
|
|
|
|
this.nodeTreeData = [...treeData] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
nzEvent($event){ |
|
|
|
|
console.log($event) |
|
|
|
|
} |
|
|
|
@ -188,6 +216,12 @@ export class uploadDisposalNodes {
|
|
|
|
|
let isChecked = (this.nzTreeComponent.getTreeNodeByKey(element.id)).isChecked |
|
|
|
|
isChecked? checkList.push(element) : null |
|
|
|
|
}); |
|
|
|
|
let galfList = this.nzTreeComponent.getHalfCheckedNodeList() |
|
|
|
|
this.data.oldTreeData.forEach(element => { |
|
|
|
|
galfList.forEach(elements => { |
|
|
|
|
element.id == elements.origin.id? checkList.push(element) : null |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
if (checkList.length) { |
|
|
|
|
this.dialogRef.close(checkList); |
|
|
|
|
} else { |
|
|
|
|