|
|
|
@ -132,6 +132,9 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
let fenceType: JYZInfoMoudleType = this.getFenceType(type) |
|
|
|
|
this.isShowNature = false //隐藏属性栏
|
|
|
|
|
if (this.selectFence != type) { |
|
|
|
|
if (this.selectFence === 7) { //初始化 应急预案模块
|
|
|
|
|
this.initializePlan() |
|
|
|
|
} |
|
|
|
|
this.isShowChildComponent && this.leftDomain && type != 4 ? this.leftDomain.initComponent(type) : null; //手动初始化子组件
|
|
|
|
|
this.selectFence = type |
|
|
|
|
this.isShowChildComponent = true |
|
|
|
@ -140,6 +143,9 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
this.selectFence = -1 |
|
|
|
|
this.isShowChildComponent = false |
|
|
|
|
buildingWindow.changeJYZInfoModel(fenceType, false) |
|
|
|
|
if (type === 7) { //初始化 应急预案模块
|
|
|
|
|
this.initializePlan() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -330,8 +336,112 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
allMarkPlanData: AllMarkPlanData; //处置预案节点 数据
|
|
|
|
|
beforeEmergencyPlan: MarkPlanData = null; //当前选择 应急预案
|
|
|
|
|
beforePlanNode: MarkNodeData = null; //当前选择 预案节点
|
|
|
|
|
beforeEmergencyPlan: MarkPlanData = new MarkPlanData(-99, "请选择节点"); //当前选择 应急预案
|
|
|
|
|
beforePlanNode: MarkNodeData = new MarkNodeData(-99, "请选择节点"); //当前选择 预案节点
|
|
|
|
|
nzCurrent: number = -1; //当前选择 预案节点Index
|
|
|
|
|
isSuspend: boolean = false; //是否暂停 自动切换节点
|
|
|
|
|
timer: any; //定时器
|
|
|
|
|
|
|
|
|
|
//初始化 应急预案模块
|
|
|
|
|
initializePlan() { |
|
|
|
|
this.beforeEmergencyPlan = new MarkPlanData(-99, "请选择节点") |
|
|
|
|
this.beforePlanNode = new MarkNodeData(-99, "请选择节点") |
|
|
|
|
this.isSuspend = false //初始化暂停状态
|
|
|
|
|
window.clearTimeout(this.timer) //清除定时器
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//公用 切换选中节点
|
|
|
|
|
publicToggleNode() { |
|
|
|
|
this.beforePlanNode = this.beforeEmergencyPlan.nodes[this.nzCurrent] |
|
|
|
|
this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id |
|
|
|
|
this.leftDomain.selectNodeId = this.beforePlanNode.id |
|
|
|
|
MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//选中 底部一级节点 开启自动播放
|
|
|
|
|
selectChildNode(item: MarkPlanData) { |
|
|
|
|
if (this.isShowChildComponent && this.leftDomain) { |
|
|
|
|
if (item.nodes.length) { |
|
|
|
|
let isTrue = confirm("即将开始播放节点") |
|
|
|
|
if (isTrue) { |
|
|
|
|
this.nzCurrent = 0 |
|
|
|
|
this.beforeEmergencyPlan = item |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.message.info('暂无数据节点'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//自动播放-切换接点
|
|
|
|
|
autoPlay() { |
|
|
|
|
if (this.nzCurrent === this.beforeEmergencyPlan.nodes.length - 1) { |
|
|
|
|
this.nzCurrent = this.nzCurrent + 1 |
|
|
|
|
this.isSuspend = false //初始化暂停状态
|
|
|
|
|
window.clearTimeout(this.timer) //清除定时器
|
|
|
|
|
this.message.info('已播放至最后一节点'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
let time: number = this.beforePlanNode.getShowTime() |
|
|
|
|
this.timer = window.setTimeout(()=>{ |
|
|
|
|
this.nzCurrent = this.nzCurrent + 1 |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
},time) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//切换预案节点
|
|
|
|
|
changePlanNode(event){ |
|
|
|
|
if (event === this.beforeEmergencyPlan.nodes.length) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.nzCurrent = event |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//切换预案节点 上一个
|
|
|
|
|
toLast() { |
|
|
|
|
if (this.nzCurrent === 0) { |
|
|
|
|
this.message.info('目前已经是第一节点'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.nzCurrent = this.nzCurrent - 1 |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//切换预案节点 暂停
|
|
|
|
|
suspend(isSuspend: boolean) { |
|
|
|
|
this.isSuspend = isSuspend |
|
|
|
|
let msg: string = this.isSuspend? "目前已暂停" : "目前已开始播放" |
|
|
|
|
this.message.info(msg); |
|
|
|
|
if (this.isSuspend) { //暂停
|
|
|
|
|
window.clearTimeout(this.timer) //清除定时器
|
|
|
|
|
} else { //开启
|
|
|
|
|
MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id) |
|
|
|
|
this.autoPlay() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//切换预案节点 初始化
|
|
|
|
|
initialize() { |
|
|
|
|
this.nzCurrent = 0 |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//切换预案节点 下一个
|
|
|
|
|
toNext() { |
|
|
|
|
if (this.nzCurrent === this.beforeEmergencyPlan.nodes.length - 1) { |
|
|
|
|
this.message.info('目前已经是最后一个节点'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.nzCurrent = this.nzCurrent + 1 |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//选中应急预案 设备
|
|
|
|
|
selectSandTableMark(markData: MarkData, select: boolean) { |
|
|
|
|