openatc-components 0.0.51 → 0.0.54

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 +1422 -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 -122
  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 +1422 -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 -122
  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,898 +1,898 @@
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="crossImg">
14
- <div v-show="isShowMode">
15
- <div class="controlText">
16
- <div style="border:0px solid red;float:right;">
17
- {{controlName }}
18
- </div>
19
- </div>
20
- <div class="modeText">
21
- {{modeName }}
22
- </div>
23
- </div>
24
- <!-- 右行道路 B-->
25
- <div class="right-dir-road" v-if="roadDir === 'right'">
26
- <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
27
- <!-- 相位倒计时 -->
28
- <div class="phaseCountdown" v-show="isShowInterval" v-if="devStatus === 3 && isLoaded && isHasPhase" :class="{'countdownBg': isLoaded}">
29
- <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
30
- <div v-if="curPhase.phaseCountdown !== -1">
31
- <span style="float: left;font-size: 20px;color: #fff;width: 70px;">{{$t('openatccomponents.overview.phase')}}{{curPhase.id}}:</span>
32
- <span style="float: left;">{{curPhase.phaseCountdown}}</span>
33
- </div>
34
- </div>
35
- </div>
36
- <!-- 手动刷新 -->
37
- <div v-if="!isLoaded">
38
- <RefreshSvg @click.native="refresh"/>
39
- <span class="text">{{$t('openatccomponents.overview.getintersectionmapagain')}}</span>
40
- </div>
41
- </div>
42
- <!-- 路口底图 -->
43
- <div class="baseImg">
44
- <!-- 城市道路 -->
45
- <CrossRoadsSvg v-if="crossType === 'Crossroads'"/>
46
- <TShapeEastRoadsSvg v-if="crossType === 'TypeT-east'"/>
47
- <TShapeWestRoadsSvg v-if="crossType === 'TypeT-west'"/>
48
- <TShapeNorthRoadsSvg v-if="crossType === 'TypeT-north'"/>
49
- <TShapeSouthRoadsSvg v-if="crossType === 'TypeT-south'"/>
50
- <!-- 其他路口 -->
51
- <CustomRoadsSvg v-if="crossType === 'Customroads'"/>
52
- <!-- 匝道 -->
53
- <RampEastRoadsSvg v-if="crossType === 'ramp-east'" />
54
- <RampWestRoadsSvg v-if="crossType === 'ramp-west'" />
55
- <RampNorthRoadsSvg v-if="crossType === 'ramp-north'" />
56
- <RampSouthRoadsSvg v-if="crossType === 'ramp-south'" />
57
- <!-- 路段行人过街 -->
58
- <PedSectionSNSvg v-if="crossType === 'ped-section-south-north'" />
59
- <PedSectionEWSvg v-if="crossType === 'ped-section-east-west'" />
60
- </div>
61
- <!-- 城市道路状态-->
62
- <div v-if="mainType === '100' || mainType === '101' || mainType === '104'">
63
- <!-- 人行道 -->
64
- <div class="sidewalk" v-if="resetflag && isLoaded">
65
- <SidewalkSvg v-for="(side, index) in compSidewalkPhaseData" :key="side.key + '-' + index" :Data="side" :crossType="crossType" />
66
- </div>
67
- <!-- 车道相位 -->
68
- <div v-if="resetflag" class="phaseIcon">
69
- <PhaseIconSvg v-for="(item, index) in compLanePhaseData" :key="item.key + '-' + index" :Data="item"/>
70
- </div>
71
- <!-- 公交相位 -->
72
- <div v-if="resetflag" class="busIcon">
73
- <BusMapSvg v-for="(item, index) in comdireBusPhaseData" :key="'Busmap-' + item.key + '-' + index" :Data="item" />
74
- <PhaseIconSvg v-for="(item, index) in comdireBusPhaseData" :key="item.key + '-' + index" :Data="item"/>
75
- </div>
76
- </div>
77
- <!-- 匝道状态 -->
78
- <!-- 车道相位 -->
79
- <div v-if="resetflag && mainType === '103'">
80
- <RampPhaseIconSvg v-for="(item, index) in LanePhaseData" :key="item.key + '-' + index" :Data="item" />
81
- </div>
82
- </div>
83
- <!-- 右行道路 E-->
84
-
85
- <!-- 左行道路 B-->
86
- <div class="left-dir-road" v-if="roadDir === 'left'">
87
- <div class="centerText" v-if="mainType === '100' || mainType === '101'" :class="{'countdownBg': isLoaded}">
88
- <!-- 相位倒计时 -->
89
- <div class="phaseCountdown" v-if="devStatus === 3 && isLoaded && isHasPhase">
90
- <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
91
- <div v-if="curPhase.phaseCountdown !== -1">
92
- <span style="float: left;font-size: 20px;color: #fff;width: 70px;">{{$t('openatccomponents.overview.phase')}}{{curPhase.id}}:</span>
93
- <span style="float: left;">{{curPhase.phaseCountdown}}</span>
94
- </div>
95
- </div>
96
- </div>
97
- <!-- 手动刷新 -->
98
- <div v-if="!isLoaded">
99
- <RefreshSvg @click.native="refresh"/>
100
- <span class="text">{{$t('openatccomponents.overview.getintersectionmapagain')}}</span>
101
- </div>
102
- </div>
103
- <!-- 路口底图 -->
104
- <div class="baseImg">
105
- <!-- 城市道路 -->
106
- <LCrossRoadsSvg v-if="crossType === 'Crossroads'"/>
107
- <LTShapeEastRoadsSvg v-if="crossType === 'TypeT-east'"/>
108
- <LTShapeWestRoadsSvg v-if="crossType === 'TypeT-west'"/>
109
- <LTShapeNorthRoadsSvg v-if="crossType === 'TypeT-north'"/>
110
- <LTShapeSouthRoadsSvg v-if="crossType === 'TypeT-south'"/>
111
- <!-- 其他路口 -->
112
- <CustomRoadsSvg v-if="mainType !== '100' && mainType !== '101'"/>
113
- </div>
114
- <!-- 城市道路状态-->
115
- <div v-if="mainType === '100' || mainType === '101'">
116
- <!-- 人行道 -->
117
- <div class="sidewalk" v-if="resetflag && isLoaded">
118
- <SidewalkSvg v-for="side in compSidewalkPhaseData" :key="side.key" :Data="side" :crossType="crossType" />
119
- </div>
120
- <!-- 车道相位 -->
121
- <div v-if="resetflag" class="phaseIcon">
122
- <LPhaseIconSvg v-for="item in compLanePhaseData" :key="item.key" :Data="item"/>
123
- </div>
124
- <!-- 公交相位 -->
125
- <div v-if="resetflag" class="busIcon">
126
- <BusMapSvg v-for="(item, index) in comdireBusPhaseData" :key="'Busmap-' + item.key + '-' + index" :Data="item" />
127
- <LPhaseIconSvg v-for="(item, index) in comdireBusPhaseData" :key="item.key + '-' + index" :Data="item"/>
128
- </div>
129
- </div>
130
- </div>
131
- <!-- 左行道路 E-->
132
- </div>
133
- </template>
134
- <script>
135
- import PhaseIconSvg from './phaseIcon/phaseIconSvg'
136
- import PhaseDataModel from './utils.js'
137
- import { getIntersectionInfo } from '../../../../api/template.js'
138
- import CrossRoadsSvg from './baseImg/CrossRoadsSvg'
139
- import TShapeEastRoadsSvg from './baseImg/TShapeEastRoadsSvg'
140
- import TShapeWestRoadsSvg from './baseImg/TShapeWestRoadsSvg.vue'
141
- import TShapeNorthRoadsSvg from './baseImg/TShapeNorthRoadsSvg.vue'
142
- import TShapeSouthRoadsSvg from './baseImg/TShapeSouthRoadsSvg.vue'
143
- import CustomRoadsSvg from './baseImg/CustomRoadsSvg.vue'
144
- import RefreshSvg from './baseImg/refreshSvg'
145
- import SidewalkSvg from './baseImg/SidewalkSvg'
146
- import RampEastRoadsSvg from './baseImg/RampEastSvg'
147
- import RampWestRoadsSvg from './baseImg/RampWestSvg'
148
- import RampNorthRoadsSvg from './baseImg/RampNorthSvg'
149
- import RampSouthRoadsSvg from './baseImg/RampSouthSvg'
150
- import RampPhaseIconSvg from './phaseIcon/rampPhaseIconSvg'
151
- import PedSectionEWSvg from './baseImg/PedSectionEWSvg'
152
- import PedSectionSNSvg from './baseImg/PedSectionSNSvg'
153
- // import { mapState } from 'vuex'
154
- import LCrossRoadsSvg from './baseImg/leftroad/LCrossRoadsSvg'
155
- import LTShapeEastRoadsSvg from './baseImg/leftroad/LTShapeEastRoadsSvg'
156
- import LTShapeWestRoadsSvg from './baseImg/leftroad/LTShapeWestRoadsSvg.vue'
157
- import LTShapeNorthRoadsSvg from './baseImg/leftroad/LTShapeNorthRoadsSvg.vue'
158
- import LTShapeSouthRoadsSvg from './baseImg/leftroad/LTShapeSouthRoadsSvg.vue'
159
- import LPhaseIconSvg from './phaseIcon/LphaseIconSvg'
160
- import CrossDiagramMgr from '../../../../EdgeMgr/controller/crossDiagramMgr.js'
161
- import BusMapSvg from './busIcon/busMapSvg'
162
- import { getMessageByCode } from '../../../../utils/responseMessage.js'
163
- export default {
164
- name: 'crossDiagram',
165
- components: {
166
- PhaseIconSvg,
167
- CrossRoadsSvg,
168
- TShapeEastRoadsSvg,
169
- TShapeWestRoadsSvg,
170
- TShapeNorthRoadsSvg,
171
- TShapeSouthRoadsSvg,
172
- CustomRoadsSvg,
173
- RefreshSvg,
174
- SidewalkSvg,
175
- RampEastRoadsSvg,
176
- RampWestRoadsSvg,
177
- RampNorthRoadsSvg,
178
- RampSouthRoadsSvg,
179
- RampPhaseIconSvg,
180
- PedSectionEWSvg,
181
- PedSectionSNSvg,
182
- LCrossRoadsSvg,
183
- LTShapeEastRoadsSvg,
184
- LTShapeWestRoadsSvg,
185
- LTShapeNorthRoadsSvg,
186
- LTShapeSouthRoadsSvg,
187
- LPhaseIconSvg,
188
- BusMapSvg
189
- },
190
- props: {
191
- crossStatusData: {
192
- type: Object
193
- },
194
- agentId: {
195
- type: String
196
- },
197
- devStatus: {
198
- type: Number
199
- },
200
- isShowInterval: {
201
- type: Boolean,
202
- devault: true
203
- },
204
- roadDirection: {
205
- type: String
206
- },
207
- isShowMode: {
208
- type: Boolean,
209
- devault: false
210
- },
211
- modeName: {
212
- type: String,
213
- default: ''
214
- },
215
- controlName: {
216
- type: String,
217
- default: ''
218
- }
219
- },
220
- // computed: {
221
- // ...mapState({
222
- // roadDirection: state => state.globalParam.roadDirection
223
- // })
224
- // },
225
- watch: {
226
- tempType: {
227
- handler: function (val) {
228
- this.getCrossType()
229
- }
230
- },
231
- crossStatusData: {
232
- handler: function (val, oldVal) {
233
- // 路口状态数据
234
- this.statusData = JSON.parse(JSON.stringify(val))
235
- this.phaseStatusList = val.phase
236
- this.overlapStatusList = val.overlap
237
- // 默认显示相位数据(包括黄闪、全红、关灯状态下,或者匝道,均不做比对跟随相位的处理)
238
- this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
239
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.sidewalkPhaseData))
240
- this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.busPhaseData))
241
- if (val.control === 1 || val.control === 2 || val.control === 3) {
242
- // 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
243
- this.SpecialControl(val)
244
- return
245
- }
246
- if (!val.phase && !this.overlapStatusList) {
247
- // 非特殊控制,相位和跟随相位不存在的情况下,灯色恢复默认
248
- this.handleSpecialControlStatus('默认')
249
- this.isHasPhase = false
250
- return
251
- }
252
- this.curPhase = val.current_phase
253
- this.isHasPhase = true
254
- this.createPhaseStatusMap()
255
- // 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
256
- this.getPhaseStatus()
257
- this.getOverlapPhaseStatus()
258
- this.getCurPhaseCountdown()
259
- this.getBusPhaseStatus()
260
- if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
261
- // 城市道路和路段行人过街才显示人行道状态
262
- this.getpedStatus()
263
- this.getOverlapPedStatus()
264
- // 算法对比行人相位与行人跟随相位的状态
265
- this.comparePedStatus()
266
- // 算法对比车道相位与车道跟随相位的状态
267
- this.comparePhaseStatus()
268
- }
269
- // console.log('this.phaseStatusMap 相位状态映射', this.phaseStatusMap)
270
- // console.log('LanePhaseData 车道相位', this.LanePhaseData)
271
- // console.log('sidewalkPhaseData 行人相位', this.sidewalkPhaseData)
272
- // console.log('overlapPhaseStatusMap 跟随相位状态映射', this.overlapPhaseStatusMap)
273
- // console.log('overlapLanePhaseData 车道跟随相位', this.overlapLanePhaseData)
274
- // console.log('this.overlapsidewalkPhaseData 行人跟随相位', this.overlapsidewalkPhaseData)
275
- },
276
- // 深度观察监听
277
- deep: true
278
- },
279
- devStatus: {
280
- handler: function (val) {
281
- if (val === 3) return
282
- this.handleDefaultStatus()
283
- }
284
- },
285
- roadDirection: {
286
- handler: function (val1, val2) {
287
- if (val1 !== val2) {
288
- this.init()
289
- }
290
- }
291
- },
292
- agentId: {
293
- handler: function (val1, val2) {
294
- if (val1 !== val2) {
295
- this.init()
296
- }
297
- }
298
- }
299
- },
300
- data () {
301
- return {
302
- roadDir: 'right', // 道路行车方向,默认右行
303
- phaseCountdownList: [], // 相位倒计时列表
304
- statusData: null, // 信号机状态
305
- LanePhaseData: [], // 车道相位数据
306
- overlapLanePhaseData: [], // 车道跟随相位数据
307
- curPhase: [], // 当前相位列表
308
- phaseStatusList: [], // 相位状态列表
309
- phaseStatusMap: new Map(), // 相位状态映射
310
- overlapPhaseStatusMap: new Map(), // 跟随相位状态映射
311
- ColorMap: new Map([[0, '#828282'], [1, '#ff2828'], [2, '#f7b500'], [3, '#77fb65'], [4, '#77fb65'], [5, '#f7b500']]), // 当前相位状态 --- 0:关灯, 1:红, 2:黄, 3:绿, 4:绿闪, 5:黄闪
312
- SidewalkColorMap: new Map([[0, '#828282'], [1, '#e24b4b'], [3, '#7bd66b']]),
313
- tempType: '', // 模版类型
314
- mainType: '101', // 路口形状
315
- mainDirection: '000', // 路口方向
316
- crossType: '', // 路口底图类型
317
- isLoaded: false, // 是否成功加载底图
318
- isHasPhase: true, // 是否有相位状态数据
319
- phaseControlColorMap: new Map([['黄闪', '#f7b500'], ['全红', '#ff2828'], ['关灯', '#828282'], ['默认', '#fff']]),
320
- sidewalkPhaseData: [], // 行人相位
321
- overlapsidewalkPhaseData: [], // 行人跟随相位
322
- resetflag: true, // 离线后,控制行人相位、车道相位reset标识
323
- compLanePhaseData: [], // 对比车道相位和车道跟随相位后,显示的数据
324
- compSidewalkPhaseData: [], // // 对比行人相位和车道跟随相位后,显示的数据
325
- comdirePhaseData: [], // 对比相同方向车道相位数据后,被删减的唯一direction的数组
326
- comdireOverlapPhaseData: [], // 对比相同方向车道跟随相位数据后,被删减的唯一direction的数组
327
- busPhaseData: [], // 公交相位数据
328
- comdireBusPhaseData: [] // 对比相同方向公交车道数据后,被删减的唯一direction的数组
329
- }
330
- },
331
- methods: {
332
- init () {
333
- this.CrossDiagramMgr = new CrossDiagramMgr()
334
- this.getRoadDirection()
335
- this.PhaseDataModel = new PhaseDataModel(this.roadDirection)
336
- this.getIntersectionInfo() // 获取路口信息
337
- },
338
- comparePhaseStatus () {
339
- // 对比车道: 跟随相位和相位的状态数据(此处判断是为了保证被比较的数据direction都是唯一的)
340
- if (!this.comdirePhaseData && !this.comdireOverlapPhaseData) {
341
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type')
342
- } else if (!this.comdireOverlapPhaseData) {
343
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.comdirePhaseData, this.overlapLanePhaseData, 'type')
344
- } else if (!this.comdirePhaseData) {
345
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.comdireOverlapPhaseData, 'type')
346
- } else {
347
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.comdirePhaseData, this.comdireOverlapPhaseData, 'type')
348
- }
349
- },
350
- comparePedStatus () {
351
- // 对比人行道: 跟随相位和相位的状态数据
352
- this.compSidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype')
353
- },
354
- resetPhaseStatus () {
355
- // 车道相位、行人相位恢复默认状态
356
- this.resetflag = false
357
- this.$nextTick(() => {
358
- this.resetflag = true
359
- })
360
- },
361
- SpecialControl (data) {
362
- switch (data.control) {
363
- case 1: this.handleSpecialControlStatus('黄闪')
364
- break
365
- case 2: this.handleSpecialControlStatus('全红')
366
- break
367
- case 3: this.handleSpecialControlStatus('关灯')
368
- break
369
- default: this.handleSpecialControlStatus('默认')
370
- }
371
- this.isHasPhase = false
372
- },
373
- handleDefaultStatus () {
374
- // 恢复默认状态
375
- if (this.compLanePhaseData.length) {
376
- this.phaseCountdown = ''
377
- this.phaseCountdownColor = '#fff'
378
- this.compLanePhaseData.forEach(data => {
379
- data.color = '#fff'
380
- })
381
- }
382
- if (this.compSidewalkPhaseData.length) {
383
- this.compSidewalkPhaseData.forEach(data => {
384
- data.color = '#fff'
385
- })
386
- }
387
- if (this.comdireBusPhaseData.length) {
388
- this.comdireBusPhaseData.forEach(data => {
389
- data.color = '#fff'
390
- })
391
- }
392
- this.phaseCountdownList = []
393
- this.resetPhaseStatus()
394
- },
395
- handleSpecialControlStatus (Control) {
396
- this.resetPhaseStatus()
397
- // 控制黄闪、全红、关灯、默认情况下的车道相位颜色和倒计时颜色
398
- if (Control === '默认') {
399
- // 倒计时恢复默认颜色
400
- this.phaseCountdownList.forEach(item => {
401
- item.phaseCountdown = ''
402
- item.id = ''
403
- item.phaseCountdownColor = '#fff'
404
- })
405
- }
406
- if (this.compLanePhaseData.length) {
407
- const compLanePhaseData = this.compLanePhaseData.map(data => ({
408
- ...data,
409
- color: this.phaseControlColorMap.get(Control)
410
- }))
411
- this.compLanePhaseData = JSON.parse(JSON.stringify(compLanePhaseData))
412
- }
413
- if (this.compSidewalkPhaseData.length) {
414
- const compSidewalkPhaseData = this.compSidewalkPhaseData.map(data => ({
415
- ...data,
416
- color: this.phaseControlColorMap.get(Control)
417
- }))
418
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(compSidewalkPhaseData))
419
- }
420
- if (this.comdireBusPhaseData.length) {
421
- const comdireBusPhaseData = this.comdireBusPhaseData.map(data => ({
422
- ...data,
423
- color: this.phaseControlColorMap.get(Control)
424
- }))
425
- this.comdireBusPhaseData = JSON.parse(JSON.stringify(comdireBusPhaseData))
426
- }
427
- if (this.mainType === '103') {
428
- if (this.LanePhaseData.length) {
429
- const LanePhaseData = this.LanePhaseData.map(data => ({
430
- ...data,
431
- color: this.phaseControlColorMap.get(Control)
432
- }))
433
- this.LanePhaseData = JSON.parse(JSON.stringify(LanePhaseData))
434
- }
435
- }
436
- },
437
- createPhaseStatusMap () {
438
- // 生成相位id和相位状态对应数据结构
439
- this.phaseStatusList.map(phase => {
440
- let phaseId = phase.id
441
- let phaseInfo = {
442
- type: phase.type,
443
- phaseCountdown: phase.countdown,
444
- pedtype: phase.pedtype
445
- }
446
- this.phaseStatusMap.set(phaseId, phaseInfo)
447
- })
448
- },
449
- getPhaseStatus () {
450
- // 得到车道相位状态(颜色)
451
- this.comdirePhaseData = []
452
- let curLanePhaseData = []
453
- for (let i = 0; i < this.LanePhaseData.length; i++) {
454
- let curPhaseStatus = this.phaseStatusMap.get(this.LanePhaseData[i].phaseid)
455
- if (!curPhaseStatus) continue
456
- const data = {
457
- ...this.LanePhaseData[i],
458
- type: curPhaseStatus.type,
459
- color: this.ColorMap.get(curPhaseStatus.type),
460
- phaseCountdown: curPhaseStatus.phaseCountdown,
461
- flag: 'phase' // 车道相位数据标识
462
- }
463
- curLanePhaseData.push(data)
464
- }
465
- this.LanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
466
- // 处理相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
467
- // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
468
- this.comdirePhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.LanePhaseData, 'type', 'phase')))
469
- },
470
- getOverlapPhaseStatus () {
471
- // 得到车道跟随相位状态(颜色)
472
- this.comdireOverlapPhaseData = []
473
- if (this.overlapStatusList) {
474
- this.overlapStatusList.map(phase => {
475
- let phaseId = phase.id
476
- let phaseInfo = {
477
- type: phase.type,
478
- phaseCountdown: phase.countdown,
479
- pedtype: phase.pedtype
480
- }
481
- this.overlapPhaseStatusMap.set(phaseId, phaseInfo)
482
- })
483
- }
484
- let curLanePhaseData = []
485
- for (let i = 0; i < this.overlapLanePhaseData.length; i++) {
486
- let curPhaseStatus = this.overlapPhaseStatusMap.get(this.overlapLanePhaseData[i].phaseid)
487
- if (!curPhaseStatus) continue
488
- const data = {
489
- ...this.overlapLanePhaseData[i],
490
- type: curPhaseStatus.type,
491
- color: this.ColorMap.get(curPhaseStatus.type),
492
- phaseCountdown: curPhaseStatus.phaseCountdown,
493
- flag: 'overlapphase' // 车道跟随相位数据标识
494
- }
495
- curLanePhaseData.push(data)
496
- }
497
- this.overlapLanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
498
- // 处理跟随相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
499
- // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
500
- this.comdireOverlapPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.overlapLanePhaseData, 'type', 'overlapphase')))
501
- },
502
- getBusPhaseStatus () {
503
- // 得到公交车道相位状态(颜色)
504
- this.comdireBusPhaseData = []
505
- let curLanePhaseData = []
506
- for (let i = 0; i < this.busPhaseData.length; i++) {
507
- let curPhaseStatus = this.phaseStatusMap.get(this.busPhaseData[i].phaseid)
508
- if (!curPhaseStatus) continue
509
- const data = {
510
- ...this.busPhaseData[i],
511
- type: curPhaseStatus.type,
512
- color: this.ColorMap.get(curPhaseStatus.type),
513
- phaseCountdown: curPhaseStatus.phaseCountdown,
514
- flag: 'busphase' // 车道相位数据标识
515
- }
516
- curLanePhaseData.push(data)
517
- }
518
- this.busPhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
519
- // 处理相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
520
- // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
521
- this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.busPhaseData, 'type', 'busphase')))
522
- },
523
- getCurPhaseCountdown () {
524
- // 获取当前相位倒计时颜色
525
- this.phaseCountdownList = []
526
- this.curPhase.forEach(curP => {
527
- this.phaseStatusList.forEach(phaseInfo => {
528
- if (phaseInfo.id === curP) {
529
- let countdownObj = {}
530
- countdownObj.id = phaseInfo.id
531
- countdownObj.phaseCountdown = phaseInfo.countdown
532
- countdownObj.phaseCountdownColor = this.ColorMap.get(phaseInfo.type)
533
- this.phaseCountdownList.push(countdownObj)
534
- }
535
- })
536
- })
537
- },
538
- getIntersectionInfo () {
539
- // 获取路口信息
540
- const agentid = this.agentId || '0'
541
- getIntersectionInfo(agentid).then(res => {
542
- if (!res.data.success) {
543
- this.isLoaded = false
544
- let parrenterror = getMessageByCode(res.data.code, this.$i18n.locale)
545
- if (res.data.data) {
546
- // 子类型错误
547
- let childErrorCode = res.data.data.errorCode
548
- if (childErrorCode) {
549
- let childerror = getMessageByCode(res.data.data.errorCode, this.$i18n.locale)
550
- this.$message.error(parrenterror + ',' + childerror)
551
- }
552
- } else {
553
- this.$message.error(parrenterror)
554
- }
555
- return
556
- }
557
- this.isLoaded = true
558
- this.crossInfo = res.data.data.param
559
- this.tempType = res.data.data.type
560
- // 获取车道相位、行人相位信息(坐标、名称)
561
- this.mainType = this.tempType.split('-')[0]
562
- this.mainDirection = this.tempType.split('-')[1]
563
- if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
564
- // 城市道路加载车道相位坐标和人行道坐标
565
- this.getPhasePos()
566
- this.getOverlapPhasePos()
567
- this.getPedPhasePos()
568
- this.getOverlapPedPhasePos()
569
- this.getBusPos()
570
- }
571
- if (this.mainType === '103') {
572
- // 获取匝道道路的主路和支路的相位坐标
573
- this.getRampPhasePos()
574
- }
575
- })
576
- },
577
- getBusPos () {
578
- // 公交相位信息
579
- this.busPhaseData = []
580
- this.crossInfo.phaseList.forEach((ele, i) => {
581
- if (ele.controltype >= 3 && ele.controltype <= 6) {
582
- ele.direction.forEach((dir, index) => {
583
- // 车道相位
584
- this.busPhaseData.push({
585
- key: this.CrossDiagramMgr.getUniqueKey('busphase'),
586
- phaseid: ele.id, // 相位id,用于对应相位状态
587
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
588
- name: this.PhaseDataModel.getBusPhasePos(dir).name,
589
- left: this.PhaseDataModel.getBusPhasePos(dir).x,
590
- top: this.PhaseDataModel.getBusPhasePos(dir).y,
591
- busleft: this.PhaseDataModel.getBusMapPos(dir).x,
592
- bustop: this.PhaseDataModel.getBusMapPos(dir).y,
593
- controltype: ele.controltype
594
- })
595
- })
596
- }
597
- })
598
- },
599
- createRandomType () {
600
- for (var i = 3; i <= 5; i++) {
601
- return Math.floor(Math.random() * (5 - 3)) + 3
602
- }
603
- },
604
- getPhasePos () {
605
- // 车道相位信息
606
- this.LanePhaseData = []
607
- this.crossInfo.phaseList.forEach((ele, i) => {
608
- if (ele.controltype === undefined || ele.controltype <= 2) {
609
- ele.direction.forEach((dir, index) => {
610
- // 车道相位
611
- this.LanePhaseData.push({
612
- key: this.CrossDiagramMgr.getUniqueKey('phase'),
613
- phaseid: ele.id, // 相位id,用于对应相位状态
614
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
615
- name: this.PhaseDataModel.getPhase(dir).name,
616
- left: this.PhaseDataModel.getPhase(dir).x,
617
- top: this.PhaseDataModel.getPhase(dir).y
618
- })
619
- })
620
- }
621
- })
622
- },
623
- getOverlapPhasePos () {
624
- // 车道跟随相位信息
625
- if (!this.crossInfo.overlaplList) return
626
- this.overlapLanePhaseData = []
627
- this.crossInfo.overlaplList.forEach((ele, i) => {
628
- if (ele.direction) {
629
- ele.direction.forEach((dir, index) => {
630
- this.overlapLanePhaseData.push({
631
- key: this.CrossDiagramMgr.getUniqueKey('overlapphase'),
632
- phaseid: ele.id, // 相位id,用于对应相位状态
633
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
634
- name: this.PhaseDataModel.getPhase(dir).name,
635
- left: this.PhaseDataModel.getPhase(dir).x,
636
- top: this.PhaseDataModel.getPhase(dir).y
637
- })
638
- })
639
- }
640
- })
641
- },
642
- getRampPhasePos () {
643
- // 匝道车道相位信息
644
- this.LanePhaseData = []
645
- this.crossInfo.phaseList.forEach((ele, i) => {
646
- ele.direction.forEach((dir, index) => {
647
- if (ele.controltype === 0) {
648
- this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getMainPhasePos)
649
- }
650
- if (ele.controltype === 1) {
651
- this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getSidePhasePos)
652
- }
653
- })
654
- })
655
- },
656
- handleRampPhasePosData (key, phase, dir) {
657
- let posInfo = phase.controltype === 0 ? this.PhaseDataModel.getMainPhasePos(dir) : this.PhaseDataModel.getSidePhasePos(dir)
658
- this.LanePhaseData.push({
659
- key,
660
- controlType: phase.controltype,
661
- phaseid: phase.id, // 相位id,用于对应相位状态
662
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
663
- name: posInfo.name,
664
- left: posInfo.x,
665
- top: posInfo.y
666
- })
667
- },
668
- getPedPhasePos () {
669
- // 行人相位信息
670
- this.sidewalkPhaseData = []
671
- this.crossInfo.phaseList.forEach((ele, i) => {
672
- if (ele.peddirection) {
673
- ele.peddirection.forEach((dir, index) => {
674
- // 行人相位
675
- if (this.PhaseDataModel.getSidePos(dir)) {
676
- this.sidewalkPhaseData.push({
677
- key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
678
- phaseid: ele.id, // 相位id,用于对应相位状态
679
- id: dir,
680
- name: this.PhaseDataModel.getSidePos(dir).name,
681
- left: this.PhaseDataModel.getSidePos(dir).x,
682
- top: this.PhaseDataModel.getSidePos(dir).y
683
- })
684
- }
685
- })
686
- }
687
- })
688
- // 行人相位无,也要显示人行横道,与车道相位显示与否逻辑不同
689
- // this.handleCompleteSidewalkPhase()
690
- },
691
- getOverlapPedPhasePos () {
692
- // 行人跟随相位信息
693
- if (!this.crossInfo.overlaplList) return
694
- this.overlapsidewalkPhaseData = []
695
- this.crossInfo.overlaplList.forEach((ele, i) => {
696
- if (ele.peddirection) {
697
- ele.peddirection.forEach((dir, index) => {
698
- if (this.PhaseDataModel.getSidePos(dir)) {
699
- this.overlapsidewalkPhaseData.push({
700
- key: this.CrossDiagramMgr.getUniqueKey('overlappedphase'),
701
- phaseid: ele.id, // 相位id,用于对应相位状态
702
- id: dir,
703
- name: this.PhaseDataModel.getSidePos(dir).name,
704
- left: this.PhaseDataModel.getSidePos(dir).x,
705
- top: this.PhaseDataModel.getSidePos(dir).y
706
- })
707
- }
708
- })
709
- }
710
- })
711
- },
712
- // handleCompleteSidewalkPhase () {
713
- // // 没有相位状态的车道也要显示,默认白色
714
- // let hasDirIds = this.sidewalkPhaseData.map(data => data.id)
715
- // let allIds = []
716
- // for (let key of this.PhaseDataModel.SidePosMap.keys()) {
717
- // allIds.push(key)
718
- // }
719
- // let diffIds = allIds.filter(function (val) { return hasDirIds.indexOf(val) === -1 })
720
- // diffIds.forEach(id => {
721
- // this.sidewalkPhaseData.push({
722
- // key: `${this.sidewalkPhaseData.length + 1}`,
723
- // phaseid: undefined, // 相位id,用于对应相位状态
724
- // id,
725
- // name: this.PhaseDataModel.getSidePos(id).name,
726
- // left: this.PhaseDataModel.getSidePos(id).x,
727
- // top: this.PhaseDataModel.getSidePos(id).y
728
- // })
729
- // })
730
- // },
731
- getCrossType () {
732
- // 路口类型对应底图决策
733
- if (this.mainType === '101') {
734
- // 十字路口
735
- this.crossType = 'Crossroads'
736
- }
737
- if (this.mainType === '100') {
738
- // T型路口
739
- switch (this.mainDirection) {
740
- case '001': this.crossType = 'TypeT-east'
741
- break
742
- case '002': this.crossType = 'TypeT-south'
743
- break
744
- case '003': this.crossType = 'TypeT-west'
745
- break
746
- case '004': this.crossType = 'TypeT-north'
747
- break
748
- }
749
- }
750
- if (this.mainType === '103') {
751
- // 匝道
752
- switch (this.mainDirection) {
753
- case '001': this.crossType = 'ramp-east'
754
- break
755
- case '002': this.crossType = 'ramp-south'
756
- break
757
- case '003': this.crossType = 'ramp-west'
758
- break
759
- case '004': this.crossType = 'ramp-north'
760
- break
761
- }
762
- }
763
- if (this.mainType === '104') {
764
- // 路段行人过街
765
- switch (this.mainDirection) {
766
- case '006': this.crossType = 'ped-section-east-west'
767
- break
768
- case '005': this.crossType = 'ped-section-south-north'
769
- break
770
- }
771
- }
772
- if (this.mainType === '999') {
773
- // 其他路口
774
- this.crossType = 'Customroads'
775
- }
776
- },
777
- refresh () {
778
- this.getIntersectionInfo()
779
- },
780
- getpedStatus () {
781
- // 行人相位状态
782
- let curPedStatus = []
783
- for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
784
- if (this.sidewalkPhaseData[i].phaseid) {
785
- let curPhaseStatus = this.phaseStatusMap.get(this.sidewalkPhaseData[i].phaseid)
786
- if (!curPhaseStatus) continue
787
- const data = {
788
- ...this.sidewalkPhaseData[i],
789
- pedtype: curPhaseStatus.pedtype,
790
- color: this.SidewalkColorMap.get(curPhaseStatus.pedtype),
791
- flag: 'ped' // 行人相位数据标识
792
- }
793
- curPedStatus.push(data)
794
- } else {
795
- // 无状态的行人道
796
- const data = {
797
- ...this.sidewalkPhaseData[i],
798
- pedtype: undefined
799
- }
800
- curPedStatus.push(data)
801
- }
802
- }
803
- this.sidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
804
- },
805
- getOverlapPedStatus () {
806
- // 行人跟随相位状态
807
- let curPedStatus = []
808
- for (let i = 0; i < this.overlapsidewalkPhaseData.length; i++) {
809
- if (this.overlapsidewalkPhaseData[i].phaseid) {
810
- let curPhaseStatus = this.overlapPhaseStatusMap.get(this.overlapsidewalkPhaseData[i].phaseid)
811
- if (!curPhaseStatus) {
812
- // 无状态的行人道,也显示出来
813
- const data = {
814
- ...this.overlapsidewalkPhaseData[i],
815
- pedtype: undefined
816
- }
817
- curPedStatus.push(data)
818
- continue
819
- }
820
- const data = {
821
- ...this.overlapsidewalkPhaseData[i],
822
- pedtype: curPhaseStatus.pedtype,
823
- color: this.SidewalkColorMap.get(curPhaseStatus.pedtype),
824
- flag: 'overlapped' // 行人跟随相位数据标识
825
- }
826
- curPedStatus.push(data)
827
- } else {
828
- // 无状态的行人道
829
- const data = {
830
- ...this.overlapsidewalkPhaseData[i],
831
- pedtype: undefined
832
- }
833
- curPedStatus.push(data)
834
- }
835
- }
836
- this.overlapsidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
837
- },
838
- getRoadDirection () {
839
- // 获取行车方向(从平台或配置工具的配置文件中读取)
840
- this.roadDir = this.roadDirection
841
- }
842
- },
843
- mounted () {
844
- this.init()
845
- }
846
- }
847
- </script>
848
- <style scoped>
849
- .invisible {
850
- visibility: hidden;
851
- }
852
- .crossImg{
853
- position: relative;
854
- width: 870px;
855
- height: 650px;
856
- left: 50%;
857
- transform: translateX(-50%);
858
- }
859
- .centerText {
860
- position: absolute;
861
- width: 140px;
862
- height: 140px;
863
- left: 50%;
864
- top: 50%;
865
- transform: translateX(-50%) translateY(-50%);
866
- /* text-align: center; */
867
- z-index: 9;
868
- display: flex;
869
- align-items: center;
870
- /* padding-left: 16px; */
871
- }
872
- .phaseCountdown {
873
- line-height: 40px;
874
- font-size: 30px;
875
- font-weight: normal;
876
- font-stretch: normal;
877
- letter-spacing: 0px;
878
- color: #fff;
879
- width: 150px;
880
- margin: 0 auto;
881
- }
882
- .countdownBg {
883
- border-radius: 10px;
884
- background-color: rgba(94, 90, 90, 0.8);
885
- padding-left: 16px;
886
- }
887
- .centerText .text {
888
- display: inline-block;
889
- color: #409eff;
890
- margin-top: 20px;
891
- }
892
-
893
- .baseImg {
894
- width: 100%;
895
- height: 650px;
896
- position: relative;
897
- }
898
- </style>
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="crossImg">
14
+ <div v-show="isShowMode">
15
+ <div class="controlText">
16
+ <div style="border:0px solid red;float:right;">
17
+ {{controlName }}
18
+ </div>
19
+ </div>
20
+ <div class="modeText">
21
+ {{modeName }}
22
+ </div>
23
+ </div>
24
+ <!-- 右行道路 B-->
25
+ <div class="right-dir-road" v-if="roadDir === 'right'">
26
+ <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
27
+ <!-- 相位倒计时 -->
28
+ <div class="phaseCountdown" v-show="isShowInterval" v-if="devStatus === 3 && isLoaded && isHasPhase" :class="{'countdownBg': isLoaded}">
29
+ <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
30
+ <div v-if="curPhase.phaseCountdown !== -1">
31
+ <span style="float: left;font-size: 20px;color: #fff;width: 70px;">{{$t('openatccomponents.overview.phase')}}{{curPhase.id}}:</span>
32
+ <span style="float: left;">{{curPhase.phaseCountdown}}</span>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ <!-- 手动刷新 -->
37
+ <div v-if="!isLoaded">
38
+ <RefreshSvg @click.native="refresh"/>
39
+ <span class="text">{{$t('openatccomponents.overview.getintersectionmapagain')}}</span>
40
+ </div>
41
+ </div>
42
+ <!-- 路口底图 -->
43
+ <div class="baseImg">
44
+ <!-- 城市道路 -->
45
+ <CrossRoadsSvg v-if="crossType === 'Crossroads'"/>
46
+ <TShapeEastRoadsSvg v-if="crossType === 'TypeT-east'"/>
47
+ <TShapeWestRoadsSvg v-if="crossType === 'TypeT-west'"/>
48
+ <TShapeNorthRoadsSvg v-if="crossType === 'TypeT-north'"/>
49
+ <TShapeSouthRoadsSvg v-if="crossType === 'TypeT-south'"/>
50
+ <!-- 其他路口 -->
51
+ <CustomRoadsSvg v-if="crossType === 'Customroads'"/>
52
+ <!-- 匝道 -->
53
+ <RampEastRoadsSvg v-if="crossType === 'ramp-east'" />
54
+ <RampWestRoadsSvg v-if="crossType === 'ramp-west'" />
55
+ <RampNorthRoadsSvg v-if="crossType === 'ramp-north'" />
56
+ <RampSouthRoadsSvg v-if="crossType === 'ramp-south'" />
57
+ <!-- 路段行人过街 -->
58
+ <PedSectionSNSvg v-if="crossType === 'ped-section-south-north'" />
59
+ <PedSectionEWSvg v-if="crossType === 'ped-section-east-west'" />
60
+ </div>
61
+ <!-- 城市道路状态-->
62
+ <div v-if="mainType === '100' || mainType === '101' || mainType === '104'">
63
+ <!-- 人行道 -->
64
+ <div class="sidewalk" v-if="resetflag && isLoaded">
65
+ <SidewalkSvg v-for="(side, index) in compSidewalkPhaseData" :key="side.key + '-' + index" :Data="side" :crossType="crossType" />
66
+ </div>
67
+ <!-- 车道相位 -->
68
+ <div v-if="resetflag" class="phaseIcon">
69
+ <PhaseIconSvg v-for="(item, index) in compLanePhaseData" :key="item.key + '-' + index" :Data="item"/>
70
+ </div>
71
+ <!-- 公交相位 -->
72
+ <div v-if="resetflag" class="busIcon">
73
+ <BusMapSvg v-for="(item, index) in comdireBusPhaseData" :key="'Busmap-' + item.key + '-' + index" :Data="item" />
74
+ <PhaseIconSvg v-for="(item, index) in comdireBusPhaseData" :key="item.key + '-' + index" :Data="item"/>
75
+ </div>
76
+ </div>
77
+ <!-- 匝道状态 -->
78
+ <!-- 车道相位 -->
79
+ <div v-if="resetflag && mainType === '103'">
80
+ <RampPhaseIconSvg v-for="(item, index) in LanePhaseData" :key="item.key + '-' + index" :Data="item" />
81
+ </div>
82
+ </div>
83
+ <!-- 右行道路 E-->
84
+
85
+ <!-- 左行道路 B-->
86
+ <div class="left-dir-road" v-if="roadDir === 'left'">
87
+ <div class="centerText" v-if="mainType === '100' || mainType === '101'" :class="{'countdownBg': isLoaded}">
88
+ <!-- 相位倒计时 -->
89
+ <div class="phaseCountdown" v-if="devStatus === 3 && isLoaded && isHasPhase">
90
+ <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
91
+ <div v-if="curPhase.phaseCountdown !== -1">
92
+ <span style="float: left;font-size: 20px;color: #fff;width: 70px;">{{$t('openatccomponents.overview.phase')}}{{curPhase.id}}:</span>
93
+ <span style="float: left;">{{curPhase.phaseCountdown}}</span>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ <!-- 手动刷新 -->
98
+ <div v-if="!isLoaded">
99
+ <RefreshSvg @click.native="refresh"/>
100
+ <span class="text">{{$t('openatccomponents.overview.getintersectionmapagain')}}</span>
101
+ </div>
102
+ </div>
103
+ <!-- 路口底图 -->
104
+ <div class="baseImg">
105
+ <!-- 城市道路 -->
106
+ <LCrossRoadsSvg v-if="crossType === 'Crossroads'"/>
107
+ <LTShapeEastRoadsSvg v-if="crossType === 'TypeT-east'"/>
108
+ <LTShapeWestRoadsSvg v-if="crossType === 'TypeT-west'"/>
109
+ <LTShapeNorthRoadsSvg v-if="crossType === 'TypeT-north'"/>
110
+ <LTShapeSouthRoadsSvg v-if="crossType === 'TypeT-south'"/>
111
+ <!-- 其他路口 -->
112
+ <CustomRoadsSvg v-if="mainType !== '100' && mainType !== '101'"/>
113
+ </div>
114
+ <!-- 城市道路状态-->
115
+ <div v-if="mainType === '100' || mainType === '101'">
116
+ <!-- 人行道 -->
117
+ <div class="sidewalk" v-if="resetflag && isLoaded">
118
+ <SidewalkSvg v-for="side in compSidewalkPhaseData" :key="side.key" :Data="side" :crossType="crossType" />
119
+ </div>
120
+ <!-- 车道相位 -->
121
+ <div v-if="resetflag" class="phaseIcon">
122
+ <LPhaseIconSvg v-for="item in compLanePhaseData" :key="item.key" :Data="item"/>
123
+ </div>
124
+ <!-- 公交相位 -->
125
+ <div v-if="resetflag" class="busIcon">
126
+ <BusMapSvg v-for="(item, index) in comdireBusPhaseData" :key="'Busmap-' + item.key + '-' + index" :Data="item" />
127
+ <LPhaseIconSvg v-for="(item, index) in comdireBusPhaseData" :key="item.key + '-' + index" :Data="item"/>
128
+ </div>
129
+ </div>
130
+ </div>
131
+ <!-- 左行道路 E-->
132
+ </div>
133
+ </template>
134
+ <script>
135
+ import PhaseIconSvg from './phaseIcon/phaseIconSvg'
136
+ import PhaseDataModel from './utils.js'
137
+ import { getIntersectionInfo } from '../../../../api/template.js'
138
+ import CrossRoadsSvg from './baseImg/CrossRoadsSvg'
139
+ import TShapeEastRoadsSvg from './baseImg/TShapeEastRoadsSvg'
140
+ import TShapeWestRoadsSvg from './baseImg/TShapeWestRoadsSvg.vue'
141
+ import TShapeNorthRoadsSvg from './baseImg/TShapeNorthRoadsSvg.vue'
142
+ import TShapeSouthRoadsSvg from './baseImg/TShapeSouthRoadsSvg.vue'
143
+ import CustomRoadsSvg from './baseImg/CustomRoadsSvg.vue'
144
+ import RefreshSvg from './baseImg/refreshSvg'
145
+ import SidewalkSvg from './baseImg/SidewalkSvg'
146
+ import RampEastRoadsSvg from './baseImg/RampEastSvg'
147
+ import RampWestRoadsSvg from './baseImg/RampWestSvg'
148
+ import RampNorthRoadsSvg from './baseImg/RampNorthSvg'
149
+ import RampSouthRoadsSvg from './baseImg/RampSouthSvg'
150
+ import RampPhaseIconSvg from './phaseIcon/rampPhaseIconSvg'
151
+ import PedSectionEWSvg from './baseImg/PedSectionEWSvg'
152
+ import PedSectionSNSvg from './baseImg/PedSectionSNSvg'
153
+ // import { mapState } from 'vuex'
154
+ import LCrossRoadsSvg from './baseImg/leftroad/LCrossRoadsSvg'
155
+ import LTShapeEastRoadsSvg from './baseImg/leftroad/LTShapeEastRoadsSvg'
156
+ import LTShapeWestRoadsSvg from './baseImg/leftroad/LTShapeWestRoadsSvg.vue'
157
+ import LTShapeNorthRoadsSvg from './baseImg/leftroad/LTShapeNorthRoadsSvg.vue'
158
+ import LTShapeSouthRoadsSvg from './baseImg/leftroad/LTShapeSouthRoadsSvg.vue'
159
+ import LPhaseIconSvg from './phaseIcon/LphaseIconSvg'
160
+ import CrossDiagramMgr from '../../../../EdgeMgr/controller/crossDiagramMgr.js'
161
+ import BusMapSvg from './busIcon/busMapSvg'
162
+ import { getMessageByCode } from '../../../../utils/responseMessage.js'
163
+ export default {
164
+ name: 'crossDiagram',
165
+ components: {
166
+ PhaseIconSvg,
167
+ CrossRoadsSvg,
168
+ TShapeEastRoadsSvg,
169
+ TShapeWestRoadsSvg,
170
+ TShapeNorthRoadsSvg,
171
+ TShapeSouthRoadsSvg,
172
+ CustomRoadsSvg,
173
+ RefreshSvg,
174
+ SidewalkSvg,
175
+ RampEastRoadsSvg,
176
+ RampWestRoadsSvg,
177
+ RampNorthRoadsSvg,
178
+ RampSouthRoadsSvg,
179
+ RampPhaseIconSvg,
180
+ PedSectionEWSvg,
181
+ PedSectionSNSvg,
182
+ LCrossRoadsSvg,
183
+ LTShapeEastRoadsSvg,
184
+ LTShapeWestRoadsSvg,
185
+ LTShapeNorthRoadsSvg,
186
+ LTShapeSouthRoadsSvg,
187
+ LPhaseIconSvg,
188
+ BusMapSvg
189
+ },
190
+ props: {
191
+ crossStatusData: {
192
+ type: Object
193
+ },
194
+ agentId: {
195
+ type: String
196
+ },
197
+ devStatus: {
198
+ type: Number
199
+ },
200
+ isShowInterval: {
201
+ type: Boolean,
202
+ devault: true
203
+ },
204
+ roadDirection: {
205
+ type: String
206
+ },
207
+ isShowMode: {
208
+ type: Boolean,
209
+ devault: false
210
+ },
211
+ modeName: {
212
+ type: String,
213
+ default: ''
214
+ },
215
+ controlName: {
216
+ type: String,
217
+ default: ''
218
+ }
219
+ },
220
+ // computed: {
221
+ // ...mapState({
222
+ // roadDirection: state => state.globalParam.roadDirection
223
+ // })
224
+ // },
225
+ watch: {
226
+ tempType: {
227
+ handler: function (val) {
228
+ this.getCrossType()
229
+ }
230
+ },
231
+ crossStatusData: {
232
+ handler: function (val, oldVal) {
233
+ // 路口状态数据
234
+ this.statusData = JSON.parse(JSON.stringify(val))
235
+ this.phaseStatusList = val.phase
236
+ this.overlapStatusList = val.overlap
237
+ // 默认显示相位数据(包括黄闪、全红、关灯状态下,或者匝道,均不做比对跟随相位的处理)
238
+ this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
239
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.sidewalkPhaseData))
240
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.busPhaseData))
241
+ if (val.control === 1 || val.control === 2 || val.control === 3) {
242
+ // 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
243
+ this.SpecialControl(val)
244
+ return
245
+ }
246
+ if (!val.phase && !this.overlapStatusList) {
247
+ // 非特殊控制,相位和跟随相位不存在的情况下,灯色恢复默认
248
+ this.handleSpecialControlStatus('默认')
249
+ this.isHasPhase = false
250
+ return
251
+ }
252
+ this.curPhase = val.current_phase
253
+ this.isHasPhase = true
254
+ this.createPhaseStatusMap()
255
+ // 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
256
+ this.getPhaseStatus()
257
+ this.getOverlapPhaseStatus()
258
+ this.getCurPhaseCountdown()
259
+ this.getBusPhaseStatus()
260
+ if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
261
+ // 城市道路和路段行人过街才显示人行道状态
262
+ this.getpedStatus()
263
+ this.getOverlapPedStatus()
264
+ // 算法对比行人相位与行人跟随相位的状态
265
+ this.comparePedStatus()
266
+ // 算法对比车道相位与车道跟随相位的状态
267
+ this.comparePhaseStatus()
268
+ }
269
+ // console.log('this.phaseStatusMap 相位状态映射', this.phaseStatusMap)
270
+ // console.log('LanePhaseData 车道相位', this.LanePhaseData)
271
+ // console.log('sidewalkPhaseData 行人相位', this.sidewalkPhaseData)
272
+ // console.log('overlapPhaseStatusMap 跟随相位状态映射', this.overlapPhaseStatusMap)
273
+ // console.log('overlapLanePhaseData 车道跟随相位', this.overlapLanePhaseData)
274
+ // console.log('this.overlapsidewalkPhaseData 行人跟随相位', this.overlapsidewalkPhaseData)
275
+ },
276
+ // 深度观察监听
277
+ deep: true
278
+ },
279
+ devStatus: {
280
+ handler: function (val) {
281
+ if (val === 3) return
282
+ this.handleDefaultStatus()
283
+ }
284
+ },
285
+ roadDirection: {
286
+ handler: function (val1, val2) {
287
+ if (val1 !== val2) {
288
+ this.init()
289
+ }
290
+ }
291
+ },
292
+ agentId: {
293
+ handler: function (val1, val2) {
294
+ if (val1 !== val2) {
295
+ this.init()
296
+ }
297
+ }
298
+ }
299
+ },
300
+ data () {
301
+ return {
302
+ roadDir: 'right', // 道路行车方向,默认右行
303
+ phaseCountdownList: [], // 相位倒计时列表
304
+ statusData: null, // 信号机状态
305
+ LanePhaseData: [], // 车道相位数据
306
+ overlapLanePhaseData: [], // 车道跟随相位数据
307
+ curPhase: [], // 当前相位列表
308
+ phaseStatusList: [], // 相位状态列表
309
+ phaseStatusMap: new Map(), // 相位状态映射
310
+ overlapPhaseStatusMap: new Map(), // 跟随相位状态映射
311
+ ColorMap: new Map([[0, '#828282'], [1, '#ff2828'], [2, '#f7b500'], [3, '#77fb65'], [4, '#77fb65'], [5, '#f7b500']]), // 当前相位状态 --- 0:关灯, 1:红, 2:黄, 3:绿, 4:绿闪, 5:黄闪
312
+ SidewalkColorMap: new Map([[0, '#828282'], [1, '#e24b4b'], [3, '#7bd66b']]),
313
+ tempType: '', // 模版类型
314
+ mainType: '101', // 路口形状
315
+ mainDirection: '000', // 路口方向
316
+ crossType: '', // 路口底图类型
317
+ isLoaded: false, // 是否成功加载底图
318
+ isHasPhase: true, // 是否有相位状态数据
319
+ phaseControlColorMap: new Map([['黄闪', '#f7b500'], ['全红', '#ff2828'], ['关灯', '#828282'], ['默认', '#fff']]),
320
+ sidewalkPhaseData: [], // 行人相位
321
+ overlapsidewalkPhaseData: [], // 行人跟随相位
322
+ resetflag: true, // 离线后,控制行人相位、车道相位reset标识
323
+ compLanePhaseData: [], // 对比车道相位和车道跟随相位后,显示的数据
324
+ compSidewalkPhaseData: [], // // 对比行人相位和车道跟随相位后,显示的数据
325
+ comdirePhaseData: [], // 对比相同方向车道相位数据后,被删减的唯一direction的数组
326
+ comdireOverlapPhaseData: [], // 对比相同方向车道跟随相位数据后,被删减的唯一direction的数组
327
+ busPhaseData: [], // 公交相位数据
328
+ comdireBusPhaseData: [] // 对比相同方向公交车道数据后,被删减的唯一direction的数组
329
+ }
330
+ },
331
+ methods: {
332
+ init () {
333
+ this.CrossDiagramMgr = new CrossDiagramMgr()
334
+ this.getRoadDirection()
335
+ this.PhaseDataModel = new PhaseDataModel(this.roadDirection)
336
+ this.getIntersectionInfo() // 获取路口信息
337
+ },
338
+ comparePhaseStatus () {
339
+ // 对比车道: 跟随相位和相位的状态数据(此处判断是为了保证被比较的数据direction都是唯一的)
340
+ if (!this.comdirePhaseData && !this.comdireOverlapPhaseData) {
341
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type')
342
+ } else if (!this.comdireOverlapPhaseData) {
343
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.comdirePhaseData, this.overlapLanePhaseData, 'type')
344
+ } else if (!this.comdirePhaseData) {
345
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.comdireOverlapPhaseData, 'type')
346
+ } else {
347
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.comdirePhaseData, this.comdireOverlapPhaseData, 'type')
348
+ }
349
+ },
350
+ comparePedStatus () {
351
+ // 对比人行道: 跟随相位和相位的状态数据
352
+ this.compSidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype')
353
+ },
354
+ resetPhaseStatus () {
355
+ // 车道相位、行人相位恢复默认状态
356
+ this.resetflag = false
357
+ this.$nextTick(() => {
358
+ this.resetflag = true
359
+ })
360
+ },
361
+ SpecialControl (data) {
362
+ switch (data.control) {
363
+ case 1: this.handleSpecialControlStatus('黄闪')
364
+ break
365
+ case 2: this.handleSpecialControlStatus('全红')
366
+ break
367
+ case 3: this.handleSpecialControlStatus('关灯')
368
+ break
369
+ default: this.handleSpecialControlStatus('默认')
370
+ }
371
+ this.isHasPhase = false
372
+ },
373
+ handleDefaultStatus () {
374
+ // 恢复默认状态
375
+ if (this.compLanePhaseData.length) {
376
+ this.phaseCountdown = ''
377
+ this.phaseCountdownColor = '#fff'
378
+ this.compLanePhaseData.forEach(data => {
379
+ data.color = '#fff'
380
+ })
381
+ }
382
+ if (this.compSidewalkPhaseData.length) {
383
+ this.compSidewalkPhaseData.forEach(data => {
384
+ data.color = '#fff'
385
+ })
386
+ }
387
+ if (this.comdireBusPhaseData.length) {
388
+ this.comdireBusPhaseData.forEach(data => {
389
+ data.color = '#fff'
390
+ })
391
+ }
392
+ this.phaseCountdownList = []
393
+ this.resetPhaseStatus()
394
+ },
395
+ handleSpecialControlStatus (Control) {
396
+ this.resetPhaseStatus()
397
+ // 控制黄闪、全红、关灯、默认情况下的车道相位颜色和倒计时颜色
398
+ if (Control === '默认') {
399
+ // 倒计时恢复默认颜色
400
+ this.phaseCountdownList.forEach(item => {
401
+ item.phaseCountdown = ''
402
+ item.id = ''
403
+ item.phaseCountdownColor = '#fff'
404
+ })
405
+ }
406
+ if (this.compLanePhaseData.length) {
407
+ const compLanePhaseData = this.compLanePhaseData.map(data => ({
408
+ ...data,
409
+ color: this.phaseControlColorMap.get(Control)
410
+ }))
411
+ this.compLanePhaseData = JSON.parse(JSON.stringify(compLanePhaseData))
412
+ }
413
+ if (this.compSidewalkPhaseData.length) {
414
+ const compSidewalkPhaseData = this.compSidewalkPhaseData.map(data => ({
415
+ ...data,
416
+ color: this.phaseControlColorMap.get(Control)
417
+ }))
418
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(compSidewalkPhaseData))
419
+ }
420
+ if (this.comdireBusPhaseData.length) {
421
+ const comdireBusPhaseData = this.comdireBusPhaseData.map(data => ({
422
+ ...data,
423
+ color: this.phaseControlColorMap.get(Control)
424
+ }))
425
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(comdireBusPhaseData))
426
+ }
427
+ if (this.mainType === '103') {
428
+ if (this.LanePhaseData.length) {
429
+ const LanePhaseData = this.LanePhaseData.map(data => ({
430
+ ...data,
431
+ color: this.phaseControlColorMap.get(Control)
432
+ }))
433
+ this.LanePhaseData = JSON.parse(JSON.stringify(LanePhaseData))
434
+ }
435
+ }
436
+ },
437
+ createPhaseStatusMap () {
438
+ // 生成相位id和相位状态对应数据结构
439
+ this.phaseStatusList.map(phase => {
440
+ let phaseId = phase.id
441
+ let phaseInfo = {
442
+ type: phase.type,
443
+ phaseCountdown: phase.countdown,
444
+ pedtype: phase.pedtype
445
+ }
446
+ this.phaseStatusMap.set(phaseId, phaseInfo)
447
+ })
448
+ },
449
+ getPhaseStatus () {
450
+ // 得到车道相位状态(颜色)
451
+ this.comdirePhaseData = []
452
+ let curLanePhaseData = []
453
+ for (let i = 0; i < this.LanePhaseData.length; i++) {
454
+ let curPhaseStatus = this.phaseStatusMap.get(this.LanePhaseData[i].phaseid)
455
+ if (!curPhaseStatus) continue
456
+ const data = {
457
+ ...this.LanePhaseData[i],
458
+ type: curPhaseStatus.type,
459
+ color: this.ColorMap.get(curPhaseStatus.type),
460
+ phaseCountdown: curPhaseStatus.phaseCountdown,
461
+ flag: 'phase' // 车道相位数据标识
462
+ }
463
+ curLanePhaseData.push(data)
464
+ }
465
+ this.LanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
466
+ // 处理相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
467
+ // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
468
+ this.comdirePhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.LanePhaseData, 'type', 'phase')))
469
+ },
470
+ getOverlapPhaseStatus () {
471
+ // 得到车道跟随相位状态(颜色)
472
+ this.comdireOverlapPhaseData = []
473
+ if (this.overlapStatusList) {
474
+ this.overlapStatusList.map(phase => {
475
+ let phaseId = phase.id
476
+ let phaseInfo = {
477
+ type: phase.type,
478
+ phaseCountdown: phase.countdown,
479
+ pedtype: phase.pedtype
480
+ }
481
+ this.overlapPhaseStatusMap.set(phaseId, phaseInfo)
482
+ })
483
+ }
484
+ let curLanePhaseData = []
485
+ for (let i = 0; i < this.overlapLanePhaseData.length; i++) {
486
+ let curPhaseStatus = this.overlapPhaseStatusMap.get(this.overlapLanePhaseData[i].phaseid)
487
+ if (!curPhaseStatus) continue
488
+ const data = {
489
+ ...this.overlapLanePhaseData[i],
490
+ type: curPhaseStatus.type,
491
+ color: this.ColorMap.get(curPhaseStatus.type),
492
+ phaseCountdown: curPhaseStatus.phaseCountdown,
493
+ flag: 'overlapphase' // 车道跟随相位数据标识
494
+ }
495
+ curLanePhaseData.push(data)
496
+ }
497
+ this.overlapLanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
498
+ // 处理跟随相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
499
+ // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
500
+ this.comdireOverlapPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.overlapLanePhaseData, 'type', 'overlapphase')))
501
+ },
502
+ getBusPhaseStatus () {
503
+ // 得到公交车道相位状态(颜色)
504
+ this.comdireBusPhaseData = []
505
+ let curLanePhaseData = []
506
+ for (let i = 0; i < this.busPhaseData.length; i++) {
507
+ let curPhaseStatus = this.phaseStatusMap.get(this.busPhaseData[i].phaseid)
508
+ if (!curPhaseStatus) continue
509
+ const data = {
510
+ ...this.busPhaseData[i],
511
+ type: curPhaseStatus.type,
512
+ color: this.ColorMap.get(curPhaseStatus.type),
513
+ phaseCountdown: curPhaseStatus.phaseCountdown,
514
+ flag: 'busphase' // 车道相位数据标识
515
+ }
516
+ curLanePhaseData.push(data)
517
+ }
518
+ this.busPhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
519
+ // 处理相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
520
+ // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
521
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.busPhaseData, 'type', 'busphase')))
522
+ },
523
+ getCurPhaseCountdown () {
524
+ // 获取当前相位倒计时颜色
525
+ this.phaseCountdownList = []
526
+ this.curPhase.forEach(curP => {
527
+ this.phaseStatusList.forEach(phaseInfo => {
528
+ if (phaseInfo.id === curP) {
529
+ let countdownObj = {}
530
+ countdownObj.id = phaseInfo.id
531
+ countdownObj.phaseCountdown = phaseInfo.countdown
532
+ countdownObj.phaseCountdownColor = this.ColorMap.get(phaseInfo.type)
533
+ this.phaseCountdownList.push(countdownObj)
534
+ }
535
+ })
536
+ })
537
+ },
538
+ getIntersectionInfo () {
539
+ // 获取路口信息
540
+ const agentid = this.agentId || '0'
541
+ getIntersectionInfo(agentid).then(res => {
542
+ if (!res.data.success) {
543
+ this.isLoaded = false
544
+ let parrenterror = getMessageByCode(res.data.code, this.$i18n.locale)
545
+ if (res.data.data) {
546
+ // 子类型错误
547
+ let childErrorCode = res.data.data.errorCode
548
+ if (childErrorCode) {
549
+ let childerror = getMessageByCode(res.data.data.errorCode, this.$i18n.locale)
550
+ this.$message.error(parrenterror + ',' + childerror)
551
+ }
552
+ } else {
553
+ this.$message.error(parrenterror)
554
+ }
555
+ return
556
+ }
557
+ this.isLoaded = true
558
+ this.crossInfo = res.data.data.param
559
+ this.tempType = res.data.data.type
560
+ // 获取车道相位、行人相位信息(坐标、名称)
561
+ this.mainType = this.tempType.split('-')[0]
562
+ this.mainDirection = this.tempType.split('-')[1]
563
+ if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
564
+ // 城市道路加载车道相位坐标和人行道坐标
565
+ this.getPhasePos()
566
+ this.getOverlapPhasePos()
567
+ this.getPedPhasePos()
568
+ this.getOverlapPedPhasePos()
569
+ this.getBusPos()
570
+ }
571
+ if (this.mainType === '103') {
572
+ // 获取匝道道路的主路和支路的相位坐标
573
+ this.getRampPhasePos()
574
+ }
575
+ })
576
+ },
577
+ getBusPos () {
578
+ // 公交相位信息
579
+ this.busPhaseData = []
580
+ this.crossInfo.phaseList.forEach((ele, i) => {
581
+ if (ele.controltype >= 3 && ele.controltype <= 6) {
582
+ ele.direction.forEach((dir, index) => {
583
+ // 车道相位
584
+ this.busPhaseData.push({
585
+ key: this.CrossDiagramMgr.getUniqueKey('busphase'),
586
+ phaseid: ele.id, // 相位id,用于对应相位状态
587
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
588
+ name: this.PhaseDataModel.getBusPhasePos(dir).name,
589
+ left: this.PhaseDataModel.getBusPhasePos(dir).x,
590
+ top: this.PhaseDataModel.getBusPhasePos(dir).y,
591
+ busleft: this.PhaseDataModel.getBusMapPos(dir).x,
592
+ bustop: this.PhaseDataModel.getBusMapPos(dir).y,
593
+ controltype: ele.controltype
594
+ })
595
+ })
596
+ }
597
+ })
598
+ },
599
+ createRandomType () {
600
+ for (var i = 3; i <= 5; i++) {
601
+ return Math.floor(Math.random() * (5 - 3)) + 3
602
+ }
603
+ },
604
+ getPhasePos () {
605
+ // 车道相位信息
606
+ this.LanePhaseData = []
607
+ this.crossInfo.phaseList.forEach((ele, i) => {
608
+ if (ele.controltype === undefined || ele.controltype <= 2) {
609
+ ele.direction.forEach((dir, index) => {
610
+ // 车道相位
611
+ this.LanePhaseData.push({
612
+ key: this.CrossDiagramMgr.getUniqueKey('phase'),
613
+ phaseid: ele.id, // 相位id,用于对应相位状态
614
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
615
+ name: this.PhaseDataModel.getPhase(dir).name,
616
+ left: this.PhaseDataModel.getPhase(dir).x,
617
+ top: this.PhaseDataModel.getPhase(dir).y
618
+ })
619
+ })
620
+ }
621
+ })
622
+ },
623
+ getOverlapPhasePos () {
624
+ // 车道跟随相位信息
625
+ if (!this.crossInfo.overlaplList) return
626
+ this.overlapLanePhaseData = []
627
+ this.crossInfo.overlaplList.forEach((ele, i) => {
628
+ if (ele.direction) {
629
+ ele.direction.forEach((dir, index) => {
630
+ this.overlapLanePhaseData.push({
631
+ key: this.CrossDiagramMgr.getUniqueKey('overlapphase'),
632
+ phaseid: ele.id, // 相位id,用于对应相位状态
633
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
634
+ name: this.PhaseDataModel.getPhase(dir).name,
635
+ left: this.PhaseDataModel.getPhase(dir).x,
636
+ top: this.PhaseDataModel.getPhase(dir).y
637
+ })
638
+ })
639
+ }
640
+ })
641
+ },
642
+ getRampPhasePos () {
643
+ // 匝道车道相位信息
644
+ this.LanePhaseData = []
645
+ this.crossInfo.phaseList.forEach((ele, i) => {
646
+ ele.direction.forEach((dir, index) => {
647
+ if (ele.controltype === 0) {
648
+ this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getMainPhasePos)
649
+ }
650
+ if (ele.controltype === 1) {
651
+ this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getSidePhasePos)
652
+ }
653
+ })
654
+ })
655
+ },
656
+ handleRampPhasePosData (key, phase, dir) {
657
+ let posInfo = phase.controltype === 0 ? this.PhaseDataModel.getMainPhasePos(dir) : this.PhaseDataModel.getSidePhasePos(dir)
658
+ this.LanePhaseData.push({
659
+ key,
660
+ controlType: phase.controltype,
661
+ phaseid: phase.id, // 相位id,用于对应相位状态
662
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
663
+ name: posInfo.name,
664
+ left: posInfo.x,
665
+ top: posInfo.y
666
+ })
667
+ },
668
+ getPedPhasePos () {
669
+ // 行人相位信息
670
+ this.sidewalkPhaseData = []
671
+ this.crossInfo.phaseList.forEach((ele, i) => {
672
+ if (ele.peddirection) {
673
+ ele.peddirection.forEach((dir, index) => {
674
+ // 行人相位
675
+ if (this.PhaseDataModel.getSidePos(dir)) {
676
+ this.sidewalkPhaseData.push({
677
+ key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
678
+ phaseid: ele.id, // 相位id,用于对应相位状态
679
+ id: dir,
680
+ name: this.PhaseDataModel.getSidePos(dir).name,
681
+ left: this.PhaseDataModel.getSidePos(dir).x,
682
+ top: this.PhaseDataModel.getSidePos(dir).y
683
+ })
684
+ }
685
+ })
686
+ }
687
+ })
688
+ // 行人相位无,也要显示人行横道,与车道相位显示与否逻辑不同
689
+ // this.handleCompleteSidewalkPhase()
690
+ },
691
+ getOverlapPedPhasePos () {
692
+ // 行人跟随相位信息
693
+ if (!this.crossInfo.overlaplList) return
694
+ this.overlapsidewalkPhaseData = []
695
+ this.crossInfo.overlaplList.forEach((ele, i) => {
696
+ if (ele.peddirection) {
697
+ ele.peddirection.forEach((dir, index) => {
698
+ if (this.PhaseDataModel.getSidePos(dir)) {
699
+ this.overlapsidewalkPhaseData.push({
700
+ key: this.CrossDiagramMgr.getUniqueKey('overlappedphase'),
701
+ phaseid: ele.id, // 相位id,用于对应相位状态
702
+ id: dir,
703
+ name: this.PhaseDataModel.getSidePos(dir).name,
704
+ left: this.PhaseDataModel.getSidePos(dir).x,
705
+ top: this.PhaseDataModel.getSidePos(dir).y
706
+ })
707
+ }
708
+ })
709
+ }
710
+ })
711
+ },
712
+ // handleCompleteSidewalkPhase () {
713
+ // // 没有相位状态的车道也要显示,默认白色
714
+ // let hasDirIds = this.sidewalkPhaseData.map(data => data.id)
715
+ // let allIds = []
716
+ // for (let key of this.PhaseDataModel.SidePosMap.keys()) {
717
+ // allIds.push(key)
718
+ // }
719
+ // let diffIds = allIds.filter(function (val) { return hasDirIds.indexOf(val) === -1 })
720
+ // diffIds.forEach(id => {
721
+ // this.sidewalkPhaseData.push({
722
+ // key: `${this.sidewalkPhaseData.length + 1}`,
723
+ // phaseid: undefined, // 相位id,用于对应相位状态
724
+ // id,
725
+ // name: this.PhaseDataModel.getSidePos(id).name,
726
+ // left: this.PhaseDataModel.getSidePos(id).x,
727
+ // top: this.PhaseDataModel.getSidePos(id).y
728
+ // })
729
+ // })
730
+ // },
731
+ getCrossType () {
732
+ // 路口类型对应底图决策
733
+ if (this.mainType === '101') {
734
+ // 十字路口
735
+ this.crossType = 'Crossroads'
736
+ }
737
+ if (this.mainType === '100') {
738
+ // T型路口
739
+ switch (this.mainDirection) {
740
+ case '001': this.crossType = 'TypeT-east'
741
+ break
742
+ case '002': this.crossType = 'TypeT-south'
743
+ break
744
+ case '003': this.crossType = 'TypeT-west'
745
+ break
746
+ case '004': this.crossType = 'TypeT-north'
747
+ break
748
+ }
749
+ }
750
+ if (this.mainType === '103') {
751
+ // 匝道
752
+ switch (this.mainDirection) {
753
+ case '001': this.crossType = 'ramp-east'
754
+ break
755
+ case '002': this.crossType = 'ramp-south'
756
+ break
757
+ case '003': this.crossType = 'ramp-west'
758
+ break
759
+ case '004': this.crossType = 'ramp-north'
760
+ break
761
+ }
762
+ }
763
+ if (this.mainType === '104') {
764
+ // 路段行人过街
765
+ switch (this.mainDirection) {
766
+ case '006': this.crossType = 'ped-section-east-west'
767
+ break
768
+ case '005': this.crossType = 'ped-section-south-north'
769
+ break
770
+ }
771
+ }
772
+ if (this.mainType === '999') {
773
+ // 其他路口
774
+ this.crossType = 'Customroads'
775
+ }
776
+ },
777
+ refresh () {
778
+ this.getIntersectionInfo()
779
+ },
780
+ getpedStatus () {
781
+ // 行人相位状态
782
+ let curPedStatus = []
783
+ for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
784
+ if (this.sidewalkPhaseData[i].phaseid) {
785
+ let curPhaseStatus = this.phaseStatusMap.get(this.sidewalkPhaseData[i].phaseid)
786
+ if (!curPhaseStatus) continue
787
+ const data = {
788
+ ...this.sidewalkPhaseData[i],
789
+ pedtype: curPhaseStatus.pedtype,
790
+ color: this.SidewalkColorMap.get(curPhaseStatus.pedtype),
791
+ flag: 'ped' // 行人相位数据标识
792
+ }
793
+ curPedStatus.push(data)
794
+ } else {
795
+ // 无状态的行人道
796
+ const data = {
797
+ ...this.sidewalkPhaseData[i],
798
+ pedtype: undefined
799
+ }
800
+ curPedStatus.push(data)
801
+ }
802
+ }
803
+ this.sidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
804
+ },
805
+ getOverlapPedStatus () {
806
+ // 行人跟随相位状态
807
+ let curPedStatus = []
808
+ for (let i = 0; i < this.overlapsidewalkPhaseData.length; i++) {
809
+ if (this.overlapsidewalkPhaseData[i].phaseid) {
810
+ let curPhaseStatus = this.overlapPhaseStatusMap.get(this.overlapsidewalkPhaseData[i].phaseid)
811
+ if (!curPhaseStatus) {
812
+ // 无状态的行人道,也显示出来
813
+ const data = {
814
+ ...this.overlapsidewalkPhaseData[i],
815
+ pedtype: undefined
816
+ }
817
+ curPedStatus.push(data)
818
+ continue
819
+ }
820
+ const data = {
821
+ ...this.overlapsidewalkPhaseData[i],
822
+ pedtype: curPhaseStatus.pedtype,
823
+ color: this.SidewalkColorMap.get(curPhaseStatus.pedtype),
824
+ flag: 'overlapped' // 行人跟随相位数据标识
825
+ }
826
+ curPedStatus.push(data)
827
+ } else {
828
+ // 无状态的行人道
829
+ const data = {
830
+ ...this.overlapsidewalkPhaseData[i],
831
+ pedtype: undefined
832
+ }
833
+ curPedStatus.push(data)
834
+ }
835
+ }
836
+ this.overlapsidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
837
+ },
838
+ getRoadDirection () {
839
+ // 获取行车方向(从平台或配置工具的配置文件中读取)
840
+ this.roadDir = this.roadDirection
841
+ }
842
+ },
843
+ mounted () {
844
+ this.init()
845
+ }
846
+ }
847
+ </script>
848
+ <style scoped>
849
+ .invisible {
850
+ visibility: hidden;
851
+ }
852
+ .crossImg{
853
+ position: relative;
854
+ width: 870px;
855
+ height: 650px;
856
+ left: 50%;
857
+ transform: translateX(-50%);
858
+ }
859
+ .centerText {
860
+ position: absolute;
861
+ width: 140px;
862
+ height: 140px;
863
+ left: 50%;
864
+ top: 50%;
865
+ transform: translateX(-50%) translateY(-50%);
866
+ /* text-align: center; */
867
+ z-index: 9;
868
+ display: flex;
869
+ align-items: center;
870
+ /* padding-left: 16px; */
871
+ }
872
+ .phaseCountdown {
873
+ line-height: 40px;
874
+ font-size: 30px;
875
+ font-weight: normal;
876
+ font-stretch: normal;
877
+ letter-spacing: 0px;
878
+ color: #fff;
879
+ width: 150px;
880
+ margin: 0 auto;
881
+ }
882
+ .countdownBg {
883
+ border-radius: 10px;
884
+ background-color: rgba(94, 90, 90, 0.8);
885
+ padding-left: 16px;
886
+ }
887
+ .centerText .text {
888
+ display: inline-block;
889
+ color: #409eff;
890
+ margin-top: 20px;
891
+ }
892
+
893
+ .baseImg {
894
+ width: 100%;
895
+ height: 650px;
896
+ position: relative;
897
+ }
898
+ </style>