openatc-components 0.1.51 → 0.1.53

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -291,6 +291,7 @@ export default {
291
291
  let currPhase = this.phaseList.filter((item) => {
292
292
  return item.id === stg
293
293
  })[0]
294
+ if (!currPhase.peddirection) return
294
295
  for (let walk of this.sidewalkPhaseData) {
295
296
  for (let ped of currPhase.peddirection) {
296
297
  if (stg === walk.phaseid) {
@@ -509,16 +510,20 @@ export default {
509
510
  })[0]
510
511
  let peddirections = []
511
512
  for (let walk of this.sidewalkPhaseData) {
512
- for (let ped of currPhase.peddirection) {
513
- // if (stg === walk.phaseid) {
514
- let objs = {}
515
- objs.name = walk.name
516
- objs.id = walk.id
517
- if (ped === walk.id) {
518
- peddirections.push(objs)
519
- peddirections = Array.from(new Set(peddirections))
513
+ if (currPhase.peddirection) {
514
+ for (let ped of currPhase.peddirection) {
515
+ // if (stg === walk.phaseid) {
516
+ let objs = {}
517
+ objs.name = walk.name
518
+ objs.id = walk.id
519
+ if (ped === walk.id) {
520
+ peddirections.push(objs)
521
+ peddirections = Array.from(new Set(peddirections))
522
+ }
523
+ // }
520
524
  }
521
- // }
525
+ } else {
526
+ peddirections = []
522
527
  }
523
528
  }
524
529
  if (ring.desc) {
@@ -720,16 +725,20 @@ export default {
720
725
  })[0]
721
726
  let peddirections = []
722
727
  for (let walk of this.sidewalkPhaseData) {
723
- for (let ped of currPhase.peddirection) {
724
- // if (stg === walk.phaseid) {
725
- let objs = {}
726
- objs.name = walk.name
727
- objs.id = walk.id
728
- if (ped === walk.id) {
729
- peddirections.push(objs)
730
- peddirections = Array.from(new Set(peddirections))
728
+ if (currPhase.peddirection) {
729
+ for (let ped of currPhase.peddirection) {
730
+ // if (stg === walk.phaseid) {
731
+ let objs = {}
732
+ objs.name = walk.name
733
+ objs.id = walk.id
734
+ if (ped === walk.id) {
735
+ peddirections.push(objs)
736
+ peddirections = Array.from(new Set(peddirections))
737
+ }
738
+ // }
731
739
  }
732
- // }
740
+ } else {
741
+ peddirections = []
733
742
  }
734
743
  }
735
744
  if (ring.desc) {
@@ -908,16 +917,20 @@ export default {
908
917
  })[0]
909
918
  let peddirections = []
910
919
  for (let walk of this.sidewalkPhaseData) {
911
- for (let ped of currPhase.peddirection) {
912
- // if (stg === walk.phaseid) {
913
- let objs = {}
914
- objs.name = walk.name
915
- objs.id = walk.id
916
- if (ped === walk.id) {
917
- peddirections.push(objs)
918
- peddirections = Array.from(new Set(peddirections))
920
+ if (currPhase.peddirection) {
921
+ for (let ped of currPhase.peddirection) {
922
+ // if (stg === walk.phaseid) {
923
+ let objs = {}
924
+ objs.name = walk.name
925
+ objs.id = walk.id
926
+ if (ped === walk.id) {
927
+ peddirections.push(objs)
928
+ peddirections = Array.from(new Set(peddirections))
929
+ }
930
+ // }
919
931
  }
920
- // }
932
+ } else {
933
+ peddirections = []
921
934
  }
922
935
  }
923
936
  if (ring.desc && ring.desc.length > 0) {
@@ -406,7 +406,11 @@ export default {
406
406
  }
407
407
  return
408
408
  }
409
- this.crossStatusData = JSON.parse(JSON.stringify(data.data.data.data))
409
+ if (data.data.data.data) {
410
+ this.crossStatusData = JSON.parse(JSON.stringify(data.data.data.data))
411
+ } else {
412
+ this.crossStatusData = {}
413
+ }
410
414
  let TscData = JSON.parse(JSON.stringify(data.data.data.data))
411
415
  // this.handleStageData(TscData) // 处理阶段(驻留)stage数据
412
416
  this.controlData = this.handleGetData(TscData)
@@ -624,7 +628,9 @@ export default {
624
628
  this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
625
629
  return
626
630
  }
627
- this.phaseList = res.data.data.phaseList
631
+ if (res.data.data && res.data.data.phaseList) {
632
+ this.phaseList = res.data.data.phaseList
633
+ }
628
634
  })
629
635
  },
630
636
  getPlatform () {
@@ -70,6 +70,7 @@ export default class RingDataModel {
70
70
  let peddirections = []
71
71
  let sidewalkPhaseData = this.getPedPhasePos()
72
72
  for (let walk of sidewalkPhaseData) {
73
+ if (!phaseList.peddirection) return
73
74
  for (let ped of phaseList.peddirection) {
74
75
  // if (stg === walk.phaseid) {
75
76
  let obj = {}