openatc-components 0.2.80 → 0.2.82

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