openatc-components 0.2.50 → 0.2.51

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