openatc-components 0.1.177 → 0.1.178

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.177",
3
+ "version": "0.1.178",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -9,6 +9,7 @@
9
9
  </StageStatus>
10
10
  <PatternStatus
11
11
  :showBarrier="showBarrier"
12
+ :controlPhase="controlPhase"
12
13
  :localPatternList="localPatternList"
13
14
  :showCondition="showCondition"
14
15
  :contrloType="contrloType"
@@ -50,6 +51,9 @@ export default {
50
51
  type: Boolean,
51
52
  default: false
52
53
  },
54
+ controlPhase: {
55
+ type: Object
56
+ },
53
57
  localPatternList: {
54
58
  type: Array
55
59
  },
@@ -48,7 +48,7 @@
48
48
  <div class="divider" :style="{'left':item, 'height':barrierHeight}"></div>
49
49
  </div>
50
50
  </div>
51
- <div v-show="(syncTime && cycle && cycle>0) || (syncTime && newCycle && newCycle>0)">
51
+ <div v-show="(this.curtime>0 && cycle && cycle>0) || (this.curtime>0 && newCycle && newCycle>0)">
52
52
  <div class="curTimeDiv" :style="{'left':paddingLeft, 'background-color': '#299BCC'}">{{ timeNumDevide }}</div>
53
53
  <div class="curTimeLine" :style="{'left':paddingLeft, 'height':barrierHeight}"></div>
54
54
  </div>
@@ -112,6 +112,8 @@ export default {
112
112
  sidewalkPhaseData: [],
113
113
  // controlDatas: this.controlData,
114
114
  max: '',
115
+ fixCycle: '',
116
+ curtime: 0,
115
117
  stageLists: [],
116
118
  busPhaseData: [], // 公交相位数据
117
119
  patternInfo: []
@@ -125,6 +127,9 @@ export default {
125
127
  stagesChange: {
126
128
  type: Array
127
129
  },
130
+ controlPhase: {
131
+ type: Object
132
+ },
128
133
  contrloType: {
129
134
  type: String
130
135
  },
@@ -171,11 +176,11 @@ export default {
171
176
  paddingLeft () {
172
177
  let res = '0%'
173
178
  if (this.contrloCycle > 0) {
174
- let curPercent = (this.contrloCycle - this.syncTime) / (this.max ? this.max : this.contrloCycle)
179
+ let curPercent = this.curtime / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
175
180
  res = curPercent * 100 + '%'
176
181
  }
177
182
  if (this.cycles > 0) {
178
- let curPercent = (this.cycles - this.syncTime) / (this.max ? this.max : this.cycles)
183
+ let curPercent = this.curtime / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
179
184
  res = curPercent * 100 + '%'
180
185
  }
181
186
  return res
@@ -183,17 +188,26 @@ export default {
183
188
  timeNumDevide () {
184
189
  if (this.contrloCycle > 0) {
185
190
  // let res = (this.contrloCycle - this.syncTime) + '/' + this.contrloCycle
186
- let res = this.controlData.curTime + '/' + this.contrloCycle
191
+ let res = this.curtime + '/' + (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
187
192
  return res
188
193
  }
189
194
  if (this.cycles > 0) {
190
195
  // let res = (this.cycles - this.syncTime) + '/' + this.cycles
191
- let res = this.controlData.curTime + '/' + this.cycles
196
+ let res = this.curtime + '/' + (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
192
197
  return res
193
198
  }
194
199
  }
195
200
  },
196
201
  watch: {
202
+ controlPhase: {
203
+ handler: function (val, oldVal) {
204
+ if (this.controlPhase && this.controlPhase.curTime) {
205
+ this.curtime = this.controlPhase.curTime
206
+ }
207
+ },
208
+ // 深度观察监听
209
+ deep: true
210
+ },
197
211
  controlData: {
198
212
  handler: function (val, oldVal) {
199
213
  if (this.contrloType === 'stage') {
@@ -211,6 +225,8 @@ export default {
211
225
  }
212
226
  this.handleBarrierHeight()
213
227
  }
228
+ if (!this.controlData.curTime) return
229
+ this.curtime = this.controlData.curTime
214
230
  },
215
231
  // 深度观察监听
216
232
  deep: true
@@ -857,6 +873,13 @@ export default {
857
873
  },
858
874
  handleCurrentChange (val) { // 两个ring的数据
859
875
  if (val === null || val.length === 0) return
876
+ if (this.controlPhase.phase && this.controlPhase.phase[0].split) {
877
+ val.map(i => {
878
+ i.map(j => {
879
+ j.value = this.controlPhase.phase.filter(item => item.id === j.id)[0].split
880
+ })
881
+ })
882
+ }
860
883
  // 按环序分组
861
884
  let ringlength = []
862
885
  let ringsequence = val.map(item => {
@@ -877,6 +900,7 @@ export default {
877
900
  }) : 0
878
901
  }) : 0
879
902
  let cycle = Math.max(...splitCycle)// 每个环的周期最大值
903
+ this.fixCycle = cycle// 每个环的周期最大值
880
904
  let newRings = ringsequence.filter(item => item)
881
905
  let minLength = Math.min(...ringlength)
882
906
  let resultArrs = [] // 环1分组