openatc-components 0.4.62 → 0.4.64

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 (456) hide show
  1. package/.babelrc +18 -18
  2. package/.editorconfig +9 -9
  3. package/.eslintignore +5 -5
  4. package/.eslintrc.js +31 -31
  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 +120 -120
  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 +94 -94
  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 +133 -133
  23. package/package/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +123 -123
  24. package/package/kisscomps/components/Channelization/Channelization.vue +585 -585
  25. package/package/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  26. package/package/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  27. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  28. package/package/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +456 -456
  29. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  30. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  31. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  32. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  33. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  34. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  35. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  36. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  37. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  38. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  39. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  40. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  41. package/package/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  42. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  43. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  44. package/package/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  45. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  46. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  47. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  48. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  49. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  50. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  51. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  52. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  53. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +368 -368
  54. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  55. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  56. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1022 -1022
  57. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +144 -144
  58. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  59. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  60. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  61. package/package/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  62. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  63. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  64. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  65. package/package/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  66. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  67. package/package/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  68. package/package/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +162 -162
  69. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +629 -629
  70. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  71. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +447 -447
  72. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +341 -341
  73. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +497 -497
  74. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +353 -353
  75. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +359 -359
  76. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +443 -443
  77. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1302 -1302
  78. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  79. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +498 -498
  80. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +484 -484
  81. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +488 -488
  82. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +566 -566
  83. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +640 -640
  84. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +497 -497
  85. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +486 -486
  86. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +490 -490
  87. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +575 -575
  88. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  89. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  90. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  91. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  92. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  93. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  94. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +1598 -1598
  95. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  96. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +200 -196
  97. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  98. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  99. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  100. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/effectPos.json +115 -115
  101. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +115 -115
  102. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  103. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  104. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +219 -219
  105. package/package/kisscomps/components/IntersectionMap/crossDirection/utils.js +91 -91
  106. package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +220 -220
  107. package/package/kisscomps/components/IntersectionMapDirSelect/customCrossDiagram.vue +702 -0
  108. package/package/kisscomps/components/IntersectionMapDirSelect/customintersectionmap.vue +188 -0
  109. package/package/kisscomps/components/IntersectionMapDirSelect/index.js +2 -0
  110. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +534 -534
  111. package/package/kisscomps/components/KanBan/kanban.vue +231 -231
  112. package/package/kisscomps/components/MessageBox/index.vue +96 -96
  113. package/package/kisscomps/components/OverLap/OverLap.vue +237 -237
  114. package/package/kisscomps/components/OverviewComponent/index.vue +853 -853
  115. package/package/kisscomps/components/PatternOptimize/PatternOptimize.vue +329 -329
  116. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +1843 -1843
  117. package/package/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  118. package/package/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  119. package/package/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  120. package/package/kisscomps/components/PhaseLegend/PhaseLegend.vue +286 -286
  121. package/package/kisscomps/components/PhaseMarker/index.js +6 -6
  122. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  123. package/package/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  124. package/package/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  125. package/package/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  126. package/package/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  127. package/package/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  128. package/package/kisscomps/components/PhasePedSelect/index.vue +206 -206
  129. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +1027 -1027
  130. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +365 -365
  131. package/package/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  132. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +214 -214
  133. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +235 -235
  134. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  135. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +131 -131
  136. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +470 -470
  137. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +871 -871
  138. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +151 -151
  139. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +215 -215
  140. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  141. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +308 -308
  142. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1293 -1293
  143. package/package/kisscomps/components/SchemeConfig/utils/thirdPartypermission.js +95 -95
  144. package/package/kisscomps/components/SelectCrossPhase/index.vue +418 -418
  145. package/package/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  146. package/package/kisscomps/components/StageBord/StageBord.vue +303 -303
  147. package/package/kisscomps/components/StageOptimize/StageOptimize.vue +367 -367
  148. package/package/kisscomps/components/StageOptimize/index.js +2 -2
  149. package/package/kisscomps/components/StageOptimize/index.vue +310 -0
  150. package/package/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  151. package/package/kisscomps/components/Stages/index.vue +307 -307
  152. package/package/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  153. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1041 -1041
  154. package/package/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  155. package/package/kisscomps/components/XiaoKanban/index.vue +122 -122
  156. package/package/kisscomps/components/overView/index.vue +676 -676
  157. package/package/kisscomps/components/patternConfig/index.vue +802 -802
  158. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +599 -599
  159. package/package/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  160. package/package/kisscomps/components/patternConfig/planContent.vue +604 -604
  161. package/package/kisscomps/components/patternConfig/planMenu.vue +329 -329
  162. package/package/kisscomps/components/patternConfig/utils.js +152 -152
  163. package/package/kisscomps/components/patternList/patternList.vue +606 -606
  164. package/package/kisscomps/index.js +133 -131
  165. package/package/kissui.min.js +1 -1
  166. package/package/static/img/CrossRoadsSvg.66a6236.svg +529 -0
  167. package/package.json +126 -126
  168. package/src/App.vue +24 -24
  169. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  170. package/src/EdgeMgr/controller/crossDiagramMgr.js +125 -125
  171. package/src/api/authapi.js +31 -31
  172. package/src/api/config.js +21 -21
  173. package/src/api/control.js +110 -110
  174. package/src/api/cross.js +62 -62
  175. package/src/api/device.js +135 -135
  176. package/src/api/fault.js +66 -66
  177. package/src/api/index.js +24 -24
  178. package/src/api/login.js +46 -46
  179. package/src/api/optimize.js +72 -72
  180. package/src/api/param.js +165 -165
  181. package/src/api/passwdAssest.js +101 -101
  182. package/src/api/permission.js +33 -33
  183. package/src/api/route.js +171 -171
  184. package/src/api/template.js +27 -27
  185. package/src/assets/font/LICENSE.txt +202 -202
  186. package/src/assets/font/font.css +6 -6
  187. package/src/i18n/index.js +26 -26
  188. package/src/i18n/language/en.js +1493 -1493
  189. package/src/i18n/language/index.js +25 -25
  190. package/src/i18n/language/zh.js +1493 -1493
  191. package/src/icons/demo_index.html +8445 -8445
  192. package/src/icons/iconfont.css +1451 -1451
  193. package/src/icons/iconfont.json +2522 -2522
  194. package/src/icons/index.js +20 -20
  195. package/src/icons/svg/azimuthlocking.svg +26 -26
  196. package/src/icons/svg/bendi.svg +110 -110
  197. package/src/icons/svg/bujin.svg +36 -36
  198. package/src/icons/svg/connectBlue.svg +7 -7
  199. package/src/icons/svg/currentvolume.svg +0 -0
  200. package/src/icons/svg/custom-BRTlane.svg +40 -40
  201. package/src/icons/svg/custom-buslane.svg +40 -40
  202. package/src/icons/svg/custom-detector.svg +12 -12
  203. package/src/icons/svg/custom-east-bottom.svg +32 -32
  204. package/src/icons/svg/custom-east-top.svg +32 -32
  205. package/src/icons/svg/custom-ewped.svg +35 -35
  206. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -40
  207. package/src/icons/svg/custom-north-left.svg +32 -32
  208. package/src/icons/svg/custom-north-right.svg +32 -32
  209. package/src/icons/svg/custom-peddetector.svg +17 -17
  210. package/src/icons/svg/custom-snped.svg +35 -35
  211. package/src/icons/svg/custom-south-left.svg +32 -32
  212. package/src/icons/svg/custom-south-right.svg +32 -32
  213. package/src/icons/svg/custom-tramlane.svg +40 -40
  214. package/src/icons/svg/custom-vehiclebranch.svg +40 -40
  215. package/src/icons/svg/custom-vehiclemainroad.svg +41 -41
  216. package/src/icons/svg/custom-west-bottom.svg +32 -32
  217. package/src/icons/svg/custom-west-top.svg +32 -32
  218. package/src/icons/svg/custom-xlped.svg +14 -14
  219. package/src/icons/svg/custom-xrped.svg +14 -14
  220. package/src/icons/svg/cutRed.svg +7 -7
  221. package/src/icons/svg/cycle.svg +0 -0
  222. package/src/icons/svg/dingzhouqi.svg +34 -34
  223. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  224. package/src/icons/svg/guandeng.svg +81 -81
  225. package/src/icons/svg/huangshan.svg +71 -71
  226. package/src/icons/svg/maincontrol.svg +0 -0
  227. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  228. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  229. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  230. package/src/icons/svg/model.svg +0 -0
  231. package/src/icons/svg/phasediff.svg +0 -0
  232. package/src/icons/svg/prioritycontrol.svg +21 -21
  233. package/src/icons/svg/quanhong.svg +86 -86
  234. package/src/icons/svg/shanghe.svg +11 -11
  235. package/src/icons/svg/shoudong.svg +103 -103
  236. package/src/icons/svg/tentativeplan.svg +28 -28
  237. package/src/icons/svg/time.svg +0 -0
  238. package/src/icons/svg/wuxianlan.svg +46 -46
  239. package/src/icons/svg/xiala.svg +11 -11
  240. package/src/icons/svg/xingrenguojie.svg +33 -33
  241. package/src/icons/svg/xitong.svg +89 -89
  242. package/src/icons/svg/youxian.svg +41 -41
  243. package/src/icons/svg/zizhukongzhi.svg +43 -43
  244. package/src/kisscomps/components/BoardCard/BoardCard.vue +133 -133
  245. package/src/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +123 -123
  246. package/src/kisscomps/components/Channelization/Channelization.vue +585 -585
  247. package/src/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  248. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  249. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  250. package/src/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +456 -456
  251. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  252. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  253. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  254. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  255. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  256. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  257. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  258. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  259. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  260. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  261. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  262. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  263. package/src/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  264. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  265. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  266. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  267. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  268. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  269. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  270. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  271. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  272. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  273. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  274. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  275. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +368 -368
  276. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  277. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  278. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1022 -1022
  279. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +144 -144
  280. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  281. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  282. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  283. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  284. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  285. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  286. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  287. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  288. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  289. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  290. package/src/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +162 -162
  291. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +629 -629
  292. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  293. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +447 -447
  294. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +341 -341
  295. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +497 -497
  296. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +353 -353
  297. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +359 -359
  298. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +443 -443
  299. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1302 -1302
  300. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  301. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +498 -498
  302. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +484 -484
  303. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +488 -488
  304. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +566 -566
  305. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +640 -640
  306. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +497 -497
  307. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +486 -486
  308. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +490 -490
  309. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +575 -575
  310. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  311. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  312. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  313. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  314. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  315. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  316. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +1598 -1598
  317. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  318. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +200 -196
  319. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  320. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  321. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  322. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/effectPos.json +115 -115
  323. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +115 -115
  324. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  325. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  326. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +219 -219
  327. package/src/kisscomps/components/IntersectionMap/crossDirection/utils.js +91 -91
  328. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +220 -220
  329. package/src/kisscomps/components/IntersectionMapDirSelect/customCrossDiagram.vue +702 -0
  330. package/src/kisscomps/components/IntersectionMapDirSelect/customintersectionmap.vue +188 -0
  331. package/src/kisscomps/components/IntersectionMapDirSelect/index.js +2 -0
  332. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +534 -534
  333. package/src/kisscomps/components/KanBan/kanban.vue +231 -231
  334. package/src/kisscomps/components/MessageBox/index.vue +96 -96
  335. package/src/kisscomps/components/OverLap/OverLap.vue +237 -237
  336. package/src/kisscomps/components/OverviewComponent/index.vue +853 -853
  337. package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +329 -329
  338. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +1843 -1843
  339. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  340. package/src/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  341. package/src/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  342. package/src/kisscomps/components/PhaseLegend/PhaseLegend.vue +286 -286
  343. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  344. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  345. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  346. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  347. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  348. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  349. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  350. package/src/kisscomps/components/PhasePedSelect/index.vue +206 -206
  351. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +1027 -1027
  352. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +365 -365
  353. package/src/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  354. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +214 -214
  355. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +235 -235
  356. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  357. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +131 -131
  358. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +470 -470
  359. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +871 -871
  360. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +151 -151
  361. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +215 -215
  362. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  363. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +308 -308
  364. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1293 -1293
  365. package/src/kisscomps/components/SchemeConfig/utils/thirdPartypermission.js +95 -95
  366. package/src/kisscomps/components/SelectCrossPhase/index.vue +418 -418
  367. package/src/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  368. package/src/kisscomps/components/StageBord/StageBord.vue +303 -303
  369. package/src/kisscomps/components/StageOptimize/StageOptimize.vue +367 -367
  370. package/src/kisscomps/components/StageOptimize/index.js +2 -2
  371. package/src/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  372. package/src/kisscomps/components/Stages/index.vue +307 -307
  373. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  374. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1041 -1041
  375. package/src/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  376. package/src/kisscomps/components/XiaoKanban/index.vue +122 -122
  377. package/src/kisscomps/components/overView/index.vue +676 -676
  378. package/src/kisscomps/components/patternConfig/index.vue +802 -802
  379. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +599 -599
  380. package/src/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  381. package/src/kisscomps/components/patternConfig/planContent.vue +604 -604
  382. package/src/kisscomps/components/patternConfig/planMenu.vue +329 -329
  383. package/src/kisscomps/components/patternConfig/utils.js +152 -152
  384. package/src/kisscomps/components/patternList/patternList.vue +606 -606
  385. package/src/kisscomps/index.js +133 -131
  386. package/src/lib/publicjs/ArryListUtil.js +38 -38
  387. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  388. package/src/lib/publicjs/KissApi.js +158 -158
  389. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  390. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  391. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  392. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  393. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  394. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  395. package/src/lib/publicjs/basecomponents.js +65 -65
  396. package/src/lib/publicjs/localStorage.js +112 -112
  397. package/src/lib/publicjs/objdeepcopy.js +32 -32
  398. package/src/lib/publicjs/pageScroll.js +30 -30
  399. package/src/lib/publicjs/passwdAssest.js +101 -101
  400. package/src/lib/publicjs/styleclassfactory.js +32 -32
  401. package/src/main.js +51 -51
  402. package/src/router/index.js +63 -63
  403. package/src/store/index.js +26 -26
  404. package/src/store/modules/globalParam.js +67 -67
  405. package/src/utils/ControlFormat.js +68 -68
  406. package/src/utils/RingDataModel.js +335 -335
  407. package/src/utils/auth.js +199 -199
  408. package/src/utils/conflct.js +268 -268
  409. package/src/utils/conflictList.js +87 -87
  410. package/src/utils/dateFormat.js +41 -41
  411. package/src/utils/fault.js +196 -196
  412. package/src/utils/faultcode.js +225 -225
  413. package/src/utils/index.js +69 -69
  414. package/src/utils/pedphasedesc.js +119 -119
  415. package/src/utils/phaseList.js +203 -203
  416. package/src/utils/phasedesc.js +144 -144
  417. package/src/utils/responseMessage.js +21 -21
  418. package/src/utils/validate.js +43 -43
  419. package/src/views/customchannelization.vue +49 -49
  420. package/src/views/home.1.vue +479 -479
  421. package/src/views/home.vue +93 -93
  422. package/src/views/intersection.vue +547 -527
  423. package/src/views/intersection2.vue +328 -328
  424. package/src/views/overView.vue +63 -63
  425. package/src/views/patternConfig.vue +14792 -14792
  426. package/src/views/schemeconfig.vue +205 -205
  427. package/static/apiconfig.json +471 -471
  428. package/static/img/CrossRoadsSvg.svg +529 -0
  429. package/static/styles/channelizatioon.scss +433 -433
  430. package/static/styles/common.scss +30 -30
  431. package/static/styles/commonkanban.scss +168 -168
  432. package/static/styles/dark/index.scss +2 -2
  433. package/static/styles/dark/theme/element-dark.scss +44 -44
  434. package/static/styles/index.scss +84 -84
  435. package/static/styles/intersection.scss +180 -180
  436. package/static/styles/light/index.scss +2 -2
  437. package/static/styles/light/theme/element-light.scss +44 -44
  438. package/static/styles/overview.scss +146 -146
  439. package/static/styles/patternConfig.scss +56 -56
  440. package/static/styles/phasePedSelect.scss +71 -71
  441. package/static/styles/schemeconfig.scss +558 -558
  442. package/static/styles/stages.scss +57 -57
  443. package/static/styles/uiComponents.scss +57 -57
  444. package/static/styles/xiaokanban.scss +61 -61
  445. package/static/token.json +2 -2
  446. package/test/e2e/custom-assertions/elementCount.js +27 -27
  447. package/test/e2e/nightwatch.conf.js +46 -46
  448. package/test/e2e/runner.js +48 -48
  449. package/test/e2e/specs/test.js +19 -19
  450. package/test/unit/.eslintrc +7 -7
  451. package/test/unit/jest.conf.js +30 -30
  452. package/test/unit/setup.js +3 -3
  453. package/test/unit/specs/HelloWorld.spec.js +11 -11
  454. package/package/kissui.js +0 -216608
  455. package/pnpm-lock.yaml +0 -16362
  456. package/src/utils/errorcode.js +0 -231
@@ -1,1598 +1,1598 @@
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="isShowState">
15
- <div class="stateText">
16
- <div style="border:0px solid red;float:right;">
17
- {{stateName }}
18
- </div>
19
- </div>
20
- </div>
21
- <div v-show="isShowMode">
22
- <div class="controlText">
23
- <div style="border:0px solid red;float:right;">
24
- {{controlName }}
25
- </div>
26
- </div>
27
- <div class="modeText">
28
- {{modeName }}
29
- </div>
30
- </div>
31
- <!-- 右行道路 B-->
32
- <div class="right-dir-road" v-if="roadDir === 'right'">
33
- <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
34
- <div class="merge-direction-icon">
35
- <xdr-dir-selector
36
- :Data="xdrMData"
37
- Width="80px"
38
- Height="80px"
39
- Widths="80px"
40
- Heights="80px"
41
- :showlist="mergeShowList"></xdr-dir-selector>
42
- </div>
43
- <!-- 相位倒计时 -->
44
- <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown && contrloType === 'ring'" :class="{'countdownBg': isLoaded}">
45
- <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
46
- <div v-if="curPhase.phaseCountdown !== undefined && curPhase.phaseCountdown !== -1" style="overflow: hidden;margin-bottom: 4px;">
47
- <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
48
- <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="curPhase.showlist" :roadDirection="roadDirection"></xdr-dir-selector>
49
- </span>
50
- <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">P{{curPhase.id}}:</span>
51
- <span style="float: left;font-size: 25px;">{{curPhase.phaseCountdown}}</span>
52
- </div>
53
- </div>
54
- </div>
55
- <!-- 阶段倒计时 -->
56
- <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasStageCountdown && contrloType === 'stage'" :class="{'countdownBg': isLoaded}">
57
- <div style="overflow: hidden;margin-bottom: 4px;" :style="{color: stageCountdownList[0].phaseCountdownColor}">
58
- <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
59
- <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="dirListSetTheme(stageCountdownList)" :roadDirection="roadDirection"></xdr-dir-selector>
60
- </span>
61
- <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">S{{crossStatusData.current_stage}}:</span>
62
- <span style="float: left;font-size: 25px;">{{crossStatusData.current_stagecd}}</span>
63
- </div>
64
- </div>
65
- <!-- 手动刷新 -->
66
- <div v-if="!isLoaded">
67
- <RefreshSvg @click.native="refresh"/>
68
- <span class="text">{{$t('openatccomponents.overview.getintersectionmapagain')}}</span>
69
- </div>
70
- </div>
71
- <!-- 路口底图 -->
72
- <div class="baseImg">
73
- <!-- 城市道路 -->
74
- <CrossRoadsSvg v-if="crossType === 'Crossroads'"/>
75
- <TShapeEastRoadsSvg v-if="crossType === 'TypeT-east'"/>
76
- <TShapeWestRoadsSvg v-if="crossType === 'TypeT-west'"/>
77
- <TShapeNorthRoadsSvg v-if="crossType === 'TypeT-north'"/>
78
- <TShapeSouthRoadsSvg v-if="crossType === 'TypeT-south'"/>
79
- <!-- 其他路口 -->
80
- <CustomRoadsSvg v-if="crossType === 'Customroads'"/>
81
- <!-- 匝道 -->
82
- <RampEastRoadsSvg v-if="crossType === 'ramp-east' && !isVipRoute" />
83
- <RampWestRoadsSvg v-if="crossType === 'ramp-west' && !isVipRoute" />
84
- <RampNorthRoadsSvg v-if="crossType === 'ramp-north' && !isVipRoute" />
85
- <RampSouthRoadsSvg v-if="crossType === 'ramp-south' && !isVipRoute" />
86
- <!-- 路段行人过街 -->
87
- <PedSectionSNSvg v-if="crossType === 'ped-section-south-north'" />
88
- <PedSectionEWSvg v-if="crossType === 'ped-section-east-west'" />
89
- </div>
90
- <!-- 城市道路状态-->
91
- <div v-if="mainType === '100' || mainType === '101' || mainType === '104'">
92
- <!-- 人行道 -->
93
- <div class="sidewalk" id="sidewalk" v-if="resetflag && isLoaded">
94
- <SidewalkClickSvg v-if="isVipRoute && compSidewalkPhaseData.length" :Data="compSidewalkPhaseData" :clickMode="clickMode" @handleClickSidewalkIcon="handleClickSidewalkIcon" />
95
- <SidewalkSvg v-else v-for="(side, index) in compSidewalkPhaseData" :key="side.key + '-' + index" :Data="side" :crossType="crossType" />
96
- </div>
97
- <!-- 车道相位 -->
98
- <div v-if="resetflag" class="phaseIcon">
99
- <PhaseIconSvg v-for="(item, index) in compLanePhaseData" :key="item.key + '-' + index" :Data="item" :isVipRoute="isVipRoute" :clickMode="clickMode" @handleClickPhaseIcon="handleClickPhaseIcon" />
100
- </div>
101
- <!-- 公交相位 -->
102
- <div v-if="resetflag && !isVipRoute" class="busIcon">
103
- <BusMapSvg v-for="(item, index) in comdireBusPhaseData" :key="'Busmap-' + item.key + '-' + index" :Data="item" />
104
- <PhaseIconSvg v-for="(item, index) in comdireBusPhaseData" :key="item.key + '-' + index" :Data="item"/>
105
- </div>
106
- <!-- 有效方向 -->
107
- <div v-if="isVipRoute" class="effectDir">
108
- <PhaseIconSvg v-for="(item, index) in effectDirData" :key="item.key + '-' + index" :Data="item" />
109
- </div>
110
- </div>
111
- <!-- 匝道状态 -->
112
- <!-- 车道相位 -->
113
- <div v-if="resetflag && mainType === '103' && !isVipRoute">
114
- <RampPhaseIconSvg v-for="(item, index) in LanePhaseData" :key="item.key + '-' + index" :Data="item" />
115
- </div>
116
- </div>
117
- <!-- 右行道路 E-->
118
-
119
- <!-- 左行道路 B-->
120
- <div class="left-dir-road" v-if="roadDir === 'left'">
121
- <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
122
- <!-- 相位倒计时 -->
123
- <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown && contrloType === 'ring'" :class="{'countdownBg': isLoaded}">
124
- <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
125
- <div v-if="curPhase.phaseCountdown !== undefined && curPhase.phaseCountdown !== -1" style="overflow: hidden;margin-bottom: 4px;">
126
- <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
127
- <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="curPhase.showlist" :roadDirection="roadDirection"></xdr-dir-selector>
128
- </span>
129
- <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">P{{curPhase.id}}:</span>
130
- <span style="float: left;font-size: 25px;">{{curPhase.phaseCountdown}}</span>
131
- </div>
132
- </div>
133
- </div>
134
- <!-- 阶段倒计时 -->
135
- <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasStageCountdown && contrloType === 'stage'" :class="{'countdownBg': isLoaded}">
136
- <div style="overflow: hidden;margin-bottom: 4px;" :style="{color: stageCountdownList[0].phaseCountdownColor}">
137
- <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
138
- <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="dirListSetTheme(stageCountdownList)" :roadDirection="roadDirection"></xdr-dir-selector>
139
- </span>
140
- <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">S{{crossStatusData.current_stage}}:</span>
141
- <span style="float: left;font-size: 25px;">{{crossStatusData.current_stagecd}}</span>
142
- </div>
143
- </div>
144
- <!-- 手动刷新 -->
145
- <div v-if="!isLoaded">
146
- <RefreshSvg @click.native="refresh"/>
147
- <span class="text">{{$t('openatccomponents.overview.getintersectionmapagain')}}</span>
148
- </div>
149
- </div>
150
- <!-- 路口底图 -->
151
- <div class="baseImg">
152
- <!-- 城市道路 -->
153
- <LCrossRoadsSvg v-if="crossType === 'Crossroads'"/>
154
- <LTShapeEastRoadsSvg v-if="crossType === 'TypeT-east'"/>
155
- <LTShapeWestRoadsSvg v-if="crossType === 'TypeT-west'"/>
156
- <LTShapeNorthRoadsSvg v-if="crossType === 'TypeT-north'"/>
157
- <LTShapeSouthRoadsSvg v-if="crossType === 'TypeT-south'"/>
158
- <!-- 其他路口 -->
159
- <CustomRoadsSvg v-if="mainType !== '100' && mainType !== '101'"/>
160
- </div>
161
- <!-- 城市道路状态-->
162
- <div v-if="mainType === '100' || mainType === '101'">
163
- <!-- 人行道 -->
164
- <div class="sidewalk" v-if="resetflag && isLoaded">
165
- <SidewalkClickSvg v-if="isVipRoute && compSidewalkPhaseData.length" :Data="compSidewalkPhaseData" :clickMode="clickMode" @handleClickSidewalkIcon="handleClickSidewalkIcon" />
166
- <SidewalkSvg v-else v-for="side in compSidewalkPhaseData" :key="side.key" :Data="side" :crossType="crossType" />
167
- </div>
168
- <!-- 车道相位 -->
169
- <div v-if="resetflag" class="phaseIcon">
170
- <LPhaseIconSvg v-for="item in compLanePhaseData" :key="item.key" :Data="item" :isVipRoute="isVipRoute" :clickMode="clickMode" @handleClickPhaseIcon="handleClickPhaseIcon"/>
171
- </div>
172
- <!-- 公交相位 -->
173
- <div v-if="resetflag" class="busIcon">
174
- <BusMapSvg v-for="(item, index) in comdireBusPhaseData" :key="'Busmap-' + item.key + '-' + index" :Data="item" />
175
- <LPhaseIconSvg v-for="(item, index) in comdireBusPhaseData" :key="item.key + '-' + index" :Data="item"/>
176
- </div>
177
- </div>
178
- </div>
179
- <!-- 左行道路 E-->
180
- </div>
181
- </template>
182
- <script>
183
- import PhaseIconSvg from './phaseIcon/phaseIconSvg'
184
- import PhaseDataModel from './utils.js'
185
- import { getIntersectionInfo } from '../../../../api/template.js'
186
- import { uploadSingleTscParam } from '../../../../api/param.js'
187
- import CrossRoadsSvg from './baseImg/CrossRoadsSvg'
188
- import TShapeEastRoadsSvg from './baseImg/TShapeEastRoadsSvg'
189
- import TShapeWestRoadsSvg from './baseImg/TShapeWestRoadsSvg.vue'
190
- import TShapeNorthRoadsSvg from './baseImg/TShapeNorthRoadsSvg.vue'
191
- import TShapeSouthRoadsSvg from './baseImg/TShapeSouthRoadsSvg.vue'
192
- import CustomRoadsSvg from './baseImg/CustomRoadsSvg.vue'
193
- import RefreshSvg from './baseImg/refreshSvg'
194
- import SidewalkSvg from './baseImg/SidewalkSvg'
195
- import SidewalkClickSvg from './baseImg/SidewalkClickSvg'
196
- import RampEastRoadsSvg from './baseImg/RampEastSvg'
197
- import RampWestRoadsSvg from './baseImg/RampWestSvg'
198
- import RampNorthRoadsSvg from './baseImg/RampNorthSvg'
199
- import RampSouthRoadsSvg from './baseImg/RampSouthSvg'
200
- import RampPhaseIconSvg from './phaseIcon/rampPhaseIconSvg'
201
- import PedSectionEWSvg from './baseImg/PedSectionEWSvg'
202
- import PedSectionSNSvg from './baseImg/PedSectionSNSvg'
203
- // import { mapState } from 'vuex'
204
- import LCrossRoadsSvg from './baseImg/leftroad/LCrossRoadsSvg'
205
- import LTShapeEastRoadsSvg from './baseImg/leftroad/LTShapeEastRoadsSvg'
206
- import LTShapeWestRoadsSvg from './baseImg/leftroad/LTShapeWestRoadsSvg.vue'
207
- import LTShapeNorthRoadsSvg from './baseImg/leftroad/LTShapeNorthRoadsSvg.vue'
208
- import LTShapeSouthRoadsSvg from './baseImg/leftroad/LTShapeSouthRoadsSvg.vue'
209
- import LPhaseIconSvg from './phaseIcon/LphaseIconSvg'
210
- import CrossDiagramMgr from '../../../../EdgeMgr/controller/crossDiagramMgr.js'
211
- import BusMapSvg from './busIcon/busMapSvg'
212
- import { getMessageByCode } from '../../../../utils/responseMessage.js'
213
-
214
- import CrossDirectionConflictList from '../../../../utils/conflictList.js'
215
- import RingDataModel from '../../../../utils/RingDataModel.js'
216
- import { getValidDirections, getMergeDirections } from '../../../../api/cross.js'
217
-
218
- export default {
219
- name: 'crossDiagram',
220
- components: {
221
- PhaseIconSvg,
222
- CrossRoadsSvg,
223
- TShapeEastRoadsSvg,
224
- TShapeWestRoadsSvg,
225
- TShapeNorthRoadsSvg,
226
- TShapeSouthRoadsSvg,
227
- CustomRoadsSvg,
228
- RefreshSvg,
229
- SidewalkSvg,
230
- RampEastRoadsSvg,
231
- RampWestRoadsSvg,
232
- RampNorthRoadsSvg,
233
- RampSouthRoadsSvg,
234
- RampPhaseIconSvg,
235
- PedSectionEWSvg,
236
- PedSectionSNSvg,
237
- LCrossRoadsSvg,
238
- LTShapeEastRoadsSvg,
239
- LTShapeWestRoadsSvg,
240
- LTShapeNorthRoadsSvg,
241
- LTShapeSouthRoadsSvg,
242
- LPhaseIconSvg,
243
- BusMapSvg,
244
- SidewalkClickSvg
245
- },
246
- props: {
247
- crossStatusData: {
248
- type: Object
249
- },
250
- agentId: {
251
- type: String
252
- },
253
- // devStatus: {
254
- // type: Number
255
- // },
256
- isShowInterval: {
257
- type: Boolean,
258
- devault: true
259
- },
260
- isShowMessage: {
261
- type: Boolean,
262
- default: true
263
- },
264
- roadDirection: {
265
- type: String
266
- },
267
- isShowState: {
268
- type: Boolean,
269
- devault: false
270
- },
271
- isShowMode: {
272
- type: Boolean,
273
- devault: false
274
- },
275
- modeName: {
276
- type: String,
277
- default: ''
278
- },
279
- controlName: {
280
- type: String,
281
- default: ''
282
- },
283
- stateName: {
284
- type: String,
285
- default: ''
286
- },
287
- choosedDirection: {
288
- type: Array,
289
- default: () => []
290
- },
291
- choosedPedDirection: {
292
- type: Array,
293
- default: () => []
294
- },
295
- isVipRoute: { // 区分普通路口和VIP路口,如果是vip路口(特勤路线和分组管控),才需要获取通道和处理通道冲突,并显示已选方向
296
- type: Boolean,
297
- default: false
298
- },
299
- clickMode: {
300
- type: Boolean,
301
- default: false
302
- },
303
- isThirdSignal: {
304
- type: Boolean,
305
- default: false
306
- },
307
- channelType: {
308
- type: Boolean,
309
- default: false
310
- }
311
- },
312
- // computed: {
313
- // ...mapState({
314
- // roadDirection: state => state.globalParam.roadDirection
315
- // })
316
- // },
317
- watch: {
318
- tempType: {
319
- handler: function (val) {
320
- this.getCrossType()
321
- }
322
- },
323
- crossStatusData: {
324
- handler: function (val, oldVal) {
325
- // 路口状态数据
326
- if (!this.channelType || (this.channelType && this.isThirdSignal)) {
327
- this.compareIsChangedPhase(val, oldVal) // 比较相位状态决定是否更新相位图标(解决虚相位显示问题,虚相位图标不显示)
328
- }
329
- this.statusData = JSON.parse(JSON.stringify(val))
330
- // 默认显示相位数据(包括黄闪、全红、关灯状态下,或者匝道,均不做比对跟随相位的处理)
331
- this.drawDefaultPhaseIcon()
332
- if (this.channelType && !this.isThirdSignal) {
333
- // 通道路口图状态数据(实时通道展示排除第三方信号机,第三方信号机还是按模版路口一样展示相位状态)
334
- this.channelStatusList = val.channellamp
335
- this.createChannelStatusMap()
336
- this.getChannelPhaseStatus()
337
- this.getChannelPedStatus()
338
- return
339
- }
340
- this.handleTempCrossStatus(val)
341
- },
342
- // 深度观察监听
343
- deep: true
344
- },
345
- devStatus: {
346
- handler: function (val) {
347
- if (val === 3) return
348
- this.handleDefaultStatus()
349
- }
350
- },
351
- // roadDirection: {
352
- // handler: function (val1, val2) {
353
- // if (val1 !== val2) {
354
- // this.init()
355
- // }
356
- // }
357
- // },
358
- agentId: {
359
- handler: function (val1, val2) {
360
- if (val1 !== val2) {
361
- this.init()
362
- }
363
- },
364
- immediate: true
365
- }
366
- },
367
- data () {
368
- return {
369
- roadDir: 'right', // 道路行车方向,默认右行
370
- phaseCountdownList: [], // 相位倒计时列表
371
- stageCountdownList: [], // 阶段倒计时列表
372
- statusData: null, // 信号机状态
373
- LanePhaseData: [], // 车道相位数据
374
- overlapLanePhaseData: [], // 车道跟随相位数据
375
- curPhase: [], // 当前相位列表
376
- phaseStatusList: [], // 相位状态列表
377
- phaseStatusMap: new Map(), // 相位状态映射
378
- overlapPhaseStatusMap: new Map(), // 跟随相位状态映射
379
- ColorMap: new Map([[0, '#828282'], [1, '#ff2828'], [2, '#f7b500'], [3, '#77fb65'], [4, '#77fb65'], [5, '#f7b500']]), // 当前相位状态 --- 0:关灯, 1:红, 2:黄, 3:绿, 4:绿闪, 5:黄闪
380
- SidewalkColorMap: new Map([[0, '#828282'], [1, '#e24b4b'], [3, '#7bd66b']]),
381
- tempType: '', // 模版类型
382
- mainType: '101', // 路口形状
383
- mainDirection: '000', // 路口方向
384
- crossType: '', // 路口底图类型
385
- isLoaded: false, // 是否成功加载底图
386
- isHasPhase: true, // 是否有相位状态数据
387
- phaseControlColorMap: new Map([['全红', '#ff2828'], ['关灯', '#828282'], ['默认', '#fff'], ['方向锁定', '#fff']]),
388
- sidewalkPhaseData: [], // 行人相位
389
- overlapsidewalkPhaseData: [], // 行人跟随相位
390
- resetflag: true, // 离线后,控制行人相位、车道相位reset标识
391
- compLanePhaseData: [], // 对比车道相位和车道跟随相位后,显示的数据
392
- compSidewalkPhaseData: [], // // 对比行人相位和车道跟随相位后,显示的数据
393
- comdirePhaseData: [], // 对比相同方向车道相位数据后,被删减的唯一direction的数组
394
- comdireOverlapPhaseData: [], // 对比相同方向车道跟随相位数据后,被删减的唯一direction的数组
395
- busPhaseData: [], // 公交相位数据
396
- comdireBusPhaseData: [], // 对比相同方向公交车道数据后,被删减的唯一direction的数组
397
- channelStatusMap: new Map(), // 通道实时状态映射
398
- channelStatusList: [], // 通道实时状态列表
399
- phaseDirMap: new Map(),
400
- xdrData: {
401
- left: '5px',
402
- top: '4px'
403
- },
404
- xdrpedData: {
405
- left: '1px',
406
- top: '1px'
407
- },
408
- isHasCountdown: false,
409
- isHasStageCountdown: false,
410
- contrloType: 'ring',
411
- isMphaseStatusDataReturnMap: new Map(), // 每个跟随相位的母相位是否返回了相位状态数据
412
- overlapStatusCompareSum: 0, // 首次加载跳过比较母相位状态数据是否返回
413
- effectDirData: [], // 路口有效方向
414
- mergeShowList: [2, 4, 10],
415
- xdrMData: {
416
- left: '18px',
417
- top: '18px'
418
- }
419
- }
420
- },
421
- methods: {
422
- compareIsChangedPhase (newCrossStatus, oldCrossStatus) {
423
- if (newCrossStatus.control === 1 || newCrossStatus.control === 2 || newCrossStatus.control === 3) return
424
- // 返回的相位状态改变后,按照返回的相位状态更新路口相位显示(下个周期生效)
425
- let newPhaseIds = newCrossStatus.phase.map(item => item.id)
426
- let oldPhaseIds = oldCrossStatus.phase.map(item => item.id)
427
- if (!this.isArraysEqual(newPhaseIds, oldPhaseIds)) { // 通过比较相位id是否完全一致
428
- this.getIntersectionInfo()
429
- }
430
- },
431
- isArraysEqual (arr1, arr2) {
432
- if (arr1.length !== arr2.length) return false
433
- for (let i = 0; i < arr1.length; i++) {
434
- if (arr1[i] !== arr2[i]) return false
435
- }
436
- return true
437
- },
438
- handleTempCrossStatus (val) {
439
- // 模版路口图状态数据
440
- this.phaseStatusList = val.phase
441
- this.overlapStatusList = val.overlap
442
- if (val.control === 1 || val.control === 2 || val.control === 3) {
443
- // 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
444
- if (val.control === 1) {
445
- this.getYellowFlashColor()
446
- } else {
447
- this.SpecialControl(val)
448
- }
449
- this.isHasPhase = false
450
- return
451
- }
452
- if (!val.phase && !this.overlapStatusList) {
453
- // 非特殊控制,相位和跟随相位不存在的情况下,灯色恢复默认
454
- this.handleSpecialControlStatus('默认')
455
- this.isHasPhase = false
456
- return
457
- }
458
- if (val.control === 16) {
459
- // 方向锁定时,相位状态显示与通道无关,显示接口返回的红灯会有歧义,此处特殊处理显示默认白色
460
- this.handleSpecialControlStatus('方向锁定')
461
- this.isHasPhase = false
462
- return
463
- }
464
- this.curPhase = val.current_phase
465
- this.curStage = val.current_stage
466
- this.isHasPhase = true
467
- if (val.phase) {
468
- this.createPhaseStatusMap()
469
- }
470
- if (val.overlap) {
471
- this.createOverlapPhaseStatusMap()
472
- }
473
- // 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
474
- this.getPhaseStatus()
475
- this.getOverlapPhaseStatus()
476
- this.getCurPhaseCountdown()
477
- this.getCurStageCountdown()
478
- this.getBusPhaseStatus()
479
- if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
480
- // 城市道路和路段行人过街才显示人行道状态
481
- this.getpedStatus()
482
- this.getOverlapPedStatus()
483
- // 算法对比行人相位与行人跟随相位的状态
484
- this.comparePedStatus()
485
- // 算法对比车道相位与车道跟随相位的状态
486
- this.comparePhaseStatus()
487
- }
488
- // console.log('this.phaseStatusMap 相位状态映射', this.phaseStatusMap)
489
- // console.log('LanePhaseData 车道相位', this.LanePhaseData)
490
- // console.log('sidewalkPhaseData 行人相位', this.sidewalkPhaseData)
491
- // console.log('overlapPhaseStatusMap 跟随相位状态映射', this.overlapPhaseStatusMap)
492
- // console.log('overlapLanePhaseData 车道跟随相位', this.overlapLanePhaseData)
493
- // console.log('this.overlapsidewalkPhaseData 行人跟随相位', this.overlapsidewalkPhaseData)
494
- },
495
- init () {
496
- this.CrossDiagramMgr = new CrossDiagramMgr()
497
- this.getRoadDirection()
498
- this.PhaseDataModel = new PhaseDataModel(this.roadDirection)
499
- this.getIntersectionInfo() // 获取路口信息
500
- },
501
- drawDefaultPhaseIcon () {
502
- this.compLanePhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')))
503
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')))
504
- this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.busPhaseData))
505
- console.log(this.LanePhaseData)
506
- console.log(this.overlapLanePhaseData)
507
- console.log('###################', this.compLanePhaseData)
508
- },
509
- comparePhaseStatus () {
510
- // 对比车道: 跟随相位和相位的状态数据(此处判断是为了保证被比较的数据direction都是唯一的)
511
- if (!this.comdirePhaseData && !this.comdireOverlapPhaseData) {
512
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type')
513
- } else if (!this.comdireOverlapPhaseData) {
514
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.comdirePhaseData, this.overlapLanePhaseData, 'type')
515
- } else if (!this.comdirePhaseData) {
516
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.comdireOverlapPhaseData, 'type')
517
- } else {
518
- this.compLanePhaseData = this.CrossDiagramMgr.compare(this.comdirePhaseData, this.comdireOverlapPhaseData, 'type')
519
- }
520
- },
521
- comparePedStatus () {
522
- // 对比人行道: 跟随相位和相位的状态数据
523
- this.compSidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype')
524
- },
525
- resetPhaseStatus () {
526
- // 车道相位、行人相位恢复默认状态
527
- this.resetflag = false
528
- this.$nextTick(() => {
529
- this.resetflag = true
530
- })
531
- },
532
- SpecialControl (data) {
533
- switch (data.control) {
534
- case 2: this.handleSpecialControlStatus('全红')
535
- break
536
- case 3: this.handleSpecialControlStatus('关灯')
537
- break
538
- default: this.handleSpecialControlStatus('默认')
539
- }
540
- },
541
- handleDefaultStatus () {
542
- // 恢复默认状态
543
- if (this.compLanePhaseData.length) {
544
- this.phaseCountdown = ''
545
- this.phaseCountdownColor = '#fff'
546
- this.compLanePhaseData.forEach(data => {
547
- data.color = '#fff'
548
- })
549
- }
550
- if (this.compSidewalkPhaseData.length) {
551
- this.compSidewalkPhaseData.forEach(data => {
552
- data.color = '#fff'
553
- })
554
- }
555
- if (this.comdireBusPhaseData.length) {
556
- this.comdireBusPhaseData.forEach(data => {
557
- data.color = '#fff'
558
- })
559
- }
560
- this.phaseCountdownList = []
561
- this.stageCountdownList = []
562
- this.resetPhaseStatus()
563
- },
564
- handleSpecialControlStatus (Control) {
565
- this.resetPhaseStatus()
566
- // 控制黄闪、全红、关灯、默认情况下的车道相位颜色和倒计时颜色
567
- if (Control === '默认') {
568
- // 倒计时恢复默认颜色
569
- this.phaseCountdownList.forEach(item => {
570
- item.phaseCountdown = ''
571
- item.id = ''
572
- item.phaseCountdownColor = '#fff'
573
- })
574
- }
575
- if (this.compLanePhaseData.length) {
576
- const compLanePhaseData = this.compLanePhaseData.map(data => ({
577
- ...data,
578
- color: this.phaseControlColorMap.get(Control)
579
- }))
580
- this.compLanePhaseData = JSON.parse(JSON.stringify(compLanePhaseData))
581
- }
582
- if (this.compSidewalkPhaseData.length) {
583
- const compSidewalkPhaseData = this.compSidewalkPhaseData.map(data => ({
584
- ...data,
585
- color: this.phaseControlColorMap.get(Control)
586
- }))
587
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(compSidewalkPhaseData))
588
- }
589
- if (this.comdireBusPhaseData.length) {
590
- const comdireBusPhaseData = this.comdireBusPhaseData.map(data => ({
591
- ...data,
592
- color: this.phaseControlColorMap.get(Control)
593
- }))
594
- this.comdireBusPhaseData = JSON.parse(JSON.stringify(comdireBusPhaseData))
595
- }
596
- if (this.mainType === '103') {
597
- if (this.LanePhaseData.length) {
598
- const LanePhaseData = this.LanePhaseData.map(data => ({
599
- ...data,
600
- color: this.phaseControlColorMap.get(Control)
601
- }))
602
- this.LanePhaseData = JSON.parse(JSON.stringify(LanePhaseData))
603
- }
604
- }
605
- },
606
- createPhaseStatusMap () {
607
- // 生成相位id和相位状态对应数据结构
608
- this.phaseStatusMap = new Map()
609
- this.phaseStatusList.map(phase => {
610
- let phaseId = phase.id
611
- let phaseInfo = {
612
- type: phase.type,
613
- phaseCountdown: phase.countdown,
614
- pedtype: phase.pedtype
615
- }
616
- this.phaseStatusMap.set(phaseId, phaseInfo)
617
- })
618
- },
619
- getYellowFlashColor () {
620
- // 车道相位(左行右行)
621
- let curLanePhaseData = []
622
- for (let i = 0; i < this.compLanePhaseData.length; i++) {
623
- const data = {
624
- ...this.compLanePhaseData[i],
625
- type: '黄闪',
626
- control: 1
627
- }
628
- curLanePhaseData.push(data)
629
- }
630
- this.compLanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
631
-
632
- // 行人相位
633
- let curPedStatus = []
634
- for (let i = 0; i < this.compSidewalkPhaseData.length; i++) {
635
- const data = {
636
- ...this.compSidewalkPhaseData[i],
637
- pedtype: '黄闪',
638
- control: 1
639
- }
640
- curPedStatus.push(data)
641
- }
642
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
643
-
644
- // 公交相位
645
- let curBusLanePhaseData = []
646
- for (let i = 0; i < this.comdireBusPhaseData.length; i++) {
647
- const data = {
648
- ...this.comdireBusPhaseData[i],
649
- type: '黄闪',
650
- control: 1
651
- }
652
- curBusLanePhaseData.push(data)
653
- }
654
- this.comdireBusPhaseData = JSON.parse(JSON.stringify(curBusLanePhaseData))
655
-
656
- if (this.mainType === '103') {
657
- // 匝道相位
658
- if (this.LanePhaseData.length) {
659
- const LanePhaseData = this.LanePhaseData.map(data => ({
660
- ...data,
661
- type: '黄闪',
662
- control: 1
663
- }))
664
- this.LanePhaseData = JSON.parse(JSON.stringify(LanePhaseData))
665
- }
666
- }
667
- },
668
- getPhaseStatus () {
669
- // 得到车道相位状态(颜色)
670
- this.comdirePhaseData = []
671
- let curLanePhaseData = []
672
- for (let i = 0; i < this.LanePhaseData.length; i++) {
673
- let curPhaseStatus = this.phaseStatusMap.get(this.LanePhaseData[i].phaseid)
674
- if (!curPhaseStatus) continue
675
- const data = {
676
- ...this.LanePhaseData[i],
677
- type: curPhaseStatus.type,
678
- color: this.ColorMap.get(curPhaseStatus.type),
679
- phaseCountdown: curPhaseStatus.phaseCountdown,
680
- flag: 'phase' // 车道相位数据标识
681
- }
682
- curLanePhaseData.push(data)
683
- }
684
- this.LanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
685
- // 处理相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
686
- // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
687
- this.comdirePhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.LanePhaseData, 'type', 'phase')))
688
- },
689
- createOverlapPhaseStatusMap () {
690
- // 处理跟随相位的母相位设置为忽略相位后的情况(如果跟随相位的母相位包含忽略相位,过滤掉跟随相位的状态数据,参照相位状态数据处理)
691
- let isMphaseStatusDataReturn = false
692
- let reset = false
693
- this.overlapStatusList = this.overlapStatusList.filter(ele => {
694
- let phaseids = this.phaseStatusList.map(item => item.id)
695
- let mphase = ele.mphase
696
- console.log(phaseids)
697
- console.log(mphase)
698
- const phaseidsSet = new Set(phaseids)
699
- isMphaseStatusDataReturn = mphase.every(value => phaseidsSet.has(value))
700
- console.log(`跟随相位${ele.id}的母相位状态数据是否均返回?`, isMphaseStatusDataReturn)
701
- if (isMphaseStatusDataReturn !== this.isMphaseStatusDataReturnMap.get(ele.id) && !reset && this.overlapStatusCompareSum > 0) {
702
- this.getIntersectionInfo()
703
- reset = true
704
- }
705
- this.isMphaseStatusDataReturnMap = this.isMphaseStatusDataReturnMap.set(ele.id, isMphaseStatusDataReturn)
706
- return isMphaseStatusDataReturn
707
- })
708
- this.overlapStatusCompareSum = this.overlapStatusCompareSum + 1
709
- // 得到跟随相位状态Map数据
710
- this.overlapPhaseStatusMap = new Map()
711
- this.overlapStatusList.map(phase => {
712
- let phaseId = phase.id
713
- let phaseInfo = {
714
- type: phase.type,
715
- phaseCountdown: phase.countdown,
716
- pedtype: phase.pedtype
717
- }
718
- this.overlapPhaseStatusMap.set(phaseId, phaseInfo)
719
- })
720
- },
721
- getOverlapPhaseStatus () {
722
- // 得到车道跟随相位状态(颜色)
723
- this.comdireOverlapPhaseData = []
724
- let curLanePhaseData = []
725
- for (let i = 0; i < this.overlapLanePhaseData.length; i++) {
726
- let curPhaseStatus = this.overlapPhaseStatusMap.get(this.overlapLanePhaseData[i].phaseid)
727
- if (!curPhaseStatus) continue
728
- const data = {
729
- ...this.overlapLanePhaseData[i],
730
- type: curPhaseStatus.type,
731
- color: this.ColorMap.get(curPhaseStatus.type),
732
- phaseCountdown: curPhaseStatus.phaseCountdown,
733
- flag: 'overlapphase' // 车道跟随相位数据标识
734
- }
735
- curLanePhaseData.push(data)
736
- }
737
- this.overlapLanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
738
- // 处理跟随相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
739
- // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
740
- this.comdireOverlapPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.overlapLanePhaseData, 'type', 'overlapphase')))
741
- },
742
- getBusPhaseStatus () {
743
- // 得到公交车道相位状态(颜色)
744
- this.comdireBusPhaseData = []
745
- let curLanePhaseData = []
746
- for (let i = 0; i < this.busPhaseData.length; i++) {
747
- let curPhaseStatus = this.phaseStatusMap.get(this.busPhaseData[i].phaseid)
748
- if (!curPhaseStatus) continue
749
- const data = {
750
- ...this.busPhaseData[i],
751
- type: curPhaseStatus.type,
752
- color: this.ColorMap.get(curPhaseStatus.type),
753
- phaseCountdown: curPhaseStatus.phaseCountdown,
754
- flag: 'busphase' // 车道相位数据标识
755
- }
756
- curLanePhaseData.push(data)
757
- }
758
- this.busPhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
759
- // 处理相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
760
- // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
761
- this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.busPhaseData, 'type', 'busphase')))
762
- },
763
- getCurPhaseCountdown () {
764
- // 获取当前相位倒计时颜色
765
- this.phaseCountdownList = []
766
- this.isHasCountdown = false
767
- this.curPhase.forEach(curP => {
768
- this.phaseStatusList.forEach(phaseInfo => {
769
- if (phaseInfo.id === curP) {
770
- let countdownObj = {}
771
- countdownObj.id = phaseInfo.id
772
- countdownObj.phaseCountdown = phaseInfo.countdown
773
- countdownObj.phaseCountdownColor = this.ColorMap.get(phaseInfo.type)
774
- let curphasedir = this.phaseDirMap.get(phaseInfo.id)
775
- if (curphasedir !== undefined) {
776
- if (curphasedir.direction && curphasedir.direction.length > 0) {
777
- countdownObj.showlist = curphasedir.direction.map(dir => {
778
- return {
779
- id: dir,
780
- peddirection: this.getshowped(curphasedir.peddirection),
781
- color: '#fff'
782
- }
783
- })
784
- } else {
785
- countdownObj.showlist = [
786
- {
787
- id: '',
788
- peddirection: this.getshowped(curphasedir.peddirection),
789
- color: '#fff'
790
- }
791
- ]
792
- }
793
- } else {
794
- countdownObj.showlist = []
795
- }
796
-
797
- this.phaseCountdownList.push(countdownObj)
798
- if (phaseInfo.countdown !== undefined && phaseInfo.countdown !== -1) {
799
- this.isHasCountdown = true
800
- }
801
- }
802
- })
803
- })
804
- },
805
- stagesList () {
806
- let list = []
807
- this.isHasStageCountdown = false
808
- if (this.crossStatusData && this.crossStatusData.stages && this.crossInfo.phaseList && this.crossInfo.phaseList.length > 0) {
809
- this.isHasStageCountdown = true
810
- let ringDataModel = new RingDataModel(this.crossStatusData, this.crossInfo.phaseList)
811
- list = ringDataModel.getStageData()
812
- if (this.isShowCurrentStage) {
813
- this.currentStage = this.crossStatusData.current_stage
814
- }
815
- }
816
- return list
817
- },
818
- dirListSetTheme (list) {
819
- let dirArr = []
820
- for (let rec of list) {
821
- let recd = {
822
- ...rec,
823
- color: '#fff'
824
- }
825
- dirArr.push(recd)
826
- for (let i = 0; i < rec.peddirection.length; i++) {
827
- rec.peddirection[i].color = 'rgba(255, 255, 255, 0.6)'
828
- }
829
- }
830
- return dirArr
831
- },
832
- getCurStageCountdown () {
833
- // 获取当前相位倒计时颜色
834
- this.stageCountdownList = []
835
- let stagesList = this.stagesList()
836
- this.stageCountdownList = stagesList[this.curStage - 1]
837
- this.stageCountdownList = this.stageCountdownList.map(phaseInfo => {
838
- return {
839
- ...phaseInfo,
840
- phaseCountdownColor: this.ColorMap.get(phaseInfo.type)
841
- }
842
- })
843
- // console.log(this.stageCountdownList)
844
- },
845
- getshowped (peddirection) {
846
- let peddirarr = peddirection.map(peddir => ({
847
- id: peddir,
848
- name: this.PhaseDataModel.getSidePos(peddir).name,
849
- color: 'rgba(255, 255, 255, 0.4)'
850
- }))
851
- return peddirarr
852
- },
853
- getIntersectionInfo () {
854
- // 获取路口信息
855
- this.contrloType = 'ring'
856
- const agentid = this.agentId
857
- getIntersectionInfo(agentid).then(res => {
858
- if (!res.data.success) {
859
- this.isLoaded = false
860
- let commomMsg = this.$t('openatccomponents.overview.signalID') + ' : ' + agentid
861
- let msg = getMessageByCode(res.data.code, this.$i18n.locale)
862
- if (res.data.data) {
863
- // 子类型错误
864
- let childErrorCode = res.data.data.errorCode
865
- if (childErrorCode) {
866
- let childerror = getMessageByCode(res.data.data.errorCode, this.$i18n.locale)
867
- msg = msg + ' - ' + childerror
868
- }
869
- }
870
- msg = msg + ' - ' + commomMsg
871
- // this.isShowMessage && this.$message.error(msg)
872
- if (this.isShowMessage) {
873
- console.log(msg)
874
- }
875
- return
876
- }
877
- this.isLoaded = true
878
- this.tempType = res.data.data.type
879
- // 获取车道相位、行人相位信息(坐标、名称)
880
- this.mainType = this.tempType.split('-')[0]
881
- this.mainDirection = this.tempType.split('-')[1]
882
- if (this.isVipRoute) {
883
- this.getValidDirections()
884
- this.getMergeDirections()
885
- }
886
- if (this.isVipRoute && !this.isThirdSignal) {
887
- // 特勤、分组管控下,非第三方设备,按通道显示相位方向;第三方设备还是按路口相位配置显示相位方向
888
- this.getChannelInfo()
889
- return
890
- }
891
- if (this.channelType && !this.isThirdSignal) {
892
- this.getChannelInfo()
893
- return
894
- }
895
- this.getTempCrossInfo(res)
896
- // 显示阶段的判断条件
897
- this.allPatternList = res.data.data.param.patternList
898
- if (this.allPatternList[0].rings === undefined || this.allPatternList[0].rings.length === 0) {
899
- this.contrloType = 'stage'
900
- } else if (this.allPatternList[0].contrloType === 'stage') {
901
- this.contrloType = 'stage'
902
- } else {
903
- this.contrloType = 'ring'
904
- }
905
- })
906
- },
907
- getTempCrossInfo (res) {
908
- this.crossInfo = res.data.data.param
909
- this.crossInfo.phaseList.forEach(cross => this.phaseDirMap.set(cross.id, {direction: cross.direction, peddirection: cross.peddirection}))
910
- if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
911
- // 城市道路加载车道相位坐标和人行道坐标
912
- this.getPhasePos()
913
- this.getOverlapPhasePos()
914
- this.getPedPhasePos()
915
- this.getOverlapPedPhasePos()
916
- if (!this.isVipRoute) {
917
- this.getBusPos()
918
- }
919
- }
920
- if (!this.isVipRoute && this.mainType === '103') {
921
- // 获取匝道道路的主路和支路的相位坐标
922
- this.getRampPhasePos()
923
- }
924
- if (!this.isVipRoute) {
925
- this.drawDefaultPhaseIcon()
926
- }
927
- if (this.isVipRoute && this.isThirdSignal) {
928
- this.LanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')
929
- // console.log(this.LanePhaseData)
930
- this.sidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')
931
- let allDir = this.LanePhaseData.map(ele => ele.id)
932
- let allPedDir = this.sidewalkPhaseData.map(ele => ele.id)
933
- this.inneChoosedDirection = this.choosedDirection.filter(dir => allDir.indexOf(dir) !== -1)
934
- this.inneChoosedPedDirection = this.choosedPedDirection.filter(dir => allPedDir.indexOf(dir) !== -1)
935
- this.drawPhaseIcon()
936
- }
937
- },
938
- getBusPos () {
939
- // 公交相位信息
940
- this.busPhaseData = []
941
- this.crossInfo.phaseList.forEach((ele, i) => {
942
- if (ele.controltype >= 3 && ele.controltype <= 6) {
943
- ele.direction.forEach((dir, index) => {
944
- // 车道相位
945
- this.busPhaseData.push({
946
- key: this.CrossDiagramMgr.getUniqueKey('busphase'),
947
- phaseid: ele.id, // 相位id,用于对应相位状态
948
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
949
- name: this.PhaseDataModel.getBusPhasePos(dir).name,
950
- left: this.PhaseDataModel.getBusPhasePos(dir).x,
951
- top: this.PhaseDataModel.getBusPhasePos(dir).y,
952
- busleft: this.PhaseDataModel.getBusMapPos(dir).x,
953
- bustop: this.PhaseDataModel.getBusMapPos(dir).y,
954
- controltype: ele.controltype
955
- })
956
- })
957
- }
958
- })
959
- // 去掉重复方向的数据
960
- this.busPhaseData = Array.from(new Set(this.busPhaseData.map(item => item.id)))
961
- .map(id => this.busPhaseData.find(item => item.id === id))
962
- },
963
- createRandomType () {
964
- for (var i = 3; i <= 5; i++) {
965
- return Math.floor(Math.random() * (5 - 3)) + 3
966
- }
967
- },
968
- getPhasePos () {
969
- // 车道相位信息
970
- this.LanePhaseData = []
971
- this.crossInfo.phaseList.forEach((ele, i) => {
972
- if (ele.controltype === undefined || ele.controltype <= 2) {
973
- ele.direction.forEach((dir, index) => {
974
- // 车道相位
975
- this.LanePhaseData.push({
976
- key: this.CrossDiagramMgr.getUniqueKey('phase'),
977
- phaseid: ele.id, // 相位id,用于对应相位状态
978
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
979
- name: this.PhaseDataModel.getPhase(dir).name,
980
- left: this.PhaseDataModel.getPhase(dir).x,
981
- top: this.PhaseDataModel.getPhase(dir).y
982
- })
983
- })
984
- }
985
- })
986
- // 去掉重复方向的数据
987
- this.LanePhaseData = Array.from(new Set(this.LanePhaseData.map(item => item.id)))
988
- .map(id => this.LanePhaseData.find(item => item.id === id))
989
- },
990
- getOverlapPhasePos () {
991
- // 车道跟随相位信息
992
- if (!this.crossInfo.overlaplList) return
993
- this.overlapLanePhaseData = []
994
- this.crossInfo.overlaplList.forEach((ele, i) => {
995
- if (ele.direction) {
996
- ele.direction.forEach((dir, index) => {
997
- this.overlapLanePhaseData.push({
998
- key: this.CrossDiagramMgr.getUniqueKey('overlapphase'),
999
- phaseid: ele.id, // 相位id,用于对应相位状态
1000
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1001
- name: this.PhaseDataModel.getPhase(dir).name,
1002
- left: this.PhaseDataModel.getPhase(dir).x,
1003
- top: this.PhaseDataModel.getPhase(dir).y
1004
- })
1005
- })
1006
- }
1007
- })
1008
- // 去掉重复方向的数据
1009
- this.overlapLanePhaseData = Array.from(new Set(this.overlapLanePhaseData.map(item => item.id)))
1010
- .map(id => this.overlapLanePhaseData.find(item => item.id === id))
1011
- },
1012
- getRampPhasePos () {
1013
- // 匝道车道相位信息
1014
- this.LanePhaseData = []
1015
- this.crossInfo.phaseList.forEach((ele, i) => {
1016
- ele.direction.forEach((dir, index) => {
1017
- if (ele.controltype === 0) {
1018
- this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getMainPhasePos)
1019
- }
1020
- if (ele.controltype === 1) {
1021
- this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getSidePhasePos)
1022
- }
1023
- })
1024
- })
1025
- // 去掉重复方向的数据
1026
- this.LanePhaseData = Array.from(new Set(this.LanePhaseData.map(item => item.id)))
1027
- .map(id => this.LanePhaseData.find(item => item.id === id))
1028
- },
1029
- handleRampPhasePosData (key, phase, dir) {
1030
- let posInfo = phase.controltype === 0 ? this.PhaseDataModel.getMainPhasePos(dir) : this.PhaseDataModel.getSidePhasePos(dir)
1031
- this.LanePhaseData.push({
1032
- key,
1033
- controlType: phase.controltype,
1034
- phaseid: phase.id, // 相位id,用于对应相位状态
1035
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1036
- name: posInfo.name,
1037
- left: posInfo.x,
1038
- top: posInfo.y
1039
- })
1040
- },
1041
- getPedPhasePos () {
1042
- // 行人相位信息
1043
- this.sidewalkPhaseData = []
1044
- this.crossInfo.phaseList.forEach((ele, i) => {
1045
- if (ele.peddirection) {
1046
- ele.peddirection.forEach((dir, index) => {
1047
- // 行人相位
1048
- if (this.PhaseDataModel.getSidePos(dir)) {
1049
- let key = this.CrossDiagramMgr.getUniqueKey('pedphase')
1050
- if (this.isVipRoute && this.isThirdSignal) {
1051
- key = this.CrossDiagramMgr.getUniqueKey('pedphase') + `-${this.agentId}`
1052
- }
1053
- this.sidewalkPhaseData.push({
1054
- key,
1055
- phaseid: ele.id, // 相位id,用于对应相位状态
1056
- id: dir,
1057
- name: this.PhaseDataModel.getSidePos(dir).name,
1058
- left: this.PhaseDataModel.getSidePos(dir).x,
1059
- top: this.PhaseDataModel.getSidePos(dir).y
1060
- })
1061
- }
1062
- })
1063
- }
1064
- })
1065
- // 去掉重复方向的数据
1066
- this.sidewalkPhaseData = Array.from(new Set(this.sidewalkPhaseData.map(item => item.id)))
1067
- .map(id => this.sidewalkPhaseData.find(item => item.id === id))
1068
- },
1069
- getOverlapPedPhasePos () {
1070
- // 行人跟随相位信息
1071
- if (!this.crossInfo.overlaplList) return
1072
- this.overlapsidewalkPhaseData = []
1073
- this.crossInfo.overlaplList.forEach((ele, i) => {
1074
- if (ele.peddirection) {
1075
- ele.peddirection.forEach((dir, index) => {
1076
- if (this.PhaseDataModel.getSidePos(dir)) {
1077
- this.overlapsidewalkPhaseData.push({
1078
- key: this.CrossDiagramMgr.getUniqueKey('overlappedphase'),
1079
- phaseid: ele.id, // 相位id,用于对应相位状态
1080
- id: dir,
1081
- name: this.PhaseDataModel.getSidePos(dir).name,
1082
- left: this.PhaseDataModel.getSidePos(dir).x,
1083
- top: this.PhaseDataModel.getSidePos(dir).y
1084
- })
1085
- }
1086
- })
1087
- }
1088
- })
1089
- // 去掉重复方向的数据
1090
- this.overlapsidewalkPhaseData = Array.from(new Set(this.overlapsidewalkPhaseData.map(item => item.id)))
1091
- .map(id => this.overlapsidewalkPhaseData.find(item => item.id === id))
1092
- },
1093
- getEffectDirectionPos () {
1094
- this.effectDirData = []
1095
- // this.effectiveDirection = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1096
- this.effectiveDirection.forEach((dir, i) => {
1097
- this.effectDirData.push({
1098
- key: this.CrossDiagramMgr.getUniqueKey('effectiveDir'),
1099
- id: dir,
1100
- name: this.PhaseDataModel.getEffectPos(dir).name,
1101
- left: this.PhaseDataModel.getEffectPos(dir).x,
1102
- top: this.PhaseDataModel.getEffectPos(dir).y,
1103
- color: '#6e737c'
1104
- })
1105
- })
1106
- },
1107
- getCrossType () {
1108
- // 路口类型对应底图决策
1109
- if (this.mainType === '101') {
1110
- // 十字路口
1111
- this.crossType = 'Crossroads'
1112
- }
1113
- if (this.mainType === '100') {
1114
- // T型路口
1115
- switch (this.mainDirection) {
1116
- case '001': this.crossType = 'TypeT-east'
1117
- break
1118
- case '002': this.crossType = 'TypeT-south'
1119
- break
1120
- case '003': this.crossType = 'TypeT-west'
1121
- break
1122
- case '004': this.crossType = 'TypeT-north'
1123
- break
1124
- }
1125
- }
1126
- if (this.mainType === '103') {
1127
- // 匝道
1128
- switch (this.mainDirection) {
1129
- case '001': this.crossType = 'ramp-east'
1130
- break
1131
- case '002': this.crossType = 'ramp-south'
1132
- break
1133
- case '003': this.crossType = 'ramp-west'
1134
- break
1135
- case '004': this.crossType = 'ramp-north'
1136
- break
1137
- }
1138
- }
1139
- if (this.mainType === '104') {
1140
- // 路段行人过街
1141
- switch (this.mainDirection) {
1142
- case '005': this.crossType = 'ped-section-east-west'
1143
- break
1144
- case '006': this.crossType = 'ped-section-south-north'
1145
- break
1146
- }
1147
- }
1148
- if (this.mainType === '999') {
1149
- // 其他路口
1150
- this.crossType = 'Customroads'
1151
- }
1152
- },
1153
- refresh () {
1154
- this.getIntersectionInfo()
1155
- },
1156
- getpedStatus () {
1157
- // 行人相位状态
1158
- let curPedStatus = []
1159
- for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
1160
- if (this.sidewalkPhaseData[i].phaseid) {
1161
- let curPhaseStatus = this.phaseStatusMap.get(this.sidewalkPhaseData[i].phaseid)
1162
- if (!curPhaseStatus) continue
1163
- const data = {
1164
- ...this.sidewalkPhaseData[i],
1165
- pedtype: curPhaseStatus.pedtype,
1166
- color: this.SidewalkColorMap.get(curPhaseStatus.pedtype),
1167
- flag: 'ped' // 行人相位数据标识
1168
- }
1169
- curPedStatus.push(data)
1170
- } else {
1171
- // 无状态的行人道
1172
- const data = {
1173
- ...this.sidewalkPhaseData[i],
1174
- pedtype: undefined
1175
- }
1176
- curPedStatus.push(data)
1177
- }
1178
- }
1179
- this.sidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
1180
- },
1181
- getOverlapPedStatus () {
1182
- // 行人跟随相位状态
1183
- let curPedStatus = []
1184
- for (let i = 0; i < this.overlapsidewalkPhaseData.length; i++) {
1185
- if (this.overlapsidewalkPhaseData[i].phaseid) {
1186
- let curPhaseStatus = this.overlapPhaseStatusMap.get(this.overlapsidewalkPhaseData[i].phaseid)
1187
- if (!curPhaseStatus) {
1188
- // 无状态的行人道,也显示出来
1189
- // const data = {
1190
- // ...this.overlapsidewalkPhaseData[i],
1191
- // pedtype: undefined
1192
- // }
1193
- // curPedStatus.push(data)
1194
- continue
1195
- }
1196
- const data = {
1197
- ...this.overlapsidewalkPhaseData[i],
1198
- pedtype: curPhaseStatus.pedtype,
1199
- color: this.SidewalkColorMap.get(curPhaseStatus.pedtype),
1200
- flag: 'overlapped' // 行人跟随相位数据标识
1201
- }
1202
- curPedStatus.push(data)
1203
- } else {
1204
- // 无状态的行人道
1205
- const data = {
1206
- ...this.overlapsidewalkPhaseData[i],
1207
- pedtype: undefined
1208
- }
1209
- curPedStatus.push(data)
1210
- }
1211
- }
1212
- this.overlapsidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
1213
- },
1214
- getRoadDirection () {
1215
- // 获取行车方向(从平台或配置工具的配置文件中读取)
1216
- this.roadDir = this.roadDirection
1217
- },
1218
- getChannelInfo () {
1219
- uploadSingleTscParam('channel', this.agentId).then(data => {
1220
- let res = data.data
1221
- if (!res.success) {
1222
- if (res.code === '4003') {
1223
- // this.isShowMessage && this.$message.error(this.$t('openatccomponents.errorTip.devicenotonline'))
1224
- if (this.isShowMessage) {
1225
- console.log(this.$t('openatccomponents.errorTip.devicenotonline'))
1226
- }
1227
- return
1228
- }
1229
- // this.isShowMessage && this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
1230
- if (this.isShowMessage) {
1231
- console.log(getMessageByCode(data.data.code, this.$i18n.locale))
1232
- }
1233
- return
1234
- }
1235
- let channelList = res.data.data.channelList.filter(ele => ele.type !== undefined)
1236
- this.channelList = this.handleRepeatRealdir(channelList)
1237
- console.log('this.channelList', this.channelList)
1238
- this.handleChannelDirection()
1239
- })
1240
- },
1241
- handleRepeatRealdir (channelList) {
1242
- // 按realdir去掉重复方向的数据
1243
- let dirChannelList = channelList.filter(ele => ele.realdir !== undefined && (ele.type === 0 || ele.type === 1 || ele.type === 3))
1244
- let pedDirChannelList = channelList.filter(ele => ele.realdir !== undefined && ele.type === 2)
1245
- let map = new Map()
1246
- let map2 = new Map()
1247
- dirChannelList.forEach(ele => {
1248
- ele.realdir.forEach(dir => {
1249
- if (map.get(dir) === undefined) {
1250
- map.set(dir, ele)
1251
- }
1252
- })
1253
- })
1254
- pedDirChannelList.forEach(ele => {
1255
- ele.realdir.forEach(dir => {
1256
- if (map2.get(dir) === undefined) {
1257
- map2.set(dir, ele)
1258
- }
1259
- })
1260
- })
1261
- let arr = Array.from(map)
1262
- let pedarr = Array.from(map2)
1263
- let newarr = []
1264
- arr.forEach(ele => {
1265
- ele[1].realdir = [ele[0]]
1266
- let obj = {
1267
- ...ele[1],
1268
- realdir: [ele[0]]
1269
- }
1270
- newarr.push(obj)
1271
- })
1272
- pedarr.forEach(ele => {
1273
- ele[1].realdir = [ele[0]]
1274
- let obj = {
1275
- ...ele[1],
1276
- realdir: [ele[0]]
1277
- }
1278
- newarr.push(obj)
1279
- })
1280
- // console.log(newarr)
1281
- return newarr
1282
- },
1283
- handleChannelDirection () {
1284
- this.LanePhaseData = []
1285
- this.sidewalkPhaseData = []
1286
- this.sidewalkDir = []
1287
- let realphasedirarr = []
1288
- let realpeddirarr = []
1289
- this.channelList.forEach((ele, i) => {
1290
- if (ele.type === 0 || ele.type === 1 || ele.type === 3) {
1291
- if (ele.realdir) {
1292
- ele.realdir.forEach((dir, index) => {
1293
- // 车道相位(通道类型是机动车,非机动车,公交时,对应相位机动车)
1294
- this.LanePhaseData.push({
1295
- key: this.CrossDiagramMgr.getUniqueKey('phase'),
1296
- channelid: ele.id, // 通道id
1297
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1298
- name: this.PhaseDataModel.getPhase(dir).name,
1299
- left: this.PhaseDataModel.getPhase(dir).x,
1300
- top: this.PhaseDataModel.getPhase(dir).y
1301
- })
1302
- })
1303
- realphasedirarr = Array.from(new Set(realphasedirarr.concat(ele.realdir)))
1304
- }
1305
- }
1306
- if (ele.type === 2) {
1307
- if (ele.realdir) {
1308
- ele.realdir.forEach((dir, index) => {
1309
- // 行人相位
1310
- if (this.sidewalkDir.indexOf(dir) === -1 && this.PhaseDataModel.getSidePos(dir)) {
1311
- let obj = {
1312
- key: this.CrossDiagramMgr.getUniqueKey('pedphase') + `-${this.agentId}`,
1313
- channelid: ele.id, // 通道id
1314
- id: dir,
1315
- name: this.PhaseDataModel.getSidePos(dir).name
1316
- }
1317
- if (this.channelType) {
1318
- obj.left = this.PhaseDataModel.getSidePos(dir).x
1319
- obj.top = this.PhaseDataModel.getSidePos(dir).y
1320
- }
1321
- this.sidewalkPhaseData.push(obj)
1322
- }
1323
- })
1324
- realpeddirarr = Array.from(new Set(realpeddirarr.concat(ele.realdir)))
1325
- this.sidewalkDir = Array.from(new Set([...this.sidewalkDir.concat(ele.realdir)]))
1326
- }
1327
- }
1328
- })
1329
- this.inneChoosedDirection = this.choosedDirection.filter(dir => realphasedirarr.indexOf(dir) !== -1)
1330
- this.inneChoosedPedDirection = this.choosedPedDirection.filter(dir => realpeddirarr.indexOf(dir) !== -1)
1331
- this.drawPhaseIcon()
1332
- },
1333
- async drawPhaseIcon () {
1334
- const targetIds = [4, 8, 12, 16] // 掉头相位后画
1335
- this.LanePhaseData = this.LanePhaseData.filter(item => !targetIds.includes(item.id)).concat(this.LanePhaseData.filter(item => targetIds.includes(item.id)))
1336
- if (!this.isThirdSignal && this.isVipRoute) {
1337
- await this.getConflictList()
1338
- this.handleClickedPhase()
1339
- this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1340
- this.handleClickedPedPhase()
1341
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.sidewalkPhaseData))
1342
- } else {
1343
- // 第三方信号机不需要处理冲突关系
1344
- this.handleClickedPhase()
1345
- this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1346
- this.handleClickedPedPhase()
1347
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.sidewalkPhaseData))
1348
- }
1349
- },
1350
- handleClickedPhase () {
1351
- if (!this.isThirdSignal) {
1352
- this.inneChoosedDirection = this.inneChoosedDirection.filter(dir => this.phaseConflictList.indexOf(dir) === -1)
1353
- }
1354
- for (let index = 0; index < this.LanePhaseData.length; index++) {
1355
- const element = this.LanePhaseData[index]
1356
- if (this.inneChoosedDirection.indexOf(element.id) !== -1) {
1357
- element.clicked = true
1358
- }
1359
- }
1360
- },
1361
-
1362
- handleClickPhaseIcon (key, action) {
1363
- let curClickedPhase = {}
1364
- if (action === 'clicked') {
1365
- for (let index = 0; index < this.LanePhaseData.length; index++) {
1366
- const element = this.LanePhaseData[index]
1367
- if (element.key === key) {
1368
- element.clicked = true
1369
- curClickedPhase = JSON.parse(JSON.stringify(element))
1370
- }
1371
- }
1372
- }
1373
- if (action === 'cancle') {
1374
- for (let index = 0; index < this.LanePhaseData.length; index++) {
1375
- const element = this.LanePhaseData[index]
1376
- if (element.key === key) {
1377
- delete element.clicked
1378
- }
1379
- }
1380
- }
1381
- this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1382
- let clickedDirection = this.compLanePhaseData.filter(ele => ele.clicked && !ele.disabled)
1383
- this.inneChoosedDirection = clickedDirection.map(ele => ele.id)
1384
- this.EmitAllChoosedDirection(curClickedPhase)
1385
- },
1386
- handleClickedPedPhase () {
1387
- if (!this.isThirdSignal) {
1388
- this.inneChoosedPedDirection = this.inneChoosedPedDirection.filter(dir => this.pedConflictList.indexOf(dir) === -1)
1389
- }
1390
- // 排他
1391
- for (let index = 0; index < this.sidewalkPhaseData.length; index++) {
1392
- const element = this.sidewalkPhaseData[index]
1393
- delete element.clicked
1394
- }
1395
- for (let index = 0; index < this.sidewalkPhaseData.length; index++) {
1396
- const element = this.sidewalkPhaseData[index]
1397
- if (this.inneChoosedPedDirection.indexOf(element.id) !== -1) {
1398
- element.clicked = true
1399
- }
1400
- }
1401
- },
1402
- handleClickSidewalkIcon (data, curChoosePed) {
1403
- this.clickedPedDirection = data.filter(ele => ele.clicked && !ele.disabled)
1404
- this.inneChoosedPedDirection = this.clickedPedDirection.map(ele => ele.id)
1405
- this.EmitAllChoosedDirection(curChoosePed)
1406
- },
1407
- EmitAllChoosedDirection (curClickedPhase) {
1408
- let allChoosedDir = {
1409
- direction: this.inneChoosedDirection,
1410
- peddirection: this.inneChoosedPedDirection
1411
- }
1412
- this.$emit('handleClickCrossIcon', allChoosedDir, curClickedPhase)
1413
- this.drawPhaseIcon()
1414
- },
1415
- async getConflictList () {
1416
- let ConflictList = new CrossDirectionConflictList(this.agentId)
1417
- return ConflictList.getConflictListByAgentid().then(res => {
1418
- if (res) {
1419
- let conflictList = ConflictList.getListDirConflict(this.inneChoosedDirection, this.inneChoosedPedDirection)
1420
- this.phaseConflictList = conflictList.allConflictDir
1421
- this.pedConflictList = conflictList.allPedConflictDir
1422
- // 排他
1423
- for (let index = 0; index < this.LanePhaseData.length; index++) {
1424
- const element = this.LanePhaseData[index]
1425
- delete element.disabled
1426
- }
1427
- for (let index = 0; index < this.sidewalkPhaseData.length; index++) {
1428
- const element = this.sidewalkPhaseData[index]
1429
- delete element.disabled
1430
- }
1431
- for (let index = 0; index < this.LanePhaseData.length; index++) {
1432
- const element = this.LanePhaseData[index]
1433
- if (this.phaseConflictList.indexOf(element.id) !== -1) {
1434
- element.disabled = true
1435
- }
1436
- }
1437
- for (let index = 0; index < this.sidewalkPhaseData.length; index++) {
1438
- const element = this.sidewalkPhaseData[index]
1439
- if (this.pedConflictList.indexOf(element.id) !== -1) {
1440
- element.disabled = true
1441
- }
1442
- }
1443
- // console.log(this.LanePhaseData)
1444
- }
1445
- })
1446
- },
1447
- createChannelStatusMap () {
1448
- // 生成相位id和相位状态对应数据结构
1449
- this.channelStatusList.map(channel => {
1450
- let channelId = channel.id
1451
- let channelInfo = {
1452
- light: channel.light
1453
- }
1454
- this.channelStatusMap.set(channelId, channelInfo)
1455
- })
1456
- },
1457
- getChannelPhaseStatus () {
1458
- // 通道相位机动车状态
1459
- this.comdirePhaseData = []
1460
- let curLanePhaseData = []
1461
- for (let i = 0; i < this.LanePhaseData.length; i++) {
1462
- let curPhaseStatus = this.channelStatusMap.get(this.LanePhaseData[i].channelid)
1463
- if (!curPhaseStatus) continue
1464
- const data = {
1465
- ...this.LanePhaseData[i],
1466
- type: curPhaseStatus.light,
1467
- color: this.ColorMap.get(curPhaseStatus.light),
1468
- flag: 'phasechannel' // 车道相位数据标识
1469
- }
1470
- curLanePhaseData.push(data)
1471
- }
1472
- this.LanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
1473
- this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1474
- },
1475
- getChannelPedStatus () {
1476
- // 通道行人相位状态
1477
- let curPedStatus = []
1478
- for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
1479
- console.log(this.sidewalkPhaseData[i])
1480
- if (this.sidewalkPhaseData[i].channelid) {
1481
- let curPhaseStatus = this.channelStatusMap.get(this.sidewalkPhaseData[i].channelid)
1482
- if (!curPhaseStatus) continue
1483
- const data = {
1484
- ...this.sidewalkPhaseData[i],
1485
- pedtype: curPhaseStatus.light,
1486
- color: this.ColorMap.get(curPhaseStatus.light),
1487
- flag: 'pedchannel' // 行人相位数据标识
1488
- }
1489
- curPedStatus.push(data)
1490
- } else {
1491
- // 无状态的行人道
1492
- const data = {
1493
- ...this.sidewalkPhaseData[i],
1494
- pedtype: undefined
1495
- }
1496
- curPedStatus.push(data)
1497
- }
1498
- }
1499
- this.compSidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
1500
- },
1501
- getValidDirections () {
1502
- getValidDirections(this.agentId).then((data) => {
1503
- if (!data.data.success) {
1504
- this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
1505
- return
1506
- }
1507
- this.effectiveDirection = data.data.data.validDirections || []
1508
- this.getEffectDirectionPos()
1509
- })
1510
- },
1511
- getMergeDirections () {
1512
- getMergeDirections(this.agentId).then((data) => {
1513
- if (!data.data.success) {
1514
- this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
1515
- return
1516
- }
1517
- this.mergeDirection = data.data.data.mergeDirections || []
1518
- if (this.mergeDirection && this.mergeDirection.length > 0) {
1519
- this.mergeShowList = this.mergeDirection.map(dir => {
1520
- return {
1521
- id: dir,
1522
- color: '#6e737c'
1523
- }
1524
- })
1525
- } else {
1526
- this.mergeShowList = [
1527
- {
1528
- id: '',
1529
- color: '#fff'
1530
- }
1531
- ]
1532
- }
1533
- })
1534
- }
1535
- },
1536
- mounted () {
1537
- // this.init()
1538
- }
1539
- }
1540
- </script>
1541
- <style scoped>
1542
- .invisible {
1543
- visibility: hidden;
1544
- }
1545
- .crossImg{
1546
- position: relative;
1547
- width: 870px;
1548
- height: 650px;
1549
- left: 50%;
1550
- transform: translateX(-50%);
1551
- }
1552
- .centerText {
1553
- position: absolute;
1554
- width: 140px;
1555
- height: 140px;
1556
- left: 50%;
1557
- top: 50%;
1558
- transform: translateX(-50%) translateY(-50%);
1559
- /* text-align: center; */
1560
- z-index: 9;
1561
- display: flex;
1562
- align-items: center;
1563
- /* padding-left: 16px; */
1564
- }
1565
- .phaseCountdown {
1566
- line-height: 42PX;
1567
- font-size: 18px;
1568
- font-weight: normal;
1569
- font-stretch: normal;
1570
- letter-spacing: 0px;
1571
- color: #fff;
1572
- width: 150px;
1573
- margin: 0 auto;
1574
- }
1575
- .countdownBg {
1576
- border-radius: 10PX;
1577
- background-color: rgba(94, 90, 90, 0.8);
1578
- padding-left: 14PX;
1579
- padding-top: 10PX;
1580
- padding-bottom: 10PX;
1581
- }
1582
- .centerText .text {
1583
- display: inline-block;
1584
- color: #299BCC;
1585
- margin-top: 20PX;
1586
- }
1587
- .merge-direction-icon {
1588
- width: 80PX;
1589
- height: 80PX;
1590
- margin: 0 auto;
1591
- }
1592
-
1593
- .baseImg {
1594
- width: 100%;
1595
- height: 650px;
1596
- position: relative;
1597
- }
1598
- </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="isShowState">
15
+ <div class="stateText">
16
+ <div style="border:0px solid red;float:right;">
17
+ {{stateName }}
18
+ </div>
19
+ </div>
20
+ </div>
21
+ <div v-show="isShowMode">
22
+ <div class="controlText">
23
+ <div style="border:0px solid red;float:right;">
24
+ {{controlName }}
25
+ </div>
26
+ </div>
27
+ <div class="modeText">
28
+ {{modeName }}
29
+ </div>
30
+ </div>
31
+ <!-- 右行道路 B-->
32
+ <div class="right-dir-road" v-if="roadDir === 'right'">
33
+ <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
34
+ <div class="merge-direction-icon">
35
+ <xdr-dir-selector
36
+ :Data="xdrMData"
37
+ Width="80px"
38
+ Height="80px"
39
+ Widths="80px"
40
+ Heights="80px"
41
+ :showlist="mergeShowList"></xdr-dir-selector>
42
+ </div>
43
+ <!-- 相位倒计时 -->
44
+ <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown && contrloType === 'ring'" :class="{'countdownBg': isLoaded}">
45
+ <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
46
+ <div v-if="curPhase.phaseCountdown !== undefined && curPhase.phaseCountdown !== -1" style="overflow: hidden;margin-bottom: 4px;">
47
+ <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
48
+ <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="curPhase.showlist" :roadDirection="roadDirection"></xdr-dir-selector>
49
+ </span>
50
+ <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">P{{curPhase.id}}:</span>
51
+ <span style="float: left;font-size: 25px;">{{curPhase.phaseCountdown}}</span>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ <!-- 阶段倒计时 -->
56
+ <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasStageCountdown && contrloType === 'stage'" :class="{'countdownBg': isLoaded}">
57
+ <div style="overflow: hidden;margin-bottom: 4px;" :style="{color: stageCountdownList[0].phaseCountdownColor}">
58
+ <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
59
+ <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="dirListSetTheme(stageCountdownList)" :roadDirection="roadDirection"></xdr-dir-selector>
60
+ </span>
61
+ <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">S{{crossStatusData.current_stage}}:</span>
62
+ <span style="float: left;font-size: 25px;">{{crossStatusData.current_stagecd}}</span>
63
+ </div>
64
+ </div>
65
+ <!-- 手动刷新 -->
66
+ <div v-if="!isLoaded">
67
+ <RefreshSvg @click.native="refresh"/>
68
+ <span class="text">{{$t('openatccomponents.overview.getintersectionmapagain')}}</span>
69
+ </div>
70
+ </div>
71
+ <!-- 路口底图 -->
72
+ <div class="baseImg">
73
+ <!-- 城市道路 -->
74
+ <CrossRoadsSvg v-if="crossType === 'Crossroads'"/>
75
+ <TShapeEastRoadsSvg v-if="crossType === 'TypeT-east'"/>
76
+ <TShapeWestRoadsSvg v-if="crossType === 'TypeT-west'"/>
77
+ <TShapeNorthRoadsSvg v-if="crossType === 'TypeT-north'"/>
78
+ <TShapeSouthRoadsSvg v-if="crossType === 'TypeT-south'"/>
79
+ <!-- 其他路口 -->
80
+ <CustomRoadsSvg v-if="crossType === 'Customroads'"/>
81
+ <!-- 匝道 -->
82
+ <RampEastRoadsSvg v-if="crossType === 'ramp-east' && !isVipRoute" />
83
+ <RampWestRoadsSvg v-if="crossType === 'ramp-west' && !isVipRoute" />
84
+ <RampNorthRoadsSvg v-if="crossType === 'ramp-north' && !isVipRoute" />
85
+ <RampSouthRoadsSvg v-if="crossType === 'ramp-south' && !isVipRoute" />
86
+ <!-- 路段行人过街 -->
87
+ <PedSectionSNSvg v-if="crossType === 'ped-section-south-north'" />
88
+ <PedSectionEWSvg v-if="crossType === 'ped-section-east-west'" />
89
+ </div>
90
+ <!-- 城市道路状态-->
91
+ <div v-if="mainType === '100' || mainType === '101' || mainType === '104'">
92
+ <!-- 人行道 -->
93
+ <div class="sidewalk" id="sidewalk" v-if="resetflag && isLoaded">
94
+ <SidewalkClickSvg v-if="isVipRoute && compSidewalkPhaseData.length" :Data="compSidewalkPhaseData" :clickMode="clickMode" @handleClickSidewalkIcon="handleClickSidewalkIcon" />
95
+ <SidewalkSvg v-else v-for="(side, index) in compSidewalkPhaseData" :key="side.key + '-' + index" :Data="side" :crossType="crossType" />
96
+ </div>
97
+ <!-- 车道相位 -->
98
+ <div v-if="resetflag" class="phaseIcon">
99
+ <PhaseIconSvg v-for="(item, index) in compLanePhaseData" :key="item.key + '-' + index" :Data="item" :isVipRoute="isVipRoute" :clickMode="clickMode" @handleClickPhaseIcon="handleClickPhaseIcon" />
100
+ </div>
101
+ <!-- 公交相位 -->
102
+ <div v-if="resetflag && !isVipRoute" class="busIcon">
103
+ <BusMapSvg v-for="(item, index) in comdireBusPhaseData" :key="'Busmap-' + item.key + '-' + index" :Data="item" />
104
+ <PhaseIconSvg v-for="(item, index) in comdireBusPhaseData" :key="item.key + '-' + index" :Data="item"/>
105
+ </div>
106
+ <!-- 有效方向 -->
107
+ <div v-if="isVipRoute" class="effectDir">
108
+ <PhaseIconSvg v-for="(item, index) in effectDirData" :key="item.key + '-' + index" :Data="item" />
109
+ </div>
110
+ </div>
111
+ <!-- 匝道状态 -->
112
+ <!-- 车道相位 -->
113
+ <div v-if="resetflag && mainType === '103' && !isVipRoute">
114
+ <RampPhaseIconSvg v-for="(item, index) in LanePhaseData" :key="item.key + '-' + index" :Data="item" />
115
+ </div>
116
+ </div>
117
+ <!-- 右行道路 E-->
118
+
119
+ <!-- 左行道路 B-->
120
+ <div class="left-dir-road" v-if="roadDir === 'left'">
121
+ <div class="centerText" v-if="crossType !== 'Customroads' && isHasPhase">
122
+ <!-- 相位倒计时 -->
123
+ <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasPhase && isHasCountdown && contrloType === 'ring'" :class="{'countdownBg': isLoaded}">
124
+ <div v-for="curPhase in phaseCountdownList" :key="curPhase.id" :style="{color: curPhase.phaseCountdownColor}">
125
+ <div v-if="curPhase.phaseCountdown !== undefined && curPhase.phaseCountdown !== -1" style="overflow: hidden;margin-bottom: 4px;">
126
+ <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
127
+ <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="curPhase.showlist" :roadDirection="roadDirection"></xdr-dir-selector>
128
+ </span>
129
+ <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">P{{curPhase.id}}:</span>
130
+ <span style="float: left;font-size: 25px;">{{curPhase.phaseCountdown}}</span>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ <!-- 阶段倒计时 -->
135
+ <div class="phaseCountdown" v-show="isShowInterval" v-if="isLoaded && isHasStageCountdown && contrloType === 'stage'" :class="{'countdownBg': isLoaded}">
136
+ <div style="overflow: hidden;margin-bottom: 4px;" :style="{color: stageCountdownList[0].phaseCountdownColor}">
137
+ <span style="float: left;width: 42px;height: 42px;position: relative;border: 1px solid rgba(255, 255, 255, 0.1);margin-right: 5px;">
138
+ <xdr-dir-selector :Data="xdrData" :Datas="xdrpedData" Width="55px" Height="55px" Widths="55px" Heights="55px" :showlist="dirListSetTheme(stageCountdownList)" :roadDirection="roadDirection"></xdr-dir-selector>
139
+ </span>
140
+ <span style="float: left;color: #fff;margin-right: 8px;width: 30px;">S{{crossStatusData.current_stage}}:</span>
141
+ <span style="float: left;font-size: 25px;">{{crossStatusData.current_stagecd}}</span>
142
+ </div>
143
+ </div>
144
+ <!-- 手动刷新 -->
145
+ <div v-if="!isLoaded">
146
+ <RefreshSvg @click.native="refresh"/>
147
+ <span class="text">{{$t('openatccomponents.overview.getintersectionmapagain')}}</span>
148
+ </div>
149
+ </div>
150
+ <!-- 路口底图 -->
151
+ <div class="baseImg">
152
+ <!-- 城市道路 -->
153
+ <LCrossRoadsSvg v-if="crossType === 'Crossroads'"/>
154
+ <LTShapeEastRoadsSvg v-if="crossType === 'TypeT-east'"/>
155
+ <LTShapeWestRoadsSvg v-if="crossType === 'TypeT-west'"/>
156
+ <LTShapeNorthRoadsSvg v-if="crossType === 'TypeT-north'"/>
157
+ <LTShapeSouthRoadsSvg v-if="crossType === 'TypeT-south'"/>
158
+ <!-- 其他路口 -->
159
+ <CustomRoadsSvg v-if="mainType !== '100' && mainType !== '101'"/>
160
+ </div>
161
+ <!-- 城市道路状态-->
162
+ <div v-if="mainType === '100' || mainType === '101'">
163
+ <!-- 人行道 -->
164
+ <div class="sidewalk" v-if="resetflag && isLoaded">
165
+ <SidewalkClickSvg v-if="isVipRoute && compSidewalkPhaseData.length" :Data="compSidewalkPhaseData" :clickMode="clickMode" @handleClickSidewalkIcon="handleClickSidewalkIcon" />
166
+ <SidewalkSvg v-else v-for="side in compSidewalkPhaseData" :key="side.key" :Data="side" :crossType="crossType" />
167
+ </div>
168
+ <!-- 车道相位 -->
169
+ <div v-if="resetflag" class="phaseIcon">
170
+ <LPhaseIconSvg v-for="item in compLanePhaseData" :key="item.key" :Data="item" :isVipRoute="isVipRoute" :clickMode="clickMode" @handleClickPhaseIcon="handleClickPhaseIcon"/>
171
+ </div>
172
+ <!-- 公交相位 -->
173
+ <div v-if="resetflag" class="busIcon">
174
+ <BusMapSvg v-for="(item, index) in comdireBusPhaseData" :key="'Busmap-' + item.key + '-' + index" :Data="item" />
175
+ <LPhaseIconSvg v-for="(item, index) in comdireBusPhaseData" :key="item.key + '-' + index" :Data="item"/>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ <!-- 左行道路 E-->
180
+ </div>
181
+ </template>
182
+ <script>
183
+ import PhaseIconSvg from './phaseIcon/phaseIconSvg'
184
+ import PhaseDataModel from './utils.js'
185
+ import { getIntersectionInfo } from '../../../../api/template.js'
186
+ import { uploadSingleTscParam } from '../../../../api/param.js'
187
+ import CrossRoadsSvg from './baseImg/CrossRoadsSvg'
188
+ import TShapeEastRoadsSvg from './baseImg/TShapeEastRoadsSvg'
189
+ import TShapeWestRoadsSvg from './baseImg/TShapeWestRoadsSvg.vue'
190
+ import TShapeNorthRoadsSvg from './baseImg/TShapeNorthRoadsSvg.vue'
191
+ import TShapeSouthRoadsSvg from './baseImg/TShapeSouthRoadsSvg.vue'
192
+ import CustomRoadsSvg from './baseImg/CustomRoadsSvg.vue'
193
+ import RefreshSvg from './baseImg/refreshSvg'
194
+ import SidewalkSvg from './baseImg/SidewalkSvg'
195
+ import SidewalkClickSvg from './baseImg/SidewalkClickSvg'
196
+ import RampEastRoadsSvg from './baseImg/RampEastSvg'
197
+ import RampWestRoadsSvg from './baseImg/RampWestSvg'
198
+ import RampNorthRoadsSvg from './baseImg/RampNorthSvg'
199
+ import RampSouthRoadsSvg from './baseImg/RampSouthSvg'
200
+ import RampPhaseIconSvg from './phaseIcon/rampPhaseIconSvg'
201
+ import PedSectionEWSvg from './baseImg/PedSectionEWSvg'
202
+ import PedSectionSNSvg from './baseImg/PedSectionSNSvg'
203
+ // import { mapState } from 'vuex'
204
+ import LCrossRoadsSvg from './baseImg/leftroad/LCrossRoadsSvg'
205
+ import LTShapeEastRoadsSvg from './baseImg/leftroad/LTShapeEastRoadsSvg'
206
+ import LTShapeWestRoadsSvg from './baseImg/leftroad/LTShapeWestRoadsSvg.vue'
207
+ import LTShapeNorthRoadsSvg from './baseImg/leftroad/LTShapeNorthRoadsSvg.vue'
208
+ import LTShapeSouthRoadsSvg from './baseImg/leftroad/LTShapeSouthRoadsSvg.vue'
209
+ import LPhaseIconSvg from './phaseIcon/LphaseIconSvg'
210
+ import CrossDiagramMgr from '../../../../EdgeMgr/controller/crossDiagramMgr.js'
211
+ import BusMapSvg from './busIcon/busMapSvg'
212
+ import { getMessageByCode } from '../../../../utils/responseMessage.js'
213
+
214
+ import CrossDirectionConflictList from '../../../../utils/conflictList.js'
215
+ import RingDataModel from '../../../../utils/RingDataModel.js'
216
+ import { getValidDirections, getMergeDirections } from '../../../../api/cross.js'
217
+
218
+ export default {
219
+ name: 'crossDiagram',
220
+ components: {
221
+ PhaseIconSvg,
222
+ CrossRoadsSvg,
223
+ TShapeEastRoadsSvg,
224
+ TShapeWestRoadsSvg,
225
+ TShapeNorthRoadsSvg,
226
+ TShapeSouthRoadsSvg,
227
+ CustomRoadsSvg,
228
+ RefreshSvg,
229
+ SidewalkSvg,
230
+ RampEastRoadsSvg,
231
+ RampWestRoadsSvg,
232
+ RampNorthRoadsSvg,
233
+ RampSouthRoadsSvg,
234
+ RampPhaseIconSvg,
235
+ PedSectionEWSvg,
236
+ PedSectionSNSvg,
237
+ LCrossRoadsSvg,
238
+ LTShapeEastRoadsSvg,
239
+ LTShapeWestRoadsSvg,
240
+ LTShapeNorthRoadsSvg,
241
+ LTShapeSouthRoadsSvg,
242
+ LPhaseIconSvg,
243
+ BusMapSvg,
244
+ SidewalkClickSvg
245
+ },
246
+ props: {
247
+ crossStatusData: {
248
+ type: Object
249
+ },
250
+ agentId: {
251
+ type: String
252
+ },
253
+ // devStatus: {
254
+ // type: Number
255
+ // },
256
+ isShowInterval: {
257
+ type: Boolean,
258
+ devault: true
259
+ },
260
+ isShowMessage: {
261
+ type: Boolean,
262
+ default: true
263
+ },
264
+ roadDirection: {
265
+ type: String
266
+ },
267
+ isShowState: {
268
+ type: Boolean,
269
+ devault: false
270
+ },
271
+ isShowMode: {
272
+ type: Boolean,
273
+ devault: false
274
+ },
275
+ modeName: {
276
+ type: String,
277
+ default: ''
278
+ },
279
+ controlName: {
280
+ type: String,
281
+ default: ''
282
+ },
283
+ stateName: {
284
+ type: String,
285
+ default: ''
286
+ },
287
+ choosedDirection: {
288
+ type: Array,
289
+ default: () => []
290
+ },
291
+ choosedPedDirection: {
292
+ type: Array,
293
+ default: () => []
294
+ },
295
+ isVipRoute: { // 区分普通路口和VIP路口,如果是vip路口(特勤路线和分组管控),才需要获取通道和处理通道冲突,并显示已选方向
296
+ type: Boolean,
297
+ default: false
298
+ },
299
+ clickMode: {
300
+ type: Boolean,
301
+ default: false
302
+ },
303
+ isThirdSignal: {
304
+ type: Boolean,
305
+ default: false
306
+ },
307
+ channelType: {
308
+ type: Boolean,
309
+ default: false
310
+ }
311
+ },
312
+ // computed: {
313
+ // ...mapState({
314
+ // roadDirection: state => state.globalParam.roadDirection
315
+ // })
316
+ // },
317
+ watch: {
318
+ tempType: {
319
+ handler: function (val) {
320
+ this.getCrossType()
321
+ }
322
+ },
323
+ crossStatusData: {
324
+ handler: function (val, oldVal) {
325
+ // 路口状态数据
326
+ if (!this.channelType || (this.channelType && this.isThirdSignal)) {
327
+ this.compareIsChangedPhase(val, oldVal) // 比较相位状态决定是否更新相位图标(解决虚相位显示问题,虚相位图标不显示)
328
+ }
329
+ this.statusData = JSON.parse(JSON.stringify(val))
330
+ // 默认显示相位数据(包括黄闪、全红、关灯状态下,或者匝道,均不做比对跟随相位的处理)
331
+ this.drawDefaultPhaseIcon()
332
+ if (this.channelType && !this.isThirdSignal) {
333
+ // 通道路口图状态数据(实时通道展示排除第三方信号机,第三方信号机还是按模版路口一样展示相位状态)
334
+ this.channelStatusList = val.channellamp
335
+ this.createChannelStatusMap()
336
+ this.getChannelPhaseStatus()
337
+ this.getChannelPedStatus()
338
+ return
339
+ }
340
+ this.handleTempCrossStatus(val)
341
+ },
342
+ // 深度观察监听
343
+ deep: true
344
+ },
345
+ devStatus: {
346
+ handler: function (val) {
347
+ if (val === 3) return
348
+ this.handleDefaultStatus()
349
+ }
350
+ },
351
+ // roadDirection: {
352
+ // handler: function (val1, val2) {
353
+ // if (val1 !== val2) {
354
+ // this.init()
355
+ // }
356
+ // }
357
+ // },
358
+ agentId: {
359
+ handler: function (val1, val2) {
360
+ if (val1 !== val2) {
361
+ this.init()
362
+ }
363
+ },
364
+ immediate: true
365
+ }
366
+ },
367
+ data () {
368
+ return {
369
+ roadDir: 'right', // 道路行车方向,默认右行
370
+ phaseCountdownList: [], // 相位倒计时列表
371
+ stageCountdownList: [], // 阶段倒计时列表
372
+ statusData: null, // 信号机状态
373
+ LanePhaseData: [], // 车道相位数据
374
+ overlapLanePhaseData: [], // 车道跟随相位数据
375
+ curPhase: [], // 当前相位列表
376
+ phaseStatusList: [], // 相位状态列表
377
+ phaseStatusMap: new Map(), // 相位状态映射
378
+ overlapPhaseStatusMap: new Map(), // 跟随相位状态映射
379
+ ColorMap: new Map([[0, '#828282'], [1, '#ff2828'], [2, '#f7b500'], [3, '#77fb65'], [4, '#77fb65'], [5, '#f7b500']]), // 当前相位状态 --- 0:关灯, 1:红, 2:黄, 3:绿, 4:绿闪, 5:黄闪
380
+ SidewalkColorMap: new Map([[0, '#828282'], [1, '#e24b4b'], [3, '#7bd66b']]),
381
+ tempType: '', // 模版类型
382
+ mainType: '101', // 路口形状
383
+ mainDirection: '000', // 路口方向
384
+ crossType: '', // 路口底图类型
385
+ isLoaded: false, // 是否成功加载底图
386
+ isHasPhase: true, // 是否有相位状态数据
387
+ phaseControlColorMap: new Map([['全红', '#ff2828'], ['关灯', '#828282'], ['默认', '#fff'], ['方向锁定', '#fff']]),
388
+ sidewalkPhaseData: [], // 行人相位
389
+ overlapsidewalkPhaseData: [], // 行人跟随相位
390
+ resetflag: true, // 离线后,控制行人相位、车道相位reset标识
391
+ compLanePhaseData: [], // 对比车道相位和车道跟随相位后,显示的数据
392
+ compSidewalkPhaseData: [], // // 对比行人相位和车道跟随相位后,显示的数据
393
+ comdirePhaseData: [], // 对比相同方向车道相位数据后,被删减的唯一direction的数组
394
+ comdireOverlapPhaseData: [], // 对比相同方向车道跟随相位数据后,被删减的唯一direction的数组
395
+ busPhaseData: [], // 公交相位数据
396
+ comdireBusPhaseData: [], // 对比相同方向公交车道数据后,被删减的唯一direction的数组
397
+ channelStatusMap: new Map(), // 通道实时状态映射
398
+ channelStatusList: [], // 通道实时状态列表
399
+ phaseDirMap: new Map(),
400
+ xdrData: {
401
+ left: '5px',
402
+ top: '4px'
403
+ },
404
+ xdrpedData: {
405
+ left: '1px',
406
+ top: '1px'
407
+ },
408
+ isHasCountdown: false,
409
+ isHasStageCountdown: false,
410
+ contrloType: 'ring',
411
+ isMphaseStatusDataReturnMap: new Map(), // 每个跟随相位的母相位是否返回了相位状态数据
412
+ overlapStatusCompareSum: 0, // 首次加载跳过比较母相位状态数据是否返回
413
+ effectDirData: [], // 路口有效方向
414
+ mergeShowList: [2, 4, 10],
415
+ xdrMData: {
416
+ left: '18px',
417
+ top: '18px'
418
+ }
419
+ }
420
+ },
421
+ methods: {
422
+ compareIsChangedPhase (newCrossStatus, oldCrossStatus) {
423
+ if (newCrossStatus.control === 1 || newCrossStatus.control === 2 || newCrossStatus.control === 3) return
424
+ // 返回的相位状态改变后,按照返回的相位状态更新路口相位显示(下个周期生效)
425
+ let newPhaseIds = newCrossStatus.phase.map(item => item.id)
426
+ let oldPhaseIds = oldCrossStatus.phase.map(item => item.id)
427
+ if (!this.isArraysEqual(newPhaseIds, oldPhaseIds)) { // 通过比较相位id是否完全一致
428
+ this.getIntersectionInfo()
429
+ }
430
+ },
431
+ isArraysEqual (arr1, arr2) {
432
+ if (arr1.length !== arr2.length) return false
433
+ for (let i = 0; i < arr1.length; i++) {
434
+ if (arr1[i] !== arr2[i]) return false
435
+ }
436
+ return true
437
+ },
438
+ handleTempCrossStatus (val) {
439
+ // 模版路口图状态数据
440
+ this.phaseStatusList = val.phase
441
+ this.overlapStatusList = val.overlap
442
+ if (val.control === 1 || val.control === 2 || val.control === 3) {
443
+ // 黄闪、全红、关灯属于特殊控制,优先级最高,直接改变灯色,不用判断phase里的type,也不需要考虑跟随相位的灯色优先级
444
+ if (val.control === 1) {
445
+ this.getYellowFlashColor()
446
+ } else {
447
+ this.SpecialControl(val)
448
+ }
449
+ this.isHasPhase = false
450
+ return
451
+ }
452
+ if (!val.phase && !this.overlapStatusList) {
453
+ // 非特殊控制,相位和跟随相位不存在的情况下,灯色恢复默认
454
+ this.handleSpecialControlStatus('默认')
455
+ this.isHasPhase = false
456
+ return
457
+ }
458
+ if (val.control === 16) {
459
+ // 方向锁定时,相位状态显示与通道无关,显示接口返回的红灯会有歧义,此处特殊处理显示默认白色
460
+ this.handleSpecialControlStatus('方向锁定')
461
+ this.isHasPhase = false
462
+ return
463
+ }
464
+ this.curPhase = val.current_phase
465
+ this.curStage = val.current_stage
466
+ this.isHasPhase = true
467
+ if (val.phase) {
468
+ this.createPhaseStatusMap()
469
+ }
470
+ if (val.overlap) {
471
+ this.createOverlapPhaseStatusMap()
472
+ }
473
+ // 正常情况下,获取车道相位、车道跟随相位、相位倒计时、行人相位、行人跟随相位 的状态
474
+ this.getPhaseStatus()
475
+ this.getOverlapPhaseStatus()
476
+ this.getCurPhaseCountdown()
477
+ this.getCurStageCountdown()
478
+ this.getBusPhaseStatus()
479
+ if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
480
+ // 城市道路和路段行人过街才显示人行道状态
481
+ this.getpedStatus()
482
+ this.getOverlapPedStatus()
483
+ // 算法对比行人相位与行人跟随相位的状态
484
+ this.comparePedStatus()
485
+ // 算法对比车道相位与车道跟随相位的状态
486
+ this.comparePhaseStatus()
487
+ }
488
+ // console.log('this.phaseStatusMap 相位状态映射', this.phaseStatusMap)
489
+ // console.log('LanePhaseData 车道相位', this.LanePhaseData)
490
+ // console.log('sidewalkPhaseData 行人相位', this.sidewalkPhaseData)
491
+ // console.log('overlapPhaseStatusMap 跟随相位状态映射', this.overlapPhaseStatusMap)
492
+ // console.log('overlapLanePhaseData 车道跟随相位', this.overlapLanePhaseData)
493
+ // console.log('this.overlapsidewalkPhaseData 行人跟随相位', this.overlapsidewalkPhaseData)
494
+ },
495
+ init () {
496
+ this.CrossDiagramMgr = new CrossDiagramMgr()
497
+ this.getRoadDirection()
498
+ this.PhaseDataModel = new PhaseDataModel(this.roadDirection)
499
+ this.getIntersectionInfo() // 获取路口信息
500
+ },
501
+ drawDefaultPhaseIcon () {
502
+ this.compLanePhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')))
503
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')))
504
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.busPhaseData))
505
+ console.log(this.LanePhaseData)
506
+ console.log(this.overlapLanePhaseData)
507
+ console.log('###################', this.compLanePhaseData)
508
+ },
509
+ comparePhaseStatus () {
510
+ // 对比车道: 跟随相位和相位的状态数据(此处判断是为了保证被比较的数据direction都是唯一的)
511
+ if (!this.comdirePhaseData && !this.comdireOverlapPhaseData) {
512
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type')
513
+ } else if (!this.comdireOverlapPhaseData) {
514
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.comdirePhaseData, this.overlapLanePhaseData, 'type')
515
+ } else if (!this.comdirePhaseData) {
516
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.comdireOverlapPhaseData, 'type')
517
+ } else {
518
+ this.compLanePhaseData = this.CrossDiagramMgr.compare(this.comdirePhaseData, this.comdireOverlapPhaseData, 'type')
519
+ }
520
+ },
521
+ comparePedStatus () {
522
+ // 对比人行道: 跟随相位和相位的状态数据
523
+ this.compSidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype')
524
+ },
525
+ resetPhaseStatus () {
526
+ // 车道相位、行人相位恢复默认状态
527
+ this.resetflag = false
528
+ this.$nextTick(() => {
529
+ this.resetflag = true
530
+ })
531
+ },
532
+ SpecialControl (data) {
533
+ switch (data.control) {
534
+ case 2: this.handleSpecialControlStatus('全红')
535
+ break
536
+ case 3: this.handleSpecialControlStatus('关灯')
537
+ break
538
+ default: this.handleSpecialControlStatus('默认')
539
+ }
540
+ },
541
+ handleDefaultStatus () {
542
+ // 恢复默认状态
543
+ if (this.compLanePhaseData.length) {
544
+ this.phaseCountdown = ''
545
+ this.phaseCountdownColor = '#fff'
546
+ this.compLanePhaseData.forEach(data => {
547
+ data.color = '#fff'
548
+ })
549
+ }
550
+ if (this.compSidewalkPhaseData.length) {
551
+ this.compSidewalkPhaseData.forEach(data => {
552
+ data.color = '#fff'
553
+ })
554
+ }
555
+ if (this.comdireBusPhaseData.length) {
556
+ this.comdireBusPhaseData.forEach(data => {
557
+ data.color = '#fff'
558
+ })
559
+ }
560
+ this.phaseCountdownList = []
561
+ this.stageCountdownList = []
562
+ this.resetPhaseStatus()
563
+ },
564
+ handleSpecialControlStatus (Control) {
565
+ this.resetPhaseStatus()
566
+ // 控制黄闪、全红、关灯、默认情况下的车道相位颜色和倒计时颜色
567
+ if (Control === '默认') {
568
+ // 倒计时恢复默认颜色
569
+ this.phaseCountdownList.forEach(item => {
570
+ item.phaseCountdown = ''
571
+ item.id = ''
572
+ item.phaseCountdownColor = '#fff'
573
+ })
574
+ }
575
+ if (this.compLanePhaseData.length) {
576
+ const compLanePhaseData = this.compLanePhaseData.map(data => ({
577
+ ...data,
578
+ color: this.phaseControlColorMap.get(Control)
579
+ }))
580
+ this.compLanePhaseData = JSON.parse(JSON.stringify(compLanePhaseData))
581
+ }
582
+ if (this.compSidewalkPhaseData.length) {
583
+ const compSidewalkPhaseData = this.compSidewalkPhaseData.map(data => ({
584
+ ...data,
585
+ color: this.phaseControlColorMap.get(Control)
586
+ }))
587
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(compSidewalkPhaseData))
588
+ }
589
+ if (this.comdireBusPhaseData.length) {
590
+ const comdireBusPhaseData = this.comdireBusPhaseData.map(data => ({
591
+ ...data,
592
+ color: this.phaseControlColorMap.get(Control)
593
+ }))
594
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(comdireBusPhaseData))
595
+ }
596
+ if (this.mainType === '103') {
597
+ if (this.LanePhaseData.length) {
598
+ const LanePhaseData = this.LanePhaseData.map(data => ({
599
+ ...data,
600
+ color: this.phaseControlColorMap.get(Control)
601
+ }))
602
+ this.LanePhaseData = JSON.parse(JSON.stringify(LanePhaseData))
603
+ }
604
+ }
605
+ },
606
+ createPhaseStatusMap () {
607
+ // 生成相位id和相位状态对应数据结构
608
+ this.phaseStatusMap = new Map()
609
+ this.phaseStatusList.map(phase => {
610
+ let phaseId = phase.id
611
+ let phaseInfo = {
612
+ type: phase.type,
613
+ phaseCountdown: phase.countdown,
614
+ pedtype: phase.pedtype
615
+ }
616
+ this.phaseStatusMap.set(phaseId, phaseInfo)
617
+ })
618
+ },
619
+ getYellowFlashColor () {
620
+ // 车道相位(左行右行)
621
+ let curLanePhaseData = []
622
+ for (let i = 0; i < this.compLanePhaseData.length; i++) {
623
+ const data = {
624
+ ...this.compLanePhaseData[i],
625
+ type: '黄闪',
626
+ control: 1
627
+ }
628
+ curLanePhaseData.push(data)
629
+ }
630
+ this.compLanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
631
+
632
+ // 行人相位
633
+ let curPedStatus = []
634
+ for (let i = 0; i < this.compSidewalkPhaseData.length; i++) {
635
+ const data = {
636
+ ...this.compSidewalkPhaseData[i],
637
+ pedtype: '黄闪',
638
+ control: 1
639
+ }
640
+ curPedStatus.push(data)
641
+ }
642
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
643
+
644
+ // 公交相位
645
+ let curBusLanePhaseData = []
646
+ for (let i = 0; i < this.comdireBusPhaseData.length; i++) {
647
+ const data = {
648
+ ...this.comdireBusPhaseData[i],
649
+ type: '黄闪',
650
+ control: 1
651
+ }
652
+ curBusLanePhaseData.push(data)
653
+ }
654
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(curBusLanePhaseData))
655
+
656
+ if (this.mainType === '103') {
657
+ // 匝道相位
658
+ if (this.LanePhaseData.length) {
659
+ const LanePhaseData = this.LanePhaseData.map(data => ({
660
+ ...data,
661
+ type: '黄闪',
662
+ control: 1
663
+ }))
664
+ this.LanePhaseData = JSON.parse(JSON.stringify(LanePhaseData))
665
+ }
666
+ }
667
+ },
668
+ getPhaseStatus () {
669
+ // 得到车道相位状态(颜色)
670
+ this.comdirePhaseData = []
671
+ let curLanePhaseData = []
672
+ for (let i = 0; i < this.LanePhaseData.length; i++) {
673
+ let curPhaseStatus = this.phaseStatusMap.get(this.LanePhaseData[i].phaseid)
674
+ if (!curPhaseStatus) continue
675
+ const data = {
676
+ ...this.LanePhaseData[i],
677
+ type: curPhaseStatus.type,
678
+ color: this.ColorMap.get(curPhaseStatus.type),
679
+ phaseCountdown: curPhaseStatus.phaseCountdown,
680
+ flag: 'phase' // 车道相位数据标识
681
+ }
682
+ curLanePhaseData.push(data)
683
+ }
684
+ this.LanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
685
+ // 处理相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
686
+ // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
687
+ this.comdirePhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.LanePhaseData, 'type', 'phase')))
688
+ },
689
+ createOverlapPhaseStatusMap () {
690
+ // 处理跟随相位的母相位设置为忽略相位后的情况(如果跟随相位的母相位包含忽略相位,过滤掉跟随相位的状态数据,参照相位状态数据处理)
691
+ let isMphaseStatusDataReturn = false
692
+ let reset = false
693
+ this.overlapStatusList = this.overlapStatusList.filter(ele => {
694
+ let phaseids = this.phaseStatusList.map(item => item.id)
695
+ let mphase = ele.mphase
696
+ console.log(phaseids)
697
+ console.log(mphase)
698
+ const phaseidsSet = new Set(phaseids)
699
+ isMphaseStatusDataReturn = mphase.every(value => phaseidsSet.has(value))
700
+ console.log(`跟随相位${ele.id}的母相位状态数据是否均返回?`, isMphaseStatusDataReturn)
701
+ if (isMphaseStatusDataReturn !== this.isMphaseStatusDataReturnMap.get(ele.id) && !reset && this.overlapStatusCompareSum > 0) {
702
+ this.getIntersectionInfo()
703
+ reset = true
704
+ }
705
+ this.isMphaseStatusDataReturnMap = this.isMphaseStatusDataReturnMap.set(ele.id, isMphaseStatusDataReturn)
706
+ return isMphaseStatusDataReturn
707
+ })
708
+ this.overlapStatusCompareSum = this.overlapStatusCompareSum + 1
709
+ // 得到跟随相位状态Map数据
710
+ this.overlapPhaseStatusMap = new Map()
711
+ this.overlapStatusList.map(phase => {
712
+ let phaseId = phase.id
713
+ let phaseInfo = {
714
+ type: phase.type,
715
+ phaseCountdown: phase.countdown,
716
+ pedtype: phase.pedtype
717
+ }
718
+ this.overlapPhaseStatusMap.set(phaseId, phaseInfo)
719
+ })
720
+ },
721
+ getOverlapPhaseStatus () {
722
+ // 得到车道跟随相位状态(颜色)
723
+ this.comdireOverlapPhaseData = []
724
+ let curLanePhaseData = []
725
+ for (let i = 0; i < this.overlapLanePhaseData.length; i++) {
726
+ let curPhaseStatus = this.overlapPhaseStatusMap.get(this.overlapLanePhaseData[i].phaseid)
727
+ if (!curPhaseStatus) continue
728
+ const data = {
729
+ ...this.overlapLanePhaseData[i],
730
+ type: curPhaseStatus.type,
731
+ color: this.ColorMap.get(curPhaseStatus.type),
732
+ phaseCountdown: curPhaseStatus.phaseCountdown,
733
+ flag: 'overlapphase' // 车道跟随相位数据标识
734
+ }
735
+ curLanePhaseData.push(data)
736
+ }
737
+ this.overlapLanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
738
+ // 处理跟随相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
739
+ // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
740
+ this.comdireOverlapPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.overlapLanePhaseData, 'type', 'overlapphase')))
741
+ },
742
+ getBusPhaseStatus () {
743
+ // 得到公交车道相位状态(颜色)
744
+ this.comdireBusPhaseData = []
745
+ let curLanePhaseData = []
746
+ for (let i = 0; i < this.busPhaseData.length; i++) {
747
+ let curPhaseStatus = this.phaseStatusMap.get(this.busPhaseData[i].phaseid)
748
+ if (!curPhaseStatus) continue
749
+ const data = {
750
+ ...this.busPhaseData[i],
751
+ type: curPhaseStatus.type,
752
+ color: this.ColorMap.get(curPhaseStatus.type),
753
+ phaseCountdown: curPhaseStatus.phaseCountdown,
754
+ flag: 'busphase' // 车道相位数据标识
755
+ }
756
+ curLanePhaseData.push(data)
757
+ }
758
+ this.busPhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
759
+ // 处理相位数据中,方向direction重复的情况:相同direction下,按照状态的优先级显示该方向的灯色:绿灯(3) > 绿闪(4) > 黄灯(2) > 红灯(1)
760
+ // 如果有相同direction,处理后会改变原数组长度,导致第二次无法正确比较状态,因此需要中间变量存储
761
+ this.comdireBusPhaseData = JSON.parse(JSON.stringify(this.CrossDiagramMgr.compareRepeatDirection(this.busPhaseData, 'type', 'busphase')))
762
+ },
763
+ getCurPhaseCountdown () {
764
+ // 获取当前相位倒计时颜色
765
+ this.phaseCountdownList = []
766
+ this.isHasCountdown = false
767
+ this.curPhase.forEach(curP => {
768
+ this.phaseStatusList.forEach(phaseInfo => {
769
+ if (phaseInfo.id === curP) {
770
+ let countdownObj = {}
771
+ countdownObj.id = phaseInfo.id
772
+ countdownObj.phaseCountdown = phaseInfo.countdown
773
+ countdownObj.phaseCountdownColor = this.ColorMap.get(phaseInfo.type)
774
+ let curphasedir = this.phaseDirMap.get(phaseInfo.id)
775
+ if (curphasedir !== undefined) {
776
+ if (curphasedir.direction && curphasedir.direction.length > 0) {
777
+ countdownObj.showlist = curphasedir.direction.map(dir => {
778
+ return {
779
+ id: dir,
780
+ peddirection: this.getshowped(curphasedir.peddirection),
781
+ color: '#fff'
782
+ }
783
+ })
784
+ } else {
785
+ countdownObj.showlist = [
786
+ {
787
+ id: '',
788
+ peddirection: this.getshowped(curphasedir.peddirection),
789
+ color: '#fff'
790
+ }
791
+ ]
792
+ }
793
+ } else {
794
+ countdownObj.showlist = []
795
+ }
796
+
797
+ this.phaseCountdownList.push(countdownObj)
798
+ if (phaseInfo.countdown !== undefined && phaseInfo.countdown !== -1) {
799
+ this.isHasCountdown = true
800
+ }
801
+ }
802
+ })
803
+ })
804
+ },
805
+ stagesList () {
806
+ let list = []
807
+ this.isHasStageCountdown = false
808
+ if (this.crossStatusData && this.crossStatusData.stages && this.crossInfo.phaseList && this.crossInfo.phaseList.length > 0) {
809
+ this.isHasStageCountdown = true
810
+ let ringDataModel = new RingDataModel(this.crossStatusData, this.crossInfo.phaseList)
811
+ list = ringDataModel.getStageData()
812
+ if (this.isShowCurrentStage) {
813
+ this.currentStage = this.crossStatusData.current_stage
814
+ }
815
+ }
816
+ return list
817
+ },
818
+ dirListSetTheme (list) {
819
+ let dirArr = []
820
+ for (let rec of list) {
821
+ let recd = {
822
+ ...rec,
823
+ color: '#fff'
824
+ }
825
+ dirArr.push(recd)
826
+ for (let i = 0; i < rec.peddirection.length; i++) {
827
+ rec.peddirection[i].color = 'rgba(255, 255, 255, 0.6)'
828
+ }
829
+ }
830
+ return dirArr
831
+ },
832
+ getCurStageCountdown () {
833
+ // 获取当前相位倒计时颜色
834
+ this.stageCountdownList = []
835
+ let stagesList = this.stagesList()
836
+ this.stageCountdownList = stagesList[this.curStage - 1]
837
+ this.stageCountdownList = this.stageCountdownList.map(phaseInfo => {
838
+ return {
839
+ ...phaseInfo,
840
+ phaseCountdownColor: this.ColorMap.get(phaseInfo.type)
841
+ }
842
+ })
843
+ // console.log(this.stageCountdownList)
844
+ },
845
+ getshowped (peddirection) {
846
+ let peddirarr = peddirection.map(peddir => ({
847
+ id: peddir,
848
+ name: this.PhaseDataModel.getSidePos(peddir).name,
849
+ color: 'rgba(255, 255, 255, 0.4)'
850
+ }))
851
+ return peddirarr
852
+ },
853
+ getIntersectionInfo () {
854
+ // 获取路口信息
855
+ this.contrloType = 'ring'
856
+ const agentid = this.agentId
857
+ getIntersectionInfo(agentid).then(res => {
858
+ if (!res.data.success) {
859
+ this.isLoaded = false
860
+ let commomMsg = this.$t('openatccomponents.overview.signalID') + ' : ' + agentid
861
+ let msg = getMessageByCode(res.data.code, this.$i18n.locale)
862
+ if (res.data.data) {
863
+ // 子类型错误
864
+ let childErrorCode = res.data.data.errorCode
865
+ if (childErrorCode) {
866
+ let childerror = getMessageByCode(res.data.data.errorCode, this.$i18n.locale)
867
+ msg = msg + ' - ' + childerror
868
+ }
869
+ }
870
+ msg = msg + ' - ' + commomMsg
871
+ // this.isShowMessage && this.$message.error(msg)
872
+ if (this.isShowMessage) {
873
+ console.log(msg)
874
+ }
875
+ return
876
+ }
877
+ this.isLoaded = true
878
+ this.tempType = res.data.data.type
879
+ // 获取车道相位、行人相位信息(坐标、名称)
880
+ this.mainType = this.tempType.split('-')[0]
881
+ this.mainDirection = this.tempType.split('-')[1]
882
+ if (this.isVipRoute) {
883
+ this.getValidDirections()
884
+ this.getMergeDirections()
885
+ }
886
+ if (this.isVipRoute && !this.isThirdSignal) {
887
+ // 特勤、分组管控下,非第三方设备,按通道显示相位方向;第三方设备还是按路口相位配置显示相位方向
888
+ this.getChannelInfo()
889
+ return
890
+ }
891
+ if (this.channelType && !this.isThirdSignal) {
892
+ this.getChannelInfo()
893
+ return
894
+ }
895
+ this.getTempCrossInfo(res)
896
+ // 显示阶段的判断条件
897
+ this.allPatternList = res.data.data.param.patternList
898
+ if (this.allPatternList[0].rings === undefined || this.allPatternList[0].rings.length === 0) {
899
+ this.contrloType = 'stage'
900
+ } else if (this.allPatternList[0].contrloType === 'stage') {
901
+ this.contrloType = 'stage'
902
+ } else {
903
+ this.contrloType = 'ring'
904
+ }
905
+ })
906
+ },
907
+ getTempCrossInfo (res) {
908
+ this.crossInfo = res.data.data.param
909
+ this.crossInfo.phaseList.forEach(cross => this.phaseDirMap.set(cross.id, {direction: cross.direction, peddirection: cross.peddirection}))
910
+ if (this.mainType === '100' || this.mainType === '101' || this.mainType === '104') {
911
+ // 城市道路加载车道相位坐标和人行道坐标
912
+ this.getPhasePos()
913
+ this.getOverlapPhasePos()
914
+ this.getPedPhasePos()
915
+ this.getOverlapPedPhasePos()
916
+ if (!this.isVipRoute) {
917
+ this.getBusPos()
918
+ }
919
+ }
920
+ if (!this.isVipRoute && this.mainType === '103') {
921
+ // 获取匝道道路的主路和支路的相位坐标
922
+ this.getRampPhasePos()
923
+ }
924
+ if (!this.isVipRoute) {
925
+ this.drawDefaultPhaseIcon()
926
+ }
927
+ if (this.isVipRoute && this.isThirdSignal) {
928
+ this.LanePhaseData = this.CrossDiagramMgr.compare(this.LanePhaseData, this.overlapLanePhaseData, 'type', 'nostatus')
929
+ // console.log(this.LanePhaseData)
930
+ this.sidewalkPhaseData = this.CrossDiagramMgr.compare(this.sidewalkPhaseData, this.overlapsidewalkPhaseData, 'pedtype', 'nostatus')
931
+ let allDir = this.LanePhaseData.map(ele => ele.id)
932
+ let allPedDir = this.sidewalkPhaseData.map(ele => ele.id)
933
+ this.inneChoosedDirection = this.choosedDirection.filter(dir => allDir.indexOf(dir) !== -1)
934
+ this.inneChoosedPedDirection = this.choosedPedDirection.filter(dir => allPedDir.indexOf(dir) !== -1)
935
+ this.drawPhaseIcon()
936
+ }
937
+ },
938
+ getBusPos () {
939
+ // 公交相位信息
940
+ this.busPhaseData = []
941
+ this.crossInfo.phaseList.forEach((ele, i) => {
942
+ if (ele.controltype >= 3 && ele.controltype <= 6) {
943
+ ele.direction.forEach((dir, index) => {
944
+ // 车道相位
945
+ this.busPhaseData.push({
946
+ key: this.CrossDiagramMgr.getUniqueKey('busphase'),
947
+ phaseid: ele.id, // 相位id,用于对应相位状态
948
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
949
+ name: this.PhaseDataModel.getBusPhasePos(dir).name,
950
+ left: this.PhaseDataModel.getBusPhasePos(dir).x,
951
+ top: this.PhaseDataModel.getBusPhasePos(dir).y,
952
+ busleft: this.PhaseDataModel.getBusMapPos(dir).x,
953
+ bustop: this.PhaseDataModel.getBusMapPos(dir).y,
954
+ controltype: ele.controltype
955
+ })
956
+ })
957
+ }
958
+ })
959
+ // 去掉重复方向的数据
960
+ this.busPhaseData = Array.from(new Set(this.busPhaseData.map(item => item.id)))
961
+ .map(id => this.busPhaseData.find(item => item.id === id))
962
+ },
963
+ createRandomType () {
964
+ for (var i = 3; i <= 5; i++) {
965
+ return Math.floor(Math.random() * (5 - 3)) + 3
966
+ }
967
+ },
968
+ getPhasePos () {
969
+ // 车道相位信息
970
+ this.LanePhaseData = []
971
+ this.crossInfo.phaseList.forEach((ele, i) => {
972
+ if (ele.controltype === undefined || ele.controltype <= 2) {
973
+ ele.direction.forEach((dir, index) => {
974
+ // 车道相位
975
+ this.LanePhaseData.push({
976
+ key: this.CrossDiagramMgr.getUniqueKey('phase'),
977
+ phaseid: ele.id, // 相位id,用于对应相位状态
978
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
979
+ name: this.PhaseDataModel.getPhase(dir).name,
980
+ left: this.PhaseDataModel.getPhase(dir).x,
981
+ top: this.PhaseDataModel.getPhase(dir).y
982
+ })
983
+ })
984
+ }
985
+ })
986
+ // 去掉重复方向的数据
987
+ this.LanePhaseData = Array.from(new Set(this.LanePhaseData.map(item => item.id)))
988
+ .map(id => this.LanePhaseData.find(item => item.id === id))
989
+ },
990
+ getOverlapPhasePos () {
991
+ // 车道跟随相位信息
992
+ if (!this.crossInfo.overlaplList) return
993
+ this.overlapLanePhaseData = []
994
+ this.crossInfo.overlaplList.forEach((ele, i) => {
995
+ if (ele.direction) {
996
+ ele.direction.forEach((dir, index) => {
997
+ this.overlapLanePhaseData.push({
998
+ key: this.CrossDiagramMgr.getUniqueKey('overlapphase'),
999
+ phaseid: ele.id, // 相位id,用于对应相位状态
1000
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1001
+ name: this.PhaseDataModel.getPhase(dir).name,
1002
+ left: this.PhaseDataModel.getPhase(dir).x,
1003
+ top: this.PhaseDataModel.getPhase(dir).y
1004
+ })
1005
+ })
1006
+ }
1007
+ })
1008
+ // 去掉重复方向的数据
1009
+ this.overlapLanePhaseData = Array.from(new Set(this.overlapLanePhaseData.map(item => item.id)))
1010
+ .map(id => this.overlapLanePhaseData.find(item => item.id === id))
1011
+ },
1012
+ getRampPhasePos () {
1013
+ // 匝道车道相位信息
1014
+ this.LanePhaseData = []
1015
+ this.crossInfo.phaseList.forEach((ele, i) => {
1016
+ ele.direction.forEach((dir, index) => {
1017
+ if (ele.controltype === 0) {
1018
+ this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getMainPhasePos)
1019
+ }
1020
+ if (ele.controltype === 1) {
1021
+ this.handleRampPhasePosData(`${i}-${index}`, ele, dir, this.PhaseDataModel.getSidePhasePos)
1022
+ }
1023
+ })
1024
+ })
1025
+ // 去掉重复方向的数据
1026
+ this.LanePhaseData = Array.from(new Set(this.LanePhaseData.map(item => item.id)))
1027
+ .map(id => this.LanePhaseData.find(item => item.id === id))
1028
+ },
1029
+ handleRampPhasePosData (key, phase, dir) {
1030
+ let posInfo = phase.controltype === 0 ? this.PhaseDataModel.getMainPhasePos(dir) : this.PhaseDataModel.getSidePhasePos(dir)
1031
+ this.LanePhaseData.push({
1032
+ key,
1033
+ controlType: phase.controltype,
1034
+ phaseid: phase.id, // 相位id,用于对应相位状态
1035
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1036
+ name: posInfo.name,
1037
+ left: posInfo.x,
1038
+ top: posInfo.y
1039
+ })
1040
+ },
1041
+ getPedPhasePos () {
1042
+ // 行人相位信息
1043
+ this.sidewalkPhaseData = []
1044
+ this.crossInfo.phaseList.forEach((ele, i) => {
1045
+ if (ele.peddirection) {
1046
+ ele.peddirection.forEach((dir, index) => {
1047
+ // 行人相位
1048
+ if (this.PhaseDataModel.getSidePos(dir)) {
1049
+ let key = this.CrossDiagramMgr.getUniqueKey('pedphase')
1050
+ if (this.isVipRoute && this.isThirdSignal) {
1051
+ key = this.CrossDiagramMgr.getUniqueKey('pedphase') + `-${this.agentId}`
1052
+ }
1053
+ this.sidewalkPhaseData.push({
1054
+ key,
1055
+ phaseid: ele.id, // 相位id,用于对应相位状态
1056
+ id: dir,
1057
+ name: this.PhaseDataModel.getSidePos(dir).name,
1058
+ left: this.PhaseDataModel.getSidePos(dir).x,
1059
+ top: this.PhaseDataModel.getSidePos(dir).y
1060
+ })
1061
+ }
1062
+ })
1063
+ }
1064
+ })
1065
+ // 去掉重复方向的数据
1066
+ this.sidewalkPhaseData = Array.from(new Set(this.sidewalkPhaseData.map(item => item.id)))
1067
+ .map(id => this.sidewalkPhaseData.find(item => item.id === id))
1068
+ },
1069
+ getOverlapPedPhasePos () {
1070
+ // 行人跟随相位信息
1071
+ if (!this.crossInfo.overlaplList) return
1072
+ this.overlapsidewalkPhaseData = []
1073
+ this.crossInfo.overlaplList.forEach((ele, i) => {
1074
+ if (ele.peddirection) {
1075
+ ele.peddirection.forEach((dir, index) => {
1076
+ if (this.PhaseDataModel.getSidePos(dir)) {
1077
+ this.overlapsidewalkPhaseData.push({
1078
+ key: this.CrossDiagramMgr.getUniqueKey('overlappedphase'),
1079
+ phaseid: ele.id, // 相位id,用于对应相位状态
1080
+ id: dir,
1081
+ name: this.PhaseDataModel.getSidePos(dir).name,
1082
+ left: this.PhaseDataModel.getSidePos(dir).x,
1083
+ top: this.PhaseDataModel.getSidePos(dir).y
1084
+ })
1085
+ }
1086
+ })
1087
+ }
1088
+ })
1089
+ // 去掉重复方向的数据
1090
+ this.overlapsidewalkPhaseData = Array.from(new Set(this.overlapsidewalkPhaseData.map(item => item.id)))
1091
+ .map(id => this.overlapsidewalkPhaseData.find(item => item.id === id))
1092
+ },
1093
+ getEffectDirectionPos () {
1094
+ this.effectDirData = []
1095
+ // this.effectiveDirection = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
1096
+ this.effectiveDirection.forEach((dir, i) => {
1097
+ this.effectDirData.push({
1098
+ key: this.CrossDiagramMgr.getUniqueKey('effectiveDir'),
1099
+ id: dir,
1100
+ name: this.PhaseDataModel.getEffectPos(dir).name,
1101
+ left: this.PhaseDataModel.getEffectPos(dir).x,
1102
+ top: this.PhaseDataModel.getEffectPos(dir).y,
1103
+ color: '#6e737c'
1104
+ })
1105
+ })
1106
+ },
1107
+ getCrossType () {
1108
+ // 路口类型对应底图决策
1109
+ if (this.mainType === '101') {
1110
+ // 十字路口
1111
+ this.crossType = 'Crossroads'
1112
+ }
1113
+ if (this.mainType === '100') {
1114
+ // T型路口
1115
+ switch (this.mainDirection) {
1116
+ case '001': this.crossType = 'TypeT-east'
1117
+ break
1118
+ case '002': this.crossType = 'TypeT-south'
1119
+ break
1120
+ case '003': this.crossType = 'TypeT-west'
1121
+ break
1122
+ case '004': this.crossType = 'TypeT-north'
1123
+ break
1124
+ }
1125
+ }
1126
+ if (this.mainType === '103') {
1127
+ // 匝道
1128
+ switch (this.mainDirection) {
1129
+ case '001': this.crossType = 'ramp-east'
1130
+ break
1131
+ case '002': this.crossType = 'ramp-south'
1132
+ break
1133
+ case '003': this.crossType = 'ramp-west'
1134
+ break
1135
+ case '004': this.crossType = 'ramp-north'
1136
+ break
1137
+ }
1138
+ }
1139
+ if (this.mainType === '104') {
1140
+ // 路段行人过街
1141
+ switch (this.mainDirection) {
1142
+ case '005': this.crossType = 'ped-section-east-west'
1143
+ break
1144
+ case '006': this.crossType = 'ped-section-south-north'
1145
+ break
1146
+ }
1147
+ }
1148
+ if (this.mainType === '999') {
1149
+ // 其他路口
1150
+ this.crossType = 'Customroads'
1151
+ }
1152
+ },
1153
+ refresh () {
1154
+ this.getIntersectionInfo()
1155
+ },
1156
+ getpedStatus () {
1157
+ // 行人相位状态
1158
+ let curPedStatus = []
1159
+ for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
1160
+ if (this.sidewalkPhaseData[i].phaseid) {
1161
+ let curPhaseStatus = this.phaseStatusMap.get(this.sidewalkPhaseData[i].phaseid)
1162
+ if (!curPhaseStatus) continue
1163
+ const data = {
1164
+ ...this.sidewalkPhaseData[i],
1165
+ pedtype: curPhaseStatus.pedtype,
1166
+ color: this.SidewalkColorMap.get(curPhaseStatus.pedtype),
1167
+ flag: 'ped' // 行人相位数据标识
1168
+ }
1169
+ curPedStatus.push(data)
1170
+ } else {
1171
+ // 无状态的行人道
1172
+ const data = {
1173
+ ...this.sidewalkPhaseData[i],
1174
+ pedtype: undefined
1175
+ }
1176
+ curPedStatus.push(data)
1177
+ }
1178
+ }
1179
+ this.sidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
1180
+ },
1181
+ getOverlapPedStatus () {
1182
+ // 行人跟随相位状态
1183
+ let curPedStatus = []
1184
+ for (let i = 0; i < this.overlapsidewalkPhaseData.length; i++) {
1185
+ if (this.overlapsidewalkPhaseData[i].phaseid) {
1186
+ let curPhaseStatus = this.overlapPhaseStatusMap.get(this.overlapsidewalkPhaseData[i].phaseid)
1187
+ if (!curPhaseStatus) {
1188
+ // 无状态的行人道,也显示出来
1189
+ // const data = {
1190
+ // ...this.overlapsidewalkPhaseData[i],
1191
+ // pedtype: undefined
1192
+ // }
1193
+ // curPedStatus.push(data)
1194
+ continue
1195
+ }
1196
+ const data = {
1197
+ ...this.overlapsidewalkPhaseData[i],
1198
+ pedtype: curPhaseStatus.pedtype,
1199
+ color: this.SidewalkColorMap.get(curPhaseStatus.pedtype),
1200
+ flag: 'overlapped' // 行人跟随相位数据标识
1201
+ }
1202
+ curPedStatus.push(data)
1203
+ } else {
1204
+ // 无状态的行人道
1205
+ const data = {
1206
+ ...this.overlapsidewalkPhaseData[i],
1207
+ pedtype: undefined
1208
+ }
1209
+ curPedStatus.push(data)
1210
+ }
1211
+ }
1212
+ this.overlapsidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
1213
+ },
1214
+ getRoadDirection () {
1215
+ // 获取行车方向(从平台或配置工具的配置文件中读取)
1216
+ this.roadDir = this.roadDirection
1217
+ },
1218
+ getChannelInfo () {
1219
+ uploadSingleTscParam('channel', this.agentId).then(data => {
1220
+ let res = data.data
1221
+ if (!res.success) {
1222
+ if (res.code === '4003') {
1223
+ // this.isShowMessage && this.$message.error(this.$t('openatccomponents.errorTip.devicenotonline'))
1224
+ if (this.isShowMessage) {
1225
+ console.log(this.$t('openatccomponents.errorTip.devicenotonline'))
1226
+ }
1227
+ return
1228
+ }
1229
+ // this.isShowMessage && this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
1230
+ if (this.isShowMessage) {
1231
+ console.log(getMessageByCode(data.data.code, this.$i18n.locale))
1232
+ }
1233
+ return
1234
+ }
1235
+ let channelList = res.data.data.channelList.filter(ele => ele.type !== undefined)
1236
+ this.channelList = this.handleRepeatRealdir(channelList)
1237
+ console.log('this.channelList', this.channelList)
1238
+ this.handleChannelDirection()
1239
+ })
1240
+ },
1241
+ handleRepeatRealdir (channelList) {
1242
+ // 按realdir去掉重复方向的数据
1243
+ let dirChannelList = channelList.filter(ele => ele.realdir !== undefined && (ele.type === 0 || ele.type === 1 || ele.type === 3))
1244
+ let pedDirChannelList = channelList.filter(ele => ele.realdir !== undefined && ele.type === 2)
1245
+ let map = new Map()
1246
+ let map2 = new Map()
1247
+ dirChannelList.forEach(ele => {
1248
+ ele.realdir.forEach(dir => {
1249
+ if (map.get(dir) === undefined) {
1250
+ map.set(dir, ele)
1251
+ }
1252
+ })
1253
+ })
1254
+ pedDirChannelList.forEach(ele => {
1255
+ ele.realdir.forEach(dir => {
1256
+ if (map2.get(dir) === undefined) {
1257
+ map2.set(dir, ele)
1258
+ }
1259
+ })
1260
+ })
1261
+ let arr = Array.from(map)
1262
+ let pedarr = Array.from(map2)
1263
+ let newarr = []
1264
+ arr.forEach(ele => {
1265
+ ele[1].realdir = [ele[0]]
1266
+ let obj = {
1267
+ ...ele[1],
1268
+ realdir: [ele[0]]
1269
+ }
1270
+ newarr.push(obj)
1271
+ })
1272
+ pedarr.forEach(ele => {
1273
+ ele[1].realdir = [ele[0]]
1274
+ let obj = {
1275
+ ...ele[1],
1276
+ realdir: [ele[0]]
1277
+ }
1278
+ newarr.push(obj)
1279
+ })
1280
+ // console.log(newarr)
1281
+ return newarr
1282
+ },
1283
+ handleChannelDirection () {
1284
+ this.LanePhaseData = []
1285
+ this.sidewalkPhaseData = []
1286
+ this.sidewalkDir = []
1287
+ let realphasedirarr = []
1288
+ let realpeddirarr = []
1289
+ this.channelList.forEach((ele, i) => {
1290
+ if (ele.type === 0 || ele.type === 1 || ele.type === 3) {
1291
+ if (ele.realdir) {
1292
+ ele.realdir.forEach((dir, index) => {
1293
+ // 车道相位(通道类型是机动车,非机动车,公交时,对应相位机动车)
1294
+ this.LanePhaseData.push({
1295
+ key: this.CrossDiagramMgr.getUniqueKey('phase'),
1296
+ channelid: ele.id, // 通道id
1297
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
1298
+ name: this.PhaseDataModel.getPhase(dir).name,
1299
+ left: this.PhaseDataModel.getPhase(dir).x,
1300
+ top: this.PhaseDataModel.getPhase(dir).y
1301
+ })
1302
+ })
1303
+ realphasedirarr = Array.from(new Set(realphasedirarr.concat(ele.realdir)))
1304
+ }
1305
+ }
1306
+ if (ele.type === 2) {
1307
+ if (ele.realdir) {
1308
+ ele.realdir.forEach((dir, index) => {
1309
+ // 行人相位
1310
+ if (this.sidewalkDir.indexOf(dir) === -1 && this.PhaseDataModel.getSidePos(dir)) {
1311
+ let obj = {
1312
+ key: this.CrossDiagramMgr.getUniqueKey('pedphase') + `-${this.agentId}`,
1313
+ channelid: ele.id, // 通道id
1314
+ id: dir,
1315
+ name: this.PhaseDataModel.getSidePos(dir).name
1316
+ }
1317
+ if (this.channelType) {
1318
+ obj.left = this.PhaseDataModel.getSidePos(dir).x
1319
+ obj.top = this.PhaseDataModel.getSidePos(dir).y
1320
+ }
1321
+ this.sidewalkPhaseData.push(obj)
1322
+ }
1323
+ })
1324
+ realpeddirarr = Array.from(new Set(realpeddirarr.concat(ele.realdir)))
1325
+ this.sidewalkDir = Array.from(new Set([...this.sidewalkDir.concat(ele.realdir)]))
1326
+ }
1327
+ }
1328
+ })
1329
+ this.inneChoosedDirection = this.choosedDirection.filter(dir => realphasedirarr.indexOf(dir) !== -1)
1330
+ this.inneChoosedPedDirection = this.choosedPedDirection.filter(dir => realpeddirarr.indexOf(dir) !== -1)
1331
+ this.drawPhaseIcon()
1332
+ },
1333
+ async drawPhaseIcon () {
1334
+ const targetIds = [4, 8, 12, 16] // 掉头相位后画
1335
+ this.LanePhaseData = this.LanePhaseData.filter(item => !targetIds.includes(item.id)).concat(this.LanePhaseData.filter(item => targetIds.includes(item.id)))
1336
+ if (!this.isThirdSignal && this.isVipRoute) {
1337
+ await this.getConflictList()
1338
+ this.handleClickedPhase()
1339
+ this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1340
+ this.handleClickedPedPhase()
1341
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.sidewalkPhaseData))
1342
+ } else {
1343
+ // 第三方信号机不需要处理冲突关系
1344
+ this.handleClickedPhase()
1345
+ this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1346
+ this.handleClickedPedPhase()
1347
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(this.sidewalkPhaseData))
1348
+ }
1349
+ },
1350
+ handleClickedPhase () {
1351
+ if (!this.isThirdSignal) {
1352
+ this.inneChoosedDirection = this.inneChoosedDirection.filter(dir => this.phaseConflictList.indexOf(dir) === -1)
1353
+ }
1354
+ for (let index = 0; index < this.LanePhaseData.length; index++) {
1355
+ const element = this.LanePhaseData[index]
1356
+ if (this.inneChoosedDirection.indexOf(element.id) !== -1) {
1357
+ element.clicked = true
1358
+ }
1359
+ }
1360
+ },
1361
+
1362
+ handleClickPhaseIcon (key, action) {
1363
+ let curClickedPhase = {}
1364
+ if (action === 'clicked') {
1365
+ for (let index = 0; index < this.LanePhaseData.length; index++) {
1366
+ const element = this.LanePhaseData[index]
1367
+ if (element.key === key) {
1368
+ element.clicked = true
1369
+ curClickedPhase = JSON.parse(JSON.stringify(element))
1370
+ }
1371
+ }
1372
+ }
1373
+ if (action === 'cancle') {
1374
+ for (let index = 0; index < this.LanePhaseData.length; index++) {
1375
+ const element = this.LanePhaseData[index]
1376
+ if (element.key === key) {
1377
+ delete element.clicked
1378
+ }
1379
+ }
1380
+ }
1381
+ this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1382
+ let clickedDirection = this.compLanePhaseData.filter(ele => ele.clicked && !ele.disabled)
1383
+ this.inneChoosedDirection = clickedDirection.map(ele => ele.id)
1384
+ this.EmitAllChoosedDirection(curClickedPhase)
1385
+ },
1386
+ handleClickedPedPhase () {
1387
+ if (!this.isThirdSignal) {
1388
+ this.inneChoosedPedDirection = this.inneChoosedPedDirection.filter(dir => this.pedConflictList.indexOf(dir) === -1)
1389
+ }
1390
+ // 排他
1391
+ for (let index = 0; index < this.sidewalkPhaseData.length; index++) {
1392
+ const element = this.sidewalkPhaseData[index]
1393
+ delete element.clicked
1394
+ }
1395
+ for (let index = 0; index < this.sidewalkPhaseData.length; index++) {
1396
+ const element = this.sidewalkPhaseData[index]
1397
+ if (this.inneChoosedPedDirection.indexOf(element.id) !== -1) {
1398
+ element.clicked = true
1399
+ }
1400
+ }
1401
+ },
1402
+ handleClickSidewalkIcon (data, curChoosePed) {
1403
+ this.clickedPedDirection = data.filter(ele => ele.clicked && !ele.disabled)
1404
+ this.inneChoosedPedDirection = this.clickedPedDirection.map(ele => ele.id)
1405
+ this.EmitAllChoosedDirection(curChoosePed)
1406
+ },
1407
+ EmitAllChoosedDirection (curClickedPhase) {
1408
+ let allChoosedDir = {
1409
+ direction: this.inneChoosedDirection,
1410
+ peddirection: this.inneChoosedPedDirection
1411
+ }
1412
+ this.$emit('handleClickCrossIcon', allChoosedDir, curClickedPhase)
1413
+ this.drawPhaseIcon()
1414
+ },
1415
+ async getConflictList () {
1416
+ let ConflictList = new CrossDirectionConflictList(this.agentId)
1417
+ return ConflictList.getConflictListByAgentid().then(res => {
1418
+ if (res) {
1419
+ let conflictList = ConflictList.getListDirConflict(this.inneChoosedDirection, this.inneChoosedPedDirection)
1420
+ this.phaseConflictList = conflictList.allConflictDir
1421
+ this.pedConflictList = conflictList.allPedConflictDir
1422
+ // 排他
1423
+ for (let index = 0; index < this.LanePhaseData.length; index++) {
1424
+ const element = this.LanePhaseData[index]
1425
+ delete element.disabled
1426
+ }
1427
+ for (let index = 0; index < this.sidewalkPhaseData.length; index++) {
1428
+ const element = this.sidewalkPhaseData[index]
1429
+ delete element.disabled
1430
+ }
1431
+ for (let index = 0; index < this.LanePhaseData.length; index++) {
1432
+ const element = this.LanePhaseData[index]
1433
+ if (this.phaseConflictList.indexOf(element.id) !== -1) {
1434
+ element.disabled = true
1435
+ }
1436
+ }
1437
+ for (let index = 0; index < this.sidewalkPhaseData.length; index++) {
1438
+ const element = this.sidewalkPhaseData[index]
1439
+ if (this.pedConflictList.indexOf(element.id) !== -1) {
1440
+ element.disabled = true
1441
+ }
1442
+ }
1443
+ // console.log(this.LanePhaseData)
1444
+ }
1445
+ })
1446
+ },
1447
+ createChannelStatusMap () {
1448
+ // 生成相位id和相位状态对应数据结构
1449
+ this.channelStatusList.map(channel => {
1450
+ let channelId = channel.id
1451
+ let channelInfo = {
1452
+ light: channel.light
1453
+ }
1454
+ this.channelStatusMap.set(channelId, channelInfo)
1455
+ })
1456
+ },
1457
+ getChannelPhaseStatus () {
1458
+ // 通道相位机动车状态
1459
+ this.comdirePhaseData = []
1460
+ let curLanePhaseData = []
1461
+ for (let i = 0; i < this.LanePhaseData.length; i++) {
1462
+ let curPhaseStatus = this.channelStatusMap.get(this.LanePhaseData[i].channelid)
1463
+ if (!curPhaseStatus) continue
1464
+ const data = {
1465
+ ...this.LanePhaseData[i],
1466
+ type: curPhaseStatus.light,
1467
+ color: this.ColorMap.get(curPhaseStatus.light),
1468
+ flag: 'phasechannel' // 车道相位数据标识
1469
+ }
1470
+ curLanePhaseData.push(data)
1471
+ }
1472
+ this.LanePhaseData = JSON.parse(JSON.stringify(curLanePhaseData))
1473
+ this.compLanePhaseData = JSON.parse(JSON.stringify(this.LanePhaseData))
1474
+ },
1475
+ getChannelPedStatus () {
1476
+ // 通道行人相位状态
1477
+ let curPedStatus = []
1478
+ for (let i = 0; i < this.sidewalkPhaseData.length; i++) {
1479
+ console.log(this.sidewalkPhaseData[i])
1480
+ if (this.sidewalkPhaseData[i].channelid) {
1481
+ let curPhaseStatus = this.channelStatusMap.get(this.sidewalkPhaseData[i].channelid)
1482
+ if (!curPhaseStatus) continue
1483
+ const data = {
1484
+ ...this.sidewalkPhaseData[i],
1485
+ pedtype: curPhaseStatus.light,
1486
+ color: this.ColorMap.get(curPhaseStatus.light),
1487
+ flag: 'pedchannel' // 行人相位数据标识
1488
+ }
1489
+ curPedStatus.push(data)
1490
+ } else {
1491
+ // 无状态的行人道
1492
+ const data = {
1493
+ ...this.sidewalkPhaseData[i],
1494
+ pedtype: undefined
1495
+ }
1496
+ curPedStatus.push(data)
1497
+ }
1498
+ }
1499
+ this.compSidewalkPhaseData = JSON.parse(JSON.stringify(curPedStatus))
1500
+ },
1501
+ getValidDirections () {
1502
+ getValidDirections(this.agentId).then((data) => {
1503
+ if (!data.data.success) {
1504
+ this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
1505
+ return
1506
+ }
1507
+ this.effectiveDirection = data.data.data.validDirections || []
1508
+ this.getEffectDirectionPos()
1509
+ })
1510
+ },
1511
+ getMergeDirections () {
1512
+ getMergeDirections(this.agentId).then((data) => {
1513
+ if (!data.data.success) {
1514
+ this.$message.error(getMessageByCode(data.data.code, this.$i18n.locale))
1515
+ return
1516
+ }
1517
+ this.mergeDirection = data.data.data.mergeDirections || []
1518
+ if (this.mergeDirection && this.mergeDirection.length > 0) {
1519
+ this.mergeShowList = this.mergeDirection.map(dir => {
1520
+ return {
1521
+ id: dir,
1522
+ color: '#6e737c'
1523
+ }
1524
+ })
1525
+ } else {
1526
+ this.mergeShowList = [
1527
+ {
1528
+ id: '',
1529
+ color: '#fff'
1530
+ }
1531
+ ]
1532
+ }
1533
+ })
1534
+ }
1535
+ },
1536
+ mounted () {
1537
+ // this.init()
1538
+ }
1539
+ }
1540
+ </script>
1541
+ <style scoped>
1542
+ .invisible {
1543
+ visibility: hidden;
1544
+ }
1545
+ .crossImg{
1546
+ position: relative;
1547
+ width: 870px;
1548
+ height: 650px;
1549
+ left: 50%;
1550
+ transform: translateX(-50%);
1551
+ }
1552
+ .centerText {
1553
+ position: absolute;
1554
+ width: 140px;
1555
+ height: 140px;
1556
+ left: 50%;
1557
+ top: 50%;
1558
+ transform: translateX(-50%) translateY(-50%);
1559
+ /* text-align: center; */
1560
+ z-index: 9;
1561
+ display: flex;
1562
+ align-items: center;
1563
+ /* padding-left: 16px; */
1564
+ }
1565
+ .phaseCountdown {
1566
+ line-height: 42PX;
1567
+ font-size: 18px;
1568
+ font-weight: normal;
1569
+ font-stretch: normal;
1570
+ letter-spacing: 0px;
1571
+ color: #fff;
1572
+ width: 150px;
1573
+ margin: 0 auto;
1574
+ }
1575
+ .countdownBg {
1576
+ border-radius: 10PX;
1577
+ background-color: rgba(94, 90, 90, 0.8);
1578
+ padding-left: 14PX;
1579
+ padding-top: 10PX;
1580
+ padding-bottom: 10PX;
1581
+ }
1582
+ .centerText .text {
1583
+ display: inline-block;
1584
+ color: #299BCC;
1585
+ margin-top: 20PX;
1586
+ }
1587
+ .merge-direction-icon {
1588
+ width: 80PX;
1589
+ height: 80PX;
1590
+ margin: 0 auto;
1591
+ }
1592
+
1593
+ .baseImg {
1594
+ width: 100%;
1595
+ height: 650px;
1596
+ position: relative;
1597
+ }
1598
+ </style>