openatc-components 0.1.85 → 0.1.89

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.
@@ -121,19 +121,19 @@ export default {
121
121
  this.getFaultById()
122
122
  },
123
123
  formatterBoardType (row) {
124
- return formatBoardType(row)
124
+ return formatBoardType(row, this.$i18n)
125
125
  },
126
126
  m_byFaultDescValue (row) {
127
- return formatFaultDescValue(row)
127
+ return formatFaultDescValue(row, this.$i18n)
128
128
  },
129
129
  m_wSubFaultType (row) {
130
- return formatSubFaultType(row)
130
+ return formatSubFaultType(row, this.$i18n)
131
131
  },
132
132
  m_byFaultLevel (row) {
133
- return formatFaultLevel(row)
133
+ return formatFaultLevel(row, this.$i18n)
134
134
  },
135
135
  m_wFaultTypes (row) {
136
- return formatFaultTypes(row)
136
+ return formatFaultTypes(row, this.$i18n)
137
137
  },
138
138
  handleEnumerateCheck (row, enumerate) {
139
139
  enumerateCheck(row.agentid, row.m_wFaultID, enumerate).then(res => {
@@ -154,7 +154,7 @@ export default {
154
154
  })
155
155
  },
156
156
  formatterEnumerate (row) {
157
- return formatEnumerate(row)
157
+ return formatEnumerate(row, this.$i18n)
158
158
  }
159
159
  }
160
160
  }
@@ -14,8 +14,8 @@
14
14
  <!-- 环模式true -->
15
15
  <div v-if="this.contrloType === 'ring' || !this.contrloType">
16
16
  <div class="ring-first" v-for="(list, index1) in patternInfo" :key="index1">
17
- <div v-for="(item,index2) in list" :key="index2" :class="item.mode===7?'direction': ''">
18
- <div class="first-1" :class="item.mode===8?'mask': ''" :style="{'width':item.greenWidth,'height':'34px','background':'#7ccc66'}">
17
+ <div style="position: relative;" :style="{'height': '34px','float':'left','width':((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%'}" v-for="(item,index2) in list" :key="index2" :class="item.mode===7?'direction': ''">
18
+ <div class="first-1" :class="item.mode===8?'mask': ''" :style="{'width':Number(item.greenWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','background':'#7ccc66'}">
19
19
  <el-tooltip placement="top-start" effect="light">
20
20
  <div slot="content">P{{item.id}}:{{item.split}}</div>
21
21
  <div style="cursor:pointer;">
@@ -23,7 +23,7 @@
23
23
  <!-- <patternwalksvg :showWalk="item.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg> -->
24
24
  <xdrdirselector Width="38px" Height="36px" :showlist="item.direction"></xdrdirselector>
25
25
  </div>
26
- <div class="box">
26
+ <div class="box" style="position: absolute; left:40px;top: 2px;">
27
27
  <div class="ring-nums">P{{item.id}}</div>
28
28
  <div class="ring-nums">{{item.split}}</div>
29
29
  </div>
@@ -38,9 +38,9 @@
38
38
  <i class="iconfont icon-youguidianche" style="position: absolute;top: 8px;font-size:12px;color:#454545;" v-if="bus.controltype === 5 && bus.phaseid===item.id"></i>
39
39
  </div>
40
40
  </div>
41
- <div class="first-1" :class="item.mode===8?'mask': ''" :style="{'width':item.flashgreen,'height':'34px','float':'left','background': 'linear-gradient(to right, #ffffff 50%, #7ccc66 0)','background-size': '4px 100%'}"></div>
42
- <div class="first-1" :class="item.mode===8?'mask': ''" :style="{'width':item.yellowWidth,'height':'34px','background':'#f9dc6a'}"></div>
43
- <div class="first-1" :class="item.mode===8?'mask': ''" :style="{'width':item.redWidth,'height':'34px','background':'#f27979'}"></div>
41
+ <div class="first-1" :class="item.mode===8?'mask': ''" :style="{'width':Number(item.flashgreen.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','float':'left','background': 'linear-gradient(to right, #ffffff 50%, #7ccc66 0)','background-size': '4px 100%'}"></div>
42
+ <div class="first-1" :class="item.mode===8?'mask': ''" :style="{'width':Number(item.yellowWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','background':'#f9dc6a'}"></div>
43
+ <div class="first-1" :class="item.mode===8?'mask': ''" :style="{'width':Number(item.redWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','background':'#f27979'}"></div>
44
44
  </div>
45
45
  </div>
46
46
  <div v-if="showBarrier">
@@ -104,6 +104,7 @@ export default {
104
104
  patternIds: this.patternId,
105
105
  newPatterns: [],
106
106
  newList: [],
107
+ contrloCycle: 0,
107
108
  sidewalkPhaseData: [],
108
109
  // controlDatas: this.controlData,
109
110
  max: '',
@@ -161,23 +162,15 @@ export default {
161
162
  computed: {
162
163
  paddingLeft () {
163
164
  let res = '0%'
164
- // if (this.newCycle && this.newCycle > 0) {
165
- // let curPercent = (this.newCycle - this.syncTime) / this.newCycle
166
- // res = curPercent * 100 + '%'
167
- // }
168
- if (this.cycle && this.cycle > 0) {
169
- let curPercent = (this.cycle - this.syncTime) / (this.max ? this.max : this.cycle)
165
+ if (this.contrloCycle > 0) {
166
+ let curPercent = (this.contrloCycle - this.syncTime) / (this.max ? this.max : this.contrloCycle)
170
167
  res = curPercent * 100 + '%'
171
168
  }
172
169
  return res
173
170
  },
174
171
  timeNumDevide () {
175
- // if (this.newCycle && this.newCycle > 0) {
176
- // let res = (this.newCycle - this.syncTime) + '/' + this.newCycle
177
- // return res
178
- // }
179
- if (this.cycle && this.cycle > 0) {
180
- let res = (this.cycle - this.syncTime) + '/' + this.cycle
172
+ if (this.contrloCycle > 0) {
173
+ let res = (this.contrloCycle - this.syncTime) + '/' + this.contrloCycle
181
174
  return res
182
175
  }
183
176
  }
@@ -482,6 +475,7 @@ export default {
482
475
  }) : 0
483
476
  }) : 0
484
477
  let cycle = Math.max(...splitCycle)// 每个环的周期最大值
478
+ this.contrloCycle = cycle
485
479
  this.patternInfo = []
486
480
  let currentArr = []
487
481
  let newPattern = []
@@ -543,7 +537,7 @@ export default {
543
537
  peddirections = []
544
538
  }
545
539
  }
546
- if (ring.desc) {
540
+ if (ring.desc && ring.desc.length > 0) {
547
541
  obj.direction = ring.desc.map(item => { // 虚相位desc为空
548
542
  return {
549
543
  id: item.id,
@@ -551,7 +545,7 @@ export default {
551
545
  }
552
546
  })
553
547
  } else {
554
- if (currPhase.direction.length > 0) {
548
+ if (currPhase.direction && currPhase.direction.length > 0) {
555
549
  obj.direction = currPhase.direction.map(item => {
556
550
  return {
557
551
  id: item,
@@ -570,6 +564,7 @@ export default {
570
564
  }
571
565
  }
572
566
  obj.split = split
567
+ obj.cycle = cycle
573
568
  if (ring.sum) {
574
569
  obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
575
570
  } else {
@@ -631,6 +626,7 @@ export default {
631
626
  }) : 0
632
627
  }) : 0
633
628
  let cycle = Math.max(...splitCycle)// 每个环的周期最大值
629
+ this.contrloCycle = cycle
634
630
  // 按环序分组
635
631
  let ringlength = []
636
632
  let ringsequence = val.map(item => {
@@ -771,7 +767,7 @@ export default {
771
767
  peddirections = []
772
768
  }
773
769
  }
774
- if (ring.desc) {
770
+ if (ring.desc && ring.desc.length > 0) {
775
771
  obj.direction = ring.desc.map(item => { // 虚相位desc为空
776
772
  return {
777
773
  id: item.id,
@@ -779,7 +775,7 @@ export default {
779
775
  }
780
776
  })
781
777
  } else {
782
- if (currPhase.direction.length > 0) {
778
+ if (currPhase.direction && currPhase.direction.length > 0) {
783
779
  obj.direction = currPhase.direction.map(item => {
784
780
  return {
785
781
  id: item,
@@ -798,6 +794,7 @@ export default {
798
794
  }
799
795
  }
800
796
  obj.split = split
797
+ obj.cycle = cycle
801
798
  if (ring.sum) {
802
799
  obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
803
800
  } else {
@@ -826,6 +823,17 @@ export default {
826
823
  return k.id
827
824
  })
828
825
  })
826
+ let valSplit = val.map(item => {
827
+ return item.map(val => {
828
+ return val.value + (val.sum ? val.sum : 0)
829
+ })
830
+ })
831
+ let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
832
+ return item.length > 0 ? item.reduce((a, b) => {
833
+ return a + b
834
+ }) : 0
835
+ }) : 0
836
+ let cycle = Math.max(...splitCycle)// 每个环的周期最大值
829
837
  let newRings = ringsequence.filter(item => item)
830
838
  let minLength = Math.min(...ringlength)
831
839
  let resultArrs = [] // 环1分组
@@ -923,7 +931,9 @@ export default {
923
931
  if (this.patternList) {
924
932
  this.setBarrier(ringTeams, val)
925
933
  }
926
- this.fillGap(ringTeams, val)
934
+ if (newRings.length > 1) {
935
+ this.fillGap(ringTeams, val)
936
+ }
927
937
  let barrier = this.step2(ringTeams, newPattern)
928
938
  this.barrierList = barrier.map(j => {
929
939
  return (j / (this.max ? this.max : this.newCycle) * 100) + '%'
@@ -973,7 +983,7 @@ export default {
973
983
  }
974
984
  })
975
985
  } else {
976
- if (currPhase.direction.length > 0) {
986
+ if (currPhase.direction && currPhase.direction.length > 0) {
977
987
  obj.direction = currPhase.direction.map(item => {
978
988
  return {
979
989
  id: item,
@@ -993,14 +1003,14 @@ export default {
993
1003
  }
994
1004
  obj.split = split
995
1005
  if (ring.sum) {
996
- obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
1006
+ obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
997
1007
  } else {
998
- obj.redWidth = (currPhase.redclear / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
1008
+ obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
999
1009
  }
1000
1010
  obj.mode = ring.mode
1001
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
1002
- obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
1003
- obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
1011
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1012
+ obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1013
+ obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1004
1014
  // 忽略相位不显示
1005
1015
  // let mode = ring.mode
1006
1016
  // if (mode !== 7) { // 忽略相位不显示
@@ -1257,9 +1267,10 @@ export default {
1257
1267
  // color: #ffffff;
1258
1268
  // }
1259
1269
  .box {
1260
- float: left;
1261
- margin-left: 6px;
1262
- margin-right: 10px;
1270
+ text-align: center;
1271
+ // float: left;
1272
+ // margin-left: 6px;
1273
+ // margin-right: 10px;
1263
1274
  }
1264
1275
  .ring-nums {
1265
1276
  // float: left;
@@ -182,14 +182,10 @@ export default {
182
182
  control: 24,
183
183
  delay: this.manualInfo.delay,
184
184
  duration: this.manualInfo.duration,
185
- data: {
186
- type: this.manualInfo.type,
187
- phase: this.manualInfo.phase,
188
- level: this.manualInfo.level
189
- }
190
-
185
+ type: this.manualInfo.type,
186
+ phase: this.manualInfo.phase,
187
+ level: this.manualInfo.level
191
188
  }
192
- console.log(submitdata, 'submitdata')
193
189
  this.$emit('closePhaseControl', submitdata)
194
190
  }
195
191
  }
@@ -111,15 +111,15 @@
111
111
  :list="patternOne.length===0?planPattern.rings[j-1]:patternOne[0].rings[j-1]"
112
112
  >
113
113
  </expend-config>
114
- <div style="width: 60%;margin: 10px auto;color:#ffffff">
114
+ <div class="forbiddenstage">
115
115
  {{$t('openatccomponents.pattern.forbiddenstage')}}
116
116
  <el-input class="stage-value" size="small" v-model="forbiddenstage"></el-input>
117
117
  </div>
118
- <div style="width: 60%;margin: 10px auto;color:#ffffff">
118
+ <div class="forbiddenstage">
119
119
  {{$t('openatccomponents.pattern.screenstage')}}
120
120
  <el-input class="stage-value" size="small" v-model="screenstage"></el-input>
121
121
  </div>
122
- <div style="width: 60%;margin: 10px auto;color:#ffffff">
122
+ <div class="forbiddenstage">
123
123
  {{$t('openatccomponents.pattern.coordinatestage')}}
124
124
  <el-input class="stage-value" size="small" v-model="coordinatestage"></el-input>
125
125
  </div>
@@ -228,14 +228,14 @@ export default {
228
228
  height: auto;
229
229
  margin: 5px 0;
230
230
  line-height: 40px;
231
- color: #FFFFFF;
231
+ // color: #FFFFFF;
232
232
  padding: 1px 1px;
233
233
  box-sizing: border-box;
234
234
  }
235
235
  .el-button--primary:hover, .el-button--primary:focus{
236
236
  background: #409EFF;
237
237
  border-color: #409EFF;
238
- color: #FFFFFF;
238
+ // color: #FFFFFF;
239
239
  }
240
240
  </style>
241
241
  <style lang="scss">