openatc-components 0.1.185 → 0.1.187

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/.babelrc +18 -18
  2. package/.editorconfig +9 -9
  3. package/.eslintignore +5 -5
  4. package/.eslintrc.js +29 -29
  5. package/.postcssrc.js +10 -10
  6. package/README.md +30 -30
  7. package/build/build.js +41 -41
  8. package/build/check-versions.js +54 -54
  9. package/build/package.config.js +58 -58
  10. package/build/package.dev.config.js +107 -107
  11. package/build/package.prod.config.js +160 -160
  12. package/build/utils.js +101 -101
  13. package/build/vue-loader.conf.js +22 -22
  14. package/build/webpack.base.conf.js +114 -114
  15. package/build/webpack.dev.conf.js +95 -95
  16. package/build/webpack.prod.conf.js +149 -149
  17. package/config/dev.env.js +8 -8
  18. package/config/index.js +93 -92
  19. package/config/prod.env.js +5 -5
  20. package/config/test.env.js +7 -7
  21. package/index.html +12 -12
  22. package/package/kisscomps/components/BoardCard/BoardCard.vue +108 -108
  23. package/package/kisscomps/components/BoardCard/index.js +2 -2
  24. package/package/kisscomps/components/Channelization/Channelization.vue +584 -585
  25. package/package/kisscomps/components/Channelization/index.js +2 -2
  26. package/package/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -361
  27. package/package/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  28. package/package/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  29. package/package/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  30. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  31. package/package/kisscomps/components/CommonKanban/index.js +2 -2
  32. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  33. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  34. package/package/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  35. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  36. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  37. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  38. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  39. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  40. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  41. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  42. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  43. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +467 -467
  44. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  45. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  46. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  47. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  48. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  49. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  50. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  51. package/package/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  52. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  53. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  54. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  55. package/package/kisscomps/components/DrawChannelization/index.js +2 -2
  56. package/package/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  57. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  58. package/package/kisscomps/components/ExpendConfig/index.js +2 -2
  59. package/package/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  60. package/package/kisscomps/components/FaultDetailModal/index.js +2 -2
  61. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +497 -497
  62. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  63. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  64. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  65. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  66. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  67. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  68. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  69. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  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 +959 -959
  86. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +123 -123
  87. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +123 -123
  88. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  89. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  90. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  91. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +99 -99
  92. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +99 -99
  93. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  94. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +171 -171
  95. package/package/kisscomps/components/IntersectionMap/crossDirection/utils.js +78 -78
  96. package/package/kisscomps/components/IntersectionMap/index.js +2 -2
  97. package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +162 -163
  98. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +530 -530
  99. package/package/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  100. package/package/kisscomps/components/KanBan/index.js +2 -2
  101. package/package/kisscomps/components/KanBan/kanban.vue +225 -225
  102. package/package/kisscomps/components/MessageBox/index.vue +96 -96
  103. package/package/kisscomps/components/OverLap/OverLap.vue +214 -214
  104. package/package/kisscomps/components/OverLap/index.js +2 -2
  105. package/package/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  106. package/package/kisscomps/components/PatternOptimize/index.js +2 -2
  107. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +1456 -1455
  108. package/package/kisscomps/components/PatternStatus/index.js +2 -2
  109. package/package/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  110. package/package/kisscomps/components/PatternWalkSvg/index.js +2 -2
  111. package/package/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  112. package/package/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  113. package/package/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  114. package/package/kisscomps/components/PhaseDirectionText/index.js +2 -2
  115. package/package/kisscomps/components/PhaseMarker/index.js +6 -6
  116. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  117. package/package/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  118. package/package/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  119. package/package/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  120. package/package/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  121. package/package/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  122. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +828 -826
  123. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +313 -313
  124. package/package/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  125. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +195 -195
  126. package/package/kisscomps/components/SchemeConfig/index.js +2 -2
  127. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +198 -198
  128. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +228 -228
  129. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +197 -197
  130. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  131. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +275 -275
  132. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +840 -840
  133. package/package/kisscomps/components/StageBord/StageBord.vue +242 -242
  134. package/package/kisscomps/components/StageBord/index.js +2 -2
  135. package/package/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  136. package/package/kisscomps/components/StageStatus/index.js +2 -2
  137. package/package/kisscomps/components/Stages/index.vue +211 -211
  138. package/package/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  139. package/package/kisscomps/components/SvgIcon/index.js +2 -2
  140. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1065 -1065
  141. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  142. package/package/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  143. package/package/kisscomps/components/XiaoKanban/index.vue +102 -102
  144. package/package/kisscomps/components/overView/index.vue +699 -699
  145. package/package/kisscomps/components/patternConfig/index.js +2 -2
  146. package/package/kisscomps/components/patternConfig/index.vue +1120 -1120
  147. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +349 -349
  148. package/package/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  149. package/package/kisscomps/components/patternConfig/planContent.vue +573 -573
  150. package/package/kisscomps/components/patternConfig/planMenu.vue +329 -329
  151. package/package/kisscomps/components/patternConfig/utils.js +152 -152
  152. package/package/kisscomps/components/patternList/index.js +2 -2
  153. package/package/kisscomps/components/patternList/patternList.vue +581 -581
  154. package/package/kisscomps/index.js +119 -119
  155. package/package/kissui.js +216608 -0
  156. package/package/kissui.min.js +1 -1
  157. package/package.json +127 -127
  158. package/src/App.vue +24 -24
  159. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  160. package/src/EdgeMgr/controller/crossDiagramMgr.js +120 -120
  161. package/src/api/authapi.js +31 -31
  162. package/src/api/config.js +21 -21
  163. package/src/api/control.js +106 -106
  164. package/src/api/cross.js +49 -49
  165. package/src/api/device.js +135 -135
  166. package/src/api/fault.js +66 -66
  167. package/src/api/index.js +24 -24
  168. package/src/api/login.js +46 -46
  169. package/src/api/optimize.js +72 -72
  170. package/src/api/param.js +154 -154
  171. package/src/api/passwdAssest.js +101 -101
  172. package/src/api/route.js +171 -171
  173. package/src/api/template.js +27 -27
  174. package/src/i18n/index.js +26 -26
  175. package/src/i18n/language/en.js +1426 -1426
  176. package/src/i18n/language/index.js +25 -25
  177. package/src/i18n/language/zh.js +1425 -1425
  178. package/src/icons/demo.css +539 -539
  179. package/src/icons/iconfont.css +1183 -1183
  180. package/src/icons/iconfont.json +2053 -2053
  181. package/src/icons/index.js +20 -20
  182. package/src/icons/svg/azimuthlocking.svg +26 -26
  183. package/src/icons/svg/bendi.svg +110 -110
  184. package/src/icons/svg/bujin.svg +36 -36
  185. package/src/icons/svg/connectBlue.svg +7 -7
  186. package/src/icons/svg/currentvolume.svg +0 -0
  187. package/src/icons/svg/custom-BRTlane.svg +40 -40
  188. package/src/icons/svg/custom-buslane.svg +40 -40
  189. package/src/icons/svg/custom-detector.svg +12 -12
  190. package/src/icons/svg/custom-east-bottom.svg +32 -32
  191. package/src/icons/svg/custom-east-top.svg +32 -32
  192. package/src/icons/svg/custom-ewped.svg +35 -35
  193. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -40
  194. package/src/icons/svg/custom-north-left.svg +32 -32
  195. package/src/icons/svg/custom-north-right.svg +32 -32
  196. package/src/icons/svg/custom-peddetector.svg +17 -17
  197. package/src/icons/svg/custom-snped.svg +35 -35
  198. package/src/icons/svg/custom-south-left.svg +32 -32
  199. package/src/icons/svg/custom-south-right.svg +32 -32
  200. package/src/icons/svg/custom-tramlane.svg +40 -40
  201. package/src/icons/svg/custom-vehiclebranch.svg +40 -40
  202. package/src/icons/svg/custom-vehiclemainroad.svg +41 -41
  203. package/src/icons/svg/custom-west-bottom.svg +32 -32
  204. package/src/icons/svg/custom-west-top.svg +32 -32
  205. package/src/icons/svg/custom-xlped.svg +14 -14
  206. package/src/icons/svg/custom-xrped.svg +14 -14
  207. package/src/icons/svg/cutRed.svg +7 -7
  208. package/src/icons/svg/cycle.svg +0 -0
  209. package/src/icons/svg/dingzhouqi.svg +34 -34
  210. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  211. package/src/icons/svg/guandeng.svg +81 -81
  212. package/src/icons/svg/huangshan.svg +71 -71
  213. package/src/icons/svg/maincontrol.svg +0 -0
  214. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  215. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  216. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  217. package/src/icons/svg/model.svg +0 -0
  218. package/src/icons/svg/phasediff.svg +0 -0
  219. package/src/icons/svg/prioritycontrol.svg +21 -21
  220. package/src/icons/svg/quanhong.svg +86 -86
  221. package/src/icons/svg/shanghe.svg +11 -11
  222. package/src/icons/svg/shoudong.svg +103 -103
  223. package/src/icons/svg/tentativeplan.svg +28 -28
  224. package/src/icons/svg/time.svg +0 -0
  225. package/src/icons/svg/wuxianlan.svg +46 -46
  226. package/src/icons/svg/xiala.svg +11 -11
  227. package/src/icons/svg/xingrenguojie.svg +33 -33
  228. package/src/icons/svg/xitong.svg +89 -89
  229. package/src/icons/svg/youxian.svg +41 -41
  230. package/src/icons/svg/zizhukongzhi.svg +43 -43
  231. package/src/kisscomps/components/BoardCard/BoardCard.vue +108 -108
  232. package/src/kisscomps/components/BoardCard/index.js +2 -2
  233. package/src/kisscomps/components/Channelization/Channelization.vue +584 -585
  234. package/src/kisscomps/components/Channelization/index.js +2 -2
  235. package/src/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -361
  236. package/src/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  237. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  238. package/src/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  239. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  240. package/src/kisscomps/components/CommonKanban/index.js +2 -2
  241. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  242. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  243. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  244. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  245. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  246. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  247. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  248. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  249. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  250. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  251. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  252. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +467 -467
  253. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  254. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  255. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  256. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  257. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  258. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  259. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  260. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  261. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  262. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  263. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  264. package/src/kisscomps/components/DrawChannelization/index.js +2 -2
  265. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  266. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  267. package/src/kisscomps/components/ExpendConfig/index.js +2 -2
  268. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  269. package/src/kisscomps/components/FaultDetailModal/index.js +2 -2
  270. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +497 -497
  271. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  272. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  273. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  274. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  275. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  276. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  277. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  278. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  279. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  280. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  281. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  282. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  283. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  284. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  285. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  286. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  287. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  288. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  289. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  290. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  291. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  292. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  293. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  294. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +959 -959
  295. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +123 -123
  296. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +123 -123
  297. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  298. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  299. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  300. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +99 -99
  301. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +99 -99
  302. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  303. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +171 -171
  304. package/src/kisscomps/components/IntersectionMap/crossDirection/utils.js +78 -78
  305. package/src/kisscomps/components/IntersectionMap/index.js +2 -2
  306. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +162 -163
  307. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +530 -530
  308. package/src/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  309. package/src/kisscomps/components/KanBan/index.js +2 -2
  310. package/src/kisscomps/components/KanBan/kanban.vue +225 -225
  311. package/src/kisscomps/components/MessageBox/index.vue +96 -96
  312. package/src/kisscomps/components/OverLap/OverLap.vue +214 -214
  313. package/src/kisscomps/components/OverLap/index.js +2 -2
  314. package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  315. package/src/kisscomps/components/PatternOptimize/index.js +2 -2
  316. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +1456 -1455
  317. package/src/kisscomps/components/PatternStatus/index.js +2 -2
  318. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  319. package/src/kisscomps/components/PatternWalkSvg/index.js +2 -2
  320. package/src/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  321. package/src/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  322. package/src/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  323. package/src/kisscomps/components/PhaseDirectionText/index.js +2 -2
  324. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  325. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  326. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  327. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  328. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  329. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  330. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  331. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +828 -826
  332. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +313 -313
  333. package/src/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  334. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +195 -195
  335. package/src/kisscomps/components/SchemeConfig/index.js +2 -2
  336. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +198 -198
  337. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +228 -228
  338. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +197 -197
  339. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  340. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +275 -275
  341. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +840 -840
  342. package/src/kisscomps/components/StageBord/StageBord.vue +242 -242
  343. package/src/kisscomps/components/StageBord/index.js +2 -2
  344. package/src/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  345. package/src/kisscomps/components/StageStatus/index.js +2 -2
  346. package/src/kisscomps/components/Stages/index.vue +211 -211
  347. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  348. package/src/kisscomps/components/SvgIcon/index.js +2 -2
  349. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1065 -1065
  350. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  351. package/src/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  352. package/src/kisscomps/components/XiaoKanban/index.vue +102 -102
  353. package/src/kisscomps/components/overView/index.vue +699 -699
  354. package/src/kisscomps/components/patternConfig/index.js +2 -2
  355. package/src/kisscomps/components/patternConfig/index.vue +1120 -1120
  356. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +349 -349
  357. package/src/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  358. package/src/kisscomps/components/patternConfig/planContent.vue +573 -573
  359. package/src/kisscomps/components/patternConfig/planMenu.vue +329 -329
  360. package/src/kisscomps/components/patternConfig/utils.js +152 -152
  361. package/src/kisscomps/components/patternList/index.js +2 -2
  362. package/src/kisscomps/components/patternList/patternList.vue +581 -581
  363. package/src/kisscomps/index.js +119 -119
  364. package/src/lib/publicjs/ArryListUtil.js +38 -38
  365. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  366. package/src/lib/publicjs/KissApi.js +158 -158
  367. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  368. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  369. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  370. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  371. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  372. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  373. package/src/lib/publicjs/basecomponents.js +65 -65
  374. package/src/lib/publicjs/localStorage.js +112 -112
  375. package/src/lib/publicjs/objdeepcopy.js +32 -32
  376. package/src/lib/publicjs/pageScroll.js +30 -30
  377. package/src/lib/publicjs/passwdAssest.js +101 -101
  378. package/src/lib/publicjs/styleclassfactory.js +32 -32
  379. package/src/main.js +50 -50
  380. package/src/router/index.js +56 -56
  381. package/src/store/getters.js +16 -16
  382. package/src/store/index.js +26 -26
  383. package/src/store/modules/globalParam.js +67 -67
  384. package/src/utils/ControlFormat.js +68 -68
  385. package/src/utils/RingDataModel.js +251 -251
  386. package/src/utils/auth.js +199 -199
  387. package/src/utils/dateFormat.js +41 -41
  388. package/src/utils/errorcode.js +228 -228
  389. package/src/utils/fault.js +196 -196
  390. package/src/utils/faultcode.js +209 -209
  391. package/src/utils/index.js +69 -69
  392. package/src/utils/pedphasedesc.js +119 -119
  393. package/src/utils/phaseList.js +203 -203
  394. package/src/utils/phasedesc.js +124 -124
  395. package/src/utils/responseMessage.js +21 -21
  396. package/src/utils/validate.js +43 -43
  397. package/src/views/customchannelization.vue +49 -49
  398. package/src/views/home.1.vue +479 -479
  399. package/src/views/home.vue +93 -93
  400. package/src/views/intersection.vue +309 -309
  401. package/src/views/overView.vue +41 -41
  402. package/src/views/patternConfig.vue +1495 -1495
  403. package/src/views/schemeconfig.vue +173 -173
  404. package/static/apiconfig.json +451 -451
  405. package/static/styles/channelizatioon.scss +433 -433
  406. package/static/styles/common.scss +23 -23
  407. package/static/styles/commonkanban.scss +100 -100
  408. package/static/styles/dark/index.scss +2 -2
  409. package/static/styles/dark/theme/element-dark.scss +42 -42
  410. package/static/styles/index.scss +84 -84
  411. package/static/styles/intersection.scss +190 -183
  412. package/static/styles/light/index.scss +2 -2
  413. package/static/styles/light/theme/element-light.scss +42 -42
  414. package/static/styles/overview.scss +135 -135
  415. package/static/styles/patternConfig.scss +55 -55
  416. package/static/styles/schemeconfig.scss +493 -493
  417. package/static/styles/stages.scss +64 -64
  418. package/static/styles/uiComponents.scss +5 -5
  419. package/static/styles/xiaokanban.scss +50 -50
  420. package/static/token.json +2 -2
  421. package/test/e2e/custom-assertions/elementCount.js +27 -27
  422. package/test/e2e/nightwatch.conf.js +46 -46
  423. package/test/e2e/runner.js +48 -48
  424. package/test/e2e/specs/test.js +19 -19
  425. package/test/unit/.eslintrc +7 -7
  426. package/test/unit/jest.conf.js +30 -30
  427. package/test/unit/setup.js +3 -3
  428. package/test/unit/specs/HelloWorld.spec.js +11 -11
  429. package/src/node_modules/.package_versions.json +0 -1
@@ -1,840 +1,840 @@
1
- <template>
2
- <div class="tentativeplan-control">
3
- <div class="title" style="margin-bottom: 18px;">{{$t('openatccomponents.overview.tentativeplan')}}</div>
4
- <el-row>
5
- <el-col :span="12">
6
- <el-form
7
- ref="manual"
8
- label-position="left"
9
- :model="manualInfo"
10
- label-width="100px">
11
- <el-form-item
12
- :label="$t('openatccomponents.overview.patternid') + ':'"
13
- prop="count">
14
- <el-select @change="selectPattern()" v-model="manualInfo.tempPatternid" class="col-inner" size="small" :placeholder="$t('openatccomponents.common.select')">
15
- <el-option
16
- v-for="item in patternSelect"
17
- :key="item.value"
18
- :label="item.label"
19
- :value="item.value">
20
- </el-option>
21
- </el-select>
22
- <!-- <el-input v-model="manualInfo.tempDuration" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
23
- </el-form-item>
24
- <el-form-item
25
- :label="$t('openatccomponents.overview.delay') + ':'"
26
- prop="intersection">
27
- <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.tempDelay" size="mini"></el-input-number>
28
- <!-- <el-input v-model="manualInfo.tempDelay" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
29
- </el-form-item>
30
- </el-form>
31
- </el-col>
32
- <el-col :span="12">
33
- <el-form
34
- ref="manual"
35
- label-position="left"
36
- :model="manualInfo"
37
- label-width="100px">
38
- <el-form-item
39
- :label="$t('openatccomponents.overview.patternoffset') + ':'"
40
- prop="count">
41
- <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.offset" size="mini"></el-input-number>
42
- <!-- <el-input v-model="manualInfo.offset" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
43
- </el-form-item>
44
- <el-form-item
45
- :label="$t('openatccomponents.overview.duration') + ':'"
46
- prop="intersection">
47
- <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.duration" size="mini"></el-input-number>
48
- <!-- <el-input v-model="manualInfo.duration" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
49
- </el-form-item>
50
- </el-form>
51
- </el-col>
52
- </el-row>
53
- <el-row>
54
- <div class="title" style="margin-top:18px; margin-bottom:10px">{{$t('openatccomponents.overview.patternstate')}}:
55
- <span>({{$t('openatccomponents.overview.cycle')}}: {{cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{offset}})</span>
56
- </div>
57
- <stage-status
58
- :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
59
- >
60
- </stage-status>
61
- <pattern-list
62
- :patternList="patternOne.length===0?planPattern.rings:patternOne"
63
- :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
64
- :cycles="patternOne.length===0?planPattern.cycle:patternOne[0].cycle"
65
- :phaseList="phaseList">
66
- </pattern-list>
67
- </el-row>
68
- <el-row>
69
- <el-tabs v-model="activeList" type="card">
70
- <el-tab-pane :label="$t('openatccomponents.pattern.ringConfig')" name="ring">
71
- <div style="width: 100%; overflow: hidden;margin-top: 20px;">
72
- <kan-ban v-for="n in ringCount"
73
- :key="n" class="closephasekanban"
74
- :index="n"
75
- :options="options"
76
- :list="patternOne.length===0?planPattern.rings[n-1]:patternOne[0].rings[n-1]"
77
- :phaseList="phaseList"
78
- :header-text="$t('openatccomponents.pattern.ring')+n"
79
- @handleSplit="handleSplit">
80
- </kan-ban>
81
- </div>
82
- </el-tab-pane>
83
- <!-- <el-tab-pane :label="$t('openatccomponents.pattern.stageConfig')" name="kanban">
84
- <el-scrollbar :vertical="true">
85
- <div class="stage-panel-contener">
86
- <stage-board v-for="(stage,index) in patternOne.length===0?stagesList:patternOne[0].stagesList"
87
- class="closephasekanban"
88
- :key="index"
89
- :stage="stage"
90
- :options="options"
91
- :stageInfo="patternOne.length===0?stagesList:patternOne[0].stagesList"
92
- :coordphaseOption="coordphaseOption"
93
- :subIndex="index"
94
- @onStageSplitChange="onStageSplitChange"
95
- @stageSplitChange="stageSplitChange"
96
- @onStageDelaystartChange="onStageDelaystartChange"
97
- @onStageAdvanceendChange="onStageAdvanceendChange"
98
- >
99
- </stage-board>
100
- </div>
101
- </el-scrollbar>
102
- </el-tab-pane> -->
103
- <el-tab-pane :label="$t('openatccomponents.pattern.parameters')" name="parame">
104
- <el-row>
105
- <expend-config
106
- v-for="(j,index) in ringCounts"
107
- :key="index"
108
- class="expendkanban"
109
- :options="options"
110
- :header-text="$t('openatccomponents.pattern.ring')+j"
111
- :list="patternOne.length===0?planPattern.rings[j-1]:patternOne[0].rings[j-1]"
112
- >
113
- </expend-config>
114
- <div class="forbiddenstage">
115
- {{$t('openatccomponents.pattern.forbiddenstage')}}
116
- <el-input class="stage-value" size="small" v-model="forbiddenstage"></el-input>
117
- </div>
118
- <div class="forbiddenstage">
119
- {{$t('openatccomponents.pattern.screenstage')}}
120
- <el-input class="stage-value" size="small" v-model="screenstage"></el-input>
121
- </div>
122
- <div class="forbiddenstage">
123
- {{$t('openatccomponents.pattern.coordinatestage')}}
124
- <el-input class="stage-value" size="small" v-model="coordinatestage"></el-input>
125
- </div>
126
- </el-row>
127
- </el-tab-pane>
128
- <el-tab-pane :label="$t('openatccomponents.pattern.overLap')" name="overlap">
129
- <el-row :gutter="20">
130
- <el-col :span="24" >
131
- <over-lap
132
- :stageList="stagesList"
133
- :overlap="overlap"
134
- :checked="true"
135
- :tentative="true"
136
- :cycle="overLapCycle"
137
- >
138
- </over-lap>
139
- </el-col>
140
- </el-row>
141
- </el-tab-pane>
142
- <el-tab-pane :label="$t('openatccomponents.pattern.patternOptimize')" name="patternOptimize">
143
- <pattern-optimize
144
- v-for="n in optimizes"
145
- :key="n" class="expendkanban"
146
- :list="patternOne.length===0?planPattern.rings[n-1]:patternOne[0].rings[n-1]"
147
- :rings="patternOne.length===0?planPattern:patternOne[0]"
148
- :phaseList="phaseList"
149
- :options="options"
150
- :header-text="$t('openatccomponents.pattern.ring')+n"
151
- :index="n"
152
- :nowNumber="n"
153
- @handleSplit="handleSplit"
154
- >
155
- </pattern-optimize>
156
- </el-tab-pane>
157
- </el-tabs>
158
- </el-row>
159
- <div class="footer" v-if="realtimeStatusModalvisible">
160
- <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
161
- <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.implement')}}</el-button>
162
- </div>
163
- <div class="footer" v-if="!realtimeStatusModalvisible">
164
- <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
165
- <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.comfirm')}}</el-button>
166
- </div>
167
- </div>
168
- </template>
169
-
170
- <script>
171
- export default {
172
- name: 'tentativeplancontrol',
173
- props: {
174
- realtimeStatusModalvisible: {
175
- type: Boolean,
176
- default: true
177
- },
178
- controlData: {
179
- type: Object
180
- },
181
- phaseList: {
182
- type: Array
183
- },
184
- overlap: {
185
- type: Array
186
- },
187
- allPatternList: {
188
- type: Array
189
- },
190
- patternSelect: {
191
- type: Array
192
- }
193
- },
194
- computed: {
195
- rings () {
196
- return this.patternOne.length === 0 ? this.planPattern.rings : this.patternOne[0].rings
197
- },
198
- cycle () {
199
- return this.patternOne.length === 0 ? this.max : (this.patternOne.length > 0 && (this.patternOne[0].cycle < this.max)) ? this.max : this.patternOne[0].cycle
200
- },
201
- offset () {
202
- return Number((this.patternOne.length === 0 || this.manualInfo.offset > 0) ? this.manualInfo.offset : this.patternOne[0].offset)
203
- },
204
- forbiddenstage () {
205
- return this.patternOne.length === 0 ? this.allPatternList[0].forbiddenstage : this.patternOne[0].forbiddenstage
206
- },
207
- screenstage () {
208
- return this.patternOne.length === 0 ? this.allPatternList[0].screenstage : this.patternOne[0].screenstage
209
- },
210
- coordinatestage () {
211
- return this.patternOne.length === 0 ? this.allPatternList[0].coordinatestage : this.patternOne[0].coordinatestage
212
- }
213
- },
214
- data () {
215
- return {
216
- stagesList: [],
217
- phaseRings: [],
218
- overLapCycle: 0,
219
- options: {
220
- group: 'pattern'
221
- },
222
- max: '',
223
- patternCycleEqual: true,
224
- activeList: 'ring',
225
- ringCount: 1,
226
- ringCounts: 1,
227
- barriers: [],
228
- optimizes: 1,
229
- coordphaseOption: [],
230
- patternOne: [],
231
- planPattern: {},
232
- manualInfo: {
233
- tempPatternid: '',
234
- offset: 0,
235
- duration: 300,
236
- tempDelay: 0 // 控制方式手动操作的情况下的延迟时间的临时值。
237
- // tempDuration: 300 // 控制方式手动操作的情况下的持续时间的临时值。
238
- }
239
- }
240
- },
241
- created () {
242
- this.patternPlan()
243
- this.getCycle()
244
- if (this.patternOne.length === 0) {
245
- this.handleStageData(this.planPattern.rings)
246
- }
247
- this.initData()
248
- },
249
- methods: {
250
- tranform (arr) { // 分barrier
251
- let newMap = new Map()
252
- arr.forEach(({id, current}) => {
253
- const find = newMap.get(current.join())
254
- if (find) newMap.get(current.join()).push(id)
255
- else newMap.set(current.join(), [id])
256
- })
257
- let ret = []
258
- newMap.forEach((value, key) => {
259
- ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
260
- })
261
- const result = []
262
- for (const a of ret) {
263
- let merged = false
264
- for (const r of result) {
265
- if (this.check([...r], a)) {
266
- a.forEach(item => r.add(item))
267
- merged = true
268
- }
269
- }
270
- if (!merged) {
271
- result.push(new Set(a))
272
- }
273
- merged = false
274
- }
275
- return result.map(s => [...s])
276
- },
277
- check (arr1, arr2) {
278
- return arr1.some(a1 => arr2.some(a2 => a1 === a2))
279
- },
280
- handleCurrentChange (val) { // 两个ring的数据
281
- if (val === null || val.length === 0) return
282
- // 按环序分组
283
- let ringlength = []
284
- let ringsequence = val.map(item => {
285
- if (item.length === 0) return
286
- ringlength.push(item.length)
287
- return item.map(k => {
288
- return k.id
289
- })
290
- })
291
- let newRings = ringsequence.filter(item => item)
292
- let minLength = Math.min(...ringlength)
293
- let resultArrs = [] // 环1分组
294
- let resultArr = [] // 环2分组
295
- for (let j = 0; j < ringsequence[0].length; j += minLength) {
296
- resultArrs.push(ringsequence[0].slice(j, j + minLength))
297
- if (ringsequence[0].length === minLength) {
298
- resultArrs.push([])
299
- }
300
- }
301
- if (newRings.length > 1) {
302
- for (let i = 0; i < ringsequence[1].length; i += minLength) {
303
- resultArr.push(ringsequence[1].slice(i, i + minLength))
304
- }
305
- }
306
- // this.patternInfo = []
307
- // this.barrierList = []
308
- let currentArr = []
309
- let newPattern = []
310
- val.map(i => {
311
- newPattern.push(...i)
312
- })
313
- if (this.phaseList.length === 0) return
314
- for (let patternStatus of val[0]) {
315
- // if (patternStatus.mode !== 7) {
316
- let concurrent = this.phaseList.filter((item) => {
317
- return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
318
- })[0].concurrent// 当前相位的并发相位
319
- if (concurrent) {
320
- let obj = {
321
- id: patternStatus.id,
322
- current: concurrent.sort()
323
- }
324
- currentArr.push(obj)
325
- }
326
- // }
327
- }
328
- if (currentArr.length !== 0) {
329
- let newCurrent = this.tranform(currentArr)
330
- // 取没个环与环关系的并集
331
- let barrierRing1 = []
332
- let barrierRing2 = []
333
- let ring1 = [] // 环1与关系1的并集
334
- for (let h = 0; h < newCurrent.length; h++) {
335
- let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
336
- ring1.push(adds)
337
- }
338
- let ring1s = [] // 环1与关系2的并集
339
- for (let h = 0; h < newCurrent.length; h++) {
340
- let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
341
- ring1s.push(addRing1)
342
- }
343
- barrierRing1.push(...ring1, ...ring1s)
344
- let resultList = []
345
- if (newRings.length > 1) {
346
- let ring2s = [] // 环2与关系1的并集
347
- for (let h = 0; h < newCurrent.length; h++) {
348
- let addRing2 = [...new Set(resultArr[1])].filter(item => newCurrent[h].includes(item))
349
- ring2s.push(addRing2)
350
- }
351
- let ring2 = [] // 环2与关系1的并集
352
- for (let h = 0; h < newCurrent.length; h++) {
353
- let add = [...new Set(resultArr[0])].filter(item => newCurrent[h].includes(item))
354
- ring2.push(add)
355
- }
356
- barrierRing2.push(...ring2, ...ring2s)
357
- for (let k = 0; k < barrierRing1.length; k++) {
358
- resultList.push(barrierRing1[k].concat(barrierRing2[k]))
359
- }
360
- }
361
- let resultLists = resultList.filter(item => item.length !== 0)
362
- let ringArr = []
363
- for (let l = 0; l < resultLists.length; l++) {
364
- for (let d = 0; d < newCurrent.length; d++) {
365
- if (newCurrent[d].filter(item => resultLists[l].includes(item)).length > 0) {
366
- ringArr.push({
367
- data: resultLists[l],
368
- id: d + 1,
369
- index: l
370
- })
371
- }
372
- }
373
- }
374
- for (var i = 0; i < ringArr.length; i++) {
375
- for (var j = i + 1; j < ringArr.length; j++) {
376
- if (ringArr[i].id === ringArr[j].id && ringArr[i].index + 1 === ringArr[j].index) {
377
- ringArr[i].data = ringArr[i].data.concat(ringArr[j].data)
378
- ringArr.splice(ringArr.indexOf(ringArr[j].id), 1)
379
- }
380
- }
381
- }
382
- let resArr = ringArr.map(item => item.data)
383
- let ringTeam = this.step1(this.phaseList, resArr)
384
- let ringTeams = ringTeam.filter(item => item.length !== 0)
385
- return this.setBarrier(ringTeams, val)
386
- }
387
- },
388
- setBarrier (ringTeam, val) {
389
- const patternObjs = {}
390
- val.forEach(l => {
391
- l.map(k => {
392
- patternObjs[k.id] = k.value
393
- })
394
- })
395
- let ret = ringTeam.map((y, index) => {
396
- if (!y || y.length === 0) return
397
- y.map(n => {
398
- n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
399
- })
400
- return {
401
- barrier: index + 1,
402
- length: y[0].length,
403
- items: y.map(j => {
404
- return {
405
- ring: j.ring,
406
- data: j.data
407
- }
408
- })
409
- }
410
- })
411
- return ret
412
- },
413
- step1 (list, arr) { // 各个环包含的相位
414
- const ret = []
415
- const listObj = {}
416
- list.forEach(l => {
417
- listObj[l.id] = l.ring
418
- })
419
- arr.forEach(a => {
420
- const retItem = []
421
- a.forEach(b => {
422
- if (listObj[b]) {
423
- const find = retItem.find(r => r.ring === listObj[b])
424
- if (find) find.data.push(b)
425
- else retItem.push({ring: listObj[b], data: [b]})
426
- }
427
- })
428
- ret.push(retItem)
429
- })
430
- return ret
431
- },
432
- patternPlan () {
433
- let Pattern = {
434
- offset: 0,
435
- cycle: 0,
436
- rings: [[], [], [], []]
437
- }
438
- var newPattern = JSON.parse(JSON.stringify(Pattern))
439
- for (let phase of this.phaseList) {
440
- let ring = {}
441
- ring.name = 'Phase ' + phase.id
442
- ring.desc = this.getPhaseDescription(phase.direction)
443
- ring.id = phase.id
444
- ring.value = 30
445
- ring.mode = 2
446
- ring.options = []
447
- ring.delaystart = 0
448
- ring.advanceend = 0
449
- if (phase.ring === 1) {
450
- newPattern.rings[0].push(ring)
451
- } else if (phase.ring === 2) {
452
- newPattern.rings[1].push(ring)
453
- } else if (phase.ring === 3) {
454
- newPattern.rings[2].push(ring)
455
- } else if (phase.ring === 4) {
456
- newPattern.rings[3].push(ring)
457
- }
458
- }
459
- let barrier = this.handleCurrentChange(newPattern.rings)
460
- newPattern.barriers = barrier
461
- this.planPattern = newPattern
462
- },
463
- getCycle () {
464
- for (let rings of this.planPattern.rings) {
465
- let num = 0
466
- for (let i = 0; i < rings.length; i++) {
467
- if (rings[i].length !== 0) {
468
- if (rings[i].mode === 7) { // 忽略相位不计周期
469
- continue
470
- }
471
- num = num + Number(rings[i].value)
472
- }
473
- }
474
- if (num !== 0) {
475
- this.planPattern.cycle = num
476
- break
477
- }
478
- }
479
- },
480
- getCycles () {
481
- if (!this.patternOne[0].stages) return
482
- let stages = this.patternOne[0].stages
483
- let modeId = stages.filter(item => item.length === 1)[0]
484
- for (let rings of this.patternOne[0].rings) {
485
- let num = 0
486
- for (let i = 0; i < rings.length; i++) {
487
- if (rings[i].length !== 0) {
488
- if (rings[i].mode === 7 && (modeId && modeId[0] === rings[i].id)) { // 忽略相位不计周期
489
- continue
490
- }
491
- num = num + Number(rings[i].value)
492
- }
493
- }
494
- if (num !== 0) {
495
- this.patternOne[0].cycle = num
496
- break
497
- }
498
- }
499
- },
500
- getPhaseDescription (phaseList) {
501
- if (!phaseList) return
502
- let list = []
503
- for (let id of phaseList) {
504
- let obj = {}
505
- obj.id = id
506
- obj.color = '#454545'
507
- list.push(obj)
508
- }
509
- return list
510
- },
511
- handleClose () {
512
- this.$emit('closePhaseBack')
513
- },
514
- onStageSplitChange (diff, rowIndex, subIndex) {
515
- let stageArr = this.stagesList[subIndex].stages
516
- let row = this.patternList[rowIndex]
517
- let ringsList = row.rings
518
- for (let rings of ringsList) {
519
- for (let ring of rings) {
520
- if (stageArr.includes(ring.id)) {
521
- ring.value = (ring.value ? ring.value : 0) + diff
522
- continue
523
- }
524
- }
525
- }
526
- },
527
- stageSplitChange (diff, rowIndex, subIndex) {
528
- let row = this.patternList[rowIndex]
529
- let ringsList = row.stagesList
530
- for (let rings of ringsList) {
531
- if (subIndex === rings.key) {
532
- rings.stageSplit = (rings.green ? rings.green : 0) + (rings.yellow ? rings.yellow : 0) + (rings.red ? rings.red : 0)
533
- continue
534
- }
535
- }
536
- },
537
- onStageDelaystartChange (diff, rowIndex, subIndex) {
538
- let stageArr = this.stagesList[subIndex].stages
539
- let row = this.patternList[rowIndex]
540
- let ringsList = row.rings
541
- for (let rings of ringsList) {
542
- for (let ring of rings) {
543
- if (stageArr.includes(ring.id)) {
544
- ring.delaystart = (ring.delaystart ? ring.delaystart : 0) + diff
545
- continue
546
- }
547
- }
548
- }
549
- },
550
- onStageAdvanceendChange (diff, rowIndex, subIndex) {
551
- let stageArr = this.stagesList[subIndex].stages
552
- let row = this.patternList[rowIndex]
553
- let ringsList = row.rings
554
- for (let rings of ringsList) {
555
- for (let ring of rings) {
556
- if (stageArr.includes(ring.id)) {
557
- ring.advanceend = (ring.advanceend ? ring.advanceend : 0) + diff
558
- continue
559
- }
560
- }
561
- }
562
- },
563
- handleSplit (index) {
564
- if (this.patternOne.length > 0) {
565
- let currPattern = this.patternOne[0].rings
566
- setTimeout(() => {
567
- this.handleStageData(currPattern)
568
- this.getCycles()
569
- this.patternOne[0].stagesList = this.stagesList
570
- }, 50)
571
- } else {
572
- let currPattern = this.planPattern.rings
573
- setTimeout(() => {
574
- this.handleStageData(currPattern)
575
- this.getCycle()
576
- this.allPatternList[0].stagesList = this.stagesList
577
- }, 50)
578
- }
579
- },
580
- selectPattern () {
581
- this.manualInfo.offset = 0
582
- let selectId = Number(this.manualInfo.tempPatternid)
583
- this.patternOne = this.allPatternList.filter(item => {
584
- return item.id === selectId
585
- })
586
- this.manualInfo.offset = this.offset
587
- for (let rings of this.patternOne[0].rings) {
588
- if (rings.length === 0) continue
589
- for (let ring of rings) {
590
- if (ring.value === 0) continue
591
- let currPhase = this.phaseList.filter((item) => {
592
- return item.id === ring.id
593
- })[0]
594
- ring.desc = currPhase.direction.map(item => {
595
- return {
596
- id: item,
597
- color: '#454545'
598
- }
599
- })
600
- }
601
- }
602
- this.handleStageData(this.patternOne[0].rings)
603
- },
604
- handleStageData (rings) { // stagesList
605
- for (let i = 0; i < rings.length; i++) {
606
- if (rings[i].length > 0) {
607
- let phaseList = []
608
- let stagesList = []
609
- // rings = JSON.parse(JSON.stringify(rings))
610
- let mapAdd = rings.map(item => {
611
- return item.map(val => {
612
- // if (val.mode !== 7) {
613
- return val.value + (val.sum ? val.sum : 0)
614
- // } else {
615
- // return 0
616
- // }
617
- })
618
- })
619
- let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
620
- return item.length > 0 ? item.reduce((a, b) => {
621
- return a + b
622
- }) : 0
623
- }) : 0
624
- this.max = Math.max(...maxCycle)// 每个环的周期最大值
625
- this.stateList = [0]
626
- this.narr = []
627
- let currentIds = ''
628
- let lastCurrentIds = ''
629
- for (let j = 0; j <= this.max; j++) { // 指针长度
630
- for (let i = 0; i < rings.length; i++) { // 环列表
631
- let ring = rings[i]// 每个环对象
632
- let sum = 0
633
- for (let n = 0; n < ring.length; n++) { // 相位累计长度
634
- // if (ring[n].mode !== 7) {
635
- sum = sum + ring[n].value + (ring[n].sum ? ring[n].sum : 0)
636
- if (j < sum) {
637
- let phaseId = ring[n].id
638
- currentIds = currentIds + '-' + phaseId
639
- break
640
- }
641
- // }
642
- }
643
- }
644
- if (lastCurrentIds !== currentIds && lastCurrentIds !== '') { // 当前相位id和上一个相比不同说明相位变化了
645
- phaseList.push(lastCurrentIds)
646
- this.stateList.push(j)// 阶段累计长度的集合
647
- }
648
- lastCurrentIds = currentIds
649
- currentIds = ''
650
- }
651
- let newPhaselist = []
652
- phaseList.forEach(i => {
653
- let rangeArr = i.split('-').map(Number)
654
- if (rangeArr.length > 2) {
655
- newPhaselist.push([
656
- JSON.parse(JSON.stringify(rangeArr[1])),
657
- JSON.parse(JSON.stringify(rangeArr[2]))
658
- ])
659
- } else {
660
- newPhaselist.push([
661
- JSON.parse(JSON.stringify(rangeArr[1]))
662
- ])
663
- }
664
- })
665
- for (let i = this.stateList.length - 1; i >= 1; i--) {
666
- this.narr.push(this.stateList[i] - this.stateList[i - 1])
667
- }
668
- // newPhaselist
669
- this.narr.reverse()// 阶段差
670
- for (let i = 0; i < newPhaselist.length; i++) {
671
- let stage = JSON.parse(JSON.stringify(newPhaselist[i]))
672
- let newStage = []
673
- stage.map(item => {
674
- for (let ring of rings) {
675
- for (let ringItem of ring) {
676
- if (item === ringItem.id && (ringItem.mode !== 7 && ringItem.mode !== 8)) {
677
- newStage.push(item)
678
- }
679
- }
680
- }
681
- })
682
- let stageItem = this.getStageItem(newStage, stage, rings, i)
683
- stagesList.push(JSON.parse(JSON.stringify(stageItem)))
684
- }
685
- this.overLapCycle = stagesList.reduce((prev, curr) => prev + parseInt(curr.split), 0)
686
- this.stagesList = JSON.parse(JSON.stringify(stagesList))
687
- }
688
- }
689
- },
690
- getStageItem (stageArr, stage, ringsList, i) {
691
- let res = {
692
- key: i,
693
- split: this.narr[i], // 阶段绿性比
694
- phases: stageArr,
695
- stageKanban: stage,
696
- delaystart: 0,
697
- advanceend: 0
698
- }
699
- // let splitArr = []
700
- let delaystartArr = []
701
- let advanceendArr = []
702
- for (let rings of ringsList) {
703
- for (let ring of rings) {
704
- if (stageArr.includes(ring.id)) {
705
- // let split = ring.value
706
- let delaystart = ring.delaystart
707
- let advanceend = ring.advanceend
708
- // splitArr.push(split)
709
- delaystartArr.push(delaystart)
710
- advanceendArr.push(advanceend)
711
- }
712
- }
713
- }
714
- // splitArr.sort(function (a, b) { return a - b })
715
- delaystartArr.sort(function (a, b) { return b - a })
716
- advanceendArr.sort(function (a, b) { return a - b })
717
- // res.split = splitArr.length > 0 ? splitArr[0] : 0
718
- res.delaystart = delaystartArr.length > 0 ? delaystartArr[0] : 0
719
- res.advanceend = advanceendArr.length > 0 ? advanceendArr[0] : 0
720
- return res
721
- },
722
- initData () {
723
- // 判断有几个环,就创建几个看板
724
- // let phaseList = this.globalParamModel.getParamsByType('phaseList')
725
- this.coordphaseOption = this.phaseList.map(ele => {
726
- return {
727
- value: ele.id
728
- }
729
- })
730
- // this.overlap = this.globalParamModel.getParamsByType('overlaplList')
731
- // this.agentId = getIframdevid()
732
- let rings = []
733
- if (this.phaseList.length === 0) {
734
- // this.$store.getters.tscParam.patternList = []
735
- return
736
- }
737
- for (let phase of this.phaseList) {
738
- rings.push(phase.ring)
739
- }
740
- this.ringCount = Array.from(new Set(rings)) // 去除数组重复的元素
741
- this.ringCount = this.ringCount.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
742
- this.ringCounts = Array.from(new Set(rings)) // 去除数组重复的元素
743
- this.ringCounts = this.ringCounts.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
744
- this.optimizes = Array.from(new Set(rings)) // 去除数组重复的元素
745
- this.optimizes = this.optimizes.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
746
- // this.increaseId()
747
- // this.getCycle()
748
- // this.updatePhaseDescription()
749
- // this.getOptionsOfRing()
750
- },
751
- sortNumbers (a, b) {
752
- return a - b
753
- },
754
- isRingCycleEqual (rings) {
755
- let isequal = true
756
- // this.patternmsg = []
757
- let maxCycle = 0
758
- for (let ring of rings) {
759
- if (ring.length === 0) continue
760
- let cycle = 0
761
- for (let r of ring) {
762
- if (r.mode === 7) { // 忽略相位不计周期
763
- continue
764
- }
765
- cycle = cycle + r.value
766
- }
767
- if (cycle > maxCycle && maxCycle === 0) {
768
- maxCycle = cycle
769
- }
770
- if (cycle !== maxCycle) {
771
- // this.patternmsg.push(rings.id)
772
- isequal = false
773
- }
774
- }
775
- return isequal
776
- },
777
- getMaxCycle (pattern) {
778
- let rings = pattern.rings
779
- let maxCycle = 0
780
- for (let ring of rings) {
781
- if (ring.length === 0) continue
782
- let cycle = 0
783
- for (let r of ring) {
784
- if (r.mode === 7) { // 忽略相位不计周期
785
- continue
786
- }
787
- cycle = cycle + r.value
788
- }
789
- if (cycle > maxCycle) {
790
- maxCycle = cycle
791
- }
792
- }
793
- return maxCycle
794
- },
795
- // checkPatternRules (rings) {
796
- // if (!this.isRingCycleEqual(rings)) {
797
- // this.patternCycleEqual = false
798
- // } else {
799
- // this.patternCycleEqual = true
800
- // }
801
- // if (!this.patternCycleEqual) {
802
- // let mess = `方案中存在环周期时长不一致`
803
- // if (this.$i18n.locale === 'en') {
804
- // mess = `Inconsistent loop cycle durations exist in the scheme`
805
- // }
806
- // this.$message({
807
- // message: mess,
808
- // type: 'error',
809
- // dangerouslyUseHTMLString: true
810
- // })
811
- // return false
812
- // }
813
- // },
814
- handleManualControl () {
815
- let submitdata = {
816
- control: 100,
817
- delay: this.manualInfo.tempDelay !== undefined ? Number(this.manualInfo.tempDelay) : 0,
818
- duration: Number(this.manualInfo.duration),
819
- // duration: this.manualInfo.tempDuration !== undefined ? Number(this.manualInfo.tempDuration) : 0,
820
- data: {}
821
- }
822
- if (this.patternOne.length === 0) {
823
- submitdata.data.cycle = this.getMaxCycle(this.planPattern)
824
- } else {
825
- submitdata.data.cycle = this.getMaxCycle(this.patternOne[0])
826
- }
827
- submitdata.data.offset = this.offset
828
- submitdata.data.rings = this.rings
829
- // this.checkPatternRules(submitdata.data.rings)
830
- if (this.patternCycleEqual) {
831
- this.$emit('closePhaseControl', submitdata)
832
- }
833
- }
834
- }
835
- }
836
- </script>
837
-
838
- <style>
839
-
840
- </style>
1
+ <template>
2
+ <div class="tentativeplan-control">
3
+ <div class="title" style="margin-bottom: 18px;">{{$t('openatccomponents.overview.tentativeplan')}}</div>
4
+ <el-row>
5
+ <el-col :span="12">
6
+ <el-form
7
+ ref="manual"
8
+ label-position="left"
9
+ :model="manualInfo"
10
+ label-width="100px">
11
+ <el-form-item
12
+ :label="$t('openatccomponents.overview.patternid') + ':'"
13
+ prop="count">
14
+ <el-select @change="selectPattern()" v-model="manualInfo.tempPatternid" class="col-inner" size="small" :placeholder="$t('openatccomponents.common.select')">
15
+ <el-option
16
+ v-for="item in patternSelect"
17
+ :key="item.value"
18
+ :label="item.label"
19
+ :value="item.value">
20
+ </el-option>
21
+ </el-select>
22
+ <!-- <el-input v-model="manualInfo.tempDuration" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
23
+ </el-form-item>
24
+ <el-form-item
25
+ :label="$t('openatccomponents.overview.delay') + ':'"
26
+ prop="intersection">
27
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.tempDelay" size="mini"></el-input-number>
28
+ <!-- <el-input v-model="manualInfo.tempDelay" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
29
+ </el-form-item>
30
+ </el-form>
31
+ </el-col>
32
+ <el-col :span="12">
33
+ <el-form
34
+ ref="manual"
35
+ label-position="left"
36
+ :model="manualInfo"
37
+ label-width="100px">
38
+ <el-form-item
39
+ :label="$t('openatccomponents.overview.patternoffset') + ':'"
40
+ prop="count">
41
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.offset" size="mini"></el-input-number>
42
+ <!-- <el-input v-model="manualInfo.offset" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
43
+ </el-form-item>
44
+ <el-form-item
45
+ :label="$t('openatccomponents.overview.duration') + ':'"
46
+ prop="intersection">
47
+ <el-input-number :placeholder="$t('openatccomponents.common.input')" :min="0" :max="65535" :precision="0" :step="1" :controls="false" v-model.number="manualInfo.duration" size="mini"></el-input-number>
48
+ <!-- <el-input v-model="manualInfo.duration" size="mini" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
49
+ </el-form-item>
50
+ </el-form>
51
+ </el-col>
52
+ </el-row>
53
+ <el-row>
54
+ <div class="title" style="margin-top:18px; margin-bottom:10px">{{$t('openatccomponents.overview.patternstate')}}:
55
+ <span>({{$t('openatccomponents.overview.cycle')}}: {{cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{offset}})</span>
56
+ </div>
57
+ <stage-status
58
+ :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
59
+ >
60
+ </stage-status>
61
+ <pattern-list
62
+ :patternList="patternOne.length===0?planPattern.rings:patternOne"
63
+ :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
64
+ :cycles="patternOne.length===0?planPattern.cycle:patternOne[0].cycle"
65
+ :phaseList="phaseList">
66
+ </pattern-list>
67
+ </el-row>
68
+ <el-row>
69
+ <el-tabs v-model="activeList" type="card">
70
+ <el-tab-pane :label="$t('openatccomponents.pattern.ringConfig')" name="ring">
71
+ <div style="width: 100%; overflow: hidden;margin-top: 20px;">
72
+ <kan-ban v-for="n in ringCount"
73
+ :key="n" class="closephasekanban"
74
+ :index="n"
75
+ :options="options"
76
+ :list="patternOne.length===0?planPattern.rings[n-1]:patternOne[0].rings[n-1]"
77
+ :phaseList="phaseList"
78
+ :header-text="$t('openatccomponents.pattern.ring')+n"
79
+ @handleSplit="handleSplit">
80
+ </kan-ban>
81
+ </div>
82
+ </el-tab-pane>
83
+ <!-- <el-tab-pane :label="$t('openatccomponents.pattern.stageConfig')" name="kanban">
84
+ <el-scrollbar :vertical="true">
85
+ <div class="stage-panel-contener">
86
+ <stage-board v-for="(stage,index) in patternOne.length===0?stagesList:patternOne[0].stagesList"
87
+ class="closephasekanban"
88
+ :key="index"
89
+ :stage="stage"
90
+ :options="options"
91
+ :stageInfo="patternOne.length===0?stagesList:patternOne[0].stagesList"
92
+ :coordphaseOption="coordphaseOption"
93
+ :subIndex="index"
94
+ @onStageSplitChange="onStageSplitChange"
95
+ @stageSplitChange="stageSplitChange"
96
+ @onStageDelaystartChange="onStageDelaystartChange"
97
+ @onStageAdvanceendChange="onStageAdvanceendChange"
98
+ >
99
+ </stage-board>
100
+ </div>
101
+ </el-scrollbar>
102
+ </el-tab-pane> -->
103
+ <el-tab-pane :label="$t('openatccomponents.pattern.parameters')" name="parame">
104
+ <el-row>
105
+ <expend-config
106
+ v-for="(j,index) in ringCounts"
107
+ :key="index"
108
+ class="expendkanban"
109
+ :options="options"
110
+ :header-text="$t('openatccomponents.pattern.ring')+j"
111
+ :list="patternOne.length===0?planPattern.rings[j-1]:patternOne[0].rings[j-1]"
112
+ >
113
+ </expend-config>
114
+ <div class="forbiddenstage">
115
+ {{$t('openatccomponents.pattern.forbiddenstage')}}
116
+ <el-input class="stage-value" size="small" v-model="forbiddenstage"></el-input>
117
+ </div>
118
+ <div class="forbiddenstage">
119
+ {{$t('openatccomponents.pattern.screenstage')}}
120
+ <el-input class="stage-value" size="small" v-model="screenstage"></el-input>
121
+ </div>
122
+ <div class="forbiddenstage">
123
+ {{$t('openatccomponents.pattern.coordinatestage')}}
124
+ <el-input class="stage-value" size="small" v-model="coordinatestage"></el-input>
125
+ </div>
126
+ </el-row>
127
+ </el-tab-pane>
128
+ <el-tab-pane :label="$t('openatccomponents.pattern.overLap')" name="overlap">
129
+ <el-row :gutter="20">
130
+ <el-col :span="24" >
131
+ <over-lap
132
+ :stageList="stagesList"
133
+ :overlap="overlap"
134
+ :checked="true"
135
+ :tentative="true"
136
+ :cycle="overLapCycle"
137
+ >
138
+ </over-lap>
139
+ </el-col>
140
+ </el-row>
141
+ </el-tab-pane>
142
+ <el-tab-pane :label="$t('openatccomponents.pattern.patternOptimize')" name="patternOptimize">
143
+ <pattern-optimize
144
+ v-for="n in optimizes"
145
+ :key="n" class="expendkanban"
146
+ :list="patternOne.length===0?planPattern.rings[n-1]:patternOne[0].rings[n-1]"
147
+ :rings="patternOne.length===0?planPattern:patternOne[0]"
148
+ :phaseList="phaseList"
149
+ :options="options"
150
+ :header-text="$t('openatccomponents.pattern.ring')+n"
151
+ :index="n"
152
+ :nowNumber="n"
153
+ @handleSplit="handleSplit"
154
+ >
155
+ </pattern-optimize>
156
+ </el-tab-pane>
157
+ </el-tabs>
158
+ </el-row>
159
+ <div class="footer" v-if="realtimeStatusModalvisible">
160
+ <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
161
+ <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.implement')}}</el-button>
162
+ </div>
163
+ <div class="footer" v-if="!realtimeStatusModalvisible">
164
+ <el-button @click="handleClose()">{{$t('openatccomponents.button.Back')}}</el-button>
165
+ <el-button type="primary" @click="handleManualControl()">{{$t('openatccomponents.overview.comfirm')}}</el-button>
166
+ </div>
167
+ </div>
168
+ </template>
169
+
170
+ <script>
171
+ export default {
172
+ name: 'tentativeplancontrol',
173
+ props: {
174
+ realtimeStatusModalvisible: {
175
+ type: Boolean,
176
+ default: true
177
+ },
178
+ controlData: {
179
+ type: Object
180
+ },
181
+ phaseList: {
182
+ type: Array
183
+ },
184
+ overlap: {
185
+ type: Array
186
+ },
187
+ allPatternList: {
188
+ type: Array
189
+ },
190
+ patternSelect: {
191
+ type: Array
192
+ }
193
+ },
194
+ computed: {
195
+ rings () {
196
+ return this.patternOne.length === 0 ? this.planPattern.rings : this.patternOne[0].rings
197
+ },
198
+ cycle () {
199
+ return this.patternOne.length === 0 ? this.max : (this.patternOne.length > 0 && (this.patternOne[0].cycle < this.max)) ? this.max : this.patternOne[0].cycle
200
+ },
201
+ offset () {
202
+ return Number((this.patternOne.length === 0 || this.manualInfo.offset > 0) ? this.manualInfo.offset : this.patternOne[0].offset)
203
+ },
204
+ forbiddenstage () {
205
+ return this.patternOne.length === 0 ? this.allPatternList[0].forbiddenstage : this.patternOne[0].forbiddenstage
206
+ },
207
+ screenstage () {
208
+ return this.patternOne.length === 0 ? this.allPatternList[0].screenstage : this.patternOne[0].screenstage
209
+ },
210
+ coordinatestage () {
211
+ return this.patternOne.length === 0 ? this.allPatternList[0].coordinatestage : this.patternOne[0].coordinatestage
212
+ }
213
+ },
214
+ data () {
215
+ return {
216
+ stagesList: [],
217
+ phaseRings: [],
218
+ overLapCycle: 0,
219
+ options: {
220
+ group: 'pattern'
221
+ },
222
+ max: '',
223
+ patternCycleEqual: true,
224
+ activeList: 'ring',
225
+ ringCount: 1,
226
+ ringCounts: 1,
227
+ barriers: [],
228
+ optimizes: 1,
229
+ coordphaseOption: [],
230
+ patternOne: [],
231
+ planPattern: {},
232
+ manualInfo: {
233
+ tempPatternid: '',
234
+ offset: 0,
235
+ duration: 300,
236
+ tempDelay: 0 // 控制方式手动操作的情况下的延迟时间的临时值。
237
+ // tempDuration: 300 // 控制方式手动操作的情况下的持续时间的临时值。
238
+ }
239
+ }
240
+ },
241
+ created () {
242
+ this.patternPlan()
243
+ this.getCycle()
244
+ if (this.patternOne.length === 0) {
245
+ this.handleStageData(this.planPattern.rings)
246
+ }
247
+ this.initData()
248
+ },
249
+ methods: {
250
+ tranform (arr) { // 分barrier
251
+ let newMap = new Map()
252
+ arr.forEach(({id, current}) => {
253
+ const find = newMap.get(current.join())
254
+ if (find) newMap.get(current.join()).push(id)
255
+ else newMap.set(current.join(), [id])
256
+ })
257
+ let ret = []
258
+ newMap.forEach((value, key) => {
259
+ ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
260
+ })
261
+ const result = []
262
+ for (const a of ret) {
263
+ let merged = false
264
+ for (const r of result) {
265
+ if (this.check([...r], a)) {
266
+ a.forEach(item => r.add(item))
267
+ merged = true
268
+ }
269
+ }
270
+ if (!merged) {
271
+ result.push(new Set(a))
272
+ }
273
+ merged = false
274
+ }
275
+ return result.map(s => [...s])
276
+ },
277
+ check (arr1, arr2) {
278
+ return arr1.some(a1 => arr2.some(a2 => a1 === a2))
279
+ },
280
+ handleCurrentChange (val) { // 两个ring的数据
281
+ if (val === null || val.length === 0) return
282
+ // 按环序分组
283
+ let ringlength = []
284
+ let ringsequence = val.map(item => {
285
+ if (item.length === 0) return
286
+ ringlength.push(item.length)
287
+ return item.map(k => {
288
+ return k.id
289
+ })
290
+ })
291
+ let newRings = ringsequence.filter(item => item)
292
+ let minLength = Math.min(...ringlength)
293
+ let resultArrs = [] // 环1分组
294
+ let resultArr = [] // 环2分组
295
+ for (let j = 0; j < ringsequence[0].length; j += minLength) {
296
+ resultArrs.push(ringsequence[0].slice(j, j + minLength))
297
+ if (ringsequence[0].length === minLength) {
298
+ resultArrs.push([])
299
+ }
300
+ }
301
+ if (newRings.length > 1) {
302
+ for (let i = 0; i < ringsequence[1].length; i += minLength) {
303
+ resultArr.push(ringsequence[1].slice(i, i + minLength))
304
+ }
305
+ }
306
+ // this.patternInfo = []
307
+ // this.barrierList = []
308
+ let currentArr = []
309
+ let newPattern = []
310
+ val.map(i => {
311
+ newPattern.push(...i)
312
+ })
313
+ if (this.phaseList.length === 0) return
314
+ for (let patternStatus of val[0]) {
315
+ // if (patternStatus.mode !== 7) {
316
+ let concurrent = this.phaseList.filter((item) => {
317
+ return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
318
+ })[0].concurrent// 当前相位的并发相位
319
+ if (concurrent) {
320
+ let obj = {
321
+ id: patternStatus.id,
322
+ current: concurrent.sort()
323
+ }
324
+ currentArr.push(obj)
325
+ }
326
+ // }
327
+ }
328
+ if (currentArr.length !== 0) {
329
+ let newCurrent = this.tranform(currentArr)
330
+ // 取没个环与环关系的并集
331
+ let barrierRing1 = []
332
+ let barrierRing2 = []
333
+ let ring1 = [] // 环1与关系1的并集
334
+ for (let h = 0; h < newCurrent.length; h++) {
335
+ let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
336
+ ring1.push(adds)
337
+ }
338
+ let ring1s = [] // 环1与关系2的并集
339
+ for (let h = 0; h < newCurrent.length; h++) {
340
+ let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
341
+ ring1s.push(addRing1)
342
+ }
343
+ barrierRing1.push(...ring1, ...ring1s)
344
+ let resultList = []
345
+ if (newRings.length > 1) {
346
+ let ring2s = [] // 环2与关系1的并集
347
+ for (let h = 0; h < newCurrent.length; h++) {
348
+ let addRing2 = [...new Set(resultArr[1])].filter(item => newCurrent[h].includes(item))
349
+ ring2s.push(addRing2)
350
+ }
351
+ let ring2 = [] // 环2与关系1的并集
352
+ for (let h = 0; h < newCurrent.length; h++) {
353
+ let add = [...new Set(resultArr[0])].filter(item => newCurrent[h].includes(item))
354
+ ring2.push(add)
355
+ }
356
+ barrierRing2.push(...ring2, ...ring2s)
357
+ for (let k = 0; k < barrierRing1.length; k++) {
358
+ resultList.push(barrierRing1[k].concat(barrierRing2[k]))
359
+ }
360
+ }
361
+ let resultLists = resultList.filter(item => item.length !== 0)
362
+ let ringArr = []
363
+ for (let l = 0; l < resultLists.length; l++) {
364
+ for (let d = 0; d < newCurrent.length; d++) {
365
+ if (newCurrent[d].filter(item => resultLists[l].includes(item)).length > 0) {
366
+ ringArr.push({
367
+ data: resultLists[l],
368
+ id: d + 1,
369
+ index: l
370
+ })
371
+ }
372
+ }
373
+ }
374
+ for (var i = 0; i < ringArr.length; i++) {
375
+ for (var j = i + 1; j < ringArr.length; j++) {
376
+ if (ringArr[i].id === ringArr[j].id && ringArr[i].index + 1 === ringArr[j].index) {
377
+ ringArr[i].data = ringArr[i].data.concat(ringArr[j].data)
378
+ ringArr.splice(ringArr.indexOf(ringArr[j].id), 1)
379
+ }
380
+ }
381
+ }
382
+ let resArr = ringArr.map(item => item.data)
383
+ let ringTeam = this.step1(this.phaseList, resArr)
384
+ let ringTeams = ringTeam.filter(item => item.length !== 0)
385
+ return this.setBarrier(ringTeams, val)
386
+ }
387
+ },
388
+ setBarrier (ringTeam, val) {
389
+ const patternObjs = {}
390
+ val.forEach(l => {
391
+ l.map(k => {
392
+ patternObjs[k.id] = k.value
393
+ })
394
+ })
395
+ let ret = ringTeam.map((y, index) => {
396
+ if (!y || y.length === 0) return
397
+ y.map(n => {
398
+ n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
399
+ })
400
+ return {
401
+ barrier: index + 1,
402
+ length: y[0].length,
403
+ items: y.map(j => {
404
+ return {
405
+ ring: j.ring,
406
+ data: j.data
407
+ }
408
+ })
409
+ }
410
+ })
411
+ return ret
412
+ },
413
+ step1 (list, arr) { // 各个环包含的相位
414
+ const ret = []
415
+ const listObj = {}
416
+ list.forEach(l => {
417
+ listObj[l.id] = l.ring
418
+ })
419
+ arr.forEach(a => {
420
+ const retItem = []
421
+ a.forEach(b => {
422
+ if (listObj[b]) {
423
+ const find = retItem.find(r => r.ring === listObj[b])
424
+ if (find) find.data.push(b)
425
+ else retItem.push({ring: listObj[b], data: [b]})
426
+ }
427
+ })
428
+ ret.push(retItem)
429
+ })
430
+ return ret
431
+ },
432
+ patternPlan () {
433
+ let Pattern = {
434
+ offset: 0,
435
+ cycle: 0,
436
+ rings: [[], [], [], []]
437
+ }
438
+ var newPattern = JSON.parse(JSON.stringify(Pattern))
439
+ for (let phase of this.phaseList) {
440
+ let ring = {}
441
+ ring.name = 'Phase ' + phase.id
442
+ ring.desc = this.getPhaseDescription(phase.direction)
443
+ ring.id = phase.id
444
+ ring.value = 30
445
+ ring.mode = 2
446
+ ring.options = []
447
+ ring.delaystart = 0
448
+ ring.advanceend = 0
449
+ if (phase.ring === 1) {
450
+ newPattern.rings[0].push(ring)
451
+ } else if (phase.ring === 2) {
452
+ newPattern.rings[1].push(ring)
453
+ } else if (phase.ring === 3) {
454
+ newPattern.rings[2].push(ring)
455
+ } else if (phase.ring === 4) {
456
+ newPattern.rings[3].push(ring)
457
+ }
458
+ }
459
+ let barrier = this.handleCurrentChange(newPattern.rings)
460
+ newPattern.barriers = barrier
461
+ this.planPattern = newPattern
462
+ },
463
+ getCycle () {
464
+ for (let rings of this.planPattern.rings) {
465
+ let num = 0
466
+ for (let i = 0; i < rings.length; i++) {
467
+ if (rings[i].length !== 0) {
468
+ if (rings[i].mode === 7) { // 忽略相位不计周期
469
+ continue
470
+ }
471
+ num = num + Number(rings[i].value)
472
+ }
473
+ }
474
+ if (num !== 0) {
475
+ this.planPattern.cycle = num
476
+ break
477
+ }
478
+ }
479
+ },
480
+ getCycles () {
481
+ if (!this.patternOne[0].stages) return
482
+ let stages = this.patternOne[0].stages
483
+ let modeId = stages.filter(item => item.length === 1)[0]
484
+ for (let rings of this.patternOne[0].rings) {
485
+ let num = 0
486
+ for (let i = 0; i < rings.length; i++) {
487
+ if (rings[i].length !== 0) {
488
+ if (rings[i].mode === 7 && (modeId && modeId[0] === rings[i].id)) { // 忽略相位不计周期
489
+ continue
490
+ }
491
+ num = num + Number(rings[i].value)
492
+ }
493
+ }
494
+ if (num !== 0) {
495
+ this.patternOne[0].cycle = num
496
+ break
497
+ }
498
+ }
499
+ },
500
+ getPhaseDescription (phaseList) {
501
+ if (!phaseList) return
502
+ let list = []
503
+ for (let id of phaseList) {
504
+ let obj = {}
505
+ obj.id = id
506
+ obj.color = '#454545'
507
+ list.push(obj)
508
+ }
509
+ return list
510
+ },
511
+ handleClose () {
512
+ this.$emit('closePhaseBack')
513
+ },
514
+ onStageSplitChange (diff, rowIndex, subIndex) {
515
+ let stageArr = this.stagesList[subIndex].stages
516
+ let row = this.patternList[rowIndex]
517
+ let ringsList = row.rings
518
+ for (let rings of ringsList) {
519
+ for (let ring of rings) {
520
+ if (stageArr.includes(ring.id)) {
521
+ ring.value = (ring.value ? ring.value : 0) + diff
522
+ continue
523
+ }
524
+ }
525
+ }
526
+ },
527
+ stageSplitChange (diff, rowIndex, subIndex) {
528
+ let row = this.patternList[rowIndex]
529
+ let ringsList = row.stagesList
530
+ for (let rings of ringsList) {
531
+ if (subIndex === rings.key) {
532
+ rings.stageSplit = (rings.green ? rings.green : 0) + (rings.yellow ? rings.yellow : 0) + (rings.red ? rings.red : 0)
533
+ continue
534
+ }
535
+ }
536
+ },
537
+ onStageDelaystartChange (diff, rowIndex, subIndex) {
538
+ let stageArr = this.stagesList[subIndex].stages
539
+ let row = this.patternList[rowIndex]
540
+ let ringsList = row.rings
541
+ for (let rings of ringsList) {
542
+ for (let ring of rings) {
543
+ if (stageArr.includes(ring.id)) {
544
+ ring.delaystart = (ring.delaystart ? ring.delaystart : 0) + diff
545
+ continue
546
+ }
547
+ }
548
+ }
549
+ },
550
+ onStageAdvanceendChange (diff, rowIndex, subIndex) {
551
+ let stageArr = this.stagesList[subIndex].stages
552
+ let row = this.patternList[rowIndex]
553
+ let ringsList = row.rings
554
+ for (let rings of ringsList) {
555
+ for (let ring of rings) {
556
+ if (stageArr.includes(ring.id)) {
557
+ ring.advanceend = (ring.advanceend ? ring.advanceend : 0) + diff
558
+ continue
559
+ }
560
+ }
561
+ }
562
+ },
563
+ handleSplit (index) {
564
+ if (this.patternOne.length > 0) {
565
+ let currPattern = this.patternOne[0].rings
566
+ setTimeout(() => {
567
+ this.handleStageData(currPattern)
568
+ this.getCycles()
569
+ this.patternOne[0].stagesList = this.stagesList
570
+ }, 50)
571
+ } else {
572
+ let currPattern = this.planPattern.rings
573
+ setTimeout(() => {
574
+ this.handleStageData(currPattern)
575
+ this.getCycle()
576
+ this.allPatternList[0].stagesList = this.stagesList
577
+ }, 50)
578
+ }
579
+ },
580
+ selectPattern () {
581
+ this.manualInfo.offset = 0
582
+ let selectId = Number(this.manualInfo.tempPatternid)
583
+ this.patternOne = this.allPatternList.filter(item => {
584
+ return item.id === selectId
585
+ })
586
+ this.manualInfo.offset = this.offset
587
+ for (let rings of this.patternOne[0].rings) {
588
+ if (rings.length === 0) continue
589
+ for (let ring of rings) {
590
+ if (ring.value === 0) continue
591
+ let currPhase = this.phaseList.filter((item) => {
592
+ return item.id === ring.id
593
+ })[0]
594
+ ring.desc = currPhase.direction.map(item => {
595
+ return {
596
+ id: item,
597
+ color: '#454545'
598
+ }
599
+ })
600
+ }
601
+ }
602
+ this.handleStageData(this.patternOne[0].rings)
603
+ },
604
+ handleStageData (rings) { // stagesList
605
+ for (let i = 0; i < rings.length; i++) {
606
+ if (rings[i].length > 0) {
607
+ let phaseList = []
608
+ let stagesList = []
609
+ // rings = JSON.parse(JSON.stringify(rings))
610
+ let mapAdd = rings.map(item => {
611
+ return item.map(val => {
612
+ // if (val.mode !== 7) {
613
+ return val.value + (val.sum ? val.sum : 0)
614
+ // } else {
615
+ // return 0
616
+ // }
617
+ })
618
+ })
619
+ let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
620
+ return item.length > 0 ? item.reduce((a, b) => {
621
+ return a + b
622
+ }) : 0
623
+ }) : 0
624
+ this.max = Math.max(...maxCycle)// 每个环的周期最大值
625
+ this.stateList = [0]
626
+ this.narr = []
627
+ let currentIds = ''
628
+ let lastCurrentIds = ''
629
+ for (let j = 0; j <= this.max; j++) { // 指针长度
630
+ for (let i = 0; i < rings.length; i++) { // 环列表
631
+ let ring = rings[i]// 每个环对象
632
+ let sum = 0
633
+ for (let n = 0; n < ring.length; n++) { // 相位累计长度
634
+ // if (ring[n].mode !== 7) {
635
+ sum = sum + ring[n].value + (ring[n].sum ? ring[n].sum : 0)
636
+ if (j < sum) {
637
+ let phaseId = ring[n].id
638
+ currentIds = currentIds + '-' + phaseId
639
+ break
640
+ }
641
+ // }
642
+ }
643
+ }
644
+ if (lastCurrentIds !== currentIds && lastCurrentIds !== '') { // 当前相位id和上一个相比不同说明相位变化了
645
+ phaseList.push(lastCurrentIds)
646
+ this.stateList.push(j)// 阶段累计长度的集合
647
+ }
648
+ lastCurrentIds = currentIds
649
+ currentIds = ''
650
+ }
651
+ let newPhaselist = []
652
+ phaseList.forEach(i => {
653
+ let rangeArr = i.split('-').map(Number)
654
+ if (rangeArr.length > 2) {
655
+ newPhaselist.push([
656
+ JSON.parse(JSON.stringify(rangeArr[1])),
657
+ JSON.parse(JSON.stringify(rangeArr[2]))
658
+ ])
659
+ } else {
660
+ newPhaselist.push([
661
+ JSON.parse(JSON.stringify(rangeArr[1]))
662
+ ])
663
+ }
664
+ })
665
+ for (let i = this.stateList.length - 1; i >= 1; i--) {
666
+ this.narr.push(this.stateList[i] - this.stateList[i - 1])
667
+ }
668
+ // newPhaselist
669
+ this.narr.reverse()// 阶段差
670
+ for (let i = 0; i < newPhaselist.length; i++) {
671
+ let stage = JSON.parse(JSON.stringify(newPhaselist[i]))
672
+ let newStage = []
673
+ stage.map(item => {
674
+ for (let ring of rings) {
675
+ for (let ringItem of ring) {
676
+ if (item === ringItem.id && (ringItem.mode !== 7 && ringItem.mode !== 8)) {
677
+ newStage.push(item)
678
+ }
679
+ }
680
+ }
681
+ })
682
+ let stageItem = this.getStageItem(newStage, stage, rings, i)
683
+ stagesList.push(JSON.parse(JSON.stringify(stageItem)))
684
+ }
685
+ this.overLapCycle = stagesList.reduce((prev, curr) => prev + parseInt(curr.split), 0)
686
+ this.stagesList = JSON.parse(JSON.stringify(stagesList))
687
+ }
688
+ }
689
+ },
690
+ getStageItem (stageArr, stage, ringsList, i) {
691
+ let res = {
692
+ key: i,
693
+ split: this.narr[i], // 阶段绿性比
694
+ phases: stageArr,
695
+ stageKanban: stage,
696
+ delaystart: 0,
697
+ advanceend: 0
698
+ }
699
+ // let splitArr = []
700
+ let delaystartArr = []
701
+ let advanceendArr = []
702
+ for (let rings of ringsList) {
703
+ for (let ring of rings) {
704
+ if (stageArr.includes(ring.id)) {
705
+ // let split = ring.value
706
+ let delaystart = ring.delaystart
707
+ let advanceend = ring.advanceend
708
+ // splitArr.push(split)
709
+ delaystartArr.push(delaystart)
710
+ advanceendArr.push(advanceend)
711
+ }
712
+ }
713
+ }
714
+ // splitArr.sort(function (a, b) { return a - b })
715
+ delaystartArr.sort(function (a, b) { return b - a })
716
+ advanceendArr.sort(function (a, b) { return a - b })
717
+ // res.split = splitArr.length > 0 ? splitArr[0] : 0
718
+ res.delaystart = delaystartArr.length > 0 ? delaystartArr[0] : 0
719
+ res.advanceend = advanceendArr.length > 0 ? advanceendArr[0] : 0
720
+ return res
721
+ },
722
+ initData () {
723
+ // 判断有几个环,就创建几个看板
724
+ // let phaseList = this.globalParamModel.getParamsByType('phaseList')
725
+ this.coordphaseOption = this.phaseList.map(ele => {
726
+ return {
727
+ value: ele.id
728
+ }
729
+ })
730
+ // this.overlap = this.globalParamModel.getParamsByType('overlaplList')
731
+ // this.agentId = getIframdevid()
732
+ let rings = []
733
+ if (this.phaseList.length === 0) {
734
+ // this.$store.getters.tscParam.patternList = []
735
+ return
736
+ }
737
+ for (let phase of this.phaseList) {
738
+ rings.push(phase.ring)
739
+ }
740
+ this.ringCount = Array.from(new Set(rings)) // 去除数组重复的元素
741
+ this.ringCount = this.ringCount.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
742
+ this.ringCounts = Array.from(new Set(rings)) // 去除数组重复的元素
743
+ this.ringCounts = this.ringCounts.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
744
+ this.optimizes = Array.from(new Set(rings)) // 去除数组重复的元素
745
+ this.optimizes = this.optimizes.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
746
+ // this.increaseId()
747
+ // this.getCycle()
748
+ // this.updatePhaseDescription()
749
+ // this.getOptionsOfRing()
750
+ },
751
+ sortNumbers (a, b) {
752
+ return a - b
753
+ },
754
+ isRingCycleEqual (rings) {
755
+ let isequal = true
756
+ // this.patternmsg = []
757
+ let maxCycle = 0
758
+ for (let ring of rings) {
759
+ if (ring.length === 0) continue
760
+ let cycle = 0
761
+ for (let r of ring) {
762
+ if (r.mode === 7) { // 忽略相位不计周期
763
+ continue
764
+ }
765
+ cycle = cycle + r.value
766
+ }
767
+ if (cycle > maxCycle && maxCycle === 0) {
768
+ maxCycle = cycle
769
+ }
770
+ if (cycle !== maxCycle) {
771
+ // this.patternmsg.push(rings.id)
772
+ isequal = false
773
+ }
774
+ }
775
+ return isequal
776
+ },
777
+ getMaxCycle (pattern) {
778
+ let rings = pattern.rings
779
+ let maxCycle = 0
780
+ for (let ring of rings) {
781
+ if (ring.length === 0) continue
782
+ let cycle = 0
783
+ for (let r of ring) {
784
+ if (r.mode === 7) { // 忽略相位不计周期
785
+ continue
786
+ }
787
+ cycle = cycle + r.value
788
+ }
789
+ if (cycle > maxCycle) {
790
+ maxCycle = cycle
791
+ }
792
+ }
793
+ return maxCycle
794
+ },
795
+ // checkPatternRules (rings) {
796
+ // if (!this.isRingCycleEqual(rings)) {
797
+ // this.patternCycleEqual = false
798
+ // } else {
799
+ // this.patternCycleEqual = true
800
+ // }
801
+ // if (!this.patternCycleEqual) {
802
+ // let mess = `方案中存在环周期时长不一致`
803
+ // if (this.$i18n.locale === 'en') {
804
+ // mess = `Inconsistent loop cycle durations exist in the scheme`
805
+ // }
806
+ // this.$message({
807
+ // message: mess,
808
+ // type: 'error',
809
+ // dangerouslyUseHTMLString: true
810
+ // })
811
+ // return false
812
+ // }
813
+ // },
814
+ handleManualControl () {
815
+ let submitdata = {
816
+ control: 100,
817
+ delay: this.manualInfo.tempDelay !== undefined ? Number(this.manualInfo.tempDelay) : 0,
818
+ duration: Number(this.manualInfo.duration),
819
+ // duration: this.manualInfo.tempDuration !== undefined ? Number(this.manualInfo.tempDuration) : 0,
820
+ data: {}
821
+ }
822
+ if (this.patternOne.length === 0) {
823
+ submitdata.data.cycle = this.getMaxCycle(this.planPattern)
824
+ } else {
825
+ submitdata.data.cycle = this.getMaxCycle(this.patternOne[0])
826
+ }
827
+ submitdata.data.offset = this.offset
828
+ submitdata.data.rings = this.rings
829
+ // this.checkPatternRules(submitdata.data.rings)
830
+ if (this.patternCycleEqual) {
831
+ this.$emit('closePhaseControl', submitdata)
832
+ }
833
+ }
834
+ }
835
+ }
836
+ </script>
837
+
838
+ <style>
839
+
840
+ </style>