openatc-components 0.1.168 → 0.1.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -255,7 +255,12 @@ export default {
255
255
  this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.busPhaseData))
256
256
  if (val.control === 1 || val.control === 2 || val.control === 3) {
257
257
  // 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
258
- this.SpecialControl(val)
258
+ if (val.control === 1) {
259
+ this.getYellowFlashColor()
260
+ } else {
261
+ this.SpecialControl(val)
262
+ }
263
+ this.isHasPhase = false
259
264
  return
260
265
  }
261
266
  if (!val.phase && !this.overlapStatusList) {
@@ -337,7 +342,7 @@ export default {
337
342
  crossType: '', // 路口底图类型
338
343
  isLoaded: false, // 是否成功加载底图
339
344
  isHasPhase: true, // 是否有相位状态数据
340
- phaseControlColorMap: new Map([['黄闪', '#f7b500'], ['全红', '#ff2828'], ['关灯', '#828282'], ['默认', '#fff'], ['方向锁定', '#fff']]),
345
+ phaseControlColorMap: new Map([['全红', '#ff2828'], ['关灯', '#828282'], ['默认', '#fff'], ['方向锁定', '#fff']]),
341
346
  sidewalkPhaseData: [], // 行人相位
342
347
  overlapsidewalkPhaseData: [], // 行人跟随相位
343
348
  resetflag: true, // 离线后,控制行人相位、车道相位reset标识
@@ -381,15 +386,12 @@ export default {
381
386
  },
382
387
  SpecialControl (data) {
383
388
  switch (data.control) {
384
- case 1: this.handleSpecialControlStatus('黄闪')
385
- break
386
389
  case 2: this.handleSpecialControlStatus('全红')
387
390
  break
388
391
  case 3: this.handleSpecialControlStatus('关灯')
389
392
  break
390
393
  default: this.handleSpecialControlStatus('默认')
391
394
  }
392
- this.isHasPhase = false
393
395
  },
394
396
  handleDefaultStatus () {
395
397
  // 恢复默认状态
@@ -467,6 +469,17 @@ export default {
467
469
  this.phaseStatusMap.set(phaseId, phaseInfo)
468
470
  })
469
471
  },
472
+ getYellowFlashColor () {
473
+ let curLanePhaseData = []
474
+ for (let i = 0; i < this.LanePhaseData.length; i++) {
475
+ const data = {
476
+ ...this.LanePhaseData[i],
477
+ type: '黄闪'
478
+ }
479
+ curLanePhaseData.push(data)
480
+ }
481
+ this.LanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
482
+ },
470
483
  getPhaseStatus () {
471
484
  // 得到车道相位状态(颜色)
472
485
  this.comdirePhaseData = []
@@ -62,21 +62,25 @@ export default {
62
62
  return {
63
63
  defaultColor: '#fff', // 默认状态颜色
64
64
  GreenFlashColor: undefined,
65
+ GreenColor: '#77fb65',
66
+ YellowColor: '#f7b500',
65
67
  lastType: ''
66
68
  }
67
69
  },
68
70
  watch: {
69
71
  Data: {
70
72
  handler: function (val) {
71
- if (val.type === 4 && this.lastType === '') {
72
- // 绿闪:绿-》灰-》绿 循环效果
73
- this.GreenFlashColor = '#77fb65'
74
- this.GreenIntervalId = setInterval(() => {
75
- this.GreenFlashColor = !this.GreenFlashColor || this.GreenFlashColor === '#828282' ? '#77fb65' : '#828282'
76
- }, 500)
77
- this.lastType = val.type
73
+ if (this.lastType === '') {
74
+ if (val.type === 4 || val.type === '黄闪') {
75
+ // 绿闪:绿-》灰-》绿 循环效果
76
+ this.GreenFlashColor = val.type === 4 ? this.GreenColor : this.YellowColor
77
+ this.GreenIntervalId = setInterval(() => {
78
+ this.GreenFlashColor = !this.GreenFlashColor || this.GreenFlashColor === '#828282' ? (val.type === 4 ? this.GreenColor : this.YellowColor) : '#828282'
79
+ }, 500)
80
+ this.lastType = val.type
81
+ }
78
82
  }
79
- if (this.GreenIntervalId && val.type !== 4 && val.type !== this.lastType) {
83
+ if (this.GreenIntervalId && val.type !== 4 && val.type !== '黄闪' && val.type !== this.lastType) {
80
84
  clearInterval(this.GreenIntervalId)
81
85
  this.GreenFlashColor = undefined
82
86
  this.lastType = ''