openatc-components 0.3.28 → 0.3.30

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.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -10,9 +10,9 @@
10
10
  <PatternStatus
11
11
  :showBarrier="showBarrier"
12
12
  :controlPhase="controlPhase"
13
- :isShowTip="isShowTip"
14
13
  :localPatternList="localPatternList"
15
14
  :showCondition="showCondition"
15
+ :patternType="patternType"
16
16
  :contrloType="contrloType"
17
17
  :allPatternList="allPatternList"
18
18
  :stagesChange="stagesChange"
@@ -72,10 +72,6 @@ export default {
72
72
  stagesChange: {
73
73
  type: Array
74
74
  },
75
- isShowTip: {
76
- type: Boolean,
77
- default: true
78
- },
79
75
  showBarrier: {
80
76
  type: Boolean,
81
77
  default: false
@@ -92,6 +88,9 @@ export default {
92
88
  patternId: {
93
89
  type: Number
94
90
  },
91
+ patternType: {
92
+ type: String
93
+ },
95
94
  agentId: {
96
95
  type: String
97
96
  },
@@ -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
  <div style="position: relative;" :style="{'height': '34px','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': ''">
18
43
  <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.greenWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%').replace('%', ''))*100+'%','height':'34px','background':'#7ccc66'}">
@@ -23,7 +48,7 @@
23
48
  <!-- <patternwalksvg :showWalk="item.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg> -->
24
49
  <xdrdirselector Width="60px" Height="60px" Widths="50px" Heights="50px" :showlist="item.direction"></xdrdirselector>
25
50
  </div>
26
- <div v-if="isShowTip" class="box" style="position: absolute; left:40px; width:40px; top: -1px;">
51
+ <div class="box" style="position: absolute; left:40px; width:40px; top: -1px;">
27
52
  <div class="ring-nums">{{$t('openatccomponents.phase.phase')}}{{item.id}}</div>
28
53
  <div class="ring-nums">{{item.split}}</div>
29
54
  </div>
@@ -117,6 +142,7 @@ export default {
117
142
  newCycle: this.cycles,
118
143
  patternIds: this.patternId,
119
144
  newPatterns: [],
145
+ patternRcp: [],
120
146
  newList: [],
121
147
  isControl: true,
122
148
  contrloCycle: 0,
@@ -131,10 +157,6 @@ export default {
131
157
  }
132
158
  },
133
159
  props: {
134
- isShowTip: {
135
- type: Boolean,
136
- default: true
137
- },
138
160
  cycleChange: {
139
161
  type: Boolean,
140
162
  default: true
@@ -145,6 +167,9 @@ export default {
145
167
  controlPhase: {
146
168
  type: Object
147
169
  },
170
+ patternType: {
171
+ type: String
172
+ },
148
173
  contrloType: {
149
174
  type: String
150
175
  },
@@ -317,6 +342,9 @@ export default {
317
342
  cycles: {
318
343
  handler: function (val, oldVal) {
319
344
  this.newCycle = this.cycles
345
+ if (this.patternType === 'rcp') {
346
+ this.handleRcp(this.patternStatusList)
347
+ }
320
348
  },
321
349
  // 深度观察监听
322
350
  deep: true
@@ -341,6 +369,9 @@ export default {
341
369
  },
342
370
  patternStatusList: {
343
371
  handler: function (val, oldVal) {
372
+ if (this.patternType === 'rcp') {
373
+ this.handleRcp(this.patternStatusList)
374
+ }
344
375
  this.handleBarrierHeight() // 计算屏障高度
345
376
  if (this.patternStatusList && this.newCycle) {
346
377
  setTimeout(() => {
@@ -373,6 +404,9 @@ export default {
373
404
  if (this.contrloType === 'stage') {
374
405
  this.getStage()
375
406
  }
407
+ if (this.patternType === 'rcp') {
408
+ this.handleRcp(this.patternStatusList)
409
+ }
376
410
  },
377
411
  methods: {
378
412
  getPed (data) {
@@ -401,6 +435,48 @@ export default {
401
435
  }
402
436
  return ped
403
437
  },
438
+ handleRcp (val) {
439
+ this.patternRcp = []
440
+ let valSplit = val.map(item => {
441
+ return item.map(val => {
442
+ return val.splitchain
443
+ })
444
+ })
445
+ let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
446
+ return item.length > 0 ? item.reduce((a, b) => {
447
+ return a + b
448
+ }) : 0
449
+ }) : 0
450
+ let cycle = Math.max(...splitCycle)// 每个环的周期最大值
451
+ for (let rings of val) {
452
+ if (rings.length === 0) continue
453
+ let list = []
454
+ for (let ring of rings) {
455
+ if (ring.splitchain === 0) continue
456
+ let obj = {}
457
+ let split = ring.splitchain
458
+ obj.split = split
459
+ obj.cycle = cycle
460
+ obj.id = ring.phases
461
+ // if (ring.sum) {
462
+ // obj.sum = ring.sum
463
+ // obj.redWidth = ((currPhase.redclear + ring.sum) / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle) * 100) + '%'
464
+ // } else {
465
+ // obj.redWidth = (currPhase.redclear / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle) * 100) + '%'
466
+ // }
467
+ // obj.mode = ring.mode
468
+ obj.greenWidth = (split / (cycle > this.cycles ? cycle : this.cycles)) * 100 + '%'
469
+ // obj.flashgreen = (currPhase.flashgreen / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle) * 100) + '%'
470
+ // obj.yellowWidth = (currPhase.yellow / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.newCycle) * 100) + '%'
471
+ // 忽略相位不显示
472
+ // let mode = ring.mode
473
+ // if (mode !== 7) { // 忽略相位不显示
474
+ list.push(obj)
475
+ // }
476
+ }
477
+ this.patternRcp.push(list)
478
+ }
479
+ },
404
480
  handleStageData (data) {
405
481
  if (!data) return
406
482
  let peddirections = this.getPed(data)
@@ -3,8 +3,8 @@
3
3
  <BoardCard
4
4
  :patternId="patternId"
5
5
  :contrloType="contrloType"
6
+ :patternType="patternType"
6
7
  :stagesChange="stagesChange"
7
- :isShowTip="isShowTip"
8
8
  :patternStatusList="patternStatusList"
9
9
  :cycles="cycles"
10
10
  :cycle="cycle"
@@ -498,10 +498,6 @@ export default {
498
498
  }
499
499
  },
500
500
  props: {
501
- isShowTip: {
502
- type: Boolean,
503
- default: true
504
- },
505
501
  contrloType: {
506
502
  type: String
507
503
  },
@@ -541,6 +537,9 @@ export default {
541
537
  patternStatusList: {
542
538
  type: Array
543
539
  },
540
+ patternType: {
541
+ type: String
542
+ },
544
543
  patternId: {
545
544
  type: Number
546
545
  },
@@ -11,12 +11,12 @@
11
11
 
12
12
  // 全局滚动条样式
13
13
  ::-webkit-scrollbar {
14
- width: 6PX;
15
- height: 6PX;
14
+ width: 12PX;
15
+ height: 12PX;
16
16
  }
17
17
  ::-webkit-scrollbar-thumb {
18
18
  // 滚动条的滑块
19
- border-radius: 3PX;
19
+ border-radius: 4px;
20
20
  background: rgba(144, 147, 153, 0.3);
21
21
  }
22
22
  ::-webkit-scrollbar-corner{
@@ -226,7 +226,7 @@
226
226
  overflow-y: auto;
227
227
  }
228
228
  .manual-common-content::-webkit-scrollbar {
229
- width: 6PX;
229
+ width: 8PX;
230
230
  }
231
231
  }
232
232
  // 手动控制弹框