openatc-components 0.5.46 → 0.5.48

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.
@@ -100,10 +100,10 @@
100
100
  </div>
101
101
  <!-- 车道灯 -->
102
102
  <div v-if="resetflag" class="roadwayLightIcon">
103
- <div :key="item.id" v-for="item in roadwayLightData" :style="{position: 'absolute', left: item.lightx, top: item.lighty}">
103
+ <div :key="item.id" v-for="item in compRoadwayLightData" :style="{position: 'absolute', left: item.lightx, top: item.lighty}">
104
104
  <svg t="1773302927218" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="22220" width="17.59" height="17.59"><path d="M868.018201 392.930029h-79.379804V252.956975C789.432195 101.34155 665.070503 0 512.13208 0S234.567366 102.664546 234.567366 254.279972v138.650057h-79.379804A68.266631 68.266631 0 0 0 87.450129 460.932062v495.065377a68.266631 68.266631 0 0 0 68.531231 68.002032H868.018201a68.266631 68.266631 0 0 0 68.531231-68.002032V460.932062a68.266631 68.266631 0 0 0-68.531231-68.002033z m-317.519215 328.367789v108.221133a8.996378 8.996378 0 0 1-8.996378 8.996378h-59.005655a8.996378 8.996378 0 0 1-8.996377-8.996378v-108.221133a84.407192 84.407192 0 0 1-46.834085-74.881615 85.465589 85.465589 0 0 1 170.666579 0 83.877993 83.877993 0 0 1-46.834084 74.881615z m132.299673-326.515593H341.200902V243.695998c0-79.379804 76.73381-144.735843 170.931178-144.735842s170.931178 65.091439 170.931178 144.735842z" fill="#fff" p-id="22221"></path></svg>
105
105
  </div>
106
- <PhaseIconSvg v-for="(item, index) in roadwayLightData" :key="item.key + '-' + index" :Data="item" :clickMode="false" />
106
+ <PhaseIconSvg v-for="(item, index) in compRoadwayLightData" :key="item.key + '-' + index" :Data="item" :clickMode="false" />
107
107
  </div>
108
108
  <!-- 公交相位 -->
109
109
  <div v-if="resetflag && !isVipRoute" class="busIcon">
@@ -407,6 +407,7 @@ export default {
407
407
  comdireOverlapPhaseData: [], // 对比相同方向车道跟随相位数据后,被删减的唯一direction的数组
408
408
  busPhaseData: [], // 公交相位数据
409
409
  comdireBusPhaseData: [], // 对比相同方向公交车道数据后,被删减的唯一direction的数组
410
+ compRoadwayLightData: [], // 车道灯状态映射过的车道灯数据
410
411
  channelStatusMap: new Map(), // 通道实时状态映射
411
412
  channelStatusList: [], // 通道实时状态列表
412
413
  phaseDirMap: new Map(),
@@ -464,6 +465,9 @@ export default {
464
465
  this.SpecialControl(val)
465
466
  }
466
467
  this.isHasPhase = false
468
+ // 特殊控制拿不到状态数据,需要重置车道灯map,状态映射车道灯消失
469
+ this.roadwayLightStatusMap = new Map()
470
+ this.getRoadwayLightStatus()
467
471
  return
468
472
  }
469
473
  if (!val.phase && !this.overlapStatusList) {
@@ -789,7 +793,7 @@ export default {
789
793
  }
790
794
  curData.push(data)
791
795
  }
792
- this.roadwayLightData = JSON.parse(JSON.stringify(curData))
796
+ this.compRoadwayLightData = JSON.parse(JSON.stringify(curData))
793
797
  },
794
798
  getBusPhaseStatus () {
795
799
  // 得到公交车道相位状态(颜色)
@@ -1211,7 +1215,7 @@ export default {
1211
1215
  })
1212
1216
  // 去掉重复方向的数据
1213
1217
  const ids = Array.from(new Set(this.roadwayLightData.map(item => item.id)))
1214
- this.roadwayLightData = ids.map(id => this.roadwayLightData.find(item => item.id === id))
1218
+ this.compRoadwayLightData = ids.map(id => this.roadwayLightData.find(item => item.id === id))
1215
1219
  },
1216
1220
  getEffectDirectionPos () {
1217
1221
  this.effectDirData = []
@@ -80,9 +80,14 @@ export default {
80
80
  if (this.isVipRoute) {
81
81
  this.handleStatus()
82
82
  }
83
- if (this.lastType === '') {
84
- if (val.type === 4 || val.type === '黄闪' || val.type === 5 || val.type === 6) {
85
- // 绿闪:绿-》灰-》绿 循环效果
83
+ if (val.type === 4 || val.type === '黄闪' || val.type === 5 || val.type === 6) {
84
+ // type黄闪代表全部相位黄闪状态
85
+ // type 4绿闪、5黄闪、6 红闪
86
+ if (val.type !== this.lastType) {
87
+ // 清除旧的
88
+ if (this.GreenIntervalId) {
89
+ clearInterval(this.GreenIntervalId)
90
+ }
86
91
  let highlightColor = ''
87
92
  if (val.type === 4) {
88
93
  highlightColor = this.GreenColor
@@ -101,7 +106,11 @@ export default {
101
106
  }
102
107
  }
103
108
  if (this.GreenIntervalId && val.type !== 4 && val.type !== '黄闪' && val.type !== 5 && val.type !== 6 && val.type !== this.lastType) {
104
- clearInterval(this.GreenIntervalId)
109
+ // 非闪烁状态 → 清除
110
+ if (this.GreenIntervalId) {
111
+ clearInterval(this.GreenIntervalId)
112
+ this.GreenIntervalId = null
113
+ }
105
114
  this.FlashColor = undefined
106
115
  this.lastType = ''
107
116
  }
@@ -100,11 +100,14 @@ export default {
100
100
  if (this.isVipRoute || this.customClick) {
101
101
  this.handleStatus()
102
102
  }
103
- if (this.lastStatus === '') {
103
+ if (val.type === 4 || val.type === '黄闪' || val.type === 5 || val.type === 6) {
104
104
  // type黄闪代表全部相位黄闪状态
105
105
  // type 4绿闪、5黄闪、6 红闪
106
- if (val.type === 4 || val.type === '黄闪' || val.type === 5 || val.type === 6) {
107
- // 绿闪:绿-》灰-》绿 循环效果
106
+ if (val.type !== this.lastStatus) {
107
+ // 清除旧的
108
+ if (this.GreenIntervalId) {
109
+ clearInterval(this.GreenIntervalId)
110
+ }
108
111
  let highlightColor = ''
109
112
  if (val.type === 4) {
110
113
  highlightColor = this.GreenColor
@@ -123,7 +126,11 @@ export default {
123
126
  }
124
127
  }
125
128
  if (this.GreenIntervalId && val.type !== 4 && val.type !== '黄闪' && val.type !== 5 && val.type !== 6 && val.type !== this.lastStatus) {
126
- clearInterval(this.GreenIntervalId)
129
+ // 非闪烁状态 → 清除
130
+ if (this.GreenIntervalId) {
131
+ clearInterval(this.GreenIntervalId)
132
+ this.GreenIntervalId = null
133
+ }
127
134
  this.FlashColor = undefined
128
135
  this.lastStatus = ''
129
136
  }
@@ -623,18 +623,22 @@ export default {
623
623
  return item.id === stg
624
624
  })[0]
625
625
  if (!currPhase) return
626
- if (!currPhase.peddirection) return
626
+ // if (!currPhase.peddirection) return
627
627
  for (let walk of this.sidewalkPhaseData) {
628
- for (let ped of currPhase.peddirection) {
629
- if (stg === walk.phaseid) {
630
- let obj = {}
631
- obj.name = walk.name
632
- obj.id = walk.id
633
- if (ped === walk.id) {
634
- peddirections.push(obj)
635
- peddirections = Array.from(new Set(peddirections))
628
+ if (currPhase.peddirection) {
629
+ for (let ped of currPhase.peddirection) {
630
+ if (stg === walk.phaseid) {
631
+ let obj = {}
632
+ obj.name = walk.name
633
+ obj.id = walk.id
634
+ if (ped === walk.id) {
635
+ peddirections.push(obj)
636
+ peddirections = Array.from(new Set(peddirections))
637
+ }
636
638
  }
637
639
  }
640
+ } else {
641
+ peddirections = []
638
642
  }
639
643
  }
640
644
  ped.push(...peddirections)
@@ -698,7 +702,7 @@ export default {
698
702
  let currPhase = this.phaseList.filter((item) => {
699
703
  return item.id === stg
700
704
  })[0]
701
- if (currPhase !== undefined) {
705
+ if (currPhase !== undefined && currPhase.direction) {
702
706
  directionList.push(...currPhase.direction)
703
707
  directionList = Array.from(new Set(directionList))
704
708
  }
@@ -179,7 +179,7 @@ export default {
179
179
  let phasedesc = this.phaseOption.filter((item) => {
180
180
  return item.id === id
181
181
  })[0].direction
182
- if (phasedesc.length === 0) return id
182
+ if (!phasedesc || phasedesc.length === 0) return id
183
183
  let description = getPhaseDesc(phasedesc, this.$i18n)
184
184
  return id + '-' + description
185
185
  },
@@ -188,22 +188,31 @@ export default {
188
188
  this.dirArr = []
189
189
  this.phaseOption.filter((item) => {
190
190
  if (item.id === data) {
191
- if (item.direction.length === 0) {
192
- let recd = {
193
- id: 0,
194
- peddirection: this.getPed(item.peddirection),
195
- color: color
196
- }
197
- this.dirArr.push(recd)
198
- } else {
199
- for (let rec of item.direction) {
191
+ if (item.direction) {
192
+ if (item.direction.length === 0) {
200
193
  let recd = {
201
- id: rec,
194
+ id: 0,
202
195
  peddirection: this.getPed(item.peddirection),
203
196
  color: color
204
197
  }
205
198
  this.dirArr.push(recd)
199
+ } else {
200
+ for (let rec of item.direction) {
201
+ let recd = {
202
+ id: rec,
203
+ peddirection: this.getPed(item.peddirection),
204
+ color: color
205
+ }
206
+ this.dirArr.push(recd)
207
+ }
206
208
  }
209
+ } else {
210
+ let recd = {
211
+ id: 0,
212
+ peddirection: this.getPed(item.peddirection),
213
+ color: color
214
+ }
215
+ this.dirArr.push(recd)
207
216
  }
208
217
  }
209
218
  })
@@ -239,22 +248,31 @@ export default {
239
248
  let color = getTheme() === 'light' ? '#1E1E1E' : '#F1F3F4'
240
249
  this.Options = list.map((item, index) => {
241
250
  let dirArr = []
242
- if (item.direction.length === 0) {
243
- let recd = {
244
- id: 0,
245
- peddirection: this.getPed(item.peddirection),
246
- color: color
247
- }
248
- dirArr.push(recd)
249
- } else {
250
- for (let rec of item.direction) {
251
+ if (item.direction) {
252
+ if (item.direction.length === 0) {
251
253
  let recd = {
252
- id: rec,
254
+ id: 0,
253
255
  peddirection: this.getPed(item.peddirection),
254
256
  color: color
255
257
  }
256
258
  dirArr.push(recd)
259
+ } else {
260
+ for (let rec of item.direction) {
261
+ let recd = {
262
+ id: rec,
263
+ peddirection: this.getPed(item.peddirection),
264
+ color: color
265
+ }
266
+ dirArr.push(recd)
267
+ }
268
+ }
269
+ } else {
270
+ let recd = {
271
+ id: 0,
272
+ peddirection: this.getPed(item.peddirection),
273
+ color: color
257
274
  }
275
+ dirArr.push(recd)
258
276
  }
259
277
  let name = ''
260
278
  name = this.$t('openatccomponents.pattern.phase') + item.id
@@ -313,6 +331,7 @@ export default {
313
331
  })
314
332
  },
315
333
  getPed (data) {
334
+ if (!data) return
316
335
  let ped = []
317
336
  let peddirections = []
318
337
  let color = getTheme() === 'light' ? '#1E1E1E' : '#F1F3F4'