openatc-components 0.0.102 → 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.
- package/package/kisscomps/components/BoardCard/BoardCard.vue +6 -1
- package/package/kisscomps/components/Channelization/Channelization.vue +13 -10
- package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +18 -12
- package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +54 -69
- package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +1 -4
- package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +11 -34
- package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +1 -26
- package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +18 -37
- package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +6 -0
- package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +28 -50
- package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +29 -53
- package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +1 -4
- package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +147 -130
- package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +5 -6
- package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +43 -144
- package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +8 -52
- package/package/kisscomps/components/KanBan/kanban.vue +7 -7
- package/package/kisscomps/components/PatternStatus/PatternStatus.vue +153 -38
- package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +16 -0
- package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +190 -0
- package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -0
- package/package/kisscomps/components/StageStatus/StageStatus.vue +6 -2
- package/package/kisscomps/components/patternList/patternList.vue +5 -0
- package/package/kisscomps/index.js +2 -0
- package/package/kissui.min.js +1 -1
- package/package.json +13 -12
- package/src/i18n/language/en.js +32 -7
- package/src/i18n/language/zh.js +31 -6
- package/src/kisscomps/components/BoardCard/BoardCard.vue +6 -1
- package/src/kisscomps/components/Channelization/Channelization.vue +13 -10
- package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +18 -12
- package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +54 -69
- package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +1 -4
- package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +11 -34
- package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +1 -26
- package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +18 -37
- package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +6 -0
- package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +28 -50
- package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +29 -53
- package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +1 -4
- package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +147 -130
- package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +5 -6
- package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +43 -144
- package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue +191 -0
- package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.syncOper.vue +331 -0
- package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +8 -52
- package/src/kisscomps/components/KanBan/kanban.vue +7 -7
- package/src/kisscomps/components/PatternStatus/PatternStatus.vue +153 -38
- package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +16 -0
- package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +190 -0
- package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -0
- package/src/kisscomps/components/StageStatus/StageStatus.vue +6 -2
- package/src/kisscomps/components/patternList/patternList.vue +5 -0
- package/src/kisscomps/index.js +2 -0
- package/src/router/index.js +2 -2
- package/src/views/intersection.vue +5 -3
- package/static/styles/channelizatioon.scss +2 -40
- package/static/styles/schemeconfig.scss +52 -0
- package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +0 -113
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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"
|
|
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
|
-
|
|
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.
|
|
426
|
-
this.
|
|
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.
|
|
481
|
-
this.iconObj
|
|
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
|
-
|
|
534
|
-
if (
|
|
509
|
+
handleChangeFlowthreshold (flowsaturationthreshold) {
|
|
510
|
+
if (flowsaturationthreshold === undefined) {
|
|
535
511
|
this.$message.error(this.$t('openatccomponents.channelizationmap.checkthreshold'))
|
|
536
|
-
this.
|
|
512
|
+
this.flowsaturationthreshold = 20
|
|
537
513
|
return
|
|
538
514
|
}
|
|
539
|
-
this.
|
|
540
|
-
this.iconObj.
|
|
541
|
-
this.$emit('changeIconDataByType', this.iconObj, ['
|
|
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.
|
|
651
|
-
this.
|
|
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
|
package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.check.vue
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020 kedacom
|
|
3
|
+
* OpenATC is licensed under Mulan PSL v2.
|
|
4
|
+
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
5
|
+
* You may obtain a copy of Mulan PSL v2 at:
|
|
6
|
+
* http://license.coscl.org.cn/MulanPSL2
|
|
7
|
+
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
|
8
|
+
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
|
9
|
+
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
10
|
+
* See the Mulan PSL v2 for more details.
|
|
11
|
+
**/
|
|
12
|
+
<template>
|
|
13
|
+
<div class="phase-associated-component">
|
|
14
|
+
<div class="phase-box" v-for="(item, index) in assophaseList" :key="index">
|
|
15
|
+
<div class="single-phase" :class="preselectPhase == item.id ? 'single-phase-select' : ''">
|
|
16
|
+
<!-- <div class="ped-icon">
|
|
17
|
+
<div v-for="(side, index) in item.peddirection" :key="'peddir-' + index">
|
|
18
|
+
<PatternWalkSvg :Data="getshowped(side)" Width="42" Height="44" />
|
|
19
|
+
</div>
|
|
20
|
+
</div> -->
|
|
21
|
+
|
|
22
|
+
<div class="phase-icon" @click="selectPhase(index, item)" v-if="item.direction">
|
|
23
|
+
<xdr-dir-selector Width="44px" Height="44px" :showlist="getShowlist(item.direction)" :roadDirection="roadDirection"></xdr-dir-selector>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="delete-phase-icon" @click="handleDeletePhase(index, item)">
|
|
26
|
+
<i class="el-icon-close"></i>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="single-phase-name">{{$t('openatccomponents.channelizationmap.phase') + item.id}}</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="phase-box">
|
|
32
|
+
<div class="single-phase add-phase" @click="handleAddPhase()">
|
|
33
|
+
<i class="iconfont icon-fangda" :class="{'add-disabled': !isCanAdd}"></i>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
<script>
|
|
39
|
+
import { mapState } from 'vuex'
|
|
40
|
+
import PhaseDataModel from '../../IntersectionMap/crossDirection/utils.js'
|
|
41
|
+
export default {
|
|
42
|
+
name: 'phase-associated-component',
|
|
43
|
+
data () {
|
|
44
|
+
return {
|
|
45
|
+
assophaseList: [], // 渠化界面的相位列表
|
|
46
|
+
preselectPhase: -1,
|
|
47
|
+
id: 1,
|
|
48
|
+
isCanAdd: true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
editData: {
|
|
53
|
+
type: Object
|
|
54
|
+
},
|
|
55
|
+
Motorways: {
|
|
56
|
+
type: Array
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
computed: {
|
|
60
|
+
...mapState({
|
|
61
|
+
associatedphaselist: state => state.globalParam.associatedPhaseList,
|
|
62
|
+
roadDirection: state => state.globalParam.roadDirection,
|
|
63
|
+
PhaseDataMgr: state => state.globalParam.PhaseDataMgr
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
watch: {
|
|
67
|
+
associatedphaselist: {
|
|
68
|
+
handler: function (list) {
|
|
69
|
+
this.assophaseList = JSON.parse(JSON.stringify(list))
|
|
70
|
+
},
|
|
71
|
+
deep: true
|
|
72
|
+
},
|
|
73
|
+
assophaseList: {
|
|
74
|
+
handler: function (list) {
|
|
75
|
+
if (list.length >= 40) {
|
|
76
|
+
this.isCanAdd = false
|
|
77
|
+
} else {
|
|
78
|
+
this.isCanAdd = true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
deep: true
|
|
82
|
+
},
|
|
83
|
+
editData: {
|
|
84
|
+
handler: function (editobj) {
|
|
85
|
+
if (editobj.phaseid !== undefined) {
|
|
86
|
+
this.preselectPhase = editobj.phaseid
|
|
87
|
+
} else {
|
|
88
|
+
this.preselectPhase = -1
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
deep: true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
methods: {
|
|
95
|
+
selectPhase (index, item) {
|
|
96
|
+
let direction = this.PhaseDataMgr.editDirPosToPhaseDireaciton(this.editData.icondireid, this.editData.lanePosition)
|
|
97
|
+
// 校验同方位车道不能关联不同相位
|
|
98
|
+
if (this.PhaseDataMgr.checkSameDirectionPhase(direction, item.id, this.editData.phaseid, this.Motorways, this.editData) === false) {
|
|
99
|
+
this.$message.error(this.$t('openatccomponents.channelizationmap.associatedphaseerror'))
|
|
100
|
+
return
|
|
101
|
+
}
|
|
102
|
+
// 关联相位
|
|
103
|
+
this.preselectPhase = item.id
|
|
104
|
+
let alldirection = direction
|
|
105
|
+
this.$emit('selectPhase', this.preselectPhase, alldirection)
|
|
106
|
+
},
|
|
107
|
+
changeDirection (choosedicon) {
|
|
108
|
+
for (let i = 0; i < this.assophaseList.length; i++) {
|
|
109
|
+
if (this.assophaseList[i].id === choosedicon.phaseid) {
|
|
110
|
+
let direction = this.PhaseDataMgr.editDirPosToPhaseDireaciton(choosedicon.icondireid, choosedicon.lanePosition, this.preselectPhase)
|
|
111
|
+
// 校验同方位车道不能关联不同相位
|
|
112
|
+
if (this.PhaseDataMgr.checkSameDirectionPhase(direction, choosedicon.phaseid) === false) {
|
|
113
|
+
this.$message.error(this.$t('openatccomponents.channelizationmap.associatedphaseerror'))
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
let alldirection = direction
|
|
117
|
+
this.$emit('selectPhase', this.preselectPhase, alldirection)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
getShowlist (direction) {
|
|
122
|
+
return direction.map(dir => {
|
|
123
|
+
return {
|
|
124
|
+
id: dir,
|
|
125
|
+
color: '#606266'
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
},
|
|
129
|
+
getshowped (peddirection) {
|
|
130
|
+
return {
|
|
131
|
+
id: peddirection,
|
|
132
|
+
name: this.PhaseDataModel.getSidePos(peddirection).name
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
handleDeletePhase (index, row) {
|
|
136
|
+
// 更新模型内初始相位列表数据
|
|
137
|
+
this.PhaseDataMgr.deleteOriginPhase(index)
|
|
138
|
+
// 删除关联此相位的所有车道相位id
|
|
139
|
+
this.handleDisassociatePhase(row.id)
|
|
140
|
+
if (row.id === this.preselectPhase) {
|
|
141
|
+
this.preselectPhase = -1
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
handleDisassociatePhase (deletePhaseid) {
|
|
145
|
+
// 删除相位后,解除相位关联
|
|
146
|
+
this.$emit('handleDisassociatePhase', deletePhaseid)
|
|
147
|
+
},
|
|
148
|
+
handleAddPhase () {
|
|
149
|
+
if (this.assophaseList.length >= 40) {
|
|
150
|
+
this.$message.error(
|
|
151
|
+
this.$t('openatccomponents.phase.mostdata')
|
|
152
|
+
)
|
|
153
|
+
return
|
|
154
|
+
}
|
|
155
|
+
// 更新模型内初始相位列表数据
|
|
156
|
+
this.PhaseDataMgr.addOriginPhase()
|
|
157
|
+
},
|
|
158
|
+
getPedPhasePos () {
|
|
159
|
+
// 行人相位信息
|
|
160
|
+
this.sidewalkPhaseData = []
|
|
161
|
+
this.assophaseList.forEach((ele, i) => {
|
|
162
|
+
if (ele.peddirection) {
|
|
163
|
+
ele.peddirection.forEach((dir, index) => {
|
|
164
|
+
// 行人相位
|
|
165
|
+
if (this.PhaseDataModel.getSidePos(dir)) {
|
|
166
|
+
this.sidewalkPhaseData.push({
|
|
167
|
+
key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
|
|
168
|
+
phaseid: ele.id, // 相位id,用于对应相位状态
|
|
169
|
+
id: dir,
|
|
170
|
+
name: this.PhaseDataModel.getSidePos(dir).name
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
})
|
|
176
|
+
return this.sidewalkPhaseData
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
created () {
|
|
180
|
+
this.globalParamModel = this.$store.getters.globalParamModel
|
|
181
|
+
this.PhaseDataModel = new PhaseDataModel()
|
|
182
|
+
},
|
|
183
|
+
mounted () {
|
|
184
|
+
this.assophaseList = JSON.parse(JSON.stringify(this.associatedphaselist))
|
|
185
|
+
},
|
|
186
|
+
destroyed () {
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
</script>
|
|
190
|
+
<style lang="scss">
|
|
191
|
+
</style>
|