openatc-components 0.0.33 → 0.0.36

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.
@@ -48,9 +48,7 @@
48
48
  <el-tooltip class="item" effect="dark" placement="left">
49
49
  <div slot="content">{{element.name}}</div>
50
50
  <div class="common-phase-description">
51
- <div v-for="(side, index) in sidewalkPhaseData" :key="side.key + '-' + index">
52
- <PatternWalkSvg v-if="element.peddirection.includes(side.id)" :Data="side" Width="38" Height="40" />
53
- </div>
51
+ <patternwalksvg :sidewalkPhaseData="sidewalkPhaseData" :showWalk="element.peddirection" Width="38" Height="40"></patternwalksvg>
54
52
  <xdrdirselector Width="40px"
55
53
  Height="40px"
56
54
  :showlist="element.desc"
@@ -70,14 +68,15 @@
70
68
  <script>
71
69
  import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
72
70
  import draggable from 'vuedraggable'
73
- import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
71
+ // import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
72
+ import patternwalksvg from '../PatternWalkSvg/PatternWalkSvg'
74
73
 
75
74
  export default {
76
75
  name: 'common-kanban',
77
76
  components: {
78
77
  draggable,
79
78
  xdrdirselector,
80
- PatternWalkSvg
79
+ patternwalksvg
81
80
  },
82
81
  props: {
83
82
  headerText: {
@@ -11,7 +11,8 @@
11
11
  * See the Mulan PSL v2 for more details.
12
12
  **/
13
13
  <template>
14
- <div :style="{position: 'absolute', left: Data.left?Data.left:'2px', top: Data.top}">
14
+ <div :style="{position: 'absolute'}">
15
+ <!-- , left: Data.left?Data.left:'2px', top: Data.top -->
15
16
  <svg
16
17
  :width="Width"
17
18
  :height="Height"
@@ -22,8 +23,7 @@
22
23
  style="enable-background:new 0 0 34 34;"
23
24
  xml:space="preserve">
24
25
  <g id="路段行人过街-东西"
25
- :class="Data.name === '东西路段人行横道' ? '' : 'invisible'"
26
- class="st0">
26
+ :class="status[0].isshow? '' : 'invisible'">
27
27
  <rect x="19.9" y="14.2" class="st1" width="1.6" height="5.6"/>
28
28
  <rect x="17.4" y="14.2" class="st1" width="1.6" height="5.6"/>
29
29
  <rect x="22.4" y="14.2" class="st1" width="1.6" height="5.6"/>
@@ -40,7 +40,7 @@
40
40
  <rect x="14.9" y="14.2" class="st1" width="1.6" height="5.6"/>
41
41
  </g>
42
42
  <g id="路段行人过街-南北" class="st0"
43
- :class="Data.name === '南北路段人行横道' ? '' : 'invisible'"
43
+ :class="status[1].isshow? '' : 'invisible'">
44
44
  >
45
45
  <rect x="14.2" y="19.9" class="st1" width="5.6" height="1.6"/>
46
46
  <rect x="14.2" y="17.4" class="st1" width="5.6" height="1.6"/>
@@ -58,7 +58,7 @@
58
58
  <rect x="14.2" y="14.9" class="st1" width="5.6" height="1.6"/>
59
59
  </g>
60
60
  <g id="斜向行人1" class="st0"
61
- :class="Data.name === 'X人行横道-\\' ? '' : 'invisible'"
61
+ :class="status[2].isshow? '' : 'invisible'">
62
62
  >
63
63
  <rect x="14.2" y="16.2" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -7.0438 17.0053)" class="st1" width="5.6" height="1.6"/>
64
64
  <rect x="12.4" y="14.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -6.3149 15.2456)" class="st1" width="5.6" height="1.6"/>
@@ -79,7 +79,7 @@
79
79
  <rect x="10.7" y="12.7" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -5.586 13.4859)" class="st1" width="5.6" height="1.6"/>
80
80
  </g>
81
81
  <g id="斜向行人2" class="st0"
82
- :class="Data.name === 'X人行横道-/' ? '' : 'invisible'"
82
+ :class="status[3].isshow? '' : 'invisible'"
83
83
  >
84
84
  <rect x="16.2" y="14.2" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -7.047 16.9978)" class="st1" width="1.6" height="5.6"/>
85
85
  <rect x="17.9" y="12.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -5.2872 17.7267)" class="st1" width="1.6" height="5.6"/>
@@ -102,7 +102,7 @@
102
102
  <rect x="19.7" y="10.7" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -3.5275 18.4556)" class="st1" width="1.6" height="5.6"/>
103
103
  </g>
104
104
  <g id="北行人"
105
- :class="Data.name === '北人行横道' ? '' : 'invisible'"
105
+ :class="status[4].isshow? '' : 'invisible'"
106
106
  class="st0">
107
107
  <rect x="19.9" class="st1" width="1.6" height="5.6"/>
108
108
  <rect x="17.4" class="st1" width="1.6" height="5.6"/>
@@ -120,7 +120,7 @@
120
120
  <rect x="14.9" class="st1" width="1.6" height="5.6"/>
121
121
  </g>
122
122
  <g id="南行人"
123
- :class="Data.name === '南人行横道' ? '' : 'invisible'"
123
+ :class="status[5].isshow? '' : 'invisible'"
124
124
  class="st0">
125
125
  <rect x="19.9" y="28.4" class="st1" width="1.6" height="5.6"/>
126
126
  <rect x="17.4" y="28.4" class="st1" width="1.6" height="5.6"/>
@@ -138,7 +138,7 @@
138
138
  <rect x="14.9" y="28.4" class="st1" width="1.6" height="5.6"/>
139
139
  </g>
140
140
  <g id="东行人"
141
- :class="Data.name === '东人行横道' ? '' : 'invisible'"
141
+ :class="status[6].isshow? '' : 'invisible'"
142
142
  class="st0">
143
143
  <rect x="28.4" y="19.9" class="st1" width="5.6" height="1.6"/>
144
144
  <rect x="28.4" y="17.4" class="st1" width="5.6" height="1.6"/>
@@ -156,7 +156,7 @@
156
156
  <rect x="28.4" y="14.9" class="st1" width="5.6" height="1.6"/>
157
157
  </g>
158
158
  <g id="西行人"
159
- :class="Data.name === '西人行横道' ? '' : 'invisible'"
159
+ :class="status[7].isshow? '' : 'invisible'"
160
160
  class="st0">
161
161
  <rect y="19.9" class="st1" width="5.6" height="1.6"/>
162
162
  <rect y="17.4" class="st1" width="5.6" height="1.6"/>
@@ -175,7 +175,7 @@
175
175
  </g>
176
176
  <g id="二次过街-西" class="st0">
177
177
  <g id="西下"
178
- :class="Data.name === '西人行横道-下' ? '' : 'invisible'"
178
+ :class="status[8].isshow? '' : 'invisible'"
179
179
  >
180
180
  <rect y="19.9" class="st1" width="5.6" height="1.6"/>
181
181
  <rect y="22.4" class="st1" width="5.6" height="1.6"/>
@@ -185,7 +185,7 @@
185
185
  <rect y="32.4" class="st1" width="5.6" height="1.6"/>
186
186
  </g>
187
187
  <g id="西上"
188
- :class="Data.name === '西人行横道-上' ? '' : 'invisible'"
188
+ :class="status[9].isshow? '' : 'invisible'"
189
189
  >
190
190
  <rect y="7.5" class="st1" width="5.6" height="1.6"/>
191
191
  <rect y="5" class="st1" width="5.6" height="1.6"/>
@@ -197,7 +197,7 @@
197
197
  </g>
198
198
  <g id="二次过街-东" class="st0">
199
199
  <g id="东上"
200
- :class="Data.name === '东人行横道-上' ? '' : 'invisible'"
200
+ :class="status[10].isshow? '' : 'invisible'"
201
201
  >
202
202
  <rect x="28.4" y="12.5" class="st1" width="5.6" height="1.6"/>
203
203
  <rect x="28.4" y="10" class="st1" width="5.6" height="1.6"/>
@@ -207,7 +207,7 @@
207
207
  <rect x="28.4" y="0" class="st1" width="5.6" height="1.6"/>
208
208
  </g>
209
209
  <g id="东下"
210
- :class="Data.name === '东人行横道-下' ? '' : 'invisible'"
210
+ :class="status[11].isshow? '' : 'invisible'"
211
211
  >
212
212
  <rect x="28.4" y="24.9" class="st1" width="5.6" height="1.6"/>
213
213
  <rect x="28.4" y="27.4" class="st1" width="5.6" height="1.6"/>
@@ -219,7 +219,7 @@
219
219
  </g>
220
220
  <g id="二次过街-南" class="st0">
221
221
  <g id="南右"
222
- :class="Data.name === '南人行横道-右' ? '' : 'invisible'"
222
+ :class="status[12].isshow? '' : 'invisible'"
223
223
  >
224
224
  <rect x="19.9" y="28.4" class="st1" width="1.6" height="5.6"/>
225
225
  <rect x="22.4" y="28.4" class="st1" width="1.6" height="5.6"/>
@@ -229,7 +229,7 @@
229
229
  <rect x="32.4" y="28.4" class="st1" width="1.6" height="5.6"/>
230
230
  </g>
231
231
  <g id="南左"
232
- :class="Data.name === '南人行横道-左' ? '' : 'invisible'"
232
+ :class="status[13].isshow? '' : 'invisible'"
233
233
  >
234
234
  <rect x="7.5" y="28.4" class="st1" width="1.6" height="5.6"/>
235
235
  <rect x="5" y="28.4" class="st1" width="1.6" height="5.6"/>
@@ -241,7 +241,7 @@
241
241
  </g>
242
242
  <g id="二次过街-北_1_" class="st0">
243
243
  <g id="北右_1_"
244
- :class="Data.name === '北人行横道-右' ? '' : 'invisible'"
244
+ :class="status[14].isshow? '' : 'invisible'"
245
245
  >
246
246
  <rect x="19.9" class="st1" width="1.6" height="5.6"/>
247
247
  <rect x="22.4" class="st1" width="1.6" height="5.6"/>
@@ -251,7 +251,7 @@
251
251
  <rect x="32.4" class="st1" width="1.6" height="5.6"/>
252
252
  </g>
253
253
  <g id="北左_1_"
254
- :class="Data.name === '北人行横道-左' ? '' : 'invisible'"
254
+ :class="status[15].isshow? '' : 'invisible'"
255
255
  >
256
256
  <rect x="7.5" class="st1" width="1.6" height="5.6"/>
257
257
  <rect x="5" class="st1" width="1.6" height="5.6"/>
@@ -269,9 +269,113 @@ export default {
269
269
  name: 'PatternWalkSvg',
270
270
  data () {
271
271
  return {
272
+ status: [
273
+ {
274
+ id: 1,
275
+ name: '东西路段人行横道',
276
+ isshow: false,
277
+ color: '#0096ba'
278
+ },
279
+ {
280
+ id: 2,
281
+ name: '南北路段人行横道',
282
+ isshow: false,
283
+ color: '#0096ba'
284
+ },
285
+ {
286
+ id: 3,
287
+ name: 'X人行横道-\\',
288
+ isshow: false,
289
+ color: '#0096ba'
290
+ },
291
+ {
292
+ id: 4,
293
+ name: 'X人行横道-/',
294
+ isshow: false,
295
+ color: '#0096ba'
296
+ },
297
+ {
298
+ id: 5,
299
+ name: '北人行横道',
300
+ isshow: false,
301
+ color: '#0096ba'
302
+ },
303
+ {
304
+ id: 6,
305
+ name: '南人行横道',
306
+ isshow: false,
307
+ color: '#0096ba'
308
+ },
309
+ {
310
+ id: 7,
311
+ name: '东人行横道',
312
+ isshow: false,
313
+ color: '#0096ba'
314
+ },
315
+ {
316
+ id: 8,
317
+ name: '西人行横道',
318
+ isshow: false,
319
+ color: '#0096ba'
320
+ },
321
+ {
322
+ id: 9,
323
+ name: '西人行横道-下',
324
+ isshow: false,
325
+ color: '#0096ba'
326
+ },
327
+ {
328
+ id: 10,
329
+ name: '西人行横道-上',
330
+ isshow: false,
331
+ color: '#0096ba'
332
+ },
333
+ {
334
+ id: 11,
335
+ name: '东人行横道-上',
336
+ isshow: false,
337
+ color: '#0096ba'
338
+ },
339
+ {
340
+ id: 12,
341
+ name: '东人行横道-下',
342
+ isshow: false,
343
+ color: '#0096ba'
344
+ },
345
+ {
346
+ id: 13,
347
+ name: '南人行横道-右',
348
+ isshow: false,
349
+ color: '#0096ba'
350
+ },
351
+ {
352
+ id: 14,
353
+ name: '南人行横道-左',
354
+ isshow: false,
355
+ color: '#0096ba'
356
+ },
357
+ {
358
+ id: 15,
359
+ name: '北人行横道-右',
360
+ isshow: false,
361
+ color: '#0096ba'
362
+ },
363
+ {
364
+ id: 16,
365
+ name: '北人行横道-左',
366
+ isshow: false,
367
+ color: '#0096ba'
368
+ }
369
+ ]
272
370
  }
273
371
  },
274
372
  props: {
373
+ sidewalkPhaseData: {
374
+ type: Array
375
+ },
376
+ showWalk: {
377
+ type: Array
378
+ },
275
379
  Width: {
276
380
  type: String,
277
381
  default: '34px'
@@ -283,6 +387,36 @@ export default {
283
387
  Data: {
284
388
  type: Object
285
389
  }
390
+ },
391
+ watch: {
392
+ sidewalkPhaseData: {
393
+ handler: function () {
394
+ this.getShow()
395
+ },
396
+ deep: true // 深度监听
397
+ },
398
+ showWalk: {
399
+ handler: function () {
400
+ this.getShow()
401
+ },
402
+ deep: true // 深度监听
403
+ }
404
+ },
405
+ created () {
406
+ this.getShow()
407
+ },
408
+ methods: {
409
+ getShow () {
410
+ console.log(this.sidewalkPhaseData, this.showWalk)
411
+ if (!this.sidewalkPhaseData) return
412
+ for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
413
+ for (let j = 0; j < this.status.length; j++) {
414
+ if (this.sidewalkPhaseData[i].name === this.status[j].name && this.showWalk.includes(this.sidewalkPhaseData[i].id)) {
415
+ this.status[j].isshow = true
416
+ }
417
+ }
418
+ }
419
+ }
286
420
  }
287
421
  }
288
422
  </script>
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  <div style="cursor:pointer;">
14
14
  <div class="ring-phase">
15
- <PatternWalkSvg v-if="item.peddirection" :Data="item.peddirection[0]" :Width="'32'" :Height="'34'" />
15
+ <patternwalksvg :sidewalkPhaseData="list.sidewalkPhaseData" :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
16
16
  <xdrdirselector Width="36px" Height="34px" :showlist="item.direction"></xdrdirselector>
17
17
  </div>
18
18
  <div class="box">
@@ -37,11 +37,11 @@
37
37
  import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
38
38
  import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
39
39
  import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
40
- import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
40
+ import patternwalksvg from '../PatternWalkSvg/PatternWalkSvg'
41
41
  export default {
42
42
  name: 'over-lap',
43
43
  components: {
44
- PatternWalkSvg,
44
+ patternwalksvg,
45
45
  xdrdirselector
46
46
  },
47
47
  data () {
@@ -134,6 +134,7 @@ export default {
134
134
  findIndexs = Array.from(new Set(findIndexs))
135
135
  return {
136
136
  ...item,
137
+ sidewalkPhaseData: this.getPedPhasePos(item.peddirection),
137
138
  stageLists: stageList.map(sta => {
138
139
  const find = findIndexs.includes(sta.key)
139
140
  return {
@@ -20,9 +20,7 @@
20
20
  <div slot="content">P{{item.id}}:{{item.split}}</div>
21
21
  <div style="cursor:pointer;">
22
22
  <div class="ring-phase">
23
- <div v-for="(side, index) in sidewalkPhaseData" :key="side.key + '-' + index">
24
- <PatternWalkSvg v-if="item.peddirection.includes(side.id)" :Data="side" :Width="'32'" :Height="'34'" />
25
- </div>
23
+ <patternwalksvg :sidewalkPhaseData="sidewalkPhaseData" :showWalk="item.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
26
24
  <xdrdirselector Width="36px" Height="34px" :showlist="item.direction"></xdrdirselector>
27
25
  </div>
28
26
  <div class="box">
@@ -46,7 +44,7 @@
46
44
  <div v-for="(item, index) in barrierList" :key="index + '1'">
47
45
  <div class="divider" :style="{'left':item, 'height':barrierHeight}"></div>
48
46
  </div>
49
- <div v-show="syncTime && cycle && cycle > 0">
47
+ <div v-show="(syncTime && cycle && cycle>0) || (syncTime && newCycle && newCycle>0)">
50
48
  <div class="curTimeDiv" :style="{'left':paddingLeft, 'background-color': '#409EFF'}">{{ timeNumDevide }}</div>
51
49
  <div class="curTimeLine" :style="{'left':paddingLeft, 'height':barrierHeight}"></div>
52
50
  </div>
@@ -63,9 +61,7 @@
63
61
  </div>
64
62
  <div style="cursor:pointer;">
65
63
  <div class="ring-phase">
66
- <div v-for="(side, index) in sidewalkPhaseData" :key="side.key + '-' + index">
67
- <PatternWalkSvg v-if="list.peddirection.includes(side.id)" :Data="side" :Width="'32'" :Height="'34'" />
68
- </div>
64
+ <patternwalksvg :sidewalkPhaseData="sidewalkPhaseData" :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
69
65
  <xdrdirselector Width="36px" Height="34px" :showlist="list.direction"></xdrdirselector>
70
66
  </div>
71
67
  <div class="box" style="line-height:28px">
@@ -85,14 +81,15 @@
85
81
  </div>
86
82
  </template>
87
83
  <script>
84
+ import patternwalksvg from '../PatternWalkSvg/PatternWalkSvg'
88
85
  import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
89
- import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
86
+ // import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
90
87
  import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
91
88
  import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
92
89
  export default {
93
90
  name: 'pattern-list',
94
91
  components: {
95
- PatternWalkSvg,
92
+ patternwalksvg,
96
93
  xdrdirselector
97
94
  },
98
95
  data () {
@@ -152,6 +149,10 @@ export default {
152
149
  computed: {
153
150
  paddingLeft () {
154
151
  let res = '0%'
152
+ if (this.newCycle && this.newCycle > 0) {
153
+ let curPercent = (this.newCycle - this.syncTime) / this.newCycle
154
+ res = curPercent * 100 + '%'
155
+ }
155
156
  if (this.cycle && this.cycle > 0) {
156
157
  let curPercent = (this.cycle - this.syncTime) / this.cycle
157
158
  res = curPercent * 100 + '%'
@@ -159,8 +160,14 @@ export default {
159
160
  return res
160
161
  },
161
162
  timeNumDevide () {
162
- let res = (this.cycle - this.syncTime) + '/' + this.cycle
163
- return res
163
+ if (this.newCycle && this.newCycle > 0) {
164
+ let res = (this.newCycle - this.syncTime) + '/' + this.newCycle
165
+ return res
166
+ }
167
+ if (this.cycle && this.cycle > 0) {
168
+ let res = (this.cycle - this.syncTime) + '/' + this.cycle
169
+ return res
170
+ }
164
171
  }
165
172
  },
166
173
  watch: {
@@ -171,6 +178,7 @@ export default {
171
178
  }
172
179
  // this.controlDatas = this.controlData
173
180
  this.handlePatternData()
181
+ this.handleBarrierHeight()
174
182
  },
175
183
  // 深度观察监听
176
184
  deep: true
@@ -243,7 +251,7 @@ export default {
243
251
  setTimeout(() => {
244
252
  this.handleCurrentChange(this.patternStatusList)
245
253
  this.handleBarrierHeight()
246
- }, 200)
254
+ }, 400)
247
255
  } else {
248
256
  this.handlePatternData()
249
257
  }