openatc-components 0.2.34 → 0.2.36

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 (484) 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 -112
  23. package/package/kisscomps/components/BoardCard/index.js +2 -2
  24. package/package/kisscomps/components/Channelization/Channelization.vue +584 -584
  25. package/package/kisscomps/components/Channelization/index.js +2 -2
  26. package/package/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  27. package/package/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  28. package/package/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  29. package/package/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  30. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  31. package/package/kisscomps/components/CommonKanban/index.js +2 -2
  32. package/package/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +454 -454
  33. package/package/kisscomps/components/DirectionListConfiguration/index.js +2 -2
  34. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  35. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  36. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  37. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  38. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  39. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  40. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  41. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  42. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  43. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  44. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  45. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  46. package/package/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  47. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  48. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  49. package/package/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  50. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  51. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  52. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  53. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  54. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  55. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  56. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  57. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  58. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +467 -467
  59. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  60. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  61. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  62. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  63. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  64. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  65. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  66. package/package/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  67. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  68. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  69. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  70. package/package/kisscomps/components/DrawChannelization/index.js +2 -2
  71. package/package/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  72. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  73. package/package/kisscomps/components/ExpendConfig/index.js +2 -2
  74. package/package/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  75. package/package/kisscomps/components/FaultDetailModal/index.js +2 -2
  76. package/package/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +127 -158
  77. package/package/kisscomps/components/IntersectionDirectionSelection/index.js +2 -2
  78. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +496 -496
  79. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  80. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  81. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  82. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  83. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  84. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  85. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  86. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1272 -1272
  87. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  88. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  89. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  90. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  91. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  92. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  93. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  94. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  95. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  96. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  97. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  98. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  99. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  100. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  101. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  102. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  103. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +1200 -1200
  104. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  105. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +196 -196
  106. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  107. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  108. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  109. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +115 -115
  110. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  111. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  112. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +219 -219
  113. package/package/kisscomps/components/IntersectionMap/crossDirection/utils.js +84 -84
  114. package/package/kisscomps/components/IntersectionMap/index.js +2 -2
  115. package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +199 -199
  116. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +530 -530
  117. package/package/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  118. package/package/kisscomps/components/KanBan/index.js +2 -2
  119. package/package/kisscomps/components/KanBan/kanban.vue +225 -225
  120. package/package/kisscomps/components/MessageBox/index.vue +96 -96
  121. package/package/kisscomps/components/OverLap/OverLap.vue +235 -235
  122. package/package/kisscomps/components/OverLap/index.js +2 -2
  123. package/package/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  124. package/package/kisscomps/components/PatternOptimize/index.js +2 -2
  125. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +1481 -1478
  126. package/package/kisscomps/components/PatternStatus/index.js +2 -2
  127. package/package/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  128. package/package/kisscomps/components/PatternWalkSvg/index.js +2 -2
  129. package/package/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  130. package/package/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  131. package/package/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  132. package/package/kisscomps/components/PhaseDirectionText/index.js +2 -2
  133. package/package/kisscomps/components/PhaseMarker/index.js +6 -6
  134. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  135. package/package/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  136. package/package/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  137. package/package/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  138. package/package/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  139. package/package/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  140. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +988 -835
  141. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +356 -313
  142. package/package/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  143. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +206 -195
  144. package/package/kisscomps/components/SchemeConfig/index.js +2 -2
  145. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +208 -198
  146. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  147. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +128 -0
  148. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +426 -0
  149. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +820 -0
  150. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +194 -0
  151. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +206 -197
  152. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  153. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +275 -275
  154. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1196 -1194
  155. package/package/kisscomps/components/SelectCrossPhase/index.vue +417 -417
  156. package/package/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  157. package/package/kisscomps/components/StageBord/StageBord.vue +287 -287
  158. package/package/kisscomps/components/StageBord/index.js +2 -2
  159. package/package/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  160. package/package/kisscomps/components/StageStatus/index.js +2 -2
  161. package/package/kisscomps/components/Stages/index.vue +252 -211
  162. package/package/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  163. package/package/kisscomps/components/SvgIcon/index.js +2 -2
  164. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1067 -1065
  165. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  166. package/package/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  167. package/package/kisscomps/components/XiaoKanban/index.vue +102 -102
  168. package/package/kisscomps/components/overView/index.vue +699 -699
  169. package/package/kisscomps/components/patternConfig/index.js +2 -2
  170. package/package/kisscomps/components/patternConfig/index.vue +1126 -1126
  171. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +348 -408
  172. package/package/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  173. package/package/kisscomps/components/patternConfig/planContent.vue +573 -576
  174. package/package/kisscomps/components/patternConfig/planMenu.vue +329 -329
  175. package/package/kisscomps/components/patternConfig/utils.js +152 -152
  176. package/package/kisscomps/components/patternList/index.js +2 -2
  177. package/package/kisscomps/components/patternList/patternList.vue +585 -585
  178. package/package/kisscomps/index.js +123 -123
  179. package/package/kissui.min.js +1 -1
  180. package/package.json +127 -127
  181. package/src/App.vue +24 -24
  182. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  183. package/src/EdgeMgr/controller/crossDiagramMgr.js +125 -125
  184. package/src/api/authapi.js +31 -31
  185. package/src/api/config.js +21 -21
  186. package/src/api/control.js +106 -106
  187. package/src/api/cross.js +49 -49
  188. package/src/api/device.js +135 -135
  189. package/src/api/fault.js +66 -66
  190. package/src/api/index.js +24 -24
  191. package/src/api/login.js +46 -46
  192. package/src/api/optimize.js +72 -72
  193. package/src/api/param.js +165 -165
  194. package/src/api/passwdAssest.js +101 -101
  195. package/src/api/route.js +171 -171
  196. package/src/api/template.js +27 -27
  197. package/src/i18n/index.js +26 -26
  198. package/src/i18n/language/en.js +1436 -1432
  199. package/src/i18n/language/index.js +25 -25
  200. package/src/i18n/language/zh.js +1435 -1431
  201. package/src/icons/demo.css +539 -539
  202. package/src/icons/demo_index.html +8146 -8146
  203. package/src/icons/iconfont.css +1399 -1399
  204. package/src/icons/iconfont.json +2431 -2431
  205. package/src/icons/index.js +20 -20
  206. package/src/icons/svg/azimuthlocking.svg +26 -26
  207. package/src/icons/svg/bendi.svg +110 -110
  208. package/src/icons/svg/bujin.svg +36 -36
  209. package/src/icons/svg/connectBlue.svg +7 -7
  210. package/src/icons/svg/currentvolume.svg +0 -0
  211. package/src/icons/svg/custom-BRTlane.svg +40 -40
  212. package/src/icons/svg/custom-buslane.svg +40 -40
  213. package/src/icons/svg/custom-detector.svg +12 -12
  214. package/src/icons/svg/custom-east-bottom.svg +32 -32
  215. package/src/icons/svg/custom-east-top.svg +32 -32
  216. package/src/icons/svg/custom-ewped.svg +35 -35
  217. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -40
  218. package/src/icons/svg/custom-north-left.svg +32 -32
  219. package/src/icons/svg/custom-north-right.svg +32 -32
  220. package/src/icons/svg/custom-peddetector.svg +17 -17
  221. package/src/icons/svg/custom-snped.svg +35 -35
  222. package/src/icons/svg/custom-south-left.svg +32 -32
  223. package/src/icons/svg/custom-south-right.svg +32 -32
  224. package/src/icons/svg/custom-tramlane.svg +40 -40
  225. package/src/icons/svg/custom-vehiclebranch.svg +40 -40
  226. package/src/icons/svg/custom-vehiclemainroad.svg +41 -41
  227. package/src/icons/svg/custom-west-bottom.svg +32 -32
  228. package/src/icons/svg/custom-west-top.svg +32 -32
  229. package/src/icons/svg/custom-xlped.svg +14 -14
  230. package/src/icons/svg/custom-xrped.svg +14 -14
  231. package/src/icons/svg/cutRed.svg +7 -7
  232. package/src/icons/svg/cycle.svg +0 -0
  233. package/src/icons/svg/dingzhouqi.svg +34 -34
  234. package/src/icons/svg/fangxiangsuoding.svg +1 -0
  235. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  236. package/src/icons/svg/guandeng.svg +81 -81
  237. package/src/icons/svg/huangshan.svg +71 -71
  238. package/src/icons/svg/jieduansuoding.svg +1 -0
  239. package/src/icons/svg/maincontrol.svg +0 -0
  240. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  241. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  242. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  243. package/src/icons/svg/model.svg +0 -0
  244. package/src/icons/svg/phasediff.svg +0 -0
  245. package/src/icons/svg/prioritycontrol.svg +21 -21
  246. package/src/icons/svg/quanhong.svg +86 -86
  247. package/src/icons/svg/shanghe.svg +11 -11
  248. package/src/icons/svg/shoudong.svg +103 -103
  249. package/src/icons/svg/tentativeplan.svg +28 -28
  250. package/src/icons/svg/time.svg +0 -0
  251. package/src/icons/svg/wuxianlan.svg +46 -46
  252. package/src/icons/svg/xiala.svg +11 -11
  253. package/src/icons/svg/xiangweisuoding.svg +1 -0
  254. package/src/icons/svg/xingrenguojie.svg +33 -33
  255. package/src/icons/svg/xitong.svg +89 -89
  256. package/src/icons/svg/youxian.svg +41 -41
  257. package/src/icons/svg/zizhukongzhi.svg +43 -43
  258. package/src/kisscomps/components/BoardCard/BoardCard.vue +112 -112
  259. package/src/kisscomps/components/BoardCard/index.js +2 -2
  260. package/src/kisscomps/components/Channelization/Channelization.vue +584 -584
  261. package/src/kisscomps/components/Channelization/index.js +2 -2
  262. package/src/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  263. package/src/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  264. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  265. package/src/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  266. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  267. package/src/kisscomps/components/CommonKanban/index.js +2 -2
  268. package/src/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +454 -454
  269. package/src/kisscomps/components/DirectionListConfiguration/index.js +2 -2
  270. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  271. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  272. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  273. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  274. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  275. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  276. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  277. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  278. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  279. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  280. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  281. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  282. package/src/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  283. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  284. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  285. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  286. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  287. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  288. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  289. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  290. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  291. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  292. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  293. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  294. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +467 -467
  295. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  296. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  297. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  298. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  299. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  300. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  301. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  302. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  303. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  304. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  305. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  306. package/src/kisscomps/components/DrawChannelization/index.js +2 -2
  307. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  308. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  309. package/src/kisscomps/components/ExpendConfig/index.js +2 -2
  310. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  311. package/src/kisscomps/components/FaultDetailModal/index.js +2 -2
  312. package/src/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +127 -158
  313. package/src/kisscomps/components/IntersectionDirectionSelection/index.js +2 -2
  314. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +496 -496
  315. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  316. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  317. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  318. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  319. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  320. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  321. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  322. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1272 -1272
  323. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  324. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  325. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  326. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  327. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  328. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  329. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  330. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  331. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  332. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  333. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  334. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  335. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  336. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  337. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  338. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  339. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +1200 -1200
  340. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  341. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +196 -196
  342. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  343. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  344. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  345. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +115 -115
  346. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  347. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  348. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +219 -219
  349. package/src/kisscomps/components/IntersectionMap/crossDirection/utils.js +84 -84
  350. package/src/kisscomps/components/IntersectionMap/index.js +2 -2
  351. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +199 -199
  352. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +530 -530
  353. package/src/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  354. package/src/kisscomps/components/KanBan/index.js +2 -2
  355. package/src/kisscomps/components/KanBan/kanban.vue +225 -225
  356. package/src/kisscomps/components/MessageBox/index.vue +96 -96
  357. package/src/kisscomps/components/OverLap/OverLap.vue +235 -235
  358. package/src/kisscomps/components/OverLap/index.js +2 -2
  359. package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  360. package/src/kisscomps/components/PatternOptimize/index.js +2 -2
  361. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +1481 -1478
  362. package/src/kisscomps/components/PatternStatus/index.js +2 -2
  363. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  364. package/src/kisscomps/components/PatternWalkSvg/index.js +2 -2
  365. package/src/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  366. package/src/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  367. package/src/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  368. package/src/kisscomps/components/PhaseDirectionText/index.js +2 -2
  369. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  370. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  371. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  372. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  373. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  374. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  375. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  376. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +988 -835
  377. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +356 -313
  378. package/src/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  379. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +206 -195
  380. package/src/kisscomps/components/SchemeConfig/index.js +2 -2
  381. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +208 -198
  382. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  383. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +128 -0
  384. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +426 -0
  385. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +820 -0
  386. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +194 -0
  387. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +206 -197
  388. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  389. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +275 -275
  390. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1196 -1194
  391. package/src/kisscomps/components/SelectCrossPhase/index.vue +417 -417
  392. package/src/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  393. package/src/kisscomps/components/StageBord/StageBord.vue +287 -287
  394. package/src/kisscomps/components/StageBord/index.js +2 -2
  395. package/src/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  396. package/src/kisscomps/components/StageStatus/index.js +2 -2
  397. package/src/kisscomps/components/Stages/index.vue +252 -211
  398. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  399. package/src/kisscomps/components/SvgIcon/index.js +2 -2
  400. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1067 -1065
  401. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  402. package/src/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  403. package/src/kisscomps/components/XiaoKanban/index.vue +102 -102
  404. package/src/kisscomps/components/overView/index.vue +699 -699
  405. package/src/kisscomps/components/patternConfig/index.js +2 -2
  406. package/src/kisscomps/components/patternConfig/index.vue +1126 -1126
  407. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +348 -408
  408. package/src/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  409. package/src/kisscomps/components/patternConfig/planContent.vue +573 -576
  410. package/src/kisscomps/components/patternConfig/planMenu.vue +329 -329
  411. package/src/kisscomps/components/patternConfig/utils.js +152 -152
  412. package/src/kisscomps/components/patternList/index.js +2 -2
  413. package/src/kisscomps/components/patternList/patternList.vue +585 -585
  414. package/src/kisscomps/index.js +123 -123
  415. package/src/lib/publicjs/ArryListUtil.js +38 -38
  416. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  417. package/src/lib/publicjs/KissApi.js +158 -158
  418. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  419. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  420. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  421. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  422. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  423. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  424. package/src/lib/publicjs/basecomponents.js +65 -65
  425. package/src/lib/publicjs/localStorage.js +112 -112
  426. package/src/lib/publicjs/objdeepcopy.js +32 -32
  427. package/src/lib/publicjs/pageScroll.js +30 -30
  428. package/src/lib/publicjs/passwdAssest.js +101 -101
  429. package/src/lib/publicjs/styleclassfactory.js +32 -32
  430. package/src/main.js +50 -50
  431. package/src/node_modules/.package_versions.json +1 -0
  432. package/src/router/index.js +63 -63
  433. package/src/store/getters.js +16 -16
  434. package/src/store/index.js +26 -26
  435. package/src/store/modules/globalParam.js +67 -67
  436. package/src/utils/ControlFormat.js +68 -68
  437. package/src/utils/RingDataModel.js +251 -251
  438. package/src/utils/auth.js +199 -199
  439. package/src/utils/conflct.js +250 -250
  440. package/src/utils/conflictList.js +87 -87
  441. package/src/utils/dateFormat.js +41 -41
  442. package/src/utils/errorcode.js +228 -228
  443. package/src/utils/fault.js +196 -196
  444. package/src/utils/faultcode.js +209 -209
  445. package/src/utils/index.js +69 -69
  446. package/src/utils/pedphasedesc.js +119 -119
  447. package/src/utils/phaseList.js +203 -203
  448. package/src/utils/phasedesc.js +144 -144
  449. package/src/utils/responseMessage.js +21 -21
  450. package/src/utils/validate.js +43 -43
  451. package/src/views/customchannelization.vue +49 -49
  452. package/src/views/home.1.vue +479 -479
  453. package/src/views/home.vue +93 -93
  454. package/src/views/intersection.vue +359 -365
  455. package/src/views/intersection2.vue +328 -328
  456. package/src/views/overView.vue +41 -41
  457. package/src/views/patternConfig.vue +1572 -609
  458. package/src/views/schemeconfig.vue +173 -204
  459. package/static/apiconfig.json +451 -451
  460. package/static/styles/channelizatioon.scss +433 -433
  461. package/static/styles/common.scss +23 -23
  462. package/static/styles/commonkanban.scss +100 -100
  463. package/static/styles/dark/index.scss +2 -2
  464. package/static/styles/dark/theme/element-dark.scss +42 -42
  465. package/static/styles/index.scss +84 -84
  466. package/static/styles/intersection.scss +190 -190
  467. package/static/styles/light/index.scss +2 -2
  468. package/static/styles/light/theme/element-light.scss +42 -42
  469. package/static/styles/overview.scss +146 -146
  470. package/static/styles/patternConfig.scss +56 -56
  471. package/static/styles/schemeconfig.scss +513 -501
  472. package/static/styles/stages.scss +57 -64
  473. package/static/styles/uiComponents.scss +57 -57
  474. package/static/styles/xiaokanban.scss +50 -50
  475. package/static/token.json +2 -2
  476. package/test/e2e/custom-assertions/elementCount.js +27 -27
  477. package/test/e2e/nightwatch.conf.js +46 -46
  478. package/test/e2e/runner.js +48 -48
  479. package/test/e2e/specs/test.js +19 -19
  480. package/test/unit/.eslintrc +7 -7
  481. package/test/unit/jest.conf.js +30 -30
  482. package/test/unit/setup.js +3 -3
  483. package/test/unit/specs/HelloWorld.spec.js +11 -11
  484. package/package/kissui.js +0 -216608
@@ -1,1200 +1,1200 @@
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
+ },
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>