openatc-components 0.1.163 → 0.1.166

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