openatc-components 0.0.80 → 0.0.83

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