openatc-components 0.5.81 → 0.5.82
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/_diff_a.txt +360 -0
- package/_diff_b.txt +362 -0
- package/package/kisscomps/components/Channelization/Channelization.vue +9 -4
- package/package/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +363 -360
- package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +7 -3
- package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +6 -2
- package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +11 -0
- package/package/kisscomps/components/IntersectionMapDirSelect/customCrossDiagram.vue +3 -2
- package/package/kisscomps/components/IntersectionMapDirSelect/customintersectionmap.vue +7 -0
- package/package/kissui.min.js +1 -1
- package/package.json +2 -2
- package/src/kisscomps/components/Channelization/Channelization.vue +9 -4
- package/src/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +363 -360
- package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +7 -3
- package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +6 -2
- package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +11 -0
- package/src/kisscomps/components/IntersectionMapDirSelect/customCrossDiagram.vue +3 -2
- package/src/kisscomps/components/IntersectionMapDirSelect/customintersectionmap.vue +7 -0
- package/static/styles/intersection.scss +4 -0
package/_diff_b.txt
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
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
|
+
<!--流量统计渠化路口图-->
|
|
13
|
+
<template>
|
|
14
|
+
<div class="show-channelization channelization-base-map" :class="{
|
|
15
|
+
'widescreenCrossImg': bodyDomWidth > 1680,
|
|
16
|
+
'superlargeCrossImg': bodyDomWidth <= 1680 && bodyDomWidth > 1440,
|
|
17
|
+
'largeCrossImg': bodyDomWidth <= 1440 && bodyDomWidth > 1280,
|
|
18
|
+
'middleCrossImg2': bodyDomWidth <= 1280 && bodyDomWidth > 960,
|
|
19
|
+
'smallCrossImg': bodyDomWidth <= 960 && bodyDomWidth > 890,
|
|
20
|
+
'smallCrossImg2': bodyDomWidth <= 890 && bodyDomWidth > 720,
|
|
21
|
+
'miniCrossImg': bodyDomWidth <= 720 && bodyDomWidth > 650,
|
|
22
|
+
'superminiCrossImg': bodyDomWidth <= 650 && bodyDomWidth > 450,
|
|
23
|
+
'transMiddleCrossImg': bodyDomWidth <= 450 && bodyDomWidth > 350,
|
|
24
|
+
'transMiddleCrossImg2': bodyDomWidth <= 350 && bodyDomWidth > 300,
|
|
25
|
+
'transMiddleCrossImg3': bodyDomWidth <= 300 && bodyDomWidth > 260,
|
|
26
|
+
'transMiniCrossImg': bodyDomWidth <= 260,
|
|
27
|
+
'changePaddingBottom': true }">
|
|
28
|
+
<ChannelizationElements
|
|
29
|
+
ref="channelizationElements"
|
|
30
|
+
UsageMode="show"
|
|
31
|
+
:allitem="allitem"
|
|
32
|
+
:CrossMapVisible="CrossMapVisible"
|
|
33
|
+
:CrossMapData="CrossMapData"
|
|
34
|
+
:isSeletable="isSeletable"
|
|
35
|
+
:Motorways="LanePhaseStatisticsData"
|
|
36
|
+
:Pedwalk="sidewalkPhaseData"
|
|
37
|
+
:Countdown="Countdown"
|
|
38
|
+
:customText="customText"
|
|
39
|
+
:textFontSize="textFontSize"
|
|
40
|
+
:Detector="DetectorData"
|
|
41
|
+
:bcgColor="bcgColor"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import ChannelizationElements from '../DrawChannelization/drawsvg/channelizationElements'
|
|
48
|
+
import { getChannelizatonChart } from '../../../api/cross'
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
name: 'channelization-flow-statistic',
|
|
52
|
+
components: {
|
|
53
|
+
ChannelizationElements
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
phasesStatisticsList: {
|
|
59
|
+
type: Array,
|
|
60
|
+
default: () => []
|
|
61
|
+
},
|
|
62
|
+
AgentId: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: '0'
|
|
65
|
+
},
|
|
66
|
+
resizeMap: { // 重新获取容器大小,调整底图大小
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
customText: {
|
|
71
|
+
type: String
|
|
72
|
+
},
|
|
73
|
+
bcgColor: {
|
|
74
|
+
type: String
|
|
75
|
+
},
|
|
76
|
+
textFontSize: {
|
|
77
|
+
type: String
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
watch: {
|
|
81
|
+
phasesStatisticsList: {
|
|
82
|
+
handler: function (val) {
|
|
83
|
+
// 相位统计数据数据
|
|
84
|
+
this.phasesStatisticsData = JSON.parse(JSON.stringify(val))
|
|
85
|
+
this.createPhaseStatisticsMap()
|
|
86
|
+
this.getLanePhaseStatusData()
|
|
87
|
+
},
|
|
88
|
+
// 深度观察监听
|
|
89
|
+
deep: true
|
|
90
|
+
},
|
|
91
|
+
AgentId: {
|
|
92
|
+
handler: function (val) {
|
|
93
|
+
// 平台设备切换时,重载当前路口保存的渠化配置
|
|
94
|
+
this.load('all')
|
|
95
|
+
},
|
|
96
|
+
deep: true
|
|
97
|
+
},
|
|
98
|
+
resizeMap: {
|
|
99
|
+
handler: function (newval, oldval) {
|
|
100
|
+
if (newval === true && oldval === false) {
|
|
101
|
+
this.getParentSize()
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
data () {
|
|
107
|
+
return {
|
|
108
|
+
isSeletable: false,
|
|
109
|
+
bodyDomWidth: 352,
|
|
110
|
+
bodyDomSize: {
|
|
111
|
+
width: 1920,
|
|
112
|
+
height: 1080
|
|
113
|
+
},
|
|
114
|
+
CrossMapVisible: true, // 控制底图显示隐藏
|
|
115
|
+
CrossMapData: {
|
|
116
|
+
x: 400,
|
|
117
|
+
y: 100,
|
|
118
|
+
w: 800,
|
|
119
|
+
h: 200,
|
|
120
|
+
angle: 0,
|
|
121
|
+
svgstr: '',
|
|
122
|
+
imgfilesrc: ''
|
|
123
|
+
}, // 管理底图数据
|
|
124
|
+
Motorways: [],
|
|
125
|
+
Texts: [],
|
|
126
|
+
Pedwalk: [],
|
|
127
|
+
Countdown: [],
|
|
128
|
+
Detector: [],
|
|
129
|
+
allitem: {
|
|
130
|
+
x: 435,
|
|
131
|
+
y: 325,
|
|
132
|
+
w: 870,
|
|
133
|
+
h: 650,
|
|
134
|
+
angle: 0
|
|
135
|
+
},
|
|
136
|
+
LanePhaseStatisticsData: [], // 车道相位数据
|
|
137
|
+
phasesStatisticsMap: new Map(), // 相位统计数据映射
|
|
138
|
+
colorMap: new Map([['A', '#009900'], ['B', '#00FF00'], ['C', '#FFFF00'], ['D', '#FF9900'], ['E', '#FF0000'], ['F', '#990000']]),
|
|
139
|
+
sidewalkPhaseData: [], // 行人相位
|
|
140
|
+
DetectorData: [] // 检测器数据(包括车辆和行人)
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
methods: {
|
|
144
|
+
createPhaseStatisticsMap () {
|
|
145
|
+
// 生成相位id和相位状态对应数据结构
|
|
146
|
+
this.phasesStatisticsData.map(phase => {
|
|
147
|
+
let phaseId = phase.phaseno
|
|
148
|
+
let phaseInfo = {
|
|
149
|
+
time: phase.time,
|
|
150
|
+
...phase.phasestatistics
|
|
151
|
+
}
|
|
152
|
+
this.phasesStatisticsMap.set(phaseId, phaseInfo)
|
|
153
|
+
})
|
|
154
|
+
},
|
|
155
|
+
getLanePhaseStatusData () {
|
|
156
|
+
let curLanePhaseData = []
|
|
157
|
+
for (let i = 0; i < this.LanePhaseStatisticsData.length; i++) {
|
|
158
|
+
let curPhaseStatus
|
|
159
|
+
if (this.LanePhaseStatisticsData[i].phasetype === 'phase') {
|
|
160
|
+
console.log(this.phasesStatisticsMap)
|
|
161
|
+
curPhaseStatus = this.phasesStatisticsMap.get(this.LanePhaseStatisticsData[i].phaseid)
|
|
162
|
+
}
|
|
163
|
+
// if (!curPhaseStatus) continue // 没有关联相位的车道不显示
|
|
164
|
+
let data
|
|
165
|
+
if (curPhaseStatus) {
|
|
166
|
+
data = {
|
|
167
|
+
...this.LanePhaseStatisticsData[i],
|
|
168
|
+
congestionindex: curPhaseStatus.congestionindex,
|
|
169
|
+
color: this.colorMap.get(curPhaseStatus.congestionindex)
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
// 没有关联的,或者没有对应状态的,车道显示默认白色
|
|
173
|
+
data = {
|
|
174
|
+
...this.LanePhaseStatisticsData[i],
|
|
175
|
+
congestionindex: undefined,
|
|
176
|
+
color: '#fff'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
curLanePhaseData.push(data)
|
|
180
|
+
}
|
|
181
|
+
this.LanePhaseStatisticsData = JSON.parse(JSON.stringify(curLanePhaseData))
|
|
182
|
+
},
|
|
183
|
+
// 加载
|
|
184
|
+
load (type) {
|
|
185
|
+
this.getChannelizatonChart().then((channelizatondata) => {
|
|
186
|
+
console.log(channelizatondata)
|
|
187
|
+
let savedTemp = JSON.parse(JSON.stringify(channelizatondata))
|
|
188
|
+
for (const [key, value] of Object.entries(savedTemp)) {
|
|
189
|
+
if (key === 'vehile') {
|
|
190
|
+
this.Motorways = value
|
|
191
|
+
}
|
|
192
|
+
if (key === 'text') {
|
|
193
|
+
this.Texts = value
|
|
194
|
+
}
|
|
195
|
+
if (key === 'ped') {
|
|
196
|
+
this.Pedwalk = value
|
|
197
|
+
}
|
|
198
|
+
if (key === 'countdown') {
|
|
199
|
+
this.Countdown = value
|
|
200
|
+
}
|
|
201
|
+
if (key === 'detector') {
|
|
202
|
+
this.Detector = value.filter(ele => ele.detailtype === 'detector')
|
|
203
|
+
}
|
|
204
|
+
if (key === 'crossMap') {
|
|
205
|
+
this.CrossMapData = JSON.parse(JSON.stringify(value))
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
this.isSeletable = false
|
|
209
|
+
// 从接口得到所有渠化车道和人行道数据
|
|
210
|
+
this.LanePhaseStatisticsData = JSON.parse(JSON.stringify(this.Motorways))
|
|
211
|
+
this.sidewalkPhaseData = JSON.parse(JSON.stringify(this.Pedwalk))
|
|
212
|
+
this.DetectorData = JSON.parse(JSON.stringify(this.Detector))
|
|
213
|
+
this.getLanePhaseStatusData()
|
|
214
|
+
})
|
|
215
|
+
},
|
|
216
|
+
// 重置
|
|
217
|
+
handleReset () {
|
|
218
|
+
this.Texts = []
|
|
219
|
+
this.Motorways = []
|
|
220
|
+
this.Countdown = []
|
|
221
|
+
this.phaseCountdownList = []
|
|
222
|
+
this.Pedwalk = []
|
|
223
|
+
this.Detector = []
|
|
224
|
+
this.CrossMapData = {
|
|
225
|
+
x: 400,
|
|
226
|
+
y: 100,
|
|
227
|
+
w: 800,
|
|
228
|
+
h: 200,
|
|
229
|
+
angle: 0,
|
|
230
|
+
svgstr: '',
|
|
231
|
+
imgfilesrc: ''
|
|
232
|
+
}
|
|
233
|
+
this.LanePhaseStatisticsData = []
|
|
234
|
+
this.sidewalkPhaseData = []
|
|
235
|
+
this.DetectorData = []
|
|
236
|
+
},
|
|
237
|
+
getChannelizatonChart () {
|
|
238
|
+
// let agentid = getIframdevid()
|
|
239
|
+
// 路口已设置渠化,则总览默认显示渠化路口,未设置显示模版路口
|
|
240
|
+
// if (this.isfromatc === true) {
|
|
241
|
+
// this.$store.dispatch('SetShowHomePage', 'Graphical')
|
|
242
|
+
// }
|
|
243
|
+
this.handleReset()
|
|
244
|
+
return new Promise((resolve, reject) => {
|
|
245
|
+
getChannelizatonChart(this.AgentId).then(data => {
|
|
246
|
+
if (!data.data.success) {
|
|
247
|
+
// let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
|
|
248
|
+
// if (data.data.data) {
|
|
249
|
+
// // 子类型错误
|
|
250
|
+
// let childErrorCode = data.data.data.errorCode
|
|
251
|
+
// if (childErrorCode) {
|
|
252
|
+
// let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
|
|
253
|
+
// this.$message.error(parrenterror + ',' + childerror)
|
|
254
|
+
// }
|
|
255
|
+
// } else {
|
|
256
|
+
// this.$message.error(parrenterror)
|
|
257
|
+
// }
|
|
258
|
+
return
|
|
259
|
+
}
|
|
260
|
+
if (data.data.data === undefined || JSON.stringify(data.data.data) === '{}') return
|
|
261
|
+
// if (this.isfromatc === true) {
|
|
262
|
+
// this.$store.dispatch('SetShowHomePage', 'Channelization')
|
|
263
|
+
// }
|
|
264
|
+
this.handleReset()
|
|
265
|
+
let channelizatondata = data.data.data
|
|
266
|
+
resolve(channelizatondata)
|
|
267
|
+
})
|
|
268
|
+
})
|
|
269
|
+
},
|
|
270
|
+
getParentSize () {
|
|
271
|
+
// 获取最外层dom尺寸,适配准备
|
|
272
|
+
var _this = this
|
|
273
|
+
this.$nextTick(function () {
|
|
274
|
+
if (this.$el.parentElement === null || this.$el.parentElement === undefined) return
|
|
275
|
+
this.bodyDomSize.width = this.$el.parentElement.clientWidth
|
|
276
|
+
this.bodyDomWidth = this.bodyDomSize.width
|
|
277
|
+
window.addEventListener('resize', () => {
|
|
278
|
+
// 定义窗口大小变更通知事件
|
|
279
|
+
if (_this.$el.parentElement === null || _this.$el.parentElement === undefined) return
|
|
280
|
+
_this.bodyDomSize.width = _this.$el.parentElement.clientWidth
|
|
281
|
+
this.bodyDomWidth = this.bodyDomSize.width
|
|
282
|
+
console.log('resize this.bodyDomSize.width', _this.bodyDomSize.width)
|
|
283
|
+
}, false)
|
|
284
|
+
})
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
created () {
|
|
288
|
+
this.load()
|
|
289
|
+
},
|
|
290
|
+
mounted () {
|
|
291
|
+
this.getParentSize()
|
|
292
|
+
this.phasesStatisticsData = JSON.parse(JSON.stringify(this.phasesStatisticsList))
|
|
293
|
+
this.createPhaseStatisticsMap()
|
|
294
|
+
},
|
|
295
|
+
destroyed () {
|
|
296
|
+
this.handleReset()
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
</script>
|
|
300
|
+
|
|
301
|
+
<style lang="css" rel="stylesheet/scss">
|
|
302
|
+
.show-channelization {
|
|
303
|
+
position: relative;
|
|
304
|
+
overflow: hidden;
|
|
305
|
+
/* 同 Channelization.vue:图内容方向与书写方向无关,锁 LTR */
|
|
306
|
+
direction: ltr;
|
|
307
|
+
}
|
|
308
|
+
.widescreenCrossImg {
|
|
309
|
+
zoom: 1.3;
|
|
310
|
+
}
|
|
311
|
+
.superlargeCrossImg {
|
|
312
|
+
zoom: 1.1;
|
|
313
|
+
}
|
|
314
|
+
.largeCrossImg {
|
|
315
|
+
zoom: 1.1;
|
|
316
|
+
}
|
|
317
|
+
.middleCrossImg {
|
|
318
|
+
zoom: 1;
|
|
319
|
+
}
|
|
320
|
+
.middleCrossImg2 {
|
|
321
|
+
zoom: 0.8;
|
|
322
|
+
}
|
|
323
|
+
.smallCrossImg {
|
|
324
|
+
zoom: 0.8;
|
|
325
|
+
}
|
|
326
|
+
.smallCrossImg2 {
|
|
327
|
+
zoom: 0.8;
|
|
328
|
+
}
|
|
329
|
+
.miniCrossImg {
|
|
330
|
+
zoom: 0.7;
|
|
331
|
+
}
|
|
332
|
+
.superminiCrossImg {
|
|
333
|
+
zoom: 0.6;
|
|
334
|
+
}
|
|
335
|
+
.minimumCrossImg {
|
|
336
|
+
zoom: 0.35;
|
|
337
|
+
}
|
|
338
|
+
.transMiddleCrossImg {
|
|
339
|
+
-webkit-transform-origin-y: 0 /*!rtl:ignore*/;
|
|
340
|
+
transform: scale(0.55);
|
|
341
|
+
margin-top: 3%;
|
|
342
|
+
padding: 0PX;
|
|
343
|
+
}
|
|
344
|
+
.transMiddleCrossImg2 {
|
|
345
|
+
-webkit-transform-origin-y: 0 /*!rtl:ignore*/;
|
|
346
|
+
transform: scale(0.27);
|
|
347
|
+
margin-top: -1.5%;
|
|
348
|
+
padding: 0PX;
|
|
349
|
+
}
|
|
350
|
+
.transMiddleCrossImg3 {
|
|
351
|
+
-webkit-transform-origin-y: 0 /*!rtl:ignore*/;
|
|
352
|
+
transform: scale(0.22);
|
|
353
|
+
margin-top: -1%;
|
|
354
|
+
padding: 0PX;
|
|
355
|
+
}
|
|
356
|
+
.transMiniCrossImg {
|
|
357
|
+
-webkit-transform-origin-y: 0 /*!rtl:ignore*/;
|
|
358
|
+
transform: scale(0.18);
|
|
359
|
+
margin-top: -1.6%;
|
|
360
|
+
padding: 0PX;
|
|
361
|
+
}
|
|
362
|
+
</style>
|
|
@@ -530,6 +530,11 @@ export default {
|
|
|
530
530
|
.show-channelization {
|
|
531
531
|
position: relative;
|
|
532
532
|
overflow: hidden;
|
|
533
|
+
/* 渠化图图层(.show-channelization-elements-components)的包含块:图内容方向与
|
|
534
|
+
书写方向无关,锁 LTR 避免窄容器下 870px 图层按“贴右”排布而偏出。
|
|
535
|
+
rtl:ignore 不可省:rtlcss 会把 direction:ltr 翻成 [dir=rtl]…{direction:rtl}
|
|
536
|
+
的镜像副本(特异性更高、后出现),不加指令就会把这条锁抵消(已实测)。 */
|
|
537
|
+
direction: ltr /*!rtl:ignore*/;
|
|
533
538
|
}
|
|
534
539
|
.widescreenCrossImg {
|
|
535
540
|
zoom: 1.3;
|
|
@@ -562,25 +567,25 @@ export default {
|
|
|
562
567
|
zoom: 0.35;
|
|
563
568
|
}
|
|
564
569
|
.transMiddleCrossImg {
|
|
565
|
-
-webkit-transform-origin-y: 0
|
|
570
|
+
-webkit-transform-origin-y: 0 /*!rtl:ignore*/;
|
|
566
571
|
transform: scale(0.55);
|
|
567
572
|
margin-top: 3%;
|
|
568
573
|
padding: 0PX;
|
|
569
574
|
}
|
|
570
575
|
.transMiddleCrossImg2 {
|
|
571
|
-
-webkit-transform-origin-y: 0
|
|
576
|
+
-webkit-transform-origin-y: 0 /*!rtl:ignore*/;
|
|
572
577
|
transform: scale(0.27);
|
|
573
578
|
margin-top: -1.5%;
|
|
574
579
|
padding: 0PX;
|
|
575
580
|
}
|
|
576
581
|
.transMiddleCrossImg3 {
|
|
577
|
-
-webkit-transform-origin-y: 0
|
|
582
|
+
-webkit-transform-origin-y: 0 /*!rtl:ignore*/;
|
|
578
583
|
transform: scale(0.22);
|
|
579
584
|
margin-top: -1%;
|
|
580
585
|
padding: 0PX;
|
|
581
586
|
}
|
|
582
587
|
.transMiniCrossImg {
|
|
583
|
-
-webkit-transform-origin-y: 0
|
|
588
|
+
-webkit-transform-origin-y: 0 /*!rtl:ignore*/;
|
|
584
589
|
transform: scale(0.18);
|
|
585
590
|
margin-top: -1.6%;
|
|
586
591
|
padding: 0PX;
|