openatc-components 0.5.82 → 0.5.84

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.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.5.82",
3
+ "version": "0.5.84",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -200,6 +200,7 @@ export default class RingDataModel {
200
200
  let phasetype
201
201
  for (let stg of stage) {
202
202
  let phaseMode = data.phase.filter(item => item.id === stg)
203
+ if (!phaseMode.length) continue
203
204
  phasetype = phaseMode[0].type
204
205
  let currPhase = this.phaseList.filter((item) => {
205
206
  return item.id === stg
@@ -276,10 +277,11 @@ export default class RingDataModel {
276
277
  let peddirections = []
277
278
  for (let id of phase) {
278
279
  let phaseMode = data.phase.filter(item => item.id === id)
280
+ if (!phaseMode.length) continue
279
281
  let currPhase = this.phaseList.filter((item) => {
280
282
  return item.id === id
281
283
  })[0]
282
- if (!currPhase) return
284
+ if (!currPhase) continue
283
285
  if (currPhase !== undefined && phaseMode[0].mode !== 1) {
284
286
  directionList = [...currPhase.direction, ...directionList]
285
287
  currPhaseid = id
@@ -12,6 +12,10 @@
12
12
  // 路口图内容方向由相位/渠化数据决定,与书写方向无关。本节点是 .crossImg 的
13
13
  // 包含块,在 rtl 下会让 870px 宽的过宽子块按“贴右”排布,导致整体偏出面板。
14
14
  // 锁 LTR 后配合 .crossImg 的 rtl:ignore 即可在两个书写方向下完全一致。
15
+ // 指令必须独占一行写在声明前:node-sass 会丢弃声明值内的 /*!rtl:ignore*/
16
+ // (compressed/expanded 均丢,已实测);独占一行的 /*! 响亮注释两种模式都保留,
17
+ // rtl-loader 入口把 /*!rtl: 还原为 /*rtl: 后由 rtlcss 消费,不生成 direction:rtl 镜像。
18
+ /*!rtl:ignore*/
15
19
  direction: ltr;
16
20
  }
17
21
  .changeWidth {
@@ -118,7 +122,10 @@
118
122
  .minimumCrossImg {
119
123
  zoom: 0.35;
120
124
  }
125
+ // origin-y 是垂直锚点,与书写方向无关,不应被 rtlcss 翻成 100%(底部锚定会让
126
+ // scale 后的整图被推出容器裁成空白)。指令独占一行,原因同上方 direction 注释。
121
127
  .transMiddleCrossImg {
128
+ /*!rtl:ignore*/
122
129
  -webkit-transform-origin-y: 0;
123
130
  transform: scale(0.55);
124
131
  // transform: translateX(0.45) translateY(0.45);
@@ -128,6 +135,7 @@
128
135
  // zoom: 0.25;
129
136
  }
130
137
  .transMiddleCrossImg2 {
138
+ /*!rtl:ignore*/
131
139
  -webkit-transform-origin-y: 0;
132
140
  // transform: scale(0.27);
133
141
  // margin-top: -1.5%;
@@ -137,6 +145,7 @@
137
145
  // zoom: 0.25;
138
146
  }
139
147
  .transMiddleCrossImg3 {
148
+ /*!rtl:ignore*/
140
149
  -webkit-transform-origin-y: 0;
141
150
  transform: scale(0.22);
142
151
  margin-top: -1%;
@@ -144,6 +153,7 @@
144
153
  // zoom: 0.25;
145
154
  }
146
155
  .transMiniCrossImg {
156
+ /*!rtl:ignore*/
147
157
  -webkit-transform-origin-y: 0;
148
158
  transform: scale(0.18);
149
159
  margin-top: -1.6%;
package/_diff_a.txt DELETED
@@ -1,360 +0,0 @@
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
- }
306
- .widescreenCrossImg {
307
- zoom: 1.3;
308
- }
309
- .superlargeCrossImg {
310
- zoom: 1.1;
311
- }
312
- .largeCrossImg {
313
- zoom: 1.1;
314
- }
315
- .middleCrossImg {
316
- zoom: 1;
317
- }
318
- .middleCrossImg2 {
319
- zoom: 0.8;
320
- }
321
- .smallCrossImg {
322
- zoom: 0.8;
323
- }
324
- .smallCrossImg2 {
325
- zoom: 0.8;
326
- }
327
- .miniCrossImg {
328
- zoom: 0.7;
329
- }
330
- .superminiCrossImg {
331
- zoom: 0.6;
332
- }
333
- .minimumCrossImg {
334
- zoom: 0.35;
335
- }
336
- .transMiddleCrossImg {
337
- -webkit-transform-origin-y: 0;
338
- transform: scale(0.55);
339
- margin-top: 3%;
340
- padding: 0PX;
341
- }
342
- .transMiddleCrossImg2 {
343
- -webkit-transform-origin-y: 0;
344
- transform: scale(0.27);
345
- margin-top: -1.5%;
346
- padding: 0PX;
347
- }
348
- .transMiddleCrossImg3 {
349
- -webkit-transform-origin-y: 0;
350
- transform: scale(0.22);
351
- margin-top: -1%;
352
- padding: 0PX;
353
- }
354
- .transMiniCrossImg {
355
- -webkit-transform-origin-y: 0;
356
- transform: scale(0.18);
357
- margin-top: -1.6%;
358
- padding: 0PX;
359
- }
360
- </style>