openatc-components 0.0.54 → 0.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openatc-components",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -21,6 +21,7 @@
21
21
  :controlData="controlData"
22
22
  :modelList="modelList"
23
23
  :patternSelect="patternSelect"
24
+ :patternAll="patternAll"
24
25
  :crossStatusData="crossStatusData"
25
26
  :phaseList="phaseList"
26
27
  :specialcontrolList="specialcontrolList"
@@ -117,6 +118,7 @@ import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
117
118
  import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
118
119
  import { setToken } from '../../../utils/auth.js'
119
120
  import RingDataModel from '../../../utils/RingDataModel.js'
121
+ import { getIntersectionInfo } from '../../../api/template'
120
122
  export default {
121
123
  name: 'scheme-config',
122
124
  components: {
@@ -150,9 +152,6 @@ export default {
150
152
  ip: {
151
153
  type: String
152
154
  },
153
- patternSelect: {
154
- type: Array
155
- },
156
155
  planPattern: {
157
156
  type: Object
158
157
  },
@@ -293,6 +292,8 @@ export default {
293
292
  confirmedFault: [],
294
293
  ignoredFault: [],
295
294
  untreatedFault: [],
295
+ patternAll: [],
296
+ patternSelect: [], // 所有方案id
296
297
  specialPage: '' // 哪一个特殊控制页面
297
298
  }
298
299
  },
@@ -330,6 +331,7 @@ export default {
330
331
  if (this.realtimeStatusModalvisible === false) {
331
332
  this.changeStatus()
332
333
  }
334
+ this.getIntersectionInfo(this.agentId)
333
335
  },
334
336
  async mounted () {
335
337
  this.setPropsToken(this.Token)
@@ -338,6 +340,17 @@ export default {
338
340
  this.initData()
339
341
  },
340
342
  methods: {
343
+ getIntersectionInfo (agentid) {
344
+ // 获取路口信息
345
+ getIntersectionInfo(agentid).then(res => {
346
+ this.patternAll = res.data.data.param.patternList
347
+ this.patternSelect = res.data.data.param.patternList.map(item => {
348
+ return {
349
+ value: item.id
350
+ }
351
+ })
352
+ })
353
+ },
341
354
  getFault () {
342
355
  this.getFaultById()
343
356
  this.faultTimer = setInterval(() => {
@@ -23,7 +23,7 @@
23
23
  :label="$t('openatccomponents.overview.controlnumber') + ':'"
24
24
  prop="shape">
25
25
  <!-- <el-input-number v-model="manualInfo.tempPatternid" :controls="false" size="mini" :max="65535" :min="0" :precision="0" :step="1" :placeholder="$t('openatccomponents.common.input')"></el-input-number> -->
26
- <el-select v-model="manualInfo.tempPatternid" class="col-inner" size="small" :placeholder="$t('openatccomponents.common.select')">
26
+ <el-select v-model="manualInfo.tempPatternid" @change="changeStage" class="col-inner" size="small" :placeholder="$t('openatccomponents.common.select')">
27
27
  <el-option
28
28
  v-for="item in patternSelect"
29
29
  :key="item.value"
@@ -94,6 +94,9 @@ export default {
94
94
  Stages
95
95
  },
96
96
  props: {
97
+ patternAll: {
98
+ type: Array
99
+ },
97
100
  crossStatusData: {
98
101
  type: Object,
99
102
  default: () => {}
@@ -150,15 +153,6 @@ export default {
150
153
  return {
151
154
  basicFuncControlId: [0, 1, 4, 5], // 基础功能包含的控制方式: 自主控制(手动下)、黄闪、步进、定周期
152
155
  visible: this.Visible,
153
- // patternSelect: [{
154
- // value: 0
155
- // }, {
156
- // value: 1
157
- // }, {
158
- // value: 2
159
- // }, {
160
- // value: 3
161
- // }],
162
156
  manualInfo: {
163
157
  tempPatternid: '', // 控制方式手动操作的情况下的控制编号的临时值。
164
158
  tempDelay: 0, // 控制方式手动操作的情况下的延迟时间的临时值。
@@ -167,6 +161,13 @@ export default {
167
161
  }
168
162
  },
169
163
  methods: {
164
+ changeStage (value) {
165
+ let stages = []
166
+ stages = this.patternAll.filter(item => {
167
+ return item.id === value
168
+ })[0].stages
169
+ this.crossStatusData.stages = stages
170
+ },
170
171
  handleClose () {
171
172
  this.$emit('closeManualModal')
172
173
  },
@@ -48,7 +48,7 @@
48
48
  </el-row>
49
49
  <el-row>
50
50
  <div class="title" style="margin-top:18px; margin-bottom:10px">{{$t('openatccomponents.overview.patternstate')}}:
51
- <span>({{$t('openatccomponents.overview.cycle')}}: {{patternOne.length===0?planPattern.cycle:patternOne[0].cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{planPattern.offset}})</span>
51
+ <span>({{$t('openatccomponents.overview.cycle')}}: {{cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{offset}})</span>
52
52
  </div>
53
53
  <stage-status
54
54
  :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
@@ -183,7 +183,7 @@ export default {
183
183
  return this.patternOne.length === 0 ? this.planPattern.rings : this.patternOne[0].rings
184
184
  },
185
185
  cycle () {
186
- return this.patternOne.length === 0 ? this.planPattern.cycle : this.patternOne[0].cycle
186
+ return this.patternOne.length === 0 ? this.max : (this.patternOne.length > 0 && (this.patternOne[0].cycle < this.max)) ? this.max : this.patternOne[0].cycle
187
187
  },
188
188
  offset () {
189
189
  return this.patternOne.length === 0 ? 0 : this.patternOne[0].offset
@@ -202,13 +202,6 @@ export default {
202
202
  return {
203
203
  stagesList: [],
204
204
  phaseRings: [],
205
- // patternSelect: [{
206
- // value: 1
207
- // }, {
208
- // value: 2
209
- // }, {
210
- // value: 3
211
- // }],
212
205
  options: {
213
206
  group: 'pattern'
214
207
  },
@@ -302,6 +295,7 @@ export default {
302
295
  // ]
303
296
  // }
304
297
  // ],
298
+ max: '',
305
299
  activeList: 'ring',
306
300
  ringCount: 1,
307
301
  ringCounts: 1,
@@ -1239,13 +1233,18 @@ export default {
1239
1233
  }
1240
1234
  }
1241
1235
  },
1242
- handleSplit (index, newList) {
1243
- // this.allPatternList[index - 1].rings[index - 1] = newList
1244
- // this.planPattern[index - 1] = newList
1245
- // let currPattern = this.patternList[index]
1246
- // setTimeout(() => {
1247
- // this.handleStageData(currPattern.rings, this.patternList[index].id, currPattern.stagesList)
1248
- // }, 50)
1236
+ handleSplit (index) {
1237
+ if (this.patternOne.length > 0) {
1238
+ let currPattern = this.patternOne[0].rings
1239
+ setTimeout(() => {
1240
+ this.handleStageData(currPattern)
1241
+ }, 50)
1242
+ } else {
1243
+ let currPattern = this.planPattern.rings
1244
+ setTimeout(() => {
1245
+ this.handleStageData(currPattern)
1246
+ }, 50)
1247
+ }
1249
1248
  },
1250
1249
  selectPattern () {
1251
1250
  this.patternOne = this.allPatternList.filter(item => {
@@ -35,7 +35,7 @@
35
35
  <div style="width:70%;">
36
36
  <i class="iconfont icon-feijidongche" style="font-size:11PX;color:#606266;" v-if="item[item.length-1].controltype === 6"></i>
37
37
  <i class="iconfont icon-lukouzhilu" style="font-size:16PX;color:#454545;" v-if="item[item.length-1].controltype === 1"></i>
38
- <i class="iconfont icon-BRT" style="position: absolute;top: 8PX;font-size:11PX;color:#454545;" v-if="item[item.length-1].controltype === 4"></i>
38
+ <i class="iconfont icon-BRT" style="font-size:11PX;color:#454545;" v-if="item[item.length-1].controltype === 4"></i>
39
39
  <div style="transform:scale(0.65);margin-left:-6px;">
40
40
  <i class="iconfont icon-xuxiangwei" style="font-size:5PX;color:#454545;" v-if="item[item.length-1].controltype === 99"></i>
41
41
  </div>
@@ -97,7 +97,7 @@ export default {
97
97
  },
98
98
  stagesList () {
99
99
  let list = []
100
- if (this.crossStatusData && this.crossStatusData.current_stage && this.phaseList && this.phaseList.length > 0) {
100
+ if (this.crossStatusData && this.crossStatusData.stages && this.phaseList && this.phaseList.length > 0) {
101
101
  let ringDataModel = new RingDataModel(this.crossStatusData, this.phaseList)
102
102
  list = ringDataModel.getStageData()
103
103
  if (this.isShowCurrentStage) {