openatc-components 0.3.45 → 0.3.46

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