openatc-components 0.1.62 → 0.1.64

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.
@@ -161,10 +161,10 @@ export default {
161
161
  computed: {
162
162
  paddingLeft () {
163
163
  let res = '0%'
164
- if (this.newCycle && this.newCycle > 0) {
165
- let curPercent = (this.newCycle - this.syncTime) / this.newCycle
166
- res = curPercent * 100 + '%'
167
- }
164
+ // if (this.newCycle && this.newCycle > 0) {
165
+ // let curPercent = (this.newCycle - this.syncTime) / this.newCycle
166
+ // res = curPercent * 100 + '%'
167
+ // }
168
168
  if (this.cycle && this.cycle > 0) {
169
169
  let curPercent = (this.cycle - this.syncTime) / (this.max ? this.max : this.cycle)
170
170
  res = curPercent * 100 + '%'
@@ -191,6 +191,7 @@ export default {
191
191
  // this.controlDatas = this.controlData
192
192
  this.getPedPhasePos()
193
193
  if (this.localPatternList) {
194
+ this.max = ''
194
195
  let idPattern = this.localPatternList.filter(item => item.id === this.controlData.patternid)
195
196
  if (idPattern.length === 0 || (this.controlData && this.showCondition)) {
196
197
  this.handleTentivePatternData()
@@ -558,13 +559,13 @@ export default {
558
559
  }
559
560
  obj.split = split
560
561
  if (ring.sum) {
561
- obj.redWidth = ((currPhase.redclear + ring.sum) / cycle * 100).toFixed(3) + '%'
562
+ obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
562
563
  } else {
563
- obj.redWidth = (currPhase.redclear / cycle * 100).toFixed(3) + '%'
564
+ obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
564
565
  }
565
- obj.flashgreen = (currPhase.flashgreen / cycle * 100).toFixed(3) + '%'
566
- obj.yellowWidth = (currPhase.yellow / cycle * 100).toFixed(3) + '%'
567
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / cycle * 100).toFixed(3) + '%'
566
+ obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
567
+ obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
568
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
568
569
  // 忽略相位不显示
569
570
  // let mode = ring.mode
570
571
  // if (mode !== 7) { // 忽略相位不显示
@@ -1111,8 +1112,8 @@ export default {
1111
1112
  newMin.push(minNum)
1112
1113
  let newmaxNum = Math.max.apply(Math, newMax)// 每组最大值
1113
1114
  let newminNum = Math.min.apply(Math, newMin)
1115
+ this.newCycle = newmaxNum + newminNum
1114
1116
  if (newmaxNum === newminNum) {
1115
- this.newCycle = newmaxNum + newminNum
1116
1117
  this.max = newmaxNum + newminNum
1117
1118
  pattern.map(d => {
1118
1119
  d.map(r => {