openatc-components 0.2.64 → 0.2.65

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