openatc-components 0.2.65 → 0.2.68

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