openatc-components 0.0.75 → 0.0.78

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.0.75",
3
+ "version": "0.0.78",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -2,6 +2,7 @@
2
2
  <div class="overLap" v-if="checked" :style="{'margin':this.controlData ? '20px 0 0 0' :tentative ? '0' : '0 40px 0 417px'}">
3
3
  <div class="ring-first" v-for="(list, index1) in this.overlapDatas" :key="index1">
4
4
  <div v-for="(item,index2) in list.stageLists" :key="index2" >
5
+ <!-- {{list.peddirection}} -->
5
6
  <div class="first-2">
6
7
  <el-tooltip v-if="item.greenWidth" placement="top-start" effect="light">
7
8
  <div slot="content">
@@ -12,7 +13,7 @@
12
13
  </div>
13
14
  <div style="cursor:pointer;">
14
15
  <div class="ring-phase">
15
- <patternwalksvg :sidewalkPhaseData="list.sidewalkPhaseData" :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
16
+ <patternwalksvg :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
16
17
  <xdrdirselector Width="36px" Height="34px" :showlist="item.direction"></xdrdirselector>
17
18
  </div>
18
19
  <div class="box">
@@ -135,6 +136,7 @@ export default {
135
136
  findIndexs = Array.from(new Set(findIndexs))
136
137
  return {
137
138
  ...item,
139
+ peddirection: this.getPedPhasePos(item.peddirection),
138
140
  sidewalkPhaseData: this.getPedPhasePos(item.peddirection),
139
141
  stageLists: stageList.map(sta => {
140
142
  const find = findIndexs.includes(sta.key)
@@ -20,7 +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
- <patternwalksvg :sidewalkPhaseData="sidewalkPhaseData" :showWalk="item.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
23
+ <patternwalksvg :showWalk="item.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
24
24
  <xdrdirselector Width="36px" Height="34px" :showlist="item.direction"></xdrdirselector>
25
25
  </div>
26
26
  <div class="box">
@@ -63,7 +63,7 @@
63
63
  </div>
64
64
  <div style="cursor:pointer;">
65
65
  <div class="ring-phase">
66
- <patternwalksvg :sidewalkPhaseData="sidewalkPhaseData" :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
66
+ <patternwalksvg :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
67
67
  <xdrdirselector Width="36px" Height="34px" :showlist="list.direction"></xdrdirselector>
68
68
  </div>
69
69
  <div class="box" style="line-height:28px">
@@ -274,9 +274,16 @@ export default {
274
274
  return item.id === stg
275
275
  })[0]
276
276
  for (let walk of this.sidewalkPhaseData) {
277
- if (stg === walk.phaseid) {
278
- peddirections.push(...currPhase.peddirection)
279
- peddirections = Array.from(new Set(peddirections))
277
+ for (let ped of currPhase.peddirection) {
278
+ if (stg === walk.phaseid) {
279
+ let obj = {}
280
+ obj.name = walk.name
281
+ obj.id = walk.id
282
+ if (ped === walk.id) {
283
+ peddirections.push(obj)
284
+ peddirections = Array.from(new Set(peddirections))
285
+ }
286
+ }
280
287
  }
281
288
  }
282
289
  ped.push(...peddirections)
@@ -420,7 +427,22 @@ export default {
420
427
  obj.yellowWidth = (currPhase.yellow / cycle * 100).toFixed(3) + '%'
421
428
  obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / cycle * 100).toFixed(3) + '%'
422
429
  obj.flashgreen = (currPhase.flashgreen / cycle * 100).toFixed(3) + '%'
423
- obj.peddirection = currPhase.peddirection
430
+ // obj.peddirection = currPhase.peddirection
431
+ let peddirections = []
432
+ for (let walk of this.sidewalkPhaseData) {
433
+ for (let ped of currPhase.peddirection) {
434
+ // if (stg === walk.phaseid) {
435
+ let objs = {}
436
+ objs.name = walk.name
437
+ objs.id = walk.id
438
+ if (ped === walk.id) {
439
+ peddirections.push(objs)
440
+ peddirections = Array.from(new Set(peddirections))
441
+ }
442
+ // }
443
+ }
444
+ }
445
+ obj.peddirection = peddirections
424
446
  obj.split = split
425
447
  obj.direction = currPhase.direction.map(item => {
426
448
  return {
@@ -517,7 +539,22 @@ export default {
517
539
  obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
518
540
  obj.redWidth = (currPhase.redclear / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
519
541
  obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
520
- obj.peddirection = currPhase.peddirection
542
+ // obj.peddirection = currPhase.peddirection
543
+ let peddirections = []
544
+ for (let walk of this.sidewalkPhaseData) {
545
+ for (let ped of currPhase.peddirection) {
546
+ // if (stg === walk.phaseid) {
547
+ let objs = {}
548
+ objs.name = walk.name
549
+ objs.id = walk.id
550
+ if (ped === walk.id) {
551
+ peddirections.push(objs)
552
+ peddirections = Array.from(new Set(peddirections))
553
+ }
554
+ // }
555
+ }
556
+ }
557
+ obj.peddirection = peddirections
521
558
  // 忽略相位不显示
522
559
  let mode = ring.mode
523
560
  if (mode !== 7) { // 忽略相位不显示
@@ -370,9 +370,6 @@ export default {
370
370
  }
371
371
  },
372
372
  props: {
373
- sidewalkPhaseData: {
374
- type: Array
375
- },
376
373
  showWalk: {
377
374
  type: Array
378
375
  },
@@ -389,28 +386,21 @@ export default {
389
386
  }
390
387
  },
391
388
  watch: {
392
- sidewalkPhaseData: {
393
- handler: function () {
394
- this.getShow()
395
- },
396
- deep: true // 深度监听
397
- },
398
389
  showWalk: {
399
- handler: function () {
400
- this.getShow()
390
+ handler: function (newList) {
391
+ this.refreshShow(newList)
401
392
  },
402
393
  deep: true // 深度监听
403
394
  }
404
395
  },
405
396
  created () {
406
- this.getShow()
397
+ this.refreshShow(this.showWalk)
407
398
  },
408
399
  methods: {
409
- getShow () {
410
- if (!this.sidewalkPhaseData) return
411
- for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
400
+ refreshShow (showWalk) {
401
+ for (let i = 0; i < this.showWalk.length; i++) {
412
402
  for (let j = 0; j < this.status.length; j++) {
413
- if (this.sidewalkPhaseData[i].name === this.status[j].name && this.showWalk.includes(this.sidewalkPhaseData[i].id)) {
403
+ if (this.showWalk[i].name === this.status[j].name) {
414
404
  this.status[j].isshow = true
415
405
  }
416
406
  }
@@ -65,7 +65,6 @@
65
65
  :phaseList="phaseList"
66
66
  :overlap="overlap"
67
67
  :patternSelect="patternSelect"
68
- :planPattern="planPattern"
69
68
  :allPatternList="allPatternList"
70
69
  @closePhaseBack="closePhaseBack"
71
70
  @closePhaseControl="closePhaseControl"
@@ -156,9 +155,6 @@ export default {
156
155
  ip: {
157
156
  type: String
158
157
  },
159
- planPattern: {
160
- type: Object
161
- },
162
158
  allPatternList: {
163
159
  type: Array
164
160
  },
@@ -499,7 +495,7 @@ export default {
499
495
  }
500
496
  })
501
497
  control.control = that.preselectModel === -1 ? that.currModel : that.preselectModel
502
- control.terminal = Number(manualInfo.tempPatternid)
498
+ control.terminal = isNaN(parseInt(manualInfo.tempPatternid)) ? Number(manualInfo.tempPatternid.replace(/[^0-9]/ig, '')) : manualInfo.tempPatternid
503
499
  control.delay = Number(manualInfo.tempDelay)
504
500
  control.duration = Number(manualInfo.tempDuration)
505
501
  control.value = that.preselectStages === -1 ? 0 : that.preselectStages
@@ -171,9 +171,6 @@ export default {
171
171
  allPatternList: {
172
172
  type: Array
173
173
  },
174
- planPattern: {
175
- type: Object
176
- },
177
174
  patternSelect: {
178
175
  type: Array
179
176
  }
@@ -302,149 +299,7 @@ export default {
302
299
  ringCounts: 1,
303
300
  coordphaseOption: [],
304
301
  patternOne: [],
305
- // planPattern: {
306
- // cycle: 120,
307
- // offset: 0,
308
- // rings: [
309
- // [
310
- // {
311
- // 'name': 'Phase 1',
312
- // 'desc': [
313
- // {
314
- // 'id': 13,
315
- // 'color': '#454545'
316
- // }
317
- // ],
318
- // 'id': 1,
319
- // 'value': 30,
320
- // 'mode': 2,
321
- // 'options': [],
322
- // 'delaystart': 0,
323
- // 'advanceend': 0
324
- // },
325
- // {
326
- // 'name': 'Phase 2',
327
- // 'desc': [
328
- // {
329
- // 'id': 3,
330
- // 'color': '#454545'
331
- // },
332
- // {
333
- // 'id': 12,
334
- // 'color': '#454545'
335
- // }
336
- // ],
337
- // 'id': 2,
338
- // 'value': 30,
339
- // 'mode': 2,
340
- // 'options': [],
341
- // 'delaystart': 0,
342
- // 'advanceend': 0
343
- // },
344
- // {
345
- // 'name': 'Phase 3',
346
- // 'desc': [
347
- // {
348
- // 'id': 1,
349
- // 'color': '#454545'
350
- // }
351
- // ],
352
- // 'id': 3,
353
- // 'value': 30,
354
- // 'mode': 2,
355
- // 'options': [],
356
- // 'delaystart': 0,
357
- // 'advanceend': 0
358
- // },
359
- // {
360
- // 'name': 'Phase 4',
361
- // 'desc': [
362
- // {
363
- // 'id': 6,
364
- // 'color': '#454545'
365
- // },
366
- // {
367
- // 'id': 8,
368
- // 'color': '#454545'
369
- // }
370
- // ],
371
- // 'id': 4,
372
- // 'value': 30,
373
- // 'mode': 2,
374
- // 'options': [],
375
- // 'delaystart': 0,
376
- // 'advanceend': 0
377
- // }
378
- // ],
379
- // [
380
- // {
381
- // 'name': 'Phase 5',
382
- // 'desc': [
383
- // {
384
- // 'id': 9,
385
- // 'color': '#454545'
386
- // }
387
- // ],
388
- // 'id': 5,
389
- // 'value': 30,
390
- // 'mode': 2,
391
- // 'options': [],
392
- // 'delaystart': 0,
393
- // 'advanceend': 0
394
- // },
395
- // {
396
- // 'name': 'Phase 6',
397
- // 'desc': [
398
- // {
399
- // 'id': 14,
400
- // 'color': '#454545'
401
- // },
402
- // {
403
- // 'id': 16,
404
- // 'color': '#454545'
405
- // }
406
- // ],
407
- // 'id': 6,
408
- // 'value': 30,
409
- // 'mode': 2,
410
- // 'options': [],
411
- // 'delaystart': 0,
412
- // 'advanceend': 0
413
- // },
414
- // {
415
- // 'name': 'Phase 7',
416
- // 'desc': [],
417
- // 'id': 7,
418
- // 'value': 30,
419
- // 'mode': 2,
420
- // 'options': [],
421
- // 'delaystart': 0,
422
- // 'advanceend': 0
423
- // },
424
- // {
425
- // 'name': 'Phase 8',
426
- // 'desc': [
427
- // {
428
- // 'id': 2,
429
- // 'color': '#454545'
430
- // },
431
- // {
432
- // 'id': 4,
433
- // 'color': '#454545'
434
- // }
435
- // ],
436
- // 'id': 8,
437
- // 'value': 30,
438
- // 'mode': 2,
439
- // 'options': [],
440
- // 'delaystart': 0,
441
- // 'advanceend': 0
442
- // }
443
- // ],
444
- // [],
445
- // []
446
- // ]
447
- // },
302
+ planPattern: {},
448
303
  // allPatternList: [
449
304
  // {
450
305
  // 'id': 1,
@@ -1176,12 +1031,71 @@ export default {
1176
1031
  }
1177
1032
  },
1178
1033
  created () {
1034
+ this.patternPlan()
1035
+ this.getCycle()
1179
1036
  if (this.patternOne.length === 0) {
1180
1037
  this.handleStageData(this.planPattern.rings)
1181
1038
  }
1182
1039
  this.initData()
1183
1040
  },
1184
1041
  methods: {
1042
+ patternPlan () {
1043
+ let Pattern = {
1044
+ offset: 0,
1045
+ cycle: 0,
1046
+ rings: [[], [], [], []]
1047
+ }
1048
+ var newPattern = JSON.parse(JSON.stringify(Pattern))
1049
+ for (let phase of this.phaseList) {
1050
+ let ring = {}
1051
+ ring.name = 'Phase ' + phase.id
1052
+ ring.desc = this.getPhaseDescription(phase.direction)
1053
+ ring.id = phase.id
1054
+ ring.value = 30
1055
+ ring.mode = 2
1056
+ ring.options = []
1057
+ ring.delaystart = 0
1058
+ ring.advanceend = 0
1059
+ if (phase.ring === 1) {
1060
+ newPattern.rings[0].push(ring)
1061
+ } else if (phase.ring === 2) {
1062
+ newPattern.rings[1].push(ring)
1063
+ } else if (phase.ring === 3) {
1064
+ newPattern.rings[2].push(ring)
1065
+ } else if (phase.ring === 4) {
1066
+ newPattern.rings[3].push(ring)
1067
+ }
1068
+ }
1069
+ this.planPattern = newPattern
1070
+ },
1071
+ getCycle () {
1072
+ for (let rings of this.planPattern.rings) {
1073
+ let num = 0
1074
+ for (let i = 0; i < rings.length; i++) {
1075
+ if (rings[i].length !== 0) {
1076
+ if (rings[i].mode === 7) { // 忽略相位不计周期
1077
+ continue
1078
+ }
1079
+ num = num + Number(rings[i].value)
1080
+ }
1081
+ }
1082
+ if (num !== 0) {
1083
+ this.planPattern.cycle = num
1084
+ break
1085
+ }
1086
+ }
1087
+ },
1088
+ getPhaseDescription (phaseList) {
1089
+ if (!phaseList) return
1090
+ let list = []
1091
+ for (let id of phaseList) {
1092
+ let obj = {}
1093
+ obj.id = id
1094
+ obj.color = '#454545'
1095
+ list.push(obj)
1096
+ }
1097
+ return list
1098
+ },
1185
1099
  handleClose () {
1186
1100
  this.$emit('closePhaseBack')
1187
1101
  },
@@ -26,7 +26,6 @@
26
26
  </template> -->
27
27
  <patternwalksvg class="patternWalk"
28
28
  :showWalk="item[0].peddirection"
29
- :sidewalkPhaseData="item[0].sidewalkPhaseData"
30
29
  :Width="'40'"
31
30
  :Height="'40'" />
32
31
  <xdr-dir-selector Width="40PX" Height="40PX" :showlist="item"></xdr-dir-selector>
@@ -70,7 +70,6 @@
70
70
  ref="rightpanel"
71
71
  :statusData="crossStatusData"
72
72
  :agentName="agentName"
73
- :planPattern="planPattern"
74
73
  :responseTime="responseTime"
75
74
  :devStatus="devStatus"
76
75
  :agentId="agentId"
@@ -145,7 +144,6 @@ export default {
145
144
  controlData: {},
146
145
  checked: false,
147
146
  overlap: [],
148
- planPattern: {},
149
147
  contrloType: '',
150
148
  narr: [],
151
149
  patternList: [],
@@ -279,84 +277,6 @@ export default {
279
277
  setHost(host)
280
278
  }
281
279
  },
282
- patternPlan () {
283
- // this.increaseId()
284
- let Pattern = {
285
- // id: this.id,
286
- // desc: `${this.$t('edge.pattern.pattern')}${this.id}`,
287
- offset: 0,
288
- cycle: 0,
289
- // stagesList: [],
290
- rings: [[], [], [], []]
291
- }
292
- var newPattern = JSON.parse(JSON.stringify(Pattern))
293
- // debugger
294
- // const phaseList = JSON.parse(JSON.stringify(this.globalParamModel.getParamsByType('phaseList')))
295
- for (let phase of this.phaseList) {
296
- let ring = {}
297
- ring.name = 'Phase ' + phase.id
298
- ring.desc = this.getPhaseDescription(phase.direction)
299
- ring.id = phase.id
300
- ring.value = 30
301
- ring.mode = 2
302
- ring.options = []
303
- ring.delaystart = 0
304
- ring.advanceend = 0
305
- if (phase.ring === 1) {
306
- newPattern.rings[0].push(ring)
307
- } else if (phase.ring === 2) {
308
- newPattern.rings[1].push(ring)
309
- } else if (phase.ring === 3) {
310
- newPattern.rings[2].push(ring)
311
- } else if (phase.ring === 4) {
312
- newPattern.rings[3].push(ring)
313
- }
314
- // pahseIndex++
315
- }
316
- this.planPattern = newPattern
317
- return newPattern
318
- },
319
- getPhaseDescription (phaseList) {
320
- if (!phaseList) return
321
- let list = []
322
- for (let id of phaseList) {
323
- let obj = {}
324
- obj.id = id
325
- obj.color = '#454545'
326
- list.push(obj)
327
- }
328
- return list
329
- },
330
- getCycle () {
331
- for (let rings of this.planPattern.rings) {
332
- let num = 0
333
- for (let i = 0; i < rings.length; i++) {
334
- if (rings[i].length !== 0) {
335
- if (rings[i].mode === 7) { // 忽略相位不计周期
336
- continue
337
- }
338
- num = num + Number(rings[i].value)
339
- let id = rings[i].id
340
- rings[i].name = this.getDescription(id)
341
- }
342
- }
343
- if (num !== 0) {
344
- this.planPattern.cycle = num
345
- break
346
- }
347
- }
348
- },
349
- getDescription (id) {
350
- for (let phase of this.phaseList) {
351
- if (phase.id === id) {
352
- if (phase.desc !== '' && phase.desc !== undefined) {
353
- return phase.desc
354
- } else {
355
- return 'phase' + id
356
- }
357
- }
358
- }
359
- },
360
280
  getIntersectionInfo (agentid, id) {
361
281
  // 获取路口信息
362
282
  getIntersectionInfo(agentid).then(res => {
@@ -365,8 +285,6 @@ export default {
365
285
  this.overlap = res.data.data.param.overlaplList
366
286
  this.contrloType = this.allPatternList[0].contrloType
367
287
  this.phaseList = res.data.data.param.phaseList
368
- this.patternPlan()
369
- this.getCycle()
370
288
  // this.patternList = res.data.data.param.patternList.filter(item => {
371
289
  // return item.id === id
372
290
  // })[0].rings
@@ -145,9 +145,16 @@ export default class RingDataModel {
145
145
  directionList = [...currPhase.direction, ...directionList]
146
146
  }
147
147
  for (let walk of sidewalkPhaseData) {
148
- if (stg === walk.phaseid) {
149
- peddirections.push(...currPhase.peddirection)
150
- peddirections = Array.from(new Set(peddirections))
148
+ for (let ped of currPhase.peddirection) {
149
+ // if (stg === walk.phaseid) {
150
+ let obj = {}
151
+ obj.name = walk.name
152
+ obj.id = walk.id
153
+ if (ped === walk.id) {
154
+ peddirections.push(obj)
155
+ peddirections = Array.from(new Set(peddirections))
156
+ }
157
+ // }
151
158
  }
152
159
  }
153
160
  for (let busPhase of busPhaseData) {
@@ -249,7 +249,7 @@
249
249
  // width: 50%;
250
250
  }
251
251
  .el-input-number--mini {
252
- width: 44%;
252
+ // width: 44%;
253
253
  }
254
254
  .el-input-number {
255
255
  // width: 100%;
@@ -372,6 +372,9 @@
372
372
  margin: 0 auto;
373
373
  margin-bottom: 13px;
374
374
  }
375
+ .el-input--mini {
376
+ width: 44%;
377
+ }
375
378
  .el-form-item__content {
376
379
  min-width: 120px;
377
380
  }
@@ -390,6 +393,9 @@
390
393
  width: 45%;
391
394
  min-width: 180px;
392
395
  }
396
+ .el-input-number--mini{
397
+ width: 100%;
398
+ }
393
399
  .el-input {
394
400
  width: 100%;
395
401
  }