openatc-components 0.4.7 → 0.4.8

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