openatc-components 0.2.32 → 0.2.34

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.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -212,6 +212,7 @@ const en = {
212
212
  'modelList22': 'Priority Control',
213
213
  'modelList23': 'Close Phase',
214
214
  'modelList100': 'Tentative Plan',
215
+ 'modelList101': 'Direction Lock',
215
216
  'modelList24': 'Priority Control',
216
217
  'modelList25': 'Azimuth locking',
217
218
  'controlType201': 'Scheme Update Frequency',
@@ -265,6 +265,7 @@ const zh = {
265
265
  'modelList25': '方位锁定',
266
266
  'modelList23': '相位放行控制',
267
267
  'modelList100': '临时方案',
268
+ 'modelList101': '方向锁定',
268
269
  'modelList24': '优先控制',
269
270
  'modelList99': '设备维护',
270
271
  'controlType201': '方案更新频次',
@@ -60,7 +60,7 @@
60
60
  </div>
61
61
  <div class="stage-label">{{$t('openatccomponents.overview.stage')}}:</div>
62
62
  <div style="width: 100%; height: auto;overflow: hidden;" v-if="isHasPermission('configer:manual:dwell')">
63
- <Stages :crossStatusData="manuals?manualsStage:realtimeStage"
63
+ <Stages :crossStatusData="crossStatusData"
64
64
  :phaseList="phaseList"
65
65
  :preselectStages="preselectStages"
66
66
  :preselectModel="preselectModel"
@@ -20,12 +20,12 @@
20
20
  :close-on-click-modal="false"
21
21
  @close="oncancle"
22
22
  append-to-body>
23
- <!-- <scheme-config
24
- :agentId="agentId"
25
- :statusData="crossStatusData"
26
- :realtimeStatusModalvisible="false"
27
- @patternCommitCallback="patternCommitCallback"/> -->
28
23
  <scheme-config
24
+ ref="rightpanel"
25
+ :agentId="agentId"
26
+ :statusData="crossStatusData"
27
+ :phaseList="phaseList2"/>
28
+ <!-- <scheme-config
29
29
  ref="rightpanel"
30
30
  :agentId="agentId"
31
31
  :lockPhaseBtnName="lockPhaseBtnName"
@@ -33,8 +33,7 @@
33
33
  :phaseList="phaseList"
34
34
  :realtimeStatusModalvisible="true"
35
35
  roadDirection="left"
36
- />
37
- <!-- funcSort="basicFunc" -->
36
+ /> -->
38
37
  </el-dialog>
39
38
  </div>
40
39
  </template>
@@ -42,6 +41,7 @@
42
41
  import { getTscControl } from '../api/control.js'
43
42
  import { getMessageByCode } from '../utils/responseMessage.js'
44
43
  import { getIntersectionInfo } from '../api/template'
44
+ import { getTscPhase } from '../api/cross.js'
45
45
  import {
46
46
  setToken
47
47
  } from '../utils/auth'
@@ -51,14 +51,16 @@ export default {
51
51
  },
52
52
  data () {
53
53
  return {
54
+ timer: 0,
55
+ phaseList2: [],
54
56
  phaseList: [],
55
57
  showWalk: [ 1, 2 ],
56
58
  sidewalkPhaseData: [{key: 'pedphase1653873194007699', phaseid: 1, id: 1, name: '东人行横道', isshow: false}],
57
59
  lockPhaseBtnName: this.$t('openatccomponents.overview.comfirm'),
58
- agentId: '12004-950',
59
- Token: 'eyJraWQiOiIxNjcwMzc0ODA4MTcyIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc1Njc3NDgwOCwiaWF0IjoxNjcwMzc0ODA4fQ.xsRoye_tk_Xf60w5Mpigm8vrPgQJCLN-W_IW4U7dafA',
60
+ agentId: 'cslsnl',
61
+ Token: 'eyJraWQiOiIxNzAxODMyOTQ3MTUwIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJxeXl0aCIsImV4cCI6MTc2OTc4ODgwMCwiaWF0IjoxNzAxMzYwMDAwfQ.RIQpNEkJibL-RYllirDeNLi8G9-t8PecM_m7KlZNQXg',
60
62
  Token103: 'eyJraWQiOiIxNjcwMzc0ODA4MTcyIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc1Njc3NDgwOCwiaWF0IjoxNjcwMzc0ODA4fQ.xsRoye_tk_Xf60w5Mpigm8vrPgQJCLN-W_IW4U7dafA',
61
- boxVisible: false,
63
+ boxVisible: true,
62
64
  dialogWidth: '80%',
63
65
  crossStatusData: {} // 路口状态数据
64
66
  }
@@ -82,11 +84,10 @@ export default {
82
84
  this.dialogWidth = def + 'px'
83
85
  }
84
86
  },
85
- initData () {
86
- // let iframdevid = getIframdevid()
87
- this.getIntersectionInfo(this.agentId, '')
88
- getTscControl(this.agentId).then((data) => {
89
- if (!data.data.success) {
87
+ getPhase () {
88
+ getTscPhase(this.agentId).then(data => {
89
+ let res = data.data
90
+ if (!res.success) {
90
91
  if (data.data.code === '4002' && data.data.data.errorCode === '4209') {
91
92
  let success = data.data.data.content.success
92
93
  if (success !== 0) {
@@ -95,10 +96,31 @@ export default {
95
96
  return
96
97
  }
97
98
  }
98
- if (data.data.code === '4003') {
99
- this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
100
- return
99
+ let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
100
+ if (data.data.data) {
101
+ // 子类型错误
102
+ let childErrorCode = data.data.data.errorCode
103
+ if (childErrorCode) {
104
+ let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
105
+ this.$message.error(parrenterror + ',' + childerror)
106
+ }
107
+ } else {
108
+ this.$message.error(parrenterror)
101
109
  }
110
+ return
111
+ }
112
+ if (res.data.data && res.data.data.phaseList) {
113
+ this.phaseList2 = res.data.data.phaseList
114
+ }
115
+ })
116
+ },
117
+ initData () {
118
+ // let iframdevid = getIframdevid()
119
+ this.getIntersectionInfo(this.agentId, '')
120
+ this.getPhase()
121
+ getTscControl(this.agentId).then((data) => {
122
+ // debugger
123
+ if (!data.data.success) {
102
124
  let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
103
125
  if (data.data.data) {
104
126
  // 子类型错误
@@ -112,7 +134,11 @@ export default {
112
134
  }
113
135
  return
114
136
  }
137
+ console.log(data.data.data)
115
138
  this.crossStatusData = JSON.parse(JSON.stringify(data.data.data.data))
139
+ // debugger
140
+ console.log(this.crossStatusData)
141
+ // debugger
116
142
  }).catch(error => {
117
143
  console.log(error)
118
144
  })
@@ -136,9 +162,14 @@ export default {
136
162
  created () {
137
163
  this.setDialogWidth()
138
164
  },
165
+ beforeDestroy () {
166
+ clearInterval(this.timer)
167
+ },
139
168
  mounted () {
140
169
  this.setPropsToken(this.Token)
141
- this.initData()
170
+ this.timer = setInterval(() => {
171
+ this.initData()
172
+ }, 1000 * 2)
142
173
  window.onresize = () => {
143
174
  return (() => {
144
175
  this.setDialogWidth()