openatc-components 0.0.14 → 0.0.17

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.
Files changed (38) hide show
  1. package/package/kisscomps/components/BoardCard/BoardCard.vue +85 -0
  2. package/package/kisscomps/components/BoardCard/index.js +2 -0
  3. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +4 -2
  4. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +1 -1
  5. package/package/kisscomps/components/OverLap/OverLap.vue +193 -0
  6. package/package/kisscomps/components/OverLap/index.js +2 -0
  7. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +832 -0
  8. package/package/kisscomps/components/PatternStatus/index.js +2 -0
  9. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +94 -78
  10. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +22 -42
  11. package/package/kisscomps/components/StageStatus/StageStatus.vue +303 -0
  12. package/package/kisscomps/components/StageStatus/index.js +2 -0
  13. package/package/kisscomps/components/patternList/index.js +2 -0
  14. package/package/kisscomps/components/patternList/patternList.vue +558 -0
  15. package/package/kisscomps/index.js +12 -0
  16. package/package/kissui.js +73981 -0
  17. package/package/kissui.min.js +1 -1
  18. package/package.json +1 -1
  19. package/src/api/control.js +2 -2
  20. package/src/api/param.js +2 -2
  21. package/src/kisscomps/components/BoardCard/BoardCard.vue +85 -0
  22. package/src/kisscomps/components/BoardCard/index.js +2 -0
  23. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +4 -2
  24. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +1 -1
  25. package/src/kisscomps/components/OverLap/OverLap.vue +193 -0
  26. package/src/kisscomps/components/OverLap/index.js +2 -0
  27. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +832 -0
  28. package/src/kisscomps/components/PatternStatus/index.js +2 -0
  29. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +94 -78
  30. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +22 -42
  31. package/src/kisscomps/components/StageStatus/StageStatus.vue +303 -0
  32. package/src/kisscomps/components/StageStatus/index.js +2 -0
  33. package/src/kisscomps/components/patternList/index.js +2 -0
  34. package/src/kisscomps/components/patternList/patternList.vue +558 -0
  35. package/src/kisscomps/index.js +12 -0
  36. package/src/utils/RingDataModel.js +98 -0
  37. package/src/views/intersection.vue +3 -2
  38. package/src/views/schemeconfig.vue +17 -2
@@ -0,0 +1,2 @@
1
+ import PatternStatus from './PatternStatus.vue'
2
+ export default PatternStatus
@@ -48,16 +48,15 @@
48
48
  :realtimeStatusModalvisible="realtimeStatusModalvisible"
49
49
  :roadDirection="roadDirection"
50
50
  @closePhaseBack="closePhaseBack"
51
- @closePhaseControl= "closePhaseControl" />
51
+ @closePhaseControl="closePhaseControl" />
52
52
  <LockingPhaseControlModal
53
53
  v-if="specialPage === 'lockingphase'"
54
- :controlData="controlData"
55
- :closePhaseRings="phaseRings"
56
- :sidewalkPhaseData="sidewalkPhaseData"
57
- :realtimeStatusModalvisible="realtimeStatusModalvisible"
58
54
  :roadDirection="roadDirection"
55
+ :phaseList="phaseList"
56
+ :patternStatus="statusData"
57
+ :lockPhaseBtnName="lockPhaseBtnName"
59
58
  @closePhaseBack="closePhaseBack"
60
- @closePhaseControl= "closePhaseControl" />
59
+ @closePhaseControl="closePhaseControl" />
61
60
  </div>
62
61
  </transition>
63
62
 
@@ -104,6 +103,7 @@ import { GetAllFaultRange } from '../../../api/fault'
104
103
  import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
105
104
  import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
106
105
  import { setToken } from '../../../utils/auth.js'
106
+ import RingDataModel from '../../../utils/RingDataModel.js'
107
107
  export default {
108
108
  name: 'scheme-config',
109
109
  components: {
@@ -143,6 +143,9 @@ export default {
143
143
  type: Boolean,
144
144
  default: true
145
145
  },
146
+ lockPhaseBtnName: {
147
+ type: String
148
+ },
146
149
  Token: {
147
150
  type: String,
148
151
  default: ''
@@ -315,23 +318,25 @@ export default {
315
318
  }, 30000)
316
319
  },
317
320
  getPedPhasePos () {
318
- // 行人相位信息
319
- this.sidewalkPhaseData = []
320
- this.phaseList.forEach((ele, i) => {
321
- if (ele.peddirection) {
322
- ele.peddirection.forEach((dir, index) => {
323
- // 行人相位
324
- if (this.PhaseDataModel.getSidePos(dir)) {
325
- this.sidewalkPhaseData.push({
326
- key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
327
- phaseid: ele.id, // 相位id,用于对应相位状态
328
- id: dir,
329
- name: this.PhaseDataModel.getSidePos(dir).name
330
- })
331
- }
332
- })
333
- }
334
- })
321
+ let ringDataModel = new RingDataModel(this.statusData, this.phaseList)
322
+ this.sidewalkPhaseData = ringDataModel.getPedPhasePos()
323
+ // // 行人相位信息
324
+ // this.sidewalkPhaseData = []
325
+ // this.phaseList.forEach((ele, i) => {
326
+ // if (ele.peddirection) {
327
+ // ele.peddirection.forEach((dir, index) => {
328
+ // // 行人相位
329
+ // if (this.PhaseDataModel.getSidePos(dir)) {
330
+ // this.sidewalkPhaseData.push({
331
+ // key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
332
+ // phaseid: ele.id, // 相位id,用于对应相位状态
333
+ // id: dir,
334
+ // name: this.PhaseDataModel.getSidePos(dir).name
335
+ // })
336
+ // }
337
+ // })
338
+ // }
339
+ // })
335
340
  },
336
341
  clearFaultInterval () {
337
342
  if (this.faultTimer !== null) {
@@ -415,8 +420,9 @@ export default {
415
420
  peddirection: peddirections
416
421
  }))
417
422
  stagesTemp.push(tempList)
418
- this.stagesList = JSON.parse(JSON.stringify(stagesTemp))
419
423
  }
424
+ this.stagesList = JSON.parse(JSON.stringify(stagesTemp))
425
+ console.log('stagesList', this.stagesList)
420
426
  },
421
427
  lockScreen () {
422
428
  this.loading = this.$loading({
@@ -518,6 +524,9 @@ export default {
518
524
  })
519
525
  this.toPage = 1
520
526
  },
527
+ handleManualConfirm (manualInfo) {
528
+ this.$emit('handleManualConfirm', manualInfo)
529
+ },
521
530
  patternCommit (manualInfo) {
522
531
  let that = this
523
532
  let control = {}
@@ -537,6 +546,7 @@ export default {
537
546
  }
538
547
  if (!this.realtimeStatusModalvisible) {
539
548
  console.log(control)
549
+ this.$emit('patternCommit', control)
540
550
  return
541
551
  }
542
552
  this.lockScreen()
@@ -575,7 +585,7 @@ export default {
575
585
  getPhase () {
576
586
  let _this = this
577
587
  return new Promise(function (resolve, reject) {
578
- uploadSingleTscParam('phase').then(data => {
588
+ uploadSingleTscParam('phase', _this.agentId).then(data => {
579
589
  let res = data.data
580
590
  if (!res.success) {
581
591
  if (res.code === '4003') {
@@ -626,15 +636,16 @@ export default {
626
636
  }
627
637
  },
628
638
  selectSpecialModel (id) {
639
+ let ringDataModel = new RingDataModel(this.statusData, this.phaseList)
629
640
  if (id === 23) {
630
641
  this.toPage = 3
631
642
  this.isClosePhase = true
632
- this.initRingPhaseData()
643
+ this.phaseRings = ringDataModel.initRingPhaseData()
633
644
  this.specialPage = 'closephase'
634
645
  } else if (id === 22) {
635
646
  this.toPage = 3
636
647
  this.isClosePhase = true
637
- this.initRingPhaseData()
648
+ this.phaseRings = ringDataModel.initRingPhaseData()
638
649
  this.specialPage = 'lockingphase'
639
650
  } else {
640
651
  this.isClosePhase = false
@@ -642,12 +653,17 @@ export default {
642
653
  }
643
654
  },
644
655
  closePhaseBack () {
656
+ // if (!this.realtimeStatusModalvisible) {
657
+ // this.$emit('closePhaseBack')
658
+ // return
659
+ // }
645
660
  this.toPage = 3
646
661
  this.isClosePhase = false
647
662
  },
648
663
  closePhaseControl (controldata) {
649
664
  if (!this.realtimeStatusModalvisible) {
650
665
  console.log(controldata)
666
+ this.$emit('closePhaseControl', controldata)
651
667
  return
652
668
  }
653
669
  this.lockScreen()
@@ -672,57 +688,57 @@ export default {
672
688
  console.log(error)
673
689
  })
674
690
  },
675
- initRingPhaseData () {
676
- // 环信息从单独上载相位信息里获取,以免相位锁定后,方案状态数据里没有rings,导致相位锁定控制列表无法显示
677
- this.phaseRings = []
678
- let map = {}
679
- let dest = []
680
- for (let i = 0; i < this.phaseList.length; i++) {
681
- let ai = this.phaseList[i]
682
- if (!map[ai.ring]) {
683
- let addphse = this.addPhaseInfo(ai)
684
- dest.push({
685
- num: ai.ring,
686
- phases: [{...ai, ...addphse}]
687
- })
688
- map[ai.ring] = ai
689
- } else {
690
- for (var j = 0; j < dest.length; j++) {
691
- var dj = dest[j]
692
- if (dj.num === ai.ring) {
693
- let addphse = this.addPhaseInfo(ai)
694
- dj.phases.push({...ai, ...addphse})
695
- break
696
- }
697
- }
698
- }
699
- }
700
- this.phaseRings = JSON.parse(JSON.stringify(dest))
701
- },
702
- addPhaseInfo (phase) {
703
- let addphse = {}
704
- addphse.name = this.$t('openatccomponents.overview.phase') + phase.id
705
- addphse.desc = this.getPhaseDescription(phase.direction)
706
- // 相位锁定选项默认都按照解锁状态显示
707
- addphse.locktype = 0
708
- addphse.close = 0
709
- if (this.crossStatusData !== null && this.crossStatusData.phase) {
710
- // 如果方案状态相位有close字段,这边就需要对应close状态进相位关断控制的选项里
711
- let phaseStatus = this.crossStatusData.phase.filter(ele => ele.id === phase.id)[0]
712
- addphse = {...addphse, ...phaseStatus}
713
- }
714
- return addphse
715
- },
716
- getPhaseDescription (phaseList) {
717
- let list = []
718
- for (let id of phaseList) {
719
- let obj = {}
720
- obj.id = id
721
- obj.color = '#454545'
722
- list.push(obj)
723
- }
724
- return list
725
- },
691
+ // initRingPhaseData () {
692
+ // // 环信息从单独上载相位信息里获取,以免相位锁定后,方案状态数据里没有rings,导致相位锁定控制列表无法显示
693
+ // this.phaseRings = []
694
+ // let map = {}
695
+ // let dest = []
696
+ // for (let i = 0; i < this.phaseList.length; i++) {
697
+ // let ai = this.phaseList[i]
698
+ // if (!map[ai.ring]) {
699
+ // let addphse = this.addPhaseInfo(ai)
700
+ // dest.push({
701
+ // num: ai.ring,
702
+ // phases: [{...ai, ...addphse}]
703
+ // })
704
+ // map[ai.ring] = ai
705
+ // } else {
706
+ // for (var j = 0; j < dest.length; j++) {
707
+ // var dj = dest[j]
708
+ // if (dj.num === ai.ring) {
709
+ // let addphse = this.addPhaseInfo(ai)
710
+ // dj.phases.push({...ai, ...addphse})
711
+ // break
712
+ // }
713
+ // }
714
+ // }
715
+ // }
716
+ // this.phaseRings = JSON.parse(JSON.stringify(dest))
717
+ // },
718
+ // addPhaseInfo (phase) {
719
+ // let addphse = {}
720
+ // addphse.name = this.$t('openatccomponents.overview.phase') + phase.id
721
+ // addphse.desc = this.getPhaseDescription(phase.direction)
722
+ // // 相位锁定选项默认都按照解锁状态显示
723
+ // addphse.locktype = 0
724
+ // addphse.close = 0
725
+ // if (this.crossStatusData !== null && this.crossStatusData.phase) {
726
+ // // 如果方案状态相位有close字段,这边就需要对应close状态进相位关断控制的选项里
727
+ // let phaseStatus = this.crossStatusData.phase.filter(ele => ele.id === phase.id)[0]
728
+ // addphse = {...addphse, ...phaseStatus}
729
+ // }
730
+ // return addphse
731
+ // },
732
+ // getPhaseDescription (phaseList) {
733
+ // let list = []
734
+ // for (let id of phaseList) {
735
+ // let obj = {}
736
+ // obj.id = id
737
+ // obj.color = '#454545'
738
+ // list.push(obj)
739
+ // }
740
+ // return list
741
+ // },
726
742
  getFaultById () {
727
743
  let param = {
728
744
  agentId: this.agentId,
@@ -76,57 +76,29 @@
76
76
  </common-kanban>
77
77
  </div>
78
78
  </el-row>
79
- <div class="footer" v-if="realtimeStatusModalvisible">
79
+ <div class="footer">
80
80
  <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
81
- <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.implement')}}</el-button>
82
- </div>
83
- <div class="footer" v-if="!realtimeStatusModalvisible">
84
- <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
85
- <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.comfirm')}}</el-button>
81
+ <el-button type="primary" @click="handleLockPhase()">{{lockPhaseBtnName}}</el-button>
86
82
  </div>
87
83
  </div>
88
84
  </template>
89
85
 
90
86
  <script>
87
+ import RingDataModel from '../../../../utils/RingDataModel.js'
91
88
  export default {
92
- name: 'closePhaselControl',
89
+ name: 'LockPhaselControl',
93
90
  props: {
94
- Visible: {
95
- type: Boolean
96
- },
97
- controlData: {
98
- type: Object
99
- },
100
- modelList: {
101
- type: Array
102
- },
103
- stagesList: {
104
- type: Array
105
- },
106
- currModel: {
107
- type: Number
108
- },
109
- preselectModel: {
110
- type: Number
111
- },
112
- currentStage: {
113
- type: Number
114
- },
115
- preselectStages: {
116
- type: Number
117
- },
118
- specialcontrolList: {
119
- type: Array
120
- },
121
- closePhaseRings: {
91
+ phaseList: {
122
92
  type: Array
123
93
  },
124
- realtimeStatusModalvisible: {
125
- type: Boolean,
126
- default: true
94
+ patternStatus: {
95
+ type: Object
127
96
  },
128
- sidewalkPhaseData: {
129
- type: Array
97
+ lockPhaseBtnName: {
98
+ type: String,
99
+ default () {
100
+ return this.$t('openatccomponents.overview.implement')
101
+ }
130
102
  },
131
103
  roadDirection: {
132
104
  type: String
@@ -134,7 +106,8 @@ export default {
134
106
  },
135
107
  data () {
136
108
  return {
137
- visible: this.Visible,
109
+ closePhaseRings: [],
110
+ sidewalkPhaseData: [],
138
111
  manualInfo: {
139
112
  tempGreenflash: 6,
140
113
  tempDuration: 600, // 控制方式手动操作的情况下的持续时间的临时值。
@@ -153,11 +126,18 @@ export default {
153
126
  }]
154
127
  }
155
128
  },
129
+ mounted () {
130
+ if (this.patternStatus && this.phaseList && this.phaseList.length > 0) {
131
+ let ringDataModel = new RingDataModel(this.patternStatus, this.phaseList)
132
+ this.closePhaseRings = ringDataModel.initRingPhaseData()
133
+ this.sidewalkPhaseData = ringDataModel.getPedPhasePos()
134
+ }
135
+ },
156
136
  methods: {
157
137
  handleClose () {
158
138
  this.$emit('closePhaseBack')
159
139
  },
160
- handleManualControl () {
140
+ handleLockPhase () {
161
141
  let submitdata = {
162
142
  control: 22,
163
143
  data: {}
@@ -0,0 +1,303 @@
1
+ /**
2
+ * Copyright (c) 2020 kedacom
3
+ * OpenATC is licensed under Mulan PSL v2.
4
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
5
+ * You may obtain a copy of Mulan PSL v2 at:
6
+ * http://license.coscl.org.cn/MulanPSL2
7
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
+ * See the Mulan PSL v2 for more details.
11
+ **/
12
+ <template>
13
+ <div class="main-statgestatus">
14
+ <div class="stage-line" v-show="stageLineStatus"></div>
15
+ <div v-for="(item, index) in numList" :key="index + '1'">
16
+ <div class="stage-verticalline" :style="{'margin-left':item}"></div>
17
+ </div>
18
+ <div v-for="(item, index) in narr" :key="index + '2'">
19
+ <div class="stage-text" :style="{'left':item}"><span class="stage-span">S{{index + 1}}</span></div>
20
+ </div>
21
+ </div>
22
+ </template>
23
+ <script>
24
+
25
+ export default {
26
+ name: 'stagestatus',
27
+ components: {},
28
+ data () {
29
+ return {
30
+ // stageList: [],
31
+ numList: [],
32
+ stateList: [],
33
+ narr: [],
34
+ max: '',
35
+ stageStatusList: [],
36
+ stageLineStatus: false
37
+ }
38
+ },
39
+ props: {
40
+ patternStatusList: {
41
+ type: Array
42
+ },
43
+ contrloType: {
44
+ type: Boolean
45
+ },
46
+ localPatternList: {
47
+ type: Array
48
+ },
49
+ controlData: {
50
+ type: Object
51
+ }
52
+ },
53
+ watch: {
54
+ controlData: {
55
+ handler: function (val, oldVal) {
56
+ // this.handleStages() // 计算屏障高度
57
+ if (this.contrloType) {
58
+ this.getStageLine()
59
+ } else {
60
+ this.getPhaseId(this.controlData)
61
+ }
62
+ },
63
+ // 深度观察监听
64
+ deep: true
65
+ },
66
+ patternStatusList: {
67
+ handler: function (val, oldVal) {
68
+ // this.handleStages() // 计算屏障高度
69
+ this.getPhaseId(this.patternStatusList)
70
+ },
71
+ // 深度观察监听
72
+ deep: true
73
+ }
74
+ },
75
+ created () {
76
+ if (this.patternStatusList && this.patternStatusList.length > 1) {
77
+ this.getPhaseId(this.patternStatusList)
78
+ }
79
+ if (this.localPatternList) {
80
+ this.getStageLine()
81
+ }
82
+ if (this.controlData) {
83
+ this.getPhaseId(this.controlData)
84
+ }
85
+ },
86
+ mounted () {
87
+ },
88
+ beforeUpdate () {
89
+ if (this.patternStatusList && this.patternStatusList.length > 1) {
90
+ this.getPhaseId(this.patternStatusList)
91
+ } else if (this.patternStatusList && this.patternStatusList.length === 1) {
92
+ this.handleStages()
93
+ }
94
+ },
95
+ methods: {
96
+ getStageLine () {
97
+ for (let i = 0; i < this.localPatternList.length; i++) {
98
+ if (this.controlData.patternid === this.localPatternList[i].id) {
99
+ let stageCycleList = this.localPatternList[i].stagesList.map(item => {
100
+ return item.stageSplit ? item.stageSplit : 0
101
+ })
102
+ let stageMaxCyle = stageCycleList.reduce((a, b) => {
103
+ return a + b
104
+ }, 0)
105
+ this.addList(stageCycleList, stageMaxCyle)
106
+ this.stageLists = this.localPatternList[i].stagesList.map(item => {
107
+ return {
108
+ ...item,
109
+ greenWidth: (item.green / stageMaxCyle * 100).toFixed(3) + '%',
110
+ yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
111
+ redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
112
+ }
113
+ })
114
+ }
115
+ }
116
+ },
117
+ addList (baseArr, maxCycle) {
118
+ this.narr = []
119
+ this.stageLineStatus = true
120
+ let setArr = []
121
+ let currNum = 0
122
+ baseArr.forEach((item, index) => {
123
+ if (index === 0) {
124
+ setArr.push(baseArr[index])
125
+ } else {
126
+ if (currNum) {
127
+ currNum = baseArr[index] + currNum
128
+ } else {
129
+ currNum = baseArr[index] + baseArr[index - 1]
130
+ }
131
+ setArr.push(currNum)
132
+ }
133
+ })
134
+ this.numList = setArr.map(item => {
135
+ return (item / maxCycle * 100).toFixed(3) + '%'
136
+ })
137
+ this.numList.unshift(0)
138
+ for (let i = this.numList.length - 1; i >= 1; i--) {
139
+ this.narr.push((Number.parseFloat(this.numList[i]) - Number.parseFloat(this.numList[i - 1])) / 2 + Number.parseFloat(this.numList[i - 1]) - 1 + '%')
140
+ }
141
+ this.narr = JSON.parse(JSON.stringify(this.narr.reverse()))
142
+ },
143
+ getControl (newList) { // 总揽实时数据
144
+ let currentIds = ''
145
+ let lastCurrentIds = ''
146
+ this.stateList = [0]
147
+ this.narr = []
148
+ for (let j = 0; j <= this.max; j++) { // 指针长度
149
+ for (let i = 0; i < newList.length; i++) { // 环列表
150
+ let ring = newList[i]// 每个环对象
151
+ let sum = 0
152
+ for (let n = 0; n < ring.length; n++) { // 相位累计长度
153
+ if (ring[n].mode !== 7) {
154
+ if (this.controlData) {
155
+ sum = sum + ring[n].split
156
+ } else {
157
+ sum = sum + ring[n].value
158
+ }
159
+ if (j < sum) {
160
+ let phaseId = ring[n].id
161
+ currentIds = currentIds + '-' + phaseId
162
+ break
163
+ }
164
+ }
165
+ }
166
+ }
167
+ if (lastCurrentIds !== currentIds && lastCurrentIds !== '') { // 当前相位id和上一个相比不同说明相位变化了
168
+ this.stateList.push(j)// 阶段累计长度的集合
169
+ }
170
+ lastCurrentIds = currentIds
171
+ currentIds = ''
172
+ this.numList = this.stateList.map(item => {
173
+ return (item / this.max * 100).toFixed(3) + '%'
174
+ })
175
+ }
176
+ },
177
+ getPhaseId (rings) { // 画阶段方法
178
+ rings = JSON.parse(JSON.stringify(rings))
179
+ if (rings.length === 0) {
180
+ this.stageLineStatus = false
181
+ return
182
+ }
183
+ this.stageLineStatus = true
184
+ if (this.controlData) {
185
+ if (!rings.rings) return
186
+ let mapAdd = rings.phase.map(item => {
187
+ return {
188
+ id: item.id,
189
+ split: item.split
190
+ }
191
+ })
192
+ let newRings = rings.rings.map(j => {
193
+ return j.sequence
194
+ })
195
+ let newList = newRings.map(item => {
196
+ let ret = []
197
+ item.map(i => {
198
+ const find = mapAdd.find(j => j.id === i)
199
+ if (find) {
200
+ ret.push(find)
201
+ }
202
+ })
203
+ return ret
204
+ })
205
+ let mapAdds = newList.map(item => {
206
+ return item.map(val => {
207
+ return val.split
208
+ })
209
+ })
210
+ let maxCycle = mapAdds.length > 0 ? mapAdds.map(item => {
211
+ return item.length > 0 ? item.reduce((a, b) => {
212
+ return a + b
213
+ }) : 0
214
+ }) : 0
215
+ this.max = Math.max(...maxCycle)// 每个环的周期最大值
216
+ this.getControl(newList)
217
+ } else {
218
+ let mapAdd = rings.map(item => {
219
+ return item.map(val => {
220
+ return val.value
221
+ })
222
+ })
223
+ let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
224
+ return item.length > 0 ? item.reduce((a, b) => {
225
+ return a + b
226
+ }) : 0
227
+ }) : 0
228
+ this.max = Math.max(...maxCycle)// 每个环的周期最大值
229
+ this.getControl(rings)
230
+ }
231
+ for (let i = this.numList.length - 1; i >= 1; i--) {
232
+ this.narr.push((Number.parseFloat(this.numList[i]) - Number.parseFloat(this.numList[i - 1])) / 2 + Number.parseFloat(this.numList[i - 1]) - 1 + '%')
233
+ }
234
+ this.narr = JSON.parse(JSON.stringify(this.narr.reverse()))
235
+ },
236
+ handleStages () {
237
+ this.numList = [0]
238
+ this.narr = []
239
+ if (this.patternStatusList.length === 0) {
240
+ this.stageLineStatus = false
241
+ return
242
+ }
243
+ this.stageLineStatus = true
244
+ let firstPatternStatusList = this.patternStatusList[0]
245
+ let stageLength = 0
246
+ let stageStatusLength = 0
247
+ for (let i = 0; i < firstPatternStatusList.length; i++) {
248
+ let tempLength = Number.parseFloat(firstPatternStatusList[i].greenWidth) + Number.parseFloat(firstPatternStatusList[i].redWidth) + Number.parseFloat(firstPatternStatusList[i].yellowWidth)
249
+ stageStatusLength = stageLength + tempLength / 2 - 1
250
+ stageLength = stageLength + tempLength
251
+ this.numList.push(stageLength + '%')
252
+ this.narr.push(stageStatusLength + '%')
253
+ }
254
+ }
255
+ },
256
+ computed: {
257
+ }
258
+ }
259
+ </script>
260
+ <style lang="scss" scoped>
261
+ .main-statgestatus {
262
+ position: relative;
263
+ margin-bottom: 30px;
264
+ }
265
+ .stage-line {
266
+ position: relative;
267
+ top: 7px;
268
+ width: 100%;
269
+ height: 1px;
270
+ background-color: #FFFFFF;
271
+ z-index:1;
272
+ }
273
+ .stage-verticalline {
274
+ position: absolute;
275
+ float: left;
276
+ width: 1px;
277
+ height: 14px;
278
+ background-color: #FFFFFF;
279
+ z-index:2;
280
+ }
281
+ .stage-text {
282
+ position: absolute;
283
+ float: left;
284
+ width: 25px;
285
+ text-align: center;
286
+ background-color: #202940;
287
+ z-index:3;
288
+ }
289
+ .stage-span {
290
+ // position: relative;
291
+ bottom: 3px;
292
+ left: 5px;
293
+ width: 15px;
294
+ height: 14px;
295
+ font-size: 14px;
296
+ font-weight: normal;
297
+ font-stretch: normal;
298
+ line-height: 20px;
299
+ letter-spacing: 0px;
300
+ background-color: #202940;
301
+ color: #FFFFFF;
302
+ }
303
+ </style>
@@ -0,0 +1,2 @@
1
+ import StageStatus from './StageStatus.vue'
2
+ export default StageStatus
@@ -0,0 +1,2 @@
1
+ import patternList from './patternList.vue'
2
+ export default patternList