openatc-components 0.3.17 → 0.3.19

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.
@@ -106,6 +106,22 @@
106
106
  <!-- <Stages :stagesList="stagesList"
107
107
  :currentStage="currentStage"
108
108
  @onSelectStages="onSelectStages"></Stages> -->
109
+ <div style="height: 100px;">
110
+ <PhaseLegend :crossStatusData="tscControlData"
111
+ :phaseList="phaseList"
112
+ showDataType="phase"
113
+ :noClick="true"
114
+ :isShowCurrentStage="false"
115
+ StageWidth="46px"
116
+ StageHeight="52px"
117
+ dirWidth="46px"
118
+ dirHeight="52px"
119
+ dirWidths="46px"
120
+ dirHeights="52px"
121
+ :showStyle="{top:'2PX',left:'9px'}"
122
+ :showStyles="{top:'0PX',left:'7px'}"
123
+ ></PhaseLegend>
124
+ </div>
109
125
 
110
126
  <!-- <h2 style="color: #fff;">渠化图</h2>
111
127
  <channelization-with-interface
@@ -133,18 +149,24 @@ import {
133
149
  } from '../utils/auth'
134
150
  import IntersectionWithInterface from '../kisscomps/components/IntersectionWithInterface'
135
151
  import ChannelizationWithInterface from '../kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface'
152
+ import {
153
+ getTscPhase
154
+ } from '../api/cross.js'
155
+ import {
156
+ getTscControl
157
+ } from '../api/control.js'
136
158
  export default {
137
159
  name: 'demo',
138
160
  data () {
139
161
  return {
140
162
  roadDirection: 'right',
141
163
  // reqUrl: 'http://192.168.13.103:10003/openatc',
142
- agentId: 'tjblfql',
164
+ agentId: '12008_ticp',
143
165
  // agentId: '13013',
144
166
  // agentId: '12007_390',
145
167
  // agentId: '12014',
146
168
  reqUrl: 'http://192.168.13.103:10003/openatc',
147
- Token: 'eyJraWQiOiIxNzE4NzU5ODA0Njc0IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcxODgwMzAwNCwiaWF0IjoxNzE4NzU5ODA0fQ.8CKosL9Yrp8h8d_op6kGHHcNXIBgNu3YhwY7JdPIKJc',
169
+ Token: 'eyJraWQiOiIxNzIxOTcwMTEzMTMwIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcyMTk3MzcxMywiaWF0IjoxNzIxOTY2NTEzfQ.aT14xZel09fHji-SrPMDTPAxISEUS8Y6KF30BWjCGKY',
148
170
  // agentId: '30003-352',
149
171
  // reqUrl: 'https://kints-dev.devdolphin.com/openatc',
150
172
  // Token: 'eyJraWQiOiIxNjUwNTA5MDI2ODk2IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJ4aWFvbWluZyIsImV4cCI6MTczNjkwOTAyNiwiaWF0IjoxNjUwNTA5MDI2fQ.-s4T-uMRmB2zf9yer87USKQXLY1a12Zq5lCOnqjNmfA',
@@ -187,6 +209,72 @@ export default {
187
209
  }
188
210
  ],
189
211
  crossStatusData: {},
212
+ crossStatusDataMock:
213
+ {
214
+ 'agentid': '12008_ticp',
215
+ 'operation': 'get-request',
216
+ 'infotype': 'status/pattern',
217
+ 'data': {
218
+ 'phase': [
219
+ {
220
+ 'id': 1,
221
+ 'type': 1,
222
+ 'pedtype': 1
223
+ },
224
+ {
225
+ 'id': 3,
226
+ 'type': 1,
227
+ 'pedtype': 1
228
+ },
229
+ {
230
+ 'id': 4,
231
+ 'type': 1,
232
+ 'pedtype': 1
233
+ },
234
+ {
235
+ 'id': 6,
236
+ 'type': 3,
237
+ 'pedtype': 3
238
+ }
239
+ ],
240
+ 'mode': 0,
241
+ 'control': 5,
242
+ 'patternid': 2,
243
+ 'cycle': 141,
244
+ 'stages': [
245
+ [
246
+ 1
247
+ ],
248
+ [
249
+ 4,
250
+ 3
251
+ ],
252
+ [
253
+ 6
254
+ ]
255
+ ],
256
+ 'stages_len': [
257
+ 70,
258
+ 25,
259
+ 46
260
+ ],
261
+ 'stages_seq': [
262
+ 1,
263
+ 2,
264
+ 3
265
+ ],
266
+ 'current_stage': 3,
267
+ 'current_stagecd': 15,
268
+ 'offset': 0,
269
+ 'current_phase': [
270
+ 6
271
+ ],
272
+ 'next_phase': [
273
+ 1
274
+ ],
275
+ 'curTime': 127
276
+ }
277
+ },
190
278
  channelRealtimeStatusData: {
191
279
  'channellamp': [
192
280
  {
@@ -234,7 +322,9 @@ export default {
234
322
  'light': 3
235
323
  }
236
324
  ]
237
- }
325
+ },
326
+ tscControlData: {},
327
+ phaseList: []
238
328
  }
239
329
  },
240
330
  components: {
@@ -325,6 +415,19 @@ export default {
325
415
  // this.controlName = control
326
416
  // this.modeName = mode
327
417
  },
418
+ getTscControlData () {
419
+ this.tscControlData = {}
420
+ getTscControl(this.agentId).then((data) => {
421
+ this.tscControlData = data.data.data.data
422
+ }).catch(error => {
423
+ console.log(error)
424
+ })
425
+ },
426
+ getCurPhaseDirection () {
427
+ getTscPhase(this.agentId).then(res => {
428
+ this.phaseList = res.data.data.data.phaseList
429
+ })
430
+ },
328
431
  registerMessage (res) {
329
432
  console.log('registerMessage:', res)
330
433
  },
@@ -363,6 +466,11 @@ export default {
363
466
  this.setDialogWidth()
364
467
  })()
365
468
  }
469
+ this.getTscControlData()
470
+ this.getCurPhaseDirection()
471
+ // setTimeout(() => {
472
+ // this.crossStatusData = this.crossStatusDataMock.data
473
+ // }, 1000)
366
474
  },
367
475
  destroyed () {
368
476
  }
@@ -20,7 +20,7 @@ export default {
20
20
  modeName: '交警遥控',
21
21
  controlName: '步进',
22
22
  agentId: 'jmlxhl',
23
- Token: 'eyJraWQiOiIxNzIxMzc5ODY5NTc1IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcyMTQyMzA2OSwiaWF0IjoxNzIxMzc5ODY5fQ.gr6NbmMF0DmAiGVjJkj9KCnHn-cEtt7FEXT9MmkKJb8',
23
+ Token: 'eyJraWQiOiIxNzA4OTA5NDk2ODcxIiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTcwODk1MjY5NiwiaWF0IjoxNzA4OTA5NDk2fQ.FI0gzBQFLyQsj95LG56lVZxb6WYlr2-datNsyv6fF-I',
24
24
  reqUrl: 'http://192.168.13.103:10003/openatc'
25
25
  }
26
26
  },
@@ -45,6 +45,7 @@
45
45
  background-color: $--card-background-base;
46
46
  border-radius: 5PX;
47
47
  .num {
48
+ color: $--color-text-primary;
48
49
  position: absolute;
49
50
  left: 5PX;
50
51
  bottom: 5PX;
@@ -1,6 +1,6 @@
1
1
 
2
- //阶段图
3
- .intersection-stages {
2
+ //阶段图/相位图例
3
+ .intersection-stages, .intersection-phases {
4
4
  .cross-content {
5
5
  margin-top: 19PX;
6
6
  // margin-left: 7PX;