openatc-components 0.1.29 → 0.1.30

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.
@@ -500,6 +500,20 @@ export default {
500
500
  }
501
501
  return item.id === ring.id
502
502
  })[0]
503
+ let peddirections = []
504
+ for (let walk of this.sidewalkPhaseData) {
505
+ for (let ped of currPhase.peddirection) {
506
+ // if (stg === walk.phaseid) {
507
+ let objs = {}
508
+ objs.name = walk.name
509
+ objs.id = walk.id
510
+ if (ped === walk.id) {
511
+ peddirections.push(objs)
512
+ peddirections = Array.from(new Set(peddirections))
513
+ }
514
+ // }
515
+ }
516
+ }
503
517
  if (ring.desc) {
504
518
  obj.direction = ring.desc.map(item => { // 虚相位desc为空
505
519
  return {
@@ -508,12 +522,23 @@ export default {
508
522
  }
509
523
  })
510
524
  } else {
511
- obj.direction = currPhase.direction.map(item => {
512
- return {
513
- id: item,
514
- color: '#454545'
515
- }
516
- })
525
+ if (currPhase.direction.length > 0) {
526
+ obj.direction = currPhase.direction.map(item => {
527
+ return {
528
+ id: item,
529
+ peddirection: peddirections,
530
+ color: '#454545'
531
+ }
532
+ })
533
+ } else {
534
+ obj.direction = [
535
+ {
536
+ id: '',
537
+ color: '#454545',
538
+ peddirection: peddirections
539
+ }
540
+ ]
541
+ }
517
542
  }
518
543
  obj.split = split
519
544
  if (ring.sum) {
@@ -524,22 +549,6 @@ export default {
524
549
  obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
525
550
  obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
526
551
  obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
527
- // obj.peddirection = currPhase.peddirection
528
- let peddirections = []
529
- for (let walk of this.sidewalkPhaseData) {
530
- for (let ped of currPhase.peddirection) {
531
- // if (stg === walk.phaseid) {
532
- let objs = {}
533
- objs.name = walk.name
534
- objs.id = walk.id
535
- if (ped === walk.id) {
536
- peddirections.push(objs)
537
- peddirections = Array.from(new Set(peddirections))
538
- }
539
- // }
540
- }
541
- }
542
- obj.peddirection = peddirections
543
552
  // 忽略相位不显示
544
553
  let mode = ring.mode
545
554
  if (mode !== 7) { // 忽略相位不显示
@@ -624,7 +633,7 @@ export default {
624
633
  }
625
634
  })
626
635
  } else {
627
- if (obj.direction && obj.direction > 0) {
636
+ if (currPhase.direction > 0) {
628
637
  obj.direction = currPhase.direction.map(item => {
629
638
  return {
630
639
  id: item,
@@ -12,7 +12,7 @@
12
12
  <template>
13
13
  <div :style="{position: 'reletive'}">
14
14
  <!-- <div> -->
15
- <div :style="{position: 'absolute', left: Data?Data.left:'2px', top: Data?Data.top:0}">
15
+ <div :style="{position: 'absolute', left: Data?Data.left:0, top: Data?Data.top:0}">
16
16
  <svg
17
17
  t="1545378648902"
18
18
  class="icon"
@@ -308,7 +308,7 @@
308
308
  </g>
309
309
  </svg>
310
310
  </div>
311
- <div :style="{position: 'absolute', left: Data?Data.left:'2px', top: Data?Data.top:0}">
311
+ <div :style="{position: 'absolute', left: Data?Data.left:0, top: Data?Data.top:0}">
312
312
  <svg
313
313
  :width="Width"
314
314
  :height="Height"
@@ -862,10 +862,10 @@ export default {
862
862
  refreshShows (showlist) {
863
863
  for (let i = 0; i < 16; i++) {
864
864
  if (this.peoplestatus[i].isshow) {
865
- this.peoplestatusstatus[i].isshow = false
865
+ this.peoplestatus[i].isshow = false
866
866
  }
867
867
  }
868
- if (!showlist[0].peddirection) return
868
+ if (showlist[0].peddirection.length === 0) return
869
869
  for (let i = 0; i < showlist[0].peddirection.length; i++) {
870
870
  for (let j = 0; j < this.peoplestatus.length; j++) {
871
871
  if (showlist[0].peddirection[i].name === this.peoplestatus[j].name) {