openatc-components 0.1.146 → 0.1.147

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