openatc-components 0.3.20 → 0.3.21
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/kisscomps/components/PhaseLegend/PhaseLegend.vue +1 -5
- package/package/kissui.min.js +1 -1
- package/package.json +1 -1
- package/src/kisscomps/components/PhaseLegend/PhaseLegend.vue +1 -5
- package/src/utils/RingDataModel.js +75 -13
- package/src/utils/conflct.js +14 -5
- package/src/views/intersection.vue +8 -8
package/package.json
CHANGED
|
@@ -148,11 +148,7 @@ export default {
|
|
|
148
148
|
let list = []
|
|
149
149
|
if (this.crossStatusData && this.crossStatusData.stages && this.phaseList && this.phaseList.length > 0) {
|
|
150
150
|
let ringDataModel = new RingDataModel(this.crossStatusData, this.phaseList)
|
|
151
|
-
|
|
152
|
-
list = ringDataModel.getStageData('phase')
|
|
153
|
-
} else {
|
|
154
|
-
list = ringDataModel.getStageData()
|
|
155
|
-
}
|
|
151
|
+
list = ringDataModel.getPhaseLegendData()
|
|
156
152
|
if (this.isShowCurrentStage) {
|
|
157
153
|
this.currentStage = this.crossStatusData.current_stage
|
|
158
154
|
}
|
|
@@ -187,13 +187,8 @@ export default class RingDataModel {
|
|
|
187
187
|
let busPhaseData = this.getBusPos()
|
|
188
188
|
let sidewalkPhaseData = this.getPedPhasePos()
|
|
189
189
|
let stages
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
stages = data.phase.map(ele => [ele.id])
|
|
193
|
-
} else {
|
|
194
|
-
// 默认按阶段数据处理
|
|
195
|
-
stages = data.stages
|
|
196
|
-
}
|
|
190
|
+
// 按阶段数据处理
|
|
191
|
+
stages = data.stages
|
|
197
192
|
for (let stage of stages) {
|
|
198
193
|
let tempList = []
|
|
199
194
|
let directionList = []
|
|
@@ -208,9 +203,6 @@ export default class RingDataModel {
|
|
|
208
203
|
if (!currPhase) return
|
|
209
204
|
if (currPhase !== undefined && phaseMode[0].mode !== 1) {
|
|
210
205
|
directionList = [...currPhase.direction, ...directionList]
|
|
211
|
-
if (datatype === 'phase') {
|
|
212
|
-
currPhaseid = stg
|
|
213
|
-
}
|
|
214
206
|
}
|
|
215
207
|
if (currPhase.peddirection) {
|
|
216
208
|
for (let walk of sidewalkPhaseData) {
|
|
@@ -245,9 +237,6 @@ export default class RingDataModel {
|
|
|
245
237
|
peddirection: peddirections,
|
|
246
238
|
sidewalkPhaseData: sidewalkPhaseData
|
|
247
239
|
}
|
|
248
|
-
if (datatype === 'phase') {
|
|
249
|
-
temp.phaseid = currPhaseid
|
|
250
|
-
}
|
|
251
240
|
return temp
|
|
252
241
|
})
|
|
253
242
|
if (directionList.length === 0) {
|
|
@@ -266,4 +255,77 @@ export default class RingDataModel {
|
|
|
266
255
|
this.stagesList = JSON.parse(JSON.stringify(stagesTemp))
|
|
267
256
|
return this.stagesList
|
|
268
257
|
}
|
|
258
|
+
getPhaseLegendData () {
|
|
259
|
+
let data = this.crossStatusData
|
|
260
|
+
let stagesTemp = []
|
|
261
|
+
let busPhaseData = this.getBusPos()
|
|
262
|
+
let sidewalkPhaseData = this.getPedPhasePos()
|
|
263
|
+
let phaseIdList
|
|
264
|
+
phaseIdList = data.phase.map(ele => [ele.id])
|
|
265
|
+
for (let phase of phaseIdList) {
|
|
266
|
+
let tempList = []
|
|
267
|
+
let directionList = []
|
|
268
|
+
let currPhaseid = ''
|
|
269
|
+
let stageControType = 0
|
|
270
|
+
let peddirections = []
|
|
271
|
+
for (let id of phase) {
|
|
272
|
+
let phaseMode = data.phase.filter(item => item.id === id)
|
|
273
|
+
let currPhase = this.phaseList.filter((item) => {
|
|
274
|
+
return item.id === id
|
|
275
|
+
})[0]
|
|
276
|
+
if (!currPhase) return
|
|
277
|
+
if (currPhase !== undefined && phaseMode[0].mode !== 1) {
|
|
278
|
+
directionList = [...currPhase.direction, ...directionList]
|
|
279
|
+
currPhaseid = id
|
|
280
|
+
}
|
|
281
|
+
if (currPhase.peddirection) {
|
|
282
|
+
for (let walk of sidewalkPhaseData) {
|
|
283
|
+
for (let ped of currPhase.peddirection) {
|
|
284
|
+
let obj = {}
|
|
285
|
+
obj.name = walk.name
|
|
286
|
+
obj.id = walk.id
|
|
287
|
+
if (ped === walk.id) {
|
|
288
|
+
peddirections.push(obj)
|
|
289
|
+
peddirections = Array.from(new Set(peddirections))
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
} else {
|
|
294
|
+
peddirections = []
|
|
295
|
+
}
|
|
296
|
+
for (let busPhase of busPhaseData) {
|
|
297
|
+
if (id === busPhase.phaseid) {
|
|
298
|
+
stageControType = busPhase.controltype
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
directionList = [...new Set(directionList)]
|
|
303
|
+
tempList = directionList.map(dir => {
|
|
304
|
+
let temp = {
|
|
305
|
+
id: dir,
|
|
306
|
+
phaseid: currPhaseid,
|
|
307
|
+
color: '#606266',
|
|
308
|
+
controltype: stageControType,
|
|
309
|
+
peddirection: peddirections,
|
|
310
|
+
sidewalkPhaseData: sidewalkPhaseData
|
|
311
|
+
}
|
|
312
|
+
return temp
|
|
313
|
+
})
|
|
314
|
+
if (directionList.length === 0) {
|
|
315
|
+
tempList = [
|
|
316
|
+
{
|
|
317
|
+
id: -1,
|
|
318
|
+
phaseid: currPhaseid,
|
|
319
|
+
color: '#606266',
|
|
320
|
+
controltype: stageControType,
|
|
321
|
+
peddirection: peddirections,
|
|
322
|
+
sidewalkPhaseData: sidewalkPhaseData
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
stagesTemp.push(tempList)
|
|
327
|
+
}
|
|
328
|
+
this.List = JSON.parse(JSON.stringify(stagesTemp))
|
|
329
|
+
return this.List
|
|
330
|
+
}
|
|
269
331
|
}
|
package/src/utils/conflct.js
CHANGED
|
@@ -61,15 +61,24 @@ export async function computedRelation (id) {
|
|
|
61
61
|
})
|
|
62
62
|
delete item.conflictchannel
|
|
63
63
|
})
|
|
64
|
-
const uniqueDirections = new Set()
|
|
65
|
-
const doChange = results.filter(obj => {
|
|
66
|
-
|
|
64
|
+
// const uniqueDirections = new Set()
|
|
65
|
+
// const doChange = results.filter(obj => {
|
|
66
|
+
// if (uniqueDirections.has(obj.direction)) {
|
|
67
|
+
// return false
|
|
68
|
+
// }
|
|
69
|
+
// uniqueDirections.add(obj.direction)
|
|
70
|
+
// return true
|
|
71
|
+
// })
|
|
72
|
+
const uniqueDirectionsAndTypes = new Set()
|
|
73
|
+
const filteredResults = results.filter(obj => {
|
|
74
|
+
const key = `${obj.direction}_${obj.type}`
|
|
75
|
+
if (uniqueDirectionsAndTypes.has(key)) {
|
|
67
76
|
return false
|
|
68
77
|
}
|
|
69
|
-
|
|
78
|
+
uniqueDirectionsAndTypes.add(key)
|
|
70
79
|
return true
|
|
71
80
|
})
|
|
72
|
-
let result =
|
|
81
|
+
let result = filteredResults.map(item => {
|
|
73
82
|
let uniqueLaneConflictList = [...new Set(item.laneConflictList)]
|
|
74
83
|
let uniquePedConflictList = [...new Set(item.pedConflictList)]
|
|
75
84
|
return {
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<h2 class="text">实时通道路口图</h2>
|
|
4
|
-
|
|
4
|
+
<channel-realtime-intersection
|
|
5
5
|
:agentId="this.agentId"
|
|
6
6
|
:roadDirection="roadDirection"
|
|
7
7
|
:channelRealtimeStatusData="channelRealtimeStatusData"
|
|
8
|
-
/>
|
|
8
|
+
/>
|
|
9
9
|
|
|
10
10
|
<!-- 按通道获取相位的方向选择列表,特殊路口显示列表,普通路口显示模版路口图 -->
|
|
11
11
|
<h2 class="text">非第三方配置路口图(按通道显示相位方向)</h2>
|
|
12
12
|
<intersection-direction-selection
|
|
13
13
|
:agentId="this.agentId"
|
|
14
|
-
:choosedDirection="[]"
|
|
15
|
-
:choosedPedDirection="[]"
|
|
14
|
+
:choosedDirection="[14,6,13,8]"
|
|
15
|
+
:choosedPedDirection="[1]"
|
|
16
16
|
:roadDirection="roadDirection"
|
|
17
17
|
@handleClickCrossIcon="handleClickCrossIcon" />
|
|
18
18
|
|
|
19
19
|
<h2 class="text">第三方配置路口图(按路口相位配置显示相位方向)</h2>
|
|
20
20
|
<div>
|
|
21
|
-
|
|
21
|
+
<intersection-direction-selection
|
|
22
22
|
:agentId="this.agentId"
|
|
23
23
|
thirdSignal
|
|
24
24
|
:choosedDirection="[5,6,7,8,13]"
|
|
25
25
|
:choosedPedDirection="[1,2]"
|
|
26
26
|
:roadDirection="roadDirection"
|
|
27
|
-
@handleClickCrossIcon="handleClickCrossIcon" />
|
|
27
|
+
@handleClickCrossIcon="handleClickCrossIcon" />
|
|
28
28
|
</div>
|
|
29
29
|
|
|
30
30
|
<!-- 显示按通道获取相位的模版路口图 -->
|
|
@@ -161,12 +161,12 @@ export default {
|
|
|
161
161
|
return {
|
|
162
162
|
roadDirection: 'right',
|
|
163
163
|
// reqUrl: 'http://192.168.13.103:10003/openatc',
|
|
164
|
-
agentId: '
|
|
164
|
+
agentId: 'tjblfql',
|
|
165
165
|
// agentId: '13013',
|
|
166
166
|
// agentId: '12007_390',
|
|
167
167
|
// agentId: '12014',
|
|
168
168
|
reqUrl: 'http://192.168.13.103:10003/openatc',
|
|
169
|
-
Token: '
|
|
169
|
+
Token: 'eyJraWQiOiIxNzIxOTc3OTkzMTY4IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcyMTk4MTU5MywiaWF0IjoxNzIxOTc0MzkzfQ.vjgAFMJlM4FEHxT9K9lJQ_VsUx1fDubr4tYgMaVffS0',
|
|
170
170
|
// agentId: '30003-352',
|
|
171
171
|
// reqUrl: 'https://kints-dev.devdolphin.com/openatc',
|
|
172
172
|
// Token: 'eyJraWQiOiIxNjUwNTA5MDI2ODk2IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJ4aWFvbWluZyIsImV4cCI6MTczNjkwOTAyNiwiaWF0IjoxNjUwNTA5MDI2fQ.-s4T-uMRmB2zf9yer87USKQXLY1a12Zq5lCOnqjNmfA',
|