openatc-components 0.2.74 → 0.2.76

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.
@@ -32,14 +32,11 @@
32
32
  <div class="right-dir-road" v-if="roadDir === 'right'">
33
33
  <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
34
34
  <!-- 相位倒计时 -->
35
- <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown" :class="{'countdownBg': isLoaded}">
35
+ <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase" :class="{'countdownBg': isLoaded}">
36
36
  <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
37
- <div v-if="curPhase.phaseCountdown !== undefined && curPhase.phaseCountdown !== -1" style="overflow: hidden;margin-bottom: 4px;">
38
- <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
39
- <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="curPhase.showlist" :roadDirection="roadDirection"></xdr-dir-selector>
40
- </span>
41
- <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">P{{curPhase.id}}:</span>
42
- <span style="float: left;font-size: 25px;">{{curPhase.phaseCountdown}}</span>
37
+ <div v-if="curPhase.phaseCountdown !== -1">
38
+ <span style="float: left;font-size: 20px;color: #fff;width: 70px;">{{$t('openatccomponents.overview.phase')}}{{curPhase.id}}:</span>
39
+ <span style="float: left;">{{curPhase.phaseCountdown}}</span>
43
40
  </div>
44
41
  </div>
45
42
  </div>
@@ -97,14 +94,11 @@
97
94
  <div class="left-dir-road" v-if="roadDir === 'left'">
98
95
  <div class="centerText" v-if="mainType === '100' || mainType === '101'" :class="{'countdownBg': isLoaded}">
99
96
  <!-- 相位倒计时 -->
100
- <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown" :class="{'countdownBg': isLoaded}">
97
+ <div class="phaseCountdown" v-if="isLoaded && isHasPhase">
101
98
  <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
102
- <div v-if="curPhase.phaseCountdown !== undefined && curPhase.phaseCountdown !== -1" style="overflow: hidden;margin-bottom: 4px;">
103
- <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
104
- <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="curPhase.showlist" :roadDirection="roadDirection"></xdr-dir-selector>
105
- </span>
106
- <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">P{{curPhase.id}}:</span>
107
- <span style="float: left;font-size: 25px;">{{curPhase.phaseCountdown}}</span>
99
+ <div v-if="curPhase.phaseCountdown !== -1">
100
+ <span style="float: left;font-size: 20px;color: #fff;width: 70px;">{{$t('openatccomponents.overview.phase')}}{{curPhase.id}}:</span>
101
+ <span style="float: left;">{{curPhase.phaseCountdown}}</span>
108
102
  </div>
109
103
  </div>
110
104
  </div>
@@ -381,16 +375,7 @@ export default {
381
375
  comdirePhaseData: [], // 对比相同方向车道相位数据后,被删减的唯一direction的数组
382
376
  comdireOverlapPhaseData: [], // 对比相同方向车道跟随相位数据后,被删减的唯一direction的数组
383
377
  busPhaseData: [], // 公交相位数据
384
- comdireBusPhaseData: [], // 对比相同方向公交车道数据后,被删减的唯一direction的数组
385
- phaseDirMap: new Map(),
386
- xdrData: {
387
- left: '5px',
388
- top: '4px'
389
- },
390
- xdrpedData: {
391
- left: '1px',
392
- top: '1px'
393
- }
378
+ comdireBusPhaseData: [] // 对比相同方向公交车道数据后,被删减的唯一direction的数组
394
379
  }
395
380
  },
396
381
  methods: {
@@ -642,7 +627,6 @@ export default {
642
627
  getCurPhaseCountdown () {
643
628
  // 获取当前相位倒计时颜色
644
629
  this.phaseCountdownList = []
645
- this.isHasCountdown = false
646
630
  this.curPhase.forEach(curP => {
647
631
  this.phaseStatusList.forEach(phaseInfo => {
648
632
  if (phaseInfo.id === curP) {
@@ -650,35 +634,11 @@ export default {
650
634
  countdownObj.id = phaseInfo.id
651
635
  countdownObj.phaseCountdown = phaseInfo.countdown
652
636
  countdownObj.phaseCountdownColor = this.ColorMap.get(phaseInfo.type)
653
- let curphasedir = this.phaseDirMap.get(phaseInfo.id)
654
- if (curphasedir !== undefined) {
655
- countdownObj.showlist = curphasedir.direction.map(dir => {
656
- return {
657
- id: dir,
658
- peddirection: this.getshowped(curphasedir.peddirection),
659
- color: '#fff'
660
- }
661
- })
662
- } else {
663
- countdownObj.showlist = []
664
- }
665
-
666
637
  this.phaseCountdownList.push(countdownObj)
667
- if (phaseInfo.countdown !== undefined && phaseInfo.countdown !== -1) {
668
- this.isHasCountdown = true
669
- }
670
638
  }
671
639
  })
672
640
  })
673
641
  },
674
- getshowped (peddirection) {
675
- let peddirarr = peddirection.map(peddir => ({
676
- id: peddir,
677
- name: this.PhaseDataModel.getSidePos(peddir).name,
678
- color: 'rgba(255, 255, 255, 0.4)'
679
- }))
680
- return peddirarr
681
- },
682
642
  getIntersectionInfo () {
683
643
  // 获取路口信息
684
644
  const agentid = this.agentId || '0'
@@ -710,7 +670,6 @@ export default {
710
670
  return
711
671
  }
712
672
  this.crossInfo = res.data.data.param
713
- this.crossInfo.phaseList.forEach(cross => this.phaseDirMap.set(cross.id, {direction: cross.direction, peddirection: cross.peddirection}))
714
673
  if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
715
674
  // 城市道路加载车道相位坐标和人行道坐标
716
675
  this.getPhasePos()
@@ -1227,8 +1186,8 @@ export default {
1227
1186
  /* padding-left: 16px; */
1228
1187
  }
1229
1188
  .phaseCountdown {
1230
- line-height: 42PX;
1231
- font-size: 18px;
1189
+ line-height: 40px;
1190
+ font-size: 30px;
1232
1191
  font-weight: normal;
1233
1192
  font-stretch: normal;
1234
1193
  letter-spacing: 0px;
@@ -1237,16 +1196,14 @@ export default {
1237
1196
  margin: 0 auto;
1238
1197
  }
1239
1198
  .countdownBg {
1240
- border-radius: 10PX;
1199
+ border-radius: 10px;
1241
1200
  background-color: rgba(94, 90, 90, 0.8);
1242
- padding-left: 14PX;
1243
- padding-top: 10PX;
1244
- padding-bottom: 10PX;
1201
+ padding-left: 16px;
1245
1202
  }
1246
1203
  .centerText .text {
1247
1204
  display: inline-block;
1248
1205
  color: #299BCC;
1249
- margin-top: 20PX;
1206
+ margin-top: 20px;
1250
1207
  }
1251
1208
 
1252
1209
  .baseImg {
@@ -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="(cycle && cycle>0 && this.isControl) || (newCycle && newCycle>0 && this.isControl)">
51
+ <div v-show="(this.controlData && this.controlData.curTime && cycle && cycle>0 && this.isControl) || (this.controlData && newCycle && newCycle>0 && this.isControl)">
52
52
  <div class="curTimeDiv" :style="{'left':paddingLeft }">{{ timeNumDevide }}</div>
53
53
  <div class="curTimeLine" :style="{'left':paddingLeft, 'height':barrierHeight}"></div>
54
54
  </div>
@@ -84,6 +84,15 @@
84
84
  <div class="first-1" :style="{'width':list.yellowWidth,'height':'34px','background':'#f9dc6a'}"></div>
85
85
  <div class="first-1" :style="{'width':list.redWidth,'height':'34px','background':'#f27979'}"></div>
86
86
  </div>
87
+ <div v-if="this.controlData && this.controlData.curTime">
88
+ <div class="curTimeDiv" :style="{ left: paddingLefts }">
89
+ {{ timeNumDevides }}
90
+ </div>
91
+ <div
92
+ class="curTimeLine"
93
+ :style="{ left: paddingLefts, height: '56px' }"
94
+ ></div>
95
+ </div>
87
96
  </div>
88
97
  <!-- </div> -->
89
98
  </div>
@@ -103,6 +112,7 @@ export default {
103
112
  data () {
104
113
  return {
105
114
  barrierHeight: '',
115
+ stageCycle: '',
106
116
  barrierList: [],
107
117
  newCycle: this.cycles,
108
118
  patternIds: this.patternId,
@@ -177,6 +187,19 @@ export default {
177
187
  }
178
188
  },
179
189
  computed: {
190
+ paddingLefts () {
191
+ let res = '0%'
192
+ let curPercent = this.curtime / this.stageCycle
193
+ if (curPercent >= 1) {
194
+ curPercent = 1
195
+ }
196
+ res = curPercent * 100 + '%'
197
+ return res
198
+ },
199
+ timeNumDevides () {
200
+ let res = this.curtime
201
+ return res
202
+ },
180
203
  paddingLeft () {
181
204
  let res = '0%'
182
205
  if (this.contrloCycle > 0) {
@@ -417,6 +440,7 @@ export default {
417
440
  let stageMaxCyle = stageCycleList.reduce((a, b) => {
418
441
  return a + b
419
442
  }, 0)
443
+ this.stageCycle = stageMaxCyle
420
444
  this.stageLists = this.localPatternList[i].stagesList.map(item => {
421
445
  return {
422
446
  ...item,
@@ -49,14 +49,6 @@
49
49
  <div style="float: left;" class="cross-name">{{$t('openatccomponents.overview.platform')}}:</div>
50
50
  <div style="margin-left: 85px;" class="cross-value">{{platform}}</div>
51
51
  </div>
52
- <div class="cross-content" v-if="controlData.current_stagecd !== undefined">
53
- <div style="float: left;" class="cross-name">{{$t('openatccomponents.overview.stagecountdown')}}:</div>
54
- <div style="margin-left: 85px;" class="cross-value">{{controlData.current_stagecd}}</div>
55
- </div>
56
- <div class="cross-content" v-if="controlData.stages_len">
57
- <div style="float: left;" class="cross-name">{{$t('openatccomponents.overview.stageduration')}}:</div>
58
- <div style="margin-left: 85px;" class="cross-value">{{controlData.stages_len + ''}}</div>
59
- </div>
60
52
  <div class="cross-content">
61
53
  <div style="float: left;" class="cross-name">{{$t('openatccomponents.overview.faultinfo')}}:</div>
62
54
  <div style="margin-left: 85px;" v-if="curFaultList.length">