openatc-components 0.3.107 → 0.3.108

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