openatc-components 0.2.80 → 0.2.82

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