openatc-components 0.0.100 → 0.0.103

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.
Files changed (60) hide show
  1. package/package/kisscomps/components/BoardCard/BoardCard.vue +6 -1
  2. package/package/kisscomps/components/Channelization/Channelization.vue +13 -10
  3. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +18 -11
  4. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +54 -74
  5. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +1 -4
  6. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +11 -34
  7. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +1 -26
  8. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +18 -37
  9. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +6 -0
  10. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +28 -50
  11. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +29 -53
  12. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +1 -4
  13. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +147 -130
  14. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +5 -6
  15. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +43 -144
  16. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +1 -45
  17. package/package/kisscomps/components/KanBan/kanban.vue +7 -7
  18. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +153 -38
  19. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +16 -0
  20. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +190 -0
  21. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -0
  22. package/package/kisscomps/components/StageStatus/StageStatus.vue +6 -2
  23. package/package/kisscomps/components/patternList/patternList.vue +5 -0
  24. package/package/kisscomps/index.js +2 -0
  25. package/package/kissui.min.js +1 -1
  26. package/package.json +13 -12
  27. package/src/i18n/language/en.js +32 -7
  28. package/src/i18n/language/zh.js +31 -6
  29. package/src/kisscomps/components/BoardCard/BoardCard.vue +6 -1
  30. package/src/kisscomps/components/Channelization/Channelization.vue +13 -10
  31. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +18 -11
  32. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +54 -74
  33. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +1 -4
  34. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +11 -34
  35. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +1 -26
  36. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +18 -37
  37. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +6 -0
  38. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +28 -50
  39. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +29 -53
  40. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +1 -4
  41. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +147 -130
  42. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +5 -6
  43. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +43 -144
  44. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +191 -0
  45. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +331 -0
  46. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +1 -45
  47. package/src/kisscomps/components/KanBan/kanban.vue +7 -7
  48. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +153 -38
  49. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +16 -0
  50. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +190 -0
  51. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -0
  52. package/src/kisscomps/components/StageStatus/StageStatus.vue +6 -2
  53. package/src/kisscomps/components/patternList/patternList.vue +5 -0
  54. package/src/kisscomps/index.js +2 -0
  55. package/src/router/index.js +2 -2
  56. package/src/views/intersection.vue +5 -3
  57. package/static/styles/channelizatioon.scss +2 -40
  58. package/static/styles/schemeconfig.scss +52 -0
  59. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +0 -113
  60. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +0 -113
@@ -64,6 +64,13 @@
64
64
 
65
65
  <div class="phase-associated">
66
66
  <div class="tittle">{{$t('openatccomponents.channelizationmap.phaseassociated')}}</div>
67
+ <!-- 相位可以编辑,增加,删除,校验 -->
68
+ <!-- <PhaseAssociatedComponentCheck
69
+ ref="phaseAssociated"
70
+ :editData="Data"
71
+ :Motorways="Motorways"
72
+ @selectPhase="selectPhase"
73
+ @handleDisassociatePhase="handleDisassociatePhase" /> -->
67
74
  <!-- 相位仅可以关联选择,不可修改 -->
68
75
  <PhaseAssociatedComponent
69
76
  :editData="Data"
@@ -108,6 +115,12 @@
108
115
  </div>
109
116
  <div class="phase-associated">
110
117
  <div class="tittle">{{$t('openatccomponents.channelizationmap.phaseassociated')}}</div>
118
+ <!-- 相位可以编辑,增加,删除,校验 -->
119
+ <!-- <PhaseAssociatedComponentCheck
120
+ ref="phaseAssociated"
121
+ :editData="Data"
122
+ @selectPhase="selectPhase"
123
+ @handleDisassociatePhase="handleDisassociatePhase" /> -->
111
124
  <!-- 相位仅可以关联选择,不可修改 -->
112
125
  <PhaseAssociatedComponent
113
126
  :editData="Data"
@@ -122,12 +135,6 @@
122
135
 
123
136
  <!-- 检测器编辑面板 -->
124
137
  <div class="detector" v-if="Data.icontype === 'detector' && Data.detailtype === 'detector'">
125
- <div class="edit-id">
126
- <span style="margin-right: 3px;">
127
- {{$t('openatccomponents.channelizationmap.detector') + ':'}}
128
- </span>
129
- <span>{{Data.id}}</span>
130
- </div>
131
138
  <div class="detector-type">
132
139
  <div class="tittle">{{$t('openatccomponents.channelizationmap.detectortype')}}</div>
133
140
  <div class="each-icon" v-for="(item, index) in detectortypeList" :key="index">
@@ -153,71 +160,40 @@
153
160
  <el-form-item
154
161
  :label="$t('openatccomponents.channelizationmap.occupancythreshold') + ':'"
155
162
  prop="intersection">
156
- <!-- <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
163
+ <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
157
164
  :value="occupancythreshold" size="mini"
158
165
  @change="handleChangeOccuthreshold" />
159
- <span class="detector-threshold-formtext">%</span> -->
160
- <el-select :value="occupancythreshold" @change="handleChangeOccuthreshold">
161
- <el-option
162
- v-for="item in occupResholdOptions"
163
- :key="item.value"
164
- :label="item.label"
165
- :value="item.value">
166
- </el-option>
167
- </el-select>
166
+ <span class="detector-threshold-formtext">%</span>
168
167
  </el-form-item>
169
168
  <el-form-item
170
169
  :label="$t('openatccomponents.channelizationmap.saturationthreshold') + ':'"
171
170
  prop="count">
172
- <!-- <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
171
+ <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
173
172
  :value="flowsaturationthreshold" size="mini"
174
173
  @change="handleChangeFlowthreshold" />
175
- <span class="detector-threshold-formtext">%</span> -->
176
- <el-select :value="minflowsaturationthreshold" @change="handleChangeMinFlowthreshold">
177
- <el-option
178
- v-for="item in minflowResholdOptions"
179
- :key="item.value"
180
- :label="item.label"
181
- :value="item.value"
182
- :disabled="item.disabled">
183
- </el-option>
184
- </el-select>
185
- <span class="flow-separator">-</span>
186
- <el-select :value="maxflowsaturationthreshold" @change="handleChangeMaxFlowthreshold">
187
- <el-option
188
- v-for="item in maxflowResholdOptions"
189
- :key="item.value"
190
- :label="item.label"
191
- :value="item.value"
192
- :disabled="item.disabled">
193
- </el-option>
194
- </el-select>
174
+ <span class="detector-threshold-formtext">%</span>
195
175
  </el-form-item>
196
176
  </el-form>
197
177
  </div>
198
178
  </div>
199
- <div class="basic-coord" v-if="JSON.stringify(Data) !== '{}' && Data.icontype !== 'countdown' && Data.icontype !== 'crossmap'">
200
- <div class="tittle">{{$t('openatccomponents.channelizationmap.basicinfo')}}</div>
201
- <BasicCoordInfo :drawingObjInfo="Data" @handleChangeBasicCoord="handleChangeBasicCoord" />
202
- </div>
179
+
203
180
  <div class="delete-drawed-item" v-if="JSON.stringify(Data) !== '{}' && Data.detailtype !== 'detectorChart'">
204
- <el-button type="primary" @click="handledelete" v-if="Data.icontype !== 'crossmap'">{{$t('openatccomponents.channelizationmap.delete')}}</el-button>
205
- <el-button type="primary" @click="handleClone" v-if="Data.icontype !== 'countdown' && Data.icontype !== 'crossmap'">{{$t('openatccomponents.channelizationmap.clone')}}</el-button>
181
+ <el-button type="primary" @click="handledelete">{{$t('openatccomponents.channelizationmap.delete')}}</el-button>
206
182
  </div>
207
183
  </div>
208
184
  </template>
209
185
  <script>
186
+ import PhaseAssociatedComponentCheck from './phaseAssociatedComponent.check'
210
187
  import PhaseAssociatedComponent from './phaseAssociatedComponent.vue'
211
188
  import OverlapAssociatedComponent from './overlapAssociatedComponent'
212
189
  import DetectorAssociatedComponent from './detectorAssociatedComponent.vue'
213
- import BasicCoordInfo from './basicCoordInfo'
214
190
  export default {
215
191
  name: 'lane-edit-panel',
216
192
  components: {
217
193
  PhaseAssociatedComponent,
194
+ PhaseAssociatedComponentCheck,
218
195
  OverlapAssociatedComponent,
219
- DetectorAssociatedComponent,
220
- BasicCoordInfo
196
+ DetectorAssociatedComponent
221
197
  },
222
198
  data () {
223
199
  return {
@@ -397,12 +373,8 @@ export default {
397
373
  iconclass: 'custom-peddetector',
398
374
  name: this.$t('openatccomponents.channelizationmap.pedestriandetector')
399
375
  }],
400
- occupResholdOptions: [],
401
- minflowResholdOptions: [],
402
- maxflowResholdOptions: [],
403
376
  occupancythreshold: 80,
404
- minflowsaturationthreshold: 30,
405
- maxflowsaturationthreshold: 70
377
+ flowsaturationthreshold: 20
406
378
  }
407
379
  },
408
380
  watch: {
@@ -422,11 +394,8 @@ export default {
422
394
  if (data.occupancythreshold !== undefined) {
423
395
  this.occupancythreshold = data.occupancythreshold
424
396
  }
425
- if (data.minflowsaturationthreshold !== undefined) {
426
- this.minflowsaturationthreshold = data.minflowsaturationthreshold
427
- }
428
- if (data.maxflowsaturationthreshold !== undefined) {
429
- this.maxflowsaturationthreshold = data.maxflowsaturationthreshold
397
+ if (data.flowsaturationthreshold !== undefined) {
398
+ this.flowsaturationthreshold = data.flowsaturationthreshold
430
399
  }
431
400
  if (data.flip !== undefined) {
432
401
  this.flip = data.flip
@@ -456,6 +425,7 @@ export default {
456
425
  this.iconObj.icondireid.splice(index, 1)
457
426
  }
458
427
  this.$emit('handleChooseDire', this.iconObj)
428
+ // this.handleAssociatedPhase()
459
429
  },
460
430
  selectLanetype (id) {
461
431
  this.iconObj.controltype = id
@@ -477,9 +447,8 @@ export default {
477
447
  if (value === 2) {
478
448
  // 行人检测器没有阈值设置
479
449
  this.iconObj.occupancythreshold = undefined
480
- this.iconObj.minflowsaturationthreshold = undefined
481
- this.iconObj.maxflowsaturationthreshold = undefined
482
- this.$emit('changeIconDataByType', this.iconObj, ['occupancythreshold', 'minflowsaturationthreshold', 'maxflowsaturationthreshold'])
450
+ this.iconObj.flowsaturationthreshold = undefined
451
+ this.$emit('changeIconDataByType', this.iconObj, ['occupancythreshold', 'flowsaturationthreshold'])
483
452
  }
484
453
  },
485
454
  selectPedPos (value) {
@@ -492,6 +461,7 @@ export default {
492
461
  selectLanePos (value) {
493
462
  this.iconObj.lanePosition = value
494
463
  this.$emit('changeIconDataByType', this.iconObj, ['lanePosition'])
464
+ // this.handleAssociatedPhase()
495
465
  },
496
466
  selectPhase (phaseid, direction) {
497
467
  // 关联相位的同时,会修改相位方向
@@ -515,6 +485,12 @@ export default {
515
485
  handleDisassociatePhase (deletePhaseid) {
516
486
  this.$emit('handleDisassociatePhase', deletePhaseid)
517
487
  },
488
+ // handleAssociatedPhase () {
489
+ // // 如果已关联相位,再改变车道转向或者方位时,需要同步更新选中的关联相位
490
+ // if (this.iconObj.phaseid !== undefined) {
491
+ // this.$refs.phaseAssociated.changeDirection(this.iconObj)
492
+ // }
493
+ // },
518
494
  selectAssociatedDetector (detectorid) {
519
495
  // 仅关联检测器,不修改
520
496
  this.iconObj.detectorid = detectorid
@@ -530,53 +506,15 @@ export default {
530
506
  this.iconObj.occupancythreshold = occupancythreshold
531
507
  this.$emit('changeIconDataByType', this.iconObj, ['occupancythreshold'])
532
508
  },
533
- handleChangeMinFlowthreshold (minflowsaturationthreshold) {
534
- if (minflowsaturationthreshold === undefined) {
509
+ handleChangeFlowthreshold (flowsaturationthreshold) {
510
+ if (flowsaturationthreshold === undefined) {
535
511
  this.$message.error(this.$t('openatccomponents.channelizationmap.checkthreshold'))
536
- this.minflowsaturationthreshold = 30
512
+ this.flowsaturationthreshold = 20
537
513
  return
538
514
  }
539
- this.minflowsaturationthreshold = minflowsaturationthreshold
540
- this.iconObj.minflowsaturationthreshold = minflowsaturationthreshold
541
- this.$emit('changeIconDataByType', this.iconObj, ['minflowsaturationthreshold'])
542
- this.handleDisabledMaxflowOption()
543
- },
544
- handleDisabledMinflowOption () {
545
- // 此处需要排他,恢复上次置灰到默认值
546
- this.minflowResholdOptions = this.minflowResholdOptions.map(option => ({
547
- label: option.label,
548
- value: option.value
549
- }))
550
- // 控制流量饱和度最小阈值的禁用范围
551
- for (let i = 0; i < this.minflowResholdOptions.length; i++) {
552
- if (this.minflowResholdOptions[i].value >= this.maxflowsaturationthreshold) {
553
- this.minflowResholdOptions[i].disabled = true
554
- }
555
- }
556
- },
557
- handleChangeMaxFlowthreshold (maxflowsaturationthreshold) {
558
- if (maxflowsaturationthreshold === undefined) {
559
- this.$message.error(this.$t('openatccomponents.channelizationmap.checkthreshold'))
560
- this.maxflowsaturationthreshold = 70
561
- return
562
- }
563
- this.maxflowsaturationthreshold = maxflowsaturationthreshold
564
- this.iconObj.maxflowsaturationthreshold = maxflowsaturationthreshold
565
- this.$emit('changeIconDataByType', this.iconObj, ['maxflowsaturationthreshold'])
566
- this.handleDisabledMinflowOption()
567
- },
568
- handleDisabledMaxflowOption () {
569
- // 此处需要排他,恢复上次置灰到默认值
570
- this.maxflowResholdOptions = this.maxflowResholdOptions.map(option => ({
571
- label: option.label,
572
- value: option.value
573
- }))
574
- // 控制流量饱和度最大阈值的禁用范围
575
- for (let i = 0; i < this.maxflowResholdOptions.length; i++) {
576
- if (this.maxflowResholdOptions[i].value <= this.minflowsaturationthreshold) {
577
- this.maxflowResholdOptions[i].disabled = true
578
- }
579
- }
515
+ this.flowsaturationthreshold = flowsaturationthreshold
516
+ this.iconObj.flowsaturationthreshold = flowsaturationthreshold
517
+ this.$emit('changeIconDataByType', this.iconObj, ['flowsaturationthreshold'])
580
518
  },
581
519
  getCurPedPosList (iconpedtypeid) {
582
520
  // 方位根据行人类型显示
@@ -594,44 +532,8 @@ export default {
594
532
  handleChangeFilp (value) {
595
533
  this.iconObj.flip = value
596
534
  this.$emit('changeIconDataByType', this.iconObj, ['flip'])
597
- },
598
- createResholdSelectOptions () {
599
- for (let i = 5; i < 100; i = i + 5) {
600
- let option = {
601
- label: i + '%',
602
- value: i
603
- }
604
- this.occupResholdOptions.push(option)
605
- if (i <= this.minflowsaturationthreshold) {
606
- option.disabled = true
607
- }
608
- this.maxflowResholdOptions.push(option)
609
- }
610
- for (let i = 5; i < 100; i = i + 5) {
611
- let option = {
612
- label: i + '%',
613
- value: i
614
- }
615
- if (i >= this.maxflowsaturationthreshold) {
616
- option.disabled = true
617
- }
618
- this.minflowResholdOptions.push(option)
619
- }
620
- },
621
- handleChangeBasicCoord (basicCoord) {
622
- // 基础信息面板修改
623
- this.iconObj.x = basicCoord.x
624
- this.iconObj.y = basicCoord.y
625
- this.iconObj.angle = basicCoord.angle
626
- this.$emit('changeIconDataByType', this.iconObj, ['x', 'y', 'angle'])
627
- },
628
- handleClone () {
629
- this.$emit('cloneItem', this.iconObj)
630
535
  }
631
536
  },
632
- created () {
633
- this.createResholdSelectOptions()
634
- },
635
537
  mounted () {
636
538
  if (JSON.stringify(this.Data) === '{}') return
637
539
  this.iconObj = JSON.parse(JSON.stringify(this.Data))
@@ -647,11 +549,8 @@ export default {
647
549
  if (this.Data.occupancythreshold !== undefined) {
648
550
  this.occupancythreshold = this.Data.occupancythreshold
649
551
  }
650
- if (this.Data.minflowsaturationthreshold !== undefined) {
651
- this.minflowsaturationthreshold = this.Data.minflowsaturationthreshold
652
- }
653
- if (this.Data.maxflowsaturationthreshold !== undefined) {
654
- this.maxflowsaturationthreshold = this.Data.maxflowsaturationthreshold
552
+ if (this.Data.flowsaturationthreshold !== undefined) {
553
+ this.flowsaturationthreshold = this.Data.flowsaturationthreshold
655
554
  }
656
555
  if (this.Data.flip !== undefined) {
657
556
  this.flip = this.Data.flip
@@ -10,11 +10,10 @@
10
10
  * See the Mulan PSL v2 for more details.
11
11
  **/
12
12
  export default class Svgmethods {
13
- clickOpen (call, call2) {
13
+ clickOpen (call) {
14
14
  const file = document.getElementById('importimg').files[0]
15
15
  const filetype = file.type
16
16
  const reader = new FileReader()
17
- const reader2 = new FileReader()
18
17
  const filesize = file.size
19
18
  if (filetype !== 'image/svg+xml' && filetype !== 'image/png' && filetype !== 'image/jpeg') {
20
19
  call('error', 'type')
@@ -30,19 +29,6 @@ export default class Svgmethods {
30
29
  const content = readerEvent.target.result
31
30
  call('vectorgraph', content)
32
31
  })
33
- reader2.readAsDataURL(file)
34
- reader2.addEventListener('load', async (readerEvent) => {
35
- const imageSrc = readerEvent.target.result
36
- // 调用计算图片大小的方法
37
- calculateImageSize(imageSrc).then(function ({width, height}) {
38
- // 通过ES6的结构赋值来得到图片的宽和高
39
- let svgsize = {
40
- width,
41
- height
42
- }
43
- call2('vectorgraph', svgsize)
44
- })
45
- })
46
32
  }
47
33
  if (filetype === 'image/png' || filetype === 'image/jpeg') {
48
34
  reader.readAsDataURL(file)
@@ -51,37 +37,7 @@ export default class Svgmethods {
51
37
  const _base64 = reader.result
52
38
  const content = _base64
53
39
  call('picture', content)
54
- const imageSrc = readerEvent.target.result
55
- // 调用计算图片大小的方法
56
- calculateImageSize(imageSrc).then(function ({width, height}) {
57
- // 通过ES6的结构赋值来得到图片的宽和高
58
- let pngsize = {
59
- width,
60
- height
61
- }
62
- call2('picture', pngsize)
63
- })
64
40
  })
65
41
  }
66
42
  }
67
43
  }
68
-
69
- // 根据图片地址获取图片的宽和高
70
- const calculateImageSize = function (url) {
71
- return new Promise(function (resolve, reject) {
72
- const image = document.createElement('img')
73
- image.addEventListener('load', function (e) {
74
- resolve({
75
- width: e.target.width,
76
- height: e.target.height
77
- })
78
- })
79
-
80
- image.addEventListener('error', function () {
81
- console.log('error')
82
- })
83
-
84
- // 将图片的url地址添加到图片地址中
85
- image.src = url
86
- })
87
- }
@@ -180,7 +180,7 @@ export default {
180
180
  ls.minSplit = temp1 > temp2 ? temp1 : temp2
181
181
  if (ls.mode !== 7 && ls.value < ls.minSplit) {
182
182
  ls.value = ls.minSplit
183
- this.$message.error(this.$t('openatccomponents.pattern.splitCheckMsg'))
183
+ // this.$message.error(this.$t('openatccomponents.pattern.splitCheckMsg'))
184
184
  }
185
185
  }
186
186
  },
@@ -202,12 +202,12 @@ export default {
202
202
  }
203
203
  return maxCycle
204
204
  },
205
- doChange (val) {
206
- // if (val.mode === 7) {
207
- // val.value = 0
208
- // } else {
209
- // val.value = 30
210
- // }
205
+ doChange (e) {
206
+ if (e) {
207
+ let n = this.index
208
+ this.$emit('handleMode', n)
209
+ this.$forceUpdate()
210
+ }
211
211
  }
212
212
  }
213
213
  }
@@ -43,7 +43,7 @@
43
43
  <div class="first-1" :style="{'width':item.redWidth,'height':'34px','background':'#f27979'}"></div>
44
44
  </div>
45
45
  </div>
46
- <div v-for="(item, index) in barrierList" :key="index + '1'">
46
+ <div v-if="showBarrier" v-for="(item, index) in barrierList" :key="index + '1'">
47
47
  <div class="divider" :style="{'left':item, 'height':barrierHeight}"></div>
48
48
  </div>
49
49
  <div v-show="(syncTime && cycle && cycle>0) || (syncTime && newCycle && newCycle>0)">
@@ -123,6 +123,10 @@ export default {
123
123
  patternList: {
124
124
  type: Array
125
125
  },
126
+ showBarrier: {
127
+ type: Boolean,
128
+ default: false
129
+ },
126
130
  localPatternList: {
127
131
  type: Array
128
132
  },
@@ -162,10 +166,10 @@ export default {
162
166
  return res
163
167
  },
164
168
  timeNumDevide () {
165
- if (this.newCycle && this.newCycle > 0) {
166
- let res = (this.newCycle - this.syncTime) + '/' + this.newCycle
167
- return res
168
- }
169
+ // if (this.newCycle && this.newCycle > 0) {
170
+ // let res = (this.newCycle - this.syncTime) + '/' + this.newCycle
171
+ // return res
172
+ // }
169
173
  if (this.cycle && this.cycle > 0) {
170
174
  let res = (this.cycle - this.syncTime) + '/' + this.cycle
171
175
  return res
@@ -191,7 +195,7 @@ export default {
191
195
  this.getPedPhasePos()
192
196
  this.getBusPos()
193
197
  this.getStage()
194
- this.handlePatternData()
198
+ // this.handlePatternData()
195
199
  },
196
200
  // 深度观察监听
197
201
  deep: true
@@ -407,63 +411,174 @@ export default {
407
411
  this.newList = []
408
412
  if (Object.keys(this.controlData).length === 0 || this.phaseList.length === 0) return
409
413
  if (!this.controlData.phase) return
410
- let cycle = this.controlData.cycle
414
+ // let cycle = this.controlData.cycle
411
415
  if (!this.controlData.rings) return
416
+ let newValue = []
412
417
  for (let rings of this.controlData.rings) {
413
418
  let phase = this.controlData.phase
414
- let list = []
419
+ // let list = []
420
+ let obj = {}
421
+ for (let key in rings.sequence) {
422
+ obj[key] = rings.sequence[key]
423
+ }
424
+ let newObj = Object.keys(obj).map(val => ({
425
+ id: obj[val]
426
+ }))
427
+ newValue.push(newObj)
415
428
  for (let sequ of rings.sequence) {
416
429
  let obj = {}
417
430
  obj.id = sequ
418
431
  let split = phase.filter((item) => {
419
432
  return item.id === sequ
420
433
  })[0].split
434
+ newValue.map(d => {
435
+ d.map(r => {
436
+ if (r.id === sequ) {
437
+ r.value = split
438
+ }
439
+ })
440
+ })
441
+ // let currPhase = this.phaseList.filter((item) => {
442
+ // if (item.id === sequ && item.controltype === 99) {
443
+ // obj.controltype = item.controltype
444
+ // }
445
+ // return item.id === sequ
446
+ // })[0]
447
+ // if (currPhase) {
448
+ // obj.redWidth = (currPhase.redclear / cycle * 100).toFixed(3) + '%'
449
+ // obj.yellowWidth = (currPhase.yellow / cycle * 100).toFixed(3) + '%'
450
+ // obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / cycle * 100).toFixed(3) + '%'
451
+ // obj.flashgreen = (currPhase.flashgreen / cycle * 100).toFixed(3) + '%'
452
+ // // obj.peddirection = currPhase.peddirection
453
+ // let peddirections = []
454
+ // for (let walk of this.sidewalkPhaseData) {
455
+ // for (let ped of currPhase.peddirection) {
456
+ // // if (stg === walk.phaseid) {
457
+ // let objs = {}
458
+ // objs.name = walk.name
459
+ // objs.id = walk.id
460
+ // if (ped === walk.id) {
461
+ // peddirections.push(objs)
462
+ // peddirections = Array.from(new Set(peddirections))
463
+ // }
464
+ // // }
465
+ // }
466
+ // }
467
+ // obj.peddirection = peddirections
468
+ // obj.split = split
469
+ // obj.direction = currPhase.direction.map(item => {
470
+ // return {
471
+ // id: item,
472
+ // color: '#454545'
473
+ // }
474
+ // })
475
+ // list.push(obj)
476
+ // }
477
+ }
478
+ // this.newList.push(list)
479
+ // this.patternInfo = [...this.newList]
480
+ }
481
+ this.handleOverViewChange(newValue)
482
+ },
483
+ handleBarrierHeight () { // 屏障高度
484
+ if (!this.patternInfo) return
485
+ let patternLength = this.patternInfo.length
486
+ this.barrierHeight = (patternLength * 35 + 21) + 'px'
487
+ },
488
+ handleOverViewChange (val) {
489
+ if (val === null || val.length === 0) return
490
+ this.patternInfo = []
491
+ let currentArr = []
492
+ let newPattern = []
493
+ val.map(i => {
494
+ newPattern.push(...i)
495
+ })
496
+ if (this.phaseList.length === 0) return
497
+ for (let patternStatus of val[0]) {
498
+ if (patternStatus.mode !== 7) {
499
+ let concurrent = this.phaseList.filter((item) => {
500
+ return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
501
+ })[0].concurrent// 当前相位的并发相位
502
+ if (concurrent) {
503
+ let obj = {
504
+ id: patternStatus.id,
505
+ current: concurrent.sort()
506
+ }
507
+ currentArr.push(obj)
508
+ }
509
+ }
510
+ }
511
+ if (currentArr.length !== 0) {
512
+ let newCurrent = this.tranform(currentArr)
513
+ let ringTeam = this.step1(this.phaseList, newCurrent)
514
+ this.fillGap(ringTeam, val)
515
+ }
516
+ let cycle = this.controlData.cycle
517
+ for (let rings of val) {
518
+ if (rings.length === 0) continue
519
+ let list = []
520
+ for (let ring of rings) {
521
+ if (ring.value === 0) continue
522
+ let obj = {}
523
+ let split = ring.value
524
+ obj.id = ring.id
525
+ // obj.split = split
421
526
  let currPhase = this.phaseList.filter((item) => {
422
- if (item.id === sequ && item.controltype === 99) {
527
+ if (item.id === ring.id && item.controltype === 99) {
423
528
  obj.controltype = item.controltype
424
529
  }
425
- return item.id === sequ
530
+ return item.id === ring.id
426
531
  })[0]
427
- if (currPhase) {
428
- obj.redWidth = (currPhase.redclear / cycle * 100).toFixed(3) + '%'
429
- obj.yellowWidth = (currPhase.yellow / cycle * 100).toFixed(3) + '%'
430
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / cycle * 100).toFixed(3) + '%'
431
- obj.flashgreen = (currPhase.flashgreen / cycle * 100).toFixed(3) + '%'
432
- // obj.peddirection = currPhase.peddirection
433
- let peddirections = []
434
- for (let walk of this.sidewalkPhaseData) {
435
- for (let ped of currPhase.peddirection) {
436
- // if (stg === walk.phaseid) {
437
- let objs = {}
438
- objs.name = walk.name
439
- objs.id = walk.id
440
- if (ped === walk.id) {
441
- peddirections.push(objs)
442
- peddirections = Array.from(new Set(peddirections))
443
- }
444
- // }
532
+ if (ring.desc) {
533
+ obj.direction = ring.desc.map(item => { // 虚相位desc为空
534
+ return {
535
+ id: item.id,
536
+ color: '#454545'
445
537
  }
446
- }
447
- obj.peddirection = peddirections
448
- obj.split = split
538
+ })
539
+ } else {
449
540
  obj.direction = currPhase.direction.map(item => {
450
541
  return {
451
542
  id: item,
452
543
  color: '#454545'
453
544
  }
454
545
  })
546
+ }
547
+ if (ring.sum) {
548
+ obj.split = split
549
+ obj.redWidth = (currPhase.redclear + ring.sum / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
550
+ } else {
551
+ obj.split = split
552
+ obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
553
+ }
554
+ obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
555
+ obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
556
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
557
+ // obj.peddirection = currPhase.peddirection
558
+ let peddirections = []
559
+ for (let walk of this.sidewalkPhaseData) {
560
+ for (let ped of currPhase.peddirection) {
561
+ // if (stg === walk.phaseid) {
562
+ let objs = {}
563
+ objs.name = walk.name
564
+ objs.id = walk.id
565
+ if (ped === walk.id) {
566
+ peddirections.push(objs)
567
+ peddirections = Array.from(new Set(peddirections))
568
+ }
569
+ // }
570
+ }
571
+ }
572
+ obj.peddirection = peddirections
573
+ // 忽略相位不显示
574
+ let mode = ring.mode
575
+ if (mode !== 7) { // 忽略相位不显示
455
576
  list.push(obj)
456
577
  }
457
578
  }
458
- this.newList.push(list)
459
- this.patternInfo = [...this.newList]
579
+ this.patternInfo.push(list)
460
580
  }
461
581
  },
462
- handleBarrierHeight () { // 屏障高度
463
- if (!this.patternInfo) return
464
- let patternLength = this.patternInfo.length
465
- this.barrierHeight = (patternLength * 35 + 21) + 'px'
466
- },
467
582
  handleCurrentChange (val) { // 两个ring的数据
468
583
  if (val === null || val.length === 0) return
469
584
  this.patternInfo = []