openatc-components 0.2.80 → 0.2.82

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 (487) 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 -93
  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 +112 -116
  23. package/package/kisscomps/components/BoardCard/index.js +2 -2
  24. package/package/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +101 -0
  25. package/package/kisscomps/components/ChannelRealtimeIntersection/index.js +2 -0
  26. package/package/kisscomps/components/Channelization/Channelization.vue +584 -584
  27. package/package/kisscomps/components/Channelization/index.js +2 -2
  28. package/package/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  29. package/package/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  30. package/package/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  31. package/package/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  32. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  33. package/package/kisscomps/components/CommonKanban/index.js +2 -2
  34. package/package/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +454 -454
  35. package/package/kisscomps/components/DirectionListConfiguration/index.js +2 -2
  36. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  37. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  38. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  39. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  40. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  41. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  42. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  43. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  44. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  45. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  46. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  47. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  48. package/package/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  49. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  50. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  51. package/package/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  52. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  53. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  54. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  55. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  56. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  57. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  58. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  59. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  60. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +467 -467
  61. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  62. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  63. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  64. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  65. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  66. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  67. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  68. package/package/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  69. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  70. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  71. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  72. package/package/kisscomps/components/DrawChannelization/index.js +2 -2
  73. package/package/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  74. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  75. package/package/kisscomps/components/ExpendConfig/index.js +2 -2
  76. package/package/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  77. package/package/kisscomps/components/FaultDetailModal/index.js +2 -2
  78. package/package/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +158 -158
  79. package/package/kisscomps/components/IntersectionDirectionSelection/index.js +2 -2
  80. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +496 -496
  81. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  82. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  83. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  84. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  85. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  86. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  87. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  88. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1302 -1272
  89. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  90. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  91. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  92. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  93. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  94. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  95. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  96. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  97. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  98. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  99. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  100. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/sidewalk.svg +535 -0
  101. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  102. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  103. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  104. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  105. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  106. package/package/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +1296 -1200
  107. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  108. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +196 -196
  109. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  110. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  111. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  112. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +115 -115
  113. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  114. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  115. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +219 -219
  116. package/package/kisscomps/components/IntersectionMap/crossDirection/utils.js +84 -84
  117. package/package/kisscomps/components/IntersectionMap/index.js +2 -2
  118. package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +211 -199
  119. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +530 -530
  120. package/package/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  121. package/package/kisscomps/components/KanBan/index.js +2 -2
  122. package/package/kisscomps/components/KanBan/kanban.vue +225 -225
  123. package/package/kisscomps/components/MessageBox/index.vue +96 -96
  124. package/package/kisscomps/components/OverLap/OverLap.vue +237 -237
  125. package/package/kisscomps/components/OverLap/index.js +2 -2
  126. package/package/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  127. package/package/kisscomps/components/PatternOptimize/index.js +2 -2
  128. package/package/kisscomps/components/PatternStatus/PatternStatus.vue +1508 -1561
  129. package/package/kisscomps/components/PatternStatus/index.js +2 -2
  130. package/package/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  131. package/package/kisscomps/components/PatternWalkSvg/index.js +2 -2
  132. package/package/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  133. package/package/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  134. package/package/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  135. package/package/kisscomps/components/PhaseDirectionText/index.js +2 -2
  136. package/package/kisscomps/components/PhaseMarker/index.js +6 -6
  137. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  138. package/package/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  139. package/package/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  140. package/package/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  141. package/package/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  142. package/package/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  143. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +895 -988
  144. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +360 -356
  145. package/package/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  146. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +210 -206
  147. package/package/kisscomps/components/SchemeConfig/index.js +2 -2
  148. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +223 -221
  149. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  150. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +128 -128
  151. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +426 -426
  152. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +851 -820
  153. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +194 -194
  154. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +211 -207
  155. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  156. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +275 -275
  157. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1209 -1205
  158. package/package/kisscomps/components/SelectCrossPhase/index.vue +418 -418
  159. package/package/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  160. package/package/kisscomps/components/StageBord/StageBord.vue +288 -288
  161. package/package/kisscomps/components/StageBord/index.js +2 -2
  162. package/package/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  163. package/package/kisscomps/components/StageStatus/index.js +2 -2
  164. package/package/kisscomps/components/Stages/index.vue +319 -318
  165. package/package/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  166. package/package/kisscomps/components/SvgIcon/index.js +2 -2
  167. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1041 -1041
  168. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  169. package/package/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  170. package/package/kisscomps/components/XiaoKanban/index.vue +102 -102
  171. package/package/kisscomps/components/overView/index.vue +699 -699
  172. package/package/kisscomps/components/patternConfig/index.js +2 -2
  173. package/package/kisscomps/components/patternConfig/index.vue +1126 -1126
  174. package/package/kisscomps/components/patternConfig/pattern/patternTable.vue +408 -408
  175. package/package/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  176. package/package/kisscomps/components/patternConfig/planContent.vue +576 -576
  177. package/package/kisscomps/components/patternConfig/planMenu.vue +329 -329
  178. package/package/kisscomps/components/patternConfig/utils.js +152 -152
  179. package/package/kisscomps/components/patternList/index.js +2 -2
  180. package/package/kisscomps/components/patternList/patternList.vue +585 -589
  181. package/package/kisscomps/index.js +125 -123
  182. package/package/kissui.js +216608 -0
  183. package/package/kissui.min.js +1 -1
  184. package/package.json +127 -127
  185. package/src/App.vue +24 -24
  186. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  187. package/src/EdgeMgr/controller/crossDiagramMgr.js +125 -125
  188. package/src/api/authapi.js +31 -31
  189. package/src/api/config.js +21 -21
  190. package/src/api/control.js +106 -106
  191. package/src/api/cross.js +53 -49
  192. package/src/api/device.js +135 -135
  193. package/src/api/fault.js +66 -66
  194. package/src/api/index.js +24 -24
  195. package/src/api/login.js +46 -46
  196. package/src/api/optimize.js +72 -72
  197. package/src/api/param.js +165 -165
  198. package/src/api/passwdAssest.js +101 -101
  199. package/src/api/route.js +171 -171
  200. package/src/api/template.js +31 -27
  201. package/src/i18n/index.js +26 -26
  202. package/src/i18n/language/en.js +1437 -1437
  203. package/src/i18n/language/index.js +25 -25
  204. package/src/i18n/language/zh.js +1436 -1436
  205. package/src/icons/demo.css +539 -539
  206. package/src/icons/demo_index.html +8146 -8146
  207. package/src/icons/iconfont.css +1399 -1399
  208. package/src/icons/iconfont.json +2431 -2431
  209. package/src/icons/index.js +20 -20
  210. package/src/icons/svg/azimuthlocking.svg +26 -26
  211. package/src/icons/svg/bendi.svg +110 -110
  212. package/src/icons/svg/bujin.svg +36 -36
  213. package/src/icons/svg/connectBlue.svg +7 -7
  214. package/src/icons/svg/currentvolume.svg +0 -0
  215. package/src/icons/svg/custom-BRTlane.svg +40 -40
  216. package/src/icons/svg/custom-buslane.svg +40 -40
  217. package/src/icons/svg/custom-detector.svg +12 -12
  218. package/src/icons/svg/custom-east-bottom.svg +32 -32
  219. package/src/icons/svg/custom-east-top.svg +32 -32
  220. package/src/icons/svg/custom-ewped.svg +35 -35
  221. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -40
  222. package/src/icons/svg/custom-north-left.svg +32 -32
  223. package/src/icons/svg/custom-north-right.svg +32 -32
  224. package/src/icons/svg/custom-peddetector.svg +17 -17
  225. package/src/icons/svg/custom-snped.svg +35 -35
  226. package/src/icons/svg/custom-south-left.svg +32 -32
  227. package/src/icons/svg/custom-south-right.svg +32 -32
  228. package/src/icons/svg/custom-tramlane.svg +40 -40
  229. package/src/icons/svg/custom-vehiclebranch.svg +40 -40
  230. package/src/icons/svg/custom-vehiclemainroad.svg +41 -41
  231. package/src/icons/svg/custom-west-bottom.svg +32 -32
  232. package/src/icons/svg/custom-west-top.svg +32 -32
  233. package/src/icons/svg/custom-xlped.svg +14 -14
  234. package/src/icons/svg/custom-xrped.svg +14 -14
  235. package/src/icons/svg/cutRed.svg +7 -7
  236. package/src/icons/svg/cycle.svg +0 -0
  237. package/src/icons/svg/dingzhouqi.svg +34 -34
  238. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  239. package/src/icons/svg/guandeng.svg +81 -81
  240. package/src/icons/svg/huangshan.svg +71 -71
  241. package/src/icons/svg/maincontrol.svg +0 -0
  242. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  243. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  244. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  245. package/src/icons/svg/model.svg +0 -0
  246. package/src/icons/svg/phasediff.svg +0 -0
  247. package/src/icons/svg/prioritycontrol.svg +21 -21
  248. package/src/icons/svg/quanhong.svg +86 -86
  249. package/src/icons/svg/shanghe.svg +11 -11
  250. package/src/icons/svg/shoudong.svg +103 -103
  251. package/src/icons/svg/tentativeplan.svg +28 -28
  252. package/src/icons/svg/time.svg +0 -0
  253. package/src/icons/svg/wuxianlan.svg +46 -46
  254. package/src/icons/svg/xiala.svg +11 -11
  255. package/src/icons/svg/xingrenguojie.svg +33 -33
  256. package/src/icons/svg/xitong.svg +89 -89
  257. package/src/icons/svg/youxian.svg +41 -41
  258. package/src/icons/svg/zizhukongzhi.svg +43 -43
  259. package/src/kisscomps/components/BoardCard/BoardCard.vue +112 -116
  260. package/src/kisscomps/components/BoardCard/index.js +2 -2
  261. package/src/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +101 -0
  262. package/src/kisscomps/components/ChannelRealtimeIntersection/index.js +2 -0
  263. package/src/kisscomps/components/Channelization/Channelization.vue +584 -584
  264. package/src/kisscomps/components/Channelization/index.js +2 -2
  265. package/src/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  266. package/src/kisscomps/components/ChannelizationFlowStatistic/index.js +2 -2
  267. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  268. package/src/kisscomps/components/ChannelizationWithInterface/index.js +2 -2
  269. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  270. package/src/kisscomps/components/CommonKanban/index.js +2 -2
  271. package/src/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +454 -454
  272. package/src/kisscomps/components/DirectionListConfiguration/index.js +2 -2
  273. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  274. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  275. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  276. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  277. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  278. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  279. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  280. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  281. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  282. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  283. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  284. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  285. package/src/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  286. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  287. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  288. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  289. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  290. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  291. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  292. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  293. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  294. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  295. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  296. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  297. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +467 -467
  298. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  299. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  300. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1005 -1005
  301. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +110 -110
  302. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  303. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  304. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  305. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  306. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  307. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  308. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  309. package/src/kisscomps/components/DrawChannelization/index.js +2 -2
  310. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  311. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  312. package/src/kisscomps/components/ExpendConfig/index.js +2 -2
  313. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  314. package/src/kisscomps/components/FaultDetailModal/index.js +2 -2
  315. package/src/kisscomps/components/IntersectionDirectionSelection/IntersectionDirectionSelection.vue +158 -158
  316. package/src/kisscomps/components/IntersectionDirectionSelection/index.js +2 -2
  317. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +496 -496
  318. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  319. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +300 -300
  320. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +288 -288
  321. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +391 -391
  322. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +336 -336
  323. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +345 -345
  324. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +389 -389
  325. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1302 -1272
  326. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  327. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +402 -402
  328. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +361 -361
  329. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +368 -368
  330. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +475 -475
  331. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +494 -494
  332. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +401 -401
  333. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +360 -360
  334. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +367 -367
  335. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +476 -476
  336. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  337. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/sidewalk.svg +535 -0
  338. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  339. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  340. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  341. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  342. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  343. package/src/kisscomps/components/IntersectionMap/crossDirection/crossDiagram.vue +1296 -1200
  344. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  345. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/phaseIconSvg.vue +196 -196
  346. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  347. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  348. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  349. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +115 -115
  350. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  351. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  352. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +219 -219
  353. package/src/kisscomps/components/IntersectionMap/crossDirection/utils.js +84 -84
  354. package/src/kisscomps/components/IntersectionMap/index.js +2 -2
  355. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +211 -199
  356. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +530 -530
  357. package/src/kisscomps/components/IntersectionWithInterface/index.js +2 -2
  358. package/src/kisscomps/components/KanBan/index.js +2 -2
  359. package/src/kisscomps/components/KanBan/kanban.vue +225 -225
  360. package/src/kisscomps/components/MessageBox/index.vue +96 -96
  361. package/src/kisscomps/components/OverLap/OverLap.vue +237 -237
  362. package/src/kisscomps/components/OverLap/index.js +2 -2
  363. package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +272 -272
  364. package/src/kisscomps/components/PatternOptimize/index.js +2 -2
  365. package/src/kisscomps/components/PatternStatus/PatternStatus.vue +1508 -1561
  366. package/src/kisscomps/components/PatternStatus/index.js +2 -2
  367. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  368. package/src/kisscomps/components/PatternWalkSvg/index.js +2 -2
  369. package/src/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  370. package/src/kisscomps/components/PhaseDirectionSelect/index.js +2 -2
  371. package/src/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  372. package/src/kisscomps/components/PhaseDirectionText/index.js +2 -2
  373. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  374. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  375. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  376. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  377. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  378. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  379. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  380. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +895 -988
  381. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +360 -356
  382. package/src/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  383. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +210 -206
  384. package/src/kisscomps/components/SchemeConfig/index.js +2 -2
  385. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +223 -221
  386. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  387. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +128 -128
  388. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/icon.vue +426 -426
  389. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +851 -820
  390. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +194 -194
  391. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +211 -207
  392. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  393. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +275 -275
  394. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +1209 -1205
  395. package/src/kisscomps/components/SelectCrossPhase/index.vue +418 -418
  396. package/src/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  397. package/src/kisscomps/components/StageBord/StageBord.vue +288 -288
  398. package/src/kisscomps/components/StageBord/index.js +2 -2
  399. package/src/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  400. package/src/kisscomps/components/StageStatus/index.js +2 -2
  401. package/src/kisscomps/components/Stages/index.vue +319 -318
  402. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  403. package/src/kisscomps/components/SvgIcon/index.js +2 -2
  404. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1041 -1041
  405. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  406. package/src/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  407. package/src/kisscomps/components/XiaoKanban/index.vue +102 -102
  408. package/src/kisscomps/components/overView/index.vue +699 -699
  409. package/src/kisscomps/components/patternConfig/index.js +2 -2
  410. package/src/kisscomps/components/patternConfig/index.vue +1126 -1126
  411. package/src/kisscomps/components/patternConfig/pattern/patternTable.vue +408 -408
  412. package/src/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  413. package/src/kisscomps/components/patternConfig/planContent.vue +576 -576
  414. package/src/kisscomps/components/patternConfig/planMenu.vue +329 -329
  415. package/src/kisscomps/components/patternConfig/utils.js +152 -152
  416. package/src/kisscomps/components/patternList/index.js +2 -2
  417. package/src/kisscomps/components/patternList/patternList.vue +585 -589
  418. package/src/kisscomps/index.js +125 -123
  419. package/src/lib/publicjs/ArryListUtil.js +38 -38
  420. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  421. package/src/lib/publicjs/KissApi.js +158 -158
  422. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  423. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  424. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  425. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  426. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  427. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  428. package/src/lib/publicjs/basecomponents.js +65 -65
  429. package/src/lib/publicjs/localStorage.js +112 -112
  430. package/src/lib/publicjs/objdeepcopy.js +32 -32
  431. package/src/lib/publicjs/pageScroll.js +30 -30
  432. package/src/lib/publicjs/passwdAssest.js +101 -101
  433. package/src/lib/publicjs/styleclassfactory.js +32 -32
  434. package/src/main.js +50 -50
  435. package/src/router/index.js +63 -63
  436. package/src/store/getters.js +16 -16
  437. package/src/store/index.js +26 -26
  438. package/src/store/modules/globalParam.js +67 -67
  439. package/src/utils/ControlFormat.js +68 -68
  440. package/src/utils/RingDataModel.js +258 -258
  441. package/src/utils/auth.js +199 -199
  442. package/src/utils/conflct.js +250 -250
  443. package/src/utils/conflictList.js +87 -87
  444. package/src/utils/dateFormat.js +41 -41
  445. package/src/utils/errorcode.js +228 -228
  446. package/src/utils/fault.js +196 -196
  447. package/src/utils/faultcode.js +209 -209
  448. package/src/utils/index.js +69 -69
  449. package/src/utils/pedphasedesc.js +119 -119
  450. package/src/utils/phaseList.js +203 -203
  451. package/src/utils/phasedesc.js +144 -144
  452. package/src/utils/responseMessage.js +21 -21
  453. package/src/utils/validate.js +43 -43
  454. package/src/views/customchannelization.vue +49 -49
  455. package/src/views/home.1.vue +479 -479
  456. package/src/views/home.vue +93 -93
  457. package/src/views/intersection.vue +413 -365
  458. package/src/views/intersection2.vue +328 -328
  459. package/src/views/overView.vue +41 -41
  460. package/src/views/patternConfig.vue +609 -609
  461. package/src/views/schemeconfig.vue +204 -204
  462. package/static/apiconfig.json +451 -451
  463. package/static/styles/channelizatioon.scss +433 -433
  464. package/static/styles/common.scss +23 -23
  465. package/static/styles/commonkanban.scss +168 -168
  466. package/static/styles/dark/index.scss +2 -2
  467. package/static/styles/dark/theme/element-dark.scss +42 -42
  468. package/static/styles/index.scss +84 -84
  469. package/static/styles/intersection.scss +190 -190
  470. package/static/styles/light/index.scss +2 -2
  471. package/static/styles/light/theme/element-light.scss +42 -42
  472. package/static/styles/overview.scss +146 -146
  473. package/static/styles/patternConfig.scss +56 -56
  474. package/static/styles/schemeconfig.scss +549 -534
  475. package/static/styles/stages.scss +57 -57
  476. package/static/styles/uiComponents.scss +57 -57
  477. package/static/styles/xiaokanban.scss +50 -50
  478. package/static/token.json +2 -2
  479. package/test/e2e/custom-assertions/elementCount.js +27 -27
  480. package/test/e2e/nightwatch.conf.js +46 -46
  481. package/test/e2e/runner.js +48 -48
  482. package/test/e2e/specs/test.js +19 -19
  483. package/test/unit/.eslintrc +7 -7
  484. package/test/unit/jest.conf.js +30 -30
  485. package/test/unit/setup.js +3 -3
  486. package/test/unit/specs/HelloWorld.spec.js +11 -11
  487. package/src/node_modules/.package_versions.json +0 -1
@@ -1,1205 +1,1209 @@
1
- <template>
2
- <div class="tentativeplan-control">
3
- <!-- <div class="title" style="margin-bottom: 18px">
4
- {{ $t('openatccomponents.overview.tentativeplan') }}
5
- </div> -->
6
- <el-row>
7
- <el-col :span="12">
8
- <el-form
9
- ref="manual"
10
- label-position="left"
11
- :model="manualInfo"
12
- label-width="74px"
13
- >
14
- <el-form-item
15
- :label="$t('openatccomponents.overview.patternid') + ':'"
16
- prop="count"
17
- >
18
- <el-select
19
- @change="selectPattern()"
20
- v-model="manualInfo.tempPatternid"
21
- class="col-inner"
22
- size="small"
23
- :placeholder="$t('openatccomponents.common.select')"
24
- >
25
- <el-option
26
- v-for="item in patternSelect"
27
- :key="item.value"
28
- :label="item.label"
29
- :value="item.value"
30
- >
31
- </el-option>
32
- </el-select>
33
- <!-- <el-input v-model="manualInfo.tempDuration" size="small" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
34
- </el-form-item>
35
- <el-form-item
36
- :label="$t('openatccomponents.overview.delay') + ':'"
37
- prop="intersection"
38
- >
39
- <el-input-number
40
- :placeholder="$t('openatccomponents.common.input')"
41
- :min="0"
42
- :max="65535"
43
- :precision="0"
44
- :step="1"
45
- :controls="false"
46
- v-model.number="manualInfo.tempDelay"
47
- size="small"
48
- ></el-input-number>
49
- <!-- <el-input v-model="manualInfo.tempDelay" size="small" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
50
- </el-form-item>
51
- </el-form>
52
- </el-col>
53
- <el-col :span="12">
54
- <el-form
55
- ref="manual"
56
- label-position="left"
57
- :model="manualInfo"
58
- label-width="74px"
59
- >
60
- <el-form-item
61
- :label="$t('openatccomponents.overview.patternoffset') + ':'"
62
- prop="count"
63
- >
64
- <el-input-number
65
- :placeholder="$t('openatccomponents.common.input')"
66
- :min="0"
67
- :max="65535"
68
- :precision="0"
69
- :step="1"
70
- :controls="false"
71
- v-model.number="manualInfo.offset"
72
- size="small"
73
- ></el-input-number>
74
- <!-- <el-input v-model="manualInfo.offset" size="small" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
75
- </el-form-item>
76
- <el-form-item
77
- :label="$t('openatccomponents.overview.duration') + ':'"
78
- prop="intersection"
79
- >
80
- <el-input-number
81
- :placeholder="$t('openatccomponents.common.input')"
82
- :min="0"
83
- :max="65535"
84
- :precision="0"
85
- :step="1"
86
- :controls="false"
87
- v-model.number="manualInfo.duration"
88
- size="small"
89
- ></el-input-number>
90
- <!-- <el-input v-model="manualInfo.duration" size="small" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
91
- </el-form-item>
92
- </el-form>
93
- </el-col>
94
- </el-row>
95
- <el-row>
96
- <el-radio v-model="isRing" :label="false" @change="changeRing">{{
97
- $t('openatccomponents.common.ringStyle')
98
- }}</el-radio>
99
- <el-radio v-model="isRing" :label="true" @change="changeStage">{{
100
- $t('openatccomponents.common.stageStyle')
101
- }}</el-radio>
102
- <!-- <div class="title" style="margin-top:18px; margin-bottom:10px">{{$t('openatccomponents.overview.patternstate')}}:
103
- <span>({{$t('openatccomponents.overview.cycle')}}: {{cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{offset}})</span>
104
- </div> -->
105
- <!-- <stage-status
106
- :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
107
- >
108
- </stage-status> -->
109
- <pattern-list
110
- :key="keyChange"
111
- :allPatternList="allPatternList"
112
- :contrloType="contrloType"
113
- :stagesChange="
114
- patternOne.length === 0
115
- ? planPattern.stagesList
116
- : patternOne[0].stagesList
117
- "
118
- :patternList="patternOne.length === 0 ? planPattern.rings : patternOne"
119
- :patternStatusList="
120
- patternOne.length === 0 ? planPattern.rings : patternOne[0].rings
121
- "
122
- :cycles="
123
- patternOne.length === 0 ? planPattern.cycle : patternOne[0].cycle
124
- "
125
- :phaseList="phaseList"
126
- >
127
- </pattern-list>
128
- </el-row>
129
- <el-row>
130
- <el-tabs v-model="activeTab" type="card">
131
- <el-tab-pane
132
- v-if="!isRing"
133
- :label="$t('openatccomponents.pattern.ringConfig')"
134
- name="kanban"
135
- >
136
- <div style="width: 100%; overflow: hidden; margin-top: 20px">
137
- <kan-ban
138
- v-for="n in ringCount"
139
- :key="n"
140
- class="closephasekanban"
141
- :index="n"
142
- :options="options"
143
- :list="
144
- patternOne.length === 0
145
- ? planPattern.rings[n - 1]
146
- : patternOne[0].rings[n - 1]
147
- "
148
- :phaseList="phaseList"
149
- :header-text="$t('openatccomponents.pattern.ring') + n"
150
- @handleSplit="handleSplit"
151
- >
152
- </kan-ban>
153
- </div>
154
- </el-tab-pane>
155
- <!-- <el-tab-pane v-if="isRing" :label="$t('openatccomponents.pattern.stageConfig')" name="kanban">
156
- <div class="stage-panel-contener">
157
- <StageKanban
158
- v-for="(stage, index) in scope.row.stagesList"
159
- class="kanban todo"
160
- :key="index"
161
- :stage="stage"
162
- :stageInfo="scope.row.stagesList"
163
- :isRing="isRing"
164
- :options="scope.row.options"
165
- :coordphaseOption="coordphaseOption"
166
- :rowIndex="scope.$index"
167
- :subIndex="index"
168
- @onStageSplitChange="onStageSplitChange"
169
- @stageSplitChange="stageSplitChange"
170
- @onStageDelaystartChange="onStageDelaystartChange"
171
- @onStageAdvanceendChange="onStageAdvanceendChange"
172
- />
173
- <div v-if="isRing" style="margin-left: 20px">
174
- <el-button
175
- type="primary"
176
- @click="addStage(scope.row.stagesList)"
177
- icon="el-icon-plus"
178
- circle
179
- ></el-button>
180
- </div>
181
- </div>
182
- </el-tab-pane> -->
183
- <el-tab-pane
184
- v-if="isRing"
185
- :label="$t('openatccomponents.pattern.stageConfig')"
186
- name="ring"
187
- >
188
- <div class="stage-panel-contener">
189
- <stage-bord
190
- v-for="(stage, index) in patternOne.length === 0
191
- ? planPattern.stagesList
192
- : patternOne[0].stagesList"
193
- class="kanban todo"
194
- :key="index"
195
- :stage="stage"
196
- :options="options"
197
- :isRing="isRing"
198
- :stageInfo="
199
- patternOne.length === 0
200
- ? planPattern.stagesList
201
- : patternOne[0].stagesList
202
- "
203
- :coordphaseOption="coordphaseOption"
204
- :subIndex="index"
205
- @onStageSplitChange="onStageSplitChange"
206
- @stageSplitChange="stageSplitChange"
207
- @onStageDelaystartChange="onStageDelaystartChange"
208
- @onStageAdvanceendChange="onStageAdvanceendChange"
209
- >
210
- </stage-bord>
211
- <div v-if="isRing" style="margin-left: 10px">
212
- <el-button
213
- type="primary"
214
- @click="
215
- addStage(
216
- patternOne.length === 0
217
- ? planPattern.stagesList
218
- : patternOne[0].stagesList
219
- )
220
- "
221
- icon="el-icon-plus"
222
- circle
223
- ></el-button>
224
- </div>
225
- </div>
226
- </el-tab-pane>
227
- <el-tab-pane
228
- v-if="!isRing"
229
- :label="$t('openatccomponents.pattern.parameters')"
230
- name="parame"
231
- >
232
- <el-row>
233
- <expend-config
234
- v-for="(j, index) in ringCounts"
235
- :key="index"
236
- class="expendkanban"
237
- :options="options"
238
- :header-text="$t('openatccomponents.pattern.ring') + j"
239
- :list="
240
- patternOne.length === 0
241
- ? planPattern.rings[j - 1]
242
- : patternOne[0].rings[j - 1]
243
- "
244
- >
245
- </expend-config>
246
- <div class="forbiddenstage">
247
- {{ $t('openatccomponents.pattern.forbiddenstage') }}
248
- <el-input
249
- class="stage-value"
250
- size="small"
251
- v-model="forbiddenstage"
252
- ></el-input>
253
- </div>
254
- <div class="forbiddenstage">
255
- {{ $t('openatccomponents.pattern.screenstage') }}
256
- <el-input
257
- class="stage-value"
258
- size="small"
259
- v-model="screenstage"
260
- ></el-input>
261
- </div>
262
- <div class="forbiddenstage">
263
- {{ $t('openatccomponents.pattern.coordinatestage') }}
264
- <el-input
265
- class="stage-value"
266
- size="small"
267
- v-model="coordinatestage"
268
- ></el-input>
269
- </div>
270
- </el-row>
271
- </el-tab-pane>
272
- <el-tab-pane
273
- v-if="!isRing"
274
- :label="$t('openatccomponents.pattern.overLap')"
275
- name="overlap"
276
- >
277
- <el-row :gutter="20">
278
- <el-col :span="24">
279
- <over-lap
280
- :stageList="stagesList"
281
- :overlap="overlap"
282
- :checked="true"
283
- :tentative="true"
284
- :cycleChange="false"
285
- :cycle="overLapCycle"
286
- >
287
- </over-lap>
288
- </el-col>
289
- </el-row>
290
- </el-tab-pane>
291
- <el-tab-pane
292
- v-if="!isRing"
293
- :label="$t('openatccomponents.pattern.patternOptimize')"
294
- name="patternOptimize"
295
- >
296
- <pattern-optimize
297
- v-for="n in optimizes"
298
- :key="n"
299
- class="expendkanban"
300
- :list="
301
- patternOne.length === 0
302
- ? planPattern.rings[n - 1]
303
- : patternOne[0].rings[n - 1]
304
- "
305
- :rings="patternOne.length === 0 ? planPattern : patternOne[0]"
306
- :phaseList="phaseList"
307
- :options="options"
308
- :header-text="$t('openatccomponents.pattern.ring') + n"
309
- :index="n"
310
- :nowNumber="n"
311
- @handleSplit="handleSplit"
312
- >
313
- </pattern-optimize>
314
- </el-tab-pane>
315
- </el-tabs>
316
- </el-row>
317
- <div class="footer" v-if="realtimeStatusModalvisible">
318
- <el-button @click="handleClose()">{{
319
- $t('openatccomponents.button.Back')
320
- }}</el-button>
321
- <el-button type="primary" plain @click="toAutoControl()" v-if="isHasPermission('configer:manual:renew')">{{$t('openatccomponents.overview.recovery')}}</el-button>
322
- <el-button type="primary" @click="handleManualControl()">{{
323
- $t('openatccomponents.overview.implement')
324
- }}</el-button>
325
- </div>
326
- <div class="footer" v-if="!realtimeStatusModalvisible">
327
- <el-button @click="handleClose()">{{
328
- $t('openatccomponents.button.Back')
329
- }}</el-button>
330
- <el-button type="primary" plain @click="toAutoControl()" v-if="isHasPermission('configer:manual:renew')">{{$t('openatccomponents.overview.recovery')}}</el-button>
331
- <el-button type="primary" @click="handleManualControl()">{{
332
- $t('openatccomponents.overview.comfirm')
333
- }}</el-button>
334
- </div>
335
- </div>
336
- </template>
337
-
338
- <script>
339
- import { hasPermission } from '../../../../utils/auth'
340
-
341
- export default {
342
- name: 'tentativeplancontrol',
343
- props: {
344
- realtimeStatusModalvisible: {
345
- type: Boolean,
346
- default: true
347
- },
348
- controlData: {
349
- type: Object
350
- },
351
- phaseList: {
352
- type: Array
353
- },
354
- overlap: {
355
- type: Array
356
- },
357
- allPatternList: {
358
- type: Array
359
- },
360
- patternSelect: {
361
- type: Array
362
- }
363
- },
364
- watch: {
365
- isRing (newVal) {
366
- this.activeTab = newVal ? 'ring' : 'kanban'
367
- }
368
- },
369
- computed: {
370
- computedActiveTab () {
371
- return this.isRing ? 'ring' : 'kanban'
372
- },
373
- rings () {
374
- return this.patternOne.length === 0 ? this.planPattern.rings : this.patternOne[0].rings
375
- },
376
- cycle () {
377
- return this.patternOne.length === 0 ? this.max : (this.patternOne.length > 0 && (this.patternOne[0].cycle < this.max)) ? this.max : this.patternOne[0].cycle
378
- },
379
- offset () {
380
- return Number((this.patternOne.length === 0 || this.manualInfo.offset > 0) ? this.manualInfo.offset : this.patternOne[0].offset)
381
- },
382
- forbiddenstage () {
383
- return this.patternOne.length === 0 ? this.allPatternList[0].forbiddenstage : this.patternOne[0].forbiddenstage
384
- },
385
- screenstage () {
386
- return this.patternOne.length === 0 ? this.allPatternList[0].screenstage : this.patternOne[0].screenstage
387
- },
388
- coordinatestage () {
389
- return this.patternOne.length === 0 ? this.allPatternList[0].coordinatestage : this.patternOne[0].coordinatestage
390
- }
391
- },
392
- data () {
393
- return {
394
- stagesList: [],
395
- phaseRings: [],
396
- keyChange: false,
397
- overLapCycle: 0,
398
- options: {
399
- group: 'pattern'
400
- },
401
- max: '',
402
- contrloType: '',
403
- patternCycleEqual: true,
404
- // activeList: 'ring',
405
- activeTab: 'kanban',
406
- isRing: false,
407
- // isChange: false,
408
- ringCount: 1,
409
- ringCounts: 1,
410
- barriers: [],
411
- optimizes: 1,
412
- coordphaseOption: [],
413
- patternOne: [],
414
- planPattern: {},
415
- manualInfo: {
416
- tempPatternid: '',
417
- offset: 0,
418
- duration: 300,
419
- tempDelay: 0 // 控制方式手动操作的情况下的延迟时间的临时值。
420
- // tempDuration: 300 // 控制方式手动操作的情况下的持续时间的临时值。
421
- }
422
- }
423
- },
424
- created () {
425
- this.patternPlan()
426
- this.getCycle()
427
- if (this.patternOne.length === 0) {
428
- this.handleStageData(this.planPattern.rings)
429
- }
430
- this.initData()
431
- if (!this.allPatternList[0].contrloType && this.allPatternList[0].rings.length > 0) {
432
- this.contrloType = 'ring'
433
- } else if (!this.allPatternList[0].contrloType && this.allPatternList[0].rings.length === 0) {
434
- this.contrloType = 'stage'
435
- } else {
436
- this.contrloType = this.allPatternList[0].contrloType
437
- }
438
- for (let i = 0; i < this.allPatternList.length; i++) {
439
- if (this.allPatternList[i].contrloType === 'stage' || (this.isRing && !this.allPatternList[i].contrloType)) {
440
- this.isRing = true
441
- // this.setStageList(this.allPatternList[i].stagesList, this.allPatternList[i].id)
442
- } else if (this.allPatternList[i].contrloType === 'ring' || (!this.isRing && !this.allPatternList[i].contrloType && this.allPatternList[i].rings.length > 0)) {
443
- this.isRing = false
444
- // this.handleStageData(this.allPatternList[i].rings)
445
- } else if (this.allPatternList[i].rings.length === 0 && this.allPatternList[i].stagesList.length > 0) {
446
- this.isRing = true
447
- // this.setStageList(this.allPatternList[i].stagesList, this.allPatternList[i].id)
448
- }
449
- }
450
- },
451
- methods: {
452
- addStage (row) {
453
- // this.isChange = false
454
- if (row.length > 15) {
455
- this.$message.error(
456
- this.$t('edge.pattern.mostlist')
457
- )
458
- return
459
- }
460
- if (this.patternOne.length !== 0) {
461
- this.patternOne[0].stagesList.push({
462
- key: row.length,
463
- green: 25,
464
- yellow: 3,
465
- red: 2,
466
- phases: [],
467
- stageSplit: 30
468
- })
469
- } else {
470
- this.planPattern.stagesList.push({
471
- key: row.length,
472
- green: 25,
473
- yellow: 3,
474
- red: 2,
475
- phases: [],
476
- stageSplit: 30
477
- })
478
- }
479
- },
480
- changeRing () {
481
- this.contrloType = 'ring'
482
- this.isRing = false
483
- // const globalParamModel = this.$store.getters.globalParamModel
484
- // let pattern = globalParamModel.getParamsByType('patternList')
485
- // let pattern = this.allPatternList
486
- this.getCycle()
487
- this.patternOne = this.allPatternList.filter(item => {
488
- return item.id === Number(this.manualInfo.tempPatternid)
489
- })
490
- // if (this.isChange) {
491
- // for (let i = 0; i < pattern.length; i++) {
492
- this.handleStageData(this.patternOne.rings)
493
- // }
494
- // } else {
495
- // for (let i = 0; i < pattern.length; i++) {
496
- // this.setStageList(pattern[i].stagesList, pattern[i].id)
497
- // }
498
- // }
499
- },
500
- changeStage () {
501
- this.contrloType = 'stage'
502
- this.isRing = true
503
- // this.patternOne = this.allPatternList.filter(item => {
504
- // return item.id === Number(this.manualInfo.tempPatternid)
505
- // })
506
- // this.getStageCycle()
507
- },
508
- getStageCycle () {
509
- // this.patternOne.length === 0 ? this.allPatternList this.patternOne
510
- if (this.patternOne.length === 0) {
511
- // this.setStageList(this.planPattern.stagesList, this.planPattern.id)
512
- // this.planPattern.stagesList = []
513
- } else {
514
- // this.patternOne = this.allPatternList.filter(item => {
515
- // return item.id === Number(this.manualInfo.tempPatternid)
516
- // })
517
- // this.setStageList(this.patternOne[0].stagesList, this.patternOne[0].id)
518
- }
519
- },
520
- setStageList (stageChange, id) {
521
- // let patternList = this.globalParamModel.getParamsByType('patternList')
522
- // let patternList = this.allPatternList
523
- let stagesList = []
524
- for (let i = 0; i < stageChange.length; i++) {
525
- let stage = JSON.parse(JSON.stringify(stageChange[i]))
526
- let stageItem = this.getStageItems(stage.phases, i, stageChange)
527
- stagesList.push(JSON.parse(JSON.stringify(stageItem)))
528
- }
529
- (this.patternOne.length === 0 ? this.planPattern : this.patternOne).map(item => { // 添加特征参数stage
530
- if (item.id === id) {
531
- if (this.isRing) {
532
- item.contrloType = 'stage'
533
- } else {
534
- item.contrloType = 'ring'
535
- }
536
- item.stagesList = JSON.parse(JSON.stringify(stagesList.filter(item => item.stageSplit)))
537
- }
538
- })
539
- this.stagesList = stagesList.filter(item => item.stageSplit)
540
- },
541
- getStageItems (stageArr, i, stageChange) {
542
- let res = {
543
- key: i,
544
- split: this.narr[i], // 阶段绿性比
545
- phases: stageArr,
546
- delaystart: 0,
547
- advanceend: 0
548
- }
549
- for (let rings of stageChange) {
550
- if (i === rings.key) {
551
- res.green = rings.green ? rings.green : rings.green === 0 ? 0 : 25
552
- res.yellow = rings.yellow ? rings.yellow : rings.yellow === 0 ? 0 : 3
553
- res.red = rings.red ? rings.red : rings.red === 0 ? 0 : 2
554
- res.phases = rings.phases ? rings.phases : stageArr
555
- // res.stageSplit = rings.split ? rings.split : 30
556
- if (rings.split) {
557
- res.stageSplit = rings.split
558
- } else if (rings.stageSplit) {
559
- res.stageSplit = rings.stageSplit
560
- } else {
561
- res.stageSplit = 0
562
- }
563
- }
564
- }
565
- return res
566
- },
567
- tranform (arr) { // 分barrier
568
- let newMap = new Map()
569
- arr.forEach(({ id, current }) => {
570
- const find = newMap.get(current.join())
571
- if (find) newMap.get(current.join()).push(id)
572
- else newMap.set(current.join(), [id])
573
- })
574
- let ret = []
575
- newMap.forEach((value, key) => {
576
- ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
577
- })
578
- const result = []
579
- for (const a of ret) {
580
- let merged = false
581
- for (const r of result) {
582
- if (this.check([...r], a)) {
583
- a.forEach(item => r.add(item))
584
- merged = true
585
- }
586
- }
587
- if (!merged) {
588
- result.push(new Set(a))
589
- }
590
- merged = false
591
- }
592
- return result.map(s => [...s])
593
- },
594
- check (arr1, arr2) {
595
- return arr1.some(a1 => arr2.some(a2 => a1 === a2))
596
- },
597
- handleCurrentChange (val) { // 两个ring的数据
598
- if (val === null || val.length === 0) return
599
- // 按环序分组
600
- let ringlength = []
601
- let ringsequence = val.map(item => {
602
- if (item.length === 0) return
603
- ringlength.push(item.length)
604
- return item.map(k => {
605
- return k.id
606
- })
607
- })
608
- let newRings = ringsequence.filter(item => item)
609
- let minLength = Math.min(...ringlength)
610
- let resultArrs = [] // 环1分组
611
- let resultArr = [] // 环2分组
612
- for (let j = 0; j < ringsequence[0].length; j += minLength) {
613
- resultArrs.push(ringsequence[0].slice(j, j + minLength))
614
- if (ringsequence[0].length === minLength) {
615
- resultArrs.push([])
616
- }
617
- }
618
- if (newRings.length > 1) {
619
- for (let i = 0; i < ringsequence[1].length; i += minLength) {
620
- resultArr.push(ringsequence[1].slice(i, i + minLength))
621
- }
622
- }
623
- // this.patternInfo = []
624
- // this.barrierList = []
625
- let currentArr = []
626
- let newPattern = []
627
- val.map(i => {
628
- newPattern.push(...i)
629
- })
630
- if (this.phaseList.length === 0) return
631
- for (let patternStatus of val[0]) {
632
- // if (patternStatus.mode !== 7) {
633
- let concurrent = this.phaseList.filter((item) => {
634
- return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
635
- })[0].concurrent// 当前相位的并发相位
636
- if (concurrent) {
637
- let obj = {
638
- id: patternStatus.id,
639
- current: concurrent.sort()
640
- }
641
- currentArr.push(obj)
642
- }
643
- // }
644
- }
645
- if (currentArr.length !== 0) {
646
- let newCurrent = this.tranform(currentArr)
647
- // 取没个环与环关系的并集
648
- let barrierRing1 = []
649
- let barrierRing2 = []
650
- let ring1 = [] // 环1与关系1的并集
651
- for (let h = 0; h < newCurrent.length; h++) {
652
- let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
653
- ring1.push(adds)
654
- }
655
- let ring1s = [] // 环1与关系2的并集
656
- for (let h = 0; h < newCurrent.length; h++) {
657
- let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
658
- ring1s.push(addRing1)
659
- }
660
- barrierRing1.push(...ring1, ...ring1s)
661
- let resultList = []
662
- if (newRings.length > 1) {
663
- let ring2s = [] // 环2与关系1的并集
664
- for (let h = 0; h < newCurrent.length; h++) {
665
- let addRing2 = [...new Set(resultArr[1])].filter(item => newCurrent[h].includes(item))
666
- ring2s.push(addRing2)
667
- }
668
- let ring2 = [] // 环2与关系1的并集
669
- for (let h = 0; h < newCurrent.length; h++) {
670
- let add = [...new Set(resultArr[0])].filter(item => newCurrent[h].includes(item))
671
- ring2.push(add)
672
- }
673
- barrierRing2.push(...ring2, ...ring2s)
674
- for (let k = 0; k < barrierRing1.length; k++) {
675
- resultList.push(barrierRing1[k].concat(barrierRing2[k]))
676
- }
677
- }
678
- let resultLists = resultList.filter(item => item.length !== 0)
679
- let ringArr = []
680
- for (let l = 0; l < resultLists.length; l++) {
681
- for (let d = 0; d < newCurrent.length; d++) {
682
- if (newCurrent[d].filter(item => resultLists[l].includes(item)).length > 0) {
683
- ringArr.push({
684
- data: resultLists[l],
685
- id: d + 1,
686
- index: l
687
- })
688
- }
689
- }
690
- }
691
- for (var i = 0; i < ringArr.length; i++) {
692
- for (var j = i + 1; j < ringArr.length; j++) {
693
- if (ringArr[i].id === ringArr[j].id && ringArr[i].index + 1 === ringArr[j].index) {
694
- ringArr[i].data = ringArr[i].data.concat(ringArr[j].data)
695
- ringArr.splice(ringArr.indexOf(ringArr[j].id), 1)
696
- }
697
- }
698
- }
699
- let resArr = ringArr.map(item => item.data)
700
- let ringTeam = this.step1(this.phaseList, resArr)
701
- let ringTeams = ringTeam.filter(item => item.length !== 0)
702
- return this.setBarrier(ringTeams, val)
703
- }
704
- },
705
- setBarrier (ringTeam, val) {
706
- const patternObjs = {}
707
- val.forEach(l => {
708
- l.map(k => {
709
- patternObjs[k.id] = k.value
710
- })
711
- })
712
- let ret = ringTeam.map((y, index) => {
713
- if (!y || y.length === 0) return
714
- y.map(n => {
715
- n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
716
- })
717
- return {
718
- barrier: index + 1,
719
- length: y[0].length,
720
- items: y.map(j => {
721
- return {
722
- ring: j.ring,
723
- data: j.data
724
- }
725
- })
726
- }
727
- })
728
- return ret
729
- },
730
- step1 (list, arr) { // 各个环包含的相位
731
- const ret = []
732
- const listObj = {}
733
- list.forEach(l => {
734
- listObj[l.id] = l.ring
735
- })
736
- arr.forEach(a => {
737
- const retItem = []
738
- a.forEach(b => {
739
- if (listObj[b]) {
740
- const find = retItem.find(r => r.ring === listObj[b])
741
- if (find) find.data.push(b)
742
- else retItem.push({ ring: listObj[b], data: [b] })
743
- }
744
- })
745
- ret.push(retItem)
746
- })
747
- return ret
748
- },
749
- patternPlan () {
750
- let Pattern = {
751
- offset: 0,
752
- cycle: 0,
753
- stagesList: [],
754
- rings: [[], [], [], []]
755
- }
756
- var newPattern = JSON.parse(JSON.stringify(Pattern))
757
- for (let phase of this.phaseList) {
758
- let ring = {}
759
- ring.name = 'Phase ' + phase.id
760
- ring.desc = this.getPhaseDescription(phase.direction)
761
- ring.id = phase.id
762
- ring.value = 30
763
- ring.mode = 2
764
- ring.options = []
765
- ring.delaystart = 0
766
- ring.advanceend = 0
767
- if (phase.ring === 1) {
768
- newPattern.rings[0].push(ring)
769
- } else if (phase.ring === 2) {
770
- newPattern.rings[1].push(ring)
771
- } else if (phase.ring === 3) {
772
- newPattern.rings[2].push(ring)
773
- } else if (phase.ring === 4) {
774
- newPattern.rings[3].push(ring)
775
- }
776
- }
777
- let barrier = this.handleCurrentChange(newPattern.rings)
778
- newPattern.barriers = barrier
779
- this.planPattern = newPattern
780
- },
781
- getCycle () {
782
- for (let rings of this.planPattern.rings) {
783
- let num = 0
784
- for (let i = 0; i < rings.length; i++) {
785
- if (rings[i].length !== 0) {
786
- if (rings[i].mode === 7) { // 忽略相位不计周期
787
- continue
788
- }
789
- num = num + Number(rings[i].value)
790
- }
791
- }
792
- if (num !== 0) {
793
- this.planPattern.cycle = num
794
- break
795
- }
796
- }
797
- },
798
- getCycles () {
799
- if (!this.patternOne[0].stages) return
800
- let stages = this.patternOne[0].stages
801
- let modeId = stages.filter(item => item.length === 1)[0]
802
- for (let rings of this.patternOne[0].rings) {
803
- let num = 0
804
- for (let i = 0; i < rings.length; i++) {
805
- if (rings[i].length !== 0) {
806
- if (rings[i].mode === 7 && (modeId && modeId[0] === rings[i].id)) { // 忽略相位不计周期
807
- continue
808
- }
809
- num = num + Number(rings[i].value)
810
- }
811
- }
812
- if (num !== 0) {
813
- this.patternOne[0].cycle = num
814
- break
815
- }
816
- }
817
- },
818
- getPhaseDescription (phaseList) {
819
- if (!phaseList) return
820
- let list = []
821
- for (let id of phaseList) {
822
- let obj = {}
823
- obj.id = id
824
- obj.color = '#454545'
825
- list.push(obj)
826
- }
827
- return list
828
- },
829
- handleClose () {
830
- this.$emit('closePhaseBack')
831
- },
832
- onStageSplitChange (diff, rowIndex, subIndex) {
833
- let stageArr = this.stagesList[subIndex].stages
834
- let row = this.patternList[rowIndex]
835
- let ringsList = row.rings
836
- for (let rings of ringsList) {
837
- for (let ring of rings) {
838
- if (stageArr.includes(ring.id)) {
839
- ring.value = (ring.value ? ring.value : 0) + diff
840
- continue
841
- }
842
- }
843
- }
844
- },
845
- stageSplitChange (diff, rowIndex, subIndex) {
846
- let row = this.patternOne.length === 0 ? this.planPattern : this.patternOne
847
- let ringsList = this.patternOne.length === 0 ? row.stagesList : row[0].stagesList
848
- for (let rings of ringsList) {
849
- // if (subIndex === rings.key) {
850
- rings.stageSplit = (rings.green ? rings.green : 0) + (rings.yellow ? rings.yellow : 0) + (rings.red ? rings.red : 0)
851
- continue
852
- // }
853
- }
854
- },
855
- onStageDelaystartChange (diff, rowIndex, subIndex) {
856
- let stageArr = this.stagesList[subIndex].stages
857
- let row = this.patternList[rowIndex]
858
- let ringsList = row.rings
859
- for (let rings of ringsList) {
860
- for (let ring of rings) {
861
- if (stageArr.includes(ring.id)) {
862
- ring.delaystart = (ring.delaystart ? ring.delaystart : 0) + diff
863
- continue
864
- }
865
- }
866
- }
867
- },
868
- onStageAdvanceendChange (diff, rowIndex, subIndex) {
869
- let stageArr = this.stagesList[subIndex].stages
870
- let row = this.patternList[rowIndex]
871
- let ringsList = row.rings
872
- for (let rings of ringsList) {
873
- for (let ring of rings) {
874
- if (stageArr.includes(ring.id)) {
875
- ring.advanceend = (ring.advanceend ? ring.advanceend : 0) + diff
876
- continue
877
- }
878
- }
879
- }
880
- },
881
- handleSplit (index) {
882
- if (this.patternOne.length > 0) {
883
- let currPattern = this.patternOne[0].rings
884
- setTimeout(() => {
885
- this.handleStageData(currPattern)
886
- this.getCycles()
887
- // this.patternOne[0].stagesList = this.stagesList
888
- }, 50)
889
- } else {
890
- let currPattern = this.planPattern.rings
891
- setTimeout(() => {
892
- this.handleStageData(currPattern)
893
- this.getCycle()
894
- // this.allPatternList[0].stagesList = this.stagesList
895
- }, 50)
896
- }
897
- },
898
- selectPattern () {
899
- this.manualInfo.offset = 0
900
- let selectId = Number(this.manualInfo.tempPatternid)
901
- this.patternOne = this.allPatternList.filter(item => {
902
- return item.id === selectId
903
- })
904
- // if (this.patternOne[0].contrloType === 'stage') {
905
- // this.changeStage()
906
- // }
907
- this.manualInfo.offset = this.offset
908
- for (let rings of this.patternOne[0].rings) {
909
- if (rings.length === 0) continue
910
- for (let ring of rings) {
911
- if (ring.value === 0) continue
912
- let currPhase = this.phaseList.filter((item) => {
913
- return item.id === ring.id
914
- })[0]
915
- ring.desc = currPhase.direction.map(item => {
916
- return {
917
- id: item,
918
- color: '#454545'
919
- }
920
- })
921
- }
922
- }
923
- this.handleStageData(this.patternOne[0].rings)
924
- },
925
- handleStageData (rings) { // stagesList
926
- if (!rings) return
927
- for (let i = 0; i < rings.length; i++) {
928
- if (rings[i].length > 0) {
929
- let phaseList = []
930
- let stagesList = []
931
- // rings = JSON.parse(JSON.stringify(rings))
932
- let mapAdd = rings.map(item => {
933
- return item.map(val => {
934
- // if (val.mode !== 7) {
935
- return val.value + (val.sum ? val.sum : 0)
936
- // } else {
937
- // return 0
938
- // }
939
- })
940
- })
941
- let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
942
- return item.length > 0 ? item.reduce((a, b) => {
943
- return a + b
944
- }) : 0
945
- }) : 0
946
- this.max = Math.max(...maxCycle)// 每个环的周期最大值
947
- this.stateList = [0]
948
- this.narr = []
949
- let currentIds = ''
950
- let lastCurrentIds = ''
951
- for (let j = 0; j <= this.max; j++) { // 指针长度
952
- for (let i = 0; i < rings.length; i++) { // 环列表
953
- let ring = rings[i]// 每个环对象
954
- let sum = 0
955
- for (let n = 0; n < ring.length; n++) { // 相位累计长度
956
- // if (ring[n].mode !== 7) {
957
- sum = sum + ring[n].value + (ring[n].sum ? ring[n].sum : 0)
958
- if (j < sum) {
959
- let phaseId = ring[n].id
960
- currentIds = currentIds + '-' + phaseId
961
- break
962
- }
963
- // }
964
- }
965
- }
966
- if (lastCurrentIds !== currentIds && lastCurrentIds !== '') { // 当前相位id和上一个相比不同说明相位变化了
967
- phaseList.push(lastCurrentIds)
968
- this.stateList.push(j)// 阶段累计长度的集合
969
- }
970
- lastCurrentIds = currentIds
971
- currentIds = ''
972
- }
973
- let newPhaselist = []
974
- phaseList.forEach(i => {
975
- let rangeArr = i.split('-').map(Number)
976
- if (rangeArr.length > 2) {
977
- newPhaselist.push([
978
- JSON.parse(JSON.stringify(rangeArr[1])),
979
- JSON.parse(JSON.stringify(rangeArr[2]))
980
- ])
981
- } else {
982
- newPhaselist.push([
983
- JSON.parse(JSON.stringify(rangeArr[1]))
984
- ])
985
- }
986
- })
987
- for (let i = this.stateList.length - 1; i >= 1; i--) {
988
- this.narr.push(this.stateList[i] - this.stateList[i - 1])
989
- }
990
- // newPhaselist
991
- this.narr.reverse()// 阶段差
992
- for (let i = 0; i < newPhaselist.length; i++) {
993
- let stage = JSON.parse(JSON.stringify(newPhaselist[i]))
994
- let newStage = []
995
- stage.map(item => {
996
- for (let ring of rings) {
997
- for (let ringItem of ring) {
998
- if (item === ringItem.id && (ringItem.mode !== 7 && ringItem.mode !== 8 && ringItem.mode !== 9)) {
999
- newStage.push(item)
1000
- }
1001
- }
1002
- }
1003
- })
1004
- let stageItem = this.getStageItem(newStage, stage, rings, i)
1005
- stagesList.push(JSON.parse(JSON.stringify(stageItem)))
1006
- }
1007
- this.overLapCycle = stagesList.reduce((prev, curr) => prev + parseInt(curr.split), 0)
1008
- this.stagesList = JSON.parse(JSON.stringify(stagesList))
1009
- }
1010
- }
1011
- },
1012
- getStageItem (stageArr, stage, ringsList, i) {
1013
- let res = {
1014
- key: i,
1015
- split: this.narr[i], // 阶段绿性比
1016
- phases: stageArr,
1017
- stageKanban: stage,
1018
- delaystart: 0,
1019
- advanceend: 0
1020
- }
1021
- // let splitArr = []
1022
- let delaystartArr = []
1023
- let advanceendArr = []
1024
- for (let rings of ringsList) {
1025
- for (let ring of rings) {
1026
- if (stageArr.includes(ring.id)) {
1027
- // let split = ring.value
1028
- let delaystart = ring.delaystart
1029
- let advanceend = ring.advanceend
1030
- // splitArr.push(split)
1031
- delaystartArr.push(delaystart)
1032
- advanceendArr.push(advanceend)
1033
- }
1034
- }
1035
- }
1036
- // splitArr.sort(function (a, b) { return a - b })
1037
- delaystartArr.sort(function (a, b) { return b - a })
1038
- advanceendArr.sort(function (a, b) { return a - b })
1039
- // res.split = splitArr.length > 0 ? splitArr[0] : 0
1040
- res.delaystart = delaystartArr.length > 0 ? delaystartArr[0] : 0
1041
- res.advanceend = advanceendArr.length > 0 ? advanceendArr[0] : 0
1042
- return res
1043
- },
1044
- initData () {
1045
- // 判断有几个环,就创建几个看板
1046
- // let phaseList = this.globalParamModel.getParamsByType('phaseList')
1047
- // this.coordphaseOption = this.phaseList.map(ele => {
1048
- // return {
1049
- // value: ele.id
1050
- // }
1051
- // })
1052
- this.coordphaseOption = this.phaseList
1053
- // this.overlap = this.globalParamModel.getParamsByType('overlaplList')
1054
- // this.agentId = getIframdevid()
1055
- let rings = []
1056
- if (this.phaseList.length === 0) {
1057
- // this.$store.getters.tscParam.patternList = []
1058
- return
1059
- }
1060
- for (let phase of this.phaseList) {
1061
- rings.push(phase.ring)
1062
- }
1063
- this.ringCount = Array.from(new Set(rings)) // 去除数组重复的元素
1064
- this.ringCount = this.ringCount.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
1065
- this.ringCounts = Array.from(new Set(rings)) // 去除数组重复的元素
1066
- this.ringCounts = this.ringCounts.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
1067
- this.optimizes = Array.from(new Set(rings)) // 去除数组重复的元素
1068
- this.optimizes = this.optimizes.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
1069
- // this.increaseId()
1070
- // this.getCycle()
1071
- // this.updatePhaseDescription()
1072
- // this.getOptionsOfRing()
1073
- },
1074
- sortNumbers (a, b) {
1075
- return a - b
1076
- },
1077
- isRingCycleEqual (rings) {
1078
- let isequal = true
1079
- // this.patternmsg = []
1080
- let maxCycle = 0
1081
- for (let ring of rings) {
1082
- if (ring.length === 0) continue
1083
- let cycle = 0
1084
- for (let r of ring) {
1085
- if (r.mode === 7) { // 忽略相位不计周期
1086
- continue
1087
- }
1088
- cycle = cycle + r.value
1089
- }
1090
- if (cycle > maxCycle && maxCycle === 0) {
1091
- maxCycle = cycle
1092
- }
1093
- if (cycle !== maxCycle) {
1094
- // this.patternmsg.push(rings.id)
1095
- isequal = false
1096
- }
1097
- }
1098
- return isequal
1099
- },
1100
- getMaxCycleStage (pattern) {
1101
- let rings = pattern.stagesList
1102
- let stageCycleList = rings.map(item => {
1103
- if (item.stageSplit) {
1104
- return item.stageSplit
1105
- } else {
1106
- return 0
1107
- }
1108
- })
1109
- let maxCycle = stageCycleList.reduce((a, b) => {
1110
- return a + b
1111
- }, 0)
1112
- return maxCycle
1113
- },
1114
- getMaxCycle (pattern) {
1115
- let rings = pattern.rings
1116
- let maxCycle = 0
1117
- for (let ring of rings) {
1118
- if (ring.length === 0) continue
1119
- let cycle = 0
1120
- for (let r of ring) {
1121
- if (r.mode === 7) { // 忽略相位不计周期
1122
- continue
1123
- }
1124
- cycle = cycle + r.value
1125
- }
1126
- if (cycle > maxCycle) {
1127
- maxCycle = cycle
1128
- }
1129
- }
1130
- return maxCycle
1131
- },
1132
- // checkPatternRules (rings) {
1133
- // if (!this.isRingCycleEqual(rings)) {
1134
- // this.patternCycleEqual = false
1135
- // } else {
1136
- // this.patternCycleEqual = true
1137
- // }
1138
- // if (!this.patternCycleEqual) {
1139
- // let mess = `方案中存在环周期时长不一致`
1140
- // if (this.$i18n.locale === 'en') {
1141
- // mess = `Inconsistent loop cycle durations exist in the scheme`
1142
- // }
1143
- // this.$message({
1144
- // message: mess,
1145
- // type: 'error',
1146
- // dangerouslyUseHTMLString: true
1147
- // })
1148
- // return false
1149
- // }
1150
- // },
1151
- handleManualControl () {
1152
- let submitdata = {
1153
- control: 100,
1154
- delay: this.manualInfo.tempDelay !== undefined ? Number(this.manualInfo.tempDelay) : 0,
1155
- duration: Number(this.manualInfo.duration),
1156
- // duration: this.manualInfo.tempDuration !== undefined ? Number(this.manualInfo.tempDuration) : 0,
1157
- data: {}
1158
- }
1159
- if (this.manualInfo.tempPatternid) {
1160
- submitdata.terminal = Number(this.manualInfo.tempPatternid)
1161
- }
1162
- if (this.patternOne.length === 0) {
1163
- if (this.isRing) {
1164
- submitdata.data.cycle = this.getMaxCycleStage(this.planPattern)
1165
- } else {
1166
- submitdata.data.cycle = this.getMaxCycle(this.planPattern)
1167
- }
1168
- submitdata.data.stagesList = this.planPattern.stagesList
1169
- } else {
1170
- if (this.isRing) {
1171
- submitdata.data.cycle = this.getMaxCycleStage(this.patternOne[0])
1172
- } else {
1173
- submitdata.data.cycle = this.getMaxCycle(this.patternOne[0])
1174
- }
1175
- this.patternOne[0].stagesList.forEach((stage) => {
1176
- delete stage.split
1177
- })
1178
- submitdata.data.stagesList = this.patternOne[0].stagesList
1179
- }
1180
- submitdata.data.offset = this.offset
1181
- if (this.patternOne.length === 0) {
1182
- submitdata.data.rings = this.planPattern.rings
1183
- } else {
1184
- submitdata.data.rings = this.patternOne[0].rings
1185
- }
1186
- // submitdata.data.rings = this.patternOne.length === 0 ? this.planPattern.rings : this.patternOne[0].rings
1187
- // this.checkPatternRules(submitdata.data.rings)
1188
- if (this.patternCycleEqual) {
1189
- this.$emit('closePhaseControl', submitdata)
1190
- }
1191
- },
1192
- toAutoControl () {
1193
- this.$emit('toAutoControl')
1194
- },
1195
- isHasPermission (path) {
1196
- let res = hasPermission(path)
1197
- return res
1198
- }
1199
- }
1200
- }
1201
- </script>
1202
-
1203
- <style>
1204
-
1205
- </style>
1
+ <template>
2
+ <div class="tentativeplan-control manual-common-content">
3
+ <!-- <div class="title" style="margin-bottom: 18px">
4
+ {{ $t('openatccomponents.overview.tentativeplan') }}
5
+ </div> -->
6
+ <el-row>
7
+ <el-col :span="12">
8
+ <el-form
9
+ ref="manual"
10
+ label-position="left"
11
+ :model="manualInfo"
12
+ label-width="74px"
13
+ >
14
+ <el-form-item
15
+ :label="$t('openatccomponents.overview.patternid') + ':'"
16
+ prop="count"
17
+ >
18
+ <el-select
19
+ @change="selectPattern()"
20
+ v-model="manualInfo.tempPatternid"
21
+ class="col-inner"
22
+ size="small"
23
+ :placeholder="$t('openatccomponents.common.select')"
24
+ >
25
+ <el-option
26
+ v-for="item in patternSelect"
27
+ :key="item.value"
28
+ :label="item.label"
29
+ :value="item.value"
30
+ >
31
+ </el-option>
32
+ </el-select>
33
+ <!-- <el-input v-model="manualInfo.tempDuration" size="small" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
34
+ </el-form-item>
35
+ <el-form-item
36
+ :label="$t('openatccomponents.overview.delay') + ':'"
37
+ prop="intersection"
38
+ >
39
+ <el-input-number
40
+ :placeholder="$t('openatccomponents.common.input')"
41
+ :min="0"
42
+ :max="65535"
43
+ :precision="0"
44
+ :step="1"
45
+ :controls="false"
46
+ v-model.number="manualInfo.tempDelay"
47
+ size="small"
48
+ ></el-input-number>
49
+ <!-- <el-input v-model="manualInfo.tempDelay" size="small" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
50
+ </el-form-item>
51
+ </el-form>
52
+ </el-col>
53
+ <el-col :span="12">
54
+ <el-form
55
+ ref="manual"
56
+ label-position="left"
57
+ :model="manualInfo"
58
+ label-width="74px"
59
+ >
60
+ <el-form-item
61
+ :label="$t('openatccomponents.overview.patternoffset') + ':'"
62
+ prop="count"
63
+ >
64
+ <el-input-number
65
+ :placeholder="$t('openatccomponents.common.input')"
66
+ :min="0"
67
+ :max="65535"
68
+ :precision="0"
69
+ :step="1"
70
+ :controls="false"
71
+ v-model.number="manualInfo.offset"
72
+ size="small"
73
+ ></el-input-number>
74
+ <!-- <el-input v-model="manualInfo.offset" size="small" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
75
+ </el-form-item>
76
+ <el-form-item
77
+ :label="$t('openatccomponents.overview.duration') + ':'"
78
+ prop="intersection"
79
+ >
80
+ <el-input-number
81
+ :placeholder="$t('openatccomponents.common.input')"
82
+ :min="0"
83
+ :max="65535"
84
+ :precision="0"
85
+ :step="1"
86
+ :controls="false"
87
+ v-model.number="manualInfo.duration"
88
+ size="small"
89
+ ></el-input-number>
90
+ <!-- <el-input v-model="manualInfo.duration" size="small" :placeholder="$t('openatccomponents.common.input')"></el-input> -->
91
+ </el-form-item>
92
+ </el-form>
93
+ </el-col>
94
+ </el-row>
95
+ <el-row style="margin-top: 20px;">
96
+ <el-radio v-model="isRing" :label="false" @change="changeRing">{{
97
+ $t('openatccomponents.common.ringStyle')
98
+ }}</el-radio>
99
+ <el-radio v-model="isRing" :label="true" @change="changeStage">{{
100
+ $t('openatccomponents.common.stageStyle')
101
+ }}</el-radio>
102
+ <!-- <div class="title" style="margin-top:18px; margin-bottom:10px">{{$t('openatccomponents.overview.patternstate')}}:
103
+ <span>({{$t('openatccomponents.overview.cycle')}}: {{cycle}} {{$t('openatccomponents.overview.patternoffset')}}: {{offset}})</span>
104
+ </div> -->
105
+ <!-- <stage-status
106
+ :patternStatusList="patternOne.length===0?planPattern.rings:patternOne[0].rings"
107
+ >
108
+ </stage-status> -->
109
+ <pattern-list
110
+ :key="keyChange"
111
+ :allPatternList="allPatternList"
112
+ :contrloType="contrloType"
113
+ :stagesChange="
114
+ patternOne.length === 0
115
+ ? planPattern.stagesList
116
+ : patternOne[0].stagesList
117
+ "
118
+ :patternList="patternOne.length === 0 ? planPattern.rings : patternOne"
119
+ :patternStatusList="
120
+ patternOne.length === 0 ? planPattern.rings : patternOne[0].rings
121
+ "
122
+ :cycles="
123
+ patternOne.length === 0 ? planPattern.cycle : patternOne[0].cycle
124
+ "
125
+ :phaseList="phaseList"
126
+ >
127
+ </pattern-list>
128
+ </el-row>
129
+ <el-row style="margin-top: 20px;">
130
+ <el-tabs v-model="activeTab" type="card">
131
+ <el-tab-pane
132
+ v-if="!isRing"
133
+ :label="$t('openatccomponents.pattern.ringConfig')"
134
+ name="kanban"
135
+ >
136
+ <div style="width: 100%; overflow: hidden;">
137
+ <kan-ban
138
+ v-for="n in ringCount"
139
+ :key="n"
140
+ class="closephasekanban"
141
+ :index="n"
142
+ :options="options"
143
+ :list="
144
+ patternOne.length === 0
145
+ ? planPattern.rings[n - 1]
146
+ : patternOne[0].rings[n - 1]
147
+ "
148
+ :phaseList="phaseList"
149
+ :header-text="$t('openatccomponents.pattern.ring') + n"
150
+ @handleSplit="handleSplit"
151
+ >
152
+ </kan-ban>
153
+ </div>
154
+ </el-tab-pane>
155
+ <!-- <el-tab-pane v-if="isRing" :label="$t('openatccomponents.pattern.stageConfig')" name="kanban">
156
+ <div class="stage-panel-contener">
157
+ <StageKanban
158
+ v-for="(stage, index) in scope.row.stagesList"
159
+ class="kanban todo"
160
+ :key="index"
161
+ :stage="stage"
162
+ :stageInfo="scope.row.stagesList"
163
+ :isRing="isRing"
164
+ :options="scope.row.options"
165
+ :coordphaseOption="coordphaseOption"
166
+ :rowIndex="scope.$index"
167
+ :subIndex="index"
168
+ @onStageSplitChange="onStageSplitChange"
169
+ @stageSplitChange="stageSplitChange"
170
+ @onStageDelaystartChange="onStageDelaystartChange"
171
+ @onStageAdvanceendChange="onStageAdvanceendChange"
172
+ />
173
+ <div v-if="isRing" style="margin-left: 20px">
174
+ <el-button
175
+ type="primary"
176
+ @click="addStage(scope.row.stagesList)"
177
+ icon="el-icon-plus"
178
+ circle
179
+ ></el-button>
180
+ </div>
181
+ </div>
182
+ </el-tab-pane> -->
183
+ <el-tab-pane
184
+ v-if="isRing"
185
+ :label="$t('openatccomponents.pattern.stageConfig')"
186
+ name="ring"
187
+ >
188
+ <div class="stage-panel-contener">
189
+ <stage-bord
190
+ v-for="(stage, index) in patternOne.length === 0
191
+ ? planPattern.stagesList
192
+ : patternOne[0].stagesList"
193
+ class="kanban todo"
194
+ :key="index"
195
+ :stage="stage"
196
+ :options="options"
197
+ :isRing="isRing"
198
+ :stageInfo="
199
+ patternOne.length === 0
200
+ ? planPattern.stagesList
201
+ : patternOne[0].stagesList
202
+ "
203
+ :coordphaseOption="coordphaseOption"
204
+ :subIndex="index"
205
+ @onStageSplitChange="onStageSplitChange"
206
+ @stageSplitChange="stageSplitChange"
207
+ @onStageDelaystartChange="onStageDelaystartChange"
208
+ @onStageAdvanceendChange="onStageAdvanceendChange"
209
+ >
210
+ </stage-bord>
211
+ <div v-if="isRing" style="margin-left: 10px">
212
+ <el-button
213
+ type="primary"
214
+ @click="
215
+ addStage(
216
+ patternOne.length === 0
217
+ ? planPattern.stagesList
218
+ : patternOne[0].stagesList
219
+ )
220
+ "
221
+ icon="el-icon-plus"
222
+ circle
223
+ ></el-button>
224
+ </div>
225
+ </div>
226
+ </el-tab-pane>
227
+ <el-tab-pane
228
+ v-if="!isRing"
229
+ :label="$t('openatccomponents.pattern.parameters')"
230
+ name="parame"
231
+ >
232
+ <el-row>
233
+ <expend-config
234
+ v-for="(j, index) in ringCounts"
235
+ :key="index"
236
+ class="expendkanban"
237
+ :options="options"
238
+ :header-text="$t('openatccomponents.pattern.ring') + j"
239
+ :list="
240
+ patternOne.length === 0
241
+ ? planPattern.rings[j - 1]
242
+ : patternOne[0].rings[j - 1]
243
+ "
244
+ >
245
+ </expend-config>
246
+ <div class="forbiddenstage">
247
+ {{ $t('openatccomponents.pattern.forbiddenstage') }}
248
+ <el-input
249
+ class="stage-value"
250
+ size="small"
251
+ v-model="forbiddenstage"
252
+ ></el-input>
253
+ </div>
254
+ <div class="forbiddenstage">
255
+ {{ $t('openatccomponents.pattern.screenstage') }}
256
+ <el-input
257
+ class="stage-value"
258
+ size="small"
259
+ v-model="screenstage"
260
+ ></el-input>
261
+ </div>
262
+ <div class="forbiddenstage">
263
+ {{ $t('openatccomponents.pattern.coordinatestage') }}
264
+ <el-input
265
+ class="stage-value"
266
+ size="small"
267
+ v-model="coordinatestage"
268
+ ></el-input>
269
+ </div>
270
+ </el-row>
271
+ </el-tab-pane>
272
+ <el-tab-pane
273
+ v-if="!isRing"
274
+ :label="$t('openatccomponents.pattern.overLap')"
275
+ name="overlap"
276
+ >
277
+ <el-row :gutter="20">
278
+ <el-col :span="24">
279
+ <over-lap
280
+ :stageList="stagesList"
281
+ :overlap="overlap"
282
+ :checked="true"
283
+ :tentative="true"
284
+ :cycleChange="false"
285
+ :cycle="overLapCycle"
286
+ >
287
+ </over-lap>
288
+ </el-col>
289
+ </el-row>
290
+ </el-tab-pane>
291
+ <el-tab-pane
292
+ v-if="!isRing"
293
+ :label="$t('openatccomponents.pattern.patternOptimize')"
294
+ name="patternOptimize"
295
+ >
296
+ <pattern-optimize
297
+ v-for="n in optimizes"
298
+ :key="n"
299
+ class="expendkanban"
300
+ :list="
301
+ patternOne.length === 0
302
+ ? planPattern.rings[n - 1]
303
+ : patternOne[0].rings[n - 1]
304
+ "
305
+ :rings="patternOne.length === 0 ? planPattern : patternOne[0]"
306
+ :phaseList="phaseList"
307
+ :options="options"
308
+ :header-text="$t('openatccomponents.pattern.ring') + n"
309
+ :index="n"
310
+ :nowNumber="n"
311
+ @handleSplit="handleSplit"
312
+ >
313
+ </pattern-optimize>
314
+ </el-tab-pane>
315
+ </el-tabs>
316
+ </el-row>
317
+ <div class="footer" v-if="realtimeStatusModalvisible">
318
+ <el-button v-if="isShowBack" @click="handleClose()">{{
319
+ $t('openatccomponents.button.Back')
320
+ }}</el-button>
321
+ <el-button @click="toAutoControl()" v-if="isHasPermission('configer:manual:renew')">{{$t('openatccomponents.overview.recovery')}}</el-button>
322
+ <el-button type="primary" @click="handleManualControl()">{{
323
+ $t('openatccomponents.overview.implement')
324
+ }}</el-button>
325
+ </div>
326
+ <div class="footer" v-if="!realtimeStatusModalvisible">
327
+ <el-button v-if="isShowBack" @click="handleClose()">{{
328
+ $t('openatccomponents.button.Back')
329
+ }}</el-button>
330
+ <el-button @click="toAutoControl()" v-if="isHasPermission('configer:manual:renew')">{{$t('openatccomponents.overview.recovery')}}</el-button>
331
+ <el-button type="primary" @click="handleManualControl()">{{
332
+ $t('openatccomponents.overview.comfirm')
333
+ }}</el-button>
334
+ </div>
335
+ </div>
336
+ </template>
337
+
338
+ <script>
339
+ import { hasPermission } from '../../../../utils/auth'
340
+
341
+ export default {
342
+ name: 'tentativeplancontrol',
343
+ props: {
344
+ realtimeStatusModalvisible: {
345
+ type: Boolean,
346
+ default: true
347
+ },
348
+ controlData: {
349
+ type: Object
350
+ },
351
+ phaseList: {
352
+ type: Array
353
+ },
354
+ overlap: {
355
+ type: Array
356
+ },
357
+ allPatternList: {
358
+ type: Array
359
+ },
360
+ patternSelect: {
361
+ type: Array
362
+ },
363
+ isShowBack: {
364
+ type: Boolean,
365
+ default: true
366
+ }
367
+ },
368
+ watch: {
369
+ isRing (newVal) {
370
+ this.activeTab = newVal ? 'ring' : 'kanban'
371
+ }
372
+ },
373
+ computed: {
374
+ computedActiveTab () {
375
+ return this.isRing ? 'ring' : 'kanban'
376
+ },
377
+ rings () {
378
+ return this.patternOne.length === 0 ? this.planPattern.rings : this.patternOne[0].rings
379
+ },
380
+ cycle () {
381
+ return this.patternOne.length === 0 ? this.max : (this.patternOne.length > 0 && (this.patternOne[0].cycle < this.max)) ? this.max : this.patternOne[0].cycle
382
+ },
383
+ offset () {
384
+ return Number((this.patternOne.length === 0 || this.manualInfo.offset > 0) ? this.manualInfo.offset : this.patternOne[0].offset)
385
+ },
386
+ forbiddenstage () {
387
+ return this.patternOne.length === 0 ? this.allPatternList[0].forbiddenstage : this.patternOne[0].forbiddenstage
388
+ },
389
+ screenstage () {
390
+ return this.patternOne.length === 0 ? this.allPatternList[0].screenstage : this.patternOne[0].screenstage
391
+ },
392
+ coordinatestage () {
393
+ return this.patternOne.length === 0 ? this.allPatternList[0].coordinatestage : this.patternOne[0].coordinatestage
394
+ }
395
+ },
396
+ data () {
397
+ return {
398
+ stagesList: [],
399
+ phaseRings: [],
400
+ keyChange: false,
401
+ overLapCycle: 0,
402
+ options: {
403
+ group: 'pattern'
404
+ },
405
+ max: '',
406
+ contrloType: '',
407
+ patternCycleEqual: true,
408
+ // activeList: 'ring',
409
+ activeTab: 'kanban',
410
+ isRing: false,
411
+ // isChange: false,
412
+ ringCount: 1,
413
+ ringCounts: 1,
414
+ barriers: [],
415
+ optimizes: 1,
416
+ coordphaseOption: [],
417
+ patternOne: [],
418
+ planPattern: {},
419
+ manualInfo: {
420
+ tempPatternid: '',
421
+ offset: 0,
422
+ duration: 300,
423
+ tempDelay: 0 // 控制方式手动操作的情况下的延迟时间的临时值。
424
+ // tempDuration: 300 // 控制方式手动操作的情况下的持续时间的临时值。
425
+ }
426
+ }
427
+ },
428
+ created () {
429
+ this.patternPlan()
430
+ this.getCycle()
431
+ if (this.patternOne.length === 0) {
432
+ this.handleStageData(this.planPattern.rings)
433
+ }
434
+ this.initData()
435
+ if (!this.allPatternList[0].contrloType && this.allPatternList[0].rings.length > 0) {
436
+ this.contrloType = 'ring'
437
+ } else if (!this.allPatternList[0].contrloType && this.allPatternList[0].rings.length === 0) {
438
+ this.contrloType = 'stage'
439
+ } else {
440
+ this.contrloType = this.allPatternList[0].contrloType
441
+ }
442
+ for (let i = 0; i < this.allPatternList.length; i++) {
443
+ if (this.allPatternList[i].contrloType === 'stage' || (this.isRing && !this.allPatternList[i].contrloType)) {
444
+ this.isRing = true
445
+ // this.setStageList(this.allPatternList[i].stagesList, this.allPatternList[i].id)
446
+ } else if (this.allPatternList[i].contrloType === 'ring' || (!this.isRing && !this.allPatternList[i].contrloType && this.allPatternList[i].rings.length > 0)) {
447
+ this.isRing = false
448
+ // this.handleStageData(this.allPatternList[i].rings)
449
+ } else if (this.allPatternList[i].rings.length === 0 && this.allPatternList[i].stagesList.length > 0) {
450
+ this.isRing = true
451
+ // this.setStageList(this.allPatternList[i].stagesList, this.allPatternList[i].id)
452
+ }
453
+ }
454
+ },
455
+ methods: {
456
+ addStage (row) {
457
+ // this.isChange = false
458
+ if (row.length > 15) {
459
+ this.$message.error(
460
+ this.$t('edge.pattern.mostlist')
461
+ )
462
+ return
463
+ }
464
+ if (this.patternOne.length !== 0) {
465
+ this.patternOne[0].stagesList.push({
466
+ key: row.length,
467
+ green: 25,
468
+ yellow: 3,
469
+ red: 2,
470
+ phases: [],
471
+ stageSplit: 30
472
+ })
473
+ } else {
474
+ this.planPattern.stagesList.push({
475
+ key: row.length,
476
+ green: 25,
477
+ yellow: 3,
478
+ red: 2,
479
+ phases: [],
480
+ stageSplit: 30
481
+ })
482
+ }
483
+ },
484
+ changeRing () {
485
+ this.contrloType = 'ring'
486
+ this.isRing = false
487
+ // const globalParamModel = this.$store.getters.globalParamModel
488
+ // let pattern = globalParamModel.getParamsByType('patternList')
489
+ // let pattern = this.allPatternList
490
+ this.getCycle()
491
+ this.patternOne = this.allPatternList.filter(item => {
492
+ return item.id === Number(this.manualInfo.tempPatternid)
493
+ })
494
+ // if (this.isChange) {
495
+ // for (let i = 0; i < pattern.length; i++) {
496
+ this.handleStageData(this.patternOne.rings)
497
+ // }
498
+ // } else {
499
+ // for (let i = 0; i < pattern.length; i++) {
500
+ // this.setStageList(pattern[i].stagesList, pattern[i].id)
501
+ // }
502
+ // }
503
+ },
504
+ changeStage () {
505
+ this.contrloType = 'stage'
506
+ this.isRing = true
507
+ // this.patternOne = this.allPatternList.filter(item => {
508
+ // return item.id === Number(this.manualInfo.tempPatternid)
509
+ // })
510
+ // this.getStageCycle()
511
+ },
512
+ getStageCycle () {
513
+ // this.patternOne.length === 0 ? this.allPatternList this.patternOne
514
+ if (this.patternOne.length === 0) {
515
+ // this.setStageList(this.planPattern.stagesList, this.planPattern.id)
516
+ // this.planPattern.stagesList = []
517
+ } else {
518
+ // this.patternOne = this.allPatternList.filter(item => {
519
+ // return item.id === Number(this.manualInfo.tempPatternid)
520
+ // })
521
+ // this.setStageList(this.patternOne[0].stagesList, this.patternOne[0].id)
522
+ }
523
+ },
524
+ setStageList (stageChange, id) {
525
+ // let patternList = this.globalParamModel.getParamsByType('patternList')
526
+ // let patternList = this.allPatternList
527
+ let stagesList = []
528
+ for (let i = 0; i < stageChange.length; i++) {
529
+ let stage = JSON.parse(JSON.stringify(stageChange[i]))
530
+ let stageItem = this.getStageItems(stage.phases, i, stageChange)
531
+ stagesList.push(JSON.parse(JSON.stringify(stageItem)))
532
+ }
533
+ (this.patternOne.length === 0 ? this.planPattern : this.patternOne).map(item => { // 添加特征参数stage
534
+ if (item.id === id) {
535
+ if (this.isRing) {
536
+ item.contrloType = 'stage'
537
+ } else {
538
+ item.contrloType = 'ring'
539
+ }
540
+ item.stagesList = JSON.parse(JSON.stringify(stagesList.filter(item => item.stageSplit)))
541
+ }
542
+ })
543
+ this.stagesList = stagesList.filter(item => item.stageSplit)
544
+ },
545
+ getStageItems (stageArr, i, stageChange) {
546
+ let res = {
547
+ key: i,
548
+ split: this.narr[i], // 阶段绿性比
549
+ phases: stageArr,
550
+ delaystart: 0,
551
+ advanceend: 0
552
+ }
553
+ for (let rings of stageChange) {
554
+ if (i === rings.key) {
555
+ res.green = rings.green ? rings.green : rings.green === 0 ? 0 : 25
556
+ res.yellow = rings.yellow ? rings.yellow : rings.yellow === 0 ? 0 : 3
557
+ res.red = rings.red ? rings.red : rings.red === 0 ? 0 : 2
558
+ res.phases = rings.phases ? rings.phases : stageArr
559
+ // res.stageSplit = rings.split ? rings.split : 30
560
+ if (rings.split) {
561
+ res.stageSplit = rings.split
562
+ } else if (rings.stageSplit) {
563
+ res.stageSplit = rings.stageSplit
564
+ } else {
565
+ res.stageSplit = 0
566
+ }
567
+ }
568
+ }
569
+ return res
570
+ },
571
+ tranform (arr) { // 分barrier
572
+ let newMap = new Map()
573
+ arr.forEach(({ id, current }) => {
574
+ const find = newMap.get(current.join())
575
+ if (find) newMap.get(current.join()).push(id)
576
+ else newMap.set(current.join(), [id])
577
+ })
578
+ let ret = []
579
+ newMap.forEach((value, key) => {
580
+ ret.push(Array.from(new Set(key.split(',').map(Number).concat(value))))
581
+ })
582
+ const result = []
583
+ for (const a of ret) {
584
+ let merged = false
585
+ for (const r of result) {
586
+ if (this.check([...r], a)) {
587
+ a.forEach(item => r.add(item))
588
+ merged = true
589
+ }
590
+ }
591
+ if (!merged) {
592
+ result.push(new Set(a))
593
+ }
594
+ merged = false
595
+ }
596
+ return result.map(s => [...s])
597
+ },
598
+ check (arr1, arr2) {
599
+ return arr1.some(a1 => arr2.some(a2 => a1 === a2))
600
+ },
601
+ handleCurrentChange (val) { // 两个ring的数据
602
+ if (val === null || val.length === 0) return
603
+ // 按环序分组
604
+ let ringlength = []
605
+ let ringsequence = val.map(item => {
606
+ if (item.length === 0) return
607
+ ringlength.push(item.length)
608
+ return item.map(k => {
609
+ return k.id
610
+ })
611
+ })
612
+ let newRings = ringsequence.filter(item => item)
613
+ let minLength = Math.min(...ringlength)
614
+ let resultArrs = [] // 环1分组
615
+ let resultArr = [] // 环2分组
616
+ for (let j = 0; j < ringsequence[0].length; j += minLength) {
617
+ resultArrs.push(ringsequence[0].slice(j, j + minLength))
618
+ if (ringsequence[0].length === minLength) {
619
+ resultArrs.push([])
620
+ }
621
+ }
622
+ if (newRings.length > 1) {
623
+ for (let i = 0; i < ringsequence[1].length; i += minLength) {
624
+ resultArr.push(ringsequence[1].slice(i, i + minLength))
625
+ }
626
+ }
627
+ // this.patternInfo = []
628
+ // this.barrierList = []
629
+ let currentArr = []
630
+ let newPattern = []
631
+ val.map(i => {
632
+ newPattern.push(...i)
633
+ })
634
+ if (this.phaseList.length === 0) return
635
+ for (let patternStatus of val[0]) {
636
+ // if (patternStatus.mode !== 7) {
637
+ let concurrent = this.phaseList.filter((item) => {
638
+ return item.id === patternStatus.id // patternStatus.id当前相位id concurrent当前相位的并发相位
639
+ })[0].concurrent// 当前相位的并发相位
640
+ if (concurrent) {
641
+ let obj = {
642
+ id: patternStatus.id,
643
+ current: concurrent.sort()
644
+ }
645
+ currentArr.push(obj)
646
+ }
647
+ // }
648
+ }
649
+ if (currentArr.length !== 0) {
650
+ let newCurrent = this.tranform(currentArr)
651
+ // 取没个环与环关系的并集
652
+ let barrierRing1 = []
653
+ let barrierRing2 = []
654
+ let ring1 = [] // 环1与关系1的并集
655
+ for (let h = 0; h < newCurrent.length; h++) {
656
+ let adds = [...new Set(resultArrs[0])].filter(item => newCurrent[h].includes(item))
657
+ ring1.push(adds)
658
+ }
659
+ let ring1s = [] // 环1与关系2的并集
660
+ for (let h = 0; h < newCurrent.length; h++) {
661
+ let addRing1 = [...new Set(resultArrs[1])].filter(item => newCurrent[h].includes(item))
662
+ ring1s.push(addRing1)
663
+ }
664
+ barrierRing1.push(...ring1, ...ring1s)
665
+ let resultList = []
666
+ if (newRings.length > 1) {
667
+ let ring2s = [] // 环2与关系1的并集
668
+ for (let h = 0; h < newCurrent.length; h++) {
669
+ let addRing2 = [...new Set(resultArr[1])].filter(item => newCurrent[h].includes(item))
670
+ ring2s.push(addRing2)
671
+ }
672
+ let ring2 = [] // 环2与关系1的并集
673
+ for (let h = 0; h < newCurrent.length; h++) {
674
+ let add = [...new Set(resultArr[0])].filter(item => newCurrent[h].includes(item))
675
+ ring2.push(add)
676
+ }
677
+ barrierRing2.push(...ring2, ...ring2s)
678
+ for (let k = 0; k < barrierRing1.length; k++) {
679
+ resultList.push(barrierRing1[k].concat(barrierRing2[k]))
680
+ }
681
+ }
682
+ let resultLists = resultList.filter(item => item.length !== 0)
683
+ let ringArr = []
684
+ for (let l = 0; l < resultLists.length; l++) {
685
+ for (let d = 0; d < newCurrent.length; d++) {
686
+ if (newCurrent[d].filter(item => resultLists[l].includes(item)).length > 0) {
687
+ ringArr.push({
688
+ data: resultLists[l],
689
+ id: d + 1,
690
+ index: l
691
+ })
692
+ }
693
+ }
694
+ }
695
+ for (var i = 0; i < ringArr.length; i++) {
696
+ for (var j = i + 1; j < ringArr.length; j++) {
697
+ if (ringArr[i].id === ringArr[j].id && ringArr[i].index + 1 === ringArr[j].index) {
698
+ ringArr[i].data = ringArr[i].data.concat(ringArr[j].data)
699
+ ringArr.splice(ringArr.indexOf(ringArr[j].id), 1)
700
+ }
701
+ }
702
+ }
703
+ let resArr = ringArr.map(item => item.data)
704
+ let ringTeam = this.step1(this.phaseList, resArr)
705
+ let ringTeams = ringTeam.filter(item => item.length !== 0)
706
+ return this.setBarrier(ringTeams, val)
707
+ }
708
+ },
709
+ setBarrier (ringTeam, val) {
710
+ const patternObjs = {}
711
+ val.forEach(l => {
712
+ l.map(k => {
713
+ patternObjs[k.id] = k.value
714
+ })
715
+ })
716
+ let ret = ringTeam.map((y, index) => {
717
+ if (!y || y.length === 0) return
718
+ y.map(n => {
719
+ n.length = n.data.length > 1 ? n.data.reduce((pre, cur) => pre + patternObjs[cur], 0) : patternObjs[n.data[0]]
720
+ })
721
+ return {
722
+ barrier: index + 1,
723
+ length: y[0].length,
724
+ items: y.map(j => {
725
+ return {
726
+ ring: j.ring,
727
+ data: j.data
728
+ }
729
+ })
730
+ }
731
+ })
732
+ return ret
733
+ },
734
+ step1 (list, arr) { // 各个环包含的相位
735
+ const ret = []
736
+ const listObj = {}
737
+ list.forEach(l => {
738
+ listObj[l.id] = l.ring
739
+ })
740
+ arr.forEach(a => {
741
+ const retItem = []
742
+ a.forEach(b => {
743
+ if (listObj[b]) {
744
+ const find = retItem.find(r => r.ring === listObj[b])
745
+ if (find) find.data.push(b)
746
+ else retItem.push({ ring: listObj[b], data: [b] })
747
+ }
748
+ })
749
+ ret.push(retItem)
750
+ })
751
+ return ret
752
+ },
753
+ patternPlan () {
754
+ let Pattern = {
755
+ offset: 0,
756
+ cycle: 0,
757
+ stagesList: [],
758
+ rings: [[], [], [], []]
759
+ }
760
+ var newPattern = JSON.parse(JSON.stringify(Pattern))
761
+ for (let phase of this.phaseList) {
762
+ let ring = {}
763
+ ring.name = 'Phase ' + phase.id
764
+ ring.desc = this.getPhaseDescription(phase.direction)
765
+ ring.id = phase.id
766
+ ring.value = 30
767
+ ring.mode = 2
768
+ ring.options = []
769
+ ring.delaystart = 0
770
+ ring.advanceend = 0
771
+ if (phase.ring === 1) {
772
+ newPattern.rings[0].push(ring)
773
+ } else if (phase.ring === 2) {
774
+ newPattern.rings[1].push(ring)
775
+ } else if (phase.ring === 3) {
776
+ newPattern.rings[2].push(ring)
777
+ } else if (phase.ring === 4) {
778
+ newPattern.rings[3].push(ring)
779
+ }
780
+ }
781
+ let barrier = this.handleCurrentChange(newPattern.rings)
782
+ newPattern.barriers = barrier
783
+ this.planPattern = newPattern
784
+ },
785
+ getCycle () {
786
+ for (let rings of this.planPattern.rings) {
787
+ let num = 0
788
+ for (let i = 0; i < rings.length; i++) {
789
+ if (rings[i].length !== 0) {
790
+ if (rings[i].mode === 7) { // 忽略相位不计周期
791
+ continue
792
+ }
793
+ num = num + Number(rings[i].value)
794
+ }
795
+ }
796
+ if (num !== 0) {
797
+ this.planPattern.cycle = num
798
+ break
799
+ }
800
+ }
801
+ },
802
+ getCycles () {
803
+ if (!this.patternOne[0].stages) return
804
+ let stages = this.patternOne[0].stages
805
+ let modeId = stages.filter(item => item.length === 1)[0]
806
+ for (let rings of this.patternOne[0].rings) {
807
+ let num = 0
808
+ for (let i = 0; i < rings.length; i++) {
809
+ if (rings[i].length !== 0) {
810
+ if (rings[i].mode === 7 && (modeId && modeId[0] === rings[i].id)) { // 忽略相位不计周期
811
+ continue
812
+ }
813
+ num = num + Number(rings[i].value)
814
+ }
815
+ }
816
+ if (num !== 0) {
817
+ this.patternOne[0].cycle = num
818
+ break
819
+ }
820
+ }
821
+ },
822
+ getPhaseDescription (phaseList) {
823
+ if (!phaseList) return
824
+ let list = []
825
+ for (let id of phaseList) {
826
+ let obj = {}
827
+ obj.id = id
828
+ obj.color = '#454545'
829
+ list.push(obj)
830
+ }
831
+ return list
832
+ },
833
+ handleClose () {
834
+ this.$emit('closePhaseBack')
835
+ },
836
+ onStageSplitChange (diff, rowIndex, subIndex) {
837
+ let stageArr = this.stagesList[subIndex].stages
838
+ let row = this.patternList[rowIndex]
839
+ let ringsList = row.rings
840
+ for (let rings of ringsList) {
841
+ for (let ring of rings) {
842
+ if (stageArr.includes(ring.id)) {
843
+ ring.value = (ring.value ? ring.value : 0) + diff
844
+ continue
845
+ }
846
+ }
847
+ }
848
+ },
849
+ stageSplitChange (diff, rowIndex, subIndex) {
850
+ let row = this.patternOne.length === 0 ? this.planPattern : this.patternOne
851
+ let ringsList = this.patternOne.length === 0 ? row.stagesList : row[0].stagesList
852
+ for (let rings of ringsList) {
853
+ // if (subIndex === rings.key) {
854
+ rings.stageSplit = (rings.green ? rings.green : 0) + (rings.yellow ? rings.yellow : 0) + (rings.red ? rings.red : 0)
855
+ continue
856
+ // }
857
+ }
858
+ },
859
+ onStageDelaystartChange (diff, rowIndex, subIndex) {
860
+ let stageArr = this.stagesList[subIndex].stages
861
+ let row = this.patternList[rowIndex]
862
+ let ringsList = row.rings
863
+ for (let rings of ringsList) {
864
+ for (let ring of rings) {
865
+ if (stageArr.includes(ring.id)) {
866
+ ring.delaystart = (ring.delaystart ? ring.delaystart : 0) + diff
867
+ continue
868
+ }
869
+ }
870
+ }
871
+ },
872
+ onStageAdvanceendChange (diff, rowIndex, subIndex) {
873
+ let stageArr = this.stagesList[subIndex].stages
874
+ let row = this.patternList[rowIndex]
875
+ let ringsList = row.rings
876
+ for (let rings of ringsList) {
877
+ for (let ring of rings) {
878
+ if (stageArr.includes(ring.id)) {
879
+ ring.advanceend = (ring.advanceend ? ring.advanceend : 0) + diff
880
+ continue
881
+ }
882
+ }
883
+ }
884
+ },
885
+ handleSplit (index) {
886
+ if (this.patternOne.length > 0) {
887
+ let currPattern = this.patternOne[0].rings
888
+ setTimeout(() => {
889
+ this.handleStageData(currPattern)
890
+ this.getCycles()
891
+ // this.patternOne[0].stagesList = this.stagesList
892
+ }, 50)
893
+ } else {
894
+ let currPattern = this.planPattern.rings
895
+ setTimeout(() => {
896
+ this.handleStageData(currPattern)
897
+ this.getCycle()
898
+ // this.allPatternList[0].stagesList = this.stagesList
899
+ }, 50)
900
+ }
901
+ },
902
+ selectPattern () {
903
+ this.manualInfo.offset = 0
904
+ let selectId = Number(this.manualInfo.tempPatternid)
905
+ this.patternOne = this.allPatternList.filter(item => {
906
+ return item.id === selectId
907
+ })
908
+ // if (this.patternOne[0].contrloType === 'stage') {
909
+ // this.changeStage()
910
+ // }
911
+ this.manualInfo.offset = this.offset
912
+ for (let rings of this.patternOne[0].rings) {
913
+ if (rings.length === 0) continue
914
+ for (let ring of rings) {
915
+ if (ring.value === 0) continue
916
+ let currPhase = this.phaseList.filter((item) => {
917
+ return item.id === ring.id
918
+ })[0]
919
+ ring.desc = currPhase.direction.map(item => {
920
+ return {
921
+ id: item,
922
+ color: '#454545'
923
+ }
924
+ })
925
+ }
926
+ }
927
+ this.handleStageData(this.patternOne[0].rings)
928
+ },
929
+ handleStageData (rings) { // stagesList
930
+ if (!rings) return
931
+ for (let i = 0; i < rings.length; i++) {
932
+ if (rings[i].length > 0) {
933
+ let phaseList = []
934
+ let stagesList = []
935
+ // rings = JSON.parse(JSON.stringify(rings))
936
+ let mapAdd = rings.map(item => {
937
+ return item.map(val => {
938
+ // if (val.mode !== 7) {
939
+ return val.value + (val.sum ? val.sum : 0)
940
+ // } else {
941
+ // return 0
942
+ // }
943
+ })
944
+ })
945
+ let maxCycle = mapAdd.length > 0 ? mapAdd.map(item => {
946
+ return item.length > 0 ? item.reduce((a, b) => {
947
+ return a + b
948
+ }) : 0
949
+ }) : 0
950
+ this.max = Math.max(...maxCycle)// 每个环的周期最大值
951
+ this.stateList = [0]
952
+ this.narr = []
953
+ let currentIds = ''
954
+ let lastCurrentIds = ''
955
+ for (let j = 0; j <= this.max; j++) { // 指针长度
956
+ for (let i = 0; i < rings.length; i++) { // 环列表
957
+ let ring = rings[i]// 每个环对象
958
+ let sum = 0
959
+ for (let n = 0; n < ring.length; n++) { // 相位累计长度
960
+ // if (ring[n].mode !== 7) {
961
+ sum = sum + ring[n].value + (ring[n].sum ? ring[n].sum : 0)
962
+ if (j < sum) {
963
+ let phaseId = ring[n].id
964
+ currentIds = currentIds + '-' + phaseId
965
+ break
966
+ }
967
+ // }
968
+ }
969
+ }
970
+ if (lastCurrentIds !== currentIds && lastCurrentIds !== '') { // 当前相位id和上一个相比不同说明相位变化了
971
+ phaseList.push(lastCurrentIds)
972
+ this.stateList.push(j)// 阶段累计长度的集合
973
+ }
974
+ lastCurrentIds = currentIds
975
+ currentIds = ''
976
+ }
977
+ let newPhaselist = []
978
+ phaseList.forEach(i => {
979
+ let rangeArr = i.split('-').map(Number)
980
+ if (rangeArr.length > 2) {
981
+ newPhaselist.push([
982
+ JSON.parse(JSON.stringify(rangeArr[1])),
983
+ JSON.parse(JSON.stringify(rangeArr[2]))
984
+ ])
985
+ } else {
986
+ newPhaselist.push([
987
+ JSON.parse(JSON.stringify(rangeArr[1]))
988
+ ])
989
+ }
990
+ })
991
+ for (let i = this.stateList.length - 1; i >= 1; i--) {
992
+ this.narr.push(this.stateList[i] - this.stateList[i - 1])
993
+ }
994
+ // newPhaselist
995
+ this.narr.reverse()// 阶段差
996
+ for (let i = 0; i < newPhaselist.length; i++) {
997
+ let stage = JSON.parse(JSON.stringify(newPhaselist[i]))
998
+ let newStage = []
999
+ stage.map(item => {
1000
+ for (let ring of rings) {
1001
+ for (let ringItem of ring) {
1002
+ if (item === ringItem.id && (ringItem.mode !== 7 && ringItem.mode !== 8 && ringItem.mode !== 9)) {
1003
+ newStage.push(item)
1004
+ }
1005
+ }
1006
+ }
1007
+ })
1008
+ let stageItem = this.getStageItem(newStage, stage, rings, i)
1009
+ stagesList.push(JSON.parse(JSON.stringify(stageItem)))
1010
+ }
1011
+ this.overLapCycle = stagesList.reduce((prev, curr) => prev + parseInt(curr.split), 0)
1012
+ this.stagesList = JSON.parse(JSON.stringify(stagesList))
1013
+ }
1014
+ }
1015
+ },
1016
+ getStageItem (stageArr, stage, ringsList, i) {
1017
+ let res = {
1018
+ key: i,
1019
+ split: this.narr[i], // 阶段绿性比
1020
+ phases: stageArr,
1021
+ stageKanban: stage,
1022
+ delaystart: 0,
1023
+ advanceend: 0
1024
+ }
1025
+ // let splitArr = []
1026
+ let delaystartArr = []
1027
+ let advanceendArr = []
1028
+ for (let rings of ringsList) {
1029
+ for (let ring of rings) {
1030
+ if (stageArr.includes(ring.id)) {
1031
+ // let split = ring.value
1032
+ let delaystart = ring.delaystart
1033
+ let advanceend = ring.advanceend
1034
+ // splitArr.push(split)
1035
+ delaystartArr.push(delaystart)
1036
+ advanceendArr.push(advanceend)
1037
+ }
1038
+ }
1039
+ }
1040
+ // splitArr.sort(function (a, b) { return a - b })
1041
+ delaystartArr.sort(function (a, b) { return b - a })
1042
+ advanceendArr.sort(function (a, b) { return a - b })
1043
+ // res.split = splitArr.length > 0 ? splitArr[0] : 0
1044
+ res.delaystart = delaystartArr.length > 0 ? delaystartArr[0] : 0
1045
+ res.advanceend = advanceendArr.length > 0 ? advanceendArr[0] : 0
1046
+ return res
1047
+ },
1048
+ initData () {
1049
+ // 判断有几个环,就创建几个看板
1050
+ // let phaseList = this.globalParamModel.getParamsByType('phaseList')
1051
+ // this.coordphaseOption = this.phaseList.map(ele => {
1052
+ // return {
1053
+ // value: ele.id
1054
+ // }
1055
+ // })
1056
+ this.coordphaseOption = this.phaseList
1057
+ // this.overlap = this.globalParamModel.getParamsByType('overlaplList')
1058
+ // this.agentId = getIframdevid()
1059
+ let rings = []
1060
+ if (this.phaseList.length === 0) {
1061
+ // this.$store.getters.tscParam.patternList = []
1062
+ return
1063
+ }
1064
+ for (let phase of this.phaseList) {
1065
+ rings.push(phase.ring)
1066
+ }
1067
+ this.ringCount = Array.from(new Set(rings)) // 去除数组重复的元素
1068
+ this.ringCount = this.ringCount.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
1069
+ this.ringCounts = Array.from(new Set(rings)) // 去除数组重复的元素
1070
+ this.ringCounts = this.ringCounts.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
1071
+ this.optimizes = Array.from(new Set(rings)) // 去除数组重复的元素
1072
+ this.optimizes = this.optimizes.sort(this.sortNumbers) // 把数组中的值按照从小到大的顺序重新排序
1073
+ // this.increaseId()
1074
+ // this.getCycle()
1075
+ // this.updatePhaseDescription()
1076
+ // this.getOptionsOfRing()
1077
+ },
1078
+ sortNumbers (a, b) {
1079
+ return a - b
1080
+ },
1081
+ isRingCycleEqual (rings) {
1082
+ let isequal = true
1083
+ // this.patternmsg = []
1084
+ let maxCycle = 0
1085
+ for (let ring of rings) {
1086
+ if (ring.length === 0) continue
1087
+ let cycle = 0
1088
+ for (let r of ring) {
1089
+ if (r.mode === 7) { // 忽略相位不计周期
1090
+ continue
1091
+ }
1092
+ cycle = cycle + r.value
1093
+ }
1094
+ if (cycle > maxCycle && maxCycle === 0) {
1095
+ maxCycle = cycle
1096
+ }
1097
+ if (cycle !== maxCycle) {
1098
+ // this.patternmsg.push(rings.id)
1099
+ isequal = false
1100
+ }
1101
+ }
1102
+ return isequal
1103
+ },
1104
+ getMaxCycleStage (pattern) {
1105
+ let rings = pattern.stagesList
1106
+ let stageCycleList = rings.map(item => {
1107
+ if (item.stageSplit) {
1108
+ return item.stageSplit
1109
+ } else {
1110
+ return 0
1111
+ }
1112
+ })
1113
+ let maxCycle = stageCycleList.reduce((a, b) => {
1114
+ return a + b
1115
+ }, 0)
1116
+ return maxCycle
1117
+ },
1118
+ getMaxCycle (pattern) {
1119
+ let rings = pattern.rings
1120
+ let maxCycle = 0
1121
+ for (let ring of rings) {
1122
+ if (ring.length === 0) continue
1123
+ let cycle = 0
1124
+ for (let r of ring) {
1125
+ if (r.mode === 7) { // 忽略相位不计周期
1126
+ continue
1127
+ }
1128
+ cycle = cycle + r.value
1129
+ }
1130
+ if (cycle > maxCycle) {
1131
+ maxCycle = cycle
1132
+ }
1133
+ }
1134
+ return maxCycle
1135
+ },
1136
+ // checkPatternRules (rings) {
1137
+ // if (!this.isRingCycleEqual(rings)) {
1138
+ // this.patternCycleEqual = false
1139
+ // } else {
1140
+ // this.patternCycleEqual = true
1141
+ // }
1142
+ // if (!this.patternCycleEqual) {
1143
+ // let mess = `方案中存在环周期时长不一致`
1144
+ // if (this.$i18n.locale === 'en') {
1145
+ // mess = `Inconsistent loop cycle durations exist in the scheme`
1146
+ // }
1147
+ // this.$message({
1148
+ // message: mess,
1149
+ // type: 'error',
1150
+ // dangerouslyUseHTMLString: true
1151
+ // })
1152
+ // return false
1153
+ // }
1154
+ // },
1155
+ handleManualControl () {
1156
+ let submitdata = {
1157
+ control: 100,
1158
+ delay: this.manualInfo.tempDelay !== undefined ? Number(this.manualInfo.tempDelay) : 0,
1159
+ duration: Number(this.manualInfo.duration),
1160
+ // duration: this.manualInfo.tempDuration !== undefined ? Number(this.manualInfo.tempDuration) : 0,
1161
+ data: {}
1162
+ }
1163
+ if (this.manualInfo.tempPatternid) {
1164
+ submitdata.terminal = Number(this.manualInfo.tempPatternid)
1165
+ }
1166
+ if (this.patternOne.length === 0) {
1167
+ if (this.isRing) {
1168
+ submitdata.data.cycle = this.getMaxCycleStage(this.planPattern)
1169
+ } else {
1170
+ submitdata.data.cycle = this.getMaxCycle(this.planPattern)
1171
+ }
1172
+ submitdata.data.stagesList = this.planPattern.stagesList
1173
+ } else {
1174
+ if (this.isRing) {
1175
+ submitdata.data.cycle = this.getMaxCycleStage(this.patternOne[0])
1176
+ } else {
1177
+ submitdata.data.cycle = this.getMaxCycle(this.patternOne[0])
1178
+ }
1179
+ this.patternOne[0].stagesList.forEach((stage) => {
1180
+ delete stage.split
1181
+ })
1182
+ submitdata.data.stagesList = this.patternOne[0].stagesList
1183
+ }
1184
+ submitdata.data.offset = this.offset
1185
+ if (this.patternOne.length === 0) {
1186
+ submitdata.data.rings = this.planPattern.rings
1187
+ } else {
1188
+ submitdata.data.rings = this.patternOne[0].rings
1189
+ }
1190
+ // submitdata.data.rings = this.patternOne.length === 0 ? this.planPattern.rings : this.patternOne[0].rings
1191
+ // this.checkPatternRules(submitdata.data.rings)
1192
+ if (this.patternCycleEqual) {
1193
+ this.$emit('closePhaseControl', submitdata)
1194
+ }
1195
+ },
1196
+ toAutoControl () {
1197
+ this.$emit('toAutoControl')
1198
+ },
1199
+ isHasPermission (path) {
1200
+ let res = hasPermission(path)
1201
+ return res
1202
+ }
1203
+ }
1204
+ }
1205
+ </script>
1206
+
1207
+ <style>
1208
+
1209
+ </style>