openatc-components 0.2.83 → 0.2.84

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