|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import { Component, OnInit, ViewChild } from '@angular/core'; |
|
|
|
|
import { NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; |
|
|
|
|
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; |
|
|
|
|
import { FacilityInfoInSceneWindow } from 'src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window'; |
|
|
|
|
import { PlanComponent } from '../plan/plan.component'; |
|
|
|
|
import { FacilityInfoUIItem } from "../../babylon/view/facilityinfoinscene-window/facilityinfo-ui-item"; |
|
|
|
|
import { ConfigManager } from 'src/app/babylon/controller/config-manager'; |
|
|
|
|
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-left-domain', |
|
|
|
@ -55,17 +56,17 @@ export class LeftDomainComponent implements OnInit {
|
|
|
|
|
let isFind = this.treeData.find(element=>{ return (item.getType()).includes(element.key) }) |
|
|
|
|
if (!isFind) { //不存在
|
|
|
|
|
if (item.getType().includes('XF_MHQ')) { //灭火器
|
|
|
|
|
let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, children: [], } |
|
|
|
|
let treeNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, } |
|
|
|
|
let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, expanded: true, children: [], } |
|
|
|
|
let treeNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, selected: true, } |
|
|
|
|
primaryNode.children.push(treeNode) |
|
|
|
|
this.treeData.push(primaryNode) |
|
|
|
|
} else { |
|
|
|
|
let primaryNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, } |
|
|
|
|
let primaryNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, selected: true, } |
|
|
|
|
this.treeData.push(primaryNode) |
|
|
|
|
} |
|
|
|
|
} else { //存在
|
|
|
|
|
if (item.getType().includes('XF_MHQ') && !isFind.children.find(elements=>{ return elements.key === item.getType() })) { //灭火器
|
|
|
|
|
let treeNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, } |
|
|
|
|
let treeNode = { title: ConfigManager.getFacilityTypeName(item.getType()), key: item.getType(), selectable: false, selected: true, } |
|
|
|
|
isFind.children.push(treeNode) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -81,6 +82,14 @@ export class LeftDomainComponent implements OnInit {
|
|
|
|
|
return num |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//点击tree节点
|
|
|
|
|
nzClick(event: NzFormatEmitEvent) { |
|
|
|
|
event.node.isSelected = !event.node.isSelected |
|
|
|
|
if (event.node.key != 'XF_MHQ') { |
|
|
|
|
FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[event.node.key], event.node.isSelected) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//编辑信息
|
|
|
|
|
editInfo() { |
|
|
|
|
|
|
|
|
@ -96,29 +105,5 @@ export class LeftDomainComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export class treeData { |
|
|
|
|
static nodes: NzTreeNodeOptions[] = [ |
|
|
|
|
{ |
|
|
|
|
title: '灭火器', |
|
|
|
|
key: '1', |
|
|
|
|
selectable: false, |
|
|
|
|
children: [ |
|
|
|
|
{ title: '4KG手提干粉灭火器', key: '1', selectable: false, }, |
|
|
|
|
{ title: '4KG手提泡沫灭火器', key: '2', selectable: false, }, |
|
|
|
|
{ title: '4KG手提二氧化碳灭火器', key: '3', selectable: false, }, |
|
|
|
|
{ title: '35KG手推灭火器', key: '4', selectable: false, }, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '灭火毯', |
|
|
|
|
key: '2', |
|
|
|
|
selectable: false, |
|
|
|
|
children: [] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '消防锹', |
|
|
|
|
key: '3', |
|
|
|
|
selectable: false, |
|
|
|
|
children: [] |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
static nodes: NzTreeNodeOptions[] = [] |
|
|
|
|
} |
|
|
|
|