openatc-components 0.3.70 → 0.3.71

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.
@@ -155,6 +155,13 @@ export default {
155
155
  this.reset = true
156
156
  }
157
157
  }
158
+ },
159
+ agentId: {
160
+ handler: function (val1, val2) {
161
+ if (val1 !== val2) {
162
+ this.resetCrossDiagram()
163
+ }
164
+ }
158
165
  }
159
166
  },
160
167
  created () {
@@ -164,9 +171,7 @@ export default {
164
171
  },
165
172
  mounted () {
166
173
  this.getParentSize()
167
- if (this.isVipRoute || this.channelType) {
168
- this.reset = true
169
- }
174
+ this.reset = true
170
175
  },
171
176
  updated () {
172
177
  },
@@ -10,16 +10,23 @@
10
10
  * See the Mulan PSL v2 for more details.
11
11
  **/
12
12
  <template>
13
- <div class="container-main" v-if="resetcomponent">
13
+ <div class="container-main">
14
14
  <div :style="{'transform': `scale(${shrink})`, 'transform-origin': 'left top', 'height': '100%'}">
15
15
  <div class="tuxingjiemian" v-show="curHomePage === 'Graphical' || curHomePage === 'Channelization'" :class="{'minifont': curBodyWidth <= 650}">
16
16
  <div class="tuxing-left" :class="{'changeWidth': graphicMode}" ref="tuxingLeft">
17
17
  <intersection-base-map
18
+ v-if="curHomePage === 'Graphical'"
18
19
  ref="intersectionMap"
19
20
  :stateName="stateName"
20
21
  :crossStatusData="crossStatusData"
21
22
  :agentId="agentId"
22
23
  :roadDirection="roadDirection" />
24
+ <channelization
25
+ v-if="curHomePage === 'Channelization'"
26
+ ref="channelization"
27
+ :AgentId="agentId"
28
+ :crossStatusData="crossStatusData"
29
+ :detectorStatusData="detectorStatusData" />
23
30
  <div class="pattern-status" v-if="!graphicMode && crossStatusData.control !== 1 && crossStatusData.control !== 2 && crossStatusData.control !== 3">
24
31
  <div class="pattern-name cross-mess">{{$t('openatccomponents.overviewcomponent.patternstate')}}</div>
25
32
  <div class="pattern-message">({{$t('openatccomponents.overviewcomponent.cycle')}}: {{controlData.cycle}} {{$t('openatccomponents.overviewcomponent.patternoffset')}}: {{controlData.patternoffset}} {{$t('openatccomponents.overviewcomponent.coordinationtime')}}: {{controlData.offset}})</div>
@@ -104,7 +111,6 @@
104
111
  </template>
105
112
 
106
113
  <script>
107
- import { mapState, mapGetters } from 'vuex'
108
114
  import { getTscControl, queryDevice } from '../../../api/control.js'
109
115
  import { registerMessage, uploadSingleTscParam } from '../../../api/param'
110
116
  import { getIntersectionInfo } from '../../../api/template'
@@ -112,6 +118,7 @@ import { setIframdevid } from '../../../utils/auth.js'
112
118
  import { getMessageByCode } from '../../../utils/responseMessage'
113
119
  import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
114
120
  import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
121
+ import { getChannelizatonChart } from '../../../api/cross'
115
122
  export default {
116
123
  name: 'overview-component',
117
124
  components: {
@@ -120,6 +127,14 @@ export default {
120
127
  AgentId: {
121
128
  type: String,
122
129
  default: '0'
130
+ },
131
+ roadDirection: {
132
+ type: String,
133
+ default: 'right'
134
+ },
135
+ isfromatc: {
136
+ type: Boolean,
137
+ default: true
123
138
  }
124
139
  },
125
140
  data () {
@@ -167,7 +182,8 @@ export default {
167
182
  commonHeight: undefined, // 左右侧面板的高度值
168
183
  graphicMode: false,
169
184
  resetcomponent: true,
170
- curHomePage: 'Graphical'
185
+ curHomePage: 'Graphical',
186
+ FuncSort: 'allFunc'
171
187
  }
172
188
  },
173
189
  computed: {
@@ -178,18 +194,7 @@ export default {
178
194
  return this.allPatternList.filter(item => {
179
195
  return item.id === this.controlData.patternid
180
196
  })[0]
181
- },
182
- ...mapGetters([
183
- 'isfromatc'
184
- ]),
185
- ...mapState({
186
- curBodyWidth: state => state.globalParam.curBodyWidth,
187
- curBodyHeight: state => state.globalParam.curBodyHeight,
188
- FuncSort: state => state.globalParam.FuncSort,
189
- // curHomePage: state => state.globalParam.curHomePage,
190
- roadDirection: state => state.globalParam.roadDirection,
191
- curOpenatcAgentid: state => state.globalParam.curOpenatcAgentid
192
- })
197
+ }
193
198
  },
194
199
  watch: {
195
200
  AgentId: {
@@ -197,9 +202,11 @@ export default {
197
202
  this.agentId = val
198
203
  this.resetcomponent = false
199
204
  this.$nextTick(() => {
200
- setTimeout(() => {
201
- this.resetcomponent = true
202
- }, 100)
205
+ this.resetcomponent = true
206
+ this.getChannelizatonChart()
207
+ this.getPlatform()
208
+ this.getPhase()
209
+ this.initData()
203
210
  })
204
211
  },
205
212
  // 深度观察监听
@@ -211,14 +218,6 @@ export default {
211
218
  },
212
219
  // 深度观察监听
213
220
  deep: true
214
- },
215
- curOpenatcAgentid: {
216
- handler: function (val) {
217
- // 平台设备切换时行人横道切换
218
- this.getPhase()
219
- this.initData()
220
- },
221
- deep: true
222
221
  }
223
222
  },
224
223
  created () {
@@ -236,9 +235,12 @@ export default {
236
235
  if (this.$route.query.shrink) {
237
236
  this.shrink = Number(this.$route.query.shrink)
238
237
  }
239
- this.$nextTick(() => {
240
- this.$refs.intersectionMap.resetCrossDiagram()
241
- })
238
+ this.getChannelizatonChart()
239
+ if (this.curHomePage === 'Graphical') {
240
+ this.$nextTick(() => {
241
+ this.$refs.intersectionMap.resetCrossDiagram()
242
+ })
243
+ }
242
244
  },
243
245
  updated () {
244
246
  if (this.$refs.tuxingLeft.offsetHeight !== this.commonHeight) {
@@ -300,6 +302,32 @@ export default {
300
302
  // }
301
303
  })
302
304
  },
305
+ getChannelizatonChart () {
306
+ let _this = this
307
+ getChannelizatonChart(this.AgentId).then(data => {
308
+ if (!data.data.success) {
309
+ // let parrenterror = getMessageByCode(data.data.code, _this.$i18n.locale)
310
+ // if (data.data.data) {
311
+ // // 子类型错误
312
+ // let childErrorCode = data.data.data.errorCode
313
+ // if (childErrorCode) {
314
+ // let childerror = getMessageByCode(data.data.data.errorCode, _this.$i18n.locale)
315
+ // _this.$message.error(parrenterror + ',' + childerror)
316
+ // }
317
+ // } else {
318
+ // _this.$message.error(parrenterror)
319
+ // }
320
+ _this.curHomePage = 'Graphical'
321
+ return
322
+ }
323
+ // 路口已设置渠化,则总览默认显示渠化路口,未设置显示模版路口
324
+ if (_this.isfromatc === true && data.data.success === true && JSON.stringify(data.data.data) !== '{}') {
325
+ _this.curHomePage = 'Channelization'
326
+ } else {
327
+ _this.curHomePage = 'Graphical'
328
+ }
329
+ })
330
+ },
303
331
  getPedPhasePos () {
304
332
  // 行人相位信息
305
333
  this.sidewalkPhaseData = []
@@ -442,7 +470,7 @@ export default {
442
470
  let TscData = JSON.parse(JSON.stringify(data.data.data.data))
443
471
  // this.handleStageData(TscData) // 处理阶段(驻留)stage数据
444
472
  this.controlData = this.handleGetData(TscData)
445
- console.log(this.controlData)
473
+ console.log('this.controlData', this.controlData)
446
474
  this.checkStage(this.controlData)
447
475
  }).catch(error => {
448
476
  // this.$message.error(error)
@@ -744,20 +772,9 @@ export default {
744
772
  if (this.platform === 'SCATS' || this.platform === 'HUATONG') {
745
773
  func = 'basicFunc'
746
774
  }
747
- this.$store.dispatch('SaveFunctionLevel', func)
775
+ this.FuncSort = func
748
776
  })
749
777
  }
750
- // getChannelizationSetting (ChannelizationData) {
751
- // // 路口已设置渠化,则总览默认显示渠化路口,未设置显示模版路口
752
- // if (this.isfromatc === true) {
753
- // this.$store.dispatch('SetShowHomePage', 'Graphical')
754
- // this.$store.dispatch('isSetChannelization', false)
755
- // if (ChannelizationData.data.success === true && JSON.stringify(ChannelizationData.data.data) !== '{}') {
756
- // this.$store.dispatch('SetShowHomePage', 'Channelization')
757
- // this.$store.dispatch('isSetChannelization', true)
758
- // }
759
- // }
760
- // },
761
778
  },
762
779
  destroyed () {
763
780
  this.isResend = false
@@ -19,6 +19,7 @@
19
19
  :leave-active-class="toPage === 1 ? 'animated fadeOutRight' : 'animated fadeOutLeft' ">
20
20
  <div class="new" style="position: absolute;width: 100%;height:100%;" v-show="(isOperation && !isClosePhase)">
21
21
  <ManualControlModalNew
22
+ v-if="resetcomponent"
22
23
  ref="ManualControlModalNew"
23
24
  :residentControlList="residentControlList"
24
25
  :specialControlList="specialControlList"
@@ -81,6 +82,7 @@
81
82
  <div v-else style="height: 100%;">
82
83
  <div class="new" style="position: absolute;width: 100%;height:100%;" v-show="(isOperation && !isClosePhase)">
83
84
  <ManualControlModalNew
85
+ v-if="resetcomponent"
84
86
  ref="ManualControlModalNew"
85
87
  :residentControlList="residentControlList"
86
88
  :specialControlList="specialControlList"
@@ -460,13 +462,17 @@ export default {
460
462
  patternAll: [],
461
463
  patternSelect: [], // 所有方案id
462
464
  specialPage: '', // 哪一个特殊控制页面
463
- nextcycleefficcontrol: [5, 6, 9, 10, 12, 19] // 下周期生效的控制方式
465
+ nextcycleefficcontrol: [5, 6, 9, 10, 12, 19], // 下周期生效的控制方式
466
+ resetcomponent: false
464
467
  }
465
468
  },
466
469
  watch: {
467
470
  agentId: {
468
- handler: function (val) {
469
- this.getIntersectionInfo(val)
471
+ handler: function (val1, val2) {
472
+ if (val1 !== val2) {
473
+ this.resetComponent()
474
+ }
475
+ this.getIntersectionInfo(val1)
470
476
  },
471
477
  // 深度观察监听
472
478
  deep: true
@@ -503,18 +509,29 @@ export default {
503
509
  this.setHost(this.reqUrl)
504
510
  this.PhaseDataModel = new PhaseDataModel(this.roadDirection)
505
511
  this.CrossDiagramMgr = new CrossDiagramMgr()
506
- this.getIntersectionInfo(this.agentId)
507
512
  },
508
513
  async mounted () {
509
- if (this.realtimeStatusModalvisible === false) {
510
- this.changeStatus()
511
- }
512
- this.setPropsToken(this.Token)
513
- // await this.getPhase()
514
- this.getFault()
515
- this.initData()
514
+ this.resetcomponent = true
515
+ this.init()
516
516
  },
517
517
  methods: {
518
+ resetComponent () {
519
+ this.resetcomponent = false
520
+ this.$nextTick(() => {
521
+ this.resetcomponent = true
522
+ this.init()
523
+ })
524
+ },
525
+ init () {
526
+ this.getIntersectionInfo(this.agentId)
527
+ if (this.realtimeStatusModalvisible === false) {
528
+ this.changeStatus()
529
+ }
530
+ this.setPropsToken(this.Token)
531
+ // await this.getPhase()
532
+ this.getFault()
533
+ this.initData()
534
+ },
518
535
  setHost (host) {
519
536
  // 获取组件外传入的token,便于独立组件调用接口
520
537
  if (host && host !== '') {
@@ -160,7 +160,8 @@
160
160
  <div class="cross-content">
161
161
  <div class="cross-name">{{$t('openatccomponents.overview.currentstage')}}:</div>
162
162
  <div>
163
- <Stages :crossStatusData="crossStatusData"
163
+ <Stages v-if="resetcomponent"
164
+ :crossStatusData="crossStatusData"
164
165
  :phaseList="phaseList"
165
166
  @onSelectStages="onSelectStages"></Stages>
166
167
  </div>
@@ -260,8 +261,27 @@ export default {
260
261
  }
261
262
 
262
263
  },
264
+ watch: {
265
+ agentId: {
266
+ handler: function (val1, val2) {
267
+ this.$nextTick(() => {
268
+ setTimeout(() => {
269
+ if (val1 !== val2) {
270
+ this.resetcomponent = false
271
+ this.$nextTick(() => {
272
+ this.resetcomponent = true
273
+ })
274
+ }
275
+ }, 100)
276
+ })
277
+ },
278
+ // 深度观察监听
279
+ deep: true
280
+ }
281
+ },
263
282
  data () {
264
283
  return {
284
+ resetcomponent: true
265
285
  }
266
286
  },
267
287
  methods: {