openatc-components 0.2.13 → 0.2.14

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.
@@ -47,8 +47,7 @@ export default {
47
47
  },
48
48
  data () {
49
49
  return {
50
- overlapDatas: [],
51
- max: ''
50
+ overlapDatas: []
52
51
  }
53
52
  },
54
53
  props: {
@@ -68,10 +67,6 @@ export default {
68
67
  type: Boolean,
69
68
  default: false
70
69
  },
71
- cycleChange: {
72
- type: Boolean,
73
- default: true
74
- },
75
70
  cycle: {
76
71
  type: Number
77
72
  },
@@ -87,13 +82,6 @@ export default {
87
82
  // 深度观察监听
88
83
  deep: true
89
84
  },
90
- cycleChange: {
91
- handler: function (val, oldVal) {
92
- this.doAdd(this.stageList, this.overlap)
93
- },
94
- // 深度观察监听
95
- deep: true
96
- },
97
85
  stageList: {
98
86
  handler: function (val, oldVal) {
99
87
  this.doAdd(this.stageList, this.overlap)
@@ -152,15 +140,6 @@ export default {
152
140
  if (findItems.length) findIndexs.push(...findItems.map(m => m.key))
153
141
  })
154
142
  findIndexs = Array.from(new Set(findIndexs))
155
- if (this.cycleChange) {
156
- const globalParamModel = this.$store.getters.globalParamModel
157
- let pattern = globalParamModel.getParamsByType('patternList')
158
- const allCycle = pattern.map(item => item.cycle)
159
- let cycle = Math.max(...allCycle)
160
- this.max = cycle
161
- } else {
162
- this.max = ''
163
- }
164
143
  return {
165
144
  ...item,
166
145
  peddirection: this.getPedPhasePos(item.peddirection),
@@ -171,8 +150,8 @@ export default {
171
150
  ...sta,
172
151
  direction: this.getRoad(item),
173
152
  // peddirection: this.getPedPhasePos(item.peddirection),
174
- greenWidth: find ? (sta.split / (this.max ? this.max : this.cycle) * 100).toFixed(3) + '%' : '0%',
175
- redWidth: !find ? (sta.split / (this.max ? this.max : this.cycle) * 100).toFixed(3) + '%' : '0%'
153
+ greenWidth: find ? (sta.split / this.cycle * 100).toFixed(3) + '%' : '0%',
154
+ redWidth: !find ? (sta.split / this.cycle * 100).toFixed(3) + '%' : '0%'
176
155
  }
177
156
  })
178
157
  }
@@ -432,9 +432,9 @@ export default {
432
432
  },
433
433
  getStage () {
434
434
  if (!this.stagesChange) return
435
- const globalParamModel = this.$store.getters.globalParamModel
436
- let pattern = globalParamModel.getParamsByType('patternList')
437
- let mapAdd = (this.allPatternList ? this.allPatternList : pattern).map(item => item.stagesList).map(item => {
435
+ // const globalParamModel = this.$store.getters.globalParamModel
436
+ // let pattern = globalParamModel.getParamsByType('patternList')
437
+ let mapAdd = this.allPatternList.map(item => item.stagesList).map(item => {
438
438
  return item.map(val => {
439
439
  return val.stageSplit ? val.stageSplit : val.split
440
440
  })
@@ -921,6 +921,7 @@ export default {
921
921
  }
922
922
  },
923
923
  handleCurrentChange (val) { // 两个ring的数据
924
+ this.patternInfo = []
924
925
  if (val === null || val.length === 0) return
925
926
  if (this.controlPhase && this.controlPhase.phase && this.controlPhase.phase[0].split) {
926
927
  val.map(i => {
@@ -1051,9 +1052,9 @@ export default {
1051
1052
  this.fillGap(ringTeams, val)
1052
1053
  }
1053
1054
  if (this.cycleChange) {
1054
- const globalParamModel = this.$store.getters.globalParamModel
1055
- let pattern = globalParamModel.getParamsByType('patternList')
1056
- const allCycle = pattern.map(item => item.cycle)
1055
+ // const globalParamModel = this.$store.getters.globalParamModel
1056
+ // let pattern = globalParamModel.getParamsByType('patternList')
1057
+ const allCycle = this.patternList.map(item => item.cycle)
1057
1058
  let cycle = Math.max(...allCycle)
1058
1059
  this.max = cycle
1059
1060
  } else {
@@ -1062,7 +1063,7 @@ export default {
1062
1063
  let barrier = this.step2(ringTeams, newPattern)
1063
1064
  let barrierLeft = barrier.map(item => item)// 屏障左移显示出人行横道
1064
1065
  this.barrierList = barrierLeft.map(j => {
1065
- return (j / (this.max ? this.max : cycle) * 100) + '%'
1066
+ return (j / (this.max ? this.max : this.newCycle) * 100) + '%'
1066
1067
  })
1067
1068
  // this.barrierList.unshift(0)
1068
1069
  }
@@ -212,7 +212,7 @@
212
212
  @onStageAdvanceendChange="onStageAdvanceendChange"
213
213
  >
214
214
  </stage-bord>
215
- <div v-if="isRing" style="margin-left: 20px">
215
+ <div v-if="isRing" style="margin-left: 10px">
216
216
  <el-button
217
217
  type="primary"
218
218
  @click="
@@ -479,27 +479,9 @@ export default {
479
479
  // this.patternOne = this.allPatternList.filter(item => {
480
480
  // return item.id === Number(this.manualInfo.tempPatternid)
481
481
  // })
482
- this.setStageList(this.patternOne[0].stagesList, this.patternOne[0].id)
482
+ // this.setStageList(this.patternOne[0].stagesList, this.patternOne[0].id)
483
483
  }
484
- // let pattern = this.allPatternList
485
- // for (let i = 0; i < pattern.length; i++) {
486
- // this.patternOne[0].cycle = this.changeStageCycle(pattern[i])
487
- // }
488
484
  },
489
- // changeStageCycle (pattern) {
490
- // let rings = pattern.stagesList
491
- // let stageCycleList = rings.map(item => {
492
- // if (item.stageSplit) {
493
- // return item.stageSplit
494
- // } else {
495
- // return 0
496
- // }
497
- // })
498
- // let maxCycle = stageCycleList.reduce((a, b) => {
499
- // return a + b
500
- // }, 0)
501
- // return maxCycle
502
- // },
503
485
  setStageList (stageChange, id) {
504
486
  // let patternList = this.globalParamModel.getParamsByType('patternList')
505
487
  // let patternList = this.allPatternList
@@ -906,6 +888,7 @@ export default {
906
888
  this.handleStageData(this.patternOne[0].rings)
907
889
  },
908
890
  handleStageData (rings) { // stagesList
891
+ if (!rings) return
909
892
  for (let i = 0; i < rings.length; i++) {
910
893
  if (rings[i].length > 0) {
911
894
  let phaseList = []