openatc-components 0.1.139 → 0.1.141

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