刘向辉 3 years ago
parent
commit
6a6c4b04e0
  1. 13
      src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts
  2. 1
      src/app/babylon/view/mark-window/mark-window.ts
  3. 62
      src/app/pages/left-domain/left-domain.component.ts
  4. 4
      src/app/pages/plan/plan.component.ts

13
src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window.ts

@ -483,7 +483,6 @@ export class FacilityInfoInSceneWindow extends UIBase {
if (this.currentSelectJYJInfo != null) {
let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(this.currentSelectJYJInfo);
facilityItem.onSelect(false);
// this.playJYJSelectEffect(false, this.currentSelectJYJInfo);
this.currentSelectJYJInfo = null;
}
@ -496,8 +495,6 @@ export class FacilityInfoInSceneWindow extends UIBase {
try {
let facilityInfosByType = BuildingWindow.instance.currentBuidngItem.buildingInfo.ModelInfo.facilityInfos;
for (let i = 0; i < facilityInfosByType.length; i++) {
if ((currentMoudle == null || currentMoudle == JYZInfoMoudleType.JYJ) && facilityInfosByType[i].type == FacilityType.JY_JYJ ||
(currentMoudle == null || currentMoudle == JYZInfoMoudleType.YG) && facilityInfosByType[i].type == FacilityType.JY_YG) {
@ -519,28 +516,18 @@ export class FacilityInfoInSceneWindow extends UIBase {
for (let j = 0; j < childMesh.length; j++) {
if (pickInfo.pickedMesh == childMesh[j]) {
result = allJYJInfo[i];
console.log("通过点击,找到加油机了");
break;
}
}
}
if (result != null) {
//this.playJYJSelectEffect(true, result);
if ((result.modelData as ModelData_facility).facilityType == FacilityType.JY_JYJ && currentMoudle == null) {
PlanComponent.instance.toggleHeaderFence(1);//在空状态下,点击加油机,跳转到加油机页签
}
let facilityItem: FacilityInfoUIItem = FacilityInfoInSceneWindow.instance.getFacilityItem(result);
console.log("场景中选中设备", facilityItem); //通知前端
this.selectFacilityItem(facilityItem);
// facilityItem.onSelect(true);
//FacilityInfoInSceneWindow.instance.selectFacilityItemToThree([facilityItem], true);
//console.log(facilityItem.getHeadUIPos());
}
}

1
src/app/babylon/view/mark-window/mark-window.ts

@ -189,6 +189,7 @@ export class MarkWindow extends UIBase {
*
*/
static openWindow(): MarkWindow {
console.log("进入沙盘");
if (MarkWindow.instance == null) {
SceneManager.s_markWindow = UIManager.open(MarkWindow);
}

62
src/app/pages/left-domain/left-domain.component.ts

@ -10,6 +10,7 @@ import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manag
import { AllMarkPlanData, MarkNodeData, MarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data';
import { MarkWindow } from 'src/app/babylon/view/mark-window/mark-window';
import { NzMessageService } from 'ng-zorro-antd/message';
import { ModeManager, ModeType } from 'src/app/babylon/controller/mode-manager';
@Component({
selector: 'app-left-domain',
@ -43,20 +44,20 @@ export class LeftDomainComponent implements OnInit {
//处理 设备data
handleFacility() {
if (this.beforeFence === 7) { //应急预案
MarkWindow.instance? this.allMarkPlanData= MarkWindow.instance.allMarkPlanData : null
EventManager.addListener(Event_GetAllMarkPlanData, (data: Event_GetAllMarkPlanData)=>{
MarkWindow.instance ? this.allMarkPlanData = MarkWindow.instance.allMarkPlanData : null
EventManager.addListener(Event_GetAllMarkPlanData, (data: Event_GetAllMarkPlanData) => {
this.allMarkPlanData = data.data
})
return
}
let list: FacilityInfoUIItem[] = []
FacilityInfoInSceneWindow.instance.facilityInfoUIItemes.forEach(item=>{
FacilityInfoInSceneWindow.instance.facilityInfoUIItemes.forEach(item => {
if (this.beforeFence === 1) { //加油机
item.getType() === "JY_JYJ"? list.push(item) : null
item.getType() === "JY_JYJ" ? list.push(item) : null
} else if (this.beforeFence === 2) { //油罐设备
item.getType() === "JY_YG"? list.push(item) : null
item.getType() === "JY_YG" ? list.push(item) : null
} else if (this.beforeFence === 3) { //消防设施
(item.getType()).slice(0,3) === "XF_"? list.push(item) : null
(item.getType()).slice(0, 3) === "XF_" ? list.push(item) : null
}
})
this.FacilityList = list
@ -83,8 +84,8 @@ export class LeftDomainComponent implements OnInit {
//处理 treeData
handleTreeData(list: FacilityInfoUIItem[]) {
this.treeData = []
list.forEach(item=>{
let isFind = this.treeData.find(element=>{ return (item.getType()).includes(element.key) })
list.forEach(item => {
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, expanded: true, children: [], }
@ -96,7 +97,7 @@ export class LeftDomainComponent implements OnInit {
this.treeData.push(primaryNode)
}
} else { //存在
if (item.getType().includes('XF_MHQ') && !isFind.children.find(elements=>{ return elements.key === item.getType() })) { //灭火器
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, }
isFind.children.push(treeNode)
}
@ -104,14 +105,14 @@ export class LeftDomainComponent implements OnInit {
})
//编辑模式
if (this.editModel) {
let isFind = this.treeData.find(item=>{ return item.key === 'XF_MHQ' })
let isFind = this.treeData.find(item => { return item.key === 'XF_MHQ' })
if (!isFind) {
let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, }
this.treeData.push(primaryNode)
}
for (let facility in FacilityType) {
if (facility.slice(0,3) === "XF_" && !facility.includes('XF_MHQ')) {
let isFind = this.treeData.find(item=>{ return item.key === facility })
if (facility.slice(0, 3) === "XF_" && !facility.includes('XF_MHQ')) {
let isFind = this.treeData.find(item => { return item.key === facility })
if (!isFind) {
let primaryNode = { title: ConfigManager.getFacilityTypeName(FacilityType[facility]), key: facility, selectable: false, }
this.treeData.push(primaryNode)
@ -125,8 +126,8 @@ export class LeftDomainComponent implements OnInit {
//获取设备 数量
getFacilityNum(type: string): number {
let num = 0
this.FacilityList.forEach(item=>{
item.getType().includes(type)? num = num + 1 : null
this.FacilityList.forEach(item => {
item.getType().includes(type) ? num = num + 1 : null
})
return num
}
@ -139,11 +140,11 @@ export class LeftDomainComponent implements OnInit {
FacilityInfoInSceneWindow.instance.showFacilityByType(null, false)
FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[event.node.key], event.node.isSelected)
} else { //显示所有
this.treeData.forEach(item=>{
this.treeData.forEach(item => {
if (item.key != 'XF_MHQ') {
FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[item.key], true)
} else {
item.children.forEach(element=>{ FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[element.key], true) })
item.children.forEach(element => { FacilityInfoInSceneWindow.instance.showFacilityByType(FacilityType[element.key], true) })
}
})
}
@ -162,7 +163,7 @@ export class LeftDomainComponent implements OnInit {
MarkWindow.instance.createMarkPlaneData(e.name)
this.addDisposalPop = false
} else { //创建节点
MarkWindow.instance.createMarkNodeData(this.addNodePop,e.name)
MarkWindow.instance.createMarkNodeData(this.addNodePop, e.name)
this.addNodePop = null
}
}
@ -185,21 +186,28 @@ export class LeftDomainComponent implements OnInit {
if (!MarkWindow.instance.currentMarkNodeInfo) { //未选中节点
this.selectPlanId = item.id
this.selectNodeId = e.id
MarkWindow.instance.selectMarkNode(item.id,e.id)
MarkWindow.instance.selectMarkNode(item.id, e.id)
} else { //已选中节点
let isTrue = confirm('切换节点后,没保存的信息将会丢失!')
let isTrue = true;
if (ModeManager.currentMode == ModeType.Edit) {
isTrue = confirm('切换节点后,没保存的信息将会丢失!')
}
if (isTrue) {
this.selectPlanId = item.id
this.selectNodeId = e.id
MarkWindow.instance.selectMarkNode(item.id,e.id)
MarkWindow.instance.selectMarkNode(item.id, e.id)
}
}
} else if (this.selectPlanId === item.id && this.selectNodeId === e.id) { //取消选中
let isTrue = confirm('切换节点后,没保存的信息将会丢失!')
let isTrue = true;
if (ModeManager.currentMode == ModeType.Edit) {
isTrue = confirm('切换节点后,没保存的信息将会丢失!')
}
if (isTrue) {
this.selectPlanId = null
this.selectNodeId = null
MarkWindow.instance.selectMarkNode(null,null)
MarkWindow.instance.selectMarkNode(null, null)
}
}
}
@ -218,10 +226,10 @@ export class LeftDomainComponent implements OnInit {
this.saveDisposalDialog = true
} else {
if (this.selectPlanId === markPlanId && this.selectNodeId === nodeId) {
MarkWindow.instance.saveToOldNode(markPlanId,nodeId)
MarkWindow.instance.saveToOldNode(markPlanId, nodeId)
} else {
let isTrue = confirm('是否覆盖要保存的节点?')
isTrue? MarkWindow.instance.saveToOldNode(markPlanId,nodeId) : null
isTrue ? MarkWindow.instance.saveToOldNode(markPlanId, nodeId) : null
}
}
}
@ -236,7 +244,7 @@ export class LeftDomainComponent implements OnInit {
this.saveType = 2
this.allNodeList = []
MarkWindow.instance.allMarkPlanData.datas.forEach(item => {
item.nodes.forEach(element=>{
item.nodes.forEach(element => {
let node = {
id: element.id,
parrentId: item.id,
@ -255,14 +263,14 @@ export class LeftDomainComponent implements OnInit {
this.message.info('请完善表单')
return
}
MarkWindow.instance.createNewNodeAndSave(e.root.id,e.name)
MarkWindow.instance.createNewNodeAndSave(e.root.id, e.name)
this.saveType = null
} else { //保存到已有节点
if (!e.node) {
this.message.info('请完善表单')
return
}
MarkWindow.instance.saveToOldNode(e.node.parrentId,e.node.id)
MarkWindow.instance.saveToOldNode(e.node.parrentId, e.node.id)
this.saveType = null
}
}

4
src/app/pages/plan/plan.component.ts

@ -64,9 +64,9 @@ export class PlanComponent implements OnInit {
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
this.beforeOneSatus.onSelectInsSuccess(find)
} else { //如果没有找到对应的单位key,则调用新建单位
let isAdd = confirm('没有单位name,是否进行初始化?')
let isAdd = confirm('没有单位' + key + ',是否进行初始化?')
if (isAdd) {
let name = 'ceshi';
let name = key;
loginStatus.createInsitution(key, name);
}
}

Loading…
Cancel
Save