openatc-components 0.4.46 → 0.4.47

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