openatc-components 0.4.7 → 0.4.8

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