openatc-components 0.4.1 → 0.4.3

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