openatc-components 0.4.28 → 0.4.30

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