openatc-components 0.3.74 → 0.3.76

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