openatc-components 0.0.99 → 0.0.102

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 (59) hide show
  1. package/package/kisscomps/components/BoardCard/BoardCard.vue +1 -6
  2. package/package/kisscomps/components/Channelization/Channelization.vue +10 -13
  3. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +113 -0
  4. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +12 -18
  5. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +69 -54
  6. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +4 -1
  7. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +34 -11
  8. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +26 -1
  9. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +37 -18
  10. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +0 -6
  11. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +50 -28
  12. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +53 -29
  13. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +4 -1
  14. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +130 -147
  15. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +6 -5
  16. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +144 -43
  17. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +52 -8
  18. package/package/kisscomps/components/KanBan/kanban.vue +6 -6
  19. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +38 -153
  20. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +0 -16
  21. package/package/kisscomps/components/StageStatus/StageStatus.vue +2 -6
  22. package/package/kisscomps/components/patternList/patternList.vue +0 -5
  23. package/package/kisscomps/index.js +0 -2
  24. package/package/kissui.min.js +1 -1
  25. package/package.json +12 -13
  26. package/src/i18n/language/en.js +7 -32
  27. package/src/i18n/language/zh.js +6 -31
  28. package/src/kisscomps/components/BoardCard/BoardCard.vue +1 -6
  29. package/src/kisscomps/components/Channelization/Channelization.vue +10 -13
  30. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +113 -0
  31. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +12 -18
  32. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +69 -54
  33. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +4 -1
  34. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +34 -11
  35. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +26 -1
  36. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +37 -18
  37. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +0 -6
  38. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +50 -28
  39. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +53 -29
  40. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +4 -1
  41. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +130 -147
  42. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +6 -5
  43. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +144 -43
  44. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +52 -8
  45. package/src/kisscomps/components/KanBan/kanban.vue +6 -6
  46. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +38 -153
  47. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +0 -16
  48. package/src/kisscomps/components/StageStatus/StageStatus.vue +2 -6
  49. package/src/kisscomps/components/patternList/patternList.vue +0 -5
  50. package/src/kisscomps/index.js +0 -2
  51. package/src/router/index.js +2 -2
  52. package/static/styles/channelizatioon.scss +40 -2
  53. package/static/styles/schemeconfig.scss +0 -52
  54. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +0 -190
  55. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +0 -163
  56. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +0 -191
  57. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +0 -331
  58. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +0 -190
  59. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +0 -163
@@ -64,13 +64,6 @@
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" /> -->
74
67
  <!-- 相位仅可以关联选择,不可修改 -->
75
68
  <PhaseAssociatedComponent
76
69
  :editData="Data"
@@ -115,12 +108,6 @@
115
108
  </div>
116
109
  <div class="phase-associated">
117
110
  <div class="tittle">{{$t('openatccomponents.channelizationmap.phaseassociated')}}</div>
118
- <!-- 相位可以编辑,增加,删除,校验 -->
119
- <!-- <PhaseAssociatedComponentCheck
120
- ref="phaseAssociated"
121
- :editData="Data"
122
- @selectPhase="selectPhase"
123
- @handleDisassociatePhase="handleDisassociatePhase" /> -->
124
111
  <!-- 相位仅可以关联选择,不可修改 -->
125
112
  <PhaseAssociatedComponent
126
113
  :editData="Data"
@@ -135,6 +122,12 @@
135
122
 
136
123
  <!-- 检测器编辑面板 -->
137
124
  <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>
138
131
  <div class="detector-type">
139
132
  <div class="tittle">{{$t('openatccomponents.channelizationmap.detectortype')}}</div>
140
133
  <div class="each-icon" v-for="(item, index) in detectortypeList" :key="index">
@@ -160,40 +153,71 @@
160
153
  <el-form-item
161
154
  :label="$t('openatccomponents.channelizationmap.occupancythreshold') + ':'"
162
155
  prop="intersection">
163
- <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
156
+ <!-- <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
164
157
  :value="occupancythreshold" size="mini"
165
158
  @change="handleChangeOccuthreshold" />
166
- <span class="detector-threshold-formtext">%</span>
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>
167
168
  </el-form-item>
168
169
  <el-form-item
169
170
  :label="$t('openatccomponents.channelizationmap.saturationthreshold') + ':'"
170
171
  prop="count">
171
- <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
172
+ <!-- <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
172
173
  :value="flowsaturationthreshold" size="mini"
173
174
  @change="handleChangeFlowthreshold" />
174
- <span class="detector-threshold-formtext">%</span>
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>
175
195
  </el-form-item>
176
196
  </el-form>
177
197
  </div>
178
198
  </div>
179
-
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>
180
203
  <div class="delete-drawed-item" v-if="JSON.stringify(Data) !== '{}' && Data.detailtype !== 'detectorChart'">
181
- <el-button type="primary" @click="handledelete">{{$t('openatccomponents.channelizationmap.delete')}}</el-button>
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>
182
206
  </div>
183
207
  </div>
184
208
  </template>
185
209
  <script>
186
- import PhaseAssociatedComponentCheck from './phaseAssociatedComponent.check'
187
210
  import PhaseAssociatedComponent from './phaseAssociatedComponent.vue'
188
211
  import OverlapAssociatedComponent from './overlapAssociatedComponent'
189
212
  import DetectorAssociatedComponent from './detectorAssociatedComponent.vue'
213
+ import BasicCoordInfo from './basicCoordInfo'
190
214
  export default {
191
215
  name: 'lane-edit-panel',
192
216
  components: {
193
217
  PhaseAssociatedComponent,
194
- PhaseAssociatedComponentCheck,
195
218
  OverlapAssociatedComponent,
196
- DetectorAssociatedComponent
219
+ DetectorAssociatedComponent,
220
+ BasicCoordInfo
197
221
  },
198
222
  data () {
199
223
  return {
@@ -373,8 +397,12 @@ export default {
373
397
  iconclass: 'custom-peddetector',
374
398
  name: this.$t('openatccomponents.channelizationmap.pedestriandetector')
375
399
  }],
400
+ occupResholdOptions: [],
401
+ minflowResholdOptions: [],
402
+ maxflowResholdOptions: [],
376
403
  occupancythreshold: 80,
377
- flowsaturationthreshold: 20
404
+ minflowsaturationthreshold: 30,
405
+ maxflowsaturationthreshold: 70
378
406
  }
379
407
  },
380
408
  watch: {
@@ -394,8 +422,11 @@ export default {
394
422
  if (data.occupancythreshold !== undefined) {
395
423
  this.occupancythreshold = data.occupancythreshold
396
424
  }
397
- if (data.flowsaturationthreshold !== undefined) {
398
- this.flowsaturationthreshold = data.flowsaturationthreshold
425
+ if (data.minflowsaturationthreshold !== undefined) {
426
+ this.minflowsaturationthreshold = data.minflowsaturationthreshold
427
+ }
428
+ if (data.maxflowsaturationthreshold !== undefined) {
429
+ this.maxflowsaturationthreshold = data.maxflowsaturationthreshold
399
430
  }
400
431
  if (data.flip !== undefined) {
401
432
  this.flip = data.flip
@@ -425,7 +456,6 @@ export default {
425
456
  this.iconObj.icondireid.splice(index, 1)
426
457
  }
427
458
  this.$emit('handleChooseDire', this.iconObj)
428
- // this.handleAssociatedPhase()
429
459
  },
430
460
  selectLanetype (id) {
431
461
  this.iconObj.controltype = id
@@ -447,8 +477,9 @@ export default {
447
477
  if (value === 2) {
448
478
  // 行人检测器没有阈值设置
449
479
  this.iconObj.occupancythreshold = undefined
450
- this.iconObj.flowsaturationthreshold = undefined
451
- this.$emit('changeIconDataByType', this.iconObj, ['occupancythreshold', 'flowsaturationthreshold'])
480
+ this.iconObj.minflowsaturationthreshold = undefined
481
+ this.iconObj.maxflowsaturationthreshold = undefined
482
+ this.$emit('changeIconDataByType', this.iconObj, ['occupancythreshold', 'minflowsaturationthreshold', 'maxflowsaturationthreshold'])
452
483
  }
453
484
  },
454
485
  selectPedPos (value) {
@@ -461,7 +492,6 @@ export default {
461
492
  selectLanePos (value) {
462
493
  this.iconObj.lanePosition = value
463
494
  this.$emit('changeIconDataByType', this.iconObj, ['lanePosition'])
464
- // this.handleAssociatedPhase()
465
495
  },
466
496
  selectPhase (phaseid, direction) {
467
497
  // 关联相位的同时,会修改相位方向
@@ -485,12 +515,6 @@ export default {
485
515
  handleDisassociatePhase (deletePhaseid) {
486
516
  this.$emit('handleDisassociatePhase', deletePhaseid)
487
517
  },
488
- // handleAssociatedPhase () {
489
- // // 如果已关联相位,再改变车道转向或者方位时,需要同步更新选中的关联相位
490
- // if (this.iconObj.phaseid !== undefined) {
491
- // this.$refs.phaseAssociated.changeDirection(this.iconObj)
492
- // }
493
- // },
494
518
  selectAssociatedDetector (detectorid) {
495
519
  // 仅关联检测器,不修改
496
520
  this.iconObj.detectorid = detectorid
@@ -506,15 +530,53 @@ export default {
506
530
  this.iconObj.occupancythreshold = occupancythreshold
507
531
  this.$emit('changeIconDataByType', this.iconObj, ['occupancythreshold'])
508
532
  },
509
- handleChangeFlowthreshold (flowsaturationthreshold) {
510
- if (flowsaturationthreshold === undefined) {
533
+ handleChangeMinFlowthreshold (minflowsaturationthreshold) {
534
+ if (minflowsaturationthreshold === undefined) {
511
535
  this.$message.error(this.$t('openatccomponents.channelizationmap.checkthreshold'))
512
- this.flowsaturationthreshold = 20
536
+ this.minflowsaturationthreshold = 30
513
537
  return
514
538
  }
515
- this.flowsaturationthreshold = flowsaturationthreshold
516
- this.iconObj.flowsaturationthreshold = flowsaturationthreshold
517
- this.$emit('changeIconDataByType', this.iconObj, ['flowsaturationthreshold'])
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
+ }
518
580
  },
519
581
  getCurPedPosList (iconpedtypeid) {
520
582
  // 方位根据行人类型显示
@@ -532,8 +594,44 @@ export default {
532
594
  handleChangeFilp (value) {
533
595
  this.iconObj.flip = value
534
596
  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)
535
630
  }
536
631
  },
632
+ created () {
633
+ this.createResholdSelectOptions()
634
+ },
537
635
  mounted () {
538
636
  if (JSON.stringify(this.Data) === '{}') return
539
637
  this.iconObj = JSON.parse(JSON.stringify(this.Data))
@@ -549,8 +647,11 @@ export default {
549
647
  if (this.Data.occupancythreshold !== undefined) {
550
648
  this.occupancythreshold = this.Data.occupancythreshold
551
649
  }
552
- if (this.Data.flowsaturationthreshold !== undefined) {
553
- this.flowsaturationthreshold = this.Data.flowsaturationthreshold
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
554
655
  }
555
656
  if (this.Data.flip !== undefined) {
556
657
  this.flip = this.Data.flip
@@ -10,10 +10,11 @@
10
10
  * See the Mulan PSL v2 for more details.
11
11
  **/
12
12
  export default class Svgmethods {
13
- clickOpen (call) {
13
+ clickOpen (call, call2) {
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()
17
18
  const filesize = file.size
18
19
  if (filetype !== 'image/svg+xml' && filetype !== 'image/png' && filetype !== 'image/jpeg') {
19
20
  call('error', 'type')
@@ -24,20 +25,63 @@ export default class Svgmethods {
24
25
  return
25
26
  }
26
27
  if (filetype === 'image/svg+xml') {
27
- reader.readAsText(file, 'UTF-8')
28
- reader.addEventListener('load', async (readerEvent) => {
29
- const content = readerEvent.target.result
30
- call('vectorgraph', content)
28
+ reader2.readAsDataURL(file)
29
+ reader2.addEventListener('load', async (readerEvent) => {
30
+ const imageSrc = readerEvent.target.result
31
+ // 调用计算图片大小的方法
32
+ calculateImageSize(imageSrc).then(function ({width, height}) {
33
+ // 通过ES6的结构赋值来得到图片的宽和高
34
+ let svgsize = {
35
+ width,
36
+ height
37
+ }
38
+ call2('vectorgraph', svgsize)
39
+ reader.readAsText(file, 'UTF-8')
40
+ reader.addEventListener('load', async (readerEvent) => {
41
+ const content = readerEvent.target.result
42
+ call('vectorgraph', content)
43
+ })
44
+ })
31
45
  })
32
46
  }
33
47
  if (filetype === 'image/png' || filetype === 'image/jpeg') {
34
48
  reader.readAsDataURL(file)
35
49
  reader.addEventListener('load', async (readerEvent) => {
36
50
  // 图片的 base64 格式, 可以直接当成 img 的 src 属性值
37
- const _base64 = reader.result
38
- const content = _base64
39
- call('picture', content)
51
+ const imageSrc = readerEvent.target.result
52
+ // 调用计算图片大小的方法
53
+ calculateImageSize(imageSrc).then(function ({width, height}) {
54
+ // 通过ES6的结构赋值来得到图片的宽和高
55
+ let pngsize = {
56
+ width,
57
+ height
58
+ }
59
+ call2('picture', pngsize)
60
+ const _base64 = reader.result
61
+ const content = _base64
62
+ call('picture', content)
63
+ })
40
64
  })
41
65
  }
42
66
  }
43
67
  }
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
+ }
@@ -202,12 +202,12 @@ export default {
202
202
  }
203
203
  return maxCycle
204
204
  },
205
- doChange (e) {
206
- if (e) {
207
- let n = this.index
208
- this.$emit('handleSplit', n)
209
- this.$forceUpdate()
210
- }
205
+ doChange (val) {
206
+ // if (val.mode === 7) {
207
+ // val.value = 0
208
+ // } else {
209
+ // val.value = 30
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-if="showBarrier" v-for="(item, index) in barrierList" :key="index + '1'">
46
+ <div 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,10 +123,6 @@ export default {
123
123
  patternList: {
124
124
  type: Array
125
125
  },
126
- showBarrier: {
127
- type: Boolean,
128
- default: false
129
- },
130
126
  localPatternList: {
131
127
  type: Array
132
128
  },
@@ -166,10 +162,10 @@ export default {
166
162
  return res
167
163
  },
168
164
  timeNumDevide () {
169
- // if (this.newCycle && this.newCycle > 0) {
170
- // let res = (this.newCycle - this.syncTime) + '/' + this.newCycle
171
- // return res
172
- // }
165
+ if (this.newCycle && this.newCycle > 0) {
166
+ let res = (this.newCycle - this.syncTime) + '/' + this.newCycle
167
+ return res
168
+ }
173
169
  if (this.cycle && this.cycle > 0) {
174
170
  let res = (this.cycle - this.syncTime) + '/' + this.cycle
175
171
  return res
@@ -195,7 +191,7 @@ export default {
195
191
  this.getPedPhasePos()
196
192
  this.getBusPos()
197
193
  this.getStage()
198
- // this.handlePatternData()
194
+ this.handlePatternData()
199
195
  },
200
196
  // 深度观察监听
201
197
  deep: true
@@ -411,174 +407,63 @@ export default {
411
407
  this.newList = []
412
408
  if (Object.keys(this.controlData).length === 0 || this.phaseList.length === 0) return
413
409
  if (!this.controlData.phase) return
414
- // let cycle = this.controlData.cycle
410
+ let cycle = this.controlData.cycle
415
411
  if (!this.controlData.rings) return
416
- let newValue = []
417
412
  for (let rings of this.controlData.rings) {
418
413
  let phase = this.controlData.phase
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)
414
+ let list = []
428
415
  for (let sequ of rings.sequence) {
429
416
  let obj = {}
430
417
  obj.id = sequ
431
418
  let split = phase.filter((item) => {
432
419
  return item.id === sequ
433
420
  })[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
526
421
  let currPhase = this.phaseList.filter((item) => {
527
- if (item.id === ring.id && item.controltype === 99) {
422
+ if (item.id === sequ && item.controltype === 99) {
528
423
  obj.controltype = item.controltype
529
424
  }
530
- return item.id === ring.id
425
+ return item.id === sequ
531
426
  })[0]
532
- if (ring.desc) {
533
- obj.direction = ring.desc.map(item => { // 虚相位desc为空
534
- return {
535
- id: item.id,
536
- color: '#454545'
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
+ // }
537
445
  }
538
- })
539
- } else {
446
+ }
447
+ obj.peddirection = peddirections
448
+ obj.split = split
540
449
  obj.direction = currPhase.direction.map(item => {
541
450
  return {
542
451
  id: item,
543
452
  color: '#454545'
544
453
  }
545
454
  })
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) { // 忽略相位不显示
576
455
  list.push(obj)
577
456
  }
578
457
  }
579
- this.patternInfo.push(list)
458
+ this.newList.push(list)
459
+ this.patternInfo = [...this.newList]
580
460
  }
581
461
  },
462
+ handleBarrierHeight () { // 屏障高度
463
+ if (!this.patternInfo) return
464
+ let patternLength = this.patternInfo.length
465
+ this.barrierHeight = (patternLength * 35 + 21) + 'px'
466
+ },
582
467
  handleCurrentChange (val) { // 两个ring的数据
583
468
  if (val === null || val.length === 0) return
584
469
  this.patternInfo = []