openatc-components 0.3.44 → 0.3.46

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