openatc-components 0.0.112 → 0.1.1

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.112",
3
+ "version": "0.1.1",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
@@ -1035,6 +1035,13 @@ const en = {
1035
1035
  '4107': 'Unknown infotype!',
1036
1036
  '4108': 'protocol is null!',
1037
1037
  '4109': 'Receive Time Out or Receive Incorrect Data!',
1038
+ '4110': 'Last sendData is not finished!',
1039
+ '4111': 'Port is null!',
1040
+ '4112': 'Cache is null!',
1041
+ '4113': 'Keyints can not be null',
1042
+ '4114': 'Keyints can not be the first two when strategy is up!',
1043
+ '4115': 'Keyints can not be the last two when strategy is down!',
1044
+ '4116': 'No less than three intersections!',
1038
1045
  // error-response
1039
1046
  '4200': 'response is null!',
1040
1047
  '4201': 'response format error!',
@@ -1034,6 +1034,13 @@ const zh = {
1034
1034
  '4107': '未知的消息类型!',
1035
1035
  '4108': '协议为空!',
1036
1036
  '4109': '接收数据超时或收到错误数据!',
1037
+ '4110': '上一次发送的数据还未完成!',
1038
+ '4111': '端口为空!',
1039
+ '4112': '缓存为空!',
1040
+ '4113': '车队尾红波协调时关键路口不能为空',
1041
+ '4114': '车队尾红波协调时关键路口不能为前两个(上行)',
1042
+ '4115': '车队尾红波协调时关键路口不能为后两个(下行)',
1043
+ '4116': '车队尾红波协调时参与协调的路口至少为3个',
1037
1044
  // error-response
1038
1045
  '4200': '应答为空!',
1039
1046
  '4201': '应答消息转换错误!',
@@ -86,7 +86,7 @@ export default {
86
86
  // 解决change事件只在失去焦点时响应,此处,可以监听到实时变化
87
87
  const key = this.$refs[`refNumber-${field}`].displayValue
88
88
  if (this.checkOnlyNum(key)) {
89
- this.basicCoodInfo[field] = field === 'angle' ? this.checkMinMaxNum(key) : Number(key)
89
+ this.basicCoodInfo[field] = field === 'angle' ? this.checkAngleMinMaxNum(key) : Number(key)
90
90
  this.$emit('handleChangeBasicCoord', this.basicCoodInfo)
91
91
  }
92
92
  },
@@ -107,7 +107,7 @@ export default {
107
107
  handleChangeAngle (angle) {
108
108
  // 解决用上下箭头控制数字改变
109
109
  if (this.checkOnlyNum(angle)) {
110
- this.basicCoodInfo['angle'] = this.checkMinMaxNum(angle)
110
+ this.basicCoodInfo['angle'] = this.checkAngleMinMaxNum(angle)
111
111
  this.$emit('handleChangeBasicCoord', this.basicCoodInfo)
112
112
  }
113
113
  },
@@ -553,18 +553,19 @@ export default {
553
553
  getIntersectionInfo(agentid).then(res => {
554
554
  if (!res.data.success) {
555
555
  this.isLoaded = false
556
+ let commomMsg = this.$t('openatccomponents.overview.signalID') + ' : ' + agentid
556
557
  this.stateName = this.$t('openatccomponents.overview.offline')
557
- let parrenterror = getMessageByCode(res.data.code, this.$i18n.locale)
558
+ let msg = getMessageByCode(res.data.code, this.$i18n.locale)
558
559
  if (res.data.data) {
559
560
  // 子类型错误
560
561
  let childErrorCode = res.data.data.errorCode
561
562
  if (childErrorCode) {
562
563
  let childerror = getMessageByCode(res.data.data.errorCode, this.$i18n.locale)
563
- this.$message.error(parrenterror + ',' + childerror)
564
+ msg = msg + ' - ' + childerror
564
565
  }
565
- } else {
566
- this.$message.error(parrenterror)
567
566
  }
567
+ msg = msg + ' - ' + commomMsg
568
+ this.$message.error(msg)
568
569
  return
569
570
  }
570
571
  this.stateName = this.$t('openatccomponents.overview.online')
@@ -313,17 +313,16 @@ export default {
313
313
  registerMessage(this.AgentId).then(data => {
314
314
  if (!data.data.success) {
315
315
  this.devStatus = 2
316
- let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
316
+ let commomMsg = this.$t('openatccomponents.overview.signalID') + ' : ' + this.AgentId
317
+ let msg = getMessageByCode(data.data.code, this.$i18n.locale)
317
318
  if (data.data.data) {
318
- // 子类型错误
319
- let childErrorCode = data.data.data.errorCode
320
- if (childErrorCode) {
321
- let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
322
- this.$message.error(parrenterror + ',' + childerror)
319
+ let errorCode = data.data.data.errorCode
320
+ if (errorCode) {
321
+ msg = msg + ' - ' + getMessageByCode(errorCode, this.$i18n.locale)
323
322
  }
324
- } else {
325
- this.$message.error(parrenterror)
326
323
  }
324
+ msg = msg + ' - ' + commomMsg
325
+ this.$message.error(msg)
327
326
  if (this.isResend) {
328
327
  this.reSend()
329
328
  }
@@ -378,27 +377,28 @@ export default {
378
377
  this.responseTime = diffTime
379
378
  this.intervalFlag = true
380
379
  if (!data.data.success) {
380
+ let commomMsg = this.$t('openatccomponents.overview.signalID') + ' : ' + this.AgentId
381
381
  if (data.data.code === '4003') {
382
382
  this.devStatus = 2
383
383
  this.clearPatternInterval() // 清除其他定时器
384
384
  this.clearVolumeInterval()
385
- this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
385
+ this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale) + ' - ' + commomMsg)
386
386
  if (this.isResend) {
387
387
  this.reSend()
388
388
  }
389
389
  return
390
390
  }
391
- let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
391
+ let msg = getMessageByCode(data.data.code, this.$i18n.locale)
392
392
  if (data.data.data) {
393
393
  // 子类型错误
394
394
  let childErrorCode = data.data.data.errorCode
395
395
  if (childErrorCode) {
396
396
  let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
397
- this.$message.error(parrenterror + ',' + childerror)
397
+ msg = msg + ' - ' + childerror
398
398
  }
399
- } else {
400
- this.$message.error(parrenterror)
401
399
  }
400
+ msg = msg + ' - ' + commomMsg
401
+ this.$message.error(msg)
402
402
  this.clearPatternInterval() // 清除其他定时器
403
403
  this.clearVolumeInterval()
404
404
  if (this.isResend) {
@@ -587,7 +587,9 @@ export default {
587
587
  queryDevParams () {
588
588
  queryDevice(this.AgentId).then(res => {
589
589
  if (!res.data.success) {
590
- this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
590
+ let commomMsg = this.$t('openatc.overview.signalID') + ': ' + this.AgentId
591
+ let msg = getMessageByCode(res.data.code, this.$i18n.locale) + ', ' + commomMsg
592
+ this.$message.error(msg)
591
593
  return
592
594
  }
593
595
  let devParams = res.data.data.jsonparam
@@ -628,7 +630,8 @@ export default {
628
630
  getPlatform () {
629
631
  queryDevice(this.AgentId).then(res => {
630
632
  if (!res.data.success) {
631
- this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
633
+ let commomMsg = this.$t('openatc.overview.signalID') + ': ' + this.AgentId
634
+ this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale) + ' - ' + commomMsg)
632
635
  return
633
636
  }
634
637
  let devParams = res.data.data.jsonparam
@@ -16,7 +16,7 @@ export default {
16
16
  name: 'custom-channelization-demo',
17
17
  data () {
18
18
  return {
19
- agentId: '13001-460',
19
+ agentId: '10002-739',
20
20
  tscParams: {}
21
21
  }
22
22
  },
@@ -30,6 +30,8 @@
30
30
  :agentId="agentId"
31
31
  :lockPhaseBtnName="lockPhaseBtnName"
32
32
  :statusData="crossStatusData"
33
+ :phaseList="phaseList"
34
+ :realtimeStatusModalvisible="false"
33
35
  roadDirection="left"
34
36
  />
35
37
  <!-- funcSort="basicFunc" -->
@@ -39,6 +41,7 @@
39
41
  <script>
40
42
  import { getTscControl } from '../api/control.js'
41
43
  import { getMessageByCode } from '../utils/responseMessage.js'
44
+ import { getIntersectionInfo } from '../api/template'
42
45
  import {
43
46
  setToken
44
47
  } from '../utils/auth'
@@ -48,6 +51,7 @@ export default {
48
51
  },
49
52
  data () {
50
53
  return {
54
+ phaseList: [],
51
55
  showWalk: [ 1, 2 ],
52
56
  sidewalkPhaseData: [{key: 'pedphase1653873194007699', phaseid: 1, id: 1, name: '东人行横道', isshow: false}],
53
57
  lockPhaseBtnName: this.$t('openatccomponents.overview.comfirm'),
@@ -80,6 +84,7 @@ export default {
80
84
  },
81
85
  initData () {
82
86
  // let iframdevid = getIframdevid()
87
+ this.getIntersectionInfo(this.agentId, '')
83
88
  getTscControl(this.agentId).then((data) => {
84
89
  if (!data.data.success) {
85
90
  if (data.data.code === '4003') {
@@ -104,6 +109,12 @@ export default {
104
109
  console.log(error)
105
110
  })
106
111
  },
112
+ getIntersectionInfo (agentid, id) {
113
+ // 获取路口信息
114
+ getIntersectionInfo(agentid).then(res => {
115
+ this.phaseList = res.data.data.param.phaseList
116
+ })
117
+ },
107
118
  setPropsToken (token) {
108
119
  // 获取组件外传入的token,便于独立组件调用接口
109
120
  if (token && token !== '') {