openatc-components 0.2.66 → 0.2.69

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