|
|
@ -903,7 +903,6 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
let data = JSON.parse(JSON.stringify(this.allFireElements)) //所有消防要素模板
|
|
|
|
let data = JSON.parse(JSON.stringify(this.allFireElements)) //所有消防要素模板
|
|
|
|
console.log(data) |
|
|
|
console.log(data) |
|
|
|
let treeData = [] //tree型 处理完成后的数据
|
|
|
|
let treeData = [] //tree型 处理完成后的数据
|
|
|
|
|
|
|
|
|
|
|
|
data.forEach(element => { |
|
|
|
data.forEach(element => { |
|
|
|
element.key = element.id |
|
|
|
element.key = element.id |
|
|
|
element.isTemplate = true //添加模板标识
|
|
|
|
element.isTemplate = true //添加模板标识
|
|
|
@ -964,7 +963,7 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(filterEmpty(treeData)) |
|
|
|
// console.log(filterEmpty(treeData))
|
|
|
|
this.dataSource.data = filterEmpty(treeData) |
|
|
|
this.dataSource.data = filterEmpty(treeData) |
|
|
|
|
|
|
|
|
|
|
|
this.treeControl.expandAll() |
|
|
|
this.treeControl.expandAll() |
|
|
@ -1096,7 +1095,7 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
let treeData = JSON.parse( JSON.stringify(this.dataSource.data) ) |
|
|
|
let treeData = JSON.parse( JSON.stringify(this.dataSource.data) ) |
|
|
|
let nodes = JSON.parse( JSON.stringify( JSON.parse(sessionStorage.getItem('examNodeList')) ) ) |
|
|
|
let nodes = JSON.parse( JSON.stringify( JSON.parse(sessionStorage.getItem('examNodeList')) ) ) |
|
|
|
if (nodes) { |
|
|
|
if (nodes) { |
|
|
|
let data = { treeData: treeData, question: JSON.parse( JSON.stringify(this.examMsg) ), node: nodes } |
|
|
|
let data = { treeData: treeData, question: JSON.parse( JSON.stringify(this.examMsg) ), node: nodes ,allFireElements:this.allFireElements} |
|
|
|
let dialogRef = this.dialog.open(uploadQuestions,{data}); |
|
|
|
let dialogRef = this.dialog.open(uploadQuestions,{data}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
@ -1126,9 +1125,11 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
// storeyData.data[key] = companyBuildingData.data[key]
|
|
|
|
// storeyData.data[key] = companyBuildingData.data[key]
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
for(let key in storeyData.data){ //筛选数据 没有匹配全部放入到 其他 数组
|
|
|
|
console.log(566,storeyData.data) |
|
|
|
|
|
|
|
for(let key in storeyData.data){ //筛选数据
|
|
|
|
storeyData.data[key].key = storeyData.data[key].Id |
|
|
|
storeyData.data[key].key = storeyData.data[key].Id |
|
|
|
let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId ) |
|
|
|
let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId ) |
|
|
|
|
|
|
|
//没有匹配全部放入到 其他 数组
|
|
|
|
if (!noMatch) { |
|
|
|
if (!noMatch) { |
|
|
|
this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key]) |
|
|
|
this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key]) |
|
|
|
} |
|
|
|
} |
|
|
|