openatc-components 0.4.58 → 0.4.60

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