openatc-components 0.0.79 → 0.0.80

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 (294) 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 +89 -89
  23. package/package/kisscomps/components/BoardCard/index.js +2 -2
  24. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +118 -118
  25. package/package/kisscomps/components/CommonKanban/index.js +2 -2
  26. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +114 -114
  27. package/package/kisscomps/components/ExpendConfig/index.js +2 -2
  28. package/package/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +170 -170
  29. package/package/kisscomps/components/FaultDetailModal/index.js +2 -2
  30. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +497 -497
  31. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  32. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PatternWalkSvg.vue +429 -429
  33. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  34. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  35. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  36. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  37. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  38. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  39. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1179 -1179
  40. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  41. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  42. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  43. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  44. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  45. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  46. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  47. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  48. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  49. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  50. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  51. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  52. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  53. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  54. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  55. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +912 -912
  56. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +112 -112
  57. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +112 -112
  58. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +111 -111
  59. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  60. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  61. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +99 -99
  62. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +99 -99
  63. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  64. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +99 -99
  65. package/package/kisscomps/components/IntersectionMap/crossDirection/utils.js +78 -78
  66. package/package/kisscomps/components/IntersectionMap/index.js +2 -2
  67. package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +153 -153
  68. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +518 -518
  69. package/package/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  70. package/package/kisscomps/components/KanBan/index.js +2 -2
  71. package/package/kisscomps/components/KanBan/kanban.vue +219 -219
  72. package/package/kisscomps/components/OverLap/OverLap.vue +207 -207
  73. package/package/kisscomps/components/OverLap/index.js +2 -2
  74. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +886 -886
  75. package/package/kisscomps/components/PatternStatus/index.js +2 -2
  76. package/package/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +418 -418
  77. package/package/kisscomps/components/PatternWalkSvg/index.js +2 -2
  78. package/package/kisscomps/components/PhaseMarker/index.js +6 -6
  79. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  80. package/package/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  81. package/package/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  82. package/package/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  83. package/package/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  84. package/package/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  85. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +739 -739
  86. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +195 -195
  87. package/package/kisscomps/components/SchemeConfig/index.js +2 -2
  88. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +198 -198
  89. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +219 -219
  90. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +263 -263
  91. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1384 -1384
  92. package/package/kisscomps/components/StageBord/StageBord.vue +242 -242
  93. package/package/kisscomps/components/StageBord/index.js +2 -2
  94. package/package/kisscomps/components/StageStatus/StageStatus.vue +306 -306
  95. package/package/kisscomps/components/StageStatus/index.js +2 -2
  96. package/package/kisscomps/components/Stages/index.vue +139 -121
  97. package/package/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  98. package/package/kisscomps/components/SvgIcon/index.js +2 -2
  99. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +522 -522
  100. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  101. package/package/kisscomps/components/overView/index.vue +676 -676
  102. package/package/kisscomps/components/patternList/index.js +2 -2
  103. package/package/kisscomps/components/patternList/patternList.vue +562 -562
  104. package/package/kisscomps/index.js +92 -92
  105. package/package/kissui.min.js +1 -1
  106. package/package.json +1 -1
  107. package/src/App.vue +24 -24
  108. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  109. package/src/EdgeMgr/controller/crossDiagramMgr.js +120 -120
  110. package/src/api/authapi.js +31 -31
  111. package/src/api/config.js +21 -21
  112. package/src/api/control.js +76 -76
  113. package/src/api/fault.js +66 -66
  114. package/src/api/index.js +24 -24
  115. package/src/api/login.js +46 -46
  116. package/src/api/optimize.js +72 -72
  117. package/src/api/param.js +154 -154
  118. package/src/api/passwdAssest.js +101 -101
  119. package/src/api/template.js +27 -27
  120. package/src/i18n/index.js +26 -26
  121. package/src/i18n/language/en.js +1111 -1111
  122. package/src/i18n/language/index.js +25 -25
  123. package/src/i18n/language/zh.js +1110 -1110
  124. package/src/icons/demo.css +539 -539
  125. package/src/icons/iconfont.css +835 -835
  126. package/src/icons/iconfont.json +1444 -1444
  127. package/src/icons/index.js +20 -20
  128. package/src/icons/svg/bendi.svg +110 -110
  129. package/src/icons/svg/bujin.svg +36 -36
  130. package/src/icons/svg/connectBlue.svg +7 -7
  131. package/src/icons/svg/currentvolume.svg +0 -0
  132. package/src/icons/svg/cutRed.svg +7 -7
  133. package/src/icons/svg/cycle.svg +0 -0
  134. package/src/icons/svg/dingzhouqi.svg +34 -34
  135. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  136. package/src/icons/svg/guandeng.svg +81 -81
  137. package/src/icons/svg/huangshan.svg +71 -71
  138. package/src/icons/svg/maincontrol.svg +0 -0
  139. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  140. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  141. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  142. package/src/icons/svg/model.svg +0 -0
  143. package/src/icons/svg/phasediff.svg +0 -0
  144. package/src/icons/svg/quanhong.svg +86 -86
  145. package/src/icons/svg/shanghe.svg +11 -11
  146. package/src/icons/svg/shoudong.svg +103 -103
  147. package/src/icons/svg/time.svg +0 -0
  148. package/src/icons/svg/wuxianlan.svg +46 -46
  149. package/src/icons/svg/xiala.svg +11 -11
  150. package/src/icons/svg/xingrenguojie.svg +33 -33
  151. package/src/icons/svg/xitong.svg +89 -89
  152. package/src/icons/svg/youxian.svg +41 -41
  153. package/src/icons/svg/zizhukongzhi.svg +43 -43
  154. package/src/kisscomps/components/BoardCard/BoardCard.vue +89 -89
  155. package/src/kisscomps/components/BoardCard/index.js +2 -2
  156. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +118 -118
  157. package/src/kisscomps/components/CommonKanban/index.js +2 -2
  158. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +114 -114
  159. package/src/kisscomps/components/ExpendConfig/index.js +2 -2
  160. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +170 -170
  161. package/src/kisscomps/components/FaultDetailModal/index.js +2 -2
  162. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +497 -497
  163. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  164. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PatternWalkSvg.vue +429 -429
  165. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  166. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  167. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  168. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  169. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  170. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  171. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1179 -1179
  172. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  173. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  174. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  175. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  176. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  177. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  178. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  179. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  180. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  181. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  182. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  183. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  184. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  185. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  186. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  187. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +912 -912
  188. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +112 -112
  189. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +112 -112
  190. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +111 -111
  191. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  192. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  193. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +99 -99
  194. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +99 -99
  195. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  196. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +99 -99
  197. package/src/kisscomps/components/IntersectionMap/crossDirection/utils.js +78 -78
  198. package/src/kisscomps/components/IntersectionMap/index.js +2 -2
  199. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +153 -153
  200. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +518 -518
  201. package/src/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  202. package/src/kisscomps/components/KanBan/index.js +2 -2
  203. package/src/kisscomps/components/KanBan/kanban.vue +219 -219
  204. package/src/kisscomps/components/OverLap/OverLap.vue +207 -207
  205. package/src/kisscomps/components/OverLap/index.js +2 -2
  206. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +886 -886
  207. package/src/kisscomps/components/PatternStatus/index.js +2 -2
  208. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +418 -418
  209. package/src/kisscomps/components/PatternWalkSvg/index.js +2 -2
  210. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  211. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  212. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  213. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  214. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  215. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  216. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  217. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +739 -739
  218. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +195 -195
  219. package/src/kisscomps/components/SchemeConfig/index.js +2 -2
  220. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +198 -198
  221. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +219 -219
  222. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +263 -263
  223. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1384 -1384
  224. package/src/kisscomps/components/StageBord/StageBord.vue +242 -242
  225. package/src/kisscomps/components/StageBord/index.js +2 -2
  226. package/src/kisscomps/components/StageStatus/StageStatus.vue +306 -306
  227. package/src/kisscomps/components/StageStatus/index.js +2 -2
  228. package/src/kisscomps/components/Stages/index.vue +139 -121
  229. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  230. package/src/kisscomps/components/SvgIcon/index.js +2 -2
  231. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +522 -522
  232. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  233. package/src/kisscomps/components/overView/index.vue +676 -676
  234. package/src/kisscomps/components/patternList/index.js +2 -2
  235. package/src/kisscomps/components/patternList/patternList.vue +562 -562
  236. package/src/kisscomps/index.js +92 -92
  237. package/src/lib/publicjs/ArryListUtil.js +38 -38
  238. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  239. package/src/lib/publicjs/KissApi.js +158 -158
  240. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  241. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  242. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  243. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  244. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  245. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  246. package/src/lib/publicjs/basecomponents.js +65 -65
  247. package/src/lib/publicjs/localStorage.js +112 -112
  248. package/src/lib/publicjs/objdeepcopy.js +32 -32
  249. package/src/lib/publicjs/pageScroll.js +30 -30
  250. package/src/lib/publicjs/passwdAssest.js +101 -101
  251. package/src/lib/publicjs/styleclassfactory.js +32 -32
  252. package/src/main.js +47 -47
  253. package/src/router/index.js +36 -36
  254. package/src/store/getters.js +16 -16
  255. package/src/store/index.js +26 -26
  256. package/src/store/modules/globalParam.js +27 -27
  257. package/src/utils/ControlFormat.js +68 -68
  258. package/src/utils/RingDataModel.js +180 -180
  259. package/src/utils/auth.js +111 -111
  260. package/src/utils/dateFormat.js +41 -41
  261. package/src/utils/errorcode.js +224 -224
  262. package/src/utils/fault.js +195 -195
  263. package/src/utils/faultcode.js +209 -209
  264. package/src/utils/index.js +69 -69
  265. package/src/utils/pedphasedesc.js +119 -119
  266. package/src/utils/phasedesc.js +124 -124
  267. package/src/utils/responseMessage.js +21 -21
  268. package/src/utils/validate.js +43 -43
  269. package/src/views/home.1.vue +479 -479
  270. package/src/views/home.vue +78 -78
  271. package/src/views/intersection.vue +276 -276
  272. package/src/views/overView.vue +41 -41
  273. package/src/views/schemeconfig.vue +154 -154
  274. package/static/apiconfig.json +336 -336
  275. package/static/styles/common.scss +19 -19
  276. package/static/styles/commonkanban.scss +87 -87
  277. package/static/styles/dark/index.scss +2 -2
  278. package/static/styles/dark/theme/element-dark.scss +42 -42
  279. package/static/styles/index.scss +84 -84
  280. package/static/styles/intersection.scss +170 -170
  281. package/static/styles/light/index.scss +2 -2
  282. package/static/styles/light/theme/element-light.scss +42 -42
  283. package/static/styles/overview.scss +371 -371
  284. package/static/styles/schemeconfig.scss +405 -405
  285. package/static/styles/stages.scss +64 -64
  286. package/static/token.json +2 -2
  287. package/test/e2e/custom-assertions/elementCount.js +27 -27
  288. package/test/e2e/nightwatch.conf.js +46 -46
  289. package/test/e2e/runner.js +48 -48
  290. package/test/e2e/specs/test.js +19 -19
  291. package/test/unit/.eslintrc +7 -7
  292. package/test/unit/jest.conf.js +30 -30
  293. package/test/unit/setup.js +3 -3
  294. package/test/unit/specs/HelloWorld.spec.js +11 -11
@@ -1,886 +1,886 @@
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 v-for="(item,index2) in list" :key="index2" :class="item.controltype===99?'direction': ''">
18
- <div class="first-1" :style="{'width':item.greenWidth,'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="36px" Height="34px" :showlist="item.direction"></xdrdirselector>
25
- </div>
26
- <div class="box">
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="position:relative; width:50px;" v-for="(bus,index3) in busPhaseData" :key="index3">
33
- <i class="iconfont icon-lukouzhilu" style="position: absolute;top: 8px;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;font-size:12px;color:#454545;" v-if="bus.controltype === 4 && bus.phaseid===item.id"></i>
35
- <i class="iconfont icon-xuxiangwei" style="position: absolute;top: 8px;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;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;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;font-size:12px;color:#454545;" v-if="bus.controltype === 5 && bus.phaseid===item.id"></i>
39
- </div>
40
- </div>
41
- <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>
42
- <div class="first-1" :style="{'width':item.yellowWidth,'height':'34px','background':'#f9dc6a'}"></div>
43
- <div class="first-1" :style="{'width':item.redWidth,'height':'34px','background':'#f27979'}"></div>
44
- </div>
45
- </div>
46
- <div v-for="(item, index) in barrierList" :key="index + '1'">
47
- <div class="divider" :style="{'left':item, 'height':barrierHeight}"></div>
48
- </div>
49
- <div v-show="(syncTime && cycle && cycle>0) || (syncTime && newCycle && newCycle>0)">
50
- <div class="curTimeDiv" :style="{'left':paddingLeft, 'background-color': '#409EFF'}">{{ timeNumDevide }}</div>
51
- <div class="curTimeLine" :style="{'left':paddingLeft, 'height':barrierHeight}"></div>
52
- </div>
53
- </div>
54
- <div v-if="this.contrloType === 'stage'">
55
- <div v-for="(list, index1) in stageLists" :key="index1">
56
- <!-- <div> -->
57
- <div class="first-1" :style="{'width':list.greenWidth,'height':'34px','background':'#7ccc66'}">
58
- <el-tooltip placement="top-start" effect="light">
59
- <div slot="content">
60
- <span class="ring-nums" v-for="(pha,index) in list.phases" :key="index">
61
- P:{{pha}}
62
- </span>
63
- </div>
64
- <div style="cursor:pointer;">
65
- <div class="ring-phase">
66
- <patternwalksvg :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
67
- <xdrdirselector Width="36px" Height="34px" :showlist="list.direction"></xdrdirselector>
68
- </div>
69
- <div class="box" style="line-height:28px">
70
- <span class="ring-nums" v-for="(pha,index) in list.phases" :key="index">
71
- P:{{pha}}
72
- </span>
73
- </div>
74
- </div>
75
- </el-tooltip>
76
- </div>
77
- <!-- <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> -->
78
- <div class="first-1" :style="{'width':list.yellowWidth,'height':'34px','background':'#f9dc6a'}"></div>
79
- <div class="first-1" :style="{'width':list.redWidth,'height':'34px','background':'#f27979'}"></div>
80
- </div>
81
- </div>
82
- <!-- </div> -->
83
- </div>
84
- </template>
85
- <script>
86
- import patternwalksvg from '../PatternWalkSvg/PatternWalkSvg'
87
- import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
88
- // import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
89
- import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
90
- import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
91
- export default {
92
- name: 'pattern-list',
93
- components: {
94
- patternwalksvg,
95
- xdrdirselector
96
- },
97
- data () {
98
- return {
99
- barrierHeight: '',
100
- barrierList: [],
101
- newCycle: this.cycles,
102
- patternIds: this.patternId,
103
- newPatterns: [],
104
- newList: [],
105
- sidewalkPhaseData: [],
106
- // controlDatas: this.controlData,
107
- max: '',
108
- stageLists: [],
109
- busPhaseData: [], // 公交相位数据
110
- patternInfo: []
111
- }
112
- },
113
- props: {
114
- stagesChange: {
115
- type: Array
116
- },
117
- contrloType: {
118
- type: String
119
- },
120
- phaseList: {
121
- type: Array
122
- },
123
- patternList: {
124
- type: Array
125
- },
126
- localPatternList: {
127
- type: Array
128
- },
129
- controlData: {
130
- type: Object
131
- },
132
- cycle: {
133
- type: Number
134
- },
135
- agentId: {
136
- type: String
137
- },
138
- cycles: {
139
- type: Number
140
- },
141
- patternId: {
142
- type: Number
143
- },
144
- patternStatusList: {
145
- type: Array
146
- },
147
- syncTime: {
148
- type: Number
149
- }
150
- },
151
- computed: {
152
- paddingLeft () {
153
- let res = '0%'
154
- if (this.newCycle && this.newCycle > 0) {
155
- let curPercent = (this.newCycle - this.syncTime) / this.newCycle
156
- res = curPercent * 100 + '%'
157
- }
158
- if (this.cycle && this.cycle > 0) {
159
- let curPercent = (this.cycle - this.syncTime) / this.cycle
160
- res = curPercent * 100 + '%'
161
- }
162
- return res
163
- },
164
- timeNumDevide () {
165
- if (this.newCycle && this.newCycle > 0) {
166
- let res = (this.newCycle - this.syncTime) + '/' + this.newCycle
167
- return res
168
- }
169
- if (this.cycle && this.cycle > 0) {
170
- let res = (this.cycle - this.syncTime) + '/' + this.cycle
171
- return res
172
- }
173
- }
174
- },
175
- watch: {
176
- controlData: {
177
- handler: function (val, oldVal) {
178
- if (this.contrloType === 'stage') {
179
- this.getIndexStage()
180
- }
181
- // this.controlDatas = this.controlData
182
- this.handlePatternData()
183
- this.handleBarrierHeight()
184
- },
185
- // 深度观察监听
186
- deep: true
187
- },
188
- phaseList: {
189
- handler: function (val, oldVal) {
190
- this.getPedPhasePos()
191
- this.getBusPos()
192
- this.getStage()
193
- },
194
- // 深度观察监听
195
- deep: true
196
- },
197
- agentId: {
198
- handler: function (val, oldVal) {
199
- this.getBusPos()
200
- },
201
- // 深度观察监听
202
- deep: true
203
- },
204
- patternId: {
205
- handler: function (val, oldVal) {
206
- this.patternIds = this.patternId
207
- },
208
- // 深度观察监听
209
- deep: true
210
- },
211
- cycles: {
212
- handler: function (val, oldVal) {
213
- this.newCycle = this.cycles
214
- },
215
- // 深度观察监听
216
- deep: true
217
- },
218
- contrloType: {
219
- handler: function (val, oldVal) {
220
- if (this.contrloType === 'stage') {
221
- this.getStage()
222
- }
223
- },
224
- // 深度观察监听
225
- deep: true
226
- },
227
- stagesChange: {
228
- handler: function (val, oldVal) {
229
- if (this.contrloType === 'stage') {
230
- this.getStage()
231
- }
232
- },
233
- // 深度观察监听
234
- deep: true
235
- },
236
- patternStatusList: {
237
- handler: function (val, oldVal) {
238
- this.handleBarrierHeight() // 计算屏障高度
239
- if (this.patternStatusList && this.newCycle) {
240
- setTimeout(() => {
241
- this.handleCurrentChange(this.patternStatusList)
242
- }, 10)
243
- this.handleBarrierHeight()
244
- }
245
- },
246
- // 深度观察监听
247
- deep: true
248
- }
249
- },
250
- created () {
251
- this.globalParamModel = this.$store.getters.globalParamModel
252
- if (this.patternStatusList && this.newCycle && !this.controlData) {
253
- setTimeout(() => {
254
- this.handleCurrentChange(this.patternStatusList)
255
- this.handleBarrierHeight()
256
- }, 400)
257
- } else {
258
- this.handlePatternData()
259
- }
260
- this.PhaseDataModel = new PhaseDataModel()
261
- this.CrossDiagramMgr = new CrossDiagramMgr()
262
- this.getPedPhasePos()
263
- this.getBusPos()
264
- if (this.contrloType === 'stage') {
265
- this.getStage()
266
- }
267
- },
268
- methods: {
269
- getPed (data) {
270
- let ped = []
271
- for (let stg of data) {
272
- let peddirections = []
273
- let currPhase = this.phaseList.filter((item) => {
274
- return item.id === stg
275
- })[0]
276
- for (let walk of this.sidewalkPhaseData) {
277
- for (let ped of currPhase.peddirection) {
278
- if (stg === walk.phaseid) {
279
- let obj = {}
280
- obj.name = walk.name
281
- obj.id = walk.id
282
- if (ped === walk.id) {
283
- peddirections.push(obj)
284
- peddirections = Array.from(new Set(peddirections))
285
- }
286
- }
287
- }
288
- }
289
- ped.push(...peddirections)
290
- }
291
- return ped
292
- },
293
- handleStageData (data) {
294
- if (!data) return
295
- let stagesTemp = []
296
- let tempList = []
297
- for (let stg of data) {
298
- let directionList = []
299
- let currPhase = this.phaseList.filter((item) => {
300
- return item.id === stg
301
- })[0]
302
- if (currPhase !== undefined) {
303
- directionList.push(...currPhase.direction)
304
- directionList = Array.from(new Set(directionList))
305
- }
306
- // if (directionList.length === 0) return
307
- tempList = directionList.map(dir => ({
308
- id: dir,
309
- color: '#606266'
310
- }))
311
- stagesTemp.push(...tempList)
312
- }
313
- return stagesTemp
314
- },
315
- getIndexStage () {
316
- if (this.localPatternList.length === 0) return
317
- for (let i = 0; i < this.localPatternList.length; i++) {
318
- if (this.controlData.patternid === this.localPatternList[i].id) {
319
- if (!this.localPatternList[i].stagesList) return
320
- let stageCycleList = this.localPatternList[i].stagesList.map(item => {
321
- return item.stageSplit ? item.stageSplit : 0
322
- })
323
- let stageMaxCyle = stageCycleList.reduce((a, b) => {
324
- return a + b
325
- }, 0)
326
- this.stageLists = this.localPatternList[i].stagesList.map(item => {
327
- return {
328
- ...item,
329
- peddirection: this.getPed(item.phases ? item.phases : item.stages),
330
- direction: this.handleStageData(item.phases ? item.phases : item.stages),
331
- greenWidth: (item.green / stageMaxCyle * 100).toFixed(3) + '%',
332
- yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
333
- redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
334
- }
335
- })
336
- }
337
- }
338
- },
339
- getStage () {
340
- if (!this.stagesChange) return
341
- let stageCycleList = this.stagesChange.map(item => {
342
- return item.stageSplit ? item.stageSplit : 0
343
- })
344
- let stageMaxCyle = stageCycleList.reduce((a, b) => {
345
- return a + b
346
- }, 0)
347
- this.stageLists = this.stagesChange.map(item => {
348
- return {
349
- ...item,
350
- peddirection: this.getPed(item.phases ? item.phases : item.stages),
351
- direction: this.handleStageData(item.phases ? item.phases : item.stages),
352
- greenWidth: (item.green / stageMaxCyle * 100).toFixed(3) + '%',
353
- yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
354
- redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
355
- }
356
- })
357
- },
358
- getBusPos () {
359
- // 公交相位信息
360
- this.busPhaseData = []
361
- this.phaseList.forEach((ele, i) => {
362
- // if (ele.controltype >= 3 && ele.controltype <= 5) {
363
- ele.direction.forEach((dir, index) => {
364
- // 车道相位
365
- this.busPhaseData.push({
366
- phaseid: ele.id, // 相位id,用于对应相位状态
367
- id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
368
- name: this.PhaseDataModel.getBusPhasePos(dir).name,
369
- controltype: ele.controltype
370
- })
371
- })
372
- // }
373
- })
374
- let result = []
375
- let obj = {}
376
- for (var i = 0; i < this.busPhaseData.length; i++) {
377
- if (!obj[this.busPhaseData[i].phaseid]) {
378
- result.push(this.busPhaseData[i])
379
- obj[this.busPhaseData[i].phaseid] = true
380
- }
381
- }
382
- this.busPhaseData = result
383
- },
384
- getPedPhasePos () {
385
- // 行人相位信息
386
- this.sidewalkPhaseData = []
387
- this.phaseList.forEach((ele, i) => {
388
- if (ele.peddirection) {
389
- ele.peddirection.forEach((dir, index) => {
390
- // 行人相位
391
- if (this.PhaseDataModel.getSidePos(dir)) {
392
- this.sidewalkPhaseData.push({
393
- key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
394
- phaseid: ele.id, // 相位id,用于对应相位状态
395
- id: dir,
396
- name: this.PhaseDataModel.getSidePos(dir).name
397
- })
398
- }
399
- })
400
- }
401
- })
402
- },
403
- handlePatternData () {
404
- if (!this.controlData) return
405
- this.newList = []
406
- if (Object.keys(this.controlData).length === 0 || this.phaseList.length === 0) return
407
- if (!this.controlData.phase) return
408
- let cycle = this.controlData.cycle
409
- if (!this.controlData.rings) return
410
- for (let rings of this.controlData.rings) {
411
- let phase = this.controlData.phase
412
- let list = []
413
- for (let sequ of rings.sequence) {
414
- let obj = {}
415
- obj.id = sequ
416
- let split = phase.filter((item) => {
417
- return item.id === sequ
418
- })[0].split
419
- let currPhase = this.phaseList.filter((item) => {
420
- if (item.id === sequ && item.controltype === 99) {
421
- obj.controltype = item.controltype
422
- }
423
- return item.id === sequ
424
- })[0]
425
- if (currPhase) {
426
- obj.redWidth = (currPhase.redclear / cycle * 100).toFixed(3) + '%'
427
- obj.yellowWidth = (currPhase.yellow / cycle * 100).toFixed(3) + '%'
428
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / cycle * 100).toFixed(3) + '%'
429
- obj.flashgreen = (currPhase.flashgreen / cycle * 100).toFixed(3) + '%'
430
- // obj.peddirection = currPhase.peddirection
431
- let peddirections = []
432
- for (let walk of this.sidewalkPhaseData) {
433
- for (let ped of currPhase.peddirection) {
434
- // if (stg === walk.phaseid) {
435
- let objs = {}
436
- objs.name = walk.name
437
- objs.id = walk.id
438
- if (ped === walk.id) {
439
- peddirections.push(objs)
440
- peddirections = Array.from(new Set(peddirections))
441
- }
442
- // }
443
- }
444
- }
445
- obj.peddirection = peddirections
446
- obj.split = split
447
- obj.direction = currPhase.direction.map(item => {
448
- return {
449
- id: item,
450
- color: '#454545'
451
- }
452
- })
453
- list.push(obj)
454
- }
455
- }
456
- this.newList.push(list)
457
- this.patternInfo = [...this.newList]
458
- }
459
- },
460
- handleBarrierHeight () { // 屏障高度
461
- if (!this.patternInfo) return
462
- let patternLength = this.patternInfo.length
463
- this.barrierHeight = (patternLength * 35 + 21) + 'px'
464
- },
465
- handleCurrentChange (val) { // 两个ring的数据
466
- if (val === null || val.length === 0) return
467
- this.patternInfo = []
468
- this.barrierList = []
469
- let currentArr = []
470
- let newPattern = []
471
- val.map(i => {
472
- newPattern.push(...i)
473
- })
474
- if (this.phaseList.length === 0) return
475
- for (let patternStatus of val[0]) {
476
- if (patternStatus.mode !== 7) {
477
- let concurrent = this.phaseList.filter((item) => {
478
- return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
479
- })[0].concurrent// 当前相位的并发相位
480
- if (concurrent) {
481
- let obj = {
482
- id: patternStatus.id,
483
- current: concurrent.sort()
484
- }
485
- currentArr.push(obj)
486
- }
487
- }
488
- }
489
- if (currentArr.length !== 0) {
490
- let newCurrent = this.tranform(currentArr)
491
- let ringTeam = this.step1(this.phaseList, newCurrent)
492
- if (this.patternList) {
493
- this.setBarrier(ringTeam, val)
494
- }
495
- this.fillGap(ringTeam, val)
496
- let barrier = this.step2(ringTeam, newPattern)
497
- this.barrierList = barrier.map(j => {
498
- return (j / (this.max ? this.max : this.newCycle) * 100) + '%'
499
- })
500
- // this.barrierList.unshift(0)
501
- }
502
- for (let rings of val) {
503
- if (rings.length === 0) continue
504
- let list = []
505
- for (let ring of rings) {
506
- if (ring.value === 0) continue
507
- let obj = {}
508
- let split = ring.value
509
- obj.id = ring.id
510
- // obj.split = split
511
- let currPhase = this.phaseList.filter((item) => {
512
- if (item.id === ring.id && item.controltype === 99) {
513
- obj.controltype = item.controltype
514
- }
515
- return item.id === ring.id
516
- })[0]
517
- if (ring.desc) {
518
- obj.direction = ring.desc.map(item => { // 虚相位desc为空
519
- return {
520
- id: item.id,
521
- color: '#454545'
522
- }
523
- })
524
- } else {
525
- obj.direction = currPhase.direction.map(item => {
526
- return {
527
- id: item,
528
- color: '#454545'
529
- }
530
- })
531
- }
532
- if (ring.sum) {
533
- obj.split = split + ring.sum
534
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen + ring.sum) / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
535
- } else {
536
- obj.split = split
537
- obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
538
- }
539
- obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
540
- obj.redWidth = (currPhase.redclear / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
541
- obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
542
- // obj.peddirection = currPhase.peddirection
543
- let peddirections = []
544
- for (let walk of this.sidewalkPhaseData) {
545
- for (let ped of currPhase.peddirection) {
546
- // if (stg === walk.phaseid) {
547
- let objs = {}
548
- objs.name = walk.name
549
- objs.id = walk.id
550
- if (ped === walk.id) {
551
- peddirections.push(objs)
552
- peddirections = Array.from(new Set(peddirections))
553
- }
554
- // }
555
- }
556
- }
557
- obj.peddirection = peddirections
558
- // 忽略相位不显示
559
- let mode = ring.mode
560
- if (mode !== 7) { // 忽略相位不显示
561
- list.push(obj)
562
- }
563
- }
564
- this.patternInfo.push(list)
565
- }
566
- },
567
- setBarrier (ringTeam, val) { // 添加特征参数barrier
568
- this.patternList.map(item => {
569
- if (item.id === this.patternIds) {
570
- const patternObjs = {}
571
- val.forEach(l => {
572
- l.map(k => {
573
- patternObjs[k.id] = k.value
574
- })
575
- })
576
- let ret = ringTeam.map((y, index) => {
577
- y.map(n => {
578
- n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
579
- })
580
- return {
581
- barrier: index + 1,
582
- length: y[0].length,
583
- items: y.map(j => {
584
- return {
585
- ring: j.ring,
586
- data: j.data
587
- }
588
- })
589
- }
590
- })
591
- item.barriers = ret
592
- }
593
- })
594
- },
595
- tranform (arr) { // 分barrier
596
- let newMap = new Map()
597
- arr.forEach(({id, current}) => {
598
- const find = newMap.get(current.join())
599
- if (find) newMap.get(current.join()).push(id)
600
- else newMap.set(current.join(), [id])
601
- })
602
- let ret = []
603
- newMap.forEach((value, key) => {
604
- ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
605
- })
606
- const result = []
607
- for (const a of ret) {
608
- let merged = false
609
- for (const r of result) {
610
- if (this.check([...r], a)) {
611
- a.forEach(item => r.add(item))
612
- merged = true
613
- }
614
- }
615
- if (!merged) {
616
- result.push(new Set(a))
617
- }
618
- merged = false
619
- }
620
- return result.map(s => [...s])
621
- },
622
- check (arr1, arr2) {
623
- return arr1.some(a1 => arr2.some(a2 => a1 === a2))
624
- },
625
- step1 (list, arr) { // 各个环包含的相位
626
- const ret = []
627
- const listObj = {}
628
- list.forEach(l => {
629
- listObj[l.id] = l.ring
630
- })
631
- arr.forEach(a => {
632
- const retItem = []
633
- a.forEach(b => {
634
- if (listObj[b]) {
635
- const find = retItem.find(r => r.ring === listObj[b])
636
- if (find) find.data.push(b)
637
- else retItem.push({ring: listObj[b], data: [b]})
638
- }
639
- })
640
- ret.push(retItem)
641
- })
642
- return ret
643
- },
644
- step2 (newArr, pattern) { // 不同环并发相位做比较
645
- let ret = []
646
- const patternObj = {}
647
- pattern.forEach(l => {
648
- if (l.mode !== 7) {
649
- patternObj[l.id] = l.value
650
- }
651
- })
652
- newArr.forEach((na, index) => {
653
- let max = 0
654
- na.forEach(n => {
655
- const total = n.data.reduce((pre, cur) => pre + patternObj[cur], 0)
656
- if (total > max) {
657
- max = total
658
- }
659
- })
660
- while (index > 0 && max < this.newCycle) { // && max < _this.newCycle
661
- index--
662
- max += ret[index]
663
- }
664
- ret.push(max)
665
- })
666
- return ret
667
- },
668
- fillGap (newArr, pattern) {
669
- this.newPatterns = []
670
- const patternObj = {}
671
- pattern.forEach(l => {
672
- l.map(k => {
673
- if (k.mode !== 7) {
674
- patternObj[k.id] = k.value
675
- }
676
- })
677
- })
678
- let newMax = []
679
- let newMin = []
680
- newArr.forEach((na, index) => {
681
- na.map(n => {
682
- n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObj[cur], 0) : patternObj[n.data[0]]
683
- })
684
- let maxNum = Math.max.apply(Math, na.map(item => { return item.length }))
685
- let minNum = Math.min.apply(Math, na.map(item => { return item.length }))
686
- newMax.push(maxNum)
687
- newMin.push(minNum)
688
- let newmaxNum = Math.max.apply(Math, newMax)// 每组最大值
689
- let newminNum = Math.min.apply(Math, newMin)
690
- if (newmaxNum === newminNum) {
691
- this.newCycle = newmaxNum + newminNum
692
- this.max = newmaxNum + newminNum
693
- pattern.map(d => {
694
- d.map(r => {
695
- if (r.sum && r.mode !== 7) {
696
- delete r.sum
697
- }
698
- })
699
- })
700
- }
701
- if (maxNum === minNum) {
702
- na.map(n => {
703
- pattern.map(h => {
704
- h.map(d => {
705
- if (d.id === n.data[1] && d.sum && d.mode !== 7) {
706
- delete d.sum
707
- }
708
- })
709
- })
710
- })
711
- } else {
712
- na.map(n => {
713
- if (n.length === maxNum) {
714
- pattern.map(h => {
715
- h.map(d => {
716
- if (n.data.length > 1) {
717
- if (d.id === n.data[1] && d.mode !== 7) {
718
- delete d.sum
719
- }
720
- } else {
721
- if (d.id === n.data[0] && d.mode !== 7) {
722
- delete d.sum
723
- }
724
- }
725
- })
726
- })
727
- }
728
- })
729
- }
730
- na.forEach((value, index, array) => {
731
- if (value.length !== maxNum) {
732
- let newNa = []
733
- newNa.push(value)
734
- newNa.forEach(m => {
735
- let sum = Number(maxNum - m.length)
736
- pattern.filter((i) => {
737
- i.map(j => {
738
- if (m.data.length > 1) {
739
- if (j.id === m.data[1] && j.mode !== 7) {
740
- j.sum = sum
741
- }
742
- } else {
743
- if (j.id === m.data[0] && j.mode !== 7) {
744
- j.sum = sum
745
- }
746
- }
747
- })
748
- })
749
- })
750
- }
751
- let mapAdd = pattern.map(item => {
752
- return item.map(val => {
753
- return val.mode === 7 ? 0 : val.value + (val.sum ? val.sum : 0)
754
- })
755
- })
756
- let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
757
- return item.length > 0 ? item.reduce((a, b) => {
758
- return a + b
759
- }) : 0
760
- }) : 0
761
- this.max = Math.max(...maxCycle)// 每个环的周期最大值
762
- })
763
- })
764
- }
765
- }
766
- }
767
- </script>
768
- <style lang="scss">
769
- // el-tooltip样式
770
- .el-tooltip__popper.is-light {
771
- background: #409EFF !important;
772
- border: 1px solid #409EFF !important;
773
- color: #FFFFFF !important;
774
- }
775
- .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow {
776
- border-top-color: #409EFF !important;
777
- }
778
- .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow::after {
779
- border-top-color: #409EFF !important;
780
- }
781
- </style>
782
- <style lang="scss" scoped>
783
- .main-patternstatus {
784
- position: relative;
785
- margin-bottom: 20px;
786
- }
787
- .main-patternstatus {
788
- position: relative;
789
- .ring-first {
790
- margin-top: 1px;
791
- width: 100%;
792
- height: 34px;
793
- }
794
- .first-1 {
795
- float: left;
796
- // text-align: center;
797
- }
798
- // .ring-num {
799
- // float: left;
800
- // margin-top:7px;
801
- // margin-left: 5px;
802
- // font-size: 14px;
803
- // font-weight: normal;
804
- // font-stretch: normal;
805
- // line-height: 22px;
806
- // letter-spacing: 0px;
807
- // color: #ffffff;
808
- // }
809
- .box {
810
- float: left;
811
- margin-left: 6px;
812
- margin-right: 10px;
813
- }
814
- .ring-nums {
815
- // float: left;
816
- // margin-top:7px;
817
- // margin-left: 5px;
818
- font-size: 12px;
819
- height: 14px;
820
- font-weight: normal;
821
- font-stretch: normal;
822
- // line-height: 22px;
823
- letter-spacing: 0px;
824
- color: #333333;
825
- }
826
- .ring-phase {
827
- position: relative;
828
- float: left;
829
- // margin-left: 5px;
830
- height: 34px;
831
- z-index: 999;
832
- background: rgba(30, 96, 12, 0.2);
833
- // margin-top:1px;
834
- }
835
- .ring-phase::after {
836
- position: absolute;
837
- display: block;
838
- content: '';
839
- height: 0;
840
- width: 0;
841
- top: 11px;
842
- left: 36px;
843
- border: 5px solid transparent;
844
- border-left-color: rgba(30, 96, 12, 0.2);
845
- }
846
- .divider {
847
- position: absolute;
848
- top: -10px;
849
- // left: 370px;
850
- width: 3px;
851
- // height: 99px;
852
- z-index: 999;
853
- background-color:#B9BABF;
854
- }
855
- .curTimeLine {
856
- position: absolute;
857
- top: -10px;
858
- width: 2px;
859
- background-color: #409EFF;
860
- }
861
- .curTimeDiv {
862
- position: absolute;
863
- z-index:50;
864
- top: -21px;
865
- margin-left: -30px;
866
- text-align:center;
867
- vertical-align: middle;
868
- width: 60px;
869
- height: 19px;
870
- color:#FFFFFF;
871
- background-color: #409EFF;
872
- }
873
- }
874
- .ring-first {
875
- margin-top: 1px;
876
- width: 100%;
877
- height: 34px;
878
- }
879
- .direction {
880
- opacity: 0.6;
881
- }
882
- .first-1 {
883
- float: left;
884
- // text-align: center;
885
- }
886
- </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 v-for="(item,index2) in list" :key="index2" :class="item.controltype===99?'direction': ''">
18
+ <div class="first-1" :style="{'width':item.greenWidth,'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="36px" Height="34px" :showlist="item.direction"></xdrdirselector>
25
+ </div>
26
+ <div class="box">
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="position:relative; width:50px;" v-for="(bus,index3) in busPhaseData" :key="index3">
33
+ <i class="iconfont icon-lukouzhilu" style="position: absolute;top: 8px;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;font-size:12px;color:#454545;" v-if="bus.controltype === 4 && bus.phaseid===item.id"></i>
35
+ <i class="iconfont icon-xuxiangwei" style="position: absolute;top: 8px;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;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;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;font-size:12px;color:#454545;" v-if="bus.controltype === 5 && bus.phaseid===item.id"></i>
39
+ </div>
40
+ </div>
41
+ <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>
42
+ <div class="first-1" :style="{'width':item.yellowWidth,'height':'34px','background':'#f9dc6a'}"></div>
43
+ <div class="first-1" :style="{'width':item.redWidth,'height':'34px','background':'#f27979'}"></div>
44
+ </div>
45
+ </div>
46
+ <div v-for="(item, index) in barrierList" :key="index + '1'">
47
+ <div class="divider" :style="{'left':item, 'height':barrierHeight}"></div>
48
+ </div>
49
+ <div v-show="(syncTime && cycle && cycle>0) || (syncTime && newCycle && newCycle>0)">
50
+ <div class="curTimeDiv" :style="{'left':paddingLeft, 'background-color': '#409EFF'}">{{ timeNumDevide }}</div>
51
+ <div class="curTimeLine" :style="{'left':paddingLeft, 'height':barrierHeight}"></div>
52
+ </div>
53
+ </div>
54
+ <div v-if="this.contrloType === 'stage'">
55
+ <div v-for="(list, index1) in stageLists" :key="index1">
56
+ <!-- <div> -->
57
+ <div class="first-1" :style="{'width':list.greenWidth,'height':'34px','background':'#7ccc66'}">
58
+ <el-tooltip placement="top-start" effect="light">
59
+ <div slot="content">
60
+ <span class="ring-nums" v-for="(pha,index) in list.phases" :key="index">
61
+ P:{{pha}}
62
+ </span>
63
+ </div>
64
+ <div style="cursor:pointer;">
65
+ <div class="ring-phase">
66
+ <patternwalksvg :showWalk="list.peddirection" :Width="'32'" :Height="'34'"></patternwalksvg>
67
+ <xdrdirselector Width="36px" Height="34px" :showlist="list.direction"></xdrdirselector>
68
+ </div>
69
+ <div class="box" style="line-height:28px">
70
+ <span class="ring-nums" v-for="(pha,index) in list.phases" :key="index">
71
+ P:{{pha}}
72
+ </span>
73
+ </div>
74
+ </div>
75
+ </el-tooltip>
76
+ </div>
77
+ <!-- <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> -->
78
+ <div class="first-1" :style="{'width':list.yellowWidth,'height':'34px','background':'#f9dc6a'}"></div>
79
+ <div class="first-1" :style="{'width':list.redWidth,'height':'34px','background':'#f27979'}"></div>
80
+ </div>
81
+ </div>
82
+ <!-- </div> -->
83
+ </div>
84
+ </template>
85
+ <script>
86
+ import patternwalksvg from '../PatternWalkSvg/PatternWalkSvg'
87
+ import xdrdirselector from '../XRDDirSelector/XRDDirSelector'
88
+ // import PatternWalkSvg from '../IntersectionMap/crossDirection/baseImg/PatternWalkSvg'
89
+ import PhaseDataModel from '../IntersectionMap/crossDirection/utils.js'
90
+ import CrossDiagramMgr from '../../../EdgeMgr/controller/crossDiagramMgr.js'
91
+ export default {
92
+ name: 'pattern-list',
93
+ components: {
94
+ patternwalksvg,
95
+ xdrdirselector
96
+ },
97
+ data () {
98
+ return {
99
+ barrierHeight: '',
100
+ barrierList: [],
101
+ newCycle: this.cycles,
102
+ patternIds: this.patternId,
103
+ newPatterns: [],
104
+ newList: [],
105
+ sidewalkPhaseData: [],
106
+ // controlDatas: this.controlData,
107
+ max: '',
108
+ stageLists: [],
109
+ busPhaseData: [], // 公交相位数据
110
+ patternInfo: []
111
+ }
112
+ },
113
+ props: {
114
+ stagesChange: {
115
+ type: Array
116
+ },
117
+ contrloType: {
118
+ type: String
119
+ },
120
+ phaseList: {
121
+ type: Array
122
+ },
123
+ patternList: {
124
+ type: Array
125
+ },
126
+ localPatternList: {
127
+ type: Array
128
+ },
129
+ controlData: {
130
+ type: Object
131
+ },
132
+ cycle: {
133
+ type: Number
134
+ },
135
+ agentId: {
136
+ type: String
137
+ },
138
+ cycles: {
139
+ type: Number
140
+ },
141
+ patternId: {
142
+ type: Number
143
+ },
144
+ patternStatusList: {
145
+ type: Array
146
+ },
147
+ syncTime: {
148
+ type: Number
149
+ }
150
+ },
151
+ computed: {
152
+ paddingLeft () {
153
+ let res = '0%'
154
+ if (this.newCycle && this.newCycle > 0) {
155
+ let curPercent = (this.newCycle - this.syncTime) / this.newCycle
156
+ res = curPercent * 100 + '%'
157
+ }
158
+ if (this.cycle && this.cycle > 0) {
159
+ let curPercent = (this.cycle - this.syncTime) / this.cycle
160
+ res = curPercent * 100 + '%'
161
+ }
162
+ return res
163
+ },
164
+ timeNumDevide () {
165
+ if (this.newCycle && this.newCycle > 0) {
166
+ let res = (this.newCycle - this.syncTime) + '/' + this.newCycle
167
+ return res
168
+ }
169
+ if (this.cycle && this.cycle > 0) {
170
+ let res = (this.cycle - this.syncTime) + '/' + this.cycle
171
+ return res
172
+ }
173
+ }
174
+ },
175
+ watch: {
176
+ controlData: {
177
+ handler: function (val, oldVal) {
178
+ if (this.contrloType === 'stage') {
179
+ this.getIndexStage()
180
+ }
181
+ // this.controlDatas = this.controlData
182
+ this.handlePatternData()
183
+ this.handleBarrierHeight()
184
+ },
185
+ // 深度观察监听
186
+ deep: true
187
+ },
188
+ phaseList: {
189
+ handler: function (val, oldVal) {
190
+ this.getPedPhasePos()
191
+ this.getBusPos()
192
+ this.getStage()
193
+ },
194
+ // 深度观察监听
195
+ deep: true
196
+ },
197
+ agentId: {
198
+ handler: function (val, oldVal) {
199
+ this.getBusPos()
200
+ },
201
+ // 深度观察监听
202
+ deep: true
203
+ },
204
+ patternId: {
205
+ handler: function (val, oldVal) {
206
+ this.patternIds = this.patternId
207
+ },
208
+ // 深度观察监听
209
+ deep: true
210
+ },
211
+ cycles: {
212
+ handler: function (val, oldVal) {
213
+ this.newCycle = this.cycles
214
+ },
215
+ // 深度观察监听
216
+ deep: true
217
+ },
218
+ contrloType: {
219
+ handler: function (val, oldVal) {
220
+ if (this.contrloType === 'stage') {
221
+ this.getStage()
222
+ }
223
+ },
224
+ // 深度观察监听
225
+ deep: true
226
+ },
227
+ stagesChange: {
228
+ handler: function (val, oldVal) {
229
+ if (this.contrloType === 'stage') {
230
+ this.getStage()
231
+ }
232
+ },
233
+ // 深度观察监听
234
+ deep: true
235
+ },
236
+ patternStatusList: {
237
+ handler: function (val, oldVal) {
238
+ this.handleBarrierHeight() // 计算屏障高度
239
+ if (this.patternStatusList && this.newCycle) {
240
+ setTimeout(() => {
241
+ this.handleCurrentChange(this.patternStatusList)
242
+ }, 10)
243
+ this.handleBarrierHeight()
244
+ }
245
+ },
246
+ // 深度观察监听
247
+ deep: true
248
+ }
249
+ },
250
+ created () {
251
+ this.globalParamModel = this.$store.getters.globalParamModel
252
+ if (this.patternStatusList && this.newCycle && !this.controlData) {
253
+ setTimeout(() => {
254
+ this.handleCurrentChange(this.patternStatusList)
255
+ this.handleBarrierHeight()
256
+ }, 400)
257
+ } else {
258
+ this.handlePatternData()
259
+ }
260
+ this.PhaseDataModel = new PhaseDataModel()
261
+ this.CrossDiagramMgr = new CrossDiagramMgr()
262
+ this.getPedPhasePos()
263
+ this.getBusPos()
264
+ if (this.contrloType === 'stage') {
265
+ this.getStage()
266
+ }
267
+ },
268
+ methods: {
269
+ getPed (data) {
270
+ let ped = []
271
+ for (let stg of data) {
272
+ let peddirections = []
273
+ let currPhase = this.phaseList.filter((item) => {
274
+ return item.id === stg
275
+ })[0]
276
+ for (let walk of this.sidewalkPhaseData) {
277
+ for (let ped of currPhase.peddirection) {
278
+ if (stg === walk.phaseid) {
279
+ let obj = {}
280
+ obj.name = walk.name
281
+ obj.id = walk.id
282
+ if (ped === walk.id) {
283
+ peddirections.push(obj)
284
+ peddirections = Array.from(new Set(peddirections))
285
+ }
286
+ }
287
+ }
288
+ }
289
+ ped.push(...peddirections)
290
+ }
291
+ return ped
292
+ },
293
+ handleStageData (data) {
294
+ if (!data) return
295
+ let stagesTemp = []
296
+ let tempList = []
297
+ for (let stg of data) {
298
+ let directionList = []
299
+ let currPhase = this.phaseList.filter((item) => {
300
+ return item.id === stg
301
+ })[0]
302
+ if (currPhase !== undefined) {
303
+ directionList.push(...currPhase.direction)
304
+ directionList = Array.from(new Set(directionList))
305
+ }
306
+ // if (directionList.length === 0) return
307
+ tempList = directionList.map(dir => ({
308
+ id: dir,
309
+ color: '#606266'
310
+ }))
311
+ stagesTemp.push(...tempList)
312
+ }
313
+ return stagesTemp
314
+ },
315
+ getIndexStage () {
316
+ if (this.localPatternList.length === 0) return
317
+ for (let i = 0; i < this.localPatternList.length; i++) {
318
+ if (this.controlData.patternid === this.localPatternList[i].id) {
319
+ if (!this.localPatternList[i].stagesList) return
320
+ let stageCycleList = this.localPatternList[i].stagesList.map(item => {
321
+ return item.stageSplit ? item.stageSplit : 0
322
+ })
323
+ let stageMaxCyle = stageCycleList.reduce((a, b) => {
324
+ return a + b
325
+ }, 0)
326
+ this.stageLists = this.localPatternList[i].stagesList.map(item => {
327
+ return {
328
+ ...item,
329
+ peddirection: this.getPed(item.phases ? item.phases : item.stages),
330
+ direction: this.handleStageData(item.phases ? item.phases : item.stages),
331
+ greenWidth: (item.green / stageMaxCyle * 100).toFixed(3) + '%',
332
+ yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
333
+ redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
334
+ }
335
+ })
336
+ }
337
+ }
338
+ },
339
+ getStage () {
340
+ if (!this.stagesChange) return
341
+ let stageCycleList = this.stagesChange.map(item => {
342
+ return item.stageSplit ? item.stageSplit : 0
343
+ })
344
+ let stageMaxCyle = stageCycleList.reduce((a, b) => {
345
+ return a + b
346
+ }, 0)
347
+ this.stageLists = this.stagesChange.map(item => {
348
+ return {
349
+ ...item,
350
+ peddirection: this.getPed(item.phases ? item.phases : item.stages),
351
+ direction: this.handleStageData(item.phases ? item.phases : item.stages),
352
+ greenWidth: (item.green / stageMaxCyle * 100).toFixed(3) + '%',
353
+ yellowWidth: (item.yellow / stageMaxCyle * 100).toFixed(3) + '%',
354
+ redWidth: (item.red / stageMaxCyle * 100).toFixed(3) + '%'
355
+ }
356
+ })
357
+ },
358
+ getBusPos () {
359
+ // 公交相位信息
360
+ this.busPhaseData = []
361
+ this.phaseList.forEach((ele, i) => {
362
+ // if (ele.controltype >= 3 && ele.controltype <= 5) {
363
+ ele.direction.forEach((dir, index) => {
364
+ // 车道相位
365
+ this.busPhaseData.push({
366
+ phaseid: ele.id, // 相位id,用于对应相位状态
367
+ id: dir, // 接口返回的dir字段,对应前端定义的相位方向id,唯一标识
368
+ name: this.PhaseDataModel.getBusPhasePos(dir).name,
369
+ controltype: ele.controltype
370
+ })
371
+ })
372
+ // }
373
+ })
374
+ let result = []
375
+ let obj = {}
376
+ for (var i = 0; i < this.busPhaseData.length; i++) {
377
+ if (!obj[this.busPhaseData[i].phaseid]) {
378
+ result.push(this.busPhaseData[i])
379
+ obj[this.busPhaseData[i].phaseid] = true
380
+ }
381
+ }
382
+ this.busPhaseData = result
383
+ },
384
+ getPedPhasePos () {
385
+ // 行人相位信息
386
+ this.sidewalkPhaseData = []
387
+ this.phaseList.forEach((ele, i) => {
388
+ if (ele.peddirection) {
389
+ ele.peddirection.forEach((dir, index) => {
390
+ // 行人相位
391
+ if (this.PhaseDataModel.getSidePos(dir)) {
392
+ this.sidewalkPhaseData.push({
393
+ key: this.CrossDiagramMgr.getUniqueKey('pedphase'),
394
+ phaseid: ele.id, // 相位id,用于对应相位状态
395
+ id: dir,
396
+ name: this.PhaseDataModel.getSidePos(dir).name
397
+ })
398
+ }
399
+ })
400
+ }
401
+ })
402
+ },
403
+ handlePatternData () {
404
+ if (!this.controlData) return
405
+ this.newList = []
406
+ if (Object.keys(this.controlData).length === 0 || this.phaseList.length === 0) return
407
+ if (!this.controlData.phase) return
408
+ let cycle = this.controlData.cycle
409
+ if (!this.controlData.rings) return
410
+ for (let rings of this.controlData.rings) {
411
+ let phase = this.controlData.phase
412
+ let list = []
413
+ for (let sequ of rings.sequence) {
414
+ let obj = {}
415
+ obj.id = sequ
416
+ let split = phase.filter((item) => {
417
+ return item.id === sequ
418
+ })[0].split
419
+ let currPhase = this.phaseList.filter((item) => {
420
+ if (item.id === sequ && item.controltype === 99) {
421
+ obj.controltype = item.controltype
422
+ }
423
+ return item.id === sequ
424
+ })[0]
425
+ if (currPhase) {
426
+ obj.redWidth = (currPhase.redclear / cycle * 100).toFixed(3) + '%'
427
+ obj.yellowWidth = (currPhase.yellow / cycle * 100).toFixed(3) + '%'
428
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / cycle * 100).toFixed(3) + '%'
429
+ obj.flashgreen = (currPhase.flashgreen / cycle * 100).toFixed(3) + '%'
430
+ // obj.peddirection = currPhase.peddirection
431
+ let peddirections = []
432
+ for (let walk of this.sidewalkPhaseData) {
433
+ for (let ped of currPhase.peddirection) {
434
+ // if (stg === walk.phaseid) {
435
+ let objs = {}
436
+ objs.name = walk.name
437
+ objs.id = walk.id
438
+ if (ped === walk.id) {
439
+ peddirections.push(objs)
440
+ peddirections = Array.from(new Set(peddirections))
441
+ }
442
+ // }
443
+ }
444
+ }
445
+ obj.peddirection = peddirections
446
+ obj.split = split
447
+ obj.direction = currPhase.direction.map(item => {
448
+ return {
449
+ id: item,
450
+ color: '#454545'
451
+ }
452
+ })
453
+ list.push(obj)
454
+ }
455
+ }
456
+ this.newList.push(list)
457
+ this.patternInfo = [...this.newList]
458
+ }
459
+ },
460
+ handleBarrierHeight () { // 屏障高度
461
+ if (!this.patternInfo) return
462
+ let patternLength = this.patternInfo.length
463
+ this.barrierHeight = (patternLength * 35 + 21) + 'px'
464
+ },
465
+ handleCurrentChange (val) { // 两个ring的数据
466
+ if (val === null || val.length === 0) return
467
+ this.patternInfo = []
468
+ this.barrierList = []
469
+ let currentArr = []
470
+ let newPattern = []
471
+ val.map(i => {
472
+ newPattern.push(...i)
473
+ })
474
+ if (this.phaseList.length === 0) return
475
+ for (let patternStatus of val[0]) {
476
+ if (patternStatus.mode !== 7) {
477
+ let concurrent = this.phaseList.filter((item) => {
478
+ return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
479
+ })[0].concurrent// 当前相位的并发相位
480
+ if (concurrent) {
481
+ let obj = {
482
+ id: patternStatus.id,
483
+ current: concurrent.sort()
484
+ }
485
+ currentArr.push(obj)
486
+ }
487
+ }
488
+ }
489
+ if (currentArr.length !== 0) {
490
+ let newCurrent = this.tranform(currentArr)
491
+ let ringTeam = this.step1(this.phaseList, newCurrent)
492
+ if (this.patternList) {
493
+ this.setBarrier(ringTeam, val)
494
+ }
495
+ this.fillGap(ringTeam, val)
496
+ let barrier = this.step2(ringTeam, newPattern)
497
+ this.barrierList = barrier.map(j => {
498
+ return (j / (this.max ? this.max : this.newCycle) * 100) + '%'
499
+ })
500
+ // this.barrierList.unshift(0)
501
+ }
502
+ for (let rings of val) {
503
+ if (rings.length === 0) continue
504
+ let list = []
505
+ for (let ring of rings) {
506
+ if (ring.value === 0) continue
507
+ let obj = {}
508
+ let split = ring.value
509
+ obj.id = ring.id
510
+ // obj.split = split
511
+ let currPhase = this.phaseList.filter((item) => {
512
+ if (item.id === ring.id && item.controltype === 99) {
513
+ obj.controltype = item.controltype
514
+ }
515
+ return item.id === ring.id
516
+ })[0]
517
+ if (ring.desc) {
518
+ obj.direction = ring.desc.map(item => { // 虚相位desc为空
519
+ return {
520
+ id: item.id,
521
+ color: '#454545'
522
+ }
523
+ })
524
+ } else {
525
+ obj.direction = currPhase.direction.map(item => {
526
+ return {
527
+ id: item,
528
+ color: '#454545'
529
+ }
530
+ })
531
+ }
532
+ if (ring.sum) {
533
+ obj.split = split + ring.sum
534
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen + ring.sum) / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
535
+ } else {
536
+ obj.split = split
537
+ obj.greenWidth = ((split - currPhase.redclear - currPhase.yellow - currPhase.flashgreen) / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
538
+ }
539
+ obj.flashgreen = (currPhase.flashgreen / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
540
+ obj.redWidth = (currPhase.redclear / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
541
+ obj.yellowWidth = (currPhase.yellow / (this.max ? this.max : this.newCycle) * 100).toFixed(3) + '%'
542
+ // obj.peddirection = currPhase.peddirection
543
+ let peddirections = []
544
+ for (let walk of this.sidewalkPhaseData) {
545
+ for (let ped of currPhase.peddirection) {
546
+ // if (stg === walk.phaseid) {
547
+ let objs = {}
548
+ objs.name = walk.name
549
+ objs.id = walk.id
550
+ if (ped === walk.id) {
551
+ peddirections.push(objs)
552
+ peddirections = Array.from(new Set(peddirections))
553
+ }
554
+ // }
555
+ }
556
+ }
557
+ obj.peddirection = peddirections
558
+ // 忽略相位不显示
559
+ let mode = ring.mode
560
+ if (mode !== 7) { // 忽略相位不显示
561
+ list.push(obj)
562
+ }
563
+ }
564
+ this.patternInfo.push(list)
565
+ }
566
+ },
567
+ setBarrier (ringTeam, val) { // 添加特征参数barrier
568
+ this.patternList.map(item => {
569
+ if (item.id === this.patternIds) {
570
+ const patternObjs = {}
571
+ val.forEach(l => {
572
+ l.map(k => {
573
+ patternObjs[k.id] = k.value
574
+ })
575
+ })
576
+ let ret = ringTeam.map((y, index) => {
577
+ y.map(n => {
578
+ n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
579
+ })
580
+ return {
581
+ barrier: index + 1,
582
+ length: y[0].length,
583
+ items: y.map(j => {
584
+ return {
585
+ ring: j.ring,
586
+ data: j.data
587
+ }
588
+ })
589
+ }
590
+ })
591
+ item.barriers = ret
592
+ }
593
+ })
594
+ },
595
+ tranform (arr) { // 分barrier
596
+ let newMap = new Map()
597
+ arr.forEach(({id, current}) => {
598
+ const find = newMap.get(current.join())
599
+ if (find) newMap.get(current.join()).push(id)
600
+ else newMap.set(current.join(), [id])
601
+ })
602
+ let ret = []
603
+ newMap.forEach((value, key) => {
604
+ ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
605
+ })
606
+ const result = []
607
+ for (const a of ret) {
608
+ let merged = false
609
+ for (const r of result) {
610
+ if (this.check([...r], a)) {
611
+ a.forEach(item => r.add(item))
612
+ merged = true
613
+ }
614
+ }
615
+ if (!merged) {
616
+ result.push(new Set(a))
617
+ }
618
+ merged = false
619
+ }
620
+ return result.map(s => [...s])
621
+ },
622
+ check (arr1, arr2) {
623
+ return arr1.some(a1 => arr2.some(a2 => a1 === a2))
624
+ },
625
+ step1 (list, arr) { // 各个环包含的相位
626
+ const ret = []
627
+ const listObj = {}
628
+ list.forEach(l => {
629
+ listObj[l.id] = l.ring
630
+ })
631
+ arr.forEach(a => {
632
+ const retItem = []
633
+ a.forEach(b => {
634
+ if (listObj[b]) {
635
+ const find = retItem.find(r => r.ring === listObj[b])
636
+ if (find) find.data.push(b)
637
+ else retItem.push({ring: listObj[b], data: [b]})
638
+ }
639
+ })
640
+ ret.push(retItem)
641
+ })
642
+ return ret
643
+ },
644
+ step2 (newArr, pattern) { // 不同环并发相位做比较
645
+ let ret = []
646
+ const patternObj = {}
647
+ pattern.forEach(l => {
648
+ if (l.mode !== 7) {
649
+ patternObj[l.id] = l.value
650
+ }
651
+ })
652
+ newArr.forEach((na, index) => {
653
+ let max = 0
654
+ na.forEach(n => {
655
+ const total = n.data.reduce((pre, cur) => pre + patternObj[cur], 0)
656
+ if (total > max) {
657
+ max = total
658
+ }
659
+ })
660
+ while (index > 0 && max < this.newCycle) { // && max < _this.newCycle
661
+ index--
662
+ max += ret[index]
663
+ }
664
+ ret.push(max)
665
+ })
666
+ return ret
667
+ },
668
+ fillGap (newArr, pattern) {
669
+ this.newPatterns = []
670
+ const patternObj = {}
671
+ pattern.forEach(l => {
672
+ l.map(k => {
673
+ if (k.mode !== 7) {
674
+ patternObj[k.id] = k.value
675
+ }
676
+ })
677
+ })
678
+ let newMax = []
679
+ let newMin = []
680
+ newArr.forEach((na, index) => {
681
+ na.map(n => {
682
+ n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObj[cur], 0) : patternObj[n.data[0]]
683
+ })
684
+ let maxNum = Math.max.apply(Math, na.map(item => { return item.length }))
685
+ let minNum = Math.min.apply(Math, na.map(item => { return item.length }))
686
+ newMax.push(maxNum)
687
+ newMin.push(minNum)
688
+ let newmaxNum = Math.max.apply(Math, newMax)// 每组最大值
689
+ let newminNum = Math.min.apply(Math, newMin)
690
+ if (newmaxNum === newminNum) {
691
+ this.newCycle = newmaxNum + newminNum
692
+ this.max = newmaxNum + newminNum
693
+ pattern.map(d => {
694
+ d.map(r => {
695
+ if (r.sum && r.mode !== 7) {
696
+ delete r.sum
697
+ }
698
+ })
699
+ })
700
+ }
701
+ if (maxNum === minNum) {
702
+ na.map(n => {
703
+ pattern.map(h => {
704
+ h.map(d => {
705
+ if (d.id === n.data[1] && d.sum && d.mode !== 7) {
706
+ delete d.sum
707
+ }
708
+ })
709
+ })
710
+ })
711
+ } else {
712
+ na.map(n => {
713
+ if (n.length === maxNum) {
714
+ pattern.map(h => {
715
+ h.map(d => {
716
+ if (n.data.length > 1) {
717
+ if (d.id === n.data[1] && d.mode !== 7) {
718
+ delete d.sum
719
+ }
720
+ } else {
721
+ if (d.id === n.data[0] && d.mode !== 7) {
722
+ delete d.sum
723
+ }
724
+ }
725
+ })
726
+ })
727
+ }
728
+ })
729
+ }
730
+ na.forEach((value, index, array) => {
731
+ if (value.length !== maxNum) {
732
+ let newNa = []
733
+ newNa.push(value)
734
+ newNa.forEach(m => {
735
+ let sum = Number(maxNum - m.length)
736
+ pattern.filter((i) => {
737
+ i.map(j => {
738
+ if (m.data.length > 1) {
739
+ if (j.id === m.data[1] && j.mode !== 7) {
740
+ j.sum = sum
741
+ }
742
+ } else {
743
+ if (j.id === m.data[0] && j.mode !== 7) {
744
+ j.sum = sum
745
+ }
746
+ }
747
+ })
748
+ })
749
+ })
750
+ }
751
+ let mapAdd = pattern.map(item => {
752
+ return item.map(val => {
753
+ return val.mode === 7 ? 0 : val.value + (val.sum ? val.sum : 0)
754
+ })
755
+ })
756
+ let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
757
+ return item.length > 0 ? item.reduce((a, b) => {
758
+ return a + b
759
+ }) : 0
760
+ }) : 0
761
+ this.max = Math.max(...maxCycle)// 每个环的周期最大值
762
+ })
763
+ })
764
+ }
765
+ }
766
+ }
767
+ </script>
768
+ <style lang="scss">
769
+ // el-tooltip样式
770
+ .el-tooltip__popper.is-light {
771
+ background: #409EFF !important;
772
+ border: 1px solid #409EFF !important;
773
+ color: #FFFFFF !important;
774
+ }
775
+ .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow {
776
+ border-top-color: #409EFF !important;
777
+ }
778
+ .el-tooltip__popper.is-light[x-placement^="top"] .popper__arrow::after {
779
+ border-top-color: #409EFF !important;
780
+ }
781
+ </style>
782
+ <style lang="scss" scoped>
783
+ .main-patternstatus {
784
+ position: relative;
785
+ margin-bottom: 20px;
786
+ }
787
+ .main-patternstatus {
788
+ position: relative;
789
+ .ring-first {
790
+ margin-top: 1px;
791
+ width: 100%;
792
+ height: 34px;
793
+ }
794
+ .first-1 {
795
+ float: left;
796
+ // text-align: center;
797
+ }
798
+ // .ring-num {
799
+ // float: left;
800
+ // margin-top:7px;
801
+ // margin-left: 5px;
802
+ // font-size: 14px;
803
+ // font-weight: normal;
804
+ // font-stretch: normal;
805
+ // line-height: 22px;
806
+ // letter-spacing: 0px;
807
+ // color: #ffffff;
808
+ // }
809
+ .box {
810
+ float: left;
811
+ margin-left: 6px;
812
+ margin-right: 10px;
813
+ }
814
+ .ring-nums {
815
+ // float: left;
816
+ // margin-top:7px;
817
+ // margin-left: 5px;
818
+ font-size: 12px;
819
+ height: 14px;
820
+ font-weight: normal;
821
+ font-stretch: normal;
822
+ // line-height: 22px;
823
+ letter-spacing: 0px;
824
+ color: #333333;
825
+ }
826
+ .ring-phase {
827
+ position: relative;
828
+ float: left;
829
+ // margin-left: 5px;
830
+ height: 34px;
831
+ z-index: 999;
832
+ background: rgba(30, 96, 12, 0.2);
833
+ // margin-top:1px;
834
+ }
835
+ .ring-phase::after {
836
+ position: absolute;
837
+ display: block;
838
+ content: '';
839
+ height: 0;
840
+ width: 0;
841
+ top: 11px;
842
+ left: 36px;
843
+ border: 5px solid transparent;
844
+ border-left-color: rgba(30, 96, 12, 0.2);
845
+ }
846
+ .divider {
847
+ position: absolute;
848
+ top: -10px;
849
+ // left: 370px;
850
+ width: 3px;
851
+ // height: 99px;
852
+ z-index: 999;
853
+ background-color:#B9BABF;
854
+ }
855
+ .curTimeLine {
856
+ position: absolute;
857
+ top: -10px;
858
+ width: 2px;
859
+ background-color: #409EFF;
860
+ }
861
+ .curTimeDiv {
862
+ position: absolute;
863
+ z-index:50;
864
+ top: -21px;
865
+ margin-left: -30px;
866
+ text-align:center;
867
+ vertical-align: middle;
868
+ width: 60px;
869
+ height: 19px;
870
+ color:#FFFFFF;
871
+ background-color: #409EFF;
872
+ }
873
+ }
874
+ .ring-first {
875
+ margin-top: 1px;
876
+ width: 100%;
877
+ height: 34px;
878
+ }
879
+ .direction {
880
+ opacity: 0.6;
881
+ }
882
+ .first-1 {
883
+ float: left;
884
+ // text-align: center;
885
+ }
886
+ </style>