openatc-components 0.5.45 → 0.5.47

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.
@@ -433,6 +433,9 @@ export default {
433
433
  },
434
434
  methods: {
435
435
  compareIsChangedPhase (newCrossStatus, oldCrossStatus) {
436
+ if (!oldCrossStatus || !newCrossStatus) return
437
+ if (!newCrossStatus.phase) return
438
+ if (!oldCrossStatus.phase) return
436
439
  if (newCrossStatus.control === 1 || newCrossStatus.control === 2 || newCrossStatus.control === 3) return
437
440
  // 返回的相位状态改变后,按照返回的相位状态更新路口相位显示(下个周期生效)
438
441
  let newPhaseIds = newCrossStatus.phase.map(item => item.id)
@@ -492,7 +495,9 @@ export default {
492
495
  this.getOverlapPhaseStatus()
493
496
  this.getRoadwayLightStatus()
494
497
  this.getCurPhaseCountdown()
495
- this.getCurStageCountdown()
498
+ if (this.isHasStageCountdown) {
499
+ this.getCurStageCountdown()
500
+ }
496
501
  this.getBusPhaseStatus()
497
502
  if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
498
503
  // 城市道路和路段行人过街才显示人行道状态
@@ -852,7 +857,7 @@ export default {
852
857
  stagesList () {
853
858
  let list = []
854
859
  this.isHasStageCountdown = false
855
- if (this.crossStatusData && this.crossStatusData.stages && this.crossInfo.phaseList && this.crossInfo.phaseList.length > 0) {
860
+ if (this.crossStatusData && this.crossStatusData.stages && this.crossInfo && this.crossInfo.phaseList && this.crossInfo.phaseList.length > 0) {
856
861
  this.isHasStageCountdown = true
857
862
  let ringDataModel = new RingDataModel(this.crossStatusData, this.crossInfo.phaseList)
858
863
  list = ringDataModel.getStageData()
@@ -890,11 +895,14 @@ export default {
890
895
  // console.log(this.stageCountdownList)
891
896
  },
892
897
  getshowped (peddirection) {
893
- let peddirarr = peddirection.map(peddir => ({
894
- id: peddir,
895
- name: this.PhaseDataModel.getSidePos(peddir).name,
896
- color: 'rgba(255, 255, 255, 0.4)'
897
- }))
898
+ let peddirarr = []
899
+ if (peddirection) {
900
+ peddirection.map(peddir => ({
901
+ id: peddir,
902
+ name: this.PhaseDataModel.getSidePos(peddir).name,
903
+ color: 'rgba(255, 255, 255, 0.4)'
904
+ }))
905
+ }
898
906
  return peddirarr
899
907
  },
900
908
  getIntersectionInfo () {
@@ -1025,20 +1033,22 @@ export default {
1025
1033
  this.busPhaseData = []
1026
1034
  this.crossInfo.phaseList.forEach((ele, i) => {
1027
1035
  if (ele.controltype >= 3 && ele.controltype <= 6) {
1028
- ele.direction.forEach((dir, index) => {
1029
- // 车道相位
1030
- this.busPhaseData.push({
1031
- key: this.CrossDiagramMgr.getUniqueKey('busphase'),
1032
- phaseid: ele.id, // 相位id,用于对应相位状态
1033
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1034
- name: this.PhaseDataModel.getBusPhasePos(dir).name,
1035
- left: this.PhaseDataModel.getBusPhasePos(dir).x,
1036
- top: this.PhaseDataModel.getBusPhasePos(dir).y,
1037
- busleft: this.PhaseDataModel.getBusMapPos(dir).x,
1038
- bustop: this.PhaseDataModel.getBusMapPos(dir).y,
1039
- controltype: ele.controltype
1036
+ if (ele.direction) {
1037
+ ele.direction.forEach((dir, index) => {
1038
+ // 车道相位
1039
+ this.busPhaseData.push({
1040
+ key: this.CrossDiagramMgr.getUniqueKey('busphase'),
1041
+ phaseid: ele.id, // 相位id,用于对应相位状态
1042
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1043
+ name: this.PhaseDataModel.getBusPhasePos(dir).name,
1044
+ left: this.PhaseDataModel.getBusPhasePos(dir).x,
1045
+ top: this.PhaseDataModel.getBusPhasePos(dir).y,
1046
+ busleft: this.PhaseDataModel.getBusMapPos(dir).x,
1047
+ bustop: this.PhaseDataModel.getBusMapPos(dir).y,
1048
+ controltype: ele.controltype
1049
+ })
1040
1050
  })
1041
- })
1051
+ }
1042
1052
  }
1043
1053
  })
1044
1054
  // 去掉重复方向的数据
@@ -1055,17 +1065,19 @@ export default {
1055
1065
  this.LanePhaseData = []
1056
1066
  this.crossInfo.phaseList.forEach((ele, i) => {
1057
1067
  if (ele.controltype === undefined || ele.controltype <= 2) {
1058
- ele.direction.forEach((dir, index) => {
1059
- // 车道相位
1060
- this.LanePhaseData.push({
1061
- key: this.CrossDiagramMgr.getUniqueKey('phase'),
1062
- phaseid: ele.id, // 相位id,用于对应相位状态
1063
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1064
- name: this.PhaseDataModel.getPhase(dir).name,
1065
- left: this.PhaseDataModel.getPhase(dir).x,
1066
- top: this.PhaseDataModel.getPhase(dir).y
1068
+ if (ele.direction) {
1069
+ ele.direction.forEach((dir, index) => {
1070
+ // 车道相位
1071
+ this.LanePhaseData.push({
1072
+ key: this.CrossDiagramMgr.getUniqueKey('phase'),
1073
+ phaseid: ele.id, // 相位id,用于对应相位状态
1074
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1075
+ name: this.PhaseDataModel.getPhase(dir).name,
1076
+ left: this.PhaseDataModel.getPhase(dir).x,
1077
+ top: this.PhaseDataModel.getPhase(dir).y
1078
+ })
1067
1079
  })
1068
- })
1080
+ }
1069
1081
  }
1070
1082
  })
1071
1083
  // 去掉重复方向的数据
@@ -1098,14 +1110,16 @@ export default {
1098
1110
  // 匝道车道相位信息
1099
1111
  this.LanePhaseData = []
1100
1112
  this.crossInfo.phaseList.forEach((ele, i) => {
1101
- ele.direction.forEach((dir, index) => {
1102
- if (ele.controltype === 0) {
1103
- this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getMainPhasePos)
1104
- }
1105
- if (ele.controltype === 1) {
1106
- this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getSidePhasePos)
1107
- }
1108
- })
1113
+ if (ele.direction) {
1114
+ ele.direction.forEach((dir, index) => {
1115
+ if (ele.controltype === 0) {
1116
+ this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getMainPhasePos)
1117
+ }
1118
+ if (ele.controltype === 1) {
1119
+ this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getSidePhasePos)
1120
+ }
1121
+ })
1122
+ }
1109
1123
  })
1110
1124
  // 去掉重复方向的数据
1111
1125
  this.LanePhaseData = Array.from(new Set(this.LanePhaseData.map(item => item.id)))
@@ -67,6 +67,7 @@
67
67
  class="ring-nums"
68
68
  :ref="'inputNumbers' + item.id"
69
69
  size="small"
70
+ controls-position="right"
70
71
  :controls="false"
71
72
  :min="0"
72
73
  :step="1"
@@ -88,8 +89,10 @@
88
89
  size="small"
89
90
  :min="0"
90
91
  :step="1"
92
+ controls-position="right"
91
93
  v-model.number="item.split"
92
94
  @change="handleEdit(item)"
95
+ style="width: 80px"
93
96
  ></el-input-number>
94
97
  </div>
95
98
  <div style="width:50px;" v-for="(bus,index3) in busPhaseData" :key="index3">