openatc-components 0.3.12 → 0.3.14

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 (492) 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/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +101 -101
  25. package/package/kisscomps/components/ChannelRealtimeIntersection/index.js +2 -2
  26. package/package/kisscomps/components/Channelization/Channelization.vue +584 -584
  27. package/package/kisscomps/components/Channelization/index.js +2 -2
  28. package/package/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  29. package/package/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  30. package/package/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  31. package/package/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  32. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  33. package/package/kisscomps/components/CommonKanban/index.js +2 -2
  34. package/package/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +454 -454
  35. package/package/kisscomps/components/DirectionListConfiguration/index.js +2 -2
  36. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  37. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  38. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  39. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  40. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  41. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  42. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  43. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  44. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  45. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  46. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  47. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  48. package/package/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  49. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  50. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  51. package/package/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  52. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  53. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  54. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  55. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  56. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  57. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  58. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  59. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  60. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +467 -467
  61. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  62. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  63. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  64. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  65. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  66. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  67. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  68. package/package/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  69. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  70. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  71. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  72. package/package/kisscomps/components/DrawChannelization/index.js +2 -2
  73. package/package/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  74. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  75. package/package/kisscomps/components/ExpendConfig/index.js +2 -2
  76. package/package/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  77. package/package/kisscomps/components/FaultDetailModal/index.js +2 -2
  78. package/package/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +158 -158
  79. package/package/kisscomps/components/IntersectionDirectionSelection/index.js +2 -2
  80. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +629 -496
  81. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  82. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +447 -300
  83. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +341 -288
  84. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +497 -391
  85. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +353 -336
  86. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +359 -345
  87. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +443 -389
  88. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1302 -1302
  89. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  90. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +498 -402
  91. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +484 -361
  92. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +488 -368
  93. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +566 -475
  94. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +640 -494
  95. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +497 -401
  96. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +486 -360
  97. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +490 -367
  98. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +575 -476
  99. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  100. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  101. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  102. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  103. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  104. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  105. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +1358 -1358
  106. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  107. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +196 -196
  108. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  109. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  110. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  111. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +115 -115
  112. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  113. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  114. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +219 -219
  115. package/package/kisscomps/components/IntersectionMap/crossDirection/utils.js +84 -84
  116. package/package/kisscomps/components/IntersectionMap/index.js +2 -2
  117. package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +211 -211
  118. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +530 -530
  119. package/package/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  120. package/package/kisscomps/components/KanBan/index.js +2 -2
  121. package/package/kisscomps/components/KanBan/kanban.vue +225 -225
  122. package/package/kisscomps/components/MessageBox/index.vue +96 -96
  123. package/package/kisscomps/components/OverLap/OverLap.vue +237 -237
  124. package/package/kisscomps/components/OverLap/index.js +2 -2
  125. package/package/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  126. package/package/kisscomps/components/PatternOptimize/index.js +2 -2
  127. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +1508 -1508
  128. package/package/kisscomps/components/PatternStatus/index.js +2 -2
  129. package/package/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  130. package/package/kisscomps/components/PatternWalkSvg/index.js +2 -2
  131. package/package/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  132. package/package/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  133. package/package/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  134. package/package/kisscomps/components/PhaseDirectionText/index.js +2 -2
  135. package/package/kisscomps/components/PhaseMarker/index.js +6 -6
  136. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  137. package/package/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  138. package/package/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  139. package/package/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  140. package/package/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  141. package/package/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  142. package/package/kisscomps/components/PhasePedSelect/index.js +2 -2
  143. package/package/kisscomps/components/PhasePedSelect/index.vue +206 -206
  144. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +908 -902
  145. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +360 -360
  146. package/package/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  147. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +210 -210
  148. package/package/kisscomps/components/SchemeConfig/index.js +2 -2
  149. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +234 -234
  150. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  151. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +128 -128
  152. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +426 -426
  153. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +855 -851
  154. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +194 -194
  155. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +211 -211
  156. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  157. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +283 -283
  158. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1211 -1211
  159. package/package/kisscomps/components/SelectCrossPhase/index.vue +418 -418
  160. package/package/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  161. package/package/kisscomps/components/StageBord/StageBord.vue +303 -303
  162. package/package/kisscomps/components/StageBord/index.js +2 -2
  163. package/package/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  164. package/package/kisscomps/components/StageStatus/index.js +2 -2
  165. package/package/kisscomps/components/Stages/index.vue +319 -319
  166. package/package/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  167. package/package/kisscomps/components/SvgIcon/index.js +2 -2
  168. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1041 -1041
  169. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  170. package/package/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  171. package/package/kisscomps/components/XiaoKanban/index.vue +102 -102
  172. package/package/kisscomps/components/overView/index.vue +699 -699
  173. package/package/kisscomps/components/patternConfig/index.js +2 -2
  174. package/package/kisscomps/components/patternConfig/index.vue +981 -981
  175. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +408 -408
  176. package/package/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  177. package/package/kisscomps/components/patternConfig/planContent.vue +576 -576
  178. package/package/kisscomps/components/patternConfig/planMenu.vue +329 -329
  179. package/package/kisscomps/components/patternConfig/utils.js +152 -152
  180. package/package/kisscomps/components/patternList/index.js +2 -2
  181. package/package/kisscomps/components/patternList/patternList.vue +585 -585
  182. package/package/kisscomps/index.js +125 -125
  183. package/package/kissui.js +216608 -0
  184. package/package/kissui.min.js +1 -1
  185. package/package.json +127 -127
  186. package/src/App.vue +24 -24
  187. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  188. package/src/EdgeMgr/controller/crossDiagramMgr.js +125 -125
  189. package/src/api/authapi.js +31 -31
  190. package/src/api/config.js +21 -21
  191. package/src/api/control.js +106 -106
  192. package/src/api/cross.js +53 -53
  193. package/src/api/device.js +135 -135
  194. package/src/api/fault.js +66 -66
  195. package/src/api/index.js +24 -24
  196. package/src/api/login.js +46 -46
  197. package/src/api/optimize.js +72 -72
  198. package/src/api/param.js +165 -165
  199. package/src/api/passwdAssest.js +101 -101
  200. package/src/api/route.js +171 -171
  201. package/src/api/template.js +31 -31
  202. package/src/assets/font/LICENSE.txt +202 -202
  203. package/src/assets/font/font.css +6 -6
  204. package/src/i18n/index.js +26 -26
  205. package/src/i18n/language/en.js +1446 -1446
  206. package/src/i18n/language/index.js +25 -25
  207. package/src/i18n/language/zh.js +1445 -1445
  208. package/src/icons/demo.css +539 -539
  209. package/src/icons/demo_index.html +8146 -8146
  210. package/src/icons/iconfont.css +1399 -1399
  211. package/src/icons/iconfont.json +2431 -2431
  212. package/src/icons/index.js +20 -20
  213. package/src/icons/svg/azimuthlocking.svg +26 -26
  214. package/src/icons/svg/bendi.svg +110 -110
  215. package/src/icons/svg/bujin.svg +36 -36
  216. package/src/icons/svg/connectBlue.svg +7 -7
  217. package/src/icons/svg/currentvolume.svg +0 -0
  218. package/src/icons/svg/custom-BRTlane.svg +40 -40
  219. package/src/icons/svg/custom-buslane.svg +40 -40
  220. package/src/icons/svg/custom-detector.svg +12 -12
  221. package/src/icons/svg/custom-east-bottom.svg +32 -32
  222. package/src/icons/svg/custom-east-top.svg +32 -32
  223. package/src/icons/svg/custom-ewped.svg +35 -35
  224. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -40
  225. package/src/icons/svg/custom-north-left.svg +32 -32
  226. package/src/icons/svg/custom-north-right.svg +32 -32
  227. package/src/icons/svg/custom-peddetector.svg +17 -17
  228. package/src/icons/svg/custom-snped.svg +35 -35
  229. package/src/icons/svg/custom-south-left.svg +32 -32
  230. package/src/icons/svg/custom-south-right.svg +32 -32
  231. package/src/icons/svg/custom-tramlane.svg +40 -40
  232. package/src/icons/svg/custom-vehiclebranch.svg +40 -40
  233. package/src/icons/svg/custom-vehiclemainroad.svg +41 -41
  234. package/src/icons/svg/custom-west-bottom.svg +32 -32
  235. package/src/icons/svg/custom-west-top.svg +32 -32
  236. package/src/icons/svg/custom-xlped.svg +14 -14
  237. package/src/icons/svg/custom-xrped.svg +14 -14
  238. package/src/icons/svg/cutRed.svg +7 -7
  239. package/src/icons/svg/cycle.svg +0 -0
  240. package/src/icons/svg/dingzhouqi.svg +34 -34
  241. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  242. package/src/icons/svg/guandeng.svg +81 -81
  243. package/src/icons/svg/huangshan.svg +71 -71
  244. package/src/icons/svg/maincontrol.svg +0 -0
  245. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  246. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  247. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  248. package/src/icons/svg/model.svg +0 -0
  249. package/src/icons/svg/phasediff.svg +0 -0
  250. package/src/icons/svg/prioritycontrol.svg +21 -21
  251. package/src/icons/svg/quanhong.svg +86 -86
  252. package/src/icons/svg/shanghe.svg +11 -11
  253. package/src/icons/svg/shoudong.svg +103 -103
  254. package/src/icons/svg/tentativeplan.svg +28 -28
  255. package/src/icons/svg/time.svg +0 -0
  256. package/src/icons/svg/wuxianlan.svg +46 -46
  257. package/src/icons/svg/xiala.svg +11 -11
  258. package/src/icons/svg/xingrenguojie.svg +33 -33
  259. package/src/icons/svg/xitong.svg +89 -89
  260. package/src/icons/svg/youxian.svg +41 -41
  261. package/src/icons/svg/zizhukongzhi.svg +43 -43
  262. package/src/kisscomps/components/BoardCard/BoardCard.vue +112 -112
  263. package/src/kisscomps/components/BoardCard/index.js +2 -2
  264. package/src/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +101 -101
  265. package/src/kisscomps/components/ChannelRealtimeIntersection/index.js +2 -2
  266. package/src/kisscomps/components/Channelization/Channelization.vue +584 -584
  267. package/src/kisscomps/components/Channelization/index.js +2 -2
  268. package/src/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  269. package/src/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  270. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  271. package/src/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  272. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  273. package/src/kisscomps/components/CommonKanban/index.js +2 -2
  274. package/src/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +454 -454
  275. package/src/kisscomps/components/DirectionListConfiguration/index.js +2 -2
  276. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  277. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  278. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  279. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  280. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  281. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  282. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  283. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  284. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  285. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  286. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  287. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  288. package/src/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  289. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  290. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  291. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  292. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  293. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  294. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  295. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  296. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  297. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  298. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  299. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  300. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +467 -467
  301. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  302. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  303. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  304. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  305. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  306. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  307. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  308. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  309. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  310. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  311. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  312. package/src/kisscomps/components/DrawChannelization/index.js +2 -2
  313. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  314. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  315. package/src/kisscomps/components/ExpendConfig/index.js +2 -2
  316. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  317. package/src/kisscomps/components/FaultDetailModal/index.js +2 -2
  318. package/src/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +158 -158
  319. package/src/kisscomps/components/IntersectionDirectionSelection/index.js +2 -2
  320. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +629 -496
  321. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  322. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +447 -300
  323. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +341 -288
  324. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +497 -391
  325. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +353 -336
  326. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +359 -345
  327. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +443 -389
  328. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1302 -1302
  329. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  330. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +498 -402
  331. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +484 -361
  332. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +488 -368
  333. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +566 -475
  334. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +640 -494
  335. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +497 -401
  336. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +486 -360
  337. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +490 -367
  338. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +575 -476
  339. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  340. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  341. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  342. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  343. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  344. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  345. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +1358 -1358
  346. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  347. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +196 -196
  348. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  349. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  350. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  351. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +115 -115
  352. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  353. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  354. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +219 -219
  355. package/src/kisscomps/components/IntersectionMap/crossDirection/utils.js +84 -84
  356. package/src/kisscomps/components/IntersectionMap/index.js +2 -2
  357. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +211 -211
  358. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +530 -530
  359. package/src/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  360. package/src/kisscomps/components/KanBan/index.js +2 -2
  361. package/src/kisscomps/components/KanBan/kanban.vue +225 -225
  362. package/src/kisscomps/components/MessageBox/index.vue +96 -96
  363. package/src/kisscomps/components/OverLap/OverLap.vue +237 -237
  364. package/src/kisscomps/components/OverLap/index.js +2 -2
  365. package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  366. package/src/kisscomps/components/PatternOptimize/index.js +2 -2
  367. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +1508 -1508
  368. package/src/kisscomps/components/PatternStatus/index.js +2 -2
  369. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  370. package/src/kisscomps/components/PatternWalkSvg/index.js +2 -2
  371. package/src/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  372. package/src/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  373. package/src/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  374. package/src/kisscomps/components/PhaseDirectionText/index.js +2 -2
  375. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  376. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  377. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  378. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  379. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  380. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  381. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  382. package/src/kisscomps/components/PhasePedSelect/index.js +2 -2
  383. package/src/kisscomps/components/PhasePedSelect/index.vue +206 -206
  384. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +908 -902
  385. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +360 -360
  386. package/src/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  387. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +210 -210
  388. package/src/kisscomps/components/SchemeConfig/index.js +2 -2
  389. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +234 -234
  390. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  391. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +128 -128
  392. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +426 -426
  393. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +855 -851
  394. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +194 -194
  395. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +211 -211
  396. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  397. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +283 -283
  398. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1211 -1211
  399. package/src/kisscomps/components/SelectCrossPhase/index.vue +418 -418
  400. package/src/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  401. package/src/kisscomps/components/StageBord/StageBord.vue +303 -303
  402. package/src/kisscomps/components/StageBord/index.js +2 -2
  403. package/src/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  404. package/src/kisscomps/components/StageStatus/index.js +2 -2
  405. package/src/kisscomps/components/Stages/index.vue +319 -319
  406. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  407. package/src/kisscomps/components/SvgIcon/index.js +2 -2
  408. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1041 -1041
  409. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  410. package/src/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  411. package/src/kisscomps/components/XiaoKanban/index.vue +102 -102
  412. package/src/kisscomps/components/overView/index.vue +699 -699
  413. package/src/kisscomps/components/patternConfig/index.js +2 -2
  414. package/src/kisscomps/components/patternConfig/index.vue +981 -981
  415. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +408 -408
  416. package/src/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  417. package/src/kisscomps/components/patternConfig/planContent.vue +576 -576
  418. package/src/kisscomps/components/patternConfig/planMenu.vue +329 -329
  419. package/src/kisscomps/components/patternConfig/utils.js +152 -152
  420. package/src/kisscomps/components/patternList/index.js +2 -2
  421. package/src/kisscomps/components/patternList/patternList.vue +585 -585
  422. package/src/kisscomps/index.js +125 -125
  423. package/src/lib/publicjs/ArryListUtil.js +38 -38
  424. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  425. package/src/lib/publicjs/KissApi.js +158 -158
  426. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  427. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  428. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  429. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  430. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  431. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  432. package/src/lib/publicjs/basecomponents.js +65 -65
  433. package/src/lib/publicjs/localStorage.js +112 -112
  434. package/src/lib/publicjs/objdeepcopy.js +32 -32
  435. package/src/lib/publicjs/pageScroll.js +30 -30
  436. package/src/lib/publicjs/passwdAssest.js +101 -101
  437. package/src/lib/publicjs/styleclassfactory.js +32 -32
  438. package/src/main.js +51 -51
  439. package/src/router/index.js +63 -63
  440. package/src/store/getters.js +16 -16
  441. package/src/store/index.js +26 -26
  442. package/src/store/modules/globalParam.js +67 -67
  443. package/src/utils/ControlFormat.js +68 -68
  444. package/src/utils/RingDataModel.js +258 -258
  445. package/src/utils/auth.js +199 -199
  446. package/src/utils/conflct.js +250 -250
  447. package/src/utils/conflictList.js +87 -87
  448. package/src/utils/dateFormat.js +41 -41
  449. package/src/utils/errorcode.js +227 -227
  450. package/src/utils/fault.js +196 -196
  451. package/src/utils/faultcode.js +209 -209
  452. package/src/utils/index.js +69 -69
  453. package/src/utils/pedphasedesc.js +119 -119
  454. package/src/utils/phaseList.js +203 -203
  455. package/src/utils/phasedesc.js +144 -144
  456. package/src/utils/responseMessage.js +21 -21
  457. package/src/utils/validate.js +43 -43
  458. package/src/views/customchannelization.vue +49 -49
  459. package/src/views/home.1.vue +479 -479
  460. package/src/views/home.vue +93 -93
  461. package/src/views/intersection.vue +413 -413
  462. package/src/views/intersection2.vue +328 -328
  463. package/src/views/overView.vue +41 -41
  464. package/src/views/patternConfig.vue +609 -609
  465. package/src/views/schemeconfig.vue +206 -206
  466. package/static/apiconfig.json +451 -451
  467. package/static/styles/channelizatioon.scss +433 -433
  468. package/static/styles/common.scss +30 -30
  469. package/static/styles/commonkanban.scss +168 -168
  470. package/static/styles/dark/index.scss +2 -2
  471. package/static/styles/dark/theme/element-dark.scss +44 -44
  472. package/static/styles/index.scss +84 -84
  473. package/static/styles/intersection.scss +190 -190
  474. package/static/styles/light/index.scss +2 -2
  475. package/static/styles/light/theme/element-light.scss +44 -44
  476. package/static/styles/overview.scss +146 -146
  477. package/static/styles/patternConfig.scss +56 -56
  478. package/static/styles/phasePedSelect.scss +69 -69
  479. package/static/styles/schemeconfig.scss +549 -549
  480. package/static/styles/stages.scss +57 -57
  481. package/static/styles/theme/element-dark.scss +0 -0
  482. package/static/styles/uiComponents.scss +57 -57
  483. package/static/styles/xiaokanban.scss +50 -50
  484. package/static/token.json +2 -2
  485. package/test/e2e/custom-assertions/elementCount.js +27 -27
  486. package/test/e2e/nightwatch.conf.js +46 -46
  487. package/test/e2e/runner.js +48 -48
  488. package/test/e2e/specs/test.js +19 -19
  489. package/test/unit/.eslintrc +7 -7
  490. package/test/unit/jest.conf.js +30 -30
  491. package/test/unit/setup.js +3 -3
  492. package/test/unit/specs/HelloWorld.spec.js +11 -11
@@ -1,1508 +1,1508 @@
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="main-patternstatus">
14
- <!-- 环模式true -->
15
- <div v-if="this.contrloType === 'ring' || !this.contrloType">
16
- <div class="ring-first" v-for="(list, index1) in patternInfo" :key="index1">
17
- <div style="position: relative;" :style="{'height': '34px','float':'left','width':((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%'}" v-for="(item,index2) in list" :key="index2" :class="item.mode===7?'direction': ''">
18
- <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.greenWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%').replace('%', ''))*100+'%','height':'34px','background':'#7ccc66'}">
19
- <el-tooltip placement="top-start" effect="light">
20
- <div slot="content">{{$t('openatccomponents.phase.phase')}}{{item.id}}:{{item.split}}</div>
21
- <div style="cursor:pointer;">
22
- <div class="ring-phase">
23
- <!-- <patternwalksvg :showWalk="item.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg> -->
24
- <xdrdirselector Width="60px" Height="60px" Widths="50px" Heights="50px" :showlist="item.direction"></xdrdirselector>
25
- </div>
26
- <div class="box" style="position: absolute; left:40px; width:40px; top: -1px;">
27
- <div class="ring-nums">{{$t('openatccomponents.phase.phase')}}{{item.id}}</div>
28
- <div class="ring-nums">{{item.split}}</div>
29
- </div>
30
- </div>
31
- </el-tooltip>
32
- <div style="width:50px;" v-for="(bus,index3) in busPhaseData" :key="index3">
33
- <i class="iconfont icon-lukouzhilu" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 1 && bus.phaseid===item.id"></i>
34
- <i class="iconfont icon-BRT" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 4 && bus.phaseid===item.id"></i>
35
- <i class="iconfont icon-xuxiangwei-xin" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 99 && bus.phaseid===item.id"></i>
36
- <i class="iconfont icon-feijidongche" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 6 && bus.phaseid===item.id"></i>
37
- <i class="iconfont icon-gongjiaoche" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 3 && bus.phaseid===item.id"></i>
38
- <i class="iconfont icon-youguidianche" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 5 && bus.phaseid===item.id"></i>
39
- </div>
40
- </div>
41
- <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.flashgreen.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','float':'left','background': 'linear-gradient(to right, #ffffff 50%, #7ccc66 0)','background-size': '4px 100%'}"></div>
42
- <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.yellowWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%').replace('%', ''))*100+'%','height':'34px','background':'#f9dc6a'}"></div>
43
- <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.redWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','background':'#f27979'}"></div>
44
- </div>
45
- </div>
46
- <div v-if="showBarrier">
47
- <div v-for="(item, index) in barrierList" :key="index + '1'">
48
- <div class="divider" :style="{'left':item, 'height':barrierHeight}"></div>
49
- </div>
50
- </div>
51
- <div v-show="(this.controlData && this.controlData.curTime && cycle && cycle>0 && this.isControl) || (this.controlData && newCycle && newCycle>0 && this.isControl)">
52
- <div class="curTimeDiv" :style="{'left':paddingLeft }">{{ timeNumDevide }}</div>
53
- <div class="curTimeLine" :style="{'left':paddingLeft, 'height':barrierHeight}"></div>
54
- </div>
55
- </div>
56
- <div v-if="this.contrloType === 'stage'" class="ring-first">
57
- <div v-for="(list, index1) in stageLists" :key="index1">
58
- <!-- <div> -->
59
- <div class="first-1" :style="{'width':list.greenWidth,'height':'34px','position':'relative','background':'#7ccc66'}">
60
- <el-tooltip placement="top-start" effect="light">
61
- <div slot="content">
62
- <span class="ring-nums" v-for="(pha,index) in list.phases" :key="index">
63
- {{$t('openatccomponents.phase.phase')}}{{pha}}
64
- </span>
65
- </div>
66
- <div style="cursor:pointer;">
67
- <div class="ring-phase">
68
- <!-- <patternwalksvg :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg> -->
69
- <xdrdirselector v-if="list.direction&&list.direction.length>0" Width="60px" Height="60px" Widths="50px" Heights="50px" :showlist="list.direction"></xdrdirselector>
70
- </div>
71
- <div class="box" style="position: absolute; left:41px; width:40px; top:-1px;">
72
- <div class="ring-nums">{{$t('openatccomponents.phase.stage')}}{{list.key+1}}</div>
73
- <div class="ring-nums">{{list.stageSplit}}</div>
74
- </div>
75
- <!-- <div class="box" style="line-height:28px">
76
- <span class="ring-nums" v-for="(pha,index) in list.phases" :key="index">
77
- P:{{pha}}
78
- </span>
79
- </div> -->
80
- </div>
81
- </el-tooltip>
82
- </div>
83
- <!-- <div class="first-1" :style="{'width':item.flashgreen,'height':'34px','float':'left','background': 'linear-gradient(to right, #ffffff 50%, #7ccc66 0)','background-size': '4px 100%'}"></div> -->
84
- <div class="first-1" :style="{'width':list.yellowWidth,'height':'34px','background':'#f9dc6a'}"></div>
85
- <div class="first-1" :style="{'width':list.redWidth,'height':'34px','background':'#f27979'}"></div>
86
- </div>
87
- <div v-if="this.controlData && this.controlData.curTime">
88
- <div class="curTimeDiv" :style="{ left: paddingLefts }">
89
- {{ timeNumDevides }}
90
- </div>
91
- <div
92
- class="curTimeLine"
93
- :style="{ left: paddingLefts, height: '56px' }"
94
- ></div>
95
- </div>
96
- </div>
97
- <!-- </div> -->
98
- </div>
99
- </template>
100
- <script>
101
- // import patternwalksvg from '../PatternWalkSvg/PatternWalkSvg'
102
- import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
103
- // import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
104
- import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
105
- import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
106
- export default {
107
- name: 'pattern-list',
108
- components: {
109
- // patternwalksvg,
110
- xdrdirselector
111
- },
112
- data () {
113
- return {
114
- barrierHeight: '',
115
- stageCycle: '',
116
- barrierList: [],
117
- newCycle: this.cycles,
118
- patternIds: this.patternId,
119
- newPatterns: [],
120
- newList: [],
121
- isControl: true,
122
- contrloCycle: 0,
123
- sidewalkPhaseData: [],
124
- // controlDatas: this.controlData,
125
- max: '',
126
- fixCycle: '',
127
- curtime: 0,
128
- stageLists: [],
129
- busPhaseData: [], // 公交相位数据
130
- patternInfo: []
131
- }
132
- },
133
- props: {
134
- cycleChange: {
135
- type: Boolean,
136
- default: true
137
- },
138
- stagesChange: {
139
- type: Array
140
- },
141
- controlPhase: {
142
- type: Object
143
- },
144
- contrloType: {
145
- type: String
146
- },
147
- phaseList: {
148
- type: Array
149
- },
150
- patternList: {
151
- type: Array
152
- },
153
- showBarrier: {
154
- type: Boolean,
155
- default: false
156
- },
157
- allPatternList: {
158
- type: Array
159
- },
160
- localPatternList: {
161
- type: Array
162
- },
163
- controlData: {
164
- type: Object
165
- },
166
- showCondition: {
167
- type: Boolean,
168
- default: false
169
- },
170
- cycle: {
171
- type: Number
172
- },
173
- agentId: {
174
- type: String
175
- },
176
- cycles: {
177
- type: Number
178
- },
179
- patternId: {
180
- type: Number
181
- },
182
- patternStatusList: {
183
- type: Array
184
- },
185
- syncTime: {
186
- type: Number
187
- }
188
- },
189
- computed: {
190
- paddingLefts () {
191
- let res = '0%'
192
- let curPercent = this.curtime / this.stageCycle
193
- if (curPercent >= 1) {
194
- curPercent = 1
195
- }
196
- res = curPercent * 100 + '%'
197
- return res
198
- },
199
- timeNumDevides () {
200
- let res = this.curtime
201
- return res
202
- },
203
- paddingLeft () {
204
- let res = '0%'
205
- if (this.contrloCycle > 0) {
206
- let curPercent = this.curtime / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
207
- if (curPercent >= 1) {
208
- curPercent = 1
209
- }
210
- res = curPercent * 100 + '%'
211
- }
212
- if (this.cycles > 0) {
213
- let curPercent = this.curtime / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
214
- if (curPercent >= 1) {
215
- curPercent = 1
216
- }
217
- res = curPercent * 100 + '%'
218
- }
219
- return res
220
- },
221
- timeNumDevide () {
222
- if (this.contrloCycle > 0) {
223
- // let res = (this.contrloCycle - this.syncTime) + '/' + this.contrloCycle
224
- // let res = this.curtime + '/' + (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
225
- let res = this.curtime
226
- return res
227
- }
228
- if (this.cycles > 0) {
229
- // let res = (this.cycles - this.syncTime) + '/' + this.cycles
230
- // let res = this.curtime + '/' + (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
231
- let res = this.curtime
232
- return res
233
- }
234
- }
235
- },
236
- watch: {
237
- controlPhase: {
238
- handler: function (val, oldVal) {
239
- if ((val && val.curTime) || val.curTime === 0) {
240
- this.curtime = val.curTime
241
- if (val.control === 4 || val.control === 16 || val.control === 22) {
242
- this.isControl = false
243
- } else {
244
- this.isControl = true
245
- }
246
- }
247
- },
248
- // 深度观察监听
249
- deep: true
250
- },
251
- controlData: {
252
- handler: function (val, oldVal) {
253
- if (this.contrloType === 'stage') {
254
- this.getIndexStage()
255
- }
256
- // this.controlDatas = this.controlData
257
- this.getPedPhasePos()
258
- if (this.localPatternList) {
259
- this.max = ''
260
- let idPattern = this.localPatternList.filter(item => item.id === this.controlData.patternid)
261
- if (idPattern.length === 0 || (this.controlData && this.showCondition)) {
262
- this.handleTentivePatternData()
263
- } else {
264
- this.handlePatternData()
265
- }
266
- this.handleBarrierHeight()
267
- }
268
- if ((val && val.curTime) || val.curTime === 0) {
269
- this.curtime = val.curTime
270
- if (val.control === 4 || val.control === 16 || val.control === 22) {
271
- this.isControl = false
272
- } else {
273
- this.isControl = true
274
- }
275
- }
276
- },
277
- // 深度观察监听
278
- deep: true
279
- },
280
- cycleChange: {
281
- handler: function (val, oldVal) {
282
- this.getStage()
283
- this.handleCurrentChange(this.patternStatusList)
284
- this.handleBarrierHeight()
285
- },
286
- // 深度观察监听
287
- deep: true
288
- },
289
- phaseList: {
290
- handler: function (val, oldVal) {
291
- this.getPedPhasePos()
292
- this.getBusPos()
293
- this.getStage()
294
- // this.handlePatternData()
295
- },
296
- // 深度观察监听
297
- deep: true
298
- },
299
- agentId: {
300
- handler: function (val, oldVal) {
301
- this.getBusPos()
302
- },
303
- // 深度观察监听
304
- deep: true
305
- },
306
- patternId: {
307
- handler: function (val, oldVal) {
308
- this.patternIds = this.patternId
309
- },
310
- // 深度观察监听
311
- deep: true
312
- },
313
- cycles: {
314
- handler: function (val, oldVal) {
315
- this.newCycle = this.cycles
316
- },
317
- // 深度观察监听
318
- deep: true
319
- },
320
- contrloType: {
321
- handler: function (val, oldVal) {
322
- if (this.contrloType === 'stage') {
323
- this.getStage()
324
- }
325
- },
326
- // 深度观察监听
327
- deep: true
328
- },
329
- stagesChange: {
330
- handler: function (val, oldVal) {
331
- if (this.contrloType === 'stage') {
332
- this.getStage()
333
- }
334
- },
335
- // 深度观察监听
336
- deep: true
337
- },
338
- patternStatusList: {
339
- handler: function (val, oldVal) {
340
- this.handleBarrierHeight() // 计算屏障高度
341
- if (this.patternStatusList && this.newCycle) {
342
- setTimeout(() => {
343
- this.handleCurrentChange(this.patternStatusList)
344
- this.handleBarrierHeight()
345
- }, 10)
346
- this.handleBarrierHeight()
347
- }
348
- },
349
- // 深度观察监听
350
- deep: true
351
- }
352
- },
353
- created () {
354
- this.globalParamModel = this.$store.getters.globalParamModel
355
- if (this.patternStatusList && this.newCycle && !this.controlData) {
356
- setTimeout(() => {
357
- this.handleCurrentChange(this.patternStatusList)
358
- this.handleBarrierHeight()
359
- }, 400)
360
- } else if ((this.controlData && this.controlData.patternid === 109) || (this.controlData && this.showCondition) || (this.controlData && this.localPatternList.length === 0)) {
361
- this.handleTentivePatternData()
362
- } else {
363
- this.handlePatternData()
364
- }
365
- this.PhaseDataModel = new PhaseDataModel()
366
- this.CrossDiagramMgr = new CrossDiagramMgr()
367
- this.getPedPhasePos()
368
- this.getBusPos()
369
- if (this.contrloType === 'stage') {
370
- this.getStage()
371
- }
372
- },
373
- methods: {
374
- getPed (data) {
375
- let ped = []
376
- for (let stg of data) {
377
- let peddirections = []
378
- let currPhase = this.phaseList.filter((item) => {
379
- return item.id === stg
380
- })[0]
381
- if (!currPhase) return
382
- if (!currPhase.peddirection) return
383
- for (let walk of this.sidewalkPhaseData) {
384
- for (let ped of currPhase.peddirection) {
385
- if (stg === walk.phaseid) {
386
- let obj = {}
387
- obj.name = walk.name
388
- obj.id = walk.id
389
- if (ped === walk.id) {
390
- peddirections.push(obj)
391
- peddirections = Array.from(new Set(peddirections))
392
- }
393
- }
394
- }
395
- }
396
- ped.push(...peddirections)
397
- }
398
- return ped
399
- },
400
- handleStageData (data) {
401
- if (!data) return
402
- let peddirections = this.getPed(data)
403
- let stagesTemp = []
404
- let tempList = []
405
- for (let stg of data) {
406
- let directionList = []
407
- let currPhase = this.phaseList.filter((item) => {
408
- return item.id === stg
409
- })[0]
410
- if (currPhase !== undefined) {
411
- directionList.push(...currPhase.direction)
412
- directionList = Array.from(new Set(directionList))
413
- }
414
- if (directionList.length === 0) {
415
- tempList.push({
416
- id: '',
417
- color: '#454545',
418
- peddirection: peddirections
419
- })
420
- } else {
421
- tempList = directionList.map(dir => ({
422
- id: dir,
423
- color: '#454545',
424
- peddirection: peddirections
425
- }))
426
- }
427
- let newTemp = tempList.filter(item => item.id !== '')
428
- stagesTemp.push(...newTemp)
429
- }
430
- return stagesTemp
431
- },
432
- getIndexStage () {
433
- if (this.localPatternList.length === 0) return
434
- for (let i = 0; i < this.localPatternList.length; i++) {
435
- if (this.controlData.patternid === this.localPatternList[i].id) {
436
- if (!this.localPatternList[i].stagesList) return
437
- let stageCycleList = this.localPatternList[i].stagesList.map(item => {
438
- return item.stageSplit ? item.stageSplit : 0
439
- })
440
- let stageMaxCyle = stageCycleList.reduce((a, b) => {
441
- return a + b
442
- }, 0)
443
- this.stageCycle = stageMaxCyle
444
- this.stageLists = this.localPatternList[i].stagesList.map(item => {
445
- return {
446
- ...item,
447
- // peddirection: this.getPed(item.phases ? item.phases : item.stages),
448
- direction: this.handleStageData(item.phases ? item.phases : item.stages),
449
- greenWidth: (item.green / stageMaxCyle * 100).toFixed(3) + '%',
450
- yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
451
- redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
452
- }
453
- })
454
- }
455
- }
456
- },
457
- getStage () {
458
- if (!this.stagesChange) return
459
- const globalParamModel = this.$store.getters.globalParamModel
460
- let pattern = this.allPatternList ? this.allPatternList : globalParamModel.getParamsByType('patternList')
461
- let mapAdd = pattern.map(item => item.stagesList).map(item => {
462
- return item.map(val => {
463
- return val.stageSplit ? val.stageSplit : val.split
464
- })
465
- })
466
- let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
467
- return item.length > 0 ? item.reduce((a, b) => {
468
- return a + b
469
- }) : 0
470
- }) : 0
471
- let stageMaxCyle = Math.max(...maxCycle)// 每个环的周期最大值
472
- if (!this.cycleChange) {
473
- let stageCycleList = this.stagesChange.map(item => {
474
- return item.stageSplit ? item.stageSplit : 0
475
- })
476
- stageMaxCyle = stageCycleList.reduce((a, b) => {
477
- return a + b
478
- }, 0)
479
- }
480
- this.stageLists = this.stagesChange.map(item => {
481
- return {
482
- ...item,
483
- // peddirection: this.getPed(item.phases ? item.phases : item.stages),
484
- direction: this.handleStageData(item.phases ? item.phases : item.stages),
485
- greenWidth: ((item.stageSplit - item.yellow - item.red) / stageMaxCyle * 100).toFixed(3) + '%',
486
- yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
487
- redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
488
- }
489
- })
490
- },
491
- getBusPos () {
492
- // 公交相位信息
493
- this.busPhaseData = []
494
- this.phaseList.forEach((ele, i) => {
495
- // if (ele.controltype >= 3 && ele.controltype <= 5) {
496
- // ele.direction.forEach((dir, index) => {
497
- // 车道相位
498
- this.busPhaseData.push({
499
- phaseid: ele.id, // 相位did,用于对应相位状态
500
- // id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
501
- // name: this.PhaseDataModel.getBusPhasePos(dir).name,
502
- controltype: ele.controltype
503
- })
504
- // })
505
- // }
506
- })
507
- let result = []
508
- let obj = {}
509
- for (var i = 0; i < this.busPhaseData.length; i++) {
510
- if (!obj[this.busPhaseData[i].phaseid]) {
511
- result.push(this.busPhaseData[i])
512
- obj[this.busPhaseData[i].phaseid] = true
513
- }
514
- }
515
- this.busPhaseData = result
516
- },
517
- getPedPhasePos () {
518
- // 行人相位信息
519
- this.sidewalkPhaseData = []
520
- this.phaseList.forEach((ele, i) => {
521
- if (ele.peddirection) {
522
- ele.peddirection.forEach((dir, index) => {
523
- // 行人相位
524
- if (this.PhaseDataModel.getSidePos(dir)) {
525
- this.sidewalkPhaseData.push({
526
- key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
527
- phaseid: ele.id, // 相位id,用于对应相位状态
528
- id: dir,
529
- name: this.PhaseDataModel.getSidePos(dir).name
530
- })
531
- }
532
- })
533
- }
534
- })
535
- },
536
- handleTentivePatternData () {
537
- if (!this.controlData) return
538
- this.newList = []
539
- if (Object.keys(this.controlData).length === 0 || this.phaseList.length === 0) return
540
- if (!this.controlData.phase) return
541
- // let cycle = this.controlData.cycle
542
- if (!this.controlData.rings) return
543
- let newValue = []
544
- for (let rings of this.controlData.rings) {
545
- let phase = this.controlData.phase
546
- // let list = []
547
- let obj = {}
548
- for (let key in rings.sequence) {
549
- obj[key] = rings.sequence[key]
550
- }
551
- let newObj = Object.keys(obj).map(val => ({
552
- id: obj[val]
553
- }))
554
- newValue.push(newObj)
555
- for (let sequ of rings.sequence) {
556
- let obj = {}
557
- obj.id = sequ
558
- let split = phase.filter((item) => {
559
- return item.id === sequ
560
- })[0].split
561
- newValue.map(d => {
562
- d.map(r => {
563
- if (r.id === sequ) {
564
- r.value = split
565
- }
566
- })
567
- })
568
- }
569
- }
570
- this.handleTentative(newValue)
571
- },
572
- handleTentative (val) {
573
- if (val === null || val.length === 0) return
574
- // 周期以实际的绿信比来计算
575
- let valSplit = val.map(item => {
576
- return item.map(val => {
577
- return val.value + (val.sum ? val.sum : 0)
578
- })
579
- })
580
- let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
581
- return item.length > 0 ? item.reduce((a, b) => {
582
- return a + b
583
- }) : 0
584
- }) : 0
585
- let cycle = Math.max(...splitCycle)// 每个环的周期最大值
586
- this.contrloCycle = cycle
587
- this.patternInfo = []
588
- let currentArr = []
589
- let newPattern = []
590
- val.map(i => {
591
- newPattern.push(...i)
592
- })
593
- if (this.phaseList.length === 0) return
594
- for (let patternStatus of val[0]) {
595
- // if (patternStatus.mode !== 7) {
596
- let concurrent = this.phaseList.filter((item) => {
597
- return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
598
- })[0].concurrent// 当前相位的并发相位
599
- if (concurrent) {
600
- let obj = {
601
- id: patternStatus.id,
602
- current: concurrent.sort()
603
- }
604
- currentArr.push(obj)
605
- }
606
- // }
607
- }
608
- if (currentArr.length !== 0) {
609
- let newCurrent = this.tranform(currentArr)
610
- let ringTeam = this.step1(this.phaseList, newCurrent)
611
- this.fillGap(ringTeam, val)
612
- }
613
- // let cycle = this.controlData.cycle
614
- for (let rings of val) {
615
- if (rings.length === 0) continue
616
- let list = []
617
- for (let ring of rings) {
618
- if (ring.value === 0) continue
619
- let obj = {}
620
- let split = ring.value
621
- obj.id = ring.id
622
- // obj.split = split
623
- let currPhase = this.phaseList.filter((item) => {
624
- if (item.id === ring.id && item.controltype === 99) {
625
- obj.controltype = item.controltype
626
- }
627
- return item.id === ring.id
628
- })[0]
629
- if (!currPhase) return
630
- let peddirections = []
631
- for (let walk of this.sidewalkPhaseData) {
632
- if (currPhase.peddirection) {
633
- for (let ped of currPhase.peddirection) {
634
- // if (stg === walk.phaseid) {
635
- let objs = {}
636
- objs.name = walk.name
637
- objs.color = 'rgba(48,49,51,0.6)'
638
- objs.id = walk.id
639
- if (ped === walk.id) {
640
- peddirections.push(objs)
641
- peddirections = Array.from(new Set(peddirections))
642
- }
643
- // }
644
- }
645
- } else {
646
- peddirections = []
647
- }
648
- }
649
- if (ring.desc && ring.desc.length > 0) {
650
- obj.direction = ring.desc.map(item => { // 虚相位desc为空
651
- return {
652
- id: item.id,
653
- color: '#303133'
654
- }
655
- })
656
- } else {
657
- if (currPhase.direction && currPhase.direction.length > 0) {
658
- obj.direction = currPhase.direction.map(item => {
659
- return {
660
- id: item,
661
- peddirection: peddirections,
662
- color: '#303133'
663
- }
664
- })
665
- } else {
666
- obj.direction = [
667
- {
668
- id: '',
669
- color: '#303133',
670
- peddirection: peddirections
671
- }
672
- ]
673
- }
674
- }
675
- obj.split = split
676
- obj.cycle = cycle
677
- if (ring.sum) {
678
- obj.sum = ring.sum
679
- obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100) + '%'
680
- } else {
681
- obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100) + '%'
682
- }
683
- obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100) + '%'
684
- obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100) + '%'
685
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100) + '%'
686
- // 忽略相位不显示
687
- // let mode = ring.mode
688
- // if (mode !== 7) { // 忽略相位不显示
689
- list.push(obj)
690
- // }
691
- }
692
- this.patternInfo.push(list)
693
- }
694
- },
695
- handlePatternData () {
696
- if (!this.controlData) return
697
- // this.newList = []
698
- if (Object.keys(this.controlData).length === 0 || this.phaseList.length === 0) return
699
- if (!this.controlData.phase) return
700
- if (!this.controlData.rings) return
701
- let nowPattern = this.localPatternList.filter(item => {
702
- return item.id === this.controlData.patternid
703
- })[0].rings
704
- // 信号机忽略相位,更新最新的相位信息
705
- let filterPattern = []
706
- for (let i of nowPattern) {
707
- for (let j of this.controlData.rings) {
708
- let filterSequence = i.filter(item => j.sequence.includes(item.id))
709
- if (filterSequence.length > 0) {
710
- filterPattern.push(filterSequence)
711
- }
712
- }
713
- }
714
- for (let rings of this.controlData.rings) {
715
- for (let sequ of rings.sequence) {
716
- let split = this.controlData.phase.filter((item) => {
717
- return item.id === sequ
718
- })[0].split
719
- filterPattern.map(d => {
720
- return d.map(r => {
721
- if (r.id === sequ) {
722
- r.value = split
723
- }
724
- })
725
- })
726
- }
727
- }
728
- this.handleOverViewChange(filterPattern)
729
- },
730
- handleBarrierHeight () { // 屏障高度
731
- if (!this.patternInfo) return
732
- let patternLength = this.patternInfo.length
733
- this.barrierHeight = (patternLength * 35 + 21) + 'px'
734
- },
735
- handleOverViewChange (val) {
736
- if (val === null || val.length === 0) return
737
- // 周期以实际的绿信比来计算
738
- let valSplit = val.map(item => {
739
- return item.map(val => {
740
- return val.value + (val.sum ? val.sum : 0)
741
- })
742
- })
743
- let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
744
- return item.length > 0 ? item.reduce((a, b) => {
745
- return a + b
746
- }) : 0
747
- }) : 0
748
- let cycle = Math.max(...splitCycle)// 每个环的周期最大值
749
- this.contrloCycle = cycle
750
- // 按环序分组
751
- let ringlength = []
752
- let ringsequence = val.map(item => {
753
- if (item.length === 0) return
754
- ringlength.push(item.length)
755
- return item.map(k => {
756
- return k.id
757
- })
758
- })
759
- let newRings = ringsequence.filter(item => item)
760
- let minLength = Math.min(...ringlength)
761
- let resultArrs = [] // 环1分组
762
- let resultArr = [] // 环2分组
763
- for (let j = 0; j < ringsequence[0].length; j += minLength) {
764
- resultArrs.push(ringsequence[0].slice(j, j + minLength))
765
- if (ringsequence[0].length === minLength) {
766
- resultArrs.push([])
767
- }
768
- }
769
- if (newRings.length > 1) {
770
- for (let i = 0; i < ringsequence[1].length; i += minLength) {
771
- resultArr.push(ringsequence[1].slice(i, i + minLength))
772
- }
773
- }
774
- this.patternInfo = []
775
- let currentArr = []
776
- let newPattern = []
777
- val.map(i => {
778
- newPattern.push(...i)
779
- })
780
- if (this.phaseList.length === 0) return
781
- for (let patternStatus of val[0]) {
782
- // if (patternStatus.mode !== 7) {
783
- let concurrent = this.phaseList.filter((item) => {
784
- return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
785
- })[0].concurrent// 当前相位的并发相位
786
- if (concurrent) {
787
- let obj = {
788
- id: patternStatus.id,
789
- current: concurrent.sort()
790
- }
791
- currentArr.push(obj)
792
- }
793
- // }
794
- }
795
- if (currentArr.length !== 0) {
796
- let newCurrent = this.tranform(currentArr)
797
- // 取没个环与环关系的并集
798
- let barrierRing1 = []
799
- let barrierRing2 = []
800
- let ring1 = [] // 环1与关系1的并集
801
- for (let h = 0; h < newCurrent.length; h++) {
802
- let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
803
- ring1.push(adds)
804
- }
805
- let ring1s = [] // 环1与关系2的并集
806
- for (let h = 0; h < newCurrent.length; h++) {
807
- let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
808
- ring1s.push(addRing1)
809
- }
810
- barrierRing1.push(...ring1, ...ring1s)
811
- let resultList = []
812
- if (newRings.length > 1) {
813
- let ring2s = [] // 环2与关系1的并集
814
- for (let h = 0; h < newCurrent.length; h++) {
815
- let addRing2 = [...new Set(resultArr[1])].filter(item => newCurrent[h].includes(item))
816
- ring2s.push(addRing2)
817
- }
818
- let ring2 = [] // 环2与关系1的并集
819
- for (let h = 0; h < newCurrent.length; h++) {
820
- let add = [...new Set(resultArr[0])].filter(item => newCurrent[h].includes(item))
821
- ring2.push(add)
822
- }
823
- barrierRing2.push(...ring2, ...ring2s)
824
- for (let k = 0; k < barrierRing1.length; k++) {
825
- resultList.push(barrierRing1[k].concat(barrierRing2[k]))
826
- }
827
- }
828
- let resultLists = resultList.filter(item => item.length !== 0)
829
- let ringArr = []
830
- for (let l = 0; l < resultLists.length; l++) {
831
- for (let d = 0; d < newCurrent.length; d++) {
832
- if (newCurrent[d].filter(item => resultLists[l].includes(item)).length > 0) {
833
- ringArr.push({
834
- data: resultLists[l],
835
- id: d + 1,
836
- index: l
837
- })
838
- }
839
- }
840
- }
841
- for (var i = 0; i < ringArr.length; i++) {
842
- for (var j = i + 1; j < ringArr.length; j++) {
843
- if (ringArr[i].id === ringArr[j].id && ringArr[i].index + 1 === ringArr[j].index) {
844
- ringArr[i].data = ringArr[i].data.concat(ringArr[j].data)
845
- ringArr.splice(ringArr.indexOf(ringArr[j].id), 1)
846
- }
847
- }
848
- }
849
- let resArr = ringArr.map(item => item.data)
850
- let ringTeam = this.step1(this.phaseList, resArr)
851
- let ringTeams = ringTeam.filter(item => item.length !== 0)
852
- this.fillGap(ringTeams, val)
853
- // 总览添加屏障
854
- let newPattern = []
855
- val.map(i => {
856
- newPattern.push(...i)
857
- })
858
- let barrier = this.step2(ringTeams, newPattern)
859
- let barrierLeft = barrier.map(item => item)
860
- this.barrierList = barrierLeft.map(j => {
861
- return (j / (this.max ? this.max : this.contrloCycle) * 100) + '%'
862
- })
863
- }
864
- // let cycle = this.controlData.cycle
865
- for (let rings of val) {
866
- if (rings.length === 0) continue
867
- let list = []
868
- for (let ring of rings) {
869
- if (ring.value === 0) continue
870
- let obj = {}
871
- let split = ring.value
872
- obj.id = ring.id
873
- obj.mode = ring.mode
874
- // obj.split = split
875
- let currPhase = this.phaseList.filter((item) => {
876
- if (item.id === ring.id && item.controltype === 99) {
877
- obj.controltype = item.controltype
878
- }
879
- return item.id === ring.id
880
- })[0]
881
- if (!currPhase) return
882
- let peddirections = []
883
- for (let walk of this.sidewalkPhaseData) {
884
- if (currPhase.peddirection) {
885
- for (let ped of currPhase.peddirection) {
886
- // if (stg === walk.phaseid) {
887
- let objs = {}
888
- objs.name = walk.name
889
- objs.id = walk.id
890
- objs.color = 'rgba(48,49,51,0.6)'
891
- if (ped === walk.id) {
892
- peddirections.push(objs)
893
- peddirections = Array.from(new Set(peddirections))
894
- }
895
- // }
896
- }
897
- } else {
898
- peddirections = []
899
- }
900
- }
901
- if (ring.desc && ring.desc.length > 0) {
902
- obj.direction = ring.desc.map(item => { // 虚相位desc为空
903
- return {
904
- id: item.id,
905
- color: '#303133'
906
- }
907
- })
908
- } else {
909
- if (currPhase.direction && currPhase.direction.length > 0) {
910
- obj.direction = currPhase.direction.map(item => {
911
- return {
912
- id: item,
913
- peddirection: peddirections,
914
- color: '#303133'
915
- }
916
- })
917
- } else {
918
- obj.direction = [
919
- {
920
- id: '',
921
- color: '#303133',
922
- peddirection: peddirections
923
- }
924
- ]
925
- }
926
- }
927
- obj.split = split
928
- obj.cycle = cycle
929
- if (ring.sum) {
930
- obj.sum = ring.sum
931
- obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100) + '%'
932
- } else {
933
- obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100) + '%'
934
- }
935
- obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100) + '%'
936
- obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100) + '%'
937
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100) + '%'
938
- // 忽略相位不显示
939
- // let mode = ring.mode
940
- // if (mode !== 7) { // 忽略相位不显示
941
- list.push(obj)
942
- // }
943
- }
944
- this.patternInfo.push(list)
945
- }
946
- },
947
- handleCurrentChange (val) { // 两个ring的数据
948
- this.patternInfo = []
949
- if (val === null || val.length === 0) return
950
- if (this.controlPhase && this.controlPhase.phase && this.controlPhase.phase[0].split) {
951
- val.map(i => {
952
- i.map(j => {
953
- j.value = this.controlPhase.phase.filter(item => item.id === j.id)[0].split
954
- })
955
- })
956
- }
957
- // 按环序分组
958
- let ringlength = []
959
- let ringsequence = val.map(item => {
960
- if (item.length === 0) return
961
- ringlength.push(item.length)
962
- return item.map(k => {
963
- return k.id
964
- })
965
- })
966
- let valSplit = val.map(item => {
967
- return item.map(val => {
968
- return val.value + (val.sum ? val.sum : 0)
969
- })
970
- })
971
- let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
972
- return item.length > 0 ? item.reduce((a, b) => {
973
- return a + b
974
- }) : 0
975
- }) : 0
976
- let cycle = Math.max(...splitCycle)// 每个环的周期最大值
977
- this.fixCycle = cycle// 每个环的周期最大值
978
- let newRings = ringsequence.filter(item => item)
979
- let minLength = Math.min(...ringlength)
980
- let resultArrs = [] // 环1分组
981
- let resultArr = [] // 环2分组
982
- for (let j = 0; j < ringsequence[0].length; j += minLength) {
983
- resultArrs.push(ringsequence[0].slice(j, j + minLength))
984
- if (ringsequence[0].length === minLength) {
985
- resultArrs.push([])
986
- }
987
- }
988
- if (newRings.length > 1) {
989
- for (let i = 0; i < ringsequence[1].length; i += minLength) {
990
- resultArr.push(ringsequence[1].slice(i, i + minLength))
991
- }
992
- }
993
- this.patternInfo = []
994
- this.barrierList = []
995
- let currentArr = []
996
- let newPattern = []
997
- val.map(i => {
998
- newPattern.push(...i)
999
- })
1000
- if (this.phaseList.length === 0) return
1001
- for (let patternStatus of val[0]) {
1002
- // if (patternStatus.mode !== 7) {
1003
- let concurrent = this.phaseList.filter((item) => {
1004
- return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
1005
- })[0].concurrent// 当前相位的并发相位
1006
- if (concurrent) {
1007
- let obj = {
1008
- id: patternStatus.id,
1009
- current: concurrent.sort()
1010
- }
1011
- currentArr.push(obj)
1012
- }
1013
- // }
1014
- }
1015
- if (currentArr.length !== 0) {
1016
- let newCurrent = this.tranform(currentArr)
1017
- // 取没个环与环关系的并集
1018
- let barrierRing1 = []
1019
- let barrierRing2 = []
1020
- let ring1 = [] // 环1与关系1的并集
1021
- for (let h = 0; h < newCurrent.length; h++) {
1022
- let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
1023
- ring1.push(adds)
1024
- }
1025
- let ring1s = [] // 环1与关系2的并集
1026
- for (let h = 0; h < newCurrent.length; h++) {
1027
- let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
1028
- ring1s.push(addRing1)
1029
- }
1030
- barrierRing1.push(...ring1, ...ring1s)
1031
- let resultList = []
1032
- if (newRings.length > 1) {
1033
- let ring2s = [] // 环2与关系1的并集
1034
- for (let h = 0; h < newCurrent.length; h++) {
1035
- let addRing2 = [...new Set(resultArr[1])].filter(item => newCurrent[h].includes(item))
1036
- ring2s.push(addRing2)
1037
- }
1038
- let ring2 = [] // 环2与关系1的并集
1039
- for (let h = 0; h < newCurrent.length; h++) {
1040
- let add = [...new Set(resultArr[0])].filter(item => newCurrent[h].includes(item))
1041
- ring2.push(add)
1042
- }
1043
- barrierRing2.push(...ring2, ...ring2s)
1044
- for (let k = 0; k < barrierRing1.length; k++) {
1045
- resultList.push(barrierRing1[k].concat(barrierRing2[k]))
1046
- }
1047
- }
1048
- let resultLists = resultList.filter(item => item.length !== 0)
1049
- let ringArr = []
1050
- for (let l = 0; l < resultLists.length; l++) {
1051
- for (let d = 0; d < newCurrent.length; d++) {
1052
- if (newCurrent[d].filter(item => resultLists[l].includes(item)).length > 0) {
1053
- ringArr.push({
1054
- data: resultLists[l],
1055
- id: d + 1,
1056
- index: l
1057
- })
1058
- }
1059
- }
1060
- }
1061
- for (var i = 0; i < ringArr.length; i++) {
1062
- for (var j = i + 1; j < ringArr.length; j++) {
1063
- if (ringArr[i].id === ringArr[j].id && ringArr[i].index + 1 === ringArr[j].index) {
1064
- ringArr[i].data = ringArr[i].data.concat(ringArr[j].data)
1065
- ringArr.splice(ringArr.indexOf(ringArr[j].id), 1)
1066
- }
1067
- }
1068
- }
1069
- let resArr = ringArr.map(item => item.data)
1070
- let ringTeam = this.step1(this.phaseList, resArr)
1071
- let ringTeams = ringTeam.filter(item => item.length !== 0)
1072
- if (this.patternList) {
1073
- this.setBarrier(ringTeams, val)
1074
- }
1075
- if (newRings.length > 1) {
1076
- this.fillGap(ringTeams, val)
1077
- }
1078
- if (this.cycleChange) {
1079
- const globalParamModel = this.$store.getters.globalParamModel
1080
- let pattern = globalParamModel.getParamsByType('patternList')
1081
- const allCycle = pattern.map(item => item.cycle)
1082
- let cycle = Math.max(...allCycle)
1083
- this.max = cycle
1084
- } else {
1085
- this.max = ''
1086
- }
1087
- let barrier = this.step2(ringTeams, newPattern)
1088
- let barrierLeft = barrier.map(item => item)// 屏障左移显示出人行横道
1089
- this.barrierList = barrierLeft.map(j => {
1090
- return (j / (this.max ? this.max : cycle) * 100) + '%'
1091
- })
1092
- // this.barrierList.unshift(0)
1093
- }
1094
- for (let rings of val) {
1095
- if (rings.length === 0) continue
1096
- let list = []
1097
- for (let ring of rings) {
1098
- if (ring.value === 0) continue
1099
- let obj = {}
1100
- let split = ring.value
1101
- obj.id = ring.id
1102
- // obj.split = split
1103
- let currPhase = this.phaseList.filter((item) => {
1104
- if (item.id === ring.id && item.controltype === 99) {
1105
- obj.controltype = item.controltype
1106
- }
1107
- return item.id === ring.id
1108
- })[0]
1109
- if (!currPhase) return
1110
- let peddirections = []
1111
- for (let walk of this.sidewalkPhaseData) {
1112
- if (currPhase.peddirection) {
1113
- for (let ped of currPhase.peddirection) {
1114
- // if (stg === walk.phaseid) {
1115
- let objs = {}
1116
- objs.name = walk.name
1117
- objs.id = walk.id
1118
- objs.color = 'rgba(48,49,51,0.6)'
1119
- if (ped === walk.id) {
1120
- peddirections.push(objs)
1121
- peddirections = Array.from(new Set(peddirections))
1122
- }
1123
- // }
1124
- }
1125
- } else {
1126
- peddirections = []
1127
- }
1128
- }
1129
- if (ring.desc && ring.desc.length > 0) {
1130
- obj.direction = ring.desc.map(item => { // 虚相位desc为空
1131
- return {
1132
- id: item.id,
1133
- color: '#303133',
1134
- peddirection: peddirections
1135
- }
1136
- })
1137
- } else {
1138
- if (currPhase.direction && currPhase.direction.length > 0) {
1139
- obj.direction = currPhase.direction.map(item => {
1140
- return {
1141
- id: item,
1142
- color: '#303133',
1143
- peddirection: peddirections
1144
- }
1145
- })
1146
- } else {
1147
- obj.direction = [
1148
- {
1149
- id: '',
1150
- color: '#303133',
1151
- peddirection: peddirections
1152
- }
1153
- ]
1154
- }
1155
- }
1156
- obj.split = split
1157
- obj.cycle = cycle
1158
- if (ring.sum) {
1159
- obj.sum = ring.sum
1160
- obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100) + '%'
1161
- } else {
1162
- obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100) + '%'
1163
- }
1164
- obj.mode = ring.mode
1165
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100) + '%'
1166
- obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100) + '%'
1167
- obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100) + '%'
1168
- // 忽略相位不显示
1169
- // let mode = ring.mode
1170
- // if (mode !== 7) { // 忽略相位不显示
1171
- list.push(obj)
1172
- // }
1173
- }
1174
- this.patternInfo.push(list)
1175
- }
1176
- },
1177
- setBarrier (ringTeam, val) { // 添加特征参数barrier
1178
- this.patternList.map(item => {
1179
- if (item.id === this.patternIds) {
1180
- const patternObjs = {}
1181
- val.forEach(l => {
1182
- l.map(k => {
1183
- patternObjs[k.id] = k.value
1184
- })
1185
- })
1186
- let ret = ringTeam.map((y, index) => {
1187
- if (!y || y.length === 0) return
1188
- y.map(n => {
1189
- n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
1190
- })
1191
- return {
1192
- barrier: index + 1,
1193
- length: y[0].length,
1194
- items: y.map(j => {
1195
- return {
1196
- ring: j.ring,
1197
- data: j.data
1198
- }
1199
- })
1200
- }
1201
- })
1202
- item.barriers = ret
1203
- }
1204
- })
1205
- },
1206
- tranform (arr) { // 分barrier
1207
- let newMap = new Map()
1208
- arr.forEach(({id, current}) => {
1209
- const find = newMap.get(current.join())
1210
- if (find) newMap.get(current.join()).push(id)
1211
- else newMap.set(current.join(), [id])
1212
- })
1213
- let ret = []
1214
- newMap.forEach((value, key) => {
1215
- ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
1216
- })
1217
- const result = []
1218
- for (const a of ret) {
1219
- let merged = false
1220
- for (const r of result) {
1221
- if (this.check([...r], a)) {
1222
- a.forEach(item => r.add(item))
1223
- merged = true
1224
- }
1225
- }
1226
- if (!merged) {
1227
- result.push(new Set(a))
1228
- }
1229
- merged = false
1230
- }
1231
- return result.map(s => [...s])
1232
- },
1233
- check (arr1, arr2) {
1234
- return arr1.some(a1 => arr2.some(a2 => a1 === a2))
1235
- },
1236
- step1 (list, arr) { // 各个环包含的相位
1237
- const ret = []
1238
- const listObj = {}
1239
- list.forEach(l => {
1240
- listObj[l.id] = l.ring
1241
- })
1242
- arr.forEach(a => {
1243
- const retItem = []
1244
- a.forEach(b => {
1245
- if (listObj[b]) {
1246
- const find = retItem.find(r => r.ring === listObj[b])
1247
- if (find) find.data.push(b)
1248
- else retItem.push({ring: listObj[b], data: [b]})
1249
- }
1250
- })
1251
- ret.push(retItem)
1252
- })
1253
- return ret
1254
- },
1255
- step2 (newArr, pattern) { // 不同环并发相位做比较
1256
- let ret = []
1257
- let max = 0
1258
- const patternObj = {}
1259
- pattern.forEach(l => {
1260
- // if (l.mode !== 7) {
1261
- patternObj[l.id] = l.value
1262
- // }
1263
- })
1264
- let barrierCycle = newArr.map(item => {
1265
- return Math.max.apply(Math, item.map(k => { return k.length }))
1266
- })
1267
- barrierCycle.forEach((b, index) => {
1268
- if (index === 0) {
1269
- ret.push(barrierCycle[index])
1270
- } else {
1271
- if (max) {
1272
- max = barrierCycle[index] + max
1273
- } else {
1274
- max = barrierCycle[index] + barrierCycle[index - 1]
1275
- }
1276
- ret.push(max)
1277
- }
1278
- })
1279
- return ret
1280
- },
1281
- fillGap (newArr, pattern) {
1282
- this.newPatterns = []
1283
- const patternObj = {}
1284
- pattern.forEach(l => {
1285
- l.map(k => {
1286
- // if (k.mode !== 7) {
1287
- patternObj[k.id] = k.value
1288
- // }
1289
- })
1290
- })
1291
- let newMax = []
1292
- let newMin = []
1293
- newArr.forEach((na, index) => {
1294
- if (!na || na.length === 0) return
1295
- na.map(n => {
1296
- n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObj[cur], 0) : patternObj[n.data[0]]
1297
- })
1298
- let maxNum = Math.max.apply(Math, na.map(item => { return item.length }))
1299
- let minNum = Math.min.apply(Math, na.map(item => { return item.length }))
1300
- newMax.push(maxNum)
1301
- newMin.push(minNum)
1302
- let newmaxNum = Math.max.apply(Math, newMax)// 每组最大值
1303
- let newminNum = Math.min.apply(Math, newMin)
1304
- this.newCycle = newmaxNum + newminNum
1305
- if (newmaxNum === newminNum) {
1306
- this.max = newmaxNum + newminNum
1307
- pattern.map(d => {
1308
- d.map(r => {
1309
- if (r.sum) {
1310
- delete r.sum
1311
- }
1312
- })
1313
- })
1314
- }
1315
- if (maxNum === minNum) {
1316
- na.map(n => {
1317
- pattern.map(h => {
1318
- h.map(d => {
1319
- if (d.id === n.data[1] && d.sum) {
1320
- delete d.sum
1321
- }
1322
- })
1323
- })
1324
- })
1325
- } else {
1326
- na.map(n => {
1327
- if (n.length === maxNum) {
1328
- pattern.map(h => {
1329
- h.map(d => {
1330
- if (n.data.length > 1) {
1331
- if (d.id === n.data[1]) {
1332
- delete d.sum
1333
- }
1334
- } else {
1335
- if (d.id === n.data[0]) {
1336
- delete d.sum
1337
- }
1338
- }
1339
- })
1340
- })
1341
- }
1342
- })
1343
- }
1344
- na.forEach((value, index, array) => {
1345
- if (value.length !== maxNum) {
1346
- let newNa = []
1347
- newNa.push(value)
1348
- newNa.forEach(m => {
1349
- let sum = Number(maxNum - m.length)
1350
- pattern.filter((i) => {
1351
- i.map(j => {
1352
- if (m.data.length > 1) {
1353
- if (j.id === m.data[1]) {
1354
- j.sum = sum
1355
- }
1356
- } else {
1357
- if (j.id === m.data[0]) {
1358
- j.sum = sum
1359
- }
1360
- }
1361
- })
1362
- })
1363
- })
1364
- }
1365
- let mapAdd = pattern.map(item => {
1366
- return item.map(val => {
1367
- return val.value + (val.sum ? val.sum : 0)
1368
- })
1369
- })
1370
- let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
1371
- return item.length > 0 ? item.reduce((a, b) => {
1372
- return a + b
1373
- }) : 0
1374
- }) : 0
1375
- this.max = Math.max(...maxCycle)// 每个环的周期最大值
1376
- })
1377
- })
1378
- }
1379
- }
1380
- }
1381
- </script>
1382
- <style lang="scss">
1383
- // el-tooltip样式
1384
- .el-tooltip__popper.is-light {
1385
- background: #299BCC !important;
1386
- border: 1px solid #299BCC !important;
1387
- color: #FFFFFF !important;
1388
- }
1389
- .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow {
1390
- border-top-color: #299BCC !important;
1391
- }
1392
- .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow::after {
1393
- border-top-color: #299BCC !important;
1394
- }
1395
- </style>
1396
- <style lang="scss" scoped>
1397
- .main-patternstatus {
1398
- position: relative;
1399
- /* margin-bottom: 20px; */
1400
- }
1401
- .main-patternstatus {
1402
- position: relative;
1403
- .ring-first {
1404
- margin-top: 1px;
1405
- width: 100%;
1406
- height: 34px;
1407
- }
1408
- .first-1 {
1409
- float: left;
1410
- // text-align: center;
1411
- }
1412
- // .ring-num {
1413
- // float: left;
1414
- // margin-top:7px;
1415
- // margin-left: 5px;
1416
- // font-size: 14px;
1417
- // font-weight: normal;
1418
- // font-stretch: normal;
1419
- // line-height: 22px;
1420
- // letter-spacing: 0px;
1421
- // color: #ffffff;
1422
- // }
1423
- .box {
1424
- text-align: center;
1425
- // float: left;
1426
- // margin-left: 6px;
1427
- // margin-right: 10px;
1428
- }
1429
- .ring-nums {
1430
- // float: left;
1431
- // margin-top:7px;
1432
- // margin-left: 5px;
1433
- font-size: 12px;
1434
- height: 14px;
1435
- font-weight: normal;
1436
- font-stretch: normal;
1437
- // line-height: 22px;
1438
- letter-spacing: 0px;
1439
- color: #333333;
1440
- }
1441
- .ring-phase {
1442
- position: relative;
1443
- float: left;
1444
- // margin-left: 5px;
1445
- height: 34px;
1446
- width: 36px;
1447
- z-index: 999;
1448
- background: rgba(30, 96, 12, 0.2);
1449
- // margin-top:1px;
1450
- }
1451
- .ring-phase::after {
1452
- position: absolute;
1453
- display: block;
1454
- content: '';
1455
- height: 0;
1456
- width: 0;
1457
- top: 11px;
1458
- left: 36px;
1459
- border: 5px solid transparent;
1460
- border-left-color: rgba(30, 96, 12, 0.2);
1461
- }
1462
- // .divider {
1463
- // position: absolute;
1464
- // top: -10px;
1465
- // // left: 370px;
1466
- // width: 2px;
1467
- // // height: 99px;
1468
- // z-index: 999;
1469
- // background-color:#B9BABF;
1470
- // }
1471
- // .curTimeLine {
1472
- // position: absolute;
1473
- // top: -10px;
1474
- // width: 4px;
1475
- // background-color: black;
1476
- // }
1477
- // .curTimeDiv {
1478
- // position: absolute;
1479
- // z-index:50;
1480
- // top: -21px;
1481
- // margin-left: -10px;
1482
- // text-align:center;
1483
- // vertical-align: middle;
1484
- // width: 60px;
1485
- // height: 19px;
1486
- // color:black;
1487
- // // background-color: black;
1488
- // }
1489
- }
1490
- .ring-first {
1491
- margin-top: 1px;
1492
- width: 100%;
1493
- height: 34px;
1494
- }
1495
- .direction {
1496
- filter: brightness(70%);
1497
- }
1498
- .mask {
1499
- background: rgb(242, 121, 121) !important;
1500
- }
1501
- .yellowClass {
1502
- background: #f9dc6a !important;
1503
- }
1504
- .first-1 {
1505
- float: left;
1506
- // text-align: center;
1507
- }
1508
- </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="main-patternstatus">
14
+ <!-- 环模式true -->
15
+ <div v-if="this.contrloType === 'ring' || !this.contrloType">
16
+ <div class="ring-first" v-for="(list, index1) in patternInfo" :key="index1">
17
+ <div style="position: relative;" :style="{'height': '34px','float':'left','width':((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%'}" v-for="(item,index2) in list" :key="index2" :class="item.mode===7?'direction': ''">
18
+ <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.greenWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%').replace('%', ''))*100+'%','height':'34px','background':'#7ccc66'}">
19
+ <el-tooltip placement="top-start" effect="light">
20
+ <div slot="content">{{$t('openatccomponents.phase.phase')}}{{item.id}}:{{item.split}}</div>
21
+ <div style="cursor:pointer;">
22
+ <div class="ring-phase">
23
+ <!-- <patternwalksvg :showWalk="item.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg> -->
24
+ <xdrdirselector Width="60px" Height="60px" Widths="50px" Heights="50px" :showlist="item.direction"></xdrdirselector>
25
+ </div>
26
+ <div class="box" style="position: absolute; left:40px; width:40px; top: -1px;">
27
+ <div class="ring-nums">{{$t('openatccomponents.phase.phase')}}{{item.id}}</div>
28
+ <div class="ring-nums">{{item.split}}</div>
29
+ </div>
30
+ </div>
31
+ </el-tooltip>
32
+ <div style="width:50px;" v-for="(bus,index3) in busPhaseData" :key="index3">
33
+ <i class="iconfont icon-lukouzhilu" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 1 && bus.phaseid===item.id"></i>
34
+ <i class="iconfont icon-BRT" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 4 && bus.phaseid===item.id"></i>
35
+ <i class="iconfont icon-xuxiangwei-xin" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 99 && bus.phaseid===item.id"></i>
36
+ <i class="iconfont icon-feijidongche" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 6 && bus.phaseid===item.id"></i>
37
+ <i class="iconfont icon-gongjiaoche" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 3 && bus.phaseid===item.id"></i>
38
+ <i class="iconfont icon-youguidianche" style="position: absolute;top: 8px;left:70px;font-size:12px;color:#454545;" v-if="bus.controltype === 5 && bus.phaseid===item.id"></i>
39
+ </div>
40
+ </div>
41
+ <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.flashgreen.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','float':'left','background': 'linear-gradient(to right, #ffffff 50%, #7ccc66 0)','background-size': '4px 100%'}"></div>
42
+ <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.yellowWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100) + '%').replace('%', ''))*100+'%','height':'34px','background':'#f9dc6a'}"></div>
43
+ <div class="first-1" :class="item.mode === 8 ? 'mask' : item.mode === 9 ? 'yellowClass' : ''" :style="{'width':Number(item.redWidth.replace('%', ''))/Number((((item.split+(item.sum?item.sum:0)) / (max?max:item.cycle) * 100).toFixed(3) + '%').replace('%', ''))*100+'%','height':'34px','background':'#f27979'}"></div>
44
+ </div>
45
+ </div>
46
+ <div v-if="showBarrier">
47
+ <div v-for="(item, index) in barrierList" :key="index + '1'">
48
+ <div class="divider" :style="{'left':item, 'height':barrierHeight}"></div>
49
+ </div>
50
+ </div>
51
+ <div v-show="(this.controlData && this.controlData.curTime && cycle && cycle>0 && this.isControl) || (this.controlData && newCycle && newCycle>0 && this.isControl)">
52
+ <div class="curTimeDiv" :style="{'left':paddingLeft }">{{ timeNumDevide }}</div>
53
+ <div class="curTimeLine" :style="{'left':paddingLeft, 'height':barrierHeight}"></div>
54
+ </div>
55
+ </div>
56
+ <div v-if="this.contrloType === 'stage'" class="ring-first">
57
+ <div v-for="(list, index1) in stageLists" :key="index1">
58
+ <!-- <div> -->
59
+ <div class="first-1" :style="{'width':list.greenWidth,'height':'34px','position':'relative','background':'#7ccc66'}">
60
+ <el-tooltip placement="top-start" effect="light">
61
+ <div slot="content">
62
+ <span class="ring-nums" v-for="(pha,index) in list.phases" :key="index">
63
+ {{$t('openatccomponents.phase.phase')}}{{pha}}
64
+ </span>
65
+ </div>
66
+ <div style="cursor:pointer;">
67
+ <div class="ring-phase">
68
+ <!-- <patternwalksvg :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg> -->
69
+ <xdrdirselector v-if="list.direction&&list.direction.length>0" Width="60px" Height="60px" Widths="50px" Heights="50px" :showlist="list.direction"></xdrdirselector>
70
+ </div>
71
+ <div class="box" style="position: absolute; left:41px; width:40px; top:-1px;">
72
+ <div class="ring-nums">{{$t('openatccomponents.phase.stage')}}{{list.key+1}}</div>
73
+ <div class="ring-nums">{{list.stageSplit}}</div>
74
+ </div>
75
+ <!-- <div class="box" style="line-height:28px">
76
+ <span class="ring-nums" v-for="(pha,index) in list.phases" :key="index">
77
+ P:{{pha}}
78
+ </span>
79
+ </div> -->
80
+ </div>
81
+ </el-tooltip>
82
+ </div>
83
+ <!-- <div class="first-1" :style="{'width':item.flashgreen,'height':'34px','float':'left','background': 'linear-gradient(to right, #ffffff 50%, #7ccc66 0)','background-size': '4px 100%'}"></div> -->
84
+ <div class="first-1" :style="{'width':list.yellowWidth,'height':'34px','background':'#f9dc6a'}"></div>
85
+ <div class="first-1" :style="{'width':list.redWidth,'height':'34px','background':'#f27979'}"></div>
86
+ </div>
87
+ <div v-if="this.controlData && this.controlData.curTime">
88
+ <div class="curTimeDiv" :style="{ left: paddingLefts }">
89
+ {{ timeNumDevides }}
90
+ </div>
91
+ <div
92
+ class="curTimeLine"
93
+ :style="{ left: paddingLefts, height: '56px' }"
94
+ ></div>
95
+ </div>
96
+ </div>
97
+ <!-- </div> -->
98
+ </div>
99
+ </template>
100
+ <script>
101
+ // import patternwalksvg from '../PatternWalkSvg/PatternWalkSvg'
102
+ import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
103
+ // import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
104
+ import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
105
+ import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
106
+ export default {
107
+ name: 'pattern-list',
108
+ components: {
109
+ // patternwalksvg,
110
+ xdrdirselector
111
+ },
112
+ data () {
113
+ return {
114
+ barrierHeight: '',
115
+ stageCycle: '',
116
+ barrierList: [],
117
+ newCycle: this.cycles,
118
+ patternIds: this.patternId,
119
+ newPatterns: [],
120
+ newList: [],
121
+ isControl: true,
122
+ contrloCycle: 0,
123
+ sidewalkPhaseData: [],
124
+ // controlDatas: this.controlData,
125
+ max: '',
126
+ fixCycle: '',
127
+ curtime: 0,
128
+ stageLists: [],
129
+ busPhaseData: [], // 公交相位数据
130
+ patternInfo: []
131
+ }
132
+ },
133
+ props: {
134
+ cycleChange: {
135
+ type: Boolean,
136
+ default: true
137
+ },
138
+ stagesChange: {
139
+ type: Array
140
+ },
141
+ controlPhase: {
142
+ type: Object
143
+ },
144
+ contrloType: {
145
+ type: String
146
+ },
147
+ phaseList: {
148
+ type: Array
149
+ },
150
+ patternList: {
151
+ type: Array
152
+ },
153
+ showBarrier: {
154
+ type: Boolean,
155
+ default: false
156
+ },
157
+ allPatternList: {
158
+ type: Array
159
+ },
160
+ localPatternList: {
161
+ type: Array
162
+ },
163
+ controlData: {
164
+ type: Object
165
+ },
166
+ showCondition: {
167
+ type: Boolean,
168
+ default: false
169
+ },
170
+ cycle: {
171
+ type: Number
172
+ },
173
+ agentId: {
174
+ type: String
175
+ },
176
+ cycles: {
177
+ type: Number
178
+ },
179
+ patternId: {
180
+ type: Number
181
+ },
182
+ patternStatusList: {
183
+ type: Array
184
+ },
185
+ syncTime: {
186
+ type: Number
187
+ }
188
+ },
189
+ computed: {
190
+ paddingLefts () {
191
+ let res = '0%'
192
+ let curPercent = this.curtime / this.stageCycle
193
+ if (curPercent >= 1) {
194
+ curPercent = 1
195
+ }
196
+ res = curPercent * 100 + '%'
197
+ return res
198
+ },
199
+ timeNumDevides () {
200
+ let res = this.curtime
201
+ return res
202
+ },
203
+ paddingLeft () {
204
+ let res = '0%'
205
+ if (this.contrloCycle > 0) {
206
+ let curPercent = this.curtime / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
207
+ if (curPercent >= 1) {
208
+ curPercent = 1
209
+ }
210
+ res = curPercent * 100 + '%'
211
+ }
212
+ if (this.cycles > 0) {
213
+ let curPercent = this.curtime / (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
214
+ if (curPercent >= 1) {
215
+ curPercent = 1
216
+ }
217
+ res = curPercent * 100 + '%'
218
+ }
219
+ return res
220
+ },
221
+ timeNumDevide () {
222
+ if (this.contrloCycle > 0) {
223
+ // let res = (this.contrloCycle - this.syncTime) + '/' + this.contrloCycle
224
+ // let res = this.curtime + '/' + (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
225
+ let res = this.curtime
226
+ return res
227
+ }
228
+ if (this.cycles > 0) {
229
+ // let res = (this.cycles - this.syncTime) + '/' + this.cycles
230
+ // let res = this.curtime + '/' + (this.fixCycle ? this.fixCycle : this.max ? this.max : this.contrloCycle)
231
+ let res = this.curtime
232
+ return res
233
+ }
234
+ }
235
+ },
236
+ watch: {
237
+ controlPhase: {
238
+ handler: function (val, oldVal) {
239
+ if ((val && val.curTime) || val.curTime === 0) {
240
+ this.curtime = val.curTime
241
+ if (val.control === 4 || val.control === 16 || val.control === 22) {
242
+ this.isControl = false
243
+ } else {
244
+ this.isControl = true
245
+ }
246
+ }
247
+ },
248
+ // 深度观察监听
249
+ deep: true
250
+ },
251
+ controlData: {
252
+ handler: function (val, oldVal) {
253
+ if (this.contrloType === 'stage') {
254
+ this.getIndexStage()
255
+ }
256
+ // this.controlDatas = this.controlData
257
+ this.getPedPhasePos()
258
+ if (this.localPatternList) {
259
+ this.max = ''
260
+ let idPattern = this.localPatternList.filter(item => item.id === this.controlData.patternid)
261
+ if (idPattern.length === 0 || (this.controlData && this.showCondition)) {
262
+ this.handleTentivePatternData()
263
+ } else {
264
+ this.handlePatternData()
265
+ }
266
+ this.handleBarrierHeight()
267
+ }
268
+ if ((val && val.curTime) || val.curTime === 0) {
269
+ this.curtime = val.curTime
270
+ if (val.control === 4 || val.control === 16 || val.control === 22) {
271
+ this.isControl = false
272
+ } else {
273
+ this.isControl = true
274
+ }
275
+ }
276
+ },
277
+ // 深度观察监听
278
+ deep: true
279
+ },
280
+ cycleChange: {
281
+ handler: function (val, oldVal) {
282
+ this.getStage()
283
+ this.handleCurrentChange(this.patternStatusList)
284
+ this.handleBarrierHeight()
285
+ },
286
+ // 深度观察监听
287
+ deep: true
288
+ },
289
+ phaseList: {
290
+ handler: function (val, oldVal) {
291
+ this.getPedPhasePos()
292
+ this.getBusPos()
293
+ this.getStage()
294
+ // this.handlePatternData()
295
+ },
296
+ // 深度观察监听
297
+ deep: true
298
+ },
299
+ agentId: {
300
+ handler: function (val, oldVal) {
301
+ this.getBusPos()
302
+ },
303
+ // 深度观察监听
304
+ deep: true
305
+ },
306
+ patternId: {
307
+ handler: function (val, oldVal) {
308
+ this.patternIds = this.patternId
309
+ },
310
+ // 深度观察监听
311
+ deep: true
312
+ },
313
+ cycles: {
314
+ handler: function (val, oldVal) {
315
+ this.newCycle = this.cycles
316
+ },
317
+ // 深度观察监听
318
+ deep: true
319
+ },
320
+ contrloType: {
321
+ handler: function (val, oldVal) {
322
+ if (this.contrloType === 'stage') {
323
+ this.getStage()
324
+ }
325
+ },
326
+ // 深度观察监听
327
+ deep: true
328
+ },
329
+ stagesChange: {
330
+ handler: function (val, oldVal) {
331
+ if (this.contrloType === 'stage') {
332
+ this.getStage()
333
+ }
334
+ },
335
+ // 深度观察监听
336
+ deep: true
337
+ },
338
+ patternStatusList: {
339
+ handler: function (val, oldVal) {
340
+ this.handleBarrierHeight() // 计算屏障高度
341
+ if (this.patternStatusList && this.newCycle) {
342
+ setTimeout(() => {
343
+ this.handleCurrentChange(this.patternStatusList)
344
+ this.handleBarrierHeight()
345
+ }, 10)
346
+ this.handleBarrierHeight()
347
+ }
348
+ },
349
+ // 深度观察监听
350
+ deep: true
351
+ }
352
+ },
353
+ created () {
354
+ this.globalParamModel = this.$store.getters.globalParamModel
355
+ if (this.patternStatusList && this.newCycle && !this.controlData) {
356
+ setTimeout(() => {
357
+ this.handleCurrentChange(this.patternStatusList)
358
+ this.handleBarrierHeight()
359
+ }, 400)
360
+ } else if ((this.controlData && this.controlData.patternid === 109) || (this.controlData && this.showCondition) || (this.controlData && this.localPatternList.length === 0)) {
361
+ this.handleTentivePatternData()
362
+ } else {
363
+ this.handlePatternData()
364
+ }
365
+ this.PhaseDataModel = new PhaseDataModel()
366
+ this.CrossDiagramMgr = new CrossDiagramMgr()
367
+ this.getPedPhasePos()
368
+ this.getBusPos()
369
+ if (this.contrloType === 'stage') {
370
+ this.getStage()
371
+ }
372
+ },
373
+ methods: {
374
+ getPed (data) {
375
+ let ped = []
376
+ for (let stg of data) {
377
+ let peddirections = []
378
+ let currPhase = this.phaseList.filter((item) => {
379
+ return item.id === stg
380
+ })[0]
381
+ if (!currPhase) return
382
+ if (!currPhase.peddirection) return
383
+ for (let walk of this.sidewalkPhaseData) {
384
+ for (let ped of currPhase.peddirection) {
385
+ if (stg === walk.phaseid) {
386
+ let obj = {}
387
+ obj.name = walk.name
388
+ obj.id = walk.id
389
+ if (ped === walk.id) {
390
+ peddirections.push(obj)
391
+ peddirections = Array.from(new Set(peddirections))
392
+ }
393
+ }
394
+ }
395
+ }
396
+ ped.push(...peddirections)
397
+ }
398
+ return ped
399
+ },
400
+ handleStageData (data) {
401
+ if (!data) return
402
+ let peddirections = this.getPed(data)
403
+ let stagesTemp = []
404
+ let tempList = []
405
+ for (let stg of data) {
406
+ let directionList = []
407
+ let currPhase = this.phaseList.filter((item) => {
408
+ return item.id === stg
409
+ })[0]
410
+ if (currPhase !== undefined) {
411
+ directionList.push(...currPhase.direction)
412
+ directionList = Array.from(new Set(directionList))
413
+ }
414
+ if (directionList.length === 0) {
415
+ tempList.push({
416
+ id: '',
417
+ color: '#454545',
418
+ peddirection: peddirections
419
+ })
420
+ } else {
421
+ tempList = directionList.map(dir => ({
422
+ id: dir,
423
+ color: '#454545',
424
+ peddirection: peddirections
425
+ }))
426
+ }
427
+ let newTemp = tempList.filter(item => item.id !== '')
428
+ stagesTemp.push(...newTemp)
429
+ }
430
+ return stagesTemp
431
+ },
432
+ getIndexStage () {
433
+ if (this.localPatternList.length === 0) return
434
+ for (let i = 0; i < this.localPatternList.length; i++) {
435
+ if (this.controlData.patternid === this.localPatternList[i].id) {
436
+ if (!this.localPatternList[i].stagesList) return
437
+ let stageCycleList = this.localPatternList[i].stagesList.map(item => {
438
+ return item.stageSplit ? item.stageSplit : 0
439
+ })
440
+ let stageMaxCyle = stageCycleList.reduce((a, b) => {
441
+ return a + b
442
+ }, 0)
443
+ this.stageCycle = stageMaxCyle
444
+ this.stageLists = this.localPatternList[i].stagesList.map(item => {
445
+ return {
446
+ ...item,
447
+ // peddirection: this.getPed(item.phases ? item.phases : item.stages),
448
+ direction: this.handleStageData(item.phases ? item.phases : item.stages),
449
+ greenWidth: (item.green / stageMaxCyle * 100).toFixed(3) + '%',
450
+ yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
451
+ redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
452
+ }
453
+ })
454
+ }
455
+ }
456
+ },
457
+ getStage () {
458
+ if (!this.stagesChange) return
459
+ const globalParamModel = this.$store.getters.globalParamModel
460
+ let pattern = this.allPatternList ? this.allPatternList : globalParamModel.getParamsByType('patternList')
461
+ let mapAdd = pattern.map(item => item.stagesList).map(item => {
462
+ return item.map(val => {
463
+ return val.stageSplit ? val.stageSplit : val.split
464
+ })
465
+ })
466
+ let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
467
+ return item.length > 0 ? item.reduce((a, b) => {
468
+ return a + b
469
+ }) : 0
470
+ }) : 0
471
+ let stageMaxCyle = Math.max(...maxCycle)// 每个环的周期最大值
472
+ if (!this.cycleChange) {
473
+ let stageCycleList = this.stagesChange.map(item => {
474
+ return item.stageSplit ? item.stageSplit : 0
475
+ })
476
+ stageMaxCyle = stageCycleList.reduce((a, b) => {
477
+ return a + b
478
+ }, 0)
479
+ }
480
+ this.stageLists = this.stagesChange.map(item => {
481
+ return {
482
+ ...item,
483
+ // peddirection: this.getPed(item.phases ? item.phases : item.stages),
484
+ direction: this.handleStageData(item.phases ? item.phases : item.stages),
485
+ greenWidth: ((item.stageSplit - item.yellow - item.red) / stageMaxCyle * 100).toFixed(3) + '%',
486
+ yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
487
+ redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
488
+ }
489
+ })
490
+ },
491
+ getBusPos () {
492
+ // 公交相位信息
493
+ this.busPhaseData = []
494
+ this.phaseList.forEach((ele, i) => {
495
+ // if (ele.controltype >= 3 && ele.controltype <= 5) {
496
+ // ele.direction.forEach((dir, index) => {
497
+ // 车道相位
498
+ this.busPhaseData.push({
499
+ phaseid: ele.id, // 相位did,用于对应相位状态
500
+ // id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
501
+ // name: this.PhaseDataModel.getBusPhasePos(dir).name,
502
+ controltype: ele.controltype
503
+ })
504
+ // })
505
+ // }
506
+ })
507
+ let result = []
508
+ let obj = {}
509
+ for (var i = 0; i < this.busPhaseData.length; i++) {
510
+ if (!obj[this.busPhaseData[i].phaseid]) {
511
+ result.push(this.busPhaseData[i])
512
+ obj[this.busPhaseData[i].phaseid] = true
513
+ }
514
+ }
515
+ this.busPhaseData = result
516
+ },
517
+ getPedPhasePos () {
518
+ // 行人相位信息
519
+ this.sidewalkPhaseData = []
520
+ this.phaseList.forEach((ele, i) => {
521
+ if (ele.peddirection) {
522
+ ele.peddirection.forEach((dir, index) => {
523
+ // 行人相位
524
+ if (this.PhaseDataModel.getSidePos(dir)) {
525
+ this.sidewalkPhaseData.push({
526
+ key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
527
+ phaseid: ele.id, // 相位id,用于对应相位状态
528
+ id: dir,
529
+ name: this.PhaseDataModel.getSidePos(dir).name
530
+ })
531
+ }
532
+ })
533
+ }
534
+ })
535
+ },
536
+ handleTentivePatternData () {
537
+ if (!this.controlData) return
538
+ this.newList = []
539
+ if (Object.keys(this.controlData).length === 0 || this.phaseList.length === 0) return
540
+ if (!this.controlData.phase) return
541
+ // let cycle = this.controlData.cycle
542
+ if (!this.controlData.rings) return
543
+ let newValue = []
544
+ for (let rings of this.controlData.rings) {
545
+ let phase = this.controlData.phase
546
+ // let list = []
547
+ let obj = {}
548
+ for (let key in rings.sequence) {
549
+ obj[key] = rings.sequence[key]
550
+ }
551
+ let newObj = Object.keys(obj).map(val => ({
552
+ id: obj[val]
553
+ }))
554
+ newValue.push(newObj)
555
+ for (let sequ of rings.sequence) {
556
+ let obj = {}
557
+ obj.id = sequ
558
+ let split = phase.filter((item) => {
559
+ return item.id === sequ
560
+ })[0].split
561
+ newValue.map(d => {
562
+ d.map(r => {
563
+ if (r.id === sequ) {
564
+ r.value = split
565
+ }
566
+ })
567
+ })
568
+ }
569
+ }
570
+ this.handleTentative(newValue)
571
+ },
572
+ handleTentative (val) {
573
+ if (val === null || val.length === 0) return
574
+ // 周期以实际的绿信比来计算
575
+ let valSplit = val.map(item => {
576
+ return item.map(val => {
577
+ return val.value + (val.sum ? val.sum : 0)
578
+ })
579
+ })
580
+ let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
581
+ return item.length > 0 ? item.reduce((a, b) => {
582
+ return a + b
583
+ }) : 0
584
+ }) : 0
585
+ let cycle = Math.max(...splitCycle)// 每个环的周期最大值
586
+ this.contrloCycle = cycle
587
+ this.patternInfo = []
588
+ let currentArr = []
589
+ let newPattern = []
590
+ val.map(i => {
591
+ newPattern.push(...i)
592
+ })
593
+ if (this.phaseList.length === 0) return
594
+ for (let patternStatus of val[0]) {
595
+ // if (patternStatus.mode !== 7) {
596
+ let concurrent = this.phaseList.filter((item) => {
597
+ return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
598
+ })[0].concurrent// 当前相位的并发相位
599
+ if (concurrent) {
600
+ let obj = {
601
+ id: patternStatus.id,
602
+ current: concurrent.sort()
603
+ }
604
+ currentArr.push(obj)
605
+ }
606
+ // }
607
+ }
608
+ if (currentArr.length !== 0) {
609
+ let newCurrent = this.tranform(currentArr)
610
+ let ringTeam = this.step1(this.phaseList, newCurrent)
611
+ this.fillGap(ringTeam, val)
612
+ }
613
+ // let cycle = this.controlData.cycle
614
+ for (let rings of val) {
615
+ if (rings.length === 0) continue
616
+ let list = []
617
+ for (let ring of rings) {
618
+ if (ring.value === 0) continue
619
+ let obj = {}
620
+ let split = ring.value
621
+ obj.id = ring.id
622
+ // obj.split = split
623
+ let currPhase = this.phaseList.filter((item) => {
624
+ if (item.id === ring.id && item.controltype === 99) {
625
+ obj.controltype = item.controltype
626
+ }
627
+ return item.id === ring.id
628
+ })[0]
629
+ if (!currPhase) return
630
+ let peddirections = []
631
+ for (let walk of this.sidewalkPhaseData) {
632
+ if (currPhase.peddirection) {
633
+ for (let ped of currPhase.peddirection) {
634
+ // if (stg === walk.phaseid) {
635
+ let objs = {}
636
+ objs.name = walk.name
637
+ objs.color = 'rgba(48,49,51,0.6)'
638
+ objs.id = walk.id
639
+ if (ped === walk.id) {
640
+ peddirections.push(objs)
641
+ peddirections = Array.from(new Set(peddirections))
642
+ }
643
+ // }
644
+ }
645
+ } else {
646
+ peddirections = []
647
+ }
648
+ }
649
+ if (ring.desc && ring.desc.length > 0) {
650
+ obj.direction = ring.desc.map(item => { // 虚相位desc为空
651
+ return {
652
+ id: item.id,
653
+ color: '#303133'
654
+ }
655
+ })
656
+ } else {
657
+ if (currPhase.direction && currPhase.direction.length > 0) {
658
+ obj.direction = currPhase.direction.map(item => {
659
+ return {
660
+ id: item,
661
+ peddirection: peddirections,
662
+ color: '#303133'
663
+ }
664
+ })
665
+ } else {
666
+ obj.direction = [
667
+ {
668
+ id: '',
669
+ color: '#303133',
670
+ peddirection: peddirections
671
+ }
672
+ ]
673
+ }
674
+ }
675
+ obj.split = split
676
+ obj.cycle = cycle
677
+ if (ring.sum) {
678
+ obj.sum = ring.sum
679
+ obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100) + '%'
680
+ } else {
681
+ obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100) + '%'
682
+ }
683
+ obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100) + '%'
684
+ obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100) + '%'
685
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100) + '%'
686
+ // 忽略相位不显示
687
+ // let mode = ring.mode
688
+ // if (mode !== 7) { // 忽略相位不显示
689
+ list.push(obj)
690
+ // }
691
+ }
692
+ this.patternInfo.push(list)
693
+ }
694
+ },
695
+ handlePatternData () {
696
+ if (!this.controlData) return
697
+ // this.newList = []
698
+ if (Object.keys(this.controlData).length === 0 || this.phaseList.length === 0) return
699
+ if (!this.controlData.phase) return
700
+ if (!this.controlData.rings) return
701
+ let nowPattern = this.localPatternList.filter(item => {
702
+ return item.id === this.controlData.patternid
703
+ })[0].rings
704
+ // 信号机忽略相位,更新最新的相位信息
705
+ let filterPattern = []
706
+ for (let i of nowPattern) {
707
+ for (let j of this.controlData.rings) {
708
+ let filterSequence = i.filter(item => j.sequence.includes(item.id))
709
+ if (filterSequence.length > 0) {
710
+ filterPattern.push(filterSequence)
711
+ }
712
+ }
713
+ }
714
+ for (let rings of this.controlData.rings) {
715
+ for (let sequ of rings.sequence) {
716
+ let split = this.controlData.phase.filter((item) => {
717
+ return item.id === sequ
718
+ })[0].split
719
+ filterPattern.map(d => {
720
+ return d.map(r => {
721
+ if (r.id === sequ) {
722
+ r.value = split
723
+ }
724
+ })
725
+ })
726
+ }
727
+ }
728
+ this.handleOverViewChange(filterPattern)
729
+ },
730
+ handleBarrierHeight () { // 屏障高度
731
+ if (!this.patternInfo) return
732
+ let patternLength = this.patternInfo.length
733
+ this.barrierHeight = (patternLength * 35 + 21) + 'px'
734
+ },
735
+ handleOverViewChange (val) {
736
+ if (val === null || val.length === 0) return
737
+ // 周期以实际的绿信比来计算
738
+ let valSplit = val.map(item => {
739
+ return item.map(val => {
740
+ return val.value + (val.sum ? val.sum : 0)
741
+ })
742
+ })
743
+ let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
744
+ return item.length > 0 ? item.reduce((a, b) => {
745
+ return a + b
746
+ }) : 0
747
+ }) : 0
748
+ let cycle = Math.max(...splitCycle)// 每个环的周期最大值
749
+ this.contrloCycle = cycle
750
+ // 按环序分组
751
+ let ringlength = []
752
+ let ringsequence = val.map(item => {
753
+ if (item.length === 0) return
754
+ ringlength.push(item.length)
755
+ return item.map(k => {
756
+ return k.id
757
+ })
758
+ })
759
+ let newRings = ringsequence.filter(item => item)
760
+ let minLength = Math.min(...ringlength)
761
+ let resultArrs = [] // 环1分组
762
+ let resultArr = [] // 环2分组
763
+ for (let j = 0; j < ringsequence[0].length; j += minLength) {
764
+ resultArrs.push(ringsequence[0].slice(j, j + minLength))
765
+ if (ringsequence[0].length === minLength) {
766
+ resultArrs.push([])
767
+ }
768
+ }
769
+ if (newRings.length > 1) {
770
+ for (let i = 0; i < ringsequence[1].length; i += minLength) {
771
+ resultArr.push(ringsequence[1].slice(i, i + minLength))
772
+ }
773
+ }
774
+ this.patternInfo = []
775
+ let currentArr = []
776
+ let newPattern = []
777
+ val.map(i => {
778
+ newPattern.push(...i)
779
+ })
780
+ if (this.phaseList.length === 0) return
781
+ for (let patternStatus of val[0]) {
782
+ // if (patternStatus.mode !== 7) {
783
+ let concurrent = this.phaseList.filter((item) => {
784
+ return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
785
+ })[0].concurrent// 当前相位的并发相位
786
+ if (concurrent) {
787
+ let obj = {
788
+ id: patternStatus.id,
789
+ current: concurrent.sort()
790
+ }
791
+ currentArr.push(obj)
792
+ }
793
+ // }
794
+ }
795
+ if (currentArr.length !== 0) {
796
+ let newCurrent = this.tranform(currentArr)
797
+ // 取没个环与环关系的并集
798
+ let barrierRing1 = []
799
+ let barrierRing2 = []
800
+ let ring1 = [] // 环1与关系1的并集
801
+ for (let h = 0; h < newCurrent.length; h++) {
802
+ let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
803
+ ring1.push(adds)
804
+ }
805
+ let ring1s = [] // 环1与关系2的并集
806
+ for (let h = 0; h < newCurrent.length; h++) {
807
+ let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
808
+ ring1s.push(addRing1)
809
+ }
810
+ barrierRing1.push(...ring1, ...ring1s)
811
+ let resultList = []
812
+ if (newRings.length > 1) {
813
+ let ring2s = [] // 环2与关系1的并集
814
+ for (let h = 0; h < newCurrent.length; h++) {
815
+ let addRing2 = [...new Set(resultArr[1])].filter(item => newCurrent[h].includes(item))
816
+ ring2s.push(addRing2)
817
+ }
818
+ let ring2 = [] // 环2与关系1的并集
819
+ for (let h = 0; h < newCurrent.length; h++) {
820
+ let add = [...new Set(resultArr[0])].filter(item => newCurrent[h].includes(item))
821
+ ring2.push(add)
822
+ }
823
+ barrierRing2.push(...ring2, ...ring2s)
824
+ for (let k = 0; k < barrierRing1.length; k++) {
825
+ resultList.push(barrierRing1[k].concat(barrierRing2[k]))
826
+ }
827
+ }
828
+ let resultLists = resultList.filter(item => item.length !== 0)
829
+ let ringArr = []
830
+ for (let l = 0; l < resultLists.length; l++) {
831
+ for (let d = 0; d < newCurrent.length; d++) {
832
+ if (newCurrent[d].filter(item => resultLists[l].includes(item)).length > 0) {
833
+ ringArr.push({
834
+ data: resultLists[l],
835
+ id: d + 1,
836
+ index: l
837
+ })
838
+ }
839
+ }
840
+ }
841
+ for (var i = 0; i < ringArr.length; i++) {
842
+ for (var j = i + 1; j < ringArr.length; j++) {
843
+ if (ringArr[i].id === ringArr[j].id && ringArr[i].index + 1 === ringArr[j].index) {
844
+ ringArr[i].data = ringArr[i].data.concat(ringArr[j].data)
845
+ ringArr.splice(ringArr.indexOf(ringArr[j].id), 1)
846
+ }
847
+ }
848
+ }
849
+ let resArr = ringArr.map(item => item.data)
850
+ let ringTeam = this.step1(this.phaseList, resArr)
851
+ let ringTeams = ringTeam.filter(item => item.length !== 0)
852
+ this.fillGap(ringTeams, val)
853
+ // 总览添加屏障
854
+ let newPattern = []
855
+ val.map(i => {
856
+ newPattern.push(...i)
857
+ })
858
+ let barrier = this.step2(ringTeams, newPattern)
859
+ let barrierLeft = barrier.map(item => item)
860
+ this.barrierList = barrierLeft.map(j => {
861
+ return (j / (this.max ? this.max : this.contrloCycle) * 100) + '%'
862
+ })
863
+ }
864
+ // let cycle = this.controlData.cycle
865
+ for (let rings of val) {
866
+ if (rings.length === 0) continue
867
+ let list = []
868
+ for (let ring of rings) {
869
+ if (ring.value === 0) continue
870
+ let obj = {}
871
+ let split = ring.value
872
+ obj.id = ring.id
873
+ obj.mode = ring.mode
874
+ // obj.split = split
875
+ let currPhase = this.phaseList.filter((item) => {
876
+ if (item.id === ring.id && item.controltype === 99) {
877
+ obj.controltype = item.controltype
878
+ }
879
+ return item.id === ring.id
880
+ })[0]
881
+ if (!currPhase) return
882
+ let peddirections = []
883
+ for (let walk of this.sidewalkPhaseData) {
884
+ if (currPhase.peddirection) {
885
+ for (let ped of currPhase.peddirection) {
886
+ // if (stg === walk.phaseid) {
887
+ let objs = {}
888
+ objs.name = walk.name
889
+ objs.id = walk.id
890
+ objs.color = 'rgba(48,49,51,0.6)'
891
+ if (ped === walk.id) {
892
+ peddirections.push(objs)
893
+ peddirections = Array.from(new Set(peddirections))
894
+ }
895
+ // }
896
+ }
897
+ } else {
898
+ peddirections = []
899
+ }
900
+ }
901
+ if (ring.desc && ring.desc.length > 0) {
902
+ obj.direction = ring.desc.map(item => { // 虚相位desc为空
903
+ return {
904
+ id: item.id,
905
+ color: '#303133'
906
+ }
907
+ })
908
+ } else {
909
+ if (currPhase.direction && currPhase.direction.length > 0) {
910
+ obj.direction = currPhase.direction.map(item => {
911
+ return {
912
+ id: item,
913
+ peddirection: peddirections,
914
+ color: '#303133'
915
+ }
916
+ })
917
+ } else {
918
+ obj.direction = [
919
+ {
920
+ id: '',
921
+ color: '#303133',
922
+ peddirection: peddirections
923
+ }
924
+ ]
925
+ }
926
+ }
927
+ obj.split = split
928
+ obj.cycle = cycle
929
+ if (ring.sum) {
930
+ obj.sum = ring.sum
931
+ obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100) + '%'
932
+ } else {
933
+ obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100) + '%'
934
+ }
935
+ obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100) + '%'
936
+ obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100) + '%'
937
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100) + '%'
938
+ // 忽略相位不显示
939
+ // let mode = ring.mode
940
+ // if (mode !== 7) { // 忽略相位不显示
941
+ list.push(obj)
942
+ // }
943
+ }
944
+ this.patternInfo.push(list)
945
+ }
946
+ },
947
+ handleCurrentChange (val) { // 两个ring的数据
948
+ this.patternInfo = []
949
+ if (val === null || val.length === 0) return
950
+ if (this.controlPhase && this.controlPhase.phase && this.controlPhase.phase[0].split) {
951
+ val.map(i => {
952
+ i.map(j => {
953
+ j.value = this.controlPhase.phase.filter(item => item.id === j.id)[0].split
954
+ })
955
+ })
956
+ }
957
+ // 按环序分组
958
+ let ringlength = []
959
+ let ringsequence = val.map(item => {
960
+ if (item.length === 0) return
961
+ ringlength.push(item.length)
962
+ return item.map(k => {
963
+ return k.id
964
+ })
965
+ })
966
+ let valSplit = val.map(item => {
967
+ return item.map(val => {
968
+ return val.value + (val.sum ? val.sum : 0)
969
+ })
970
+ })
971
+ let splitCycle = valSplit.length > 0 ? valSplit.map(item => {
972
+ return item.length > 0 ? item.reduce((a, b) => {
973
+ return a + b
974
+ }) : 0
975
+ }) : 0
976
+ let cycle = Math.max(...splitCycle)// 每个环的周期最大值
977
+ this.fixCycle = cycle// 每个环的周期最大值
978
+ let newRings = ringsequence.filter(item => item)
979
+ let minLength = Math.min(...ringlength)
980
+ let resultArrs = [] // 环1分组
981
+ let resultArr = [] // 环2分组
982
+ for (let j = 0; j < ringsequence[0].length; j += minLength) {
983
+ resultArrs.push(ringsequence[0].slice(j, j + minLength))
984
+ if (ringsequence[0].length === minLength) {
985
+ resultArrs.push([])
986
+ }
987
+ }
988
+ if (newRings.length > 1) {
989
+ for (let i = 0; i < ringsequence[1].length; i += minLength) {
990
+ resultArr.push(ringsequence[1].slice(i, i + minLength))
991
+ }
992
+ }
993
+ this.patternInfo = []
994
+ this.barrierList = []
995
+ let currentArr = []
996
+ let newPattern = []
997
+ val.map(i => {
998
+ newPattern.push(...i)
999
+ })
1000
+ if (this.phaseList.length === 0) return
1001
+ for (let patternStatus of val[0]) {
1002
+ // if (patternStatus.mode !== 7) {
1003
+ let concurrent = this.phaseList.filter((item) => {
1004
+ return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
1005
+ })[0].concurrent// 当前相位的并发相位
1006
+ if (concurrent) {
1007
+ let obj = {
1008
+ id: patternStatus.id,
1009
+ current: concurrent.sort()
1010
+ }
1011
+ currentArr.push(obj)
1012
+ }
1013
+ // }
1014
+ }
1015
+ if (currentArr.length !== 0) {
1016
+ let newCurrent = this.tranform(currentArr)
1017
+ // 取没个环与环关系的并集
1018
+ let barrierRing1 = []
1019
+ let barrierRing2 = []
1020
+ let ring1 = [] // 环1与关系1的并集
1021
+ for (let h = 0; h < newCurrent.length; h++) {
1022
+ let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
1023
+ ring1.push(adds)
1024
+ }
1025
+ let ring1s = [] // 环1与关系2的并集
1026
+ for (let h = 0; h < newCurrent.length; h++) {
1027
+ let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
1028
+ ring1s.push(addRing1)
1029
+ }
1030
+ barrierRing1.push(...ring1, ...ring1s)
1031
+ let resultList = []
1032
+ if (newRings.length > 1) {
1033
+ let ring2s = [] // 环2与关系1的并集
1034
+ for (let h = 0; h < newCurrent.length; h++) {
1035
+ let addRing2 = [...new Set(resultArr[1])].filter(item => newCurrent[h].includes(item))
1036
+ ring2s.push(addRing2)
1037
+ }
1038
+ let ring2 = [] // 环2与关系1的并集
1039
+ for (let h = 0; h < newCurrent.length; h++) {
1040
+ let add = [...new Set(resultArr[0])].filter(item => newCurrent[h].includes(item))
1041
+ ring2.push(add)
1042
+ }
1043
+ barrierRing2.push(...ring2, ...ring2s)
1044
+ for (let k = 0; k < barrierRing1.length; k++) {
1045
+ resultList.push(barrierRing1[k].concat(barrierRing2[k]))
1046
+ }
1047
+ }
1048
+ let resultLists = resultList.filter(item => item.length !== 0)
1049
+ let ringArr = []
1050
+ for (let l = 0; l < resultLists.length; l++) {
1051
+ for (let d = 0; d < newCurrent.length; d++) {
1052
+ if (newCurrent[d].filter(item => resultLists[l].includes(item)).length > 0) {
1053
+ ringArr.push({
1054
+ data: resultLists[l],
1055
+ id: d + 1,
1056
+ index: l
1057
+ })
1058
+ }
1059
+ }
1060
+ }
1061
+ for (var i = 0; i < ringArr.length; i++) {
1062
+ for (var j = i + 1; j < ringArr.length; j++) {
1063
+ if (ringArr[i].id === ringArr[j].id && ringArr[i].index + 1 === ringArr[j].index) {
1064
+ ringArr[i].data = ringArr[i].data.concat(ringArr[j].data)
1065
+ ringArr.splice(ringArr.indexOf(ringArr[j].id), 1)
1066
+ }
1067
+ }
1068
+ }
1069
+ let resArr = ringArr.map(item => item.data)
1070
+ let ringTeam = this.step1(this.phaseList, resArr)
1071
+ let ringTeams = ringTeam.filter(item => item.length !== 0)
1072
+ if (this.patternList) {
1073
+ this.setBarrier(ringTeams, val)
1074
+ }
1075
+ if (newRings.length > 1) {
1076
+ this.fillGap(ringTeams, val)
1077
+ }
1078
+ if (this.cycleChange) {
1079
+ const globalParamModel = this.$store.getters.globalParamModel
1080
+ let pattern = globalParamModel.getParamsByType('patternList')
1081
+ const allCycle = pattern.map(item => item.cycle)
1082
+ let cycle = Math.max(...allCycle)
1083
+ this.max = cycle
1084
+ } else {
1085
+ this.max = ''
1086
+ }
1087
+ let barrier = this.step2(ringTeams, newPattern)
1088
+ let barrierLeft = barrier.map(item => item)// 屏障左移显示出人行横道
1089
+ this.barrierList = barrierLeft.map(j => {
1090
+ return (j / (this.max ? this.max : cycle) * 100) + '%'
1091
+ })
1092
+ // this.barrierList.unshift(0)
1093
+ }
1094
+ for (let rings of val) {
1095
+ if (rings.length === 0) continue
1096
+ let list = []
1097
+ for (let ring of rings) {
1098
+ if (ring.value === 0) continue
1099
+ let obj = {}
1100
+ let split = ring.value
1101
+ obj.id = ring.id
1102
+ // obj.split = split
1103
+ let currPhase = this.phaseList.filter((item) => {
1104
+ if (item.id === ring.id && item.controltype === 99) {
1105
+ obj.controltype = item.controltype
1106
+ }
1107
+ return item.id === ring.id
1108
+ })[0]
1109
+ if (!currPhase) return
1110
+ let peddirections = []
1111
+ for (let walk of this.sidewalkPhaseData) {
1112
+ if (currPhase.peddirection) {
1113
+ for (let ped of currPhase.peddirection) {
1114
+ // if (stg === walk.phaseid) {
1115
+ let objs = {}
1116
+ objs.name = walk.name
1117
+ objs.id = walk.id
1118
+ objs.color = 'rgba(48,49,51,0.6)'
1119
+ if (ped === walk.id) {
1120
+ peddirections.push(objs)
1121
+ peddirections = Array.from(new Set(peddirections))
1122
+ }
1123
+ // }
1124
+ }
1125
+ } else {
1126
+ peddirections = []
1127
+ }
1128
+ }
1129
+ if (ring.desc && ring.desc.length > 0) {
1130
+ obj.direction = ring.desc.map(item => { // 虚相位desc为空
1131
+ return {
1132
+ id: item.id,
1133
+ color: '#303133',
1134
+ peddirection: peddirections
1135
+ }
1136
+ })
1137
+ } else {
1138
+ if (currPhase.direction && currPhase.direction.length > 0) {
1139
+ obj.direction = currPhase.direction.map(item => {
1140
+ return {
1141
+ id: item,
1142
+ color: '#303133',
1143
+ peddirection: peddirections
1144
+ }
1145
+ })
1146
+ } else {
1147
+ obj.direction = [
1148
+ {
1149
+ id: '',
1150
+ color: '#303133',
1151
+ peddirection: peddirections
1152
+ }
1153
+ ]
1154
+ }
1155
+ }
1156
+ obj.split = split
1157
+ obj.cycle = cycle
1158
+ if (ring.sum) {
1159
+ obj.sum = ring.sum
1160
+ obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100) + '%'
1161
+ } else {
1162
+ obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100) + '%'
1163
+ }
1164
+ obj.mode = ring.mode
1165
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100) + '%'
1166
+ obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100) + '%'
1167
+ obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100) + '%'
1168
+ // 忽略相位不显示
1169
+ // let mode = ring.mode
1170
+ // if (mode !== 7) { // 忽略相位不显示
1171
+ list.push(obj)
1172
+ // }
1173
+ }
1174
+ this.patternInfo.push(list)
1175
+ }
1176
+ },
1177
+ setBarrier (ringTeam, val) { // 添加特征参数barrier
1178
+ this.patternList.map(item => {
1179
+ if (item.id === this.patternIds) {
1180
+ const patternObjs = {}
1181
+ val.forEach(l => {
1182
+ l.map(k => {
1183
+ patternObjs[k.id] = k.value
1184
+ })
1185
+ })
1186
+ let ret = ringTeam.map((y, index) => {
1187
+ if (!y || y.length === 0) return
1188
+ y.map(n => {
1189
+ n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
1190
+ })
1191
+ return {
1192
+ barrier: index + 1,
1193
+ length: y[0].length,
1194
+ items: y.map(j => {
1195
+ return {
1196
+ ring: j.ring,
1197
+ data: j.data
1198
+ }
1199
+ })
1200
+ }
1201
+ })
1202
+ item.barriers = ret
1203
+ }
1204
+ })
1205
+ },
1206
+ tranform (arr) { // 分barrier
1207
+ let newMap = new Map()
1208
+ arr.forEach(({id, current}) => {
1209
+ const find = newMap.get(current.join())
1210
+ if (find) newMap.get(current.join()).push(id)
1211
+ else newMap.set(current.join(), [id])
1212
+ })
1213
+ let ret = []
1214
+ newMap.forEach((value, key) => {
1215
+ ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
1216
+ })
1217
+ const result = []
1218
+ for (const a of ret) {
1219
+ let merged = false
1220
+ for (const r of result) {
1221
+ if (this.check([...r], a)) {
1222
+ a.forEach(item => r.add(item))
1223
+ merged = true
1224
+ }
1225
+ }
1226
+ if (!merged) {
1227
+ result.push(new Set(a))
1228
+ }
1229
+ merged = false
1230
+ }
1231
+ return result.map(s => [...s])
1232
+ },
1233
+ check (arr1, arr2) {
1234
+ return arr1.some(a1 => arr2.some(a2 => a1 === a2))
1235
+ },
1236
+ step1 (list, arr) { // 各个环包含的相位
1237
+ const ret = []
1238
+ const listObj = {}
1239
+ list.forEach(l => {
1240
+ listObj[l.id] = l.ring
1241
+ })
1242
+ arr.forEach(a => {
1243
+ const retItem = []
1244
+ a.forEach(b => {
1245
+ if (listObj[b]) {
1246
+ const find = retItem.find(r => r.ring === listObj[b])
1247
+ if (find) find.data.push(b)
1248
+ else retItem.push({ring: listObj[b], data: [b]})
1249
+ }
1250
+ })
1251
+ ret.push(retItem)
1252
+ })
1253
+ return ret
1254
+ },
1255
+ step2 (newArr, pattern) { // 不同环并发相位做比较
1256
+ let ret = []
1257
+ let max = 0
1258
+ const patternObj = {}
1259
+ pattern.forEach(l => {
1260
+ // if (l.mode !== 7) {
1261
+ patternObj[l.id] = l.value
1262
+ // }
1263
+ })
1264
+ let barrierCycle = newArr.map(item => {
1265
+ return Math.max.apply(Math, item.map(k => { return k.length }))
1266
+ })
1267
+ barrierCycle.forEach((b, index) => {
1268
+ if (index === 0) {
1269
+ ret.push(barrierCycle[index])
1270
+ } else {
1271
+ if (max) {
1272
+ max = barrierCycle[index] + max
1273
+ } else {
1274
+ max = barrierCycle[index] + barrierCycle[index - 1]
1275
+ }
1276
+ ret.push(max)
1277
+ }
1278
+ })
1279
+ return ret
1280
+ },
1281
+ fillGap (newArr, pattern) {
1282
+ this.newPatterns = []
1283
+ const patternObj = {}
1284
+ pattern.forEach(l => {
1285
+ l.map(k => {
1286
+ // if (k.mode !== 7) {
1287
+ patternObj[k.id] = k.value
1288
+ // }
1289
+ })
1290
+ })
1291
+ let newMax = []
1292
+ let newMin = []
1293
+ newArr.forEach((na, index) => {
1294
+ if (!na || na.length === 0) return
1295
+ na.map(n => {
1296
+ n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObj[cur], 0) : patternObj[n.data[0]]
1297
+ })
1298
+ let maxNum = Math.max.apply(Math, na.map(item => { return item.length }))
1299
+ let minNum = Math.min.apply(Math, na.map(item => { return item.length }))
1300
+ newMax.push(maxNum)
1301
+ newMin.push(minNum)
1302
+ let newmaxNum = Math.max.apply(Math, newMax)// 每组最大值
1303
+ let newminNum = Math.min.apply(Math, newMin)
1304
+ this.newCycle = newmaxNum + newminNum
1305
+ if (newmaxNum === newminNum) {
1306
+ this.max = newmaxNum + newminNum
1307
+ pattern.map(d => {
1308
+ d.map(r => {
1309
+ if (r.sum) {
1310
+ delete r.sum
1311
+ }
1312
+ })
1313
+ })
1314
+ }
1315
+ if (maxNum === minNum) {
1316
+ na.map(n => {
1317
+ pattern.map(h => {
1318
+ h.map(d => {
1319
+ if (d.id === n.data[1] && d.sum) {
1320
+ delete d.sum
1321
+ }
1322
+ })
1323
+ })
1324
+ })
1325
+ } else {
1326
+ na.map(n => {
1327
+ if (n.length === maxNum) {
1328
+ pattern.map(h => {
1329
+ h.map(d => {
1330
+ if (n.data.length > 1) {
1331
+ if (d.id === n.data[1]) {
1332
+ delete d.sum
1333
+ }
1334
+ } else {
1335
+ if (d.id === n.data[0]) {
1336
+ delete d.sum
1337
+ }
1338
+ }
1339
+ })
1340
+ })
1341
+ }
1342
+ })
1343
+ }
1344
+ na.forEach((value, index, array) => {
1345
+ if (value.length !== maxNum) {
1346
+ let newNa = []
1347
+ newNa.push(value)
1348
+ newNa.forEach(m => {
1349
+ let sum = Number(maxNum - m.length)
1350
+ pattern.filter((i) => {
1351
+ i.map(j => {
1352
+ if (m.data.length > 1) {
1353
+ if (j.id === m.data[1]) {
1354
+ j.sum = sum
1355
+ }
1356
+ } else {
1357
+ if (j.id === m.data[0]) {
1358
+ j.sum = sum
1359
+ }
1360
+ }
1361
+ })
1362
+ })
1363
+ })
1364
+ }
1365
+ let mapAdd = pattern.map(item => {
1366
+ return item.map(val => {
1367
+ return val.value + (val.sum ? val.sum : 0)
1368
+ })
1369
+ })
1370
+ let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
1371
+ return item.length > 0 ? item.reduce((a, b) => {
1372
+ return a + b
1373
+ }) : 0
1374
+ }) : 0
1375
+ this.max = Math.max(...maxCycle)// 每个环的周期最大值
1376
+ })
1377
+ })
1378
+ }
1379
+ }
1380
+ }
1381
+ </script>
1382
+ <style lang="scss">
1383
+ // el-tooltip样式
1384
+ .el-tooltip__popper.is-light {
1385
+ background: #299BCC !important;
1386
+ border: 1px solid #299BCC !important;
1387
+ color: #FFFFFF !important;
1388
+ }
1389
+ .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow {
1390
+ border-top-color: #299BCC !important;
1391
+ }
1392
+ .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow::after {
1393
+ border-top-color: #299BCC !important;
1394
+ }
1395
+ </style>
1396
+ <style lang="scss" scoped>
1397
+ .main-patternstatus {
1398
+ position: relative;
1399
+ /* margin-bottom: 20px; */
1400
+ }
1401
+ .main-patternstatus {
1402
+ position: relative;
1403
+ .ring-first {
1404
+ margin-top: 1px;
1405
+ width: 100%;
1406
+ height: 34px;
1407
+ }
1408
+ .first-1 {
1409
+ float: left;
1410
+ // text-align: center;
1411
+ }
1412
+ // .ring-num {
1413
+ // float: left;
1414
+ // margin-top:7px;
1415
+ // margin-left: 5px;
1416
+ // font-size: 14px;
1417
+ // font-weight: normal;
1418
+ // font-stretch: normal;
1419
+ // line-height: 22px;
1420
+ // letter-spacing: 0px;
1421
+ // color: #ffffff;
1422
+ // }
1423
+ .box {
1424
+ text-align: center;
1425
+ // float: left;
1426
+ // margin-left: 6px;
1427
+ // margin-right: 10px;
1428
+ }
1429
+ .ring-nums {
1430
+ // float: left;
1431
+ // margin-top:7px;
1432
+ // margin-left: 5px;
1433
+ font-size: 12px;
1434
+ height: 14px;
1435
+ font-weight: normal;
1436
+ font-stretch: normal;
1437
+ // line-height: 22px;
1438
+ letter-spacing: 0px;
1439
+ color: #333333;
1440
+ }
1441
+ .ring-phase {
1442
+ position: relative;
1443
+ float: left;
1444
+ // margin-left: 5px;
1445
+ height: 34px;
1446
+ width: 36px;
1447
+ z-index: 999;
1448
+ background: rgba(30, 96, 12, 0.2);
1449
+ // margin-top:1px;
1450
+ }
1451
+ .ring-phase::after {
1452
+ position: absolute;
1453
+ display: block;
1454
+ content: '';
1455
+ height: 0;
1456
+ width: 0;
1457
+ top: 11px;
1458
+ left: 36px;
1459
+ border: 5px solid transparent;
1460
+ border-left-color: rgba(30, 96, 12, 0.2);
1461
+ }
1462
+ // .divider {
1463
+ // position: absolute;
1464
+ // top: -10px;
1465
+ // // left: 370px;
1466
+ // width: 2px;
1467
+ // // height: 99px;
1468
+ // z-index: 999;
1469
+ // background-color:#B9BABF;
1470
+ // }
1471
+ // .curTimeLine {
1472
+ // position: absolute;
1473
+ // top: -10px;
1474
+ // width: 4px;
1475
+ // background-color: black;
1476
+ // }
1477
+ // .curTimeDiv {
1478
+ // position: absolute;
1479
+ // z-index:50;
1480
+ // top: -21px;
1481
+ // margin-left: -10px;
1482
+ // text-align:center;
1483
+ // vertical-align: middle;
1484
+ // width: 60px;
1485
+ // height: 19px;
1486
+ // color:black;
1487
+ // // background-color: black;
1488
+ // }
1489
+ }
1490
+ .ring-first {
1491
+ margin-top: 1px;
1492
+ width: 100%;
1493
+ height: 34px;
1494
+ }
1495
+ .direction {
1496
+ filter: brightness(70%);
1497
+ }
1498
+ .mask {
1499
+ background: rgb(242, 121, 121) !important;
1500
+ }
1501
+ .yellowClass {
1502
+ background: #f9dc6a !important;
1503
+ }
1504
+ .first-1 {
1505
+ float: left;
1506
+ // text-align: center;
1507
+ }
1508
+ </style>