openatc-components 0.1.22 → 0.1.24

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