openatc-components 0.4.56 → 0.4.57

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.4.56",
3
+ "version": "0.4.57",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -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
  },
@@ -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)
@@ -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
  },