openatc-components 0.4.47 → 0.4.49

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