openatc-components 0.2.9 → 0.2.10

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,7 +47,8 @@ export default {
47
47
  },
48
48
  data () {
49
49
  return {
50
- overlapDatas: []
50
+ overlapDatas: [],
51
+ max: ''
51
52
  }
52
53
  },
53
54
  props: {
@@ -67,6 +68,10 @@ export default {
67
68
  type: Boolean,
68
69
  default: false
69
70
  },
71
+ cycleChange: {
72
+ type: Boolean,
73
+ default: true
74
+ },
70
75
  cycle: {
71
76
  type: Number
72
77
  },
@@ -82,6 +87,13 @@ export default {
82
87
  // 深度观察监听
83
88
  deep: true
84
89
  },
90
+ cycleChange: {
91
+ handler: function (val, oldVal) {
92
+ this.doAdd(this.stageList, this.overlap)
93
+ },
94
+ // 深度观察监听
95
+ deep: true
96
+ },
85
97
  stageList: {
86
98
  handler: function (val, oldVal) {
87
99
  this.doAdd(this.stageList, this.overlap)
@@ -140,6 +152,15 @@ export default {
140
152
  if (findItems.length) findIndexs.push(...findItems.map(m => m.key))
141
153
  })
142
154
  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
+ }
143
164
  return {
144
165
  ...item,
145
166
  peddirection: this.getPedPhasePos(item.peddirection),
@@ -150,8 +171,8 @@ export default {
150
171
  ...sta,
151
172
  direction: this.getRoad(item),
152
173
  // peddirection: this.getPedPhasePos(item.peddirection),
153
- greenWidth: find ? (sta.split / this.cycle * 100).toFixed(3) + '%' : '0%',
154
- redWidth: !find ? (sta.split / this.cycle * 100).toFixed(3) + '%' : '0%'
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%'
155
176
  }
156
177
  })
157
178
  }
@@ -212,7 +212,7 @@
212
212
  @onStageAdvanceendChange="onStageAdvanceendChange"
213
213
  >
214
214
  </stage-bord>
215
- <div v-if="isRing" style="margin-left: 10px">
215
+ <div v-if="isRing" style="margin-left: 20px">
216
216
  <el-button
217
217
  type="primary"
218
218
  @click="