openatc-components 0.5.13 → 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.13",
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': '查询',
@@ -19,15 +19,25 @@
19
19
  :style="{position: 'absolute', left: '310px', top: '198px', zIndex: '10'}"
20
20
  >
21
21
  <defs>
22
- <filter id="shadow-effect" x="-50%" y="-50%" width="200%" height="200%">
23
- <!-- 对应 box-shadow: 0 0 6px 6px #10B800 -->
24
- <feDropShadow
25
- dx="0"
26
- dy="0"
27
- stdDeviation="4"
28
- flood-color="#10B800"
29
- flood-opacity="1"/>
30
- </filter>
22
+ <filter id="shadow-effect-side"
23
+ x="-10%"
24
+ y="-10%"
25
+ width="200%"
26
+ height="200%">
27
+ <feFlood flood-color="#10B800" flood-opacity="1" result="glowColor" />
28
+ <feComposite in="glowColor"
29
+ in2="SourceGraphic"
30
+ operator="in"
31
+ result="glowMask" />
32
+ <feGaussianBlur in="glowMask" stdDeviation="2" result="blurredGlow" />
33
+ <feComponentTransfer in="blurredGlow" result="brightGlow">
34
+ <feFuncA type="linear" slope="2" />
35
+ </feComponentTransfer>
36
+ <feMerge>
37
+ <feMergeNode in="brightGlow" />
38
+ <feMergeNode in="SourceGraphic" />
39
+ </feMerge>
40
+ </filter>
31
41
  </defs>
32
42
  <g
33
43
  id="西行人"
@@ -1224,7 +1234,7 @@ export default {
1224
1234
  }
1225
1235
  }
1226
1236
  clickedPath.setAttribute('fill', this.clickedColor)
1227
- clickedPath.setAttribute('filter', 'url(#shadow-effect)')
1237
+ clickedPath.setAttribute('filter', 'url(#shadow-effect-side)')
1228
1238
  }
1229
1239
  this.$emit('handleClickSidewalkIcon', this.sidewalkData, curChoosePed)
1230
1240
  }
@@ -1239,7 +1249,7 @@ export default {
1239
1249
  let data = this.sidewalkData.filter(ele => ele.id === side.id)[0]
1240
1250
  if (data && data.clicked === true) {
1241
1251
  dom.setAttribute('fill', this.clickedColor)
1242
- dom.setAttribute('filter', 'url(#shadow-effect)')
1252
+ dom.setAttribute('filter', 'url(#shadow-effect-side)')
1243
1253
  }
1244
1254
  if (this.clickMode && data && data.disabled === true) {
1245
1255
  dom.setAttribute('fill', this.disabledColor)
@@ -1411,8 +1411,8 @@ export default {
1411
1411
  } else {
1412
1412
  nextSelected = this.inneChoosedDirection.filter(d => d !== id)
1413
1413
  }
1414
- // 第三方信号机检查是否冲突,冲突提示是否确定;非第三方不进冲突检查
1415
- if (this.isThirdSignal && this.checkConflict(nextSelected)) {
1414
+ // 检查是否冲突,冲突提示是否确定
1415
+ if (this.checkConflict(nextSelected)) {
1416
1416
  try {
1417
1417
  await this.$confirm(this.$t('openatccomponents.overview.conflictdirectionstips'), this.$t('openatccomponents.common.tipsmodaltitle'), {
1418
1418
  confirmButtonText: this.$t('openatccomponents.button.OK'),
@@ -18,14 +18,24 @@
18
18
  </svg> -->
19
19
  <svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 36 26" :width="IconLengh" :height="IconWdith">
20
20
  <defs>
21
- <filter id="shadow-effect" x="-50%" y="-50%" width="200%" height="200%">
22
- <!-- 对应 box-shadow: 0 0 6px 6px #10B800 -->
23
- <feDropShadow
24
- dx="0"
25
- dy="0"
26
- stdDeviation="4"
27
- flood-color="#10B800"
28
- flood-opacity="1"/>
21
+ <filter id="shadow-effect"
22
+ x="-10%"
23
+ y="-10%"
24
+ width="200%"
25
+ height="200%">
26
+ <feFlood flood-color="#10B800" flood-opacity="1" result="glowColor" />
27
+ <feComposite in="glowColor"
28
+ in2="SourceGraphic"
29
+ operator="in"
30
+ result="glowMask" />
31
+ <feGaussianBlur in="glowMask" stdDeviation="2" result="blurredGlow" />
32
+ <feComponentTransfer in="blurredGlow" result="brightGlow">
33
+ <feFuncA type="linear" slope="2" />
34
+ </feComponentTransfer>
35
+ <feMerge>
36
+ <feMergeNode in="brightGlow" />
37
+ <feMergeNode in="SourceGraphic" />
38
+ </feMerge>
29
39
  </filter>
30
40
  </defs>
31
41
  <!-- 东相位 -->
@@ -148,8 +158,7 @@ export default {
148
158
  default: false
149
159
  },
150
160
  beforeSelect: {
151
- type: Function,
152
- required: true
161
+ type: Function
153
162
  }
154
163
  },
155
164
  methods: {
@@ -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 () {