openatc-components 0.0.39-hotfix → 0.0.40-hotfix

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/config/index.js CHANGED
@@ -17,6 +17,7 @@ module.exports = {
17
17
  // target: 'https://dolphin-test.kedacom.com/openatc',
18
18
  target: 'http://192.168.13.105:11003/openatc',
19
19
  // target: 'http://192.168.13.103:10003/openatc',
20
+ // target: 'http://192.168.13.103:10003/openatc',
20
21
  // target: 'http://192.168.13.103:9999',//'http://172.16.239.139:8080/',//设置你调用的接口域名和端口号
21
22
  // target: 'http://192.168.13.103:9999/kissapi',//'http://172.16.239.139:8080/',//设置你调用的接口域名和端口号
22
23
  changeOrigin: true, //跨域
@@ -350,17 +350,17 @@ export default {
350
350
  // 公交相位信息
351
351
  this.busPhaseData = []
352
352
  this.phaseList.forEach((ele, i) => {
353
- if (ele.controltype >= 3 && ele.controltype <= 5) {
354
- ele.direction.forEach((dir, index) => {
353
+ // if (ele.controltype >= 3 && ele.controltype <= 5) {
354
+ ele.direction.forEach((dir, index) => {
355
355
  // 车道相位
356
- this.busPhaseData.push({
357
- phaseid: ele.id, // 相位id,用于对应相位状态
358
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
359
- name: this.PhaseDataModel.getBusPhasePos(dir).name,
360
- controltype: ele.controltype
361
- })
356
+ this.busPhaseData.push({
357
+ phaseid: ele.id, // 相位id,用于对应相位状态
358
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
359
+ name: this.PhaseDataModel.getBusPhasePos(dir).name,
360
+ controltype: ele.controltype
362
361
  })
363
- }
362
+ })
363
+ // }
364
364
  })
365
365
  let result = []
366
366
  let obj = {}
@@ -21,11 +21,11 @@
21
21
  :controlData="controlData"
22
22
  :modelList="modelList"
23
23
  :patternSelect="patternSelect"
24
- :stagesList="stagesList"
24
+ :crossStatusData="crossStatusData"
25
+ :phaseList="phaseList"
25
26
  :specialcontrolList="specialcontrolList"
26
27
  :currModel="currModel"
27
28
  :preselectModel="preselectModel"
28
- :currentStage="currentStage"
29
29
  :preselectStages="preselectStages"
30
30
  :realtimeStatusModalvisible="realtimeStatusModalvisible"
31
31
  :funcSort="funcSort"
@@ -86,12 +86,12 @@
86
86
  :confirmedFault="confirmedFault"
87
87
  :ignoredFault="ignoredFault"
88
88
  :untreatedFault="untreatedFault"
89
- :currentStage="currentStage"
90
89
  :closePhase="closePhase"
91
90
  :agentName="agentName"
92
91
  :devStatus="devStatus"
93
92
  :agentId="agentId"
94
- :stagesList="stagesList"
93
+ :crossStatusData="crossStatusData"
94
+ :phaseList="phaseList"
95
95
  :sidewalkPhaseData="sidewalkPhaseData"
96
96
  :roadDirection="roadDirection"
97
97
  @changeStatus="changeStatus"
@@ -191,8 +191,6 @@ export default {
191
191
  controlData: {},
192
192
  control: '',
193
193
  sidewalkPhaseData: [],
194
- stagesList: [],
195
- currentStage: 0,
196
194
  list: [{
197
195
  iconClass: 'model',
198
196
  name: '控制模式',
@@ -349,23 +347,7 @@ export default {
349
347
  getPedPhasePos () {
350
348
  let ringDataModel = new RingDataModel(this.statusData, this.phaseList)
351
349
  this.sidewalkPhaseData = ringDataModel.getPedPhasePos()
352
- // // 行人相位信息
353
- // this.sidewalkPhaseData = []
354
- // this.phaseList.forEach((ele, i) => {
355
- // if (ele.peddirection) {
356
- // ele.peddirection.forEach((dir, index) => {
357
- // // 行人相位
358
- // if (this.PhaseDataModel.getSidePos(dir)) {
359
- // this.sidewalkPhaseData.push({
360
- // key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
361
- // phaseid: ele.id, // 相位id,用于对应相位状态
362
- // id: dir,
363
- // name: this.PhaseDataModel.getSidePos(dir).name
364
- // })
365
- // }
366
- // })
367
- // }
368
- // })
350
+ this.ringDataModel = ringDataModel
369
351
  },
370
352
  clearFaultInterval () {
371
353
  if (this.faultTimer !== null) {
@@ -377,81 +359,9 @@ export default {
377
359
  this.crossStatusData = JSON.parse(JSON.stringify(this.statusData))
378
360
  let TscData = JSON.parse(JSON.stringify(this.crossStatusData))
379
361
  this.currModel = TscData.control
380
- this.handleStageData(TscData) // 处理阶段(驻留)stage数据
381
362
  this.controlData = this.handleGetData(TscData)
382
363
  this.handleGetPhaseClose()
383
364
  },
384
- getBusPos () {
385
- // 公交相位信息
386
- this.busPhaseData = []
387
- this.phaseList.forEach((ele, i) => {
388
- if (ele.controltype >= 3 && ele.controltype <= 5) {
389
- ele.direction.forEach((dir, index) => {
390
- // 车道相位
391
- this.busPhaseData.push({
392
- // key: this.CrossDiagramMgr.getUniqueKey('busphase'),
393
- phaseid: ele.id, // 相位id,用于对应相位状态
394
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
395
- name: this.PhaseDataModel.getBusPhasePos(dir).name,
396
- controltype: ele.controltype
397
- })
398
- })
399
- }
400
- })
401
- let result = []
402
- let obj = {}
403
- for (var i = 0; i < this.busPhaseData.length; i++) {
404
- if (!obj[this.busPhaseData[i].phaseid]) {
405
- result.push(this.busPhaseData[i])
406
- obj[this.busPhaseData[i].phaseid] = true
407
- }
408
- }
409
- this.busPhaseData = result
410
- },
411
- handleStageData (data) {
412
- this.getBusPos()
413
- this.stagesList = []
414
- let busPhaseData = this.busPhaseData
415
- this.currentStage = data.current_stage
416
- let stages = data.stages
417
- if (!stages) return
418
- let stagesTemp = []
419
- for (let stage of stages) {
420
- let tempList = []
421
- let directionList = []
422
- let stageControType = 0
423
- let peddirections = []
424
- for (let stg of stage) {
425
- let currPhase = this.phaseList.filter((item) => {
426
- return item.id === stg
427
- })[0]
428
- if (currPhase !== undefined) {
429
- directionList = [...currPhase.direction, ...directionList]
430
- }
431
- for (let walk of this.sidewalkPhaseData) {
432
- if (stg === walk.phaseid) {
433
- peddirections.push(...currPhase.peddirection)
434
- peddirections = Array.from(new Set(peddirections))
435
- }
436
- }
437
- for (let busPhase of busPhaseData) {
438
- if (stg === busPhase.phaseid) {
439
- stageControType = busPhase.controltype
440
- }
441
- }
442
- }
443
- directionList = [...new Set(directionList)]
444
- if (directionList.length === 0) return
445
- tempList = directionList.map(dir => ({
446
- id: dir,
447
- color: '#606266',
448
- controltype: stageControType,
449
- peddirection: peddirections
450
- }))
451
- stagesTemp.push(tempList)
452
- }
453
- this.stagesList = JSON.parse(JSON.stringify(stagesTemp))
454
- },
455
365
  lockScreen () {
456
366
  this.loading = this.$loading({
457
367
  lock: true,
@@ -59,20 +59,10 @@
59
59
  </div>
60
60
  <div class="stage-label">{{$t('openatccomponents.overview.stage')}}:</div>
61
61
  <div style="width: 100%; height: auto;overflow: hidden;">
62
- <div class="control-model" v-for="(item, index) in stagesList" :key="index">
63
- <div class="single-model" @click="selectStages(index + 1)" :class="preselectStages == index + 1 ? 'single-model-select' : ''">
64
- <xdrdirselector Width="40px" Height="40px" :showlist="item" :roadDirection="roadDirection"></xdrdirselector>
65
- <div style="display:flex;flex-direction:row;justify-content:center;align-items:center;">
66
- <div class="current-stage-num" style="width:20%;">{{index + 1}}</div>
67
- <div style="width:70%;">
68
- <i class="iconfont icon-BRT" style="font-size:11PX;color:#606266;" v-if="item[item.length-1].controltype === 4"></i>
69
- <i class="iconfont icon-feijidongche" style="font-size:11PX;color:#606266;" v-if="item[item.length-1].controltype === 6"></i>
70
- <i class="iconfont icon-gongjiaoche" style="font-size:11PX;color:#606266;" v-if="item[item.length-1].controltype === 3"></i>
71
- <i class="iconfont icon-youguidianche" style="font-size:11PX;color:#606266;" v-if="item[item.length-1].controltype === 5"></i>
72
- </div>
73
- </div>
74
- </div>
75
- </div>
62
+ <Stages :crossStatusData="crossStatusData"
63
+ :phaseList="phaseList"
64
+ :isShowCurrentStage="false"
65
+ @onSelectStages="selectStages"></Stages>
76
66
  </div>
77
67
  <div class="stage-label" v-if="funcSort === 'allFunc'">{{$t('openatccomponents.overview.specialcontrol')}}:</div>
78
68
  <div style="width: 100%; height: auto;overflow: hidden;" v-if="funcSort === 'allFunc'">
@@ -96,12 +86,24 @@
96
86
 
97
87
  <script>
98
88
  import xdrdirselector from '../../XRDDirSelector/XRDDirSelector'
89
+ import Stages from '../../Stages/index'
99
90
  export default {
100
91
  name: 'manualControl',
101
92
  components: {
102
- xdrdirselector
93
+ xdrdirselector,
94
+ Stages
103
95
  },
104
96
  props: {
97
+ crossStatusData: {
98
+ type: Object,
99
+ default: () => {}
100
+ },
101
+ phaseList: {
102
+ type: Array,
103
+ default () {
104
+ return []
105
+ }
106
+ },
105
107
  Visible: {
106
108
  type: Boolean
107
109
  },
@@ -111,9 +113,9 @@ export default {
111
113
  modelList: {
112
114
  type: Array
113
115
  },
114
- stagesList: {
115
- type: Array
116
- },
116
+ // stagesList: {
117
+ // type: Array
118
+ // },
117
119
  patternSelect: {
118
120
  type: Array
119
121
  },
@@ -142,12 +142,11 @@
142
142
  </div>
143
143
  <!-- 信号机控制状态模块 End-->
144
144
 
145
- <div class="cross-content" v-show="stagesList && stagesList.length > 0">
145
+ <div class="cross-content">
146
146
  <div style="float: left;" class="cross-name">{{$t('openatccomponents.overview.currentstage')}}:</div>
147
147
  <div style="margin-left: 85PX;">
148
- <Stages :stagesList="stagesList"
149
- :currentStage="currentStage"
150
- :sidewalkPhaseData="sidewalkPhaseData"
148
+ <Stages :crossStatusData="crossStatusData"
149
+ :phaseList="phaseList"
151
150
  @onSelectStages="onSelectStages"></Stages>
152
151
  </div>
153
152
  </div>
@@ -170,14 +169,22 @@
170
169
 
171
170
  <script>
172
171
  import xdrdirselector from '../../XRDDirSelector/XRDDirSelector'
173
- import PatternWalkSvg from '../../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
174
172
  export default {
175
173
  name: 'realtimestatus',
176
174
  components: {
177
- xdrdirselector,
178
- PatternWalkSvg
175
+ xdrdirselector
179
176
  },
180
177
  props: {
178
+ crossStatusData: {
179
+ type: Object,
180
+ default: () => {}
181
+ },
182
+ phaseList: {
183
+ type: Array,
184
+ default () {
185
+ return []
186
+ }
187
+ },
181
188
  Visible: {
182
189
  type: Boolean
183
190
  },
@@ -16,9 +16,19 @@
16
16
  <div style="width: 100%; height: auto;">
17
17
  <div class="control-model" v-for="(item, index) in stagesList" :key="index">
18
18
  <div style="position:relative;" :style="singleStyle" class="single-model" @click="selectStages(index + 1)" :class="currentStage == index + 1 ? 'single-model-select' : ''">
19
- <template v-for="(side, index) in item[0].sidewalkPhaseData" >
20
- <PatternWalkSvg class="patternWalk" v-if="item[0].peddirection.includes(side.id)" :key="side.key + '-' + index" :Data="side" :Width="'55'" :Height="'55'" />
21
- </template>
19
+ <!-- <template v-for="(side, index) in item[0].sidewalkPhaseData" >
20
+ <PatternWalkSvg class="patternWalk"
21
+ v-if="item[0].peddirection.includes(side.id)"
22
+ :key="side.key + '-' + index"
23
+ :Data="side"
24
+ :Width="'55'"
25
+ :Height="'55'" />
26
+ </template> -->
27
+ <PatternWalkSvg class="patternWalk"
28
+ :showWalk="item[0].peddirection"
29
+ :sidewalkPhaseData="item[0].sidewalkPhaseData"
30
+ :Width="'55'"
31
+ :Height="'55'" />
22
32
  <xdr-dir-selector Width="40PX" Height="40PX" :showlist="item"></xdr-dir-selector>
23
33
  <div style="display:flex;flex-direction:row;justify-content:center;align-items:center;">
24
34
  <div class="current-stage-num" style="width:20%;">{{index + 1}}</div>
@@ -31,6 +41,10 @@
31
41
  </div>
32
42
  </div>
33
43
  </div>
44
+ <!-- <PatternWalkSvg class="patternWalk"
45
+ :Data="side"
46
+ :Width="'55'"
47
+ :Height="'55'" /> -->
34
48
  </div>
35
49
  </div>
36
50
  </div>
@@ -38,20 +52,21 @@
38
52
 
39
53
  <script>
40
54
  /* eslint-disable */
41
- import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
55
+ import RingDataModel from '../../../utils/RingDataModel.js'
42
56
  export default {
43
57
  name: 'Stages',
44
- components: {
45
- PatternWalkSvg
46
- },
47
58
  props: {
48
- stagesList: {
49
- type: Array,
50
- default: []
59
+ isShowCurrentStage: {
60
+ type: Boolean,
61
+ default: true
51
62
  },
52
- currentStage: {
53
- type: Number,
54
- default: -1
63
+ crossStatusData: {
64
+ type: Object,
65
+ default: () => {}
66
+ },
67
+ phaseList: {
68
+ type: Array,
69
+ default: () => []
55
70
  },
56
71
  StageWidth: {
57
72
  type: String,
@@ -64,6 +79,9 @@ export default {
64
79
  },
65
80
  data () {
66
81
  return {
82
+ side: {key: 'pedphase1653818707546719', phaseid: 1, id: 1, name: '东人行横道'},
83
+ // stagesList: [],
84
+ currentStage: -1,
67
85
  };
68
86
  },
69
87
  computed: {
@@ -72,10 +90,24 @@ export default {
72
90
  width: this.StageWidth,
73
91
  height: this.StageHeight
74
92
  }
93
+ },
94
+ stagesList () {
95
+ let list = []
96
+ if (this.crossStatusData && this.phaseList) {
97
+ let ringDataModel = new RingDataModel(this.crossStatusData, this.phaseList)
98
+ list = ringDataModel.getStageData()
99
+ if (this.isShowCurrentStage) {
100
+ this.currentStage = this.crossStatusData.current_stage
101
+ }
102
+ }
103
+ return list
75
104
  }
76
105
  },
77
106
  methods: {
78
107
  selectStages (value) {
108
+ if (this.isShowCurrentStage) {
109
+ return false
110
+ }
79
111
  this.currentStage = value
80
112
  this.$emit('onSelectStages', value)
81
113
  }