openatc-components 0.1.131 → 0.1.132

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 (431) 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 +91 -91
  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 +170 -170
  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 +221 -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 +1366 -1366
  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 +817 -817
  123. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +313 -272
  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 -226
  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 -181
  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 -995
  141. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  142. package/package/kisscomps/components/overView/index.vue +699 -699
  143. package/package/kisscomps/components/patternList/index.js +2 -2
  144. package/package/kisscomps/components/patternList/patternList.vue +572 -572
  145. package/package/kisscomps/index.js +115 -119
  146. package/package/kissui.min.js +1 -1
  147. package/package.json +126 -126
  148. package/src/App.vue +24 -24
  149. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  150. package/src/EdgeMgr/controller/crossDiagramMgr.js +120 -120
  151. package/src/api/authapi.js +31 -31
  152. package/src/api/config.js +21 -21
  153. package/src/api/control.js +91 -102
  154. package/src/api/cross.js +49 -49
  155. package/src/api/fault.js +66 -66
  156. package/src/api/index.js +24 -24
  157. package/src/api/login.js +46 -46
  158. package/src/api/optimize.js +72 -72
  159. package/src/api/param.js +154 -154
  160. package/src/api/passwdAssest.js +101 -101
  161. package/src/api/template.js +27 -27
  162. package/src/i18n/index.js +26 -26
  163. package/src/i18n/language/en.js +1300 -1401
  164. package/src/i18n/language/index.js +25 -25
  165. package/src/i18n/language/zh.js +1299 -1416
  166. package/src/icons/demo.css +539 -539
  167. package/src/icons/iconfont.css +1183 -1183
  168. package/src/icons/iconfont.json +2053 -2053
  169. package/src/icons/index.js +20 -20
  170. package/src/icons/svg/azimuthlocking.svg +26 -26
  171. package/src/icons/svg/bendi.svg +110 -110
  172. package/src/icons/svg/bujin.svg +36 -36
  173. package/src/icons/svg/connectBlue.svg +7 -7
  174. package/src/icons/svg/currentvolume.svg +0 -0
  175. package/src/icons/svg/custom-BRTlane.svg +40 -40
  176. package/src/icons/svg/custom-buslane.svg +40 -40
  177. package/src/icons/svg/custom-detector.svg +12 -12
  178. package/src/icons/svg/custom-east-bottom.svg +32 -32
  179. package/src/icons/svg/custom-east-top.svg +32 -32
  180. package/src/icons/svg/custom-ewped.svg +35 -35
  181. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -40
  182. package/src/icons/svg/custom-north-left.svg +32 -32
  183. package/src/icons/svg/custom-north-right.svg +32 -32
  184. package/src/icons/svg/custom-peddetector.svg +17 -17
  185. package/src/icons/svg/custom-snped.svg +35 -35
  186. package/src/icons/svg/custom-south-left.svg +32 -32
  187. package/src/icons/svg/custom-south-right.svg +32 -32
  188. package/src/icons/svg/custom-tramlane.svg +40 -40
  189. package/src/icons/svg/custom-vehiclebranch.svg +40 -40
  190. package/src/icons/svg/custom-vehiclemainroad.svg +41 -41
  191. package/src/icons/svg/custom-west-bottom.svg +32 -32
  192. package/src/icons/svg/custom-west-top.svg +32 -32
  193. package/src/icons/svg/custom-xlped.svg +14 -14
  194. package/src/icons/svg/custom-xrped.svg +14 -14
  195. package/src/icons/svg/cutRed.svg +7 -7
  196. package/src/icons/svg/cycle.svg +0 -0
  197. package/src/icons/svg/dingzhouqi.svg +34 -34
  198. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  199. package/src/icons/svg/guandeng.svg +81 -81
  200. package/src/icons/svg/huangshan.svg +71 -71
  201. package/src/icons/svg/maincontrol.svg +0 -0
  202. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  203. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  204. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  205. package/src/icons/svg/model.svg +0 -0
  206. package/src/icons/svg/phasediff.svg +0 -0
  207. package/src/icons/svg/prioritycontrol.svg +21 -21
  208. package/src/icons/svg/quanhong.svg +86 -86
  209. package/src/icons/svg/shanghe.svg +11 -11
  210. package/src/icons/svg/shoudong.svg +103 -103
  211. package/src/icons/svg/tentativeplan.svg +28 -28
  212. package/src/icons/svg/time.svg +0 -0
  213. package/src/icons/svg/wuxianlan.svg +46 -46
  214. package/src/icons/svg/xiala.svg +11 -11
  215. package/src/icons/svg/xingrenguojie.svg +33 -33
  216. package/src/icons/svg/xitong.svg +89 -89
  217. package/src/icons/svg/youxian.svg +41 -41
  218. package/src/icons/svg/zizhukongzhi.svg +43 -43
  219. package/src/kisscomps/components/BoardCard/BoardCard.vue +99 -99
  220. package/src/kisscomps/components/BoardCard/index.js +2 -2
  221. package/src/kisscomps/components/Channelization/Channelization.vue +556 -556
  222. package/src/kisscomps/components/Channelization/index.js +2 -2
  223. package/src/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +361 -361
  224. package/src/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  225. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  226. package/src/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  227. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +123 -123
  228. package/src/kisscomps/components/CommonKanban/index.js +2 -2
  229. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  230. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  231. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  232. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  233. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  234. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  235. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  236. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  237. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  238. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  239. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  240. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +455 -455
  241. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +219 -219
  242. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  243. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  244. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  245. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  246. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +168 -168
  247. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +168 -168
  248. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  249. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  250. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  251. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  252. package/src/kisscomps/components/DrawChannelization/index.js +2 -2
  253. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  254. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +114 -114
  255. package/src/kisscomps/components/ExpendConfig/index.js +2 -2
  256. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +170 -170
  257. package/src/kisscomps/components/FaultDetailModal/index.js +2 -2
  258. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +497 -497
  259. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  260. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  261. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  262. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  263. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  264. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  265. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  266. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1179 -1179
  267. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  268. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  269. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  270. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  271. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  272. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  273. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  274. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  275. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  276. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  277. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  278. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  279. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  280. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  281. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  282. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +920 -920
  283. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +112 -112
  284. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +112 -112
  285. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +111 -111
  286. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  287. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  288. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +99 -99
  289. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +99 -99
  290. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  291. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +171 -171
  292. package/src/kisscomps/components/IntersectionMap/crossDirection/utils.js +78 -78
  293. package/src/kisscomps/components/IntersectionMap/index.js +2 -2
  294. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +163 -163
  295. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +528 -528
  296. package/src/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  297. package/src/kisscomps/components/KanBan/index.js +2 -2
  298. package/src/kisscomps/components/KanBan/kanban.vue +221 -221
  299. package/src/kisscomps/components/MessageBox/index.vue +96 -96
  300. package/src/kisscomps/components/OverLap/OverLap.vue +214 -214
  301. package/src/kisscomps/components/OverLap/index.js +2 -2
  302. package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  303. package/src/kisscomps/components/PatternOptimize/index.js +2 -2
  304. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +1366 -1366
  305. package/src/kisscomps/components/PatternStatus/index.js +2 -2
  306. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  307. package/src/kisscomps/components/PatternWalkSvg/index.js +2 -2
  308. package/src/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  309. package/src/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  310. package/src/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  311. package/src/kisscomps/components/PhaseDirectionText/index.js +2 -2
  312. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  313. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  314. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  315. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  316. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  317. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  318. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  319. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +817 -817
  320. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +313 -272
  321. package/src/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  322. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +195 -195
  323. package/src/kisscomps/components/SchemeConfig/index.js +2 -2
  324. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +198 -198
  325. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +228 -226
  326. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +197 -197
  327. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  328. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +275 -275
  329. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +840 -840
  330. package/src/kisscomps/components/StageBord/StageBord.vue +242 -242
  331. package/src/kisscomps/components/StageBord/index.js +2 -2
  332. package/src/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  333. package/src/kisscomps/components/StageStatus/index.js +2 -2
  334. package/src/kisscomps/components/Stages/index.vue +211 -181
  335. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  336. package/src/kisscomps/components/SvgIcon/index.js +2 -2
  337. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +998 -995
  338. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  339. package/src/kisscomps/components/overView/index.vue +699 -699
  340. package/src/kisscomps/components/patternList/index.js +2 -2
  341. package/src/kisscomps/components/patternList/patternList.vue +572 -572
  342. package/src/kisscomps/index.js +115 -119
  343. package/src/lib/publicjs/ArryListUtil.js +38 -38
  344. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  345. package/src/lib/publicjs/KissApi.js +158 -158
  346. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  347. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  348. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  349. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  350. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  351. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  352. package/src/lib/publicjs/basecomponents.js +65 -65
  353. package/src/lib/publicjs/localStorage.js +112 -112
  354. package/src/lib/publicjs/objdeepcopy.js +32 -32
  355. package/src/lib/publicjs/pageScroll.js +30 -30
  356. package/src/lib/publicjs/passwdAssest.js +101 -101
  357. package/src/lib/publicjs/styleclassfactory.js +32 -32
  358. package/src/main.js +50 -50
  359. package/src/node_modules/.package_versions.json +1 -0
  360. package/src/router/index.js +49 -56
  361. package/src/store/getters.js +16 -16
  362. package/src/store/index.js +26 -26
  363. package/src/store/modules/globalParam.js +67 -67
  364. package/src/utils/ControlFormat.js +68 -68
  365. package/src/utils/RingDataModel.js +251 -251
  366. package/src/utils/auth.js +178 -178
  367. package/src/utils/dateFormat.js +41 -41
  368. package/src/utils/errorcode.js +228 -228
  369. package/src/utils/fault.js +196 -196
  370. package/src/utils/faultcode.js +209 -209
  371. package/src/utils/index.js +69 -69
  372. package/src/utils/pedphasedesc.js +119 -119
  373. package/src/utils/phaseList.js +203 -203
  374. package/src/utils/phasedesc.js +124 -124
  375. package/src/utils/responseMessage.js +21 -21
  376. package/src/utils/validate.js +43 -43
  377. package/src/views/customchannelization.vue +49 -49
  378. package/src/views/home.1.vue +479 -479
  379. package/src/views/home.vue +93 -93
  380. package/src/views/intersection.vue +309 -309
  381. package/src/views/overView.vue +41 -41
  382. package/src/views/schemeconfig.vue +173 -173
  383. package/static/apiconfig.json +371 -446
  384. package/static/styles/channelizatioon.scss +433 -433
  385. package/static/styles/common.scss +21 -23
  386. package/static/styles/commonkanban.scss +87 -87
  387. package/static/styles/dark/index.scss +2 -2
  388. package/static/styles/dark/theme/element-dark.scss +42 -42
  389. package/static/styles/index.scss +84 -84
  390. package/static/styles/intersection.scss +183 -183
  391. package/static/styles/light/index.scss +2 -2
  392. package/static/styles/light/theme/element-light.scss +42 -42
  393. package/static/styles/overview.scss +116 -116
  394. package/static/styles/schemeconfig.scss +493 -493
  395. package/static/styles/stages.scss +64 -64
  396. package/static/styles/uiComponents.scss +5 -5
  397. package/static/token.json +2 -2
  398. package/test/e2e/custom-assertions/elementCount.js +27 -27
  399. package/test/e2e/nightwatch.conf.js +46 -46
  400. package/test/e2e/runner.js +48 -48
  401. package/test/e2e/specs/test.js +19 -19
  402. package/test/unit/.eslintrc +7 -7
  403. package/test/unit/jest.conf.js +30 -30
  404. package/test/unit/setup.js +3 -3
  405. package/test/unit/specs/HelloWorld.spec.js +11 -11
  406. package/package/kisscomps/components/XiaoKanban/DirSelector.vue +0 -356
  407. package/package/kisscomps/components/XiaoKanban/index.vue +0 -101
  408. package/package/kisscomps/components/patternConfig/components/planExecute.vue +0 -972
  409. package/package/kisscomps/components/patternConfig/index.js +0 -2
  410. package/package/kisscomps/components/patternConfig/index.vue +0 -1020
  411. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +0 -391
  412. package/package/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +0 -665
  413. package/package/kisscomps/components/patternConfig/planContent.vue +0 -572
  414. package/package/kisscomps/components/patternConfig/planMenu.vue +0 -329
  415. package/package/kisscomps/components/patternConfig/utils.js +0 -152
  416. package/pnpm-lock.yaml +0 -11430
  417. package/src/api/device.js +0 -135
  418. package/src/api/route.js +0 -171
  419. package/src/kisscomps/components/XiaoKanban/DirSelector.vue +0 -356
  420. package/src/kisscomps/components/XiaoKanban/index.vue +0 -101
  421. package/src/kisscomps/components/patternConfig/components/planExecute.vue +0 -972
  422. package/src/kisscomps/components/patternConfig/index.js +0 -2
  423. package/src/kisscomps/components/patternConfig/index.vue +0 -1020
  424. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +0 -391
  425. package/src/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +0 -665
  426. package/src/kisscomps/components/patternConfig/planContent.vue +0 -572
  427. package/src/kisscomps/components/patternConfig/planMenu.vue +0 -329
  428. package/src/kisscomps/components/patternConfig/utils.js +0 -152
  429. package/src/views/patternConfig.vue +0 -1461
  430. package/static/styles/patternConfig.scss +0 -57
  431. package/static/styles/xiaokanban.scss +0 -51
@@ -1,1366 +1,1366 @@
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
- this.barrierList = barrier.map(j => {
952
- return (j / (this.max ? this.max : this.newCycle) * 100) + '%'
953
- })
954
- // this.barrierList.unshift(0)
955
- }
956
- for (let rings of val) {
957
- if (rings.length === 0) continue
958
- let list = []
959
- for (let ring of rings) {
960
- if (ring.value === 0) continue
961
- let obj = {}
962
- let split = ring.value
963
- obj.id = ring.id
964
- // obj.split = split
965
- let currPhase = this.phaseList.filter((item) => {
966
- if (item.id === ring.id && item.controltype === 99) {
967
- obj.controltype = item.controltype
968
- }
969
- return item.id === ring.id
970
- })[0]
971
- if (!currPhase) return
972
- let peddirections = []
973
- for (let walk of this.sidewalkPhaseData) {
974
- if (currPhase.peddirection) {
975
- for (let ped of currPhase.peddirection) {
976
- // if (stg === walk.phaseid) {
977
- let objs = {}
978
- objs.name = walk.name
979
- objs.id = walk.id
980
- if (ped === walk.id) {
981
- peddirections.push(objs)
982
- peddirections = Array.from(new Set(peddirections))
983
- }
984
- // }
985
- }
986
- } else {
987
- peddirections = []
988
- }
989
- }
990
- if (ring.desc && ring.desc.length > 0) {
991
- obj.direction = ring.desc.map(item => { // 虚相位desc为空
992
- return {
993
- id: item.id,
994
- color: '#454545',
995
- peddirection: peddirections
996
- }
997
- })
998
- } else {
999
- if (currPhase.direction && currPhase.direction.length > 0) {
1000
- obj.direction = currPhase.direction.map(item => {
1001
- return {
1002
- id: item,
1003
- color: '#454545',
1004
- peddirection: peddirections
1005
- }
1006
- })
1007
- } else {
1008
- obj.direction = [
1009
- {
1010
- id: '',
1011
- color: '#454545',
1012
- peddirection: peddirections
1013
- }
1014
- ]
1015
- }
1016
- }
1017
- obj.split = split
1018
- obj.cycle = cycle
1019
- if (ring.sum) {
1020
- obj.sum = ring.sum
1021
- obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1022
- } else {
1023
- obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1024
- }
1025
- obj.mode = ring.mode
1026
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1027
- obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1028
- obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1029
- // 忽略相位不显示
1030
- // let mode = ring.mode
1031
- // if (mode !== 7) { // 忽略相位不显示
1032
- list.push(obj)
1033
- // }
1034
- }
1035
- this.patternInfo.push(list)
1036
- }
1037
- },
1038
- setBarrier (ringTeam, val) { // 添加特征参数barrier
1039
- this.patternList.map(item => {
1040
- if (item.id === this.patternIds) {
1041
- const patternObjs = {}
1042
- val.forEach(l => {
1043
- l.map(k => {
1044
- patternObjs[k.id] = k.value
1045
- })
1046
- })
1047
- let ret = ringTeam.map((y, index) => {
1048
- if (!y || y.length === 0) return
1049
- y.map(n => {
1050
- n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
1051
- })
1052
- return {
1053
- barrier: index + 1,
1054
- length: y[0].length,
1055
- items: y.map(j => {
1056
- return {
1057
- ring: j.ring,
1058
- data: j.data
1059
- }
1060
- })
1061
- }
1062
- })
1063
- item.barriers = ret
1064
- }
1065
- })
1066
- },
1067
- tranform (arr) { // 分barrier
1068
- let newMap = new Map()
1069
- arr.forEach(({id, current}) => {
1070
- const find = newMap.get(current.join())
1071
- if (find) newMap.get(current.join()).push(id)
1072
- else newMap.set(current.join(), [id])
1073
- })
1074
- let ret = []
1075
- newMap.forEach((value, key) => {
1076
- ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
1077
- })
1078
- const result = []
1079
- for (const a of ret) {
1080
- let merged = false
1081
- for (const r of result) {
1082
- if (this.check([...r], a)) {
1083
- a.forEach(item => r.add(item))
1084
- merged = true
1085
- }
1086
- }
1087
- if (!merged) {
1088
- result.push(new Set(a))
1089
- }
1090
- merged = false
1091
- }
1092
- return result.map(s => [...s])
1093
- },
1094
- check (arr1, arr2) {
1095
- return arr1.some(a1 => arr2.some(a2 => a1 === a2))
1096
- },
1097
- step1 (list, arr) { // 各个环包含的相位
1098
- const ret = []
1099
- const listObj = {}
1100
- list.forEach(l => {
1101
- listObj[l.id] = l.ring
1102
- })
1103
- arr.forEach(a => {
1104
- const retItem = []
1105
- a.forEach(b => {
1106
- if (listObj[b]) {
1107
- const find = retItem.find(r => r.ring === listObj[b])
1108
- if (find) find.data.push(b)
1109
- else retItem.push({ring: listObj[b], data: [b]})
1110
- }
1111
- })
1112
- ret.push(retItem)
1113
- })
1114
- return ret
1115
- },
1116
- step2 (newArr, pattern) { // 不同环并发相位做比较
1117
- let ret = []
1118
- let max = 0
1119
- const patternObj = {}
1120
- pattern.forEach(l => {
1121
- // if (l.mode !== 7) {
1122
- patternObj[l.id] = l.value
1123
- // }
1124
- })
1125
- let barrierCycle = newArr.map(item => {
1126
- return Math.max.apply(Math, item.map(k => { return k.length }))
1127
- })
1128
- barrierCycle.forEach((b, index) => {
1129
- if (index === 0) {
1130
- ret.push(barrierCycle[index])
1131
- } else {
1132
- if (max) {
1133
- max = barrierCycle[index] + max
1134
- } else {
1135
- max = barrierCycle[index] + barrierCycle[index - 1]
1136
- }
1137
- ret.push(max)
1138
- }
1139
- })
1140
- return ret
1141
- },
1142
- fillGap (newArr, pattern) {
1143
- this.newPatterns = []
1144
- const patternObj = {}
1145
- pattern.forEach(l => {
1146
- l.map(k => {
1147
- // if (k.mode !== 7) {
1148
- patternObj[k.id] = k.value
1149
- // }
1150
- })
1151
- })
1152
- let newMax = []
1153
- let newMin = []
1154
- newArr.forEach((na, index) => {
1155
- if (!na || na.length === 0) return
1156
- na.map(n => {
1157
- n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObj[cur], 0) : patternObj[n.data[0]]
1158
- })
1159
- let maxNum = Math.max.apply(Math, na.map(item => { return item.length }))
1160
- let minNum = Math.min.apply(Math, na.map(item => { return item.length }))
1161
- newMax.push(maxNum)
1162
- newMin.push(minNum)
1163
- let newmaxNum = Math.max.apply(Math, newMax)// 每组最大值
1164
- let newminNum = Math.min.apply(Math, newMin)
1165
- this.newCycle = newmaxNum + newminNum
1166
- if (newmaxNum === newminNum) {
1167
- this.max = newmaxNum + newminNum
1168
- pattern.map(d => {
1169
- d.map(r => {
1170
- if (r.sum) {
1171
- delete r.sum
1172
- }
1173
- })
1174
- })
1175
- }
1176
- if (maxNum === minNum) {
1177
- na.map(n => {
1178
- pattern.map(h => {
1179
- h.map(d => {
1180
- if (d.id === n.data[1] && d.sum) {
1181
- delete d.sum
1182
- }
1183
- })
1184
- })
1185
- })
1186
- } else {
1187
- na.map(n => {
1188
- if (n.length === maxNum) {
1189
- pattern.map(h => {
1190
- h.map(d => {
1191
- if (n.data.length > 1) {
1192
- if (d.id === n.data[1]) {
1193
- delete d.sum
1194
- }
1195
- } else {
1196
- if (d.id === n.data[0]) {
1197
- delete d.sum
1198
- }
1199
- }
1200
- })
1201
- })
1202
- }
1203
- })
1204
- }
1205
- na.forEach((value, index, array) => {
1206
- if (value.length !== maxNum) {
1207
- let newNa = []
1208
- newNa.push(value)
1209
- newNa.forEach(m => {
1210
- let sum = Number(maxNum - m.length)
1211
- pattern.filter((i) => {
1212
- i.map(j => {
1213
- if (m.data.length > 1) {
1214
- if (j.id === m.data[1]) {
1215
- j.sum = sum
1216
- }
1217
- } else {
1218
- if (j.id === m.data[0]) {
1219
- j.sum = sum
1220
- }
1221
- }
1222
- })
1223
- })
1224
- })
1225
- }
1226
- let mapAdd = pattern.map(item => {
1227
- return item.map(val => {
1228
- return val.value + (val.sum ? val.sum : 0)
1229
- })
1230
- })
1231
- let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
1232
- return item.length > 0 ? item.reduce((a, b) => {
1233
- return a + b
1234
- }) : 0
1235
- }) : 0
1236
- this.max = Math.max(...maxCycle)// 每个环的周期最大值
1237
- })
1238
- })
1239
- }
1240
- }
1241
- }
1242
- </script>
1243
- <style lang="scss">
1244
- // el-tooltip样式
1245
- .el-tooltip__popper.is-light {
1246
- background: #299BCC !important;
1247
- border: 1px solid #299BCC !important;
1248
- color: #FFFFFF !important;
1249
- }
1250
- .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow {
1251
- border-top-color: #299BCC !important;
1252
- }
1253
- .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow::after {
1254
- border-top-color: #299BCC !important;
1255
- }
1256
- </style>
1257
- <style lang="scss" scoped>
1258
- .main-patternstatus {
1259
- position: relative;
1260
- margin-bottom: 20px;
1261
- }
1262
- .main-patternstatus {
1263
- position: relative;
1264
- .ring-first {
1265
- margin-top: 1px;
1266
- width: 100%;
1267
- height: 34px;
1268
- }
1269
- .first-1 {
1270
- float: left;
1271
- // text-align: center;
1272
- }
1273
- // .ring-num {
1274
- // float: left;
1275
- // margin-top:7px;
1276
- // margin-left: 5px;
1277
- // font-size: 14px;
1278
- // font-weight: normal;
1279
- // font-stretch: normal;
1280
- // line-height: 22px;
1281
- // letter-spacing: 0px;
1282
- // color: #ffffff;
1283
- // }
1284
- .box {
1285
- text-align: center;
1286
- // float: left;
1287
- // margin-left: 6px;
1288
- // margin-right: 10px;
1289
- }
1290
- .ring-nums {
1291
- // float: left;
1292
- // margin-top:7px;
1293
- // margin-left: 5px;
1294
- font-size: 12px;
1295
- height: 14px;
1296
- font-weight: normal;
1297
- font-stretch: normal;
1298
- // line-height: 22px;
1299
- letter-spacing: 0px;
1300
- color: #333333;
1301
- }
1302
- .ring-phase {
1303
- position: relative;
1304
- float: left;
1305
- // margin-left: 5px;
1306
- height: 34px;
1307
- width: 36px;
1308
- z-index: 999;
1309
- background: rgba(30, 96, 12, 0.2);
1310
- // margin-top:1px;
1311
- }
1312
- .ring-phase::after {
1313
- position: absolute;
1314
- display: block;
1315
- content: '';
1316
- height: 0;
1317
- width: 0;
1318
- top: 11px;
1319
- left: 36px;
1320
- border: 5px solid transparent;
1321
- border-left-color: rgba(30, 96, 12, 0.2);
1322
- }
1323
- .divider {
1324
- position: absolute;
1325
- top: -10px;
1326
- // left: 370px;
1327
- width: 3px;
1328
- // height: 99px;
1329
- z-index: 999;
1330
- background-color:#B9BABF;
1331
- }
1332
- .curTimeLine {
1333
- position: absolute;
1334
- top: -10px;
1335
- width: 2px;
1336
- background-color: #299BCC;
1337
- }
1338
- .curTimeDiv {
1339
- position: absolute;
1340
- z-index:50;
1341
- top: -21px;
1342
- margin-left: -30px;
1343
- text-align:center;
1344
- vertical-align: middle;
1345
- width: 60px;
1346
- height: 19px;
1347
- color:#FFFFFF;
1348
- background-color: #299BCC;
1349
- }
1350
- }
1351
- .ring-first {
1352
- margin-top: 1px;
1353
- width: 100%;
1354
- height: 34px;
1355
- }
1356
- .direction {
1357
- filter: brightness(70%);
1358
- }
1359
- .masks {
1360
- background: rgb(242, 121, 121) !important;
1361
- }
1362
- .first-1 {
1363
- float: left;
1364
- // text-align: center;
1365
- }
1366
- </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
+ this.barrierList = barrier.map(j => {
952
+ return (j / (this.max ? this.max : this.newCycle) * 100) + '%'
953
+ })
954
+ // this.barrierList.unshift(0)
955
+ }
956
+ for (let rings of val) {
957
+ if (rings.length === 0) continue
958
+ let list = []
959
+ for (let ring of rings) {
960
+ if (ring.value === 0) continue
961
+ let obj = {}
962
+ let split = ring.value
963
+ obj.id = ring.id
964
+ // obj.split = split
965
+ let currPhase = this.phaseList.filter((item) => {
966
+ if (item.id === ring.id && item.controltype === 99) {
967
+ obj.controltype = item.controltype
968
+ }
969
+ return item.id === ring.id
970
+ })[0]
971
+ if (!currPhase) return
972
+ let peddirections = []
973
+ for (let walk of this.sidewalkPhaseData) {
974
+ if (currPhase.peddirection) {
975
+ for (let ped of currPhase.peddirection) {
976
+ // if (stg === walk.phaseid) {
977
+ let objs = {}
978
+ objs.name = walk.name
979
+ objs.id = walk.id
980
+ if (ped === walk.id) {
981
+ peddirections.push(objs)
982
+ peddirections = Array.from(new Set(peddirections))
983
+ }
984
+ // }
985
+ }
986
+ } else {
987
+ peddirections = []
988
+ }
989
+ }
990
+ if (ring.desc && ring.desc.length > 0) {
991
+ obj.direction = ring.desc.map(item => { // 虚相位desc为空
992
+ return {
993
+ id: item.id,
994
+ color: '#454545',
995
+ peddirection: peddirections
996
+ }
997
+ })
998
+ } else {
999
+ if (currPhase.direction && currPhase.direction.length > 0) {
1000
+ obj.direction = currPhase.direction.map(item => {
1001
+ return {
1002
+ id: item,
1003
+ color: '#454545',
1004
+ peddirection: peddirections
1005
+ }
1006
+ })
1007
+ } else {
1008
+ obj.direction = [
1009
+ {
1010
+ id: '',
1011
+ color: '#454545',
1012
+ peddirection: peddirections
1013
+ }
1014
+ ]
1015
+ }
1016
+ }
1017
+ obj.split = split
1018
+ obj.cycle = cycle
1019
+ if (ring.sum) {
1020
+ obj.sum = ring.sum
1021
+ obj.redWidth = ((currPhase.redclear + ring.sum) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1022
+ } else {
1023
+ obj.redWidth = (currPhase.redclear / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1024
+ }
1025
+ obj.mode = ring.mode
1026
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1027
+ obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1028
+ obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : cycle) * 100).toFixed(3) + '%'
1029
+ // 忽略相位不显示
1030
+ // let mode = ring.mode
1031
+ // if (mode !== 7) { // 忽略相位不显示
1032
+ list.push(obj)
1033
+ // }
1034
+ }
1035
+ this.patternInfo.push(list)
1036
+ }
1037
+ },
1038
+ setBarrier (ringTeam, val) { // 添加特征参数barrier
1039
+ this.patternList.map(item => {
1040
+ if (item.id === this.patternIds) {
1041
+ const patternObjs = {}
1042
+ val.forEach(l => {
1043
+ l.map(k => {
1044
+ patternObjs[k.id] = k.value
1045
+ })
1046
+ })
1047
+ let ret = ringTeam.map((y, index) => {
1048
+ if (!y || y.length === 0) return
1049
+ y.map(n => {
1050
+ n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
1051
+ })
1052
+ return {
1053
+ barrier: index + 1,
1054
+ length: y[0].length,
1055
+ items: y.map(j => {
1056
+ return {
1057
+ ring: j.ring,
1058
+ data: j.data
1059
+ }
1060
+ })
1061
+ }
1062
+ })
1063
+ item.barriers = ret
1064
+ }
1065
+ })
1066
+ },
1067
+ tranform (arr) { // 分barrier
1068
+ let newMap = new Map()
1069
+ arr.forEach(({id, current}) => {
1070
+ const find = newMap.get(current.join())
1071
+ if (find) newMap.get(current.join()).push(id)
1072
+ else newMap.set(current.join(), [id])
1073
+ })
1074
+ let ret = []
1075
+ newMap.forEach((value, key) => {
1076
+ ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
1077
+ })
1078
+ const result = []
1079
+ for (const a of ret) {
1080
+ let merged = false
1081
+ for (const r of result) {
1082
+ if (this.check([...r], a)) {
1083
+ a.forEach(item => r.add(item))
1084
+ merged = true
1085
+ }
1086
+ }
1087
+ if (!merged) {
1088
+ result.push(new Set(a))
1089
+ }
1090
+ merged = false
1091
+ }
1092
+ return result.map(s => [...s])
1093
+ },
1094
+ check (arr1, arr2) {
1095
+ return arr1.some(a1 => arr2.some(a2 => a1 === a2))
1096
+ },
1097
+ step1 (list, arr) { // 各个环包含的相位
1098
+ const ret = []
1099
+ const listObj = {}
1100
+ list.forEach(l => {
1101
+ listObj[l.id] = l.ring
1102
+ })
1103
+ arr.forEach(a => {
1104
+ const retItem = []
1105
+ a.forEach(b => {
1106
+ if (listObj[b]) {
1107
+ const find = retItem.find(r => r.ring === listObj[b])
1108
+ if (find) find.data.push(b)
1109
+ else retItem.push({ring: listObj[b], data: [b]})
1110
+ }
1111
+ })
1112
+ ret.push(retItem)
1113
+ })
1114
+ return ret
1115
+ },
1116
+ step2 (newArr, pattern) { // 不同环并发相位做比较
1117
+ let ret = []
1118
+ let max = 0
1119
+ const patternObj = {}
1120
+ pattern.forEach(l => {
1121
+ // if (l.mode !== 7) {
1122
+ patternObj[l.id] = l.value
1123
+ // }
1124
+ })
1125
+ let barrierCycle = newArr.map(item => {
1126
+ return Math.max.apply(Math, item.map(k => { return k.length }))
1127
+ })
1128
+ barrierCycle.forEach((b, index) => {
1129
+ if (index === 0) {
1130
+ ret.push(barrierCycle[index])
1131
+ } else {
1132
+ if (max) {
1133
+ max = barrierCycle[index] + max
1134
+ } else {
1135
+ max = barrierCycle[index] + barrierCycle[index - 1]
1136
+ }
1137
+ ret.push(max)
1138
+ }
1139
+ })
1140
+ return ret
1141
+ },
1142
+ fillGap (newArr, pattern) {
1143
+ this.newPatterns = []
1144
+ const patternObj = {}
1145
+ pattern.forEach(l => {
1146
+ l.map(k => {
1147
+ // if (k.mode !== 7) {
1148
+ patternObj[k.id] = k.value
1149
+ // }
1150
+ })
1151
+ })
1152
+ let newMax = []
1153
+ let newMin = []
1154
+ newArr.forEach((na, index) => {
1155
+ if (!na || na.length === 0) return
1156
+ na.map(n => {
1157
+ n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObj[cur], 0) : patternObj[n.data[0]]
1158
+ })
1159
+ let maxNum = Math.max.apply(Math, na.map(item => { return item.length }))
1160
+ let minNum = Math.min.apply(Math, na.map(item => { return item.length }))
1161
+ newMax.push(maxNum)
1162
+ newMin.push(minNum)
1163
+ let newmaxNum = Math.max.apply(Math, newMax)// 每组最大值
1164
+ let newminNum = Math.min.apply(Math, newMin)
1165
+ this.newCycle = newmaxNum + newminNum
1166
+ if (newmaxNum === newminNum) {
1167
+ this.max = newmaxNum + newminNum
1168
+ pattern.map(d => {
1169
+ d.map(r => {
1170
+ if (r.sum) {
1171
+ delete r.sum
1172
+ }
1173
+ })
1174
+ })
1175
+ }
1176
+ if (maxNum === minNum) {
1177
+ na.map(n => {
1178
+ pattern.map(h => {
1179
+ h.map(d => {
1180
+ if (d.id === n.data[1] && d.sum) {
1181
+ delete d.sum
1182
+ }
1183
+ })
1184
+ })
1185
+ })
1186
+ } else {
1187
+ na.map(n => {
1188
+ if (n.length === maxNum) {
1189
+ pattern.map(h => {
1190
+ h.map(d => {
1191
+ if (n.data.length > 1) {
1192
+ if (d.id === n.data[1]) {
1193
+ delete d.sum
1194
+ }
1195
+ } else {
1196
+ if (d.id === n.data[0]) {
1197
+ delete d.sum
1198
+ }
1199
+ }
1200
+ })
1201
+ })
1202
+ }
1203
+ })
1204
+ }
1205
+ na.forEach((value, index, array) => {
1206
+ if (value.length !== maxNum) {
1207
+ let newNa = []
1208
+ newNa.push(value)
1209
+ newNa.forEach(m => {
1210
+ let sum = Number(maxNum - m.length)
1211
+ pattern.filter((i) => {
1212
+ i.map(j => {
1213
+ if (m.data.length > 1) {
1214
+ if (j.id === m.data[1]) {
1215
+ j.sum = sum
1216
+ }
1217
+ } else {
1218
+ if (j.id === m.data[0]) {
1219
+ j.sum = sum
1220
+ }
1221
+ }
1222
+ })
1223
+ })
1224
+ })
1225
+ }
1226
+ let mapAdd = pattern.map(item => {
1227
+ return item.map(val => {
1228
+ return val.value + (val.sum ? val.sum : 0)
1229
+ })
1230
+ })
1231
+ let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
1232
+ return item.length > 0 ? item.reduce((a, b) => {
1233
+ return a + b
1234
+ }) : 0
1235
+ }) : 0
1236
+ this.max = Math.max(...maxCycle)// 每个环的周期最大值
1237
+ })
1238
+ })
1239
+ }
1240
+ }
1241
+ }
1242
+ </script>
1243
+ <style lang="scss">
1244
+ // el-tooltip样式
1245
+ .el-tooltip__popper.is-light {
1246
+ background: #299BCC !important;
1247
+ border: 1px solid #299BCC !important;
1248
+ color: #FFFFFF !important;
1249
+ }
1250
+ .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow {
1251
+ border-top-color: #299BCC !important;
1252
+ }
1253
+ .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow::after {
1254
+ border-top-color: #299BCC !important;
1255
+ }
1256
+ </style>
1257
+ <style lang="scss" scoped>
1258
+ .main-patternstatus {
1259
+ position: relative;
1260
+ margin-bottom: 20px;
1261
+ }
1262
+ .main-patternstatus {
1263
+ position: relative;
1264
+ .ring-first {
1265
+ margin-top: 1px;
1266
+ width: 100%;
1267
+ height: 34px;
1268
+ }
1269
+ .first-1 {
1270
+ float: left;
1271
+ // text-align: center;
1272
+ }
1273
+ // .ring-num {
1274
+ // float: left;
1275
+ // margin-top:7px;
1276
+ // margin-left: 5px;
1277
+ // font-size: 14px;
1278
+ // font-weight: normal;
1279
+ // font-stretch: normal;
1280
+ // line-height: 22px;
1281
+ // letter-spacing: 0px;
1282
+ // color: #ffffff;
1283
+ // }
1284
+ .box {
1285
+ text-align: center;
1286
+ // float: left;
1287
+ // margin-left: 6px;
1288
+ // margin-right: 10px;
1289
+ }
1290
+ .ring-nums {
1291
+ // float: left;
1292
+ // margin-top:7px;
1293
+ // margin-left: 5px;
1294
+ font-size: 12px;
1295
+ height: 14px;
1296
+ font-weight: normal;
1297
+ font-stretch: normal;
1298
+ // line-height: 22px;
1299
+ letter-spacing: 0px;
1300
+ color: #333333;
1301
+ }
1302
+ .ring-phase {
1303
+ position: relative;
1304
+ float: left;
1305
+ // margin-left: 5px;
1306
+ height: 34px;
1307
+ width: 36px;
1308
+ z-index: 999;
1309
+ background: rgba(30, 96, 12, 0.2);
1310
+ // margin-top:1px;
1311
+ }
1312
+ .ring-phase::after {
1313
+ position: absolute;
1314
+ display: block;
1315
+ content: '';
1316
+ height: 0;
1317
+ width: 0;
1318
+ top: 11px;
1319
+ left: 36px;
1320
+ border: 5px solid transparent;
1321
+ border-left-color: rgba(30, 96, 12, 0.2);
1322
+ }
1323
+ .divider {
1324
+ position: absolute;
1325
+ top: -10px;
1326
+ // left: 370px;
1327
+ width: 3px;
1328
+ // height: 99px;
1329
+ z-index: 999;
1330
+ background-color:#B9BABF;
1331
+ }
1332
+ .curTimeLine {
1333
+ position: absolute;
1334
+ top: -10px;
1335
+ width: 2px;
1336
+ background-color: #299BCC;
1337
+ }
1338
+ .curTimeDiv {
1339
+ position: absolute;
1340
+ z-index:50;
1341
+ top: -21px;
1342
+ margin-left: -30px;
1343
+ text-align:center;
1344
+ vertical-align: middle;
1345
+ width: 60px;
1346
+ height: 19px;
1347
+ color:#FFFFFF;
1348
+ background-color: #299BCC;
1349
+ }
1350
+ }
1351
+ .ring-first {
1352
+ margin-top: 1px;
1353
+ width: 100%;
1354
+ height: 34px;
1355
+ }
1356
+ .direction {
1357
+ filter: brightness(70%);
1358
+ }
1359
+ .masks {
1360
+ background: rgb(242, 121, 121) !important;
1361
+ }
1362
+ .first-1 {
1363
+ float: left;
1364
+ // text-align: center;
1365
+ }
1366
+ </style>