|
|
|
@ -338,7 +338,6 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
beforePlanNode: MarkNodeData = new MarkNodeData(-99, "请选择节点"); //当前选择 预案节点
|
|
|
|
|
nzCurrent: number = -1; //当前选择 预案节点Index
|
|
|
|
|
isSuspend: boolean = false; //是否暂停 自动切换节点
|
|
|
|
|
timer: any; //定时器
|
|
|
|
|
progressList: number[] = []; //进度条 条/值
|
|
|
|
|
updateTimer: any; //更新进度条定时器
|
|
|
|
|
|
|
|
|
@ -347,7 +346,6 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
this.beforeEmergencyPlan = new MarkPlanData(-99, "请选择节点") |
|
|
|
|
this.beforePlanNode = new MarkNodeData(-99, "请选择节点") |
|
|
|
|
this.isSuspend = false //初始化暂停状态
|
|
|
|
|
window.clearTimeout(this.timer) //清除定时器
|
|
|
|
|
this.progressList = [] |
|
|
|
|
window.clearTimeout(this.updateTimer) //清除定时器
|
|
|
|
|
} |
|
|
|
@ -369,62 +367,50 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
selectChildNode(item: MarkPlanData) { |
|
|
|
|
if (this.isShowChildComponent && this.leftDomain) { |
|
|
|
|
if (item.nodes.length) { |
|
|
|
|
let isTrue = confirm("即将开始播放节点") |
|
|
|
|
if (isTrue) { |
|
|
|
|
this.timer? window.clearTimeout(this.timer) : null //清除定时器
|
|
|
|
|
this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器
|
|
|
|
|
this.nzCurrent = 0 |
|
|
|
|
this.beforeEmergencyPlan = item |
|
|
|
|
this.updateProgressList().then(res=>{ |
|
|
|
|
this.publicToggleNode().then(data=>{ |
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器
|
|
|
|
|
this.nzCurrent = 0 |
|
|
|
|
this.beforeEmergencyPlan = item |
|
|
|
|
this.updateProgressList().then(res=>{ |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.message.info('暂无数据节点'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//更新进度条 条数
|
|
|
|
|
updateProgressList() { |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
this.progressList = [] |
|
|
|
|
this.beforeEmergencyPlan.nodes.forEach(item=>{ this.progressList.push(0) }) |
|
|
|
|
resolve(true) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//更新进度条 值
|
|
|
|
|
updateProgress() { |
|
|
|
|
if (this.progressList[this.nzCurrent] >= 100) { |
|
|
|
|
this.progressList[this.nzCurrent] = 100 |
|
|
|
|
window.clearTimeout(this.updateTimer) //清除定时器
|
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
let time: number = this.beforePlanNode.getShowTime() || 1 |
|
|
|
|
this.updateTimer = window.setTimeout(()=>{ |
|
|
|
|
this.progressList[this.nzCurrent] = this.progressList[this.nzCurrent] + Math.ceil(100 / time) |
|
|
|
|
this.progressList[this.nzCurrent] = this.progressList[this.nzCurrent] + Number((100 / time).toFixed(2)) / 10 |
|
|
|
|
this.updateProgress() |
|
|
|
|
},1000) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//更新进度条 条数
|
|
|
|
|
updateProgressList() { |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
this.progressList = [] |
|
|
|
|
this.beforeEmergencyPlan.nodes.forEach(item=>{ this.progressList.push(0) }) |
|
|
|
|
resolve(true) |
|
|
|
|
}) |
|
|
|
|
},100) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//自动播放-切换接点
|
|
|
|
|
autoPlay() { |
|
|
|
|
let time: number = this.beforePlanNode.getShowTime() || 1 |
|
|
|
|
this.timer = window.setTimeout(()=>{ |
|
|
|
|
if (this.nzCurrent >= this.beforeEmergencyPlan.nodes.length - 1) { |
|
|
|
|
this.isSuspend = false //初始化暂停状态
|
|
|
|
|
window.clearTimeout(this.timer) //清除定时器
|
|
|
|
|
this.message.info('已播放至最后一节点'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.nzCurrent = this.nzCurrent + 1 |
|
|
|
|
this.publicToggleNode().then(data=>{ |
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
}) |
|
|
|
|
},time * 1000) |
|
|
|
|
if (this.nzCurrent >= this.beforeEmergencyPlan.nodes.length - 1) { |
|
|
|
|
this.message.info('已播放至最后一节点'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.nzCurrent = this.nzCurrent + 1 |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//切换预案节点
|
|
|
|
@ -432,10 +418,10 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
if (this.progressList.length != this.beforeEmergencyPlan.nodes.length) { |
|
|
|
|
this.updateProgressList() |
|
|
|
|
} |
|
|
|
|
this.timer? window.clearTimeout(this.timer) : null //清除定时器
|
|
|
|
|
this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器
|
|
|
|
|
this.isSuspend = true //暂停
|
|
|
|
|
this.nzCurrent = event |
|
|
|
|
this.progressList[this.nzCurrent] = 0 |
|
|
|
|
this.progressList.forEach((item,index)=>{ index >= this.nzCurrent? this.progressList[index] = 0 : null }) |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -452,13 +438,10 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
if (this.progressList.length != this.beforeEmergencyPlan.nodes.length) { |
|
|
|
|
this.updateProgressList() |
|
|
|
|
} |
|
|
|
|
this.timer? window.clearTimeout(this.timer) : null //清除定时器
|
|
|
|
|
this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器
|
|
|
|
|
this.nzCurrent = this.nzCurrent - 1 |
|
|
|
|
this.progressList[this.nzCurrent] = 0 |
|
|
|
|
this.publicToggleNode().then(data=>{ |
|
|
|
|
//!this.isSuspend? this.autoPlay() : null
|
|
|
|
|
}) |
|
|
|
|
this.progressList.forEach((item,index)=>{ index >= this.nzCurrent? this.progressList[index] = 0 : null }) |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//切换预案节点 暂停
|
|
|
|
@ -474,15 +457,11 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
let msg: string = this.isSuspend? "目前已暂停" : "目前已开始播放" |
|
|
|
|
this.message.info(msg); |
|
|
|
|
if (this.isSuspend) { //暂停
|
|
|
|
|
window.clearTimeout(this.timer) //清除定时器
|
|
|
|
|
window.clearTimeout(this.updateTimer) //清除定时器
|
|
|
|
|
} else { //开启
|
|
|
|
|
this.timer? window.clearTimeout(this.timer) : null //清除定时器
|
|
|
|
|
this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器
|
|
|
|
|
this.progressList.forEach((item,index)=>{ index >= this.nzCurrent? this.progressList[index] = 0 : null }) |
|
|
|
|
MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id, false, true) |
|
|
|
|
this.progressList.forEach((item,index)=>{ index > this.nzCurrent? this.progressList[index] = 0 : null }) |
|
|
|
|
this.updateProgress() |
|
|
|
|
this.autoPlay() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -492,13 +471,10 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
this.message.info('请选择节点'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.timer? window.clearTimeout(this.timer) : null //清除定时器
|
|
|
|
|
this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器
|
|
|
|
|
this.updateProgressList().then(res=>{ |
|
|
|
|
this.nzCurrent = 0 |
|
|
|
|
this.publicToggleNode().then(data=>{ |
|
|
|
|
!this.isSuspend? this.autoPlay() : null |
|
|
|
|
}) |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -515,13 +491,10 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
if (this.progressList.length != this.beforeEmergencyPlan.nodes.length) { |
|
|
|
|
this.updateProgressList() |
|
|
|
|
} |
|
|
|
|
this.timer? window.clearTimeout(this.timer) : null //清除定时器
|
|
|
|
|
this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器
|
|
|
|
|
this.nzCurrent = this.nzCurrent + 1 |
|
|
|
|
this.progressList[this.nzCurrent] = 0 |
|
|
|
|
this.publicToggleNode().then(data=>{ |
|
|
|
|
//!this.isSuspend? this.autoPlay() : null
|
|
|
|
|
}) |
|
|
|
|
this.progressList.forEach((item,index)=>{ index >= this.nzCurrent? this.progressList[index] = 0 : null }) |
|
|
|
|
this.publicToggleNode() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取进度条 flex分布
|
|
|
|
@ -569,6 +542,8 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
this.contingencyPlanTask = null //关闭弹窗
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
videoDialogType: videoDialog = new videoDialog(true, null); //全景图/视频 弹窗
|
|
|
|
|
|
|
|
|
|
selectRightTopFast: number = 0; //当前选择功能 快捷栏
|
|
|
|
|
selectAdsorb: boolean = false; //吸附状态
|
|
|
|
|
topLevelView: boolean = false; //顶视图状态
|
|
|
|
@ -644,6 +619,15 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//全景图/视频 type
|
|
|
|
|
export class videoDialog { |
|
|
|
|
isVideo: boolean |
|
|
|
|
url: string |
|
|
|
|
constructor(isVideo: boolean, url: string) { |
|
|
|
|
this.isVideo = isVideo |
|
|
|
|
this.url = url |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//设备任务窗口 数据类型
|
|
|
|
|
export class taskDialog { |
|
|
|
|
institution: string; //单位
|
|
|
|
|