openatc-components 0.2.20 → 0.2.22

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 (25) hide show
  1. package/package/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +49 -49
  2. package/package/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +8 -39
  3. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +33 -33
  4. package/package/kisscomps/components/OverLap/OverLap.vue +24 -3
  5. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +10 -12
  6. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +3 -3
  7. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +28 -5
  8. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +2 -49
  9. package/package/kisscomps/components/patternConfig/planContent.vue +0 -3
  10. package/package/kissui.min.js +1 -1
  11. package/package.json +2 -2
  12. package/src/EdgeMgr/controller/crossDiagramMgr.js +1 -0
  13. package/src/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +49 -49
  14. package/src/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +8 -39
  15. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +33 -33
  16. package/src/kisscomps/components/OverLap/OverLap.vue +24 -3
  17. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +10 -12
  18. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +3 -3
  19. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +28 -5
  20. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +2 -49
  21. package/src/kisscomps/components/patternConfig/planContent.vue +0 -3
  22. package/src/node_modules/.package_versions.json +1 -0
  23. package/src/views/intersection.vue +5 -11
  24. package/src/views/patternConfig.vue +969 -6
  25. package/static/styles/schemeconfig.scss +8 -3
@@ -47,7 +47,7 @@
47
47
  import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
48
48
  import { uploadSingleTscParam } from '../../../api/param.js'
49
49
  import { getMessageByCode } from '../../../utils/responseMessage.js'
50
- // import { getIntersectionInfo } from '../../../api/template.js'
50
+ import { getIntersectionInfo } from '../../../api/template.js'
51
51
  import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
52
52
  import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
53
53
  // import { getTheme } from '../../../utils/auth'
@@ -100,57 +100,57 @@ export default {
100
100
  }
101
101
  },
102
102
  methods: {
103
- init (IntersectionInfo) {
103
+ init () {
104
104
  this.CrossDiagramMgr = new CrossDiagramMgr()
105
105
  this.PhaseDataModel = new PhaseDataModel(this.roadDirection)
106
- this.getIntersectionInfo(IntersectionInfo) // 获取路口信息
106
+ this.getIntersectionInfo() // 获取路口信息
107
107
  },
108
- getIntersectionInfo (res) {
108
+ getIntersectionInfo () {
109
109
  // 获取路口信息
110
- // const agentid = this.agentId || '0'
111
- // getIntersectionInfo(agentid).then(res => {
112
- // if (!res.data.success) {
113
- // this.isLoaded = false
114
- // let commomMsg = this.$t('openatccomponents.overview.signalID') + ' : ' + agentid
115
- // let msg = getMessageByCode(res.data.code, this.$i18n.locale)
116
- // if (res.data.data) {
117
- // // 子类型错误
118
- // let childErrorCode = res.data.data.errorCode
119
- // if (childErrorCode) {
120
- // let childerror = getMessageByCode(res.data.data.errorCode, this.$i18n.locale)
121
- // msg = msg + ' - ' + childerror
122
- // }
123
- // }
124
- // msg = msg + ' - ' + commomMsg
125
- // this.$message.error(msg)
126
- // return
127
- // }
128
- this.tempType = res.data.data.type
129
- // 获取车道相位、行人相位信息(坐标、名称)
130
- this.mainType = this.tempType.split('-')[0]
131
- this.mainDirection = this.tempType.split('-')[1]
132
- if (!this.isThirdSignal) {
133
- // 可点击模式下,非第三方设备,按通道显示相位方向
134
- this.getChannelInfo()
135
- return
136
- }
137
- this.crossInfo = res.data.data.param
138
- // 城市道路加载车道相位坐标和人行道坐标
139
- this.getPhasePos()
140
- this.getOverlapPhasePos()
141
- this.getPedPhasePos()
142
- this.getOverlapPedPhasePos()
143
- if (this.isThirdSignal) {
144
- // 第三方设备,按相位方向显示相位方向
145
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')
146
- this.compSidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')
147
- let allDir = this.compLanePhaseData.map(ele => ele.id)
148
- let allPedDir = this.compSidewalkPhaseData.map(ele => ele.id)
149
- this.inneChoosedDirection = this.choosedDirection.filter(dir => allDir.indexOf(dir) !== -1)
150
- this.inneChoosedPedDirection = this.choosedPedDirection.filter(dir => allPedDir.indexOf(dir) !== -1)
151
- this.drawPhaseIcon()
152
- }
153
- // })
110
+ const agentid = this.agentId || '0'
111
+ getIntersectionInfo(agentid).then(res => {
112
+ if (!res.data.success) {
113
+ this.isLoaded = false
114
+ let commomMsg = this.$t('openatccomponents.overview.signalID') + ' : ' + agentid
115
+ let msg = getMessageByCode(res.data.code, this.$i18n.locale)
116
+ if (res.data.data) {
117
+ // 子类型错误
118
+ let childErrorCode = res.data.data.errorCode
119
+ if (childErrorCode) {
120
+ let childerror = getMessageByCode(res.data.data.errorCode, this.$i18n.locale)
121
+ msg = msg + ' - ' + childerror
122
+ }
123
+ }
124
+ msg = msg + ' - ' + commomMsg
125
+ this.$message.error(msg)
126
+ return
127
+ }
128
+ this.tempType = res.data.data.type
129
+ // 获取车道相位、行人相位信息(坐标、名称)
130
+ this.mainType = this.tempType.split('-')[0]
131
+ this.mainDirection = this.tempType.split('-')[1]
132
+ if (!this.isThirdSignal) {
133
+ // 可点击模式下,非第三方设备,按通道显示相位方向
134
+ this.getChannelInfo()
135
+ return
136
+ }
137
+ this.crossInfo = res.data.data.param
138
+ // 城市道路加载车道相位坐标和人行道坐标
139
+ this.getPhasePos()
140
+ this.getOverlapPhasePos()
141
+ this.getPedPhasePos()
142
+ this.getOverlapPedPhasePos()
143
+ if (this.isThirdSignal) {
144
+ // 第三方设备,按相位方向显示相位方向
145
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')
146
+ this.compSidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')
147
+ let allDir = this.compLanePhaseData.map(ele => ele.id)
148
+ let allPedDir = this.compSidewalkPhaseData.map(ele => ele.id)
149
+ this.inneChoosedDirection = this.choosedDirection.filter(dir => allDir.indexOf(dir) !== -1)
150
+ this.inneChoosedPedDirection = this.choosedPedDirection.filter(dir => allPedDir.indexOf(dir) !== -1)
151
+ this.drawPhaseIcon()
152
+ }
153
+ })
154
154
  },
155
155
  getPhasePos () {
156
156
  // 车道相位信息
@@ -448,7 +448,7 @@ export default {
448
448
  }
449
449
  },
450
450
  mounted () {
451
- // this.init()
451
+ this.init()
452
452
  }
453
453
  }
454
454
  </script>
@@ -1,20 +1,19 @@
1
1
  <template>
2
- <div class="intersection-direction-selection" v-if="isSpecialIntersection !== undefined">
2
+ <div class="intersection-direction-selection">
3
3
  <intersection-base-map
4
- v-if="!isSpecialIntersection && reset"
4
+ v-if="!isSpecialIntersection"
5
5
  ref="intersectionMap2"
6
6
  :crossStatusData="crossStatusData"
7
7
  :agentId="agentId"
8
8
  isVipRoute
9
- :clickMode="clickMode"
9
+ clickMode
10
10
  :isThirdSignal="isThirdSignal"
11
11
  :choosedDirection="choosedDirection"
12
12
  :choosedPedDirection="choosedPedDirection"
13
13
  :roadDirection="roadDirection"
14
14
  @handleClickCrossIcon="handleClickCrossIcon" />
15
15
  <direction-list-configuration
16
- v-if="isSpecialIntersection && clickMode && reset"
17
- ref="listConfiguration"
16
+ v-if="isSpecialIntersection"
18
17
  :agentId="agentId"
19
18
  :isThirdSignal="isThirdSignal"
20
19
  :choosedDirection="choosedDirection"
@@ -35,9 +34,8 @@ export default {
35
34
  data () {
36
35
  return {
37
36
  crossStatusData: {},
38
- isSpecialIntersection: undefined,
39
- isThirdSignal: false,
40
- reset: true
37
+ isSpecialIntersection: false,
38
+ isThirdSignal: false
41
39
  }
42
40
  },
43
41
  props: {
@@ -57,23 +55,6 @@ export default {
57
55
  },
58
56
  thirdSignal: { // 是否是第三方平台(可以直接传,也可以内部接口判断)
59
57
  type: Boolean
60
- },
61
- clickMode: {
62
- type: Boolean,
63
- default: true
64
- }
65
- },
66
- watch: {
67
- agentId: {
68
- handler: function (val, oldVal) {
69
- if (val) {
70
- this.reset = false
71
- this.$nextTick(() => {
72
- this.reset = true
73
- this.initSelection()
74
- })
75
- }
76
- }
77
58
  }
78
59
  },
79
60
  methods: {
@@ -106,11 +87,6 @@ export default {
106
87
  this.mainType = this.tempType.split('-')[0]
107
88
  if (this.mainType === '999') {
108
89
  this.isSpecialIntersection = true
109
- if (this.clickMode) {
110
- this.$nextTick(() => {
111
- this.$refs.listConfiguration.init(res)
112
- })
113
- }
114
90
  } else {
115
91
  this.isSpecialIntersection = false
116
92
  }
@@ -137,22 +113,15 @@ export default {
137
113
  },
138
114
  handleClickCrossIcon (allChoosedDir, curClickedPhase) {
139
115
  this.$emit('handleClickCrossIcon', allChoosedDir, curClickedPhase)
140
- },
141
- initSelection () {
142
- this.getIntersectionInfo()
143
- this.getPlatform()
144
116
  }
145
117
  },
146
118
  mounted () {
147
- this.initSelection()
119
+ this.getIntersectionInfo()
120
+ this.getPlatform()
148
121
  },
149
122
  destroyed () {
150
123
  }
151
124
  }
152
125
  </script>
153
126
  <style lang='scss'>
154
- .intersection-direction-selection {
155
- width: 100%;
156
- height: 100%
157
- }
158
127
  </style>
@@ -276,9 +276,7 @@ export default {
276
276
  this.phaseStatusList = val.phase
277
277
  this.overlapStatusList = val.overlap
278
278
  // 默认显示相位数据(包括黄闪、全红、关灯状态下,或者匝道,均不做比对跟随相位的处理)
279
- this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
280
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.sidewalkPhaseData))
281
- this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.busPhaseData))
279
+ this.drawDefaultPhaseIcon()
282
280
  if (val.control === 1 || val.control === 2 || val.control === 3) {
283
281
  // 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
284
282
  if (val.control === 1) {
@@ -387,6 +385,14 @@ export default {
387
385
  this.PhaseDataModel = new PhaseDataModel(this.roadDirection)
388
386
  this.getIntersectionInfo() // 获取路口信息
389
387
  },
388
+ drawDefaultPhaseIcon () {
389
+ this.compLanePhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')))
390
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')))
391
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.busPhaseData))
392
+ console.log(this.LanePhaseData)
393
+ console.log(this.overlapLanePhaseData)
394
+ console.log('###################', this.compLanePhaseData)
395
+ },
390
396
  comparePhaseStatus () {
391
397
  // 对比车道: 跟随相位和相位的状态数据(此处判断是为了保证被比较的数据direction都是唯一的)
392
398
  if (!this.comdirePhaseData && !this.comdireOverlapPhaseData) {
@@ -498,39 +504,51 @@ export default {
498
504
  getYellowFlashColor () {
499
505
  // 车道相位(左行右行)
500
506
  let curLanePhaseData = []
501
- for (let i = 0; i < this.LanePhaseData.length; i++) {
507
+ for (let i = 0; i < this.compLanePhaseData.length; i++) {
502
508
  const data = {
503
- ...this.LanePhaseData[i],
509
+ ...this.compLanePhaseData[i],
504
510
  type: '黄闪',
505
511
  control: 1
506
512
  }
507
513
  curLanePhaseData.push(data)
508
514
  }
509
- this.LanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
515
+ this.compLanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
510
516
 
511
517
  // 行人相位
512
518
  let curPedStatus = []
513
- for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
519
+ for (let i = 0; i < this.compSidewalkPhaseData.length; i++) {
514
520
  const data = {
515
- ...this.sidewalkPhaseData[i],
521
+ ...this.compSidewalkPhaseData[i],
516
522
  pedtype: '黄闪',
517
523
  control: 1
518
524
  }
519
525
  curPedStatus.push(data)
520
526
  }
521
- this.sidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
527
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
522
528
 
523
529
  // 公交相位
524
530
  let curBusLanePhaseData = []
525
- for (let i = 0; i < this.busPhaseData.length; i++) {
531
+ for (let i = 0; i < this.comdireBusPhaseData.length; i++) {
526
532
  const data = {
527
- ...this.busPhaseData[i],
533
+ ...this.comdireBusPhaseData[i],
528
534
  type: '黄闪',
529
535
  control: 1
530
536
  }
531
537
  curBusLanePhaseData.push(data)
532
538
  }
533
- this.busPhaseData = JSON.parse(JSON.stringify(curBusLanePhaseData))
539
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(curBusLanePhaseData))
540
+
541
+ if (this.mainType === '103') {
542
+ // 匝道相位
543
+ if (this.LanePhaseData.length) {
544
+ const LanePhaseData = this.LanePhaseData.map(data => ({
545
+ ...data,
546
+ type: '黄闪',
547
+ control: 1
548
+ }))
549
+ this.LanePhaseData = JSON.parse(JSON.stringify(LanePhaseData))
550
+ }
551
+ }
534
552
  },
535
553
  getPhaseStatus () {
536
554
  // 得到车道相位状态(颜色)
@@ -666,6 +684,9 @@ export default {
666
684
  // 获取匝道道路的主路和支路的相位坐标
667
685
  this.getRampPhasePos()
668
686
  }
687
+ if (!this.isVipRoute) {
688
+ this.drawDefaultPhaseIcon()
689
+ }
669
690
  if (this.isVipRoute && this.isThirdSignal) {
670
691
  this.LanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')
671
692
  // console.log(this.LanePhaseData)
@@ -793,8 +814,6 @@ export default {
793
814
  })
794
815
  }
795
816
  })
796
- // 行人相位无,也要显示人行横道,与车道相位显示与否逻辑不同
797
- // this.handleCompleteSidewalkPhase()
798
817
  },
799
818
  getOverlapPedPhasePos () {
800
819
  // 行人跟随相位信息
@@ -817,25 +836,6 @@ export default {
817
836
  }
818
837
  })
819
838
  },
820
- // handleCompleteSidewalkPhase () {
821
- // // 没有相位状态的车道也要显示,默认白色
822
- // let hasDirIds = this.sidewalkPhaseData.map(data => data.id)
823
- // let allIds = []
824
- // for (let key of this.PhaseDataModel.SidePosMap.keys()) {
825
- // allIds.push(key)
826
- // }
827
- // let diffIds = allIds.filter(function (val) { return hasDirIds.indexOf(val) === -1 })
828
- // diffIds.forEach(id => {
829
- // this.sidewalkPhaseData.push({
830
- // key: `${this.sidewalkPhaseData.length + 1}`,
831
- // phaseid: undefined, // 相位id,用于对应相位状态
832
- // id,
833
- // name: this.PhaseDataModel.getSidePos(id).name,
834
- // left: this.PhaseDataModel.getSidePos(id).x,
835
- // top: this.PhaseDataModel.getSidePos(id).y
836
- // })
837
- // })
838
- // },
839
839
  getCrossType () {
840
840
  // 路口类型对应底图决策
841
841
  if (this.mainType === '101') {
@@ -47,7 +47,8 @@ export default {
47
47
  },
48
48
  data () {
49
49
  return {
50
- overlapDatas: []
50
+ overlapDatas: [],
51
+ max: ''
51
52
  }
52
53
  },
53
54
  props: {
@@ -67,6 +68,10 @@ export default {
67
68
  type: Boolean,
68
69
  default: false
69
70
  },
71
+ cycleChange: {
72
+ type: Boolean,
73
+ default: true
74
+ },
70
75
  cycle: {
71
76
  type: Number
72
77
  },
@@ -82,6 +87,13 @@ export default {
82
87
  // 深度观察监听
83
88
  deep: true
84
89
  },
90
+ cycleChange: {
91
+ handler: function (val, oldVal) {
92
+ this.doAdd(this.stageList, this.overlap)
93
+ },
94
+ // 深度观察监听
95
+ deep: true
96
+ },
85
97
  stageList: {
86
98
  handler: function (val, oldVal) {
87
99
  this.doAdd(this.stageList, this.overlap)
@@ -140,6 +152,15 @@ export default {
140
152
  if (findItems.length) findIndexs.push(...findItems.map(m => m.key))
141
153
  })
142
154
  findIndexs = Array.from(new Set(findIndexs))
155
+ if (this.cycleChange) {
156
+ const globalParamModel = this.$store.getters.globalParamModel
157
+ let pattern = globalParamModel.getParamsByType('patternList')
158
+ const allCycle = pattern.map(item => item.cycle)
159
+ let cycle = Math.max(...allCycle)
160
+ this.max = cycle
161
+ } else {
162
+ this.max = ''
163
+ }
143
164
  return {
144
165
  ...item,
145
166
  peddirection: this.getPedPhasePos(item.peddirection),
@@ -150,8 +171,8 @@ export default {
150
171
  ...sta,
151
172
  direction: this.getRoad(item),
152
173
  // peddirection: this.getPedPhasePos(item.peddirection),
153
- greenWidth: find ? (sta.split / this.cycle * 100).toFixed(3) + '%' : '0%',
154
- redWidth: !find ? (sta.split / this.cycle * 100).toFixed(3) + '%' : '0%'
174
+ greenWidth: find ? (sta.split / (this.max ? this.max : this.cycle) * 100).toFixed(3) + '%' : '0%',
175
+ redWidth: !find ? (sta.split / (this.max ? this.max : this.cycle) * 100).toFixed(3) + '%' : '0%'
155
176
  }
156
177
  })
157
178
  }
@@ -53,7 +53,7 @@
53
53
  <div class="curTimeLine" :style="{'left':paddingLeft, 'height':barrierHeight}"></div>
54
54
  </div>
55
55
  </div>
56
- <div v-if="this.contrloType === 'stage'">
56
+ <div v-if="this.contrloType === 'stage'" class="ring-first">
57
57
  <div v-for="(list, index1) in stageLists" :key="index1">
58
58
  <!-- <div> -->
59
59
  <div class="first-1" :style="{'width':list.greenWidth,'height':'34px','position':'relative','background':'#7ccc66'}">
@@ -215,7 +215,7 @@ export default {
215
215
  handler: function (val, oldVal) {
216
216
  if (val && val.curTime) {
217
217
  this.curtime = val.curTime
218
- if (val.control === '相位锁定' || val.control === '通道锁定' || val.control === '阶段锁定') {
218
+ if (val.control === 4 || val.control === 16 || val.control === 22) {
219
219
  this.isControl = false
220
220
  } else {
221
221
  this.isControl = true
@@ -244,7 +244,7 @@ export default {
244
244
  }
245
245
  if (val && val.curTime) {
246
246
  this.curtime = val.curTime
247
- if (val.control === '相位锁定' || val.control === '通道锁定' || val.control === '阶段锁定') {
247
+ if (val.control === 4 || val.control === 16 || val.control === 22) {
248
248
  this.isControl = false
249
249
  } else {
250
250
  this.isControl = true
@@ -432,9 +432,9 @@ export default {
432
432
  },
433
433
  getStage () {
434
434
  if (!this.stagesChange) return
435
- // const globalParamModel = this.$store.getters.globalParamModel
436
- // let pattern = globalParamModel.getParamsByType('patternList')
437
- let mapAdd = this.allPatternList.map(item => item.stagesList).map(item => {
435
+ const globalParamModel = this.$store.getters.globalParamModel
436
+ let pattern = globalParamModel ? globalParamModel.getParamsByType('patternList') : this.allPatternList
437
+ let mapAdd = pattern.map(item => item.stagesList).map(item => {
438
438
  return item.map(val => {
439
439
  return val.stageSplit ? val.stageSplit : val.split
440
440
  })
@@ -444,7 +444,6 @@ export default {
444
444
  return a + b
445
445
  }) : 0
446
446
  }) : 0
447
- console.log(maxCycle, 'maxCycle')
448
447
  let stageMaxCyle = Math.max(...maxCycle)// 每个环的周期最大值
449
448
  if (!this.cycleChange) {
450
449
  let stageCycleList = this.stagesChange.map(item => {
@@ -464,7 +463,6 @@ export default {
464
463
  redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
465
464
  }
466
465
  })
467
- console.log(this.stageLists, '011')
468
466
  },
469
467
  getBusPos () {
470
468
  // 公交相位信息
@@ -1052,9 +1050,9 @@ export default {
1052
1050
  this.fillGap(ringTeams, val)
1053
1051
  }
1054
1052
  if (this.cycleChange) {
1055
- // const globalParamModel = this.$store.getters.globalParamModel
1056
- // let pattern = globalParamModel.getParamsByType('patternList')
1057
- const allCycle = this.patternList.map(item => item.cycle)
1053
+ const globalParamModel = this.$store.getters.globalParamModel
1054
+ let pattern = globalParamModel.getParamsByType('patternList')
1055
+ const allCycle = pattern.map(item => item.cycle)
1058
1056
  let cycle = Math.max(...allCycle)
1059
1057
  this.max = cycle
1060
1058
  } else {
@@ -1063,7 +1061,7 @@ export default {
1063
1061
  let barrier = this.step2(ringTeams, newPattern)
1064
1062
  let barrierLeft = barrier.map(item => item)// 屏障左移显示出人行横道
1065
1063
  this.barrierList = barrierLeft.map(j => {
1066
- return (j / (this.max ? this.max : this.newCycle) * 100) + '%'
1064
+ return (j / (this.max ? this.max : cycle) * 100) + '%'
1067
1065
  })
1068
1066
  // this.barrierList.unshift(0)
1069
1067
  }
@@ -510,9 +510,9 @@ export default {
510
510
  data[key] = that.ParamsModeEn.get(0)
511
511
  }
512
512
  }
513
- if (key === 'control') {
514
- data[key] = that.ParamsControlEn.get(data[key])
515
- }
513
+ // if (key === 'control') {
514
+ // data[key] = that.ParamsControlEn.get(data[key])
515
+ // }
516
516
  if (key === 'phase') {
517
517
  for (let val of data[key]) {
518
518
  val.type = that.phaseTypeEn.get(val.type)
@@ -94,7 +94,6 @@
94
94
  </el-row>
95
95
  <el-row>
96
96
  <el-radio
97
- style="margin-left: 30px"
98
97
  v-model="isRing"
99
98
  :label="false"
100
99
  @change="changeRing"
@@ -113,7 +112,7 @@
113
112
  <pattern-list
114
113
  :key="keyChange"
115
114
  :allPatternList="allPatternList"
116
- :contrloType="!this.isRing ? 'ring' : 'stage'"
115
+ :contrloType="contrloType"
117
116
  :stagesChange="
118
117
  patternOne.length === 0
119
118
  ? planPattern.stagesList
@@ -390,6 +389,7 @@ export default {
390
389
  group: 'pattern'
391
390
  },
392
391
  max: '',
392
+ contrloType: '',
393
393
  patternCycleEqual: true,
394
394
  activeList: 'ring',
395
395
  isRing: false,
@@ -417,6 +417,25 @@ export default {
417
417
  this.handleStageData(this.planPattern.rings)
418
418
  }
419
419
  this.initData()
420
+ if (!this.allPatternList[0].contrloType && this.allPatternList[0].rings.length > 0) {
421
+ this.contrloType = 'ring'
422
+ } else if (!this.allPatternList[0].contrloType && this.allPatternList[0].rings.length === 0) {
423
+ this.contrloType = 'stage'
424
+ } else {
425
+ this.contrloType = this.allPatternList[0].contrloType
426
+ }
427
+ for (let i = 0; i < this.allPatternList.length; i++) {
428
+ if (this.allPatternList[i].contrloType === 'stage' || (this.isRing && !this.allPatternList[i].contrloType)) {
429
+ this.isRing = true
430
+ // this.setStageList(this.allPatternList[i].stagesList, this.allPatternList[i].id)
431
+ } else if (this.allPatternList[i].contrloType === 'ring' || (!this.isRing && !this.allPatternList[i].contrloType && this.allPatternList[i].rings.length > 0)) {
432
+ this.isRing = false
433
+ // this.handleStageData(this.allPatternList[i].rings)
434
+ } else if (this.allPatternList[i].rings.length === 0 && this.allPatternList[i].stagesList.length > 0) {
435
+ this.isRing = true
436
+ // this.setStageList(this.allPatternList[i].stagesList, this.allPatternList[i].id)
437
+ }
438
+ }
420
439
  },
421
440
  methods: {
422
441
  addStage (row) {
@@ -448,7 +467,7 @@ export default {
448
467
  }
449
468
  },
450
469
  changeRing () {
451
- // this.contrloType = 'stage'
470
+ this.contrloType = 'ring'
452
471
  this.isRing = false
453
472
  // const globalParamModel = this.$store.getters.globalParamModel
454
473
  // let pattern = globalParamModel.getParamsByType('patternList')
@@ -468,7 +487,11 @@ export default {
468
487
  // }
469
488
  },
470
489
  changeStage () {
490
+ this.contrloType = 'stage'
471
491
  this.isRing = true
492
+ this.patternOne = this.allPatternList.filter(item => {
493
+ return item.id === Number(this.manualInfo.tempPatternid)
494
+ })
472
495
  this.getStageCycle()
473
496
  },
474
497
  getStageCycle () {
@@ -849,14 +872,14 @@ export default {
849
872
  setTimeout(() => {
850
873
  this.handleStageData(currPattern)
851
874
  this.getCycles()
852
- this.patternOne[0].stagesList = this.stagesList
875
+ // this.patternOne[0].stagesList = this.stagesList
853
876
  }, 50)
854
877
  } else {
855
878
  let currPattern = this.planPattern.rings
856
879
  setTimeout(() => {
857
880
  this.handleStageData(currPattern)
858
881
  this.getCycle()
859
- this.allPatternList[0].stagesList = this.stagesList
882
+ // this.allPatternList[0].stagesList = this.stagesList
860
883
  }, 50)
861
884
  }
862
885
  },
@@ -76,28 +76,13 @@
76
76
  <el-table-column align="center" :label="$t('openatccomponents.pattern.plan')">
77
77
  <template slot-scope="scope">
78
78
  <div class="pattern-figure">
79
- <!-- <pattern-list
79
+ <pattern-list
80
80
  :patternStatusList="scope.row.rings"
81
81
  :cycles="scope.row.cycle"
82
82
  :phaseList="scope.row.currPhase"
83
- :contrloType="controlType"
84
83
  >
85
- </pattern-list> -->
86
- <pattern-list
87
- :patternId="scope.row.patternid"
88
- :contrloType="getControlType(scope.row)"
89
- :index="scope.$index"
90
- :cycleChange="true"
91
- :stagesChange="getSelectedPattern(scope.row).stagesList"
92
- :patternStatusList="getSelectedPattern(scope.row).rings"
93
- :patternList="scope.row.allPatterns"
94
- :allPatternList="scope.row.allPatterns"
95
- :cycles="scope.row.cycle"
96
- :phaseList="scope.row.currPhase"
97
- :agentId="scope.row.agentid"
98
- :showBarrier="false">
99
84
  </pattern-list>
100
- </div>
85
+ </div>
101
86
  </template>
102
87
  </el-table-column>
103
88
  </el-table>
@@ -129,7 +114,6 @@ export default {
129
114
  },
130
115
  data () {
131
116
  return {
132
- controlType: 'stage',
133
117
  loading: true,
134
118
  tableHeight: 460,
135
119
  screenHeight: window.innerHeight, // 屏幕高度
@@ -195,9 +179,6 @@ export default {
195
179
  let currPattern
196
180
  if (Array.isArray(currPatternList)) {
197
181
  currPattern = currPatternList.filter(cpl => cpl.id === patternId)[0]
198
- if (!currPattern) {
199
- currPattern = currPatternList[0]
200
- }
201
182
  } else {
202
183
  currPattern = currPatternList
203
184
  }
@@ -311,34 +292,6 @@ export default {
311
292
  }
312
293
  return res
313
294
  },
314
- getControlType (row) {
315
- let contrloType = 'ring'
316
- let allPatternList = row.feature && row.feature.patternList ? row.feature.patternList : row.allPatterns
317
- if (
318
- !allPatternList[0].contrloType &&
319
- allPatternList[0].rings.length > 0
320
- ) {
321
- contrloType = 'ring'
322
- } else if (
323
- !allPatternList[0].contrloType &&
324
- allPatternList[0].rings.length === 0
325
- ) {
326
- contrloType = 'stage'
327
- } else {
328
- contrloType = allPatternList[0].contrloType
329
- }
330
- let res = contrloType
331
- return res
332
- },
333
- getSelectedPattern (row) {
334
- let res = []
335
- let patternList = row.feature && row.feature.patternList ? row.feature.patternList : row.allPatterns
336
- let pattern = patternList.find(item => item.id === row.patternid)
337
- if (pattern) {
338
- res = pattern
339
- }
340
- return res
341
- },
342
295
  getCurPattern (agentid) {
343
296
  // 获取当前设备所有可选方案
344
297
  this.loading = true