openatc-components 0.3.17 → 0.3.19
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 +1 -1
- package/package/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +26 -7
- package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +85 -81
- package/package/kisscomps/components/PhaseLegend/PhaseLegend.vue +290 -0
- package/package/kisscomps/components/PhaseLegend/index.js +2 -0
- package/package/kisscomps/index.js +3 -1
- package/package/kissui.min.js +1 -1
- package/package.json +1 -1
- package/src/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +26 -7
- package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +85 -81
- package/src/kisscomps/components/PhaseLegend/PhaseLegend.vue +290 -0
- package/src/kisscomps/components/PhaseLegend/index.js +2 -0
- package/src/kisscomps/index.js +3 -1
- package/src/router/index.js +1 -1
- package/src/utils/RingDataModel.js +18 -7
- package/src/views/intersection.vue +111 -3
- package/src/views/overView.vue +1 -1
- package/static/styles/phasePedSelect.scss +1 -0
- package/static/styles/stages.scss +2 -2
package/config/index.js
CHANGED
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
|
16
16
|
// target: 'http://192.168.14.2:8012/openatc',//'http://172.16.239.139:8080/',//设置你调用的接口域名和端口号
|
|
17
17
|
// target: 'https://dolphin-test.kedacom.com/openatc',
|
|
18
18
|
// target: 'http://192.168.13.105:11003/openatc',
|
|
19
|
-
target: 'http://192.168.
|
|
19
|
+
target: 'http://192.168.13.103:10003/openatc',
|
|
20
20
|
// target: 'http://192.168.15.11:8012/openatc',
|
|
21
21
|
// target: 'http://192.168.13.103:10003/openatc',
|
|
22
22
|
// target: 'http://192.168.13.103:9999',//'http://172.16.239.139:8080/',//设置你调用的接口域名和端口号
|
package/package/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue
CHANGED
|
@@ -19,12 +19,15 @@
|
|
|
19
19
|
:crossStatusData="crossStatusData"
|
|
20
20
|
:agentId="agentId"
|
|
21
21
|
:graphicMode="true"
|
|
22
|
-
:roadDirection="roadDirection"
|
|
22
|
+
:roadDirection="roadDirection"
|
|
23
|
+
:isThirdSignal="isThirdSignal"/>
|
|
23
24
|
</div>
|
|
24
25
|
</template>
|
|
25
26
|
|
|
26
27
|
<script>
|
|
27
28
|
import IntersectionMap from '../IntersectionMap/intersectionmap'
|
|
29
|
+
import { queryDevice } from '../../../api/control.js'
|
|
30
|
+
import { getMessageByCode } from '../../../utils/responseMessage.js'
|
|
28
31
|
|
|
29
32
|
export default {
|
|
30
33
|
name: 'channel-realtime-intersection',
|
|
@@ -77,19 +80,35 @@ export default {
|
|
|
77
80
|
data () {
|
|
78
81
|
return {
|
|
79
82
|
reset: true,
|
|
80
|
-
crossStatusData: {}
|
|
83
|
+
crossStatusData: {},
|
|
84
|
+
isThirdSignal: false
|
|
81
85
|
}
|
|
82
86
|
},
|
|
83
87
|
methods: {
|
|
84
|
-
|
|
88
|
+
getPlatform () {
|
|
89
|
+
queryDevice(this.agentId).then(res => {
|
|
90
|
+
if (!res.data.success) {
|
|
91
|
+
let commomMsg = this.$t('openatc.overview.signalID') + ': ' + this.AgentId
|
|
92
|
+
this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale) + ' - ' + commomMsg)
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
this.platform = res.data.data.platform
|
|
96
|
+
console.log(this.platform)
|
|
97
|
+
if (this.platform !== '' && this.platform !== 'OpenATC') {
|
|
98
|
+
this.isThirdSignal = true
|
|
99
|
+
} else {
|
|
100
|
+
this.isThirdSignal = false
|
|
101
|
+
}
|
|
102
|
+
if (this.thirdSignal) {
|
|
103
|
+
this.isThirdSignal = this.thirdSignal
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}
|
|
85
107
|
},
|
|
86
108
|
created () {
|
|
87
109
|
},
|
|
88
110
|
mounted () {
|
|
89
|
-
|
|
90
|
-
// 模拟
|
|
91
|
-
// this.crossStatusData = JSON.parse(JSON.stringify(this.channelRealtimeStatusData))
|
|
92
|
-
// }, 3000)
|
|
111
|
+
this.getPlatform()
|
|
93
112
|
this.crossStatusData = JSON.parse(JSON.stringify(this.channelRealtimeStatusData))
|
|
94
113
|
},
|
|
95
114
|
destroyed () {
|
|
@@ -287,64 +287,15 @@ export default {
|
|
|
287
287
|
this.statusData = JSON.parse(JSON.stringify(val))
|
|
288
288
|
// 默认显示相位数据(包括黄闪、全红、关灯状态下,或者匝道,均不做比对跟随相位的处理)
|
|
289
289
|
this.drawDefaultPhaseIcon()
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
// 通道路口图状态数据
|
|
290
|
+
if (this.channelType && !this.isThirdSignal) {
|
|
291
|
+
// 通道路口图状态数据(实时通道展示排除第三方信号机,第三方信号机还是按模版路口一样展示相位状态)
|
|
293
292
|
this.channelStatusList = val.channellamp
|
|
294
293
|
this.createChannelStatusMap()
|
|
295
294
|
this.getChannelPhaseStatus()
|
|
296
295
|
this.getChannelPedStatus()
|
|
297
296
|
return
|
|
298
297
|
}
|
|
299
|
-
|
|
300
|
-
// 模版路口图状态数据
|
|
301
|
-
this.phaseStatusList = val.phase
|
|
302
|
-
this.overlapStatusList = val.overlap
|
|
303
|
-
if (val.control === 1 || val.control === 2 || val.control === 3) {
|
|
304
|
-
// 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
|
|
305
|
-
if (val.control === 1) {
|
|
306
|
-
this.getYellowFlashColor()
|
|
307
|
-
} else {
|
|
308
|
-
this.SpecialControl(val)
|
|
309
|
-
}
|
|
310
|
-
this.isHasPhase = false
|
|
311
|
-
return
|
|
312
|
-
}
|
|
313
|
-
if (!val.phase && !this.overlapStatusList) {
|
|
314
|
-
// 非特殊控制,相位和跟随相位不存在的情况下,灯色恢复默认
|
|
315
|
-
this.handleSpecialControlStatus('默认')
|
|
316
|
-
this.isHasPhase = false
|
|
317
|
-
return
|
|
318
|
-
}
|
|
319
|
-
if (val.control === 16) {
|
|
320
|
-
// 方向锁定时,相位状态显示与通道无关,显示接口返回的红灯会有歧义,此处特殊处理显示默认白色
|
|
321
|
-
this.handleSpecialControlStatus('方向锁定')
|
|
322
|
-
this.isHasPhase = false
|
|
323
|
-
return
|
|
324
|
-
}
|
|
325
|
-
this.curPhase = val.current_phase
|
|
326
|
-
this.isHasPhase = true
|
|
327
|
-
this.createPhaseStatusMap()
|
|
328
|
-
// 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
|
|
329
|
-
this.getPhaseStatus()
|
|
330
|
-
this.getOverlapPhaseStatus()
|
|
331
|
-
this.getCurPhaseCountdown()
|
|
332
|
-
this.getBusPhaseStatus()
|
|
333
|
-
if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
|
|
334
|
-
// 城市道路和路段行人过街才显示人行道状态
|
|
335
|
-
this.getpedStatus()
|
|
336
|
-
this.getOverlapPedStatus()
|
|
337
|
-
// 算法对比行人相位与行人跟随相位的状态
|
|
338
|
-
this.comparePedStatus()
|
|
339
|
-
// 算法对比车道相位与车道跟随相位的状态
|
|
340
|
-
this.comparePhaseStatus()
|
|
341
|
-
}
|
|
342
|
-
// console.log('this.phaseStatusMap 相位状态映射', this.phaseStatusMap)
|
|
343
|
-
// console.log('LanePhaseData 车道相位', this.LanePhaseData)
|
|
344
|
-
// console.log('sidewalkPhaseData 行人相位', this.sidewalkPhaseData)
|
|
345
|
-
// console.log('overlapPhaseStatusMap 跟随相位状态映射', this.overlapPhaseStatusMap)
|
|
346
|
-
// console.log('overlapLanePhaseData 车道跟随相位', this.overlapLanePhaseData)
|
|
347
|
-
// console.log('this.overlapsidewalkPhaseData 行人跟随相位', this.overlapsidewalkPhaseData)
|
|
298
|
+
this.handleTempCrossStatus(val)
|
|
348
299
|
},
|
|
349
300
|
// 深度观察监听
|
|
350
301
|
deep: true
|
|
@@ -414,6 +365,56 @@ export default {
|
|
|
414
365
|
}
|
|
415
366
|
},
|
|
416
367
|
methods: {
|
|
368
|
+
handleTempCrossStatus (val) {
|
|
369
|
+
// 模版路口图状态数据
|
|
370
|
+
this.phaseStatusList = val.phase
|
|
371
|
+
this.overlapStatusList = val.overlap
|
|
372
|
+
if (val.control === 1 || val.control === 2 || val.control === 3) {
|
|
373
|
+
// 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
|
|
374
|
+
if (val.control === 1) {
|
|
375
|
+
this.getYellowFlashColor()
|
|
376
|
+
} else {
|
|
377
|
+
this.SpecialControl(val)
|
|
378
|
+
}
|
|
379
|
+
this.isHasPhase = false
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
if (!val.phase && !this.overlapStatusList) {
|
|
383
|
+
// 非特殊控制,相位和跟随相位不存在的情况下,灯色恢复默认
|
|
384
|
+
this.handleSpecialControlStatus('默认')
|
|
385
|
+
this.isHasPhase = false
|
|
386
|
+
return
|
|
387
|
+
}
|
|
388
|
+
if (val.control === 16) {
|
|
389
|
+
// 方向锁定时,相位状态显示与通道无关,显示接口返回的红灯会有歧义,此处特殊处理显示默认白色
|
|
390
|
+
this.handleSpecialControlStatus('方向锁定')
|
|
391
|
+
this.isHasPhase = false
|
|
392
|
+
return
|
|
393
|
+
}
|
|
394
|
+
this.curPhase = val.current_phase
|
|
395
|
+
this.isHasPhase = true
|
|
396
|
+
this.createPhaseStatusMap()
|
|
397
|
+
// 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
|
|
398
|
+
this.getPhaseStatus()
|
|
399
|
+
this.getOverlapPhaseStatus()
|
|
400
|
+
this.getCurPhaseCountdown()
|
|
401
|
+
this.getBusPhaseStatus()
|
|
402
|
+
if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
|
|
403
|
+
// 城市道路和路段行人过街才显示人行道状态
|
|
404
|
+
this.getpedStatus()
|
|
405
|
+
this.getOverlapPedStatus()
|
|
406
|
+
// 算法对比行人相位与行人跟随相位的状态
|
|
407
|
+
this.comparePedStatus()
|
|
408
|
+
// 算法对比车道相位与车道跟随相位的状态
|
|
409
|
+
this.comparePhaseStatus()
|
|
410
|
+
}
|
|
411
|
+
// console.log('this.phaseStatusMap 相位状态映射', this.phaseStatusMap)
|
|
412
|
+
// console.log('LanePhaseData 车道相位', this.LanePhaseData)
|
|
413
|
+
// console.log('sidewalkPhaseData 行人相位', this.sidewalkPhaseData)
|
|
414
|
+
// console.log('overlapPhaseStatusMap 跟随相位状态映射', this.overlapPhaseStatusMap)
|
|
415
|
+
// console.log('overlapLanePhaseData 车道跟随相位', this.overlapLanePhaseData)
|
|
416
|
+
// console.log('this.overlapsidewalkPhaseData 行人跟随相位', this.overlapsidewalkPhaseData)
|
|
417
|
+
},
|
|
417
418
|
init () {
|
|
418
419
|
this.CrossDiagramMgr = new CrossDiagramMgr()
|
|
419
420
|
this.getRoadDirection()
|
|
@@ -729,40 +730,43 @@ export default {
|
|
|
729
730
|
this.getChannelInfo()
|
|
730
731
|
return
|
|
731
732
|
}
|
|
732
|
-
if (this.channelType) {
|
|
733
|
+
if (this.channelType && !this.isThirdSignal) {
|
|
733
734
|
this.getChannelInfo()
|
|
734
735
|
return
|
|
735
736
|
}
|
|
736
|
-
this.
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
if (!this.isVipRoute && this.mainType === '103') {
|
|
749
|
-
// 获取匝道道路的主路和支路的相位坐标
|
|
750
|
-
this.getRampPhasePos()
|
|
751
|
-
}
|
|
737
|
+
this.getTempCrossInfo(res)
|
|
738
|
+
})
|
|
739
|
+
},
|
|
740
|
+
getTempCrossInfo (res) {
|
|
741
|
+
this.crossInfo = res.data.data.param
|
|
742
|
+
this.crossInfo.phaseList.forEach(cross => this.phaseDirMap.set(cross.id, {direction: cross.direction, peddirection: cross.peddirection}))
|
|
743
|
+
if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
|
|
744
|
+
// 城市道路加载车道相位坐标和人行道坐标
|
|
745
|
+
this.getPhasePos()
|
|
746
|
+
this.getOverlapPhasePos()
|
|
747
|
+
this.getPedPhasePos()
|
|
748
|
+
this.getOverlapPedPhasePos()
|
|
752
749
|
if (!this.isVipRoute) {
|
|
753
|
-
this.
|
|
750
|
+
this.getBusPos()
|
|
754
751
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
752
|
+
}
|
|
753
|
+
if (!this.isVipRoute && this.mainType === '103') {
|
|
754
|
+
// 获取匝道道路的主路和支路的相位坐标
|
|
755
|
+
this.getRampPhasePos()
|
|
756
|
+
}
|
|
757
|
+
if (!this.isVipRoute) {
|
|
758
|
+
this.drawDefaultPhaseIcon()
|
|
759
|
+
}
|
|
760
|
+
if (this.isVipRoute && this.isThirdSignal) {
|
|
761
|
+
this.LanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')
|
|
762
|
+
// console.log(this.LanePhaseData)
|
|
763
|
+
this.sidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')
|
|
764
|
+
let allDir = this.LanePhaseData.map(ele => ele.id)
|
|
765
|
+
let allPedDir = this.sidewalkPhaseData.map(ele => ele.id)
|
|
766
|
+
this.inneChoosedDirection = this.choosedDirection.filter(dir => allDir.indexOf(dir) !== -1)
|
|
767
|
+
this.inneChoosedPedDirection = this.choosedPedDirection.filter(dir => allPedDir.indexOf(dir) !== -1)
|
|
768
|
+
this.drawPhaseIcon()
|
|
769
|
+
}
|
|
766
770
|
},
|
|
767
771
|
getBusPos () {
|
|
768
772
|
// 公交相位信息
|
|
@@ -0,0 +1,290 @@
|
|
|
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 id="intersection-phases" class="intersection-phases" :style="PhaseStyle">
|
|
14
|
+
<div>
|
|
15
|
+
<div style="width: 100%; height: auto;">
|
|
16
|
+
<div class="control-model" v-for="(item, index) in PhaseList" :key="index">
|
|
17
|
+
<div style="position:relative;" :style="{...singleStyle, 'backgroundColor': item[0].bgcolor}" class="single-model" @click="selectLegend(index + 1)" :class="currentStage == index + 1 ? 'single-model-select' : ''">
|
|
18
|
+
<xdr-dir-selector :Width="dirWidth" :Height="dirHeight" :Widths="dirWidths" :Heights="dirHeights" :Data="showStyle" :Datas="showStyles" :showlist="dirListSetTheme(item)"></xdr-dir-selector>
|
|
19
|
+
<div style="display:flex;flex-direction:row;justify-content:center;align-items:end;" :style="{height: StageHeight}">
|
|
20
|
+
<div class="current-stage-num" style="width:25%;" :style="{color: themeColor, fontSize: numSize}">{{item[0].phaseid}}</div>
|
|
21
|
+
<div style="width:70%;">
|
|
22
|
+
<i class="iconfont icon-feijidongche" :style="{color: themeColor, fontSize: iconSize}" style="font-size:11PX;color:#606266;margin-left:10PX" v-if="item[item.length-1].controltype === 6"></i>
|
|
23
|
+
<i class="iconfont icon-lukouzhilu" :style="{color: themeColor2, fontSize: iconSize2}" style="font-size:16PX;color:#454545;margin-left:10PX" v-if="item[item.length-1].controltype === 1"></i>
|
|
24
|
+
<i class="iconfont icon-BRT" :style="{color: themeColor2, fontSize: iconSize}" style="font-size:11PX;color:#454545;margin-left:10PX" v-if="item[item.length-1].controltype === 4"></i>
|
|
25
|
+
<div style="transform:scale(0.65);margin-left:10PX">
|
|
26
|
+
<i class="iconfont icon-xuxiangwei-xin" :style="{color: themeColor2}" style="font-size:5PX;color:#454545;" v-if="item[item.length-1].controltype === 99"></i>
|
|
27
|
+
</div>
|
|
28
|
+
<i class="iconfont icon-gongjiaoche" :style="{color: themeColor, fontSize: iconSize}" style="font-size:11PX;color:#606266;margin-left:10PX" v-if="item[item.length-1].controltype === 3"></i>
|
|
29
|
+
<i class="iconfont icon-youguidianche" :style="{color: themeColor, fontSize: iconSize}" style="font-size:11PX;color:#606266;margin-left:10PX" v-if="item[item.length-1].controltype === 5"></i>
|
|
30
|
+
<div v-if="presetStageIndex === index + 1" style="color:red;width:50px;position:absolute;right:0px;bottom:5px;font-size:11px;">{{presetText}}</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
/* eslint-disable */
|
|
42
|
+
import RingDataModel from '../../../utils/RingDataModel.js'
|
|
43
|
+
import { getTheme } from '../../../utils/auth.js'
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
name: 'PhaseLegend',
|
|
47
|
+
props: {
|
|
48
|
+
isShowCurrentStage: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
},
|
|
52
|
+
crossStatusData: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => {}
|
|
55
|
+
},
|
|
56
|
+
phaseList: {
|
|
57
|
+
type: Array,
|
|
58
|
+
default: () => []
|
|
59
|
+
},
|
|
60
|
+
presetText: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '预置'
|
|
63
|
+
},
|
|
64
|
+
presetIndex: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: -1
|
|
67
|
+
},
|
|
68
|
+
preselectStages:{
|
|
69
|
+
type: Number,
|
|
70
|
+
default: -1
|
|
71
|
+
},
|
|
72
|
+
preselectModel:{
|
|
73
|
+
type: Number,
|
|
74
|
+
default: -1
|
|
75
|
+
},
|
|
76
|
+
presetPhaseId: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: -1
|
|
79
|
+
},
|
|
80
|
+
zoom: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: 1
|
|
83
|
+
},
|
|
84
|
+
StageWidth: { // 图的大小样式
|
|
85
|
+
type: String,
|
|
86
|
+
default: '70px'
|
|
87
|
+
},
|
|
88
|
+
StageHeight: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: '80px'
|
|
91
|
+
},
|
|
92
|
+
dirWidth: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: '75PX'
|
|
95
|
+
},
|
|
96
|
+
dirHeight: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: '75PX'
|
|
99
|
+
},
|
|
100
|
+
dirWidths: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: '65PX'
|
|
103
|
+
},
|
|
104
|
+
dirHeights: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: '65PX'
|
|
107
|
+
},
|
|
108
|
+
showStyle: { // 图内部方向的位置
|
|
109
|
+
type: Object,
|
|
110
|
+
default: () => ({
|
|
111
|
+
top:'7PX',
|
|
112
|
+
left:'13px'
|
|
113
|
+
})
|
|
114
|
+
},
|
|
115
|
+
showStyles: { // 图内部人行道的位置
|
|
116
|
+
type: Object,
|
|
117
|
+
default: () => ({
|
|
118
|
+
top:'5PX',
|
|
119
|
+
left:'12px'
|
|
120
|
+
})
|
|
121
|
+
},
|
|
122
|
+
noClick: { // 图是否可以点击
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
showDataType: { // 图展示的数据类型:默认按阶段展示,如果传phase则按相位维度展示
|
|
127
|
+
type: String
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
data () {
|
|
131
|
+
return {
|
|
132
|
+
presetStageIndex: -1,
|
|
133
|
+
side: {key: 'pedphase1653818707546719', phaseid: 1, id: 1, name: '东人行横道'},
|
|
134
|
+
// PhaseList: [],
|
|
135
|
+
currentStage: -1,
|
|
136
|
+
themeColor: getTheme() === 'light' ? '#606266' : '#fff',
|
|
137
|
+
themeColor2: getTheme() === 'light' ? '#454545' : '#fff'
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
computed: {
|
|
141
|
+
singleStyle () {
|
|
142
|
+
return {
|
|
143
|
+
width: this.StageWidth,
|
|
144
|
+
height: this.StageHeight
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
PhaseList () {
|
|
148
|
+
let list = []
|
|
149
|
+
if (this.crossStatusData && this.crossStatusData.stages && this.phaseList && this.phaseList.length > 0) {
|
|
150
|
+
let ringDataModel = new RingDataModel(this.crossStatusData, this.phaseList)
|
|
151
|
+
if (this.showDataType === 'phase') {
|
|
152
|
+
list = ringDataModel.getStageData('phase')
|
|
153
|
+
} else {
|
|
154
|
+
list = ringDataModel.getStageData()
|
|
155
|
+
}
|
|
156
|
+
if (this.isShowCurrentStage) {
|
|
157
|
+
this.currentStage = this.crossStatusData.current_stage
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
console.log(list,'list')
|
|
161
|
+
this.clickType(list, this.currentStage)
|
|
162
|
+
console.log(this.phaseList,'this.phaseList')
|
|
163
|
+
return list
|
|
164
|
+
},
|
|
165
|
+
PhaseStyle () {
|
|
166
|
+
return {
|
|
167
|
+
zoom: this.zoom
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
iconSize () {
|
|
171
|
+
const fontsize = parseInt(this.dirWidth.replace(/px$/, ""));
|
|
172
|
+
return fontsize / 75 * 11 + 'px'
|
|
173
|
+
},
|
|
174
|
+
iconSize2 () {
|
|
175
|
+
const fontsize = parseInt(this.dirWidth.replace(/px$/, ""));
|
|
176
|
+
return fontsize / 75 * 16 + 'px'
|
|
177
|
+
},
|
|
178
|
+
numSize () {
|
|
179
|
+
const fontsize = parseInt(this.dirWidth.replace(/px$/, ""));
|
|
180
|
+
const newfontsize = fontsize / 75 * 12
|
|
181
|
+
if (newfontsize < 10) {
|
|
182
|
+
return 10 + 'px'
|
|
183
|
+
} else {
|
|
184
|
+
return newfontsize + 'px'
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
watch: {
|
|
189
|
+
preselectStages: {
|
|
190
|
+
handler: function (val, oldVal) {
|
|
191
|
+
if(this.preselectStages === -1 && this.preselectModel !== -1) {
|
|
192
|
+
this.currentStage = -1
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
// 深度观察监听
|
|
196
|
+
deep: true
|
|
197
|
+
},
|
|
198
|
+
preselectModel: {
|
|
199
|
+
handler: function (val, oldVal) {
|
|
200
|
+
if(this.preselectStages === -1 && this.preselectModel !== -1) {
|
|
201
|
+
this.currentStage = -1
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
// 深度观察监听
|
|
205
|
+
deep: true
|
|
206
|
+
},
|
|
207
|
+
PhaseList: {
|
|
208
|
+
handler: function (val, oldVal) {
|
|
209
|
+
if (this.presetPhaseId > -1) {
|
|
210
|
+
this.presetStageIndex = this.getComputedPresetIndex()
|
|
211
|
+
} else {
|
|
212
|
+
this.presetStageIndex = this.presetIndex
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
// 深度观察监听
|
|
216
|
+
deep: true
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
methods: {
|
|
220
|
+
getComputedPresetIndex() {
|
|
221
|
+
let res = -1
|
|
222
|
+
for (let i = 0; i < this.PhaseList.length; i++) {
|
|
223
|
+
let stage = this.PhaseList[i]
|
|
224
|
+
for (let phase of stage) {
|
|
225
|
+
let phaseId = phase.id
|
|
226
|
+
if (phaseId === this.presetPhaseId) {
|
|
227
|
+
res = i
|
|
228
|
+
break
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (res > -1) {
|
|
232
|
+
res = res + 1
|
|
233
|
+
break
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return res
|
|
237
|
+
},
|
|
238
|
+
selectLegend (value) {
|
|
239
|
+
if (this.noClick) return
|
|
240
|
+
if (this.isShowCurrentStage) {
|
|
241
|
+
return false
|
|
242
|
+
}
|
|
243
|
+
this.currentStage = value
|
|
244
|
+
this.$emit('onSelectStages', value)
|
|
245
|
+
this.clickType(this.PhaseList, value)
|
|
246
|
+
},
|
|
247
|
+
resetToDefaultThemeColor (List) {
|
|
248
|
+
for (let i = 0; i < List.length; i++) {
|
|
249
|
+
if (List[i].length) {
|
|
250
|
+
if (List[i][0].clicked) {
|
|
251
|
+
delete List[i][0].clicked
|
|
252
|
+
}
|
|
253
|
+
List[i][0].bgcolor = getTheme() === 'light' ? '#edf6ff' : '#243d59'
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
highlightThemeColor (List, index) {
|
|
258
|
+
for (let i = 0; i < List.length; i++) {
|
|
259
|
+
if (i === index) {
|
|
260
|
+
List[i][0].clicked = true
|
|
261
|
+
List[i][0].bgcolor = getTheme() === 'light' ? '#c1e0ff' : '#0082ac'
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
clickType (stagelist, value) {
|
|
266
|
+
this.resetToDefaultThemeColor(stagelist)
|
|
267
|
+
this.highlightThemeColor(stagelist, value - 1)
|
|
268
|
+
},
|
|
269
|
+
dirListSetTheme (list) {
|
|
270
|
+
let dirArr = []
|
|
271
|
+
let color = getTheme() === 'light' ? '#606266' : '#F1F3F4'
|
|
272
|
+
let pedColor = getTheme() === 'light' ? '#606266' : 'rgba(255, 255, 255, 0.6)'
|
|
273
|
+
for (let rec of list) {
|
|
274
|
+
let recd = {
|
|
275
|
+
...rec,
|
|
276
|
+
color: color
|
|
277
|
+
}
|
|
278
|
+
dirArr.push(recd)
|
|
279
|
+
for(let i=0;i<rec.peddirection.length;i++) {
|
|
280
|
+
rec.peddirection[i].color = pedColor
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return dirArr
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
mounted () {
|
|
287
|
+
this.resetToDefaultThemeColor(this.PhaseList)
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
</script>
|
|
@@ -31,6 +31,7 @@ import patternConfig from './components/patternConfig/index.vue'
|
|
|
31
31
|
import XiaoKanBan from './components/XiaoKanBan/index.vue'
|
|
32
32
|
import DirectionListConfiguration from './components/DirectionListConfiguration/index.js'
|
|
33
33
|
import IntersectionDirectionSelection from './components/IntersectionDirectionSelection/index.js'
|
|
34
|
+
import PhaseLegend from './components/PhaseLegend/index.js'
|
|
34
35
|
import { setToken, setHost, setIsCheckPermission, setUserRoles, setPermissions } from '../utils/auth.js'
|
|
35
36
|
import componentsGlobalParam from '../store/modules/globalParam'
|
|
36
37
|
|
|
@@ -71,7 +72,8 @@ const components = {
|
|
|
71
72
|
XiaoKanBan,
|
|
72
73
|
PhaseDirectionSelect,
|
|
73
74
|
DirectionListConfiguration,
|
|
74
|
-
IntersectionDirectionSelection
|
|
75
|
+
IntersectionDirectionSelection,
|
|
76
|
+
PhaseLegend
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
const language = {
|