openatc-components 0.1.3 → 0.1.4

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.
@@ -1,59 +1,43 @@
1
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
- **/
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
12
  <template>
13
13
  <div class="basic-coodinfo-component">
14
- <el-form
15
- :inline="true"
16
- :model="basicCoodInfo"
17
- label-position="left">
18
- <el-form-item
19
- label="X:"
20
- prop="intersection">
21
- <el-input-number :min="0" :controls="false"
22
- ref="refNumber-x"
23
- v-model="basicCoodInfo.x"
24
- @change="handleChangePosX"
25
- @input.native="eventChange('x')" />
26
- </el-form-item>
27
- <el-form-item
28
- label="Y:"
29
- prop="count">
30
- <el-input-number :min="0" :controls="false"
31
- ref="refNumber-y"
32
- v-model="basicCoodInfo.y"
33
- @change="handleChangePosY"
34
- @input.native="eventChange('y')" />
35
- </el-form-item>
36
- <el-form-item
37
- v-if="showAngle"
38
- :label="$t('openatccomponents.channelizationmap.angle') + ':'"
39
- prop="count">
40
- <el-input-number :min="0" :max="360" :controls="false"
41
- ref="refNumber-angle"
42
- v-model="basicCoodInfo.angle"
43
- @change="handleChangeAngle"
44
- @input.native="eventChange('angle')" />
45
- </el-form-item>
14
+ <el-form :inline="true" :model="basicCoodInfo" label-position="left">
15
+ <el-form-item label="X:">
16
+ <el-input-number :min="0" :controls="false" ref="refNumber-x" v-model="basicCoodInfo.x"
17
+ @change="handleChangePosX" @input.native="eventChange('x')" />
18
+ </el-form-item>
19
+ <el-form-item label="Y:">
20
+ <el-input-number :min="0" :controls="false" ref="refNumber-y" v-model="basicCoodInfo.y"
21
+ @change="handleChangePosY" @input.native="eventChange('y')" />
22
+ </el-form-item>
23
+ <el-form-item v-if="showAngle" :label="$t('openatccomponents.channelizationmap.angle') + ':'">
24
+ <el-input-number :min="0" :max="360" :controls="false" ref="refNumber-angle" v-model="basicCoodInfo.angle"
25
+ @change="handleChangeAngle" @input.native="eventChange('angle')" />
26
+ </el-form-item>
27
+ <el-form-item v-if="showKeyId" label="ID:">
28
+ <el-input v-model="basicCoodInfo.keyid" ref="keyid" @input="handleChangeKeyID" />
29
+ </el-form-item>
46
30
  </el-form>
47
31
  </div>
48
32
  </template>
49
33
  <script>
50
34
  export default {
51
35
  name: 'basic-coodinfo-component',
52
- components: {
53
- },
36
+ components: {},
54
37
  data () {
55
38
  return {
56
39
  showAngle: true,
40
+ showKeyId: true,
57
41
  basicCoodInfo: {
58
42
  x: 0,
59
43
  y: 0,
@@ -66,8 +50,7 @@ export default {
66
50
  type: Object
67
51
  }
68
52
  },
69
- computed: {
70
- },
53
+ computed: {},
71
54
  watch: {
72
55
  drawingObjInfo: {
73
56
  handler: function (obj) {
@@ -76,7 +59,11 @@ export default {
76
59
  y: obj.y,
77
60
  angle: obj.angle
78
61
  }
62
+ if (obj.keyid !== undefined) {
63
+ this.basicCoodInfo.keyid = obj.keyid
64
+ }
79
65
  this.isShowAngleSetting()
66
+ this.isShowKeyIdSetting()
80
67
  },
81
68
  deep: true
82
69
  }
@@ -111,6 +98,10 @@ export default {
111
98
  this.$emit('handleChangeBasicCoord', this.basicCoodInfo)
112
99
  }
113
100
  },
101
+ handleChangeKeyID (value) {
102
+ this.basicCoodInfo.keyid = value
103
+ this.$emit('handleChangeBasicCoord', this.basicCoodInfo)
104
+ },
114
105
  checkOnlyNum (numString) {
115
106
  // eslint-disable-next-line no-new-wrappers
116
107
  let num = new Number(numString)
@@ -140,6 +131,15 @@ export default {
140
131
  if (this.drawingObjInfo.icontype === 'detector' && this.drawingObjInfo.detailtype === 'detectorChart') {
141
132
  this.showAngle = false
142
133
  }
134
+ },
135
+ isShowKeyIdSetting () {
136
+ this.showKeyId = false
137
+ if (this.drawingObjInfo.icontype === 'vehile') {
138
+ this.showKeyId = true
139
+ }
140
+ if (this.drawingObjInfo.icontype === 'ped') {
141
+ this.showKeyId = true
142
+ }
143
143
  }
144
144
  },
145
145
  mounted () {
@@ -150,12 +150,16 @@ export default {
150
150
  y: this.drawingObjInfo.y,
151
151
  angle: this.drawingObjInfo.angle
152
152
  }
153
+ if (this.drawingObjInfo.keyid !== undefined) {
154
+ this.basicCoodInfo.keyid = this.drawingObjInfo.keyid
155
+ }
153
156
  this.isShowAngleSetting()
157
+ this.isShowKeyIdSetting()
154
158
  }
155
159
  },
156
- destroyed () {
157
- }
160
+ destroyed () {}
158
161
  }
162
+
159
163
  </script>
160
164
  <style lang="scss">
161
165
  </style>
@@ -343,7 +343,7 @@ export default {
343
343
  case 'crossmap':
344
344
  this.changeCrossMap(iconObj, changefield)
345
345
  }
346
- console.log('this.customlist', this.customlist)
346
+ // console.log('this.customlist', this.customlist)
347
347
  },
348
348
 
349
349
  // 被删除的相位所关联的车道,解除相位关联
@@ -394,6 +394,7 @@ export default {
394
394
  let Motorwaysitem = {
395
395
  index: this.index,
396
396
  id: this.motorid,
397
+ keyid: this.motorid, // 后端需要的id,默认指取索引,可修改
397
398
  icontype: 'vehile',
398
399
  icondireid: [1], // 前端区分箭头方向的标识
399
400
  icondirename: [this.PhaseDataModel.getPhase(1).name],
@@ -460,6 +461,7 @@ export default {
460
461
  let peditem = {
461
462
  index: this.index,
462
463
  id: this.pedid,
464
+ keyid: this.pedid, // 后端需要的id,默认指取索引,可修改
463
465
  icontype: 'ped',
464
466
  iconpedtypeid: 1,
465
467
  iconpedposition: 1,
@@ -542,6 +544,7 @@ export default {
542
544
  occupancythreshold: 80,
543
545
  minflowsaturationthreshold: 30,
544
546
  maxflowsaturationthreshold: 70,
547
+ associatedlaneid: '', // 检测器关联的车道索引
545
548
  ...defaultDetectorParam
546
549
  }
547
550
  this.curChooseIconIndex = detectoritem.index
@@ -151,8 +151,7 @@
151
151
  label-position="left"
152
152
  label-width="130px">
153
153
  <el-form-item
154
- :label="$t('openatccomponents.channelizationmap.occupancythreshold') + ':'"
155
- prop="intersection">
154
+ :label="$t('openatccomponents.channelizationmap.occupancythreshold') + ':'">
156
155
  <!-- <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
157
156
  :value="occupancythreshold" size="mini"
158
157
  @change="handleChangeOccuthreshold" />
@@ -167,8 +166,7 @@
167
166
  </el-select>
168
167
  </el-form-item>
169
168
  <el-form-item
170
- :label="$t('openatccomponents.channelizationmap.saturationthreshold') + ':'"
171
- prop="count">
169
+ :label="$t('openatccomponents.channelizationmap.saturationthreshold') + ':'">
172
170
  <!-- <el-input-number :min="0" :max="100" :precision="0" :step="1" :controls="false"
173
171
  :value="flowsaturationthreshold" size="mini"
174
172
  @change="handleChangeFlowthreshold" />
@@ -195,6 +193,17 @@
195
193
  </el-form-item>
196
194
  </el-form>
197
195
  </div>
196
+ <div class="detector-associated">
197
+ <div class="tittle">{{$t('openatccomponents.channelizationmap.laneassociated')}}</div>
198
+ <el-select filterable clearable :value="Data.associatedlaneid" @change="handleAssociatedLaneid">
199
+ <el-option
200
+ v-for="id in AssociatedLaneidOptions"
201
+ :key="'Laneid' + id"
202
+ :label="id"
203
+ :value="id">
204
+ </el-option>
205
+ </el-select>
206
+ </div>
198
207
  </div>
199
208
  <div class="basic-coord" v-if="JSON.stringify(Data) !== '{}' && Data.icontype !== 'countdown' && Data.icontype !== 'crossmap'">
200
209
  <div class="tittle">{{$t('openatccomponents.channelizationmap.basicinfo')}}</div>
@@ -402,7 +411,8 @@ export default {
402
411
  maxflowResholdOptions: [],
403
412
  occupancythreshold: 80,
404
413
  minflowsaturationthreshold: 30,
405
- maxflowsaturationthreshold: 70
414
+ maxflowsaturationthreshold: 70,
415
+ AssociatedLaneidOptions: []
406
416
  }
407
417
  },
408
418
  watch: {
@@ -428,11 +438,12 @@ export default {
428
438
  if (data.maxflowsaturationthreshold !== undefined) {
429
439
  this.maxflowsaturationthreshold = data.maxflowsaturationthreshold
430
440
  }
431
- this.handleDisabledMinflowOption(data.minflowsaturationthreshold)
432
- this.handleDisabledMaxflowOption(data.maxflowsaturationthreshold)
433
441
  if (data.flip !== undefined) {
434
442
  this.flip = data.flip
435
443
  }
444
+ if (this.Data.icontype === 'detector' && this.Data.detailtype === 'detector') {
445
+ this.handleDetectorSettings()
446
+ }
436
447
  this.getCurPedPosList(data.iconpedtypeid)
437
448
  },
438
449
  deep: true
@@ -626,9 +637,31 @@ export default {
626
637
  this.iconObj.y = basicCoord.y
627
638
  this.iconObj.angle = basicCoord.angle
628
639
  this.$emit('changeIconDataByType', this.iconObj, ['x', 'y', 'angle'])
640
+ if (basicCoord.keyid !== undefined) {
641
+ this.iconObj.keyid = basicCoord.keyid
642
+ this.$emit('changeIconDataByType', this.iconObj, ['keyid'])
643
+ }
629
644
  },
630
645
  handleClone () {
631
646
  this.$emit('cloneItem', this.iconObj)
647
+ },
648
+ handleDetectorSettings () {
649
+ this.handleDisabledMinflowOption()
650
+ this.handleDisabledMaxflowOption()
651
+ this.getAssociatedLaneidOptions()
652
+ },
653
+ handleAssociatedLaneid (value) {
654
+ // 检测器关联车道索引
655
+ this.iconObj.associatedlaneid = value
656
+ this.$emit('changeIconDataByType', this.iconObj, ['associatedlaneid'])
657
+ },
658
+ getAssociatedLaneidOptions () {
659
+ // 获取当前所有车道的id(即索引)
660
+ let ids = this.Motorways.map(ele => ele.id)
661
+ ids.sort(function (a, b) {
662
+ return a - b
663
+ })
664
+ this.AssociatedLaneidOptions = ids
632
665
  }
633
666
  },
634
667
  created () {
@@ -137,6 +137,12 @@
137
137
  <div class="name">{{$t('openatccomponents.overview.curStage')}}</div>
138
138
  </div>
139
139
  </el-col>
140
+ <el-col :span="8" v-if="controlData.current_phase !== undefined && controlData.current_phase.length !== 0 ">
141
+ <div class="grid-content bg-base">
142
+ <div class="value" v-html="controlData.current_phase.join(',')"></div>
143
+ <div class="name">{{$t('openatccomponents.overview.curPhase')}}</div>
144
+ </div>
145
+ </el-col>
140
146
  </el-row>
141
147
  </div>
142
148
  </div>