openatc-components 0.5.14 → 0.5.15

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.5.14",
3
+ "version": "0.5.15",
4
4
  "description": "A Vue.js project",
5
5
  "author": "openatc developer",
6
6
  "private": false,
package/src/api/param.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  getIframdevid
15
15
  } from '../utils/auth'
16
16
 
17
- export function registerMessage (agentid) {
17
+ export function registerMessage (agentid, protocol) {
18
18
  // var iframdevid = getIframdevid()
19
19
  if (agentid === '' || agentid === undefined) {
20
20
  agentid = 0
@@ -24,6 +24,9 @@ export function registerMessage (agentid) {
24
24
  data.agentid = agentid
25
25
  data.operation = 'get-request'
26
26
  data.infotype = 'login'
27
+ if (protocol === 'rcp') {
28
+ data.model = 'rcp'
29
+ }
27
30
  // let paramList = [iframdevid, 'param', 'upload']
28
31
  return api.Send({}, data)
29
32
  }
@@ -1094,6 +1094,21 @@ const en = {
1094
1094
  'download': 'Download'
1095
1095
  },
1096
1096
  'common': {
1097
+ 'datatype': 'Data Type',
1098
+ 'objectid': 'Object ID',
1099
+ 'propertyid': 'Property ID',
1100
+ 'elementid': 'Element ID',
1101
+ 'returncode': 'Return Code',
1102
+ 'statusbadvalue': 'Status Bad Value',
1103
+ 'statuswronglength': 'Status Wrong Length',
1104
+ 'statusvverflow': 'Status Overflow',
1105
+ 'statusreadonly': 'Status Read Only',
1106
+ 'statusnullvalue': 'Status Null Value',
1107
+ 'statuserror': 'Status Error',
1108
+ 'statuscontrolfail': 'Status Control Fail',
1109
+ 'statusaccessdenied': 'Status Access Denied',
1110
+ 'statusinvalidkey': 'Status Invalid Key',
1111
+ 'statuschecksumerror': 'Status Checksum Error',
1097
1112
  'implement': 'Implement',
1098
1113
  'confirm': 'Confirm',
1099
1114
  'query': 'Query',
@@ -1090,6 +1090,21 @@ const zh = {
1090
1090
  'download': '下载'
1091
1091
  },
1092
1092
  'common': {
1093
+ 'datatype': '数据类',
1094
+ 'objectid': '对象',
1095
+ 'propertyid': '属性',
1096
+ 'elementid': '元素',
1097
+ 'returncode': '数据值',
1098
+ 'statusbadvalue': '值错误',
1099
+ 'statuswronglength': '值长度错误',
1100
+ 'statusvverflow': '值越界',
1101
+ 'statusreadonly': '值只读',
1102
+ 'statusnullvalue': '值不存在',
1103
+ 'statuserror': '值一般错误',
1104
+ 'statuscontrolfail': '控制失败',
1105
+ 'statusaccessdenied': '无访问权限',
1106
+ 'statusinvalidkey': '密钥错误',
1107
+ 'statuschecksumerror': '校验错误',
1093
1108
  'implement': '执行',
1094
1109
  'confirm': '确认',
1095
1110
  'query': '查询',
@@ -222,7 +222,7 @@ export default {
222
222
  this.agentId = val
223
223
  this.resetcomponent = false
224
224
  setIframdevid(val)
225
- this.registerMessage() // 注册消息
225
+ // this.registerMessage() // 注册消息
226
226
  await this.getIntersectionInfo(val)
227
227
  this.$nextTick(() => {
228
228
  this.resetcomponent = true
@@ -249,7 +249,7 @@ export default {
249
249
  this.CrossDiagramMgr = new CrossDiagramMgr()
250
250
  this.agentId = this.AgentId
251
251
  setIframdevid(this.agentId)
252
- this.registerMessage() // 注册消息
252
+ // this.registerMessage() // 注册消息
253
253
  this.getIntersectionInfo(this.agentId)
254
254
  },
255
255
  mounted () {
@@ -380,8 +380,8 @@ export default {
380
380
  })
381
381
  },
382
382
  registerMessage () {
383
- registerMessage(this.agentId).then(data => {
384
- if (!data.data.success) {
383
+ registerMessage(this.agentId, this.protocol).then(data => {
384
+ if (!data.data.success && this.protocol !== 'rcp') {
385
385
  // this.devStatus = 2
386
386
  if (data.data.code === '4002' && data.data.data.errorCode === '4209') {
387
387
  let success = data.data.data.content.success
@@ -406,6 +406,20 @@ export default {
406
406
  this.reSend()
407
407
  }
408
408
  return
409
+ } else {
410
+ if (data.data.code === '4002' && data.data.data.errorCode === '4210') {
411
+ let successArray = data.data.data.content
412
+ successArray.forEach(success => {
413
+ let dataType = this.$t('edge.common.datatype') + ':' + success.DataClass // 数据类
414
+ let objectID = this.$t('edge.common.objectid') + ':' + success.ObjectID // 对象
415
+ let propertyID = this.$t('edge.common.propertyid') + ':' + success.PropertyID // 属性
416
+ let elementID = this.$t('edge.common.elementid') + ':' + success.ElementID // 元素
417
+ let returnCode = this.$t('edge.common.returncode') + ':' + this.getError(success.ReturnCode) // 数据值
418
+ let errormsg = `${dataType} ${objectID} ${propertyID} ${elementID} ${returnCode}`
419
+ this.$message.error(this.$t(errormsg))
420
+ })
421
+ return
422
+ }
409
423
  }
410
424
  // this.devStatus = 3
411
425
  this.clearPatternInterval() // 清除其他定时器
@@ -418,6 +432,31 @@ export default {
418
432
  this.getPhase()
419
433
  })
420
434
  },
435
+ getError (val) {
436
+ if (val === 'Status_BadValue') {
437
+ return this.$t('edge.common.statusbadvalue')
438
+ } else if (val === 'Status_WrongLength') {
439
+ return this.$t('edge.common.statuswronglength')
440
+ } else if (val === 'Status_Overflow') {
441
+ return this.$t('edge.common.statusvverflow')
442
+ } else if (val === 'Status_ReadOnly') {
443
+ return this.$t('edge.common.statusreadonly')
444
+ } else if (val === 'Status_NullValue') {
445
+ return this.$t('edge.common.statusnullvalue')
446
+ } else if (val === 'Status_Error') {
447
+ return this.$t('edge.common.statuserror')
448
+ } else if (val === 'Status_ControlFail') {
449
+ return this.$t('edge.common.statuscontrolfail')
450
+ } else if (val === 'Status_AccessDenied') {
451
+ return this.$t('edge.common.statusaccessdenied')
452
+ } else if (val === 'Status_InvalidKey') {
453
+ return this.$t('edge.common.statusinvalidkey')
454
+ } else if (val === 'Status_ChecksumError') {
455
+ return this.$t('edge.common.statuschecksumerror')
456
+ } else {
457
+ return ''
458
+ }
459
+ },
421
460
  reSend () { // 设备掉线重连机制
422
461
  // this.devStatus = 1
423
462
  this.clearRegisterMessageTimer()
@@ -725,36 +764,36 @@ export default {
725
764
  reconnectionDev () {
726
765
  this.registerMessage()
727
766
  },
728
- queryDevParams () {
729
- queryDevice(this.AgentId).then(res => {
730
- if (!res.data.success) {
731
- this.isShowMessage && this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
732
- return
733
- }
734
- let devParams = res.data.data.jsonparam
735
- this.ip = devParams.ip
736
- this.port = String(devParams.port)
737
- this.protocol = res.data.data.protocol
738
- this.agentId = res.data.data.agentid
739
- if (res.data.data.name) {
740
- this.agentName = res.data.data.name
741
- }
742
- this.platform = res.data.data.platform
743
- let state = res.data.data.state
744
- if (state === 'UP') {
745
- this.stateName = this.$t('openatccomponents.overview.online')
746
- } else {
747
- this.stateName = this.$t('openatccomponents.overview.offline')
748
- }
749
- this.registerMessage() // 注册消息
750
- this.initData()
751
- // 配置工具没参数的时候
752
- this.getIntersectionInfo(this.agentId)
753
- if (this.curHomePage === 'Channelization') {
754
- this.getDetectorStatus()
755
- }
756
- })
757
- },
767
+ // queryDevParams () {
768
+ // queryDevice(this.AgentId).then(res => {
769
+ // if (!res.data.success) {
770
+ // this.isShowMessage && this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
771
+ // return
772
+ // }
773
+ // let devParams = res.data.data.jsonparam
774
+ // this.ip = devParams.ip
775
+ // this.port = String(devParams.port)
776
+ // this.protocol = res.data.data.protocol
777
+ // this.agentId = res.data.data.agentid
778
+ // if (res.data.data.name) {
779
+ // this.agentName = res.data.data.name
780
+ // }
781
+ // this.platform = res.data.data.platform
782
+ // let state = res.data.data.state
783
+ // if (state === 'UP') {
784
+ // this.stateName = this.$t('openatccomponents.overview.online')
785
+ // } else {
786
+ // this.stateName = this.$t('openatccomponents.overview.offline')
787
+ // }
788
+ // this.registerMessage() // 注册消息
789
+ // this.initData()
790
+ // // 配置工具没参数的时候
791
+ // this.getIntersectionInfo(this.agentId)
792
+ // if (this.curHomePage === 'Channelization') {
793
+ // this.getDetectorStatus()
794
+ // }
795
+ // })
796
+ // },
758
797
  getPhase () {
759
798
  uploadSingleTscParam('phase', this.agentId).then(data => {
760
799
  let res = data.data
@@ -800,6 +839,7 @@ export default {
800
839
  this.agentName = res.data.data.name
801
840
  }
802
841
  this.platform = res.data.data.platform
842
+ this.registerMessage() // 注册消息
803
843
  })
804
844
  },
805
845
  getDetectorStatus () {