openatc-components 0.4.77 → 0.4.78

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.
@@ -15,6 +15,7 @@
15
15
  :isMove="isMove"
16
16
  :localPatternList="localPatternList"
17
17
  :showCondition="showCondition"
18
+ :patternType="patternType"
18
19
  :contrloType="contrloType"
19
20
  :allPatternList="allPatternList"
20
21
  :stagesChange="stagesChange"
@@ -103,6 +104,9 @@ export default {
103
104
  patternId: {
104
105
  type: Number
105
106
  },
107
+ patternType: {
108
+ type: String
109
+ },
106
110
  agentId: {
107
111
  type: String
108
112
  },
@@ -31,7 +31,7 @@
31
31
  <!-- 右行道路 B-->
32
32
  <div class="right-dir-road" v-if="roadDir === 'right'">
33
33
  <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
34
- <div v-if="isVipRoute" class="merge-direction-icon">
34
+ <div class="merge-direction-icon">
35
35
  <xdr-dir-selector
36
36
  :Data="xdrMData"
37
37
  Width="80px"
@@ -688,6 +688,11 @@ export default {
688
688
  color: #299BCC;
689
689
  margin-top: 20PX;
690
690
  }
691
+ .merge-direction-icon {
692
+ width: 80PX;
693
+ height: 80PX;
694
+ margin: 0 auto;
695
+ }
691
696
 
692
697
  .baseImg {
693
698
  width: 100%;
@@ -10,12 +10,6 @@
10
10
  <span v-for="(ids,index3) in list.includedphases" :key="index3">
11
11
  {{$t('openatccomponents.phase.phase')}}{{ids}}<span v-if="index3+1!==list.includedphases.length">,</span>
12
12
  </span>
13
- <span v-if="list.modifyphase && list.modifyphase.length>0">(<span v-for="(ids, index4) in list.modifyphase" :key="index4">
14
- *{{$t('openatccomponents.phase.phase')}}{{ ids
15
- }}<span v-if="index4 + 1 !== list.modifyphase.length"
16
- >,</span
17
- >
18
- </span>)</span>
19
13
  </div>
20
14
  <div style="cursor:pointer;">
21
15
  <div class="ring-phase">
@@ -28,12 +22,6 @@
28
22
  <span v-for="(ids,index3) in list.includedphases" :key="index3">
29
23
  {{$t('openatccomponents.phase.phase')}}{{ids}}<span v-if="index3+1!==list.includedphases.length">,</span>
30
24
  </span>
31
- <span v-if="list.modifyphase && list.modifyphase.length>0">(<span v-for="(ids, index4) in list.modifyphase" :key="index4">
32
- *{{$t('openatccomponents.phase.phase')}}{{ ids
33
- }}<span v-if="index4 + 1 !== list.modifyphase.length"
34
- >,</span
35
- >
36
- </span>)</span>
37
25
  </div>
38
26
  </div>
39
27
  </div>
@@ -165,16 +153,7 @@ export default {
165
153
  const findItems = stageList.filter(j => (j.phases ? j.phases : j.stages).includes(i))
166
154
  if (findItems.length) findIndexs.push(...findItems.map(m => m.key))
167
155
  })
168
- // 收集所有包含 modifyphase 中相位的阶段 key
169
- let modifyIndexs = []
170
- if (item.modifyphase !== undefined) {
171
- item.modifyphase.forEach(i => {
172
- const findItems = stageList.filter(j => j.phases.includes(i))
173
- if (findItems.length) modifyIndexs.push(...findItems.map(m => m.key))
174
- })
175
- }
176
156
  findIndexs = Array.from(new Set(findIndexs))
177
- modifyIndexs = Array.from(new Set(modifyIndexs))
178
157
  if (this.cycleChange) {
179
158
  const globalParamModel = this.$store.getters.globalParamModel
180
159
  let pattern = globalParamModel.getParamsByType('patternList')
@@ -189,7 +168,7 @@ export default {
189
168
  peddirection: this.getPedPhasePos(item.peddirection),
190
169
  sidewalkPhaseData: this.getPedPhasePos(item.peddirection),
191
170
  stageLists: stageList.map(sta => {
192
- const find = findIndexs.includes(sta.key) && !modifyIndexs.includes(sta.key)
171
+ const find = findIndexs.includes(sta.key)
193
172
  return {
194
173
  ...sta,
195
174
  direction: this.getRoad(item),
@@ -11,8 +11,33 @@
11
11
  **/
12
12
  <template>
13
13
  <div class="main-patternstatus">
14
+ <!-- rcp模式 -->
15
+ <div v-if="patternType === 'rcp'">
16
+ <div class="ring-first" v-for="(list, index1) in patternRcp" :key="index1">
17
+ <div style="position: relative" :style="{height: '34px',paddingRight: '1px',float: 'left',width:
18
+ ((item.split + (item.sum ? item.sum : 0)) /(item.cycle > cycles ? item.cycle : cycles)) *100 +'%',}"
19
+ v-for="(item, index2) in list" :key="index2">
20
+ <div class="first-1" :style="{ width:
21
+ (Number(item.greenWidth.replace('%', '')) /
22
+ Number((((item.split + (item.sum ? item.sum : 0)) /
23
+ (item.cycle > cycles ? item.cycle : cycles)) * 100 + '%').replace('%', ''))) * 100 + '%', height: '34px',background: '#7ccc66'}">
24
+ </div>
25
+ <el-tooltip placement="top-start" effect="light">
26
+ <div v-if="item.id" slot="content">P{{ item.id }}:{{ item.split }}</div>
27
+ <div v-if="item.id" style="cursor: pointer">
28
+ <div
29
+ class="box"
30
+ style="position: absolute; width:40px; left: 0; top: 5px"
31
+ >
32
+ <div class="ring-nums">P{{ item.id }}:{{ item.split }}</div>
33
+ </div>
34
+ </div>
35
+ </el-tooltip>
36
+ </div>
37
+ </div>
38
+ </div>
14
39
  <!-- 环模式true -->
15
- <div v-if="this.contrloType === 'ring' || !this.contrloType">
40
+ <div v-if="(this.contrloType === 'ring' || !this.contrloType) && patternType !== 'rcp'">
16
41
  <div class="ring-first" v-for="(list, index1) in patternInfo" :key="index1">
17
42
  <draggable :move="move" @end="endDrag(index1)" :disabled="isMove" :list="list">
18
43
  <div style="position: relative;" :style="{'height': '35px','float':'left','width':((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%'}" v-for="(item,index2) in list" :key="index2" :class="item.mode === 7 ? 'direction' : isBorder ? 'hovercell' : ''">
@@ -134,6 +159,7 @@ export default {
134
159
  newCycle: this.cycles,
135
160
  patternIds: this.patternId,
136
161
  newPatterns: [],
162
+ patternRcp: [],
137
163
  newList: [],
138
164
  isControl: true,
139
165
  contrloCycle: 0,
@@ -170,6 +196,9 @@ export default {
170
196
  controlPhase: {
171
197
  type: Object
172
198
  },
199
+ patternType: {
200
+ type: String
201
+ },
173
202
  contrloType: {
174
203
  type: String
175
204
  },
@@ -342,6 +371,9 @@ export default {
342
371
  cycles: {
343
372
  handler: function (val, oldVal) {
344
373
  this.newCycle = this.cycles
374
+ if (this.patternType === 'rcp') {
375
+ this.handleRcp(this.patternStatusList)
376
+ }
345
377
  },
346
378
  // 深度观察监听
347
379
  deep: true
@@ -366,6 +398,9 @@ export default {
366
398
  },
367
399
  patternStatusList: {
368
400
  handler: function (val, oldVal) {
401
+ if (this.patternType === 'rcp') {
402
+ this.handleRcp(this.patternStatusList)
403
+ }
369
404
  this.handleBarrierHeight() // 计算屏障高度
370
405
  if (this.patternStatusList && this.newCycle) {
371
406
  // setTimeout(() => {
@@ -398,6 +433,9 @@ export default {
398
433
  if (this.contrloType === 'stage') {
399
434
  this.getStage()
400
435
  }
436
+ if (this.patternType === 'rcp') {
437
+ this.handleRcp(this.patternStatusList)
438
+ }
401
439
  },
402
440
  methods: {
403
441
  move (e) {
@@ -485,6 +523,48 @@ export default {
485
523
  }
486
524
  return ped
487
525
  },
526
+ handleRcp (val) {
527
+ this.patternRcp = []
528
+ let valSplit = val.map(item => {
529
+ return item.map(val => {
530
+ return val.splitchain
531
+ })
532
+ })
533
+ let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
534
+ return item.length > 0 ? item.reduce((a, b) => {
535
+ return a + b
536
+ }) : 0
537
+ }) : 0
538
+ let cycle = Math.max(...splitCycle)// 每个环的周期最大值
539
+ for (let rings of val) {
540
+ if (rings.length === 0) continue
541
+ let list = []
542
+ for (let ring of rings) {
543
+ if (ring.splitchain === 0) continue
544
+ let obj = {}
545
+ let split = ring.splitchain
546
+ obj.split = split
547
+ obj.cycle = cycle
548
+ obj.id = ring.phases
549
+ // if (ring.sum) {
550
+ // obj.sum = ring.sum
551
+ // obj.redWidth = ((currPhase.redclear + ring.sum) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle) * 100) + '%'
552
+ // } else {
553
+ // obj.redWidth = (currPhase.redclear / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle) * 100) + '%'
554
+ // }
555
+ // obj.mode = ring.mode
556
+ obj.greenWidth = (split / (cycle > this.cycles ? cycle : this.cycles)) * 100 + '%'
557
+ // obj.flashgreen = (currPhase.flashgreen / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle) * 100) + '%'
558
+ // obj.yellowWidth = (currPhase.yellow / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle) * 100) + '%'
559
+ // 忽略相位不显示
560
+ // let mode = ring.mode
561
+ // if (mode !== 7) { // 忽略相位不显示
562
+ list.push(obj)
563
+ // }
564
+ }
565
+ this.patternRcp.push(list)
566
+ }
567
+ },
488
568
  handleStageData (data) {
489
569
  if (!data) return
490
570
  let peddirections = this.getPed(data)
@@ -757,20 +837,6 @@ export default {
757
837
  let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
758
838
  ring1s.push(addRing1)
759
839
  }
760
- // 双环相位数不等的时候
761
- if (newRings.length > 1) {
762
- if (newRings[0].length !== newRings[1].length) {
763
- for (let h = 0; h < newCurrent.length; h++) {
764
- let adds = [...new Set(ringsequence[0])].filter(item => newCurrent[h].includes(item))
765
- ring1.push(adds)
766
- }
767
- let ring1s = [] // 环1与关系2的并集
768
- for (let h = 0; h < newCurrent.length; h++) {
769
- let addRing1 = [...new Set(ringsequence[1])].filter(item => newCurrent[h].includes(item))
770
- ring1s.push(addRing1)
771
- }
772
- }
773
- }
774
840
  barrierRing1.push(...ring1, ...ring1s)
775
841
  let resultList = []
776
842
  if (newRings.length > 1) {
@@ -1057,20 +1123,6 @@ export default {
1057
1123
  let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
1058
1124
  ring1s.push(addRing1)
1059
1125
  }
1060
- // 双环相位数不等的时候
1061
- if (newRings.length > 1) {
1062
- if (newRings[0].length !== newRings[1].length) {
1063
- for (let h = 0; h < newCurrent.length; h++) {
1064
- let adds = [...new Set(ringsequence[0])].filter(item => newCurrent[h].includes(item))
1065
- ring1.push(adds)
1066
- }
1067
- let ring1s = [] // 环1与关系2的并集
1068
- for (let h = 0; h < newCurrent.length; h++) {
1069
- let addRing1 = [...new Set(ringsequence[1])].filter(item => newCurrent[h].includes(item))
1070
- ring1s.push(addRing1)
1071
- }
1072
- }
1073
- }
1074
1126
  barrierRing1.push(...ring1, ...ring1s)
1075
1127
  let resultList = []
1076
1128
  if (newRings.length > 1) {
@@ -1320,20 +1372,6 @@ export default {
1320
1372
  let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
1321
1373
  ring1s.push(addRing1)
1322
1374
  }
1323
- // 双环相位数不等的时候
1324
- if (newRings.length > 1) {
1325
- if (newRings[0].length !== newRings[1].length) {
1326
- for (let h = 0; h < newCurrent.length; h++) {
1327
- let adds = [...new Set(ringsequence[0])].filter(item => newCurrent[h].includes(item))
1328
- ring1.push(adds)
1329
- }
1330
- let ring1s = [] // 环1与关系2的并集
1331
- for (let h = 0; h < newCurrent.length; h++) {
1332
- let addRing1 = [...new Set(ringsequence[1])].filter(item => newCurrent[h].includes(item))
1333
- ring1s.push(addRing1)
1334
- }
1335
- }
1336
- }
1337
1375
  barrierRing1.push(...ring1, ...ring1s)
1338
1376
  let resultList = []
1339
1377
  if (newRings.length >= 1) {
@@ -1392,6 +1430,9 @@ export default {
1392
1430
  if (this.patternList) {
1393
1431
  this.setBarrier(ringTeams, val)
1394
1432
  }
1433
+ if (newRings.length > 1) {
1434
+ this.fillGap(ringTeams, val)
1435
+ }
1395
1436
  if (this.cycleChange) {
1396
1437
  const globalParamModel = this.$store.getters.globalParamModel
1397
1438
  let pattern = globalParamModel.getParamsByType('patternList')
@@ -1401,9 +1442,6 @@ export default {
1401
1442
  } else {
1402
1443
  this.max = ''
1403
1444
  }
1404
- if (newRings.length > 1) {
1405
- this.fillGap(ringTeams, val)
1406
- }
1407
1445
  let barrier = this.step2(ringTeams, newPattern)
1408
1446
  let barrierLeft = barrier.map(item => item)// 屏障左移显示出人行横道
1409
1447
  this.barrierList = barrierLeft.map(j => {
@@ -441,11 +441,7 @@ PURPOSE. * See the Mulan PSL v2 for more details. **/
441
441
  :width="iconWidth"
442
442
  :height="iconHeight"
443
443
  >
444
- <path
445
- :class="themeColor"
446
- d="M947.685353 711.851301h-34.260223v-121.814126c0-15.226766-11.420074-30.453532-30.453531-30.453532h-342.602231v-167.494424h137.040892c38.066914 0 64.713755-30.453532 64.713755-64.713754V114.200743c0-38.066914-30.453532-64.713755-64.713755-64.713754H346.228104c-38.066914-3.806691-68.520446 26.64684-68.520446 64.713754v216.981413c0 38.066914 30.453532 64.713755 64.713755 64.713755h137.040892v167.494424h-342.602231c-15.226766 0-30.453532 11.420074-30.453531 30.453531v121.814127h-26.64684c-38.066914 0-64.713755 30.453532-64.713755 64.713754v137.040892c0 38.066914 30.453532 64.713755 64.713755 64.713755h137.040892c38.066914 0 64.713755-30.453532 64.713754-64.713755v-137.040892c0-38.066914-30.453532-64.713755-64.713754-64.713754H167.313606v-91.360595h315.95539v91.360595h-41.873606c-38.066914 0-64.713755 30.453532-64.713754 64.713754v137.040892c0 38.066914 30.453532 64.713755 64.713754 64.713755h137.040893c38.066914 0 64.713755-30.453532 64.713754-64.713755v-137.040892c0-38.066914-30.453532-64.713755-64.713754-64.713754h-41.873606v-91.360595H852.518067v91.360595h-45.680297c-38.066914 0-64.713755 30.453532-64.713755 64.713754v137.040892c0 38.066914 30.453532 64.713755 64.713755 64.713755h137.040892c38.066914 0 64.713755-30.453532 64.713754-64.713755v-137.040892c3.806691-38.066914-22.840149-68.520446-60.907063-68.520446z m7.613383 205.561338c0 3.806691-3.806691 7.613383-7.613383 7.613383h-137.040892c-3.806691 0-7.613383-3.806691-7.613383-7.613383v-137.040892c0-3.806691 3.806691-7.613383 7.613383-7.613383h137.040892c3.806691 0 7.613383 3.806691 7.613383 7.613383v137.040892z" p-id="21091">
447
- </path>
448
- </svg>
444
+ <path d="M947.685353 711.851301h-34.260223v-121.814126c0-15.226766-11.420074-30.453532-30.453531-30.453532h-342.602231v-167.494424h137.040892c38.066914 0 64.713755-30.453532 64.713755-64.713754V114.200743c0-38.066914-30.453532-64.713755-64.713755-64.713754H346.228104c-38.066914-3.806691-68.520446 26.64684-68.520446 64.713754v216.981413c0 38.066914 30.453532 64.713755 64.713755 64.713755h137.040892v167.494424h-342.602231c-15.226766 0-30.453532 11.420074-30.453531 30.453531v121.814127h-26.64684c-38.066914 0-64.713755 30.453532-64.713755 64.713754v137.040892c0 38.066914 30.453532 64.713755 64.713755 64.713755h137.040892c38.066914 0 64.713755-30.453532 64.713754-64.713755v-137.040892c0-38.066914-30.453532-64.713755-64.713754-64.713754H167.313606v-91.360595h315.95539v91.360595h-41.873606c-38.066914 0-64.713755 30.453532-64.713754 64.713754v137.040892c0 38.066914 30.453532 64.713755 64.713754 64.713755h137.040893c38.066914 0 64.713755-30.453532 64.713754-64.713755v-137.040892c0-38.066914-30.453532-64.713755-64.713754-64.713754h-41.873606v-91.360595H852.518067v91.360595h-45.680297c-38.066914 0-64.713755 30.453532-64.713755 64.713754v137.040892c0 38.066914 30.453532 64.713755 64.713755 64.713755h137.040892c38.066914 0 64.713755-30.453532 64.713754-64.713755v-137.040892c3.806691-38.066914-22.840149-68.520446-60.907063-68.520446z m7.613383 205.561338c0 3.806691-3.806691 7.613383-7.613383 7.613383h-137.040892c-3.806691 0-7.613383-3.806691-7.613383-7.613383v-137.040892c0-3.806691 3.806691-7.613383 7.613383-7.613383h137.040892c3.806691 0 7.613383 3.806691 7.613383 7.613383v137.040892z" p-id="21091"></path></svg>
449
445
  </span>
450
446
  </template>
451
447
 
@@ -3,6 +3,7 @@
3
3
  <BoardCard
4
4
  :patternId="patternId"
5
5
  :contrloType="contrloType"
6
+ :patternType="patternType"
6
7
  :stagesChange="stagesChange"
7
8
  :isShowTip="isShowTip"
8
9
  :isBorder="isBorder"
@@ -552,6 +553,9 @@ export default {
552
553
  patternStatusList: {
553
554
  type: Array
554
555
  },
556
+ patternType: {
557
+ type: String
558
+ },
555
559
  patternId: {
556
560
  type: Number
557
561
  },