openatc-components 0.0.50 → 0.0.51

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.
Files changed (291) hide show
  1. package/.babelrc +18 -18
  2. package/.editorconfig +9 -9
  3. package/.eslintignore +5 -5
  4. package/.eslintrc.js +29 -29
  5. package/.postcssrc.js +10 -10
  6. package/README.md +30 -30
  7. package/build/build.js +41 -41
  8. package/build/check-versions.js +54 -54
  9. package/build/package.config.js +58 -58
  10. package/build/package.dev.config.js +107 -107
  11. package/build/package.prod.config.js +160 -160
  12. package/build/utils.js +101 -101
  13. package/build/vue-loader.conf.js +22 -22
  14. package/build/webpack.base.conf.js +114 -114
  15. package/build/webpack.dev.conf.js +95 -95
  16. package/build/webpack.prod.conf.js +149 -149
  17. package/config/dev.env.js +8 -8
  18. package/config/index.js +91 -91
  19. package/config/prod.env.js +5 -5
  20. package/config/test.env.js +7 -7
  21. package/index.html +12 -12
  22. package/package/kisscomps/components/BoardCard/BoardCard.vue +89 -89
  23. package/package/kisscomps/components/BoardCard/index.js +2 -2
  24. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +118 -118
  25. package/package/kisscomps/components/CommonKanban/index.js +2 -2
  26. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +93 -93
  27. package/package/kisscomps/components/ExpendConfig/index.js +2 -2
  28. package/package/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +170 -170
  29. package/package/kisscomps/components/FaultDetailModal/index.js +2 -2
  30. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +497 -497
  31. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  32. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PatternWalkSvg.vue +429 -429
  33. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  34. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  35. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  36. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  37. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  38. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  39. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1179 -1179
  40. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  41. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  42. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  43. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  44. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  45. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  46. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  47. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  48. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  49. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  50. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  51. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  52. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  53. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  54. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  55. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +898 -898
  56. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +112 -112
  57. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +112 -112
  58. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +111 -111
  59. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  60. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  61. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +99 -99
  62. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +99 -99
  63. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  64. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +99 -99
  65. package/package/kisscomps/components/IntersectionMap/crossDirection/utils.js +78 -78
  66. package/package/kisscomps/components/IntersectionMap/index.js +2 -2
  67. package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +148 -148
  68. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +513 -513
  69. package/package/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  70. package/package/kisscomps/components/KanBan/index.js +2 -2
  71. package/package/kisscomps/components/KanBan/kanban.vue +219 -219
  72. package/package/kisscomps/components/OverLap/OverLap.vue +205 -205
  73. package/package/kisscomps/components/OverLap/index.js +2 -2
  74. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +846 -846
  75. package/package/kisscomps/components/PatternStatus/index.js +2 -2
  76. package/package/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +428 -428
  77. package/package/kisscomps/components/PatternWalkSvg/index.js +2 -2
  78. package/package/kisscomps/components/PhaseMarker/index.js +6 -6
  79. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  80. package/package/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  81. package/package/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  82. package/package/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  83. package/package/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  84. package/package/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  85. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +714 -714
  86. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +195 -195
  87. package/package/kisscomps/components/SchemeConfig/index.js +2 -2
  88. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +198 -198
  89. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +198 -198
  90. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +263 -263
  91. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1427 -1427
  92. package/package/kisscomps/components/StageBord/StageBord.vue +243 -243
  93. package/package/kisscomps/components/StageBord/index.js +2 -2
  94. package/package/kisscomps/components/StageStatus/StageStatus.vue +306 -306
  95. package/package/kisscomps/components/StageStatus/index.js +2 -2
  96. package/package/kisscomps/components/Stages/index.vue +122 -126
  97. package/package/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  98. package/package/kisscomps/components/SvgIcon/index.js +2 -2
  99. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +522 -522
  100. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  101. package/package/kisscomps/components/overView/index.vue +656 -656
  102. package/package/kisscomps/components/patternList/index.js +2 -2
  103. package/package/kisscomps/components/patternList/patternList.vue +562 -562
  104. package/package/kisscomps/index.js +85 -85
  105. package/package/kissui.min.js +1 -1
  106. package/package.json +122 -122
  107. package/src/App.vue +24 -24
  108. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  109. package/src/EdgeMgr/controller/crossDiagramMgr.js +120 -120
  110. package/src/api/authapi.js +31 -31
  111. package/src/api/config.js +21 -21
  112. package/src/api/control.js +76 -76
  113. package/src/api/fault.js +66 -66
  114. package/src/api/index.js +24 -24
  115. package/src/api/login.js +46 -46
  116. package/src/api/optimize.js +72 -72
  117. package/src/api/param.js +154 -154
  118. package/src/api/passwdAssest.js +101 -101
  119. package/src/api/template.js +27 -27
  120. package/src/i18n/index.js +26 -26
  121. package/src/i18n/language/en.js +1111 -1111
  122. package/src/i18n/language/index.js +25 -25
  123. package/src/i18n/language/zh.js +1110 -1110
  124. package/src/icons/index.js +20 -20
  125. package/src/icons/svg/bendi.svg +110 -110
  126. package/src/icons/svg/bujin.svg +36 -36
  127. package/src/icons/svg/connectBlue.svg +7 -7
  128. package/src/icons/svg/currentvolume.svg +0 -0
  129. package/src/icons/svg/cutRed.svg +7 -7
  130. package/src/icons/svg/cycle.svg +0 -0
  131. package/src/icons/svg/dingzhouqi.svg +34 -34
  132. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  133. package/src/icons/svg/guandeng.svg +81 -81
  134. package/src/icons/svg/huangshan.svg +71 -71
  135. package/src/icons/svg/maincontrol.svg +0 -0
  136. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  137. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  138. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  139. package/src/icons/svg/model.svg +0 -0
  140. package/src/icons/svg/phasediff.svg +0 -0
  141. package/src/icons/svg/quanhong.svg +86 -86
  142. package/src/icons/svg/shanghe.svg +11 -11
  143. package/src/icons/svg/shoudong.svg +103 -103
  144. package/src/icons/svg/time.svg +0 -0
  145. package/src/icons/svg/wuxianlan.svg +46 -46
  146. package/src/icons/svg/xiala.svg +11 -11
  147. package/src/icons/svg/xingrenguojie.svg +33 -33
  148. package/src/icons/svg/xitong.svg +89 -89
  149. package/src/icons/svg/youxian.svg +41 -41
  150. package/src/icons/svg/zizhukongzhi.svg +43 -43
  151. package/src/kisscomps/components/BoardCard/BoardCard.vue +89 -89
  152. package/src/kisscomps/components/BoardCard/index.js +2 -2
  153. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +118 -118
  154. package/src/kisscomps/components/CommonKanban/index.js +2 -2
  155. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +93 -93
  156. package/src/kisscomps/components/ExpendConfig/index.js +2 -2
  157. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +170 -170
  158. package/src/kisscomps/components/FaultDetailModal/index.js +2 -2
  159. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +497 -497
  160. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  161. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PatternWalkSvg.vue +429 -429
  162. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  163. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  164. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  165. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  166. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  167. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  168. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1179 -1179
  169. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  170. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  171. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  172. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  173. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  174. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  175. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  176. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  177. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  178. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  179. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  180. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  181. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  182. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  183. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  184. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +898 -898
  185. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +112 -112
  186. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +112 -112
  187. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +111 -111
  188. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  189. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  190. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +99 -99
  191. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +99 -99
  192. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  193. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +99 -99
  194. package/src/kisscomps/components/IntersectionMap/crossDirection/utils.js +78 -78
  195. package/src/kisscomps/components/IntersectionMap/index.js +2 -2
  196. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +148 -148
  197. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +513 -513
  198. package/src/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  199. package/src/kisscomps/components/KanBan/index.js +2 -2
  200. package/src/kisscomps/components/KanBan/kanban.vue +219 -219
  201. package/src/kisscomps/components/OverLap/OverLap.vue +205 -205
  202. package/src/kisscomps/components/OverLap/index.js +2 -2
  203. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +846 -846
  204. package/src/kisscomps/components/PatternStatus/index.js +2 -2
  205. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +428 -428
  206. package/src/kisscomps/components/PatternWalkSvg/index.js +2 -2
  207. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  208. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  209. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  210. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  211. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  212. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  213. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  214. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +714 -714
  215. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +195 -195
  216. package/src/kisscomps/components/SchemeConfig/index.js +2 -2
  217. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +198 -198
  218. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +198 -198
  219. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +263 -263
  220. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1427 -1427
  221. package/src/kisscomps/components/StageBord/StageBord.vue +243 -243
  222. package/src/kisscomps/components/StageBord/index.js +2 -2
  223. package/src/kisscomps/components/StageStatus/StageStatus.vue +306 -306
  224. package/src/kisscomps/components/StageStatus/index.js +2 -2
  225. package/src/kisscomps/components/Stages/index.vue +122 -126
  226. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  227. package/src/kisscomps/components/SvgIcon/index.js +2 -2
  228. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +522 -522
  229. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  230. package/src/kisscomps/components/overView/index.vue +656 -656
  231. package/src/kisscomps/components/patternList/index.js +2 -2
  232. package/src/kisscomps/components/patternList/patternList.vue +562 -562
  233. package/src/kisscomps/index.js +85 -85
  234. package/src/lib/publicjs/ArryListUtil.js +38 -38
  235. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  236. package/src/lib/publicjs/KissApi.js +158 -158
  237. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  238. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  239. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  240. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  241. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  242. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  243. package/src/lib/publicjs/basecomponents.js +65 -65
  244. package/src/lib/publicjs/localStorage.js +112 -112
  245. package/src/lib/publicjs/objdeepcopy.js +32 -32
  246. package/src/lib/publicjs/pageScroll.js +30 -30
  247. package/src/lib/publicjs/passwdAssest.js +101 -101
  248. package/src/lib/publicjs/styleclassfactory.js +32 -32
  249. package/src/main.js +47 -47
  250. package/src/router/index.js +36 -36
  251. package/src/store/getters.js +16 -16
  252. package/src/store/index.js +26 -26
  253. package/src/store/modules/globalParam.js +27 -27
  254. package/src/utils/ControlFormat.js +68 -68
  255. package/src/utils/RingDataModel.js +173 -173
  256. package/src/utils/auth.js +110 -110
  257. package/src/utils/dateFormat.js +41 -41
  258. package/src/utils/errorcode.js +224 -224
  259. package/src/utils/fault.js +195 -195
  260. package/src/utils/faultcode.js +209 -209
  261. package/src/utils/index.js +69 -69
  262. package/src/utils/pedphasedesc.js +119 -119
  263. package/src/utils/phasedesc.js +124 -124
  264. package/src/utils/responseMessage.js +21 -21
  265. package/src/utils/validate.js +43 -43
  266. package/src/views/home.1.vue +479 -479
  267. package/src/views/home.vue +78 -78
  268. package/src/views/intersection.vue +276 -276
  269. package/src/views/overView.vue +33 -33
  270. package/src/views/schemeconfig.vue +154 -154
  271. package/static/apiconfig.json +336 -336
  272. package/static/styles/common.scss +19 -19
  273. package/static/styles/commonkanban.scss +87 -87
  274. package/static/styles/dark/index.scss +2 -2
  275. package/static/styles/dark/theme/element-dark.scss +42 -42
  276. package/static/styles/index.scss +84 -84
  277. package/static/styles/intersection.scss +161 -161
  278. package/static/styles/light/index.scss +2 -2
  279. package/static/styles/light/theme/element-light.scss +42 -42
  280. package/static/styles/overview.scss +371 -371
  281. package/static/styles/schemeconfig.scss +396 -396
  282. package/static/styles/stages.scss +64 -64
  283. package/static/token.json +2 -2
  284. package/test/e2e/custom-assertions/elementCount.js +27 -27
  285. package/test/e2e/nightwatch.conf.js +46 -46
  286. package/test/e2e/runner.js +48 -48
  287. package/test/e2e/specs/test.js +19 -19
  288. package/test/unit/.eslintrc +7 -7
  289. package/test/unit/jest.conf.js +30 -30
  290. package/test/unit/setup.js +3 -3
  291. package/test/unit/specs/HelloWorld.spec.js +11 -11
@@ -1,656 +1,656 @@
1
- /**
2
- * Copyright (c) 2020 kedacom
3
- * OpenATC is licensed under Mulan PSL v2.
4
- * You can use this software according to the terms and conditions of the Mulan PSL v2.
5
- * You may obtain a copy of Mulan PSL v2 at:
6
- * http://license.coscl.org.cn/MulanPSL2
7
- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
- * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
- * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
- * See the Mulan PSL v2 for more details.
11
- **/
12
- <template>
13
- <div class="container-main">
14
- <div :style="{'transform': `scale(${shrink})`, 'transform-origin': 'left top', 'height': '100%'}">
15
- <!-- <div class="wenzijiemian" v-show="!isShowGui">
16
- <TextPage
17
- ref="textPage"
18
- :agentId="agentId"
19
- :ip="ip"
20
- :port="port"
21
- :protocol="protocol"
22
- :devStatus="devStatus"
23
- :originControlData="controlData" />
24
- </div> -->
25
- <div class="tuxingjiemian" :class="{'minifont': curBodyWidth <= 650}">
26
- <div class="tuxing-left" :class="{'changeWidth': graphicMode}" ref="tuxingLeft">
27
- <intersection-base-map
28
- ref="intersectionMap"
29
- :crossStatusData="crossStatusData"
30
- :devStatus="devStatus"
31
- :agentId="agentId"
32
- :graphicMode="graphicMode"
33
- :roadDirection="roadDirection" />
34
- <div class="pattern-status" v-if="!graphicMode">
35
- <div class="pattern-name cross-mess">{{$t('openatccomponents.overview.patternstate')}}</div>
36
- <div class="pattern-message">({{$t('openatccomponents.overview.cycle')}}: {{controlData.cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{controlData.patternoffset}} {{$t('openatccomponents.overview.coordinationtime')}}: {{controlData.offset}})</div>
37
- <!-- <span class="pattern-explain">:{{$t('openatccomponents.overview.phasesplit')}}</span> -->
38
- <span class="pattern-explain"><el-checkbox v-model="checked">{{$t('openatccomponents.pattern.overLap')}}</el-checkbox></span>
39
- <!-- P{{$t('openatccomponents.overview.phase')}} -->
40
- <pattern-list
41
- ref="boardCard"
42
- :cycle="crossStatusData ? crossStatusData.cycle : 0"
43
- :syncTime="crossStatusData ? crossStatusData.syncTime : 0"
44
- :controlData="controlData"
45
- :contrloType="contrloType"
46
- :patternStatusList="patternList"
47
- :localPatternList="allPatternList"
48
- :phaseList="phaseList"
49
- :isPhase="true"
50
- :agentId="agentId"
51
- >
52
- </pattern-list>
53
- <over-lap
54
- v-if="!contrloType"
55
- :checked="checked"
56
- :overlap="overlap"
57
- :stageList="stagesListOver"
58
- :cycle="controlData.cycle"
59
- :controlData="controlData"
60
- >
61
- </over-lap>
62
- </div>
63
- </div>
64
-
65
- <div ref="tuxingRight" class="tuxing-right" >
66
- <scheme-config
67
- ref="rightpanel"
68
- :statusData="crossStatusData"
69
- :agentName="agentName"
70
- :responseTime="responseTime"
71
- :devStatus="devStatus"
72
- :agentId="agentId"
73
- :ip="ip"
74
- :platform="platform"
75
- :funcSort="FuncSort"
76
- :roadDirection="roadDirection" />
77
- </div>
78
- </div>
79
- </div>
80
- </div>
81
- </template>
82
-
83
- <script>
84
- import { mapState } from 'vuex'
85
- import { getTscControl, queryDevice } from '../../../api/control'
86
- import { registerMessage, uploadSingleTscParam } from '../../../api/param'
87
- import { setIframdevid, getStageTypes, setToken, setHost } from '../../../utils/auth'
88
- // import BoardCard from '@/components/BoardCard'
89
- // import OverLap from '@/components/OverLap'
90
- import { getIntersectionInfo } from '../../../api/template'
91
- // import { getFaultMesZh, getFaultMesEn } from '../../utils/faultcode.js'
92
- import { getMessageByCode } from '../../../utils/responseMessage'
93
- import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
94
- import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr'
95
- // import TextPage from './textPage/index'
96
- // import { setToken, setHost } from '../../../utils/auth.js'
97
- export default {
98
- name: 'overview',
99
- components: {
100
- // TextPage
101
- },
102
- props: {
103
- reqUrl: {
104
- type: String,
105
- default: 'http://192.168.13.105:11003/openatc'
106
- },
107
- AgentId: {
108
- type: String,
109
- default: '0'
110
- },
111
- Token: {
112
- type: String,
113
- default: ''
114
- },
115
- roadDirection: {
116
- type: String,
117
- default: 'right'
118
- }
119
- },
120
- data () {
121
- return {
122
- curBodyWidth: 1920,
123
- graphicMode: false,
124
- FuncSort: 'allFunc',
125
- controlData: {},
126
- checked: false,
127
- overlap: [],
128
- contrloType: false,
129
- narr: [],
130
- patternList: [],
131
- allPatternList: [],
132
- stagesListOver: [],
133
- sidewalkPhaseData: [],
134
- phaseControlTimer: null, // 定时器
135
- registerMessageTimer: null, // 延时器
136
- volumeControlTimer: null, // 流量定时器
137
- ParamsMode: new Map([[0, '自主控制'], [1, '本地手动'], [2, '平台控制'], [3, '配置软件控制'], [4, '遥控器控制'], [5, '黄闪器控制'], [6, '降级控制'], [7, '脚本控制'], [8, '算法控制']]),
138
- ParamsModeEn: new Map([[0, 'Autonomous Control'], [1, 'Local Manual'], [2, 'Platform Control'], [3, 'Configuration Software Control'], [4, 'Remote Control'], [5, 'Yellow Flasher Control'], [6, 'Degradation Control'], [7, 'Script Control'], [8, 'Algorithm Control']]),
139
- ParamsControl: new Map([[0, '多时段'], [1, '黄闪'], [2, '全红'], [3, '关灯'], [4, '步进'], [5, '定周期控制'], [6, '单点感应控制'], [7, '协调感应控制'], [8, '方案选择控制'], [9, '自适应控制'], [10, '无电缆控制'], [11, '有电缆控制'], [12, '行人过街控制'], [13, '方案恢复过渡'], [14, '相位驻留'], [15, '通道检测'], [16, '方向锁定'], [17, '韦伯斯特单点控制'], [18, '预留18'], [19, '感应式行人过街'], [20, '方案干预'], [100, '方案干预'], [21, '预留21'], [22, '相位锁定'], [23, '相位放行控制'], [24, '紧急控制'], [99, '设备维护']]),
140
- ParamsControlEn: new Map([[0, 'Multi Period'], [1, 'Yellow Flash Control'], [2, 'Red Control'], [3, 'Dark Control'], [4, 'Step'], [5, 'Fixed_Cycle Control'], [6, 'Free Control'], [7, 'Coordinated Induction Control'], [8, 'Pattern Selection Control'], [9, 'Adaptive Control'], [10, 'Wireless Control'], [11, 'Cable Control'], [12, 'Pedestrian Crossing Control'], [13, 'Pattern recovery'], [14, 'Phase dwell'], [15, 'Channel Detection'], [16, 'Direction lock'], [17, 'Webster Single Point Coordination'], [18, 'Reserving18'], [19, 'Inductive Pedestrian Crossing Control'], [20, 'Program Intervention'], [100, 'Program Intervention'], [21, 'Reserving21'], [22, 'Priority Control'], [23, 'Close Phase'], [24, 'Emergency Control'], [99, 'Device Mantenance']]),
141
- phaseType: new Map([[1, '红'], [2, '黄'], [3, '绿']]), // phaseType表示红,黄,绿
142
- phaseTypeEn: new Map([[1, 'Red'], [2, 'Yellow'], [3, 'Green']]), // phaseType表示红,黄,绿
143
- ip: '--',
144
- port: '--',
145
- protocol: '--',
146
- devStatus: 1,
147
- mode: '2',
148
- agentId: '0',
149
- agentName: '--',
150
- platform: undefined,
151
- crossStatusData: {}, // 路口状态数据
152
- reset: false,
153
- responseTime: 0,
154
- phaseList: [], // 当前相位集合
155
- intervalFlag: true,
156
- shrink: 1,
157
- isResend: true,
158
- commonHeight: undefined // 左右侧面板的高度值
159
- }
160
- },
161
- computed: {
162
- // patternList () {
163
- // return this.$store.state.globalParam.tscParam.patternList
164
- // },
165
- ...mapState({
166
- // curBodyWidth: state => state.globalParam.curBodyWidth,
167
- curBodyHeight: state => state.globalParam.curBodyHeight,
168
- // FuncSort: state => state.globalParam.FuncSort,
169
- hideMenu: state => state.globalParam.hideMenu
170
- // graphicMode: state => state.globalParam.graphicMode
171
- // isShowGui: state => state.globalParam.isShowGui,
172
- // roadDirection: state => state.globalParam.roadDirection
173
- })
174
- },
175
- watch: {
176
- AgentId: {
177
- handler: function (val, oldVal) {
178
- this.agentId = val
179
- },
180
- // 深度观察监听
181
- deep: true
182
- },
183
- Token: {
184
- handler: function (val) {
185
- this.setPropsToken(val)
186
- }
187
- },
188
- $route: {
189
- handler: function (val, oldVal) {
190
- if (val.query !== undefined) {
191
- if (this.$route.query.shrink) {
192
- this.shrink = Number(this.$route.query.shrink)
193
- }
194
- this.agentId = this.$route.query.agentid
195
- setIframdevid(this.agentId)
196
- this.getPlatform()
197
- this.$refs.rightpanel.getFaultById()
198
- }
199
- },
200
- // 深度观察监听
201
- deep: true
202
- },
203
- phaseList: {
204
- handler: function (val, oldVal) {
205
- this.getPedPhasePos()
206
- },
207
- // 深度观察监听
208
- deep: true
209
- }
210
- },
211
- created () {
212
- this.agentId = this.AgentId
213
- this.setHost(this.reqUrl)
214
- this.PhaseDataModel = new PhaseDataModel()
215
- this.CrossDiagramMgr = new CrossDiagramMgr()
216
- if (getStageTypes('contrloType') === 'true') {
217
- this.contrloType = true
218
- } else {
219
- this.contrloType = false
220
- }
221
- this.globalParamModel = this.$store.getters.globalParamModel
222
- if (this.$route.query !== undefined && Object.keys(this.$route.query).length) {
223
- this.agentId = this.$route.query.agentid
224
- setIframdevid(this.agentId)
225
- this.registerMessage() // 注册消息
226
- this.getIntersectionInfo(this.agentId, this.crossStatusData.patternid)
227
- } else {
228
- this.queryDevParams() // 查询设备信息
229
- }
230
- },
231
- mounted () {
232
- this.getPlatform()
233
- if (this.$route.query.shrink) {
234
- this.shrink = Number(this.$route.query.shrink)
235
- }
236
- var _this = this
237
- _this.$nextTick(function () {
238
- this.curBodyWidth = this.$el.parentElement.clientWidth
239
- })
240
- },
241
- updated () {
242
- if (this.$refs.tuxingLeft.offsetHeight !== this.commonHeight) {
243
- // 根据左侧面板动态变化的高度,同步更新右侧面板高度
244
- this.commonHeight = this.$refs.tuxingLeft.offsetHeight
245
- this.$refs.tuxingRight.style.height = this.commonHeight + 'px'
246
- }
247
- },
248
- methods: {
249
- setPropsToken (token) {
250
- // 获取组件外传入的token,便于独立组件调用接口
251
- if (token && token !== '') {
252
- setToken(token)
253
- }
254
- },
255
- setHost (host) {
256
- // 获取组件外传入的token,便于独立组件调用接口
257
- if (host && host !== '') {
258
- setHost(host)
259
- }
260
- },
261
- getIntersectionInfo (agentid, id) {
262
- // 获取路口信息
263
- getIntersectionInfo(agentid).then(res => {
264
- // this.globalParamModel.setGlobalParams(res.data.data.param)
265
- this.allPatternList = res.data.data.param.patternList
266
- this.overlap = res.data.data.param.overlaplList
267
- this.phaseList = res.data.data.param.phaseList
268
- this.patternList = res.data.data.param.patternList.filter(item => {
269
- return item.id === id
270
- })[0].rings
271
- })
272
- },
273
- getPedPhasePos () {
274
- // 行人相位信息
275
- this.sidewalkPhaseData = []
276
- this.phaseList.forEach((ele, i) => {
277
- if (ele.peddirection) {
278
- ele.peddirection.forEach((dir, index) => {
279
- // 行人相位
280
- if (this.PhaseDataModel.getSidePos(dir)) {
281
- this.sidewalkPhaseData.push({
282
- key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
283
- phaseid: ele.id, // 相位id,用于对应相位状态
284
- id: dir,
285
- name: this.PhaseDataModel.getSidePos(dir).name
286
- })
287
- }
288
- })
289
- }
290
- })
291
- },
292
- registerMessage () {
293
- registerMessage(this.AgentId).then(data => {
294
- if (!data.data.success) {
295
- this.devStatus = 2
296
- let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
297
- if (data.data.data) {
298
- // 子类型错误
299
- let childErrorCode = data.data.data.errorCode
300
- if (childErrorCode) {
301
- let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
302
- this.$message.error(parrenterror + ',' + childerror)
303
- }
304
- } else {
305
- this.$message.error(parrenterror)
306
- }
307
- if (this.isResend) {
308
- this.reSend()
309
- }
310
- return
311
- }
312
- this.devStatus = 3
313
- this.clearPatternInterval() // 清除其他定时器
314
- this.clearVolumeInterval()
315
- this.phaseControlTimer = setInterval(() => {
316
- if (this.intervalFlag) {
317
- this.initData()
318
- }
319
- }, 1000)
320
- // this.$refs.textPage.getVolume()
321
- // this.volumeControlTimer = setInterval(() => {
322
- // this.$refs.textPage.getVolume()
323
- // }, 300000)
324
- this.getPhase()
325
- })
326
- },
327
- reSend () { // 设备掉线重连机制
328
- this.devStatus = 1
329
- this.clearRegisterMessageTimer()
330
- this.registerMessageTimer = setTimeout(() => {
331
- this.reconnectionDev()
332
- }, 5000)
333
- },
334
- clearPatternInterval () {
335
- if (this.phaseControlTimer !== null) {
336
- clearInterval(this.phaseControlTimer) // 清除定时器
337
- this.phaseControlTimer = null
338
- }
339
- },
340
- clearVolumeInterval () {
341
- if (this.volumeControlTimer !== null) {
342
- clearInterval(this.volumeControlTimer) // 清除流量定时器
343
- this.volumeControlTimer = null
344
- }
345
- },
346
- clearRegisterMessageTimer () {
347
- if (this.registerMessageTimer !== null) {
348
- clearTimeout(this.registerMessageTimer) // 清除延时器
349
- this.registerMessageTimer = null
350
- }
351
- },
352
- initData () {
353
- this.intervalFlag = false
354
- let startTime = new Date().getTime()
355
- getTscControl(this.AgentId).then((data) => {
356
- let endTime = new Date().getTime()
357
- let diffTime = endTime - startTime
358
- this.responseTime = diffTime
359
- this.intervalFlag = true
360
- if (!data.data.success) {
361
- if (data.data.code === '4003') {
362
- this.devStatus = 2
363
- this.clearPatternInterval() // 清除其他定时器
364
- this.clearVolumeInterval()
365
- this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
366
- if (this.isResend) {
367
- this.reSend()
368
- }
369
- return
370
- }
371
- let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
372
- if (data.data.data) {
373
- // 子类型错误
374
- let childErrorCode = data.data.data.errorCode
375
- if (childErrorCode) {
376
- let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
377
- this.$message.error(parrenterror + ',' + childerror)
378
- }
379
- } else {
380
- this.$message.error(parrenterror)
381
- }
382
- this.clearPatternInterval() // 清除其他定时器
383
- this.clearVolumeInterval()
384
- if (this.isResend) {
385
- this.reSend()
386
- }
387
- return
388
- }
389
- this.crossStatusData = JSON.parse(JSON.stringify(data.data.data.data))
390
- let TscData = JSON.parse(JSON.stringify(data.data.data.data))
391
- // this.handleStageData(TscData) // 处理阶段(驻留)stage数据
392
- this.controlData = this.handleGetData(TscData)
393
- this.checkStage(this.controlData)
394
- }).catch(error => {
395
- // this.$message.error(error)
396
- console.log(error)
397
- })
398
- },
399
- getControl (newList) { // 总揽实时数据
400
- let currentIds = ''
401
- let lastCurrentIds = ''
402
- this.stateList = [0]
403
- this.narr = []
404
- let overstagesList = []
405
- let phaseList = []
406
- for (let j = 0; j <= this.max; j++) { // 指针长度
407
- for (let i = 0; i < newList.length; i++) { // 环列表
408
- let ring = newList[i]// 每个环对象
409
- let sum = 0
410
- for (let n = 0; n < ring.length; n++) { // 相位累计长度
411
- if (ring[n].mode !== 7) {
412
- sum = sum + ring[n].split
413
- if (j < sum) {
414
- let phaseId = ring[n].id
415
- currentIds = currentIds + '-' + phaseId
416
- break
417
- }
418
- }
419
- }
420
- }
421
- if (lastCurrentIds !== currentIds && lastCurrentIds !== '') { // 当前相位id和上一个相比不同说明相位变化了
422
- phaseList.push(lastCurrentIds)
423
- this.stateList.push(j)// 阶段累计长度的集合
424
- }
425
- lastCurrentIds = currentIds
426
- currentIds = ''
427
- }
428
- let newPhaselist = []
429
- phaseList.forEach(i => {
430
- let rangeArr = i.split('-').map(Number)
431
- if (rangeArr.length > 2) {
432
- newPhaselist.push([
433
- JSON.parse(JSON.stringify(rangeArr[1])),
434
- JSON.parse(JSON.stringify(rangeArr[2]))
435
- ])
436
- } else {
437
- newPhaselist.push([
438
- JSON.parse(JSON.stringify(rangeArr[1]))
439
- ])
440
- }
441
- })
442
- for (let i = this.stateList.length - 1; i >= 1; i--) {
443
- this.narr.push(this.stateList[i] - this.stateList[i - 1])
444
- }
445
- this.narr.reverse()// 阶段差
446
- for (let i = 0; i < newPhaselist.length; i++) {
447
- let stage = JSON.parse(JSON.stringify(newPhaselist[i]))
448
- let stageItem = this.getStageItem(stage, newList, i)
449
- overstagesList.push(JSON.parse(JSON.stringify(stageItem)))
450
- }
451
- this.stagesListOver = JSON.parse(JSON.stringify(overstagesList))
452
- },
453
- getStageItem (stageArr, ringsList, i) {
454
- let res = {
455
- key: i,
456
- split: this.narr[i], // 阶段绿性比
457
- stages: stageArr,
458
- delaystart: 0,
459
- advanceend: 0
460
- }
461
- // let splitArr = []
462
- let delaystartArr = []
463
- let advanceendArr = []
464
- for (let rings of ringsList) {
465
- for (let ring of rings) {
466
- if (stageArr.includes(ring.id)) {
467
- // let split = ring.value
468
- let delaystart = ring.delaystart
469
- let advanceend = ring.advanceend
470
- // splitArr.push(split)
471
- delaystartArr.push(delaystart)
472
- advanceendArr.push(advanceend)
473
- }
474
- }
475
- }
476
- // splitArr.sort(function (a, b) { return a - b })
477
- delaystartArr.sort(function (a, b) { return b - a })
478
- advanceendArr.sort(function (a, b) { return a - b })
479
- // res.split = splitArr.length > 0 ? splitArr[0] : 0
480
- res.delaystart = delaystartArr.length > 0 ? delaystartArr[0] : 0
481
- res.advanceend = advanceendArr.length > 0 ? advanceendArr[0] : 0
482
- return res
483
- },
484
- checkStage (rings) {
485
- if (!rings.phase || !rings.rings) return
486
- let mapAdd = rings.phase.map(item => {
487
- return {
488
- id: item.id,
489
- split: item.split
490
- }
491
- })
492
- let newRings = rings.rings.map(j => {
493
- return j.sequence
494
- })
495
- let newList = newRings.map(item => {
496
- let ret = []
497
- item.map(i => {
498
- const find = mapAdd.find(j => j.id === i)
499
- if (find) {
500
- ret.push(find)
501
- }
502
- })
503
- return ret
504
- })
505
- let mapAdds = newList.map(item => {
506
- return item.map(val => {
507
- return val.split
508
- })
509
- })
510
- let maxCycle = mapAdds.length > 0 ? mapAdds.map(item => {
511
- return item.length > 0 ? item.reduce((a, b) => {
512
- return a + b
513
- }) : 0
514
- }) : 0
515
- this.max = Math.max(...maxCycle)// 每个环的周期最大值
516
- this.getControl(newList)
517
- },
518
- handleGetData (data) {
519
- let that = this
520
- if (data.name === '') {
521
- if (that.$i18n.locale === 'en') {
522
- data.name = 'Pattern' + data.patternid
523
- } else if (that.$i18n.locale === 'zh') {
524
- data.name = '方案' + data.patternid
525
- }
526
- }
527
- Object.keys(data).forEach(function (key) {
528
- if (that.$i18n.locale === 'en') {
529
- if (key === 'mode') {
530
- if (data[key] > 0 && data[key] < 6) {
531
- data[key] = that.ParamsModeEn.get(data[key])
532
- } else {
533
- data[key] = that.ParamsModeEn.get(0)
534
- }
535
- }
536
- if (key === 'control') {
537
- data[key] = that.ParamsControlEn.get(data[key])
538
- }
539
- if (key === 'phase') {
540
- for (let val of data[key]) {
541
- val.type = that.phaseTypeEn.get(val.type)
542
- }
543
- }
544
- } else if (that.$i18n.locale === 'zh') {
545
- if (key === 'mode') {
546
- if (data[key] > 0 && data[key] < 6) {
547
- data[key] = that.ParamsMode.get(data[key])
548
- } else {
549
- data[key] = that.ParamsMode.get(0)
550
- }
551
- }
552
- if (key === 'control') {
553
- data[key] = that.ParamsControl.get(data[key])
554
- }
555
- if (key === 'phase') {
556
- for (let val of data[key]) {
557
- val.type = that.phaseType.get(val.type)
558
- }
559
- }
560
- }
561
- })
562
- return data
563
- },
564
- reconnectionDev () {
565
- this.registerMessage()
566
- },
567
- queryDevParams () {
568
- queryDevice(this.AgentId).then(res => {
569
- if (!res.data.success) {
570
- this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
571
- return
572
- }
573
- let devParams = res.data.data.jsonparam
574
- this.ip = devParams.ip
575
- this.port = String(devParams.port)
576
- this.protocol = res.data.data.protocol
577
- this.agentId = res.data.data.agentid
578
- if (res.data.data.name) {
579
- this.agentName = res.data.data.name
580
- }
581
- this.platform = res.data.data.platform
582
- if (this.platform === 'OpenATC') {
583
- this.FuncSort = 'allFunc'
584
- }
585
- if (this.platform === 'SCATS' || this.platform === 'HUATONG') {
586
- this.FuncSort = 'basicFunc'
587
- }
588
- this.$refs.intersectionMap.resetCrossDiagram()
589
- this.registerMessage() // 注册消息
590
- this.initData()
591
- this.getIntersectionInfo(this.agentId, this.crossStatusData.patternid)
592
- })
593
- },
594
- getPhase () {
595
- uploadSingleTscParam('phase', this.AgentId).then(data => {
596
- let res = data.data
597
- if (!res.success) {
598
- if (res.code === '4003') {
599
- this.$message.error(this.$t('openatccomponents.errorTip.devicenotonline'))
600
- return
601
- }
602
- this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
603
- return
604
- }
605
- this.phaseList = res.data.data.phaseList
606
- })
607
- },
608
- getPlatform () {
609
- queryDevice(this.AgentId).then(res => {
610
- if (!res.data.success) {
611
- this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
612
- return
613
- }
614
- let devParams = res.data.data.jsonparam
615
- this.ip = devParams.ip
616
- this.port = String(devParams.port)
617
- this.protocol = res.data.data.protocol
618
- this.agentId = res.data.data.agentid
619
- if (res.data.data.name) {
620
- this.agentName = res.data.data.name
621
- }
622
- this.platform = res.data.data.platform
623
- // let func = 'allFunc'
624
- // if (this.platform === 'OpenATC') {
625
- // func = 'allFunc'
626
- // }
627
- // if (this.platform === 'SCATS' || this.platform === 'HUATONG') {
628
- // func = 'basicFunc'
629
- // }
630
- // this.$store.dispatch('SaveFunctionLevel', func)
631
- if (this.platform === 'OpenATC') {
632
- this.FuncSort = 'allFunc'
633
- }
634
- if (this.platform === 'SCATS' || this.platform === 'HUATONG') {
635
- this.FuncSort = 'basicFunc'
636
- }
637
- })
638
- },
639
- isJsonString (str) {
640
- try {
641
- JSON.parse(str)
642
- return true
643
- } catch (err) {
644
- return false
645
- }
646
- }
647
- },
648
- destroyed () {
649
- this.isResend = false
650
- this.clearPatternInterval() // 清除定时器
651
- this.clearVolumeInterval()
652
- this.clearRegisterMessageTimer() // 清除定时器
653
- this.getPlatform()
654
- }
655
- }
656
- </script>
1
+ /**
2
+ * Copyright (c) 2020 kedacom
3
+ * OpenATC is licensed under Mulan PSL v2.
4
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
5
+ * You may obtain a copy of Mulan PSL v2 at:
6
+ * http://license.coscl.org.cn/MulanPSL2
7
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
+ * See the Mulan PSL v2 for more details.
11
+ **/
12
+ <template>
13
+ <div class="container-main">
14
+ <div :style="{'transform': `scale(${shrink})`, 'transform-origin': 'left top', 'height': '100%'}">
15
+ <!-- <div class="wenzijiemian" v-show="!isShowGui">
16
+ <TextPage
17
+ ref="textPage"
18
+ :agentId="agentId"
19
+ :ip="ip"
20
+ :port="port"
21
+ :protocol="protocol"
22
+ :devStatus="devStatus"
23
+ :originControlData="controlData" />
24
+ </div> -->
25
+ <div class="tuxingjiemian" :class="{'minifont': curBodyWidth <= 650}">
26
+ <div class="tuxing-left" :class="{'changeWidth': graphicMode}" ref="tuxingLeft">
27
+ <intersection-base-map
28
+ ref="intersectionMap"
29
+ :crossStatusData="crossStatusData"
30
+ :devStatus="devStatus"
31
+ :agentId="agentId"
32
+ :graphicMode="graphicMode"
33
+ :roadDirection="roadDirection" />
34
+ <div class="pattern-status" v-if="!graphicMode">
35
+ <div class="pattern-name cross-mess">{{$t('openatccomponents.overview.patternstate')}}</div>
36
+ <div class="pattern-message">({{$t('openatccomponents.overview.cycle')}}: {{controlData.cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{controlData.patternoffset}} {{$t('openatccomponents.overview.coordinationtime')}}: {{controlData.offset}})</div>
37
+ <!-- <span class="pattern-explain">:{{$t('openatccomponents.overview.phasesplit')}}</span> -->
38
+ <span class="pattern-explain"><el-checkbox v-model="checked">{{$t('openatccomponents.pattern.overLap')}}</el-checkbox></span>
39
+ <!-- P{{$t('openatccomponents.overview.phase')}} -->
40
+ <pattern-list
41
+ ref="boardCard"
42
+ :cycle="crossStatusData ? crossStatusData.cycle : 0"
43
+ :syncTime="crossStatusData ? crossStatusData.syncTime : 0"
44
+ :controlData="controlData"
45
+ :contrloType="contrloType"
46
+ :patternStatusList="patternList"
47
+ :localPatternList="allPatternList"
48
+ :phaseList="phaseList"
49
+ :isPhase="true"
50
+ :agentId="agentId"
51
+ >
52
+ </pattern-list>
53
+ <over-lap
54
+ v-if="!contrloType"
55
+ :checked="checked"
56
+ :overlap="overlap"
57
+ :stageList="stagesListOver"
58
+ :cycle="controlData.cycle"
59
+ :controlData="controlData"
60
+ >
61
+ </over-lap>
62
+ </div>
63
+ </div>
64
+
65
+ <div ref="tuxingRight" class="tuxing-right" >
66
+ <scheme-config
67
+ ref="rightpanel"
68
+ :statusData="crossStatusData"
69
+ :agentName="agentName"
70
+ :responseTime="responseTime"
71
+ :devStatus="devStatus"
72
+ :agentId="agentId"
73
+ :ip="ip"
74
+ :platform="platform"
75
+ :funcSort="FuncSort"
76
+ :roadDirection="roadDirection" />
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </template>
82
+
83
+ <script>
84
+ import { mapState } from 'vuex'
85
+ import { getTscControl, queryDevice } from '../../../api/control'
86
+ import { registerMessage, uploadSingleTscParam } from '../../../api/param'
87
+ import { setIframdevid, getStageTypes, setToken, setHost } from '../../../utils/auth'
88
+ // import BoardCard from '@/components/BoardCard'
89
+ // import OverLap from '@/components/OverLap'
90
+ import { getIntersectionInfo } from '../../../api/template'
91
+ // import { getFaultMesZh, getFaultMesEn } from '../../utils/faultcode.js'
92
+ import { getMessageByCode } from '../../../utils/responseMessage'
93
+ import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
94
+ import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr'
95
+ // import TextPage from './textPage/index'
96
+ // import { setToken, setHost } from '../../../utils/auth.js'
97
+ export default {
98
+ name: 'overview',
99
+ components: {
100
+ // TextPage
101
+ },
102
+ props: {
103
+ reqUrl: {
104
+ type: String,
105
+ default: 'http://192.168.13.105:11003/openatc'
106
+ },
107
+ AgentId: {
108
+ type: String,
109
+ default: '0'
110
+ },
111
+ Token: {
112
+ type: String,
113
+ default: ''
114
+ },
115
+ roadDirection: {
116
+ type: String,
117
+ default: 'right'
118
+ }
119
+ },
120
+ data () {
121
+ return {
122
+ curBodyWidth: 1920,
123
+ graphicMode: false,
124
+ FuncSort: 'allFunc',
125
+ controlData: {},
126
+ checked: false,
127
+ overlap: [],
128
+ contrloType: false,
129
+ narr: [],
130
+ patternList: [],
131
+ allPatternList: [],
132
+ stagesListOver: [],
133
+ sidewalkPhaseData: [],
134
+ phaseControlTimer: null, // 定时器
135
+ registerMessageTimer: null, // 延时器
136
+ volumeControlTimer: null, // 流量定时器
137
+ ParamsMode: new Map([[0, '自主控制'], [1, '本地手动'], [2, '平台控制'], [3, '配置软件控制'], [4, '遥控器控制'], [5, '黄闪器控制'], [6, '降级控制'], [7, '脚本控制'], [8, '算法控制']]),
138
+ ParamsModeEn: new Map([[0, 'Autonomous Control'], [1, 'Local Manual'], [2, 'Platform Control'], [3, 'Configuration Software Control'], [4, 'Remote Control'], [5, 'Yellow Flasher Control'], [6, 'Degradation Control'], [7, 'Script Control'], [8, 'Algorithm Control']]),
139
+ ParamsControl: new Map([[0, '多时段'], [1, '黄闪'], [2, '全红'], [3, '关灯'], [4, '步进'], [5, '定周期控制'], [6, '单点感应控制'], [7, '协调感应控制'], [8, '方案选择控制'], [9, '自适应控制'], [10, '无电缆控制'], [11, '有电缆控制'], [12, '行人过街控制'], [13, '方案恢复过渡'], [14, '相位驻留'], [15, '通道检测'], [16, '方向锁定'], [17, '韦伯斯特单点控制'], [18, '预留18'], [19, '感应式行人过街'], [20, '方案干预'], [100, '方案干预'], [21, '预留21'], [22, '相位锁定'], [23, '相位放行控制'], [24, '紧急控制'], [99, '设备维护']]),
140
+ ParamsControlEn: new Map([[0, 'Multi Period'], [1, 'Yellow Flash Control'], [2, 'Red Control'], [3, 'Dark Control'], [4, 'Step'], [5, 'Fixed_Cycle Control'], [6, 'Free Control'], [7, 'Coordinated Induction Control'], [8, 'Pattern Selection Control'], [9, 'Adaptive Control'], [10, 'Wireless Control'], [11, 'Cable Control'], [12, 'Pedestrian Crossing Control'], [13, 'Pattern recovery'], [14, 'Phase dwell'], [15, 'Channel Detection'], [16, 'Direction lock'], [17, 'Webster Single Point Coordination'], [18, 'Reserving18'], [19, 'Inductive Pedestrian Crossing Control'], [20, 'Program Intervention'], [100, 'Program Intervention'], [21, 'Reserving21'], [22, 'Priority Control'], [23, 'Close Phase'], [24, 'Emergency Control'], [99, 'Device Mantenance']]),
141
+ phaseType: new Map([[1, '红'], [2, '黄'], [3, '绿']]), // phaseType表示红,黄,绿
142
+ phaseTypeEn: new Map([[1, 'Red'], [2, 'Yellow'], [3, 'Green']]), // phaseType表示红,黄,绿
143
+ ip: '--',
144
+ port: '--',
145
+ protocol: '--',
146
+ devStatus: 1,
147
+ mode: '2',
148
+ agentId: '0',
149
+ agentName: '--',
150
+ platform: undefined,
151
+ crossStatusData: {}, // 路口状态数据
152
+ reset: false,
153
+ responseTime: 0,
154
+ phaseList: [], // 当前相位集合
155
+ intervalFlag: true,
156
+ shrink: 1,
157
+ isResend: true,
158
+ commonHeight: undefined // 左右侧面板的高度值
159
+ }
160
+ },
161
+ computed: {
162
+ // patternList () {
163
+ // return this.$store.state.globalParam.tscParam.patternList
164
+ // },
165
+ ...mapState({
166
+ // curBodyWidth: state => state.globalParam.curBodyWidth,
167
+ curBodyHeight: state => state.globalParam.curBodyHeight,
168
+ // FuncSort: state => state.globalParam.FuncSort,
169
+ hideMenu: state => state.globalParam.hideMenu
170
+ // graphicMode: state => state.globalParam.graphicMode
171
+ // isShowGui: state => state.globalParam.isShowGui,
172
+ // roadDirection: state => state.globalParam.roadDirection
173
+ })
174
+ },
175
+ watch: {
176
+ AgentId: {
177
+ handler: function (val, oldVal) {
178
+ this.agentId = val
179
+ },
180
+ // 深度观察监听
181
+ deep: true
182
+ },
183
+ Token: {
184
+ handler: function (val) {
185
+ this.setPropsToken(val)
186
+ }
187
+ },
188
+ $route: {
189
+ handler: function (val, oldVal) {
190
+ if (val.query !== undefined) {
191
+ if (this.$route.query.shrink) {
192
+ this.shrink = Number(this.$route.query.shrink)
193
+ }
194
+ this.agentId = this.$route.query.agentid
195
+ setIframdevid(this.agentId)
196
+ this.getPlatform()
197
+ this.$refs.rightpanel.getFaultById()
198
+ }
199
+ },
200
+ // 深度观察监听
201
+ deep: true
202
+ },
203
+ phaseList: {
204
+ handler: function (val, oldVal) {
205
+ this.getPedPhasePos()
206
+ },
207
+ // 深度观察监听
208
+ deep: true
209
+ }
210
+ },
211
+ created () {
212
+ this.agentId = this.AgentId
213
+ this.setHost(this.reqUrl)
214
+ this.PhaseDataModel = new PhaseDataModel()
215
+ this.CrossDiagramMgr = new CrossDiagramMgr()
216
+ if (getStageTypes('contrloType') === 'true') {
217
+ this.contrloType = true
218
+ } else {
219
+ this.contrloType = false
220
+ }
221
+ this.globalParamModel = this.$store.getters.globalParamModel
222
+ if (this.$route.query !== undefined && Object.keys(this.$route.query).length) {
223
+ this.agentId = this.$route.query.agentid
224
+ setIframdevid(this.agentId)
225
+ this.registerMessage() // 注册消息
226
+ this.getIntersectionInfo(this.agentId, this.crossStatusData.patternid)
227
+ } else {
228
+ this.queryDevParams() // 查询设备信息
229
+ }
230
+ },
231
+ mounted () {
232
+ this.getPlatform()
233
+ if (this.$route.query.shrink) {
234
+ this.shrink = Number(this.$route.query.shrink)
235
+ }
236
+ var _this = this
237
+ _this.$nextTick(function () {
238
+ this.curBodyWidth = this.$el.parentElement.clientWidth
239
+ })
240
+ },
241
+ updated () {
242
+ if (this.$refs.tuxingLeft.offsetHeight !== this.commonHeight) {
243
+ // 根据左侧面板动态变化的高度,同步更新右侧面板高度
244
+ this.commonHeight = this.$refs.tuxingLeft.offsetHeight
245
+ this.$refs.tuxingRight.style.height = this.commonHeight + 'px'
246
+ }
247
+ },
248
+ methods: {
249
+ setPropsToken (token) {
250
+ // 获取组件外传入的token,便于独立组件调用接口
251
+ if (token && token !== '') {
252
+ setToken(token)
253
+ }
254
+ },
255
+ setHost (host) {
256
+ // 获取组件外传入的token,便于独立组件调用接口
257
+ if (host && host !== '') {
258
+ setHost(host)
259
+ }
260
+ },
261
+ getIntersectionInfo (agentid, id) {
262
+ // 获取路口信息
263
+ getIntersectionInfo(agentid).then(res => {
264
+ // this.globalParamModel.setGlobalParams(res.data.data.param)
265
+ this.allPatternList = res.data.data.param.patternList
266
+ this.overlap = res.data.data.param.overlaplList
267
+ this.phaseList = res.data.data.param.phaseList
268
+ this.patternList = res.data.data.param.patternList.filter(item => {
269
+ return item.id === id
270
+ })[0].rings
271
+ })
272
+ },
273
+ getPedPhasePos () {
274
+ // 行人相位信息
275
+ this.sidewalkPhaseData = []
276
+ this.phaseList.forEach((ele, i) => {
277
+ if (ele.peddirection) {
278
+ ele.peddirection.forEach((dir, index) => {
279
+ // 行人相位
280
+ if (this.PhaseDataModel.getSidePos(dir)) {
281
+ this.sidewalkPhaseData.push({
282
+ key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
283
+ phaseid: ele.id, // 相位id,用于对应相位状态
284
+ id: dir,
285
+ name: this.PhaseDataModel.getSidePos(dir).name
286
+ })
287
+ }
288
+ })
289
+ }
290
+ })
291
+ },
292
+ registerMessage () {
293
+ registerMessage(this.AgentId).then(data => {
294
+ if (!data.data.success) {
295
+ this.devStatus = 2
296
+ let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
297
+ if (data.data.data) {
298
+ // 子类型错误
299
+ let childErrorCode = data.data.data.errorCode
300
+ if (childErrorCode) {
301
+ let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
302
+ this.$message.error(parrenterror + ',' + childerror)
303
+ }
304
+ } else {
305
+ this.$message.error(parrenterror)
306
+ }
307
+ if (this.isResend) {
308
+ this.reSend()
309
+ }
310
+ return
311
+ }
312
+ this.devStatus = 3
313
+ this.clearPatternInterval() // 清除其他定时器
314
+ this.clearVolumeInterval()
315
+ this.phaseControlTimer = setInterval(() => {
316
+ if (this.intervalFlag) {
317
+ this.initData()
318
+ }
319
+ }, 1000)
320
+ // this.$refs.textPage.getVolume()
321
+ // this.volumeControlTimer = setInterval(() => {
322
+ // this.$refs.textPage.getVolume()
323
+ // }, 300000)
324
+ this.getPhase()
325
+ })
326
+ },
327
+ reSend () { // 设备掉线重连机制
328
+ this.devStatus = 1
329
+ this.clearRegisterMessageTimer()
330
+ this.registerMessageTimer = setTimeout(() => {
331
+ this.reconnectionDev()
332
+ }, 5000)
333
+ },
334
+ clearPatternInterval () {
335
+ if (this.phaseControlTimer !== null) {
336
+ clearInterval(this.phaseControlTimer) // 清除定时器
337
+ this.phaseControlTimer = null
338
+ }
339
+ },
340
+ clearVolumeInterval () {
341
+ if (this.volumeControlTimer !== null) {
342
+ clearInterval(this.volumeControlTimer) // 清除流量定时器
343
+ this.volumeControlTimer = null
344
+ }
345
+ },
346
+ clearRegisterMessageTimer () {
347
+ if (this.registerMessageTimer !== null) {
348
+ clearTimeout(this.registerMessageTimer) // 清除延时器
349
+ this.registerMessageTimer = null
350
+ }
351
+ },
352
+ initData () {
353
+ this.intervalFlag = false
354
+ let startTime = new Date().getTime()
355
+ getTscControl(this.AgentId).then((data) => {
356
+ let endTime = new Date().getTime()
357
+ let diffTime = endTime - startTime
358
+ this.responseTime = diffTime
359
+ this.intervalFlag = true
360
+ if (!data.data.success) {
361
+ if (data.data.code === '4003') {
362
+ this.devStatus = 2
363
+ this.clearPatternInterval() // 清除其他定时器
364
+ this.clearVolumeInterval()
365
+ this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
366
+ if (this.isResend) {
367
+ this.reSend()
368
+ }
369
+ return
370
+ }
371
+ let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
372
+ if (data.data.data) {
373
+ // 子类型错误
374
+ let childErrorCode = data.data.data.errorCode
375
+ if (childErrorCode) {
376
+ let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
377
+ this.$message.error(parrenterror + ',' + childerror)
378
+ }
379
+ } else {
380
+ this.$message.error(parrenterror)
381
+ }
382
+ this.clearPatternInterval() // 清除其他定时器
383
+ this.clearVolumeInterval()
384
+ if (this.isResend) {
385
+ this.reSend()
386
+ }
387
+ return
388
+ }
389
+ this.crossStatusData = JSON.parse(JSON.stringify(data.data.data.data))
390
+ let TscData = JSON.parse(JSON.stringify(data.data.data.data))
391
+ // this.handleStageData(TscData) // 处理阶段(驻留)stage数据
392
+ this.controlData = this.handleGetData(TscData)
393
+ this.checkStage(this.controlData)
394
+ }).catch(error => {
395
+ // this.$message.error(error)
396
+ console.log(error)
397
+ })
398
+ },
399
+ getControl (newList) { // 总揽实时数据
400
+ let currentIds = ''
401
+ let lastCurrentIds = ''
402
+ this.stateList = [0]
403
+ this.narr = []
404
+ let overstagesList = []
405
+ let phaseList = []
406
+ for (let j = 0; j <= this.max; j++) { // 指针长度
407
+ for (let i = 0; i < newList.length; i++) { // 环列表
408
+ let ring = newList[i]// 每个环对象
409
+ let sum = 0
410
+ for (let n = 0; n < ring.length; n++) { // 相位累计长度
411
+ if (ring[n].mode !== 7) {
412
+ sum = sum + ring[n].split
413
+ if (j < sum) {
414
+ let phaseId = ring[n].id
415
+ currentIds = currentIds + '-' + phaseId
416
+ break
417
+ }
418
+ }
419
+ }
420
+ }
421
+ if (lastCurrentIds !== currentIds && lastCurrentIds !== '') { // 当前相位id和上一个相比不同说明相位变化了
422
+ phaseList.push(lastCurrentIds)
423
+ this.stateList.push(j)// 阶段累计长度的集合
424
+ }
425
+ lastCurrentIds = currentIds
426
+ currentIds = ''
427
+ }
428
+ let newPhaselist = []
429
+ phaseList.forEach(i => {
430
+ let rangeArr = i.split('-').map(Number)
431
+ if (rangeArr.length > 2) {
432
+ newPhaselist.push([
433
+ JSON.parse(JSON.stringify(rangeArr[1])),
434
+ JSON.parse(JSON.stringify(rangeArr[2]))
435
+ ])
436
+ } else {
437
+ newPhaselist.push([
438
+ JSON.parse(JSON.stringify(rangeArr[1]))
439
+ ])
440
+ }
441
+ })
442
+ for (let i = this.stateList.length - 1; i >= 1; i--) {
443
+ this.narr.push(this.stateList[i] - this.stateList[i - 1])
444
+ }
445
+ this.narr.reverse()// 阶段差
446
+ for (let i = 0; i < newPhaselist.length; i++) {
447
+ let stage = JSON.parse(JSON.stringify(newPhaselist[i]))
448
+ let stageItem = this.getStageItem(stage, newList, i)
449
+ overstagesList.push(JSON.parse(JSON.stringify(stageItem)))
450
+ }
451
+ this.stagesListOver = JSON.parse(JSON.stringify(overstagesList))
452
+ },
453
+ getStageItem (stageArr, ringsList, i) {
454
+ let res = {
455
+ key: i,
456
+ split: this.narr[i], // 阶段绿性比
457
+ stages: stageArr,
458
+ delaystart: 0,
459
+ advanceend: 0
460
+ }
461
+ // let splitArr = []
462
+ let delaystartArr = []
463
+ let advanceendArr = []
464
+ for (let rings of ringsList) {
465
+ for (let ring of rings) {
466
+ if (stageArr.includes(ring.id)) {
467
+ // let split = ring.value
468
+ let delaystart = ring.delaystart
469
+ let advanceend = ring.advanceend
470
+ // splitArr.push(split)
471
+ delaystartArr.push(delaystart)
472
+ advanceendArr.push(advanceend)
473
+ }
474
+ }
475
+ }
476
+ // splitArr.sort(function (a, b) { return a - b })
477
+ delaystartArr.sort(function (a, b) { return b - a })
478
+ advanceendArr.sort(function (a, b) { return a - b })
479
+ // res.split = splitArr.length > 0 ? splitArr[0] : 0
480
+ res.delaystart = delaystartArr.length > 0 ? delaystartArr[0] : 0
481
+ res.advanceend = advanceendArr.length > 0 ? advanceendArr[0] : 0
482
+ return res
483
+ },
484
+ checkStage (rings) {
485
+ if (!rings.phase || !rings.rings) return
486
+ let mapAdd = rings.phase.map(item => {
487
+ return {
488
+ id: item.id,
489
+ split: item.split
490
+ }
491
+ })
492
+ let newRings = rings.rings.map(j => {
493
+ return j.sequence
494
+ })
495
+ let newList = newRings.map(item => {
496
+ let ret = []
497
+ item.map(i => {
498
+ const find = mapAdd.find(j => j.id === i)
499
+ if (find) {
500
+ ret.push(find)
501
+ }
502
+ })
503
+ return ret
504
+ })
505
+ let mapAdds = newList.map(item => {
506
+ return item.map(val => {
507
+ return val.split
508
+ })
509
+ })
510
+ let maxCycle = mapAdds.length > 0 ? mapAdds.map(item => {
511
+ return item.length > 0 ? item.reduce((a, b) => {
512
+ return a + b
513
+ }) : 0
514
+ }) : 0
515
+ this.max = Math.max(...maxCycle)// 每个环的周期最大值
516
+ this.getControl(newList)
517
+ },
518
+ handleGetData (data) {
519
+ let that = this
520
+ if (data.name === '') {
521
+ if (that.$i18n.locale === 'en') {
522
+ data.name = 'Pattern' + data.patternid
523
+ } else if (that.$i18n.locale === 'zh') {
524
+ data.name = '方案' + data.patternid
525
+ }
526
+ }
527
+ Object.keys(data).forEach(function (key) {
528
+ if (that.$i18n.locale === 'en') {
529
+ if (key === 'mode') {
530
+ if (data[key] > 0 && data[key] < 6) {
531
+ data[key] = that.ParamsModeEn.get(data[key])
532
+ } else {
533
+ data[key] = that.ParamsModeEn.get(0)
534
+ }
535
+ }
536
+ if (key === 'control') {
537
+ data[key] = that.ParamsControlEn.get(data[key])
538
+ }
539
+ if (key === 'phase') {
540
+ for (let val of data[key]) {
541
+ val.type = that.phaseTypeEn.get(val.type)
542
+ }
543
+ }
544
+ } else if (that.$i18n.locale === 'zh') {
545
+ if (key === 'mode') {
546
+ if (data[key] > 0 && data[key] < 6) {
547
+ data[key] = that.ParamsMode.get(data[key])
548
+ } else {
549
+ data[key] = that.ParamsMode.get(0)
550
+ }
551
+ }
552
+ if (key === 'control') {
553
+ data[key] = that.ParamsControl.get(data[key])
554
+ }
555
+ if (key === 'phase') {
556
+ for (let val of data[key]) {
557
+ val.type = that.phaseType.get(val.type)
558
+ }
559
+ }
560
+ }
561
+ })
562
+ return data
563
+ },
564
+ reconnectionDev () {
565
+ this.registerMessage()
566
+ },
567
+ queryDevParams () {
568
+ queryDevice(this.AgentId).then(res => {
569
+ if (!res.data.success) {
570
+ this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
571
+ return
572
+ }
573
+ let devParams = res.data.data.jsonparam
574
+ this.ip = devParams.ip
575
+ this.port = String(devParams.port)
576
+ this.protocol = res.data.data.protocol
577
+ this.agentId = res.data.data.agentid
578
+ if (res.data.data.name) {
579
+ this.agentName = res.data.data.name
580
+ }
581
+ this.platform = res.data.data.platform
582
+ if (this.platform === 'OpenATC') {
583
+ this.FuncSort = 'allFunc'
584
+ }
585
+ if (this.platform === 'SCATS' || this.platform === 'HUATONG') {
586
+ this.FuncSort = 'basicFunc'
587
+ }
588
+ this.$refs.intersectionMap.resetCrossDiagram()
589
+ this.registerMessage() // 注册消息
590
+ this.initData()
591
+ this.getIntersectionInfo(this.agentId, this.crossStatusData.patternid)
592
+ })
593
+ },
594
+ getPhase () {
595
+ uploadSingleTscParam('phase', this.AgentId).then(data => {
596
+ let res = data.data
597
+ if (!res.success) {
598
+ if (res.code === '4003') {
599
+ this.$message.error(this.$t('openatccomponents.errorTip.devicenotonline'))
600
+ return
601
+ }
602
+ this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
603
+ return
604
+ }
605
+ this.phaseList = res.data.data.phaseList
606
+ })
607
+ },
608
+ getPlatform () {
609
+ queryDevice(this.AgentId).then(res => {
610
+ if (!res.data.success) {
611
+ this.$message.error(getMessageByCode(res.data.code, this.$i18n.locale))
612
+ return
613
+ }
614
+ let devParams = res.data.data.jsonparam
615
+ this.ip = devParams.ip
616
+ this.port = String(devParams.port)
617
+ this.protocol = res.data.data.protocol
618
+ this.agentId = res.data.data.agentid
619
+ if (res.data.data.name) {
620
+ this.agentName = res.data.data.name
621
+ }
622
+ this.platform = res.data.data.platform
623
+ // let func = 'allFunc'
624
+ // if (this.platform === 'OpenATC') {
625
+ // func = 'allFunc'
626
+ // }
627
+ // if (this.platform === 'SCATS' || this.platform === 'HUATONG') {
628
+ // func = 'basicFunc'
629
+ // }
630
+ // this.$store.dispatch('SaveFunctionLevel', func)
631
+ if (this.platform === 'OpenATC') {
632
+ this.FuncSort = 'allFunc'
633
+ }
634
+ if (this.platform === 'SCATS' || this.platform === 'HUATONG') {
635
+ this.FuncSort = 'basicFunc'
636
+ }
637
+ })
638
+ },
639
+ isJsonString (str) {
640
+ try {
641
+ JSON.parse(str)
642
+ return true
643
+ } catch (err) {
644
+ return false
645
+ }
646
+ }
647
+ },
648
+ destroyed () {
649
+ this.isResend = false
650
+ this.clearPatternInterval() // 清除定时器
651
+ this.clearVolumeInterval()
652
+ this.clearRegisterMessageTimer() // 清除定时器
653
+ this.getPlatform()
654
+ }
655
+ }
656
+ </script>