openatc-components 0.3.21 → 0.3.22

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