openatc-components 0.4.87 → 0.4.88

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 (402) hide show
  1. package/.babelrc +18 -18
  2. package/.editorconfig +9 -9
  3. package/.eslintignore +5 -5
  4. package/.eslintrc.js +31 -31
  5. package/.postcssrc.js +10 -10
  6. package/README.md +30 -30
  7. package/build/build.js +41 -41
  8. package/build/check-versions.js +54 -54
  9. package/build/package.config.js +58 -58
  10. package/build/package.dev.config.js +107 -107
  11. package/build/package.prod.config.js +160 -160
  12. package/build/utils.js +101 -101
  13. package/build/vue-loader.conf.js +22 -22
  14. package/build/webpack.base.conf.js +120 -120
  15. package/build/webpack.dev.conf.js +95 -95
  16. package/build/webpack.prod.conf.js +149 -149
  17. package/config/prod.env.js +5 -5
  18. package/config/test.env.js +7 -7
  19. package/index.html +12 -12
  20. package/package/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +123 -123
  21. package/package/kisscomps/components/Channelization/Channelization.vue +585 -585
  22. package/package/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  23. package/package/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  24. package/package/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  25. package/package/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +456 -456
  26. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  27. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  28. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  29. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  30. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  31. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  32. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  33. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  34. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  35. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  36. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  37. package/package/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  38. package/package/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  39. package/package/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  40. package/package/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  41. package/package/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  42. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  43. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  44. package/package/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  45. package/package/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  46. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  47. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  48. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  49. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  50. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +368 -368
  51. package/package/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  52. package/package/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  53. package/package/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1022 -1022
  54. package/package/kisscomps/components/DrawChannelization/drawsvg/index.vue +144 -144
  55. package/package/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  56. package/package/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  57. package/package/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  58. package/package/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  59. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  60. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  61. package/package/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  62. package/package/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  63. package/package/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  64. package/package/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  65. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +629 -629
  66. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  67. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +447 -447
  68. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +341 -341
  69. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +497 -497
  70. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +353 -353
  71. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +359 -359
  72. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +443 -443
  73. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1302 -1302
  74. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  75. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +498 -498
  76. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +484 -484
  77. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +488 -488
  78. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +566 -566
  79. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +640 -640
  80. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +497 -497
  81. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +486 -486
  82. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +490 -490
  83. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +575 -575
  84. package/package/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  85. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  86. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  87. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  88. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  89. package/package/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  90. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  91. package/package/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  92. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  93. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  94. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +131 -115
  95. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  96. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  97. package/package/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +235 -219
  98. package/package/kisscomps/components/IntersectionMap/intersectionmap.vue +220 -220
  99. package/package/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +534 -534
  100. package/package/kisscomps/components/KanBan/kanban.vue +231 -231
  101. package/package/kisscomps/components/MessageBox/index.vue +96 -96
  102. package/package/kisscomps/components/OverviewComponent/index.vue +827 -853
  103. package/package/kisscomps/components/PatternOptimize/PatternOptimize.vue +329 -329
  104. package/package/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  105. package/package/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  106. package/package/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  107. package/package/kisscomps/components/PhaseLegend/PhaseLegend.vue +286 -286
  108. package/package/kisscomps/components/PhaseMarker/index.js +6 -6
  109. package/package/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  110. package/package/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  111. package/package/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  112. package/package/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  113. package/package/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  114. package/package/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  115. package/package/kisscomps/components/PhasePedSelect/index.vue +206 -206
  116. package/package/kisscomps/components/SchemeConfig/SchemeConfig.vue +7 -30
  117. package/package/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +365 -365
  118. package/package/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  119. package/package/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +214 -214
  120. package/package/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +235 -235
  121. package/package/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  122. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +131 -131
  123. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +871 -871
  124. package/package/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +151 -151
  125. package/package/kisscomps/components/SchemeConfig/priorityControl/index.vue +215 -215
  126. package/package/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  127. package/package/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +308 -308
  128. package/package/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +0 -19
  129. package/package/kisscomps/components/SchemeConfig/utils/thirdPartypermission.js +95 -95
  130. package/package/kisscomps/components/SelectCrossPhase/index.vue +418 -418
  131. package/package/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  132. package/package/kisscomps/components/StageOptimize/StageOptimize.vue +367 -367
  133. package/package/kisscomps/components/StageOptimize/index.js +2 -2
  134. package/package/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  135. package/package/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  136. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1041 -1041
  137. package/package/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  138. package/package/kisscomps/components/XiaoKanban/index.vue +122 -122
  139. package/package/kisscomps/components/overView/index.vue +653 -676
  140. package/package/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  141. package/package/kisscomps/components/patternConfig/planContent.vue +604 -604
  142. package/package/kisscomps/components/patternConfig/planMenu.vue +329 -329
  143. package/package/kisscomps/components/patternConfig/utils.js +152 -152
  144. package/package/kissui.min.js +1 -1
  145. package/package.json +1 -1
  146. package/src/App.vue +1 -5
  147. package/src/EdgeMgr/EdgeModelBase.js +16 -16
  148. package/src/EdgeMgr/controller/crossDiagramMgr.js +125 -125
  149. package/src/api/authapi.js +31 -31
  150. package/src/api/config.js +21 -21
  151. package/src/api/control.js +110 -110
  152. package/src/api/device.js +135 -135
  153. package/src/api/fault.js +66 -66
  154. package/src/api/index.js +24 -24
  155. package/src/api/login.js +46 -46
  156. package/src/api/optimize.js +72 -72
  157. package/src/api/param.js +165 -165
  158. package/src/api/passwdAssest.js +101 -101
  159. package/src/api/permission.js +33 -33
  160. package/src/api/route.js +171 -171
  161. package/src/api/template.js +27 -27
  162. package/src/assets/font/LICENSE.txt +202 -202
  163. package/src/assets/font/font.css +6 -6
  164. package/src/i18n/index.js +26 -26
  165. package/src/i18n/language/en.js +78 -0
  166. package/src/i18n/language/ru.js +78 -0
  167. package/src/i18n/language/zh.js +78 -0
  168. package/src/icons/index.js +20 -20
  169. package/src/icons/svg/azimuthlocking.svg +26 -26
  170. package/src/icons/svg/bendi.svg +110 -110
  171. package/src/icons/svg/bujin.svg +36 -36
  172. package/src/icons/svg/connectBlue.svg +7 -7
  173. package/src/icons/svg/currentvolume.svg +0 -0
  174. package/src/icons/svg/custom-BRTlane.svg +40 -40
  175. package/src/icons/svg/custom-buslane.svg +40 -40
  176. package/src/icons/svg/custom-detector.svg +12 -12
  177. package/src/icons/svg/custom-east-bottom.svg +32 -32
  178. package/src/icons/svg/custom-east-top.svg +32 -32
  179. package/src/icons/svg/custom-ewped.svg +35 -35
  180. package/src/icons/svg/custom-nonmotorizedlane.svg +40 -40
  181. package/src/icons/svg/custom-north-left.svg +32 -32
  182. package/src/icons/svg/custom-north-right.svg +32 -32
  183. package/src/icons/svg/custom-peddetector.svg +17 -17
  184. package/src/icons/svg/custom-snped.svg +35 -35
  185. package/src/icons/svg/custom-south-left.svg +32 -32
  186. package/src/icons/svg/custom-south-right.svg +32 -32
  187. package/src/icons/svg/custom-tramlane.svg +40 -40
  188. package/src/icons/svg/custom-vehiclebranch.svg +40 -40
  189. package/src/icons/svg/custom-vehiclemainroad.svg +41 -41
  190. package/src/icons/svg/custom-west-bottom.svg +32 -32
  191. package/src/icons/svg/custom-west-top.svg +32 -32
  192. package/src/icons/svg/custom-xlped.svg +14 -14
  193. package/src/icons/svg/custom-xrped.svg +14 -14
  194. package/src/icons/svg/cutRed.svg +7 -7
  195. package/src/icons/svg/cycle.svg +0 -0
  196. package/src/icons/svg/dingzhouqi.svg +34 -34
  197. package/src/icons/svg/ganyingkongzhi.svg +30 -30
  198. package/src/icons/svg/guandeng.svg +81 -81
  199. package/src/icons/svg/huangshan.svg +71 -71
  200. package/src/icons/svg/maincontrol.svg +0 -0
  201. package/src/icons/svg/manualcontrolbackground.svg +51 -51
  202. package/src/icons/svg/manualcontrolbackground1.svg +62 -62
  203. package/src/icons/svg/manualcontrolbackgrounden.svg +62 -62
  204. package/src/icons/svg/model.svg +0 -0
  205. package/src/icons/svg/phasediff.svg +0 -0
  206. package/src/icons/svg/prioritycontrol.svg +21 -21
  207. package/src/icons/svg/quanhong.svg +86 -86
  208. package/src/icons/svg/shanghe.svg +11 -11
  209. package/src/icons/svg/shoudong.svg +103 -103
  210. package/src/icons/svg/tentativeplan.svg +28 -28
  211. package/src/icons/svg/time.svg +0 -0
  212. package/src/icons/svg/wuxianlan.svg +46 -46
  213. package/src/icons/svg/xiala.svg +11 -11
  214. package/src/icons/svg/xingrenguojie.svg +33 -33
  215. package/src/icons/svg/xitong.svg +89 -89
  216. package/src/icons/svg/youxian.svg +41 -41
  217. package/src/icons/svg/zizhukongzhi.svg +43 -43
  218. package/src/kisscomps/components/ChannelRealtimeIntersection/ChannelRealtimeIntersection.vue +123 -123
  219. package/src/kisscomps/components/Channelization/Channelization.vue +585 -585
  220. package/src/kisscomps/components/ChannelizationFlowStatistic/ChannelizationFlowStatistic.vue +360 -360
  221. package/src/kisscomps/components/ChannelizationWithInterface/ChannelizationWithInterface.vue +518 -518
  222. package/src/kisscomps/components/CommonKanban/CommonKanban.vue +132 -132
  223. package/src/kisscomps/components/DirectionListConfiguration/DirectionListConfiguration.vue +456 -456
  224. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-bottom.vue +41 -41
  225. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-east-top.vue +60 -60
  226. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-ewped.vue +105 -105
  227. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-left.vue +60 -60
  228. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-north-right.vue +60 -60
  229. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-snped.vue +105 -105
  230. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-left.vue +60 -60
  231. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-south-right.vue +60 -60
  232. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-bottom.vue +60 -60
  233. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-west-top.vue +60 -60
  234. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xlped.vue +30 -30
  235. package/src/kisscomps/components/DirectionListConfiguration/svg/ped-xrped.vue +30 -30
  236. package/src/kisscomps/components/DirectionListConfiguration/svg/pedSvg.vue +78 -78
  237. package/src/kisscomps/components/DrawChannelization/drawsvg/basicCoordInfo.vue +181 -181
  238. package/src/kisscomps/components/DrawChannelization/drawsvg/channelizationElements.vue +255 -255
  239. package/src/kisscomps/components/DrawChannelization/drawsvg/detectorAssociatedComponent.vue +152 -152
  240. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/TextBox.vue +91 -91
  241. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/crossMap.vue +194 -194
  242. package/src/kisscomps/components/DrawChannelization/drawsvg/drawElement/editText.vue +108 -108
  243. package/src/kisscomps/components/DrawChannelization/drawsvg/firstImportCrossmap.vue +51 -51
  244. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/countdownSvg.vue +236 -236
  245. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorChart.vue +247 -247
  246. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/detectorIconSvg.vue +210 -210
  247. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/laneIcon.vue +72 -72
  248. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/motorwayIconSvg.vue +368 -368
  249. package/src/kisscomps/components/DrawChannelization/drawsvg/iconSvg/pedroadIconSvg.vue +230 -230
  250. package/src/kisscomps/components/DrawChannelization/drawsvg/importDialog.vue +74 -74
  251. package/src/kisscomps/components/DrawChannelization/drawsvg/index.draw.vue +1022 -1022
  252. package/src/kisscomps/components/DrawChannelization/drawsvg/index.vue +144 -144
  253. package/src/kisscomps/components/DrawChannelization/drawsvg/laneEditPanel.vue +707 -707
  254. package/src/kisscomps/components/DrawChannelization/drawsvg/overlapAssociatedComponent.vue +172 -172
  255. package/src/kisscomps/components/DrawChannelization/drawsvg/phaseAssociatedComponent.vue +172 -172
  256. package/src/kisscomps/components/DrawChannelization/drawsvg/table.vue +99 -99
  257. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/loadutils.js +87 -87
  258. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phaseDataModel.js +32 -32
  259. package/src/kisscomps/components/DrawChannelization/drawsvg/utils/phasePos.json +20 -20
  260. package/src/kisscomps/components/DrawChannelization/phaseDataMgr.js +278 -278
  261. package/src/kisscomps/components/ExpendConfig/ExpendConfig.vue +118 -118
  262. package/src/kisscomps/components/FaultDetailModal/FaultDetailModal.vue +178 -178
  263. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CrossRoadsSvg.vue +629 -629
  264. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/CustomRoadsSvg.vue +46 -46
  265. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionEWSvg.vue +447 -447
  266. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/PedSectionSNSvg.vue +341 -341
  267. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampEastSvg.vue +497 -497
  268. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampNorthSvg.vue +353 -353
  269. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampSouthSvg.vue +359 -359
  270. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/RampWestSvg.vue +443 -443
  271. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkClickSvg.vue +1302 -1302
  272. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/SidewalkSvg.vue +1190 -1190
  273. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeEastRoadsSvg.vue +498 -498
  274. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeNorthRoadsSvg.vue +484 -484
  275. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeSouthRoadsSvg.vue +488 -488
  276. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/TShapeWestRoadsSvg.vue +566 -566
  277. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LCrossRoadsSvg.vue +640 -640
  278. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeEastRoadsSvg.vue +497 -497
  279. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeNorthRoadsSvg.vue +486 -486
  280. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeSouthRoadsSvg.vue +490 -490
  281. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/leftroad/LTShapeWestRoadsSvg.vue +575 -575
  282. package/src/kisscomps/components/IntersectionMap/crossDirection/baseImg/refreshSvg.vue +63 -63
  283. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/busMapSvg.vue +50 -50
  284. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/eastBusSvg.vue +167 -167
  285. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/northBusSvg.vue +168 -168
  286. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/southBusSvg.vue +168 -168
  287. package/src/kisscomps/components/IntersectionMap/crossDirection/busIcon/westBusSvg.vue +169 -169
  288. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/LphaseIconSvg.vue +197 -197
  289. package/src/kisscomps/components/IntersectionMap/crossDirection/phaseIcon/rampPhaseIconSvg.vue +122 -122
  290. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.json +196 -196
  291. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/busPos.left.json +196 -196
  292. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.json +131 -115
  293. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/phasePos.left.json +115 -115
  294. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/rampPos.json +52 -52
  295. package/src/kisscomps/components/IntersectionMap/crossDirection/posJson/sidePos.json +235 -219
  296. package/src/kisscomps/components/IntersectionMap/intersectionmap.vue +220 -220
  297. package/src/kisscomps/components/IntersectionWithInterface/IntersectionWithInterface.vue +534 -534
  298. package/src/kisscomps/components/KanBan/kanban.vue +231 -231
  299. package/src/kisscomps/components/MessageBox/index.vue +96 -96
  300. package/src/kisscomps/components/OverviewComponent/index.vue +827 -853
  301. package/src/kisscomps/components/PatternOptimize/PatternOptimize.vue +329 -329
  302. package/src/kisscomps/components/PatternWalkSvg/PatternWalkSvg.vue +423 -423
  303. package/src/kisscomps/components/PhaseDirectionSelect/PhaseDirectionSelect.vue +126 -126
  304. package/src/kisscomps/components/PhaseDirectionText/PhaseDirectionText.vue +106 -106
  305. package/src/kisscomps/components/PhaseLegend/PhaseLegend.vue +286 -286
  306. package/src/kisscomps/components/PhaseMarker/index.js +6 -6
  307. package/src/kisscomps/components/PhaseMarker/phasemarker.vue +215 -215
  308. package/src/kisscomps/components/PhaseMarker/svg/patternSvg.vue +121 -121
  309. package/src/kisscomps/components/PhaseMarker/svg/phase.vue +60 -60
  310. package/src/kisscomps/components/PhaseMarker/svg/phaseCount.vue +62 -62
  311. package/src/kisscomps/components/PhaseMarker/svg/phaseCountCycle.vue +62 -62
  312. package/src/kisscomps/components/PhaseMarker/svg/phaseSvg.vue +117 -117
  313. package/src/kisscomps/components/PhasePedSelect/index.vue +206 -206
  314. package/src/kisscomps/components/SchemeConfig/SchemeConfig.vue +7 -30
  315. package/src/kisscomps/components/SchemeConfig/azimuthlocking/index.vue +365 -365
  316. package/src/kisscomps/components/SchemeConfig/azimuthlocking/utils.js +92 -92
  317. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +214 -214
  318. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +235 -235
  319. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +235 -235
  320. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/controlModelGroup.vue +131 -131
  321. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/index.vue +871 -871
  322. package/src/kisscomps/components/SchemeConfig/manualControlModalNew/othersIcon.vue +151 -151
  323. package/src/kisscomps/components/SchemeConfig/priorityControl/index.vue +215 -215
  324. package/src/kisscomps/components/SchemeConfig/priorityControl/utils.js +163 -163
  325. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +308 -308
  326. package/src/kisscomps/components/SchemeConfig/tentativeplancontrolmodal/index.vue +0 -19
  327. package/src/kisscomps/components/SchemeConfig/utils/thirdPartypermission.js +95 -95
  328. package/src/kisscomps/components/SelectCrossPhase/index.vue +418 -418
  329. package/src/kisscomps/components/SelectCrossPhase/utils.js +142 -142
  330. package/src/kisscomps/components/StageOptimize/StageOptimize.vue +367 -367
  331. package/src/kisscomps/components/StageOptimize/index.js +2 -2
  332. package/src/kisscomps/components/StageStatus/StageStatus.vue +341 -341
  333. package/src/kisscomps/components/SvgIcon/SvgIcon.vue +53 -53
  334. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +1041 -1041
  335. package/src/kisscomps/components/XiaoKanban/DirSelector.vue +356 -356
  336. package/src/kisscomps/components/XiaoKanban/index.vue +122 -122
  337. package/src/kisscomps/components/overView/index.vue +653 -676
  338. package/src/kisscomps/components/patternConfig/pattern/planChart/model/coordinationModel.js +665 -665
  339. package/src/kisscomps/components/patternConfig/planContent.vue +604 -604
  340. package/src/kisscomps/components/patternConfig/planMenu.vue +329 -329
  341. package/src/kisscomps/components/patternConfig/utils.js +152 -152
  342. package/src/lib/publicjs/ArryListUtil.js +38 -38
  343. package/src/lib/publicjs/HttpurlMgr.js +45 -45
  344. package/src/lib/publicjs/KissApi.js +158 -158
  345. package/src/lib/publicjs/KissWSSub/Heartcheck.js +128 -128
  346. package/src/lib/publicjs/KissWSSub/KissWsSub.js +91 -91
  347. package/src/lib/publicjs/KissWSSub/KissWsSubByType.js +152 -152
  348. package/src/lib/publicjs/KissWSSub/SimuWsSubByType.js +44 -44
  349. package/src/lib/publicjs/KissWSSub/Sub.js +51 -51
  350. package/src/lib/publicjs/KissWSSub/SubChannel.js +119 -119
  351. package/src/lib/publicjs/basecomponents.js +65 -65
  352. package/src/lib/publicjs/localStorage.js +112 -112
  353. package/src/lib/publicjs/objdeepcopy.js +32 -32
  354. package/src/lib/publicjs/pageScroll.js +30 -30
  355. package/src/lib/publicjs/passwdAssest.js +101 -101
  356. package/src/lib/publicjs/styleclassfactory.js +32 -32
  357. package/src/router/index.js +63 -63
  358. package/src/store/index.js +26 -26
  359. package/src/store/modules/globalParam.js +67 -67
  360. package/src/utils/ControlFormat.js +46 -68
  361. package/src/utils/RingDataModel.js +335 -335
  362. package/src/utils/conflictList.js +87 -87
  363. package/src/utils/dateFormat.js +41 -41
  364. package/src/utils/fault.js +144 -196
  365. package/src/utils/faultcode.js +173 -225
  366. package/src/utils/index.js +69 -69
  367. package/src/utils/pedphasedesc.js +119 -119
  368. package/src/utils/phaseList.js +203 -203
  369. package/src/utils/phasedesc.js +144 -144
  370. package/src/utils/responseMessage.js +3 -0
  371. package/src/utils/validate.js +43 -43
  372. package/src/views/customchannelization.vue +49 -49
  373. package/src/views/home.1.vue +479 -479
  374. package/src/views/home.vue +93 -93
  375. package/src/views/intersection2.vue +328 -328
  376. package/src/views/overView.vue +63 -63
  377. package/static/styles/channelizatioon.scss +433 -433
  378. package/static/styles/common.scss +30 -30
  379. package/static/styles/commonkanban.scss +168 -168
  380. package/static/styles/dark/index.scss +2 -2
  381. package/static/styles/dark/theme/element-dark.scss +44 -44
  382. package/static/styles/index.scss +84 -84
  383. package/static/styles/intersection.scss +180 -180
  384. package/static/styles/light/index.scss +2 -2
  385. package/static/styles/light/theme/element-light.scss +44 -44
  386. package/static/styles/overview.scss +146 -146
  387. package/static/styles/patternConfig.scss +56 -56
  388. package/static/styles/phasePedSelect.scss +71 -71
  389. package/static/styles/stages.scss +57 -57
  390. package/static/styles/uiComponents.scss +57 -57
  391. package/static/styles/xiaokanban.scss +61 -61
  392. package/static/token.json +2 -2
  393. package/test/e2e/custom-assertions/elementCount.js +27 -27
  394. package/test/e2e/nightwatch.conf.js +46 -46
  395. package/test/e2e/runner.js +48 -48
  396. package/test/e2e/specs/test.js +19 -19
  397. package/test/unit/.eslintrc +7 -7
  398. package/test/unit/jest.conf.js +30 -30
  399. package/test/unit/setup.js +3 -3
  400. package/test/unit/specs/HelloWorld.spec.js +11 -11
  401. package/package/kissui.js +0 -216608
  402. package/pnpm-lock.yaml +0 -16362
@@ -1,1022 +1,1022 @@
1
- /**
2
- * Copyright (c) 2020 kedacom
3
- * OpenATC is licensed under Mulan PSL v2.
4
- * You can use this software according to the terms and conditions of the Mulan PSL v2.
5
- * You may obtain a copy of Mulan PSL v2 at:
6
- * http://license.coscl.org.cn/MulanPSL2
7
- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
- * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
- * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
- * See the Mulan PSL v2 for more details.
11
- **/
12
- <!--渠化绘制功能-->
13
- <template>
14
- <div class="custom-cross" v-if="visible">
15
- <ImportDialog ref="importDialog" @loadSvgString="loadSvgString" @loadMapSize="loadMapSize" />
16
- <Messagebox :visible="canclesettingvisible" :text="$t('openatccomponents.channelizationmap.canclesetting')" @cancle="cancleSetting" @ok="completeSetting"/>
17
- <div class="custom-main" ref="custommain">
18
- <div class="custom-group drawPanelAnimation" ref="customGroup">
19
- <!-- 绘制功能 -->
20
- <div class="draw-function">
21
- <div class="again-import">
22
- <span class="import-label">{{$t('openatccomponents.channelizationmap.importcrosspicture')}}</span>
23
- <el-button
24
- class="again-import-btn"
25
- type="primary"
26
- :disabled="!isSeletable"
27
- @click="clickOpen"
28
- >{{$t('openatccomponents.channelizationmap.againimport')}}</el-button>
29
- <i class="lock-map el-icon-unlock" v-if="!isLockedCrossMap" @click="handleLockCrossMap()"></i>
30
- <i class="lock-map el-icon-lock" v-if="isLockedCrossMap" @click="handleLockCrossMap()"></i>
31
- </div>
32
-
33
- <div class="draw-to-sketchpad">
34
- <div class="drawtip">{{$t('openatccomponents.channelizationmap.drawtips')}}</div>
35
- <div class="draw-operation">
36
- <!-- <el-button
37
- type="primary"
38
- :disabled="!isSeletable"
39
- @click="addText"
40
- >添加text</el-button>-->
41
- <el-button
42
- v-for="editbtn in editBtnGroup"
43
- :key="editbtn.type"
44
- class="edit-icon-btn"
45
- @click="handleAddIcon(editbtn)"
46
- >
47
- <LaneIconSvg :laneicon="editbtn"/>
48
- <div
49
- class="btn-label"
50
- :class="{'highlightColor': editbtn.active === true, 'defaultColor': editbtn.active === false}"
51
- >{{editbtn.label}}</div>
52
- </el-button>
53
- </div>
54
- </div>
55
- </div>
56
- <!-- 画板区域 -->
57
- <div class="sketchpad-area" id="sketchpadgroup" ref="sketchpadgroup">
58
- <ChannelizationElements
59
- id="channelizationElements"
60
- :allitem="allitem"
61
- :CrossMapVisible="CrossMapVisible"
62
- :CrossMapData="CrossMapData"
63
- :isSeletable="isSeletable"
64
- :pointchange="pointchange"
65
- @changeCrossMap="changeCrossMap"
66
- :Motorways="Motorways"
67
- :curChooseIconIndex="curChooseIconIndex"
68
- @changeMotorwayItem="changeMotorwayItem"
69
- @handleSelectIcon="handleSelectIcon"
70
- :Countdown="Countdown"
71
- :CountdownList="phaseCountdownMock"
72
- @changeTimeItem="changeTimeItem"
73
- :Pedwalk="Pedwalk"
74
- @changePedItem="changePedItem"
75
- :Detector="Detector"
76
- @changeDetectorItem="changeDetectorItem"
77
- :DetectorChart="DetectorChart"
78
- :CurChooseIcon="curChooseIcon"
79
- @changeDetectorChartItem="changeDetectorChartItem"
80
- :isLockedCrossMap="isLockedCrossMap"
81
- />
82
- </div>
83
- <div class="draw-end-function">
84
- <el-button type="primary" @click="handleReset()">{{$t('openatccomponents.button.reset')}}</el-button>
85
- <!-- <el-button type="primary" @click="cancledraw()">{{$t('openatccomponents.button.Cancel')}}</el-button> -->
86
- <el-button type="primary" @click="savedraw()">{{$t('openatccomponents.button.save')}}</el-button>
87
- <el-button type="primary" @click="importFromFile()">{{$t('openatccomponents.main.import')}}</el-button>
88
- <el-button type="primary" @click="exportToFile()">{{$t('openatccomponents.main.export')}}</el-button>
89
- </div>
90
- </div>
91
- <div class="custom-edit" ref="customEdit">
92
- <LaneEditPanel
93
- :Data="curChooseIcon"
94
- :choosedirections="curChooseIcon.direction"
95
- :Motorways="Motorways"
96
- @handleChooseDire="handleChooseDire"
97
- @handleChoosePed="handleChoosePed"
98
- @deleteItem="deleteItem"
99
- @cloneItem="cloneItem"
100
- @changeIconDataByType="changeIconDataByType"
101
- @handleDisassociatePhase="handleDisassociatePhase"
102
- />
103
- </div>
104
- </div>
105
- <!-- <el-row>
106
- <div class="phase-table">
107
- <PhaseTable
108
- :customlist="customlist"
109
- @changeText="changeText"
110
- @deleteItem="deleteItem"
111
- @changeMotorwayItem="changeMotorwayItem"
112
- @changeIconDataByType="changeIconDataByType"
113
- />
114
- </div>
115
- </el-row> -->
116
- <!-- 从文件导入弹窗 -->
117
- <el-dialog
118
- :title="$t('openatccomponents.main.tip')"
119
- :visible.sync="dialogVisible"
120
- width="30%"
121
- >
122
- <input
123
- type="file"
124
- id="file"
125
- />
126
- <span
127
- slot="footer"
128
- class="dialog-footer"
129
- >
130
- <el-button @click="dialogVisible = false">{{$t('openatccomponents.common.cancel')}}</el-button>
131
- <el-button
132
- type="primary"
133
- @click="readAsText"
134
- >{{$t('openatccomponents.common.confirm')}}</el-button>
135
- </span>
136
- </el-dialog>
137
- </div>
138
- </template>
139
-
140
- <script>
141
- import ChannelizationElements from './channelizationElements'
142
-
143
- import LaneEditPanel from './laneEditPanel'
144
-
145
- import PhaseTable from './table'
146
- import PhaseDataModel from './utils/phaseDataModel.js'
147
- import LaneIconSvg from './iconSvg/laneIcon'
148
-
149
- import ImportDialog from './importDialog'
150
- import Messagebox from '../../MessageBox/index'
151
-
152
- import { mapState } from 'vuex'
153
-
154
- import { saveChannelizatonChart } from '../../../../api/cross'
155
- import { getMessageByCode } from '../../../../utils/responseMessage.js'
156
-
157
- import axios from 'axios'
158
-
159
- export default {
160
- name: 'draw-channelization',
161
- components: {
162
- Messagebox,
163
- ImportDialog,
164
- ChannelizationElements,
165
- PhaseTable,
166
- LaneIconSvg,
167
- LaneEditPanel
168
- },
169
- computed: {
170
- ...mapState({
171
- phaseList: state => state.globalParam.tscParam.phaseList
172
- })
173
- },
174
- props: {
175
- loadedChannelizatonData: {
176
- type: Object
177
- },
178
- AgentId: {
179
- type: String,
180
- default: '0'
181
- }
182
- },
183
- watch: {
184
- AgentId: {
185
- handler: function (val) {
186
- // 平台设备切换时,清空上一个渠化配置
187
- this.handleReset()
188
- },
189
- deep: true
190
- },
191
- loadedChannelizatonData: {
192
- handler: function (val) {
193
- // 平台设备切换时,重载当前路口保存的渠化配置
194
- this.LoadedChannelizatonData = JSON.parse(JSON.stringify(val))
195
- this.load('all')
196
- },
197
- deep: true
198
- }
199
- },
200
- data () {
201
- return {
202
- visible: true,
203
- canclesettingvisible: false,
204
-
205
- isSeletable: true, // 元素是否可以编辑
206
- index: 0,
207
- motorid: 1, // 车道id
208
- pedid: 1, // 人行道id
209
- detectorcoilid: 1, // 检测器线圈id(非关联检测器id)
210
- Motorways: [], // 管理所有自定义机动车图标数据
211
- customlist: [], // 所有自定义的图标列表
212
- Texts: [], // 管理所有自定义文字数据
213
- Pedwalk: [], // 管理所有人行横道
214
- Detector: [], // 管理所有检测器
215
- DetectorChart: [], // 管理所有检测器统计图
216
- motorwayicon: '',
217
- IconLengh: 33,
218
- IconWdith: 109,
219
- textareaW: 200,
220
- textareaH: 100,
221
- pedW: 206,
222
- pedH: 22,
223
- MapW: 800,
224
- MapH: 200,
225
- detectorW: 20,
226
- detectorH: 20,
227
- detectorchartW: 70,
228
- detectorchartH: 100,
229
- isLockedCrossMap: true, // 底图是否是锁定状态
230
- CrossMapData: {
231
- index: -2,
232
- icontype: 'crossmap',
233
- x: 400,
234
- y: 100,
235
- w: 800,
236
- h: 200,
237
- angle: 0,
238
- svgstr: '',
239
- imgfilesrc: ''
240
- }, // 管理底图数据
241
- allitem: {
242
- x: 435,
243
- y: 325,
244
- w: 870,
245
- h: 650,
246
- angle: 0
247
- },
248
- countdownW: 140,
249
- countdownH: 140,
250
- Countdown: [], // 管理倒计时图标
251
- phaseCountdownMock: [
252
- {
253
- id: 2,
254
- phaseCountdown: 59,
255
- phaseCountdownColor: '#fff'
256
- },
257
- {
258
- id: 5,
259
- phaseCountdown: 32,
260
- phaseCountdownColor: '#fff'
261
- }
262
- ], // 倒计时动态数据模拟
263
- svgvisible: false,
264
- pointchange: false, // 控制选中时光标样式
265
- CrossMapVisible: true, // 控制底图显示隐藏
266
-
267
- curChooseIconIndex: -1, // 底图暂用-2代替,别的图标与递增的index相关
268
- curChooseIcon: {},
269
- editBtnGroup: [
270
- {
271
- label: this.$t('openatccomponents.channelizationmap.motorway'),
272
- type: 'motorway',
273
- active: false,
274
- width: '16px',
275
- height: '16px'
276
- },
277
- {
278
- label: this.$t('openatccomponents.channelizationmap.pedcrossing'),
279
- type: 'pedcrossing',
280
- active: false,
281
- width: '16px',
282
- height: '16px'
283
- },
284
- {
285
- label: this.$t('openatccomponents.channelizationmap.countdown'),
286
- type: 'countdown',
287
- active: false,
288
- width: '16px',
289
- height: '16px'
290
- },
291
- {
292
- label: this.$t('openatccomponents.channelizationmap.detector'),
293
- type: 'detector',
294
- active: false,
295
- width: '16px',
296
- height: '16px'
297
- }
298
- ],
299
- AddType: '', // 正在添加的图标类型
300
-
301
- dirNameMap: new Map([
302
- [1, '直行'],
303
- [2, '左转'],
304
- [3, '右转'],
305
- [4, '掉头']
306
- ]),
307
- phaseAssociatedMap: new Map(), // 关联相位Map: key 是相位ID, value 是车道数据包含direction
308
- dialogVisible: false,
309
- LoadedChannelizatonData: {} // 从接口获取到的渠化参数,用于作为加载数据,从文件导入可修改
310
- }
311
- },
312
- methods: {
313
- clickOpen () {
314
- this.$refs.importDialog.clickOpen()
315
- },
316
-
317
- // 改变鼠标样式
318
- changeMouse () {
319
- if (!this.isSeletable) return
320
- document.getElementById('sketchpadArea').style.cursor =
321
- 'url(resource/pic/icons/magnifier3.cur) 12 12,pointer'
322
- this.pointchange = true
323
- },
324
-
325
- // 根据类型,表格编辑后,修改数据策略
326
- changeIconDataByType (iconObj, changefield) {
327
- this.curChooseIcon = JSON.parse(JSON.stringify(iconObj))
328
- // 根据数据类型改变数据
329
- switch (iconObj.icontype) {
330
- case 'text':
331
- this.changeText(iconObj, changefield)
332
- break
333
- case 'vehile':
334
- this.changeMotorwayItem(iconObj, changefield)
335
- break
336
- case 'ped':
337
- this.changePedItem(iconObj, changefield)
338
- break
339
- case 'countdown':
340
- this.changeTimeItem(iconObj, changefield)
341
- break
342
- case 'detector':
343
- this.changeDetectorItem(iconObj, changefield)
344
- break
345
- case 'crossmap':
346
- this.changeCrossMap(iconObj, changefield)
347
- }
348
- // console.log('this.customlist', this.customlist)
349
- },
350
-
351
- // 被删除的相位所关联的车道,解除相位关联
352
- handleDisassociatePhase (deletePhaseid) {
353
- for (let i = 0; i < this.Motorways.length; i++) {
354
- if (this.Motorways[i].phaseid === deletePhaseid) {
355
- this.Motorways[i].phaseid = undefined
356
- this.Motorways[i].phaselabel = ''
357
- this.Motorways[i].phasetype = undefined
358
- }
359
- }
360
- for (let i = 0; i < this.Pedwalk.length; i++) {
361
- if (this.Pedwalk[i].phaseid === deletePhaseid) {
362
- this.Pedwalk[i].phaseid = undefined
363
- this.Pedwalk[i].phaselabel = ''
364
- this.Pedwalk[i].phasetype = undefined
365
- }
366
- }
367
- },
368
-
369
- // 添加不同类型的车道图标
370
- handleAddIcon (editbtn) {
371
- // 按钮及图标高亮效果实现
372
- this.editBtnGroup = this.editBtnGroup.map(btn => {
373
- btn.active = false
374
- return btn
375
- })
376
- for (let i = 0; i < this.editBtnGroup.length; i++) {
377
- if (this.editBtnGroup[i].type === editbtn.type) {
378
- this.editBtnGroup[i].active = true
379
- }
380
- }
381
- this.changeMouse()
382
- this.AddType = editbtn.type
383
- },
384
-
385
- addMotorwayIcon () {
386
- this.PhaseDataModel = new PhaseDataModel()
387
- let defaultMotorwayParam = {
388
- x: this.setLeft,
389
- y: this.setTop,
390
- w: this.IconLengh,
391
- h: this.IconWdith,
392
- angle: 0
393
- }
394
- this.IconLengh = 33
395
- this.IconWdith = 109
396
- let Motorwaysitem = {
397
- index: this.index,
398
- id: this.motorid,
399
- keyid: this.motorid, // 后端需要的id,默认指取索引,可修改
400
- laneid: undefined, // 全息需要车道id
401
- icontype: 'vehile',
402
- icondireid: [1], // 前端区分箭头方向的标识
403
- icondirename: [this.PhaseDataModel.getPhase(1).name],
404
- lanePosition: 1,
405
- controltype: 0,
406
- phasetype: undefined,
407
- phaseid: undefined,
408
- phaselabel: '',
409
- direction: [], // 值为1-16,对应16个方向
410
- flip: false, // 车道类型是否翻转显示
411
- ...defaultMotorwayParam
412
- }
413
- this.curChooseIconIndex = Motorwaysitem.index
414
- this.curChooseIcon = JSON.parse(JSON.stringify(Motorwaysitem))
415
- this.Motorways.push(Motorwaysitem)
416
- this.customlist.push(Motorwaysitem)
417
- this.index = this.increaseId(this.customlist, 'index')
418
- this.motorid = this.increaseId(this.Motorways, 'id')
419
- },
420
- changeMotorwayItem (MotorwayItem, fields) {
421
- this.changeItem(MotorwayItem, fields, this.Motorways)
422
- this.changeCustomItem(MotorwayItem, fields)
423
- },
424
-
425
- // 选中图标
426
- handleSelectIcon (iconobj, isCrossMap) {
427
- // console.log('选中的图标', iconobj)
428
- if (isCrossMap === 'crossmap') {
429
- this.curChooseIconIndex = -2
430
- } else {
431
- this.curChooseIconIndex = iconobj.index
432
- }
433
- this.curChooseIcon = JSON.parse(JSON.stringify(iconobj))
434
- },
435
- // 根据多选的车道,修改车道图标
436
- handleChooseDire (iconObj) {
437
- this.curChooseIcon = JSON.parse(JSON.stringify(iconObj))
438
- let editDirections = iconObj.icondireid
439
- if (
440
- this.curChooseIcon.icontype === 'vehile'
441
- ) {
442
- this.curChooseIcon.icondireid = editDirections
443
- this.curChooseIcon.icondirename = editDirections.map(dir =>
444
- this.dirNameMap.get(dir)
445
- )
446
- this.changeMotorwayItem(this.curChooseIcon, [
447
- 'icondireid',
448
- 'icondirename'
449
- ])
450
- }
451
- },
452
-
453
- addPedwalkIcon () {
454
- let defaulPedParam = {
455
- x: this.setLeft,
456
- y: this.setTop,
457
- w: this.pedW,
458
- h: this.pedH,
459
- angle: 0,
460
- viewbox: [0, 0, 206, 22]
461
- }
462
- this.pedW = 206
463
- this.pedH = 22
464
- let peditem = {
465
- index: this.index,
466
- id: this.pedid,
467
- keyid: this.pedid, // 后端需要的id,默认指取索引,可修改
468
- icontype: 'ped',
469
- iconpedtypeid: 1,
470
- iconpedposition: 1,
471
- phasetype: undefined,
472
- phaseid: undefined,
473
- phaselabel: '',
474
- ...defaulPedParam
475
- }
476
- this.curChooseIconIndex = peditem.index
477
- this.curChooseIcon = JSON.parse(JSON.stringify(peditem))
478
- this.Pedwalk.push(peditem)
479
- this.customlist.push(peditem)
480
- this.index = this.increaseId(this.customlist, 'index')
481
- this.pedid = this.increaseId(this.Pedwalk, 'id')
482
- },
483
- changePedItem (PedItem, fields) {
484
- this.changeItem(PedItem, fields, this.Pedwalk)
485
- this.changeCustomItem(PedItem, fields)
486
- },
487
-
488
- handleChoosePed (pediconobj) {
489
- this.curChooseIcon = JSON.parse(JSON.stringify(pediconobj))
490
- if (this.curChooseIcon.icontype === 'ped') {
491
- this.curChooseIcon.iconpedtypeid = pediconobj.iconpedtypeid
492
- this.curChooseIcon.iconpedposition = pediconobj.iconpedposition
493
- this.changePedItem(this.curChooseIcon, ['iconpedtypeid', 'iconpedposition'])
494
- }
495
- console.log(this.curChooseIcon)
496
- },
497
-
498
- addTimer () {
499
- let defaultCountParam = {
500
- x: this.setLeft,
501
- y: this.setTop,
502
- w: this.countdownW,
503
- h: this.countdownH,
504
- angle: 0
505
- }
506
- this.countdownW = 140
507
- this.countdownH = 140
508
- let countdownitem = {
509
- index: this.index,
510
- icontype: 'countdown',
511
- ...defaultCountParam
512
- }
513
- this.curChooseIconIndex = countdownitem.index
514
- this.curChooseIcon = JSON.parse(JSON.stringify(countdownitem))
515
- this.Countdown.push(countdownitem)
516
- this.customlist.push(countdownitem)
517
- this.index = this.increaseId(this.customlist, 'index')
518
- },
519
- changeTimeItem (timeItem, fields) {
520
- this.changeItem(timeItem, fields, this.Countdown)
521
- this.changeCustomItem(timeItem, fields)
522
- },
523
-
524
- addAllDetector () {
525
- // 统计图暂留
526
- this.addDetector()
527
- // this.addDetectorChart()
528
- this.detectorcoilid = this.increaseId(this.Detector, 'id')
529
- },
530
- addDetector () {
531
- let defaultDetectorParam = {
532
- x: this.setLeft,
533
- y: this.setTop,
534
- w: this.detectorW,
535
- h: this.detectorH,
536
- angle: 0
537
- }
538
- this.detectorW = 20
539
- this.detectorH = 20
540
- let detectoritem = {
541
- index: this.index,
542
- id: this.detectorcoilid,
543
- icontype: 'detector',
544
- detailtype: 'detector',
545
- detectortype: 1, // 检测器类型: 1 车辆检测器 2 行人检测器
546
- detectorid: undefined,
547
- occupancythreshold: 80,
548
- minflowsaturationthreshold: 30,
549
- maxflowsaturationthreshold: 70,
550
- associatedlaneid: '', // 检测器关联的车道索引
551
- ...defaultDetectorParam
552
- }
553
- this.curChooseIconIndex = detectoritem.index
554
- this.curChooseIcon = JSON.parse(JSON.stringify(detectoritem))
555
- this.Detector.push(detectoritem)
556
- this.customlist.push(detectoritem)
557
- this.index = this.increaseId(this.customlist, 'index')
558
- },
559
- changeDetectorItem (detectorItem, fields) {
560
- this.changeItem(detectorItem, fields, this.Detector)
561
- this.changeCustomItem(detectorItem, fields)
562
- },
563
- addDetectorChart () {
564
- let defaultDetectorParam = {
565
- x: this.setLeft,
566
- y: this.setTop - 100, // 偏移到检测器正上方150
567
- w: this.detectorchartW,
568
- h: this.detectorchartH,
569
- angle: 0
570
- }
571
- this.detectorchartW = 70
572
- this.detectorchartH = 100
573
- let detectoritem = {
574
- index: this.index,
575
- id: this.detectorcoilid,
576
- icontype: 'detector',
577
- detailtype: 'detectorChart',
578
- ...defaultDetectorParam
579
- }
580
- this.curChooseIconIndex = detectoritem.index
581
- this.curChooseIcon = JSON.parse(JSON.stringify(detectoritem))
582
- this.DetectorChart.push(detectoritem)
583
- this.customlist.push(detectoritem)
584
- this.index = this.increaseId(this.customlist, 'index')
585
- },
586
- changeDetectorChartItem (detectorItem, fields) {
587
- this.changeItem(detectorItem, fields, this.DetectorChart)
588
- this.changeCustomItem(detectorItem, fields)
589
- },
590
-
591
- // 添加文字
592
- addText () {
593
- let defaultTextParam = {
594
- x: this.textareaW / 2,
595
- y: this.textareaH / 2,
596
- w: this.textareaW,
597
- h: this.textareaH,
598
- angle: 0
599
- }
600
- this.textareaW = 200
601
- this.textareaH = 100
602
- let textitem = {
603
- index: this.index,
604
- icontype: 'text',
605
- text: '',
606
- ...defaultTextParam
607
- }
608
- this.Texts.push(textitem)
609
- this.customlist.push(textitem)
610
- this.index = this.increaseId(this.customlist, 'index')
611
- },
612
- changeText (textobj, fields) {
613
- this.changeItem(textobj, fields, this.Texts)
614
- this.changeCustomItem(textobj, fields)
615
- },
616
-
617
- changeCustomItem (row, fields) {
618
- this.changeItem(row, fields, this.customlist)
619
- },
620
- changeItem (row, fieldarr, data) {
621
- for (let item of data) {
622
- if (item.index === row.index) {
623
- for (let field of fieldarr) {
624
- item[field] = row[field]
625
- }
626
- }
627
- }
628
- },
629
- deleteItem (row) {
630
- let index = row.index
631
- // let id = row.id
632
- this.customlist = this.customlist.filter(ele => ele.index !== index)
633
- switch (row.icontype) {
634
- // case 'text':
635
- // this.Texts = this.Texts.filter(ele => ele.index !== index)
636
- // break
637
- case 'vehile':
638
- this.Motorways = this.Motorways.filter(ele => ele.index !== index)
639
- this.motorid = this.increaseId(this.Motorways, 'id')
640
- this.deleteLaneAssociatedDetector(row.id)
641
- break
642
- case 'ped':
643
- this.Pedwalk = this.Pedwalk.filter(ele => ele.index !== index)
644
- this.pedid = this.increaseId(this.Pedwalk, 'id')
645
- break
646
- case 'countdown':
647
- this.Countdown = this.Countdown.filter(ele => ele.index !== index)
648
- break
649
- case 'detector':
650
- this.Detector = this.Detector.filter(ele => ele.index !== index)
651
- // this.DetectorChart = this.DetectorChart.filter(ele => ele.id !== id)
652
- this.detectorcoilid = this.increaseId(this.Detector, 'id')
653
- }
654
- this.curChooseIconIndex = -1
655
- this.curChooseIcon = {}
656
- },
657
- deleteLaneAssociatedDetector (dellaneid) {
658
- // 删除关联车道的检测器的历史关联关系
659
- for (let i = 0; i < this.Detector.length; i++) {
660
- let curDetc = this.Detector[i]
661
- if (curDetc.associatedlaneid === dellaneid) {
662
- curDetc.associatedlaneid = undefined
663
- }
664
- }
665
- },
666
- cloneItem (row) {
667
- // 克隆元素
668
- let cloneObj = {
669
- ...row,
670
- index: this.index,
671
- x: 435,
672
- y: 325
673
- }
674
- switch (row.icontype) {
675
- case 'vehile':
676
- cloneObj.id = this.motorid
677
- this.Motorways.push(cloneObj)
678
- this.motorid = this.increaseId(this.Motorways, 'id')
679
- this.customlist.push(cloneObj)
680
- break
681
- case 'ped':
682
- cloneObj.id = this.pedid
683
- this.Pedwalk.push(cloneObj)
684
- this.pedid = this.increaseId(this.Pedwalk, 'id')
685
- this.customlist.push(cloneObj)
686
- break
687
- // case 'countdown':
688
- // this.Countdown.push(cloneObj)
689
- // this.customlist.push(cloneObj)
690
- // break
691
- case 'detector':
692
- cloneObj.id = this.detectorcoilid
693
- this.Detector.push(cloneObj)
694
- this.customlist.push(cloneObj)
695
- // 同时克隆统计图
696
- // this.index = this.increaseId(this.customlist, 'index')
697
- // let curchartobj = JSON.parse(JSON.stringify(this.DetectorChart)).filter(ele => ele.id === row.id)[0]
698
- // curchartobj.index = this.index
699
- // curchartobj.id = this.detectorcoilid
700
- // curchartobj.x = 435
701
- // curchartobj.y = 325 - 100
702
- // this.DetectorChart.push(curchartobj)
703
- // this.customlist.push(curchartobj)
704
- this.detectorcoilid = this.increaseId(this.Detector, 'id')
705
- }
706
- this.curChooseIconIndex = this.index
707
- this.curChooseIcon = JSON.parse(JSON.stringify(cloneObj))
708
- this.index = this.increaseId(this.customlist, 'index')
709
- },
710
-
711
- loadSvgString (type, imgstr) {
712
- // 加载用户上传的底图svg字符串
713
- if (type === 'vectorgraph') {
714
- // 导入矢量图
715
- // this.getCrossMapViewbox(imgstr)
716
- this.CrossMapData = {
717
- ...this.CrossMapData,
718
- type,
719
- svgstr: imgstr
720
- }
721
- }
722
- if (type === 'picture') {
723
- // 导入图片
724
- this.CrossMapData = {
725
- ...this.CrossMapData,
726
- type,
727
- imgfilesrc: imgstr
728
- }
729
- }
730
- },
731
- loadMapSize (type, mapsize) {
732
- this.CrossMapData = {
733
- ...this.CrossMapData,
734
- angle: 0,
735
- x: Math.round(mapsize.width / 2),
736
- y: Math.round(mapsize.height / 2),
737
- w: Math.round(mapsize.width),
738
- h: Math.round(mapsize.height)
739
- }
740
- this.MapW = mapsize.width
741
- this.MapH = mapsize.height
742
- },
743
-
744
- getCrossMapViewbox (svgstr) {
745
- // 获取户上传svg的viewBox属性的大小
746
- let arr = svgstr.split('"')
747
- let index, viewBox
748
- for (let i = 0; i < arr.length - 1; i++) {
749
- if (arr[i].indexOf('viewBox') !== -1) {
750
- index = i
751
- }
752
- }
753
- if (index) {
754
- viewBox = arr[index + 1]
755
- }
756
- this.MapW = Number(viewBox.split(' ')[2])
757
- this.MapH = Number(viewBox.split(' ')[3])
758
- },
759
- changeCrossMap (mapdata, fields) {
760
- this.changeItem(mapdata, fields, [this.CrossMapData])
761
- },
762
-
763
- // 重置
764
- handleReset () {
765
- this.customlist = []
766
- this.Texts = []
767
- this.Motorways = []
768
- this.Countdown = []
769
- this.Pedwalk = []
770
- this.Detector = []
771
- this.DetectorChart = []
772
- // this.CrossMapData = {
773
- // index: -2, // 暂定为-2,用于复用图标判断逻辑
774
- // icontype: 'crossmap',
775
- // x: this.MapW / 2,
776
- // y: this.MapH / 2,
777
- // w: this.MapW,
778
- // h: this.MapH,
779
- // angle: 0,
780
- // svgstr: '',
781
- // imgfilesrc: ''
782
- // }
783
- this.index = 0
784
- this.curChooseIcon = {}
785
- axios.get('./img/CrossRoadsSvg.svg').then((val) => {
786
- if (!val.data || val.data === '') return
787
- this.CrossMapData = {
788
- index: -2,
789
- icontype: 'crossmap',
790
- x: 435,
791
- y: 325,
792
- w: 870,
793
- h: 650,
794
- angle: 0,
795
- imgfilesrc: '',
796
- svgstr: val.data,
797
- type: 'vectorgraph'
798
- }
799
- })
800
- },
801
- // 取消
802
- cancledraw () {
803
- this.canclesettingvisible = true
804
- },
805
- completeSetting () {
806
- this.canclesettingvisible = false
807
- this.$router.push('/overview/index')
808
- },
809
- cancleSetting () {
810
- this.canclesettingvisible = false
811
- },
812
- handleSaveParams () {
813
- let temp = {}
814
- console.log(this.customlist)
815
- for (const item of this.customlist) {
816
- if (temp.hasOwnProperty(item.icontype)) {
817
- temp[item.icontype].push(item)
818
- } else {
819
- temp[item.icontype] = [item]
820
- }
821
- }
822
- if (this.CrossMapData.svgstr !== '' || this.CrossMapData.imgfilesrc !== '') {
823
- temp.crossMap = this.CrossMapData
824
- }
825
- return temp
826
- },
827
- // 保存
828
- savedraw () {
829
- let temp = {}
830
- temp = this.handleSaveParams()
831
- this.saveChannelizatonChart(temp)
832
- },
833
- // 加载
834
- load (type) {
835
- this.curChooseIconIndex = -1
836
- let savedTemp = JSON.parse(JSON.stringify(this.LoadedChannelizatonData))
837
- let arr = []
838
- for (const [key, value] of Object.entries(savedTemp)) {
839
- if (key === 'vehile') {
840
- this.Motorways = value
841
- }
842
- if (key === 'text') {
843
- this.Texts = value
844
- }
845
- if (key === 'ped') {
846
- this.Pedwalk = value
847
- }
848
- if (key === 'countdown') {
849
- this.Countdown = value
850
- }
851
- if (key === 'detector') {
852
- this.Detector = value.filter(ele => ele.detailtype === 'detector')
853
- // this.DetectorChart = value.filter(ele => ele.detailtype === 'detectorChart')
854
- }
855
- if (key === 'crossMap') {
856
- this.CrossMapData = JSON.parse(JSON.stringify(value))
857
- if (value.icontype === undefined) {
858
- this.CrossMapData.icontype = 'crossmap'
859
- }
860
- } else {
861
- if (value.length > 1) {
862
- arr = [...arr, ...value]
863
- } else {
864
- arr.push(value[0])
865
- }
866
- }
867
- }
868
- this.customlist = JSON.parse(JSON.stringify(arr))
869
- if (this.customlist.length > 0) {
870
- this.index = this.increaseId(this.customlist, 'index')
871
- }
872
- if (this.Motorways.length > 0) {
873
- this.motorid = this.increaseId(this.Motorways, 'id')
874
- }
875
- if (this.Pedwalk.length > 0) {
876
- this.pedid = this.increaseId(this.Pedwalk, 'id')
877
- }
878
- if (this.Detector.length > 0) {
879
- this.detectorcoilid = this.increaseId(this.Detector, 'id')
880
- }
881
- },
882
- increaseId (arr, field) { // 实现field对应的index或者id, 在arr的基础上寻找最小的
883
- let List = arr.map(ele => ele[field])
884
- let i = List.length - 1
885
- if (i >= 0) {
886
- for (let j = 1; j <= 200; j++) {
887
- if (!List.includes(j)) {
888
- return j
889
- }
890
- }
891
- } else {
892
- return 1
893
- }
894
- },
895
-
896
- exitEdit () {
897
- this.isSeletable = !this.isSeletable
898
- },
899
-
900
- resetAddParams () {
901
- this.AddType = ''
902
- this.editBtnGroup = this.editBtnGroup.map(btn => {
903
- btn.active = false
904
- return btn
905
- })
906
- },
907
- saveChannelizatonChart (ChannelizatonData) {
908
- // let agentid = getIframdevid()
909
- let params = {
910
- agentid: this.AgentId,
911
- data: ChannelizatonData
912
- }
913
- if (ChannelizatonData.crossMap && ChannelizatonData.crossMap.type === 'vectorgraph') {
914
- ChannelizatonData.crossMap.imgfilesrc = ''
915
- }
916
- if (ChannelizatonData.crossMap && ChannelizatonData.crossMap.type === 'picture') {
917
- ChannelizatonData.crossMap.svgstr = ''
918
- }
919
- saveChannelizatonChart(params).then(data => {
920
- this.$emit('saveCallback', data)
921
- if (!data.data.success) {
922
- let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
923
- if (data.data.data) {
924
- // 子类型错误
925
- let childErrorCode = data.data.data.errorCode
926
- if (childErrorCode) {
927
- let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
928
- this.$message.error(parrenterror + ',' + childerror)
929
- }
930
- } else {
931
- this.$message.error(parrenterror)
932
- }
933
- return
934
- }
935
- let msg = this.$t('openatccomponents.common.savesuccess')
936
- this.$message({
937
- message: msg,
938
- type: 'success',
939
- duration: 1 * 1000
940
- })
941
- })
942
- },
943
- handleClickSketchpad () {
944
- // 监听画板区域点击事件,改变图标放置的位置
945
- let sketchpadArea = document.getElementById('sketchpadArea')
946
- let _this = this
947
- sketchpadArea.addEventListener('click', function (e) {
948
- if (_this.pointchange) {
949
- document.getElementById('sketchpadArea').style.cursor =
950
- 'url(resource/pic/icons/magnifier3.cur) 12 12,default'
951
- _this.pointchange = false
952
- let boundingClientLeft = document.getElementById('channelizationElements').getBoundingClientRect().left
953
- let boundingClientTop = document.getElementById('channelizationElements').getBoundingClientRect().top
954
- _this.setLeft = Math.round(e.clientX - boundingClientLeft) // 四舍五入
955
- _this.setTop = Math.round(e.clientY - boundingClientTop)
956
- if (_this.AddType === '') return
957
- switch (_this.AddType) {
958
- case 'motorway':
959
- _this.addMotorwayIcon()
960
- break
961
- case 'pedcrossing':
962
- _this.addPedwalkIcon()
963
- break
964
- case 'countdown':
965
- _this.addTimer()
966
- break
967
- case 'detector':
968
- _this.addAllDetector()
969
- }
970
- _this.resetAddParams()
971
- }
972
- })
973
- },
974
- handleLockCrossMap () {
975
- this.isLockedCrossMap = !this.isLockedCrossMap
976
- },
977
- importFromFile () {
978
- this.dialogVisible = true
979
- },
980
- readAsText () {
981
- let _this = this
982
- var file = document.getElementById('file').files[0]
983
- var reader = new FileReader()
984
- reader.async = true
985
- // 将文件以文本形式读入页面
986
- reader.readAsText(file)
987
- reader.onload = function (f) {
988
- setTimeout(() => {
989
- _this.LoadedChannelizatonData = {}
990
- _this.handleReset()
991
- _this.dialogVisible = false
992
- _this.LoadedChannelizatonData = JSON.parse(this.result)
993
- _this.load()
994
- _this.$alert(_this.$t('openatccomponents.channelizationmap.importfilesuccess'), { type: 'success' })
995
- }, 50)
996
- }
997
- },
998
- async exportToFile () {
999
- let tscParam = this.handleSaveParams()
1000
- let content = new Blob([JSON.stringify(tscParam)])
1001
- // 生成url对象
1002
- let urlObject = window.URL || window.webkitURL || window
1003
- let url = urlObject.createObjectURL(content)
1004
- // 生成<a></a>DOM元素
1005
- let el = document.createElement('a')
1006
- // 链接赋值
1007
- el.href = url
1008
- el.download = 'ChanelizationParam.json'
1009
- // 必须点击否则不会下载
1010
- el.click()
1011
- // 移除链接释放资源
1012
- urlObject.revokeObjectURL(url)
1013
- }
1014
- },
1015
- mounted () {
1016
- this.handleClickSketchpad()
1017
- }
1018
- }
1019
- </script>
1020
-
1021
- <style lang="css" rel="stylesheet/scss">
1022
- </style>
1
+ /**
2
+ * Copyright (c) 2020 kedacom
3
+ * OpenATC is licensed under Mulan PSL v2.
4
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
5
+ * You may obtain a copy of Mulan PSL v2 at:
6
+ * http://license.coscl.org.cn/MulanPSL2
7
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
+ * See the Mulan PSL v2 for more details.
11
+ **/
12
+ <!--渠化绘制功能-->
13
+ <template>
14
+ <div class="custom-cross" v-if="visible">
15
+ <ImportDialog ref="importDialog" @loadSvgString="loadSvgString" @loadMapSize="loadMapSize" />
16
+ <Messagebox :visible="canclesettingvisible" :text="$t('openatccomponents.channelizationmap.canclesetting')" @cancle="cancleSetting" @ok="completeSetting"/>
17
+ <div class="custom-main" ref="custommain">
18
+ <div class="custom-group drawPanelAnimation" ref="customGroup">
19
+ <!-- 绘制功能 -->
20
+ <div class="draw-function">
21
+ <div class="again-import">
22
+ <span class="import-label">{{$t('openatccomponents.channelizationmap.importcrosspicture')}}</span>
23
+ <el-button
24
+ class="again-import-btn"
25
+ type="primary"
26
+ :disabled="!isSeletable"
27
+ @click="clickOpen"
28
+ >{{$t('openatccomponents.channelizationmap.againimport')}}</el-button>
29
+ <i class="lock-map el-icon-unlock" v-if="!isLockedCrossMap" @click="handleLockCrossMap()"></i>
30
+ <i class="lock-map el-icon-lock" v-if="isLockedCrossMap" @click="handleLockCrossMap()"></i>
31
+ </div>
32
+
33
+ <div class="draw-to-sketchpad">
34
+ <div class="drawtip">{{$t('openatccomponents.channelizationmap.drawtips')}}</div>
35
+ <div class="draw-operation">
36
+ <!-- <el-button
37
+ type="primary"
38
+ :disabled="!isSeletable"
39
+ @click="addText"
40
+ >添加text</el-button>-->
41
+ <el-button
42
+ v-for="editbtn in editBtnGroup"
43
+ :key="editbtn.type"
44
+ class="edit-icon-btn"
45
+ @click="handleAddIcon(editbtn)"
46
+ >
47
+ <LaneIconSvg :laneicon="editbtn"/>
48
+ <div
49
+ class="btn-label"
50
+ :class="{'highlightColor': editbtn.active === true, 'defaultColor': editbtn.active === false}"
51
+ >{{editbtn.label}}</div>
52
+ </el-button>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ <!-- 画板区域 -->
57
+ <div class="sketchpad-area" id="sketchpadgroup" ref="sketchpadgroup">
58
+ <ChannelizationElements
59
+ id="channelizationElements"
60
+ :allitem="allitem"
61
+ :CrossMapVisible="CrossMapVisible"
62
+ :CrossMapData="CrossMapData"
63
+ :isSeletable="isSeletable"
64
+ :pointchange="pointchange"
65
+ @changeCrossMap="changeCrossMap"
66
+ :Motorways="Motorways"
67
+ :curChooseIconIndex="curChooseIconIndex"
68
+ @changeMotorwayItem="changeMotorwayItem"
69
+ @handleSelectIcon="handleSelectIcon"
70
+ :Countdown="Countdown"
71
+ :CountdownList="phaseCountdownMock"
72
+ @changeTimeItem="changeTimeItem"
73
+ :Pedwalk="Pedwalk"
74
+ @changePedItem="changePedItem"
75
+ :Detector="Detector"
76
+ @changeDetectorItem="changeDetectorItem"
77
+ :DetectorChart="DetectorChart"
78
+ :CurChooseIcon="curChooseIcon"
79
+ @changeDetectorChartItem="changeDetectorChartItem"
80
+ :isLockedCrossMap="isLockedCrossMap"
81
+ />
82
+ </div>
83
+ <div class="draw-end-function">
84
+ <el-button type="primary" @click="handleReset()">{{$t('openatccomponents.button.reset')}}</el-button>
85
+ <!-- <el-button type="primary" @click="cancledraw()">{{$t('openatccomponents.button.Cancel')}}</el-button> -->
86
+ <el-button type="primary" @click="savedraw()">{{$t('openatccomponents.button.save')}}</el-button>
87
+ <el-button type="primary" @click="importFromFile()">{{$t('openatccomponents.main.import')}}</el-button>
88
+ <el-button type="primary" @click="exportToFile()">{{$t('openatccomponents.main.export')}}</el-button>
89
+ </div>
90
+ </div>
91
+ <div class="custom-edit" ref="customEdit">
92
+ <LaneEditPanel
93
+ :Data="curChooseIcon"
94
+ :choosedirections="curChooseIcon.direction"
95
+ :Motorways="Motorways"
96
+ @handleChooseDire="handleChooseDire"
97
+ @handleChoosePed="handleChoosePed"
98
+ @deleteItem="deleteItem"
99
+ @cloneItem="cloneItem"
100
+ @changeIconDataByType="changeIconDataByType"
101
+ @handleDisassociatePhase="handleDisassociatePhase"
102
+ />
103
+ </div>
104
+ </div>
105
+ <!-- <el-row>
106
+ <div class="phase-table">
107
+ <PhaseTable
108
+ :customlist="customlist"
109
+ @changeText="changeText"
110
+ @deleteItem="deleteItem"
111
+ @changeMotorwayItem="changeMotorwayItem"
112
+ @changeIconDataByType="changeIconDataByType"
113
+ />
114
+ </div>
115
+ </el-row> -->
116
+ <!-- 从文件导入弹窗 -->
117
+ <el-dialog
118
+ :title="$t('openatccomponents.main.tip')"
119
+ :visible.sync="dialogVisible"
120
+ width="30%"
121
+ >
122
+ <input
123
+ type="file"
124
+ id="file"
125
+ />
126
+ <span
127
+ slot="footer"
128
+ class="dialog-footer"
129
+ >
130
+ <el-button @click="dialogVisible = false">{{$t('openatccomponents.common.cancel')}}</el-button>
131
+ <el-button
132
+ type="primary"
133
+ @click="readAsText"
134
+ >{{$t('openatccomponents.common.confirm')}}</el-button>
135
+ </span>
136
+ </el-dialog>
137
+ </div>
138
+ </template>
139
+
140
+ <script>
141
+ import ChannelizationElements from './channelizationElements'
142
+
143
+ import LaneEditPanel from './laneEditPanel'
144
+
145
+ import PhaseTable from './table'
146
+ import PhaseDataModel from './utils/phaseDataModel.js'
147
+ import LaneIconSvg from './iconSvg/laneIcon'
148
+
149
+ import ImportDialog from './importDialog'
150
+ import Messagebox from '../../MessageBox/index'
151
+
152
+ import { mapState } from 'vuex'
153
+
154
+ import { saveChannelizatonChart } from '../../../../api/cross'
155
+ import { getMessageByCode } from '../../../../utils/responseMessage.js'
156
+
157
+ import axios from 'axios'
158
+
159
+ export default {
160
+ name: 'draw-channelization',
161
+ components: {
162
+ Messagebox,
163
+ ImportDialog,
164
+ ChannelizationElements,
165
+ PhaseTable,
166
+ LaneIconSvg,
167
+ LaneEditPanel
168
+ },
169
+ computed: {
170
+ ...mapState({
171
+ phaseList: state => state.globalParam.tscParam.phaseList
172
+ })
173
+ },
174
+ props: {
175
+ loadedChannelizatonData: {
176
+ type: Object
177
+ },
178
+ AgentId: {
179
+ type: String,
180
+ default: '0'
181
+ }
182
+ },
183
+ watch: {
184
+ AgentId: {
185
+ handler: function (val) {
186
+ // 平台设备切换时,清空上一个渠化配置
187
+ this.handleReset()
188
+ },
189
+ deep: true
190
+ },
191
+ loadedChannelizatonData: {
192
+ handler: function (val) {
193
+ // 平台设备切换时,重载当前路口保存的渠化配置
194
+ this.LoadedChannelizatonData = JSON.parse(JSON.stringify(val))
195
+ this.load('all')
196
+ },
197
+ deep: true
198
+ }
199
+ },
200
+ data () {
201
+ return {
202
+ visible: true,
203
+ canclesettingvisible: false,
204
+
205
+ isSeletable: true, // 元素是否可以编辑
206
+ index: 0,
207
+ motorid: 1, // 车道id
208
+ pedid: 1, // 人行道id
209
+ detectorcoilid: 1, // 检测器线圈id(非关联检测器id)
210
+ Motorways: [], // 管理所有自定义机动车图标数据
211
+ customlist: [], // 所有自定义的图标列表
212
+ Texts: [], // 管理所有自定义文字数据
213
+ Pedwalk: [], // 管理所有人行横道
214
+ Detector: [], // 管理所有检测器
215
+ DetectorChart: [], // 管理所有检测器统计图
216
+ motorwayicon: '',
217
+ IconLengh: 33,
218
+ IconWdith: 109,
219
+ textareaW: 200,
220
+ textareaH: 100,
221
+ pedW: 206,
222
+ pedH: 22,
223
+ MapW: 800,
224
+ MapH: 200,
225
+ detectorW: 20,
226
+ detectorH: 20,
227
+ detectorchartW: 70,
228
+ detectorchartH: 100,
229
+ isLockedCrossMap: true, // 底图是否是锁定状态
230
+ CrossMapData: {
231
+ index: -2,
232
+ icontype: 'crossmap',
233
+ x: 400,
234
+ y: 100,
235
+ w: 800,
236
+ h: 200,
237
+ angle: 0,
238
+ svgstr: '',
239
+ imgfilesrc: ''
240
+ }, // 管理底图数据
241
+ allitem: {
242
+ x: 435,
243
+ y: 325,
244
+ w: 870,
245
+ h: 650,
246
+ angle: 0
247
+ },
248
+ countdownW: 140,
249
+ countdownH: 140,
250
+ Countdown: [], // 管理倒计时图标
251
+ phaseCountdownMock: [
252
+ {
253
+ id: 2,
254
+ phaseCountdown: 59,
255
+ phaseCountdownColor: '#fff'
256
+ },
257
+ {
258
+ id: 5,
259
+ phaseCountdown: 32,
260
+ phaseCountdownColor: '#fff'
261
+ }
262
+ ], // 倒计时动态数据模拟
263
+ svgvisible: false,
264
+ pointchange: false, // 控制选中时光标样式
265
+ CrossMapVisible: true, // 控制底图显示隐藏
266
+
267
+ curChooseIconIndex: -1, // 底图暂用-2代替,别的图标与递增的index相关
268
+ curChooseIcon: {},
269
+ editBtnGroup: [
270
+ {
271
+ label: this.$t('openatccomponents.channelizationmap.motorway'),
272
+ type: 'motorway',
273
+ active: false,
274
+ width: '16px',
275
+ height: '16px'
276
+ },
277
+ {
278
+ label: this.$t('openatccomponents.channelizationmap.pedcrossing'),
279
+ type: 'pedcrossing',
280
+ active: false,
281
+ width: '16px',
282
+ height: '16px'
283
+ },
284
+ {
285
+ label: this.$t('openatccomponents.channelizationmap.countdown'),
286
+ type: 'countdown',
287
+ active: false,
288
+ width: '16px',
289
+ height: '16px'
290
+ },
291
+ {
292
+ label: this.$t('openatccomponents.channelizationmap.detector'),
293
+ type: 'detector',
294
+ active: false,
295
+ width: '16px',
296
+ height: '16px'
297
+ }
298
+ ],
299
+ AddType: '', // 正在添加的图标类型
300
+
301
+ dirNameMap: new Map([
302
+ [1, '直行'],
303
+ [2, '左转'],
304
+ [3, '右转'],
305
+ [4, '掉头']
306
+ ]),
307
+ phaseAssociatedMap: new Map(), // 关联相位Map: key 是相位ID, value 是车道数据包含direction
308
+ dialogVisible: false,
309
+ LoadedChannelizatonData: {} // 从接口获取到的渠化参数,用于作为加载数据,从文件导入可修改
310
+ }
311
+ },
312
+ methods: {
313
+ clickOpen () {
314
+ this.$refs.importDialog.clickOpen()
315
+ },
316
+
317
+ // 改变鼠标样式
318
+ changeMouse () {
319
+ if (!this.isSeletable) return
320
+ document.getElementById('sketchpadArea').style.cursor =
321
+ 'url(resource/pic/icons/magnifier3.cur) 12 12,pointer'
322
+ this.pointchange = true
323
+ },
324
+
325
+ // 根据类型,表格编辑后,修改数据策略
326
+ changeIconDataByType (iconObj, changefield) {
327
+ this.curChooseIcon = JSON.parse(JSON.stringify(iconObj))
328
+ // 根据数据类型改变数据
329
+ switch (iconObj.icontype) {
330
+ case 'text':
331
+ this.changeText(iconObj, changefield)
332
+ break
333
+ case 'vehile':
334
+ this.changeMotorwayItem(iconObj, changefield)
335
+ break
336
+ case 'ped':
337
+ this.changePedItem(iconObj, changefield)
338
+ break
339
+ case 'countdown':
340
+ this.changeTimeItem(iconObj, changefield)
341
+ break
342
+ case 'detector':
343
+ this.changeDetectorItem(iconObj, changefield)
344
+ break
345
+ case 'crossmap':
346
+ this.changeCrossMap(iconObj, changefield)
347
+ }
348
+ // console.log('this.customlist', this.customlist)
349
+ },
350
+
351
+ // 被删除的相位所关联的车道,解除相位关联
352
+ handleDisassociatePhase (deletePhaseid) {
353
+ for (let i = 0; i < this.Motorways.length; i++) {
354
+ if (this.Motorways[i].phaseid === deletePhaseid) {
355
+ this.Motorways[i].phaseid = undefined
356
+ this.Motorways[i].phaselabel = ''
357
+ this.Motorways[i].phasetype = undefined
358
+ }
359
+ }
360
+ for (let i = 0; i < this.Pedwalk.length; i++) {
361
+ if (this.Pedwalk[i].phaseid === deletePhaseid) {
362
+ this.Pedwalk[i].phaseid = undefined
363
+ this.Pedwalk[i].phaselabel = ''
364
+ this.Pedwalk[i].phasetype = undefined
365
+ }
366
+ }
367
+ },
368
+
369
+ // 添加不同类型的车道图标
370
+ handleAddIcon (editbtn) {
371
+ // 按钮及图标高亮效果实现
372
+ this.editBtnGroup = this.editBtnGroup.map(btn => {
373
+ btn.active = false
374
+ return btn
375
+ })
376
+ for (let i = 0; i < this.editBtnGroup.length; i++) {
377
+ if (this.editBtnGroup[i].type === editbtn.type) {
378
+ this.editBtnGroup[i].active = true
379
+ }
380
+ }
381
+ this.changeMouse()
382
+ this.AddType = editbtn.type
383
+ },
384
+
385
+ addMotorwayIcon () {
386
+ this.PhaseDataModel = new PhaseDataModel()
387
+ let defaultMotorwayParam = {
388
+ x: this.setLeft,
389
+ y: this.setTop,
390
+ w: this.IconLengh,
391
+ h: this.IconWdith,
392
+ angle: 0
393
+ }
394
+ this.IconLengh = 33
395
+ this.IconWdith = 109
396
+ let Motorwaysitem = {
397
+ index: this.index,
398
+ id: this.motorid,
399
+ keyid: this.motorid, // 后端需要的id,默认指取索引,可修改
400
+ laneid: undefined, // 全息需要车道id
401
+ icontype: 'vehile',
402
+ icondireid: [1], // 前端区分箭头方向的标识
403
+ icondirename: [this.PhaseDataModel.getPhase(1).name],
404
+ lanePosition: 1,
405
+ controltype: 0,
406
+ phasetype: undefined,
407
+ phaseid: undefined,
408
+ phaselabel: '',
409
+ direction: [], // 值为1-16,对应16个方向
410
+ flip: false, // 车道类型是否翻转显示
411
+ ...defaultMotorwayParam
412
+ }
413
+ this.curChooseIconIndex = Motorwaysitem.index
414
+ this.curChooseIcon = JSON.parse(JSON.stringify(Motorwaysitem))
415
+ this.Motorways.push(Motorwaysitem)
416
+ this.customlist.push(Motorwaysitem)
417
+ this.index = this.increaseId(this.customlist, 'index')
418
+ this.motorid = this.increaseId(this.Motorways, 'id')
419
+ },
420
+ changeMotorwayItem (MotorwayItem, fields) {
421
+ this.changeItem(MotorwayItem, fields, this.Motorways)
422
+ this.changeCustomItem(MotorwayItem, fields)
423
+ },
424
+
425
+ // 选中图标
426
+ handleSelectIcon (iconobj, isCrossMap) {
427
+ // console.log('选中的图标', iconobj)
428
+ if (isCrossMap === 'crossmap') {
429
+ this.curChooseIconIndex = -2
430
+ } else {
431
+ this.curChooseIconIndex = iconobj.index
432
+ }
433
+ this.curChooseIcon = JSON.parse(JSON.stringify(iconobj))
434
+ },
435
+ // 根据多选的车道,修改车道图标
436
+ handleChooseDire (iconObj) {
437
+ this.curChooseIcon = JSON.parse(JSON.stringify(iconObj))
438
+ let editDirections = iconObj.icondireid
439
+ if (
440
+ this.curChooseIcon.icontype === 'vehile'
441
+ ) {
442
+ this.curChooseIcon.icondireid = editDirections
443
+ this.curChooseIcon.icondirename = editDirections.map(dir =>
444
+ this.dirNameMap.get(dir)
445
+ )
446
+ this.changeMotorwayItem(this.curChooseIcon, [
447
+ 'icondireid',
448
+ 'icondirename'
449
+ ])
450
+ }
451
+ },
452
+
453
+ addPedwalkIcon () {
454
+ let defaulPedParam = {
455
+ x: this.setLeft,
456
+ y: this.setTop,
457
+ w: this.pedW,
458
+ h: this.pedH,
459
+ angle: 0,
460
+ viewbox: [0, 0, 206, 22]
461
+ }
462
+ this.pedW = 206
463
+ this.pedH = 22
464
+ let peditem = {
465
+ index: this.index,
466
+ id: this.pedid,
467
+ keyid: this.pedid, // 后端需要的id,默认指取索引,可修改
468
+ icontype: 'ped',
469
+ iconpedtypeid: 1,
470
+ iconpedposition: 1,
471
+ phasetype: undefined,
472
+ phaseid: undefined,
473
+ phaselabel: '',
474
+ ...defaulPedParam
475
+ }
476
+ this.curChooseIconIndex = peditem.index
477
+ this.curChooseIcon = JSON.parse(JSON.stringify(peditem))
478
+ this.Pedwalk.push(peditem)
479
+ this.customlist.push(peditem)
480
+ this.index = this.increaseId(this.customlist, 'index')
481
+ this.pedid = this.increaseId(this.Pedwalk, 'id')
482
+ },
483
+ changePedItem (PedItem, fields) {
484
+ this.changeItem(PedItem, fields, this.Pedwalk)
485
+ this.changeCustomItem(PedItem, fields)
486
+ },
487
+
488
+ handleChoosePed (pediconobj) {
489
+ this.curChooseIcon = JSON.parse(JSON.stringify(pediconobj))
490
+ if (this.curChooseIcon.icontype === 'ped') {
491
+ this.curChooseIcon.iconpedtypeid = pediconobj.iconpedtypeid
492
+ this.curChooseIcon.iconpedposition = pediconobj.iconpedposition
493
+ this.changePedItem(this.curChooseIcon, ['iconpedtypeid', 'iconpedposition'])
494
+ }
495
+ console.log(this.curChooseIcon)
496
+ },
497
+
498
+ addTimer () {
499
+ let defaultCountParam = {
500
+ x: this.setLeft,
501
+ y: this.setTop,
502
+ w: this.countdownW,
503
+ h: this.countdownH,
504
+ angle: 0
505
+ }
506
+ this.countdownW = 140
507
+ this.countdownH = 140
508
+ let countdownitem = {
509
+ index: this.index,
510
+ icontype: 'countdown',
511
+ ...defaultCountParam
512
+ }
513
+ this.curChooseIconIndex = countdownitem.index
514
+ this.curChooseIcon = JSON.parse(JSON.stringify(countdownitem))
515
+ this.Countdown.push(countdownitem)
516
+ this.customlist.push(countdownitem)
517
+ this.index = this.increaseId(this.customlist, 'index')
518
+ },
519
+ changeTimeItem (timeItem, fields) {
520
+ this.changeItem(timeItem, fields, this.Countdown)
521
+ this.changeCustomItem(timeItem, fields)
522
+ },
523
+
524
+ addAllDetector () {
525
+ // 统计图暂留
526
+ this.addDetector()
527
+ // this.addDetectorChart()
528
+ this.detectorcoilid = this.increaseId(this.Detector, 'id')
529
+ },
530
+ addDetector () {
531
+ let defaultDetectorParam = {
532
+ x: this.setLeft,
533
+ y: this.setTop,
534
+ w: this.detectorW,
535
+ h: this.detectorH,
536
+ angle: 0
537
+ }
538
+ this.detectorW = 20
539
+ this.detectorH = 20
540
+ let detectoritem = {
541
+ index: this.index,
542
+ id: this.detectorcoilid,
543
+ icontype: 'detector',
544
+ detailtype: 'detector',
545
+ detectortype: 1, // 检测器类型: 1 车辆检测器 2 行人检测器
546
+ detectorid: undefined,
547
+ occupancythreshold: 80,
548
+ minflowsaturationthreshold: 30,
549
+ maxflowsaturationthreshold: 70,
550
+ associatedlaneid: '', // 检测器关联的车道索引
551
+ ...defaultDetectorParam
552
+ }
553
+ this.curChooseIconIndex = detectoritem.index
554
+ this.curChooseIcon = JSON.parse(JSON.stringify(detectoritem))
555
+ this.Detector.push(detectoritem)
556
+ this.customlist.push(detectoritem)
557
+ this.index = this.increaseId(this.customlist, 'index')
558
+ },
559
+ changeDetectorItem (detectorItem, fields) {
560
+ this.changeItem(detectorItem, fields, this.Detector)
561
+ this.changeCustomItem(detectorItem, fields)
562
+ },
563
+ addDetectorChart () {
564
+ let defaultDetectorParam = {
565
+ x: this.setLeft,
566
+ y: this.setTop - 100, // 偏移到检测器正上方150
567
+ w: this.detectorchartW,
568
+ h: this.detectorchartH,
569
+ angle: 0
570
+ }
571
+ this.detectorchartW = 70
572
+ this.detectorchartH = 100
573
+ let detectoritem = {
574
+ index: this.index,
575
+ id: this.detectorcoilid,
576
+ icontype: 'detector',
577
+ detailtype: 'detectorChart',
578
+ ...defaultDetectorParam
579
+ }
580
+ this.curChooseIconIndex = detectoritem.index
581
+ this.curChooseIcon = JSON.parse(JSON.stringify(detectoritem))
582
+ this.DetectorChart.push(detectoritem)
583
+ this.customlist.push(detectoritem)
584
+ this.index = this.increaseId(this.customlist, 'index')
585
+ },
586
+ changeDetectorChartItem (detectorItem, fields) {
587
+ this.changeItem(detectorItem, fields, this.DetectorChart)
588
+ this.changeCustomItem(detectorItem, fields)
589
+ },
590
+
591
+ // 添加文字
592
+ addText () {
593
+ let defaultTextParam = {
594
+ x: this.textareaW / 2,
595
+ y: this.textareaH / 2,
596
+ w: this.textareaW,
597
+ h: this.textareaH,
598
+ angle: 0
599
+ }
600
+ this.textareaW = 200
601
+ this.textareaH = 100
602
+ let textitem = {
603
+ index: this.index,
604
+ icontype: 'text',
605
+ text: '',
606
+ ...defaultTextParam
607
+ }
608
+ this.Texts.push(textitem)
609
+ this.customlist.push(textitem)
610
+ this.index = this.increaseId(this.customlist, 'index')
611
+ },
612
+ changeText (textobj, fields) {
613
+ this.changeItem(textobj, fields, this.Texts)
614
+ this.changeCustomItem(textobj, fields)
615
+ },
616
+
617
+ changeCustomItem (row, fields) {
618
+ this.changeItem(row, fields, this.customlist)
619
+ },
620
+ changeItem (row, fieldarr, data) {
621
+ for (let item of data) {
622
+ if (item.index === row.index) {
623
+ for (let field of fieldarr) {
624
+ item[field] = row[field]
625
+ }
626
+ }
627
+ }
628
+ },
629
+ deleteItem (row) {
630
+ let index = row.index
631
+ // let id = row.id
632
+ this.customlist = this.customlist.filter(ele => ele.index !== index)
633
+ switch (row.icontype) {
634
+ // case 'text':
635
+ // this.Texts = this.Texts.filter(ele => ele.index !== index)
636
+ // break
637
+ case 'vehile':
638
+ this.Motorways = this.Motorways.filter(ele => ele.index !== index)
639
+ this.motorid = this.increaseId(this.Motorways, 'id')
640
+ this.deleteLaneAssociatedDetector(row.id)
641
+ break
642
+ case 'ped':
643
+ this.Pedwalk = this.Pedwalk.filter(ele => ele.index !== index)
644
+ this.pedid = this.increaseId(this.Pedwalk, 'id')
645
+ break
646
+ case 'countdown':
647
+ this.Countdown = this.Countdown.filter(ele => ele.index !== index)
648
+ break
649
+ case 'detector':
650
+ this.Detector = this.Detector.filter(ele => ele.index !== index)
651
+ // this.DetectorChart = this.DetectorChart.filter(ele => ele.id !== id)
652
+ this.detectorcoilid = this.increaseId(this.Detector, 'id')
653
+ }
654
+ this.curChooseIconIndex = -1
655
+ this.curChooseIcon = {}
656
+ },
657
+ deleteLaneAssociatedDetector (dellaneid) {
658
+ // 删除关联车道的检测器的历史关联关系
659
+ for (let i = 0; i < this.Detector.length; i++) {
660
+ let curDetc = this.Detector[i]
661
+ if (curDetc.associatedlaneid === dellaneid) {
662
+ curDetc.associatedlaneid = undefined
663
+ }
664
+ }
665
+ },
666
+ cloneItem (row) {
667
+ // 克隆元素
668
+ let cloneObj = {
669
+ ...row,
670
+ index: this.index,
671
+ x: 435,
672
+ y: 325
673
+ }
674
+ switch (row.icontype) {
675
+ case 'vehile':
676
+ cloneObj.id = this.motorid
677
+ this.Motorways.push(cloneObj)
678
+ this.motorid = this.increaseId(this.Motorways, 'id')
679
+ this.customlist.push(cloneObj)
680
+ break
681
+ case 'ped':
682
+ cloneObj.id = this.pedid
683
+ this.Pedwalk.push(cloneObj)
684
+ this.pedid = this.increaseId(this.Pedwalk, 'id')
685
+ this.customlist.push(cloneObj)
686
+ break
687
+ // case 'countdown':
688
+ // this.Countdown.push(cloneObj)
689
+ // this.customlist.push(cloneObj)
690
+ // break
691
+ case 'detector':
692
+ cloneObj.id = this.detectorcoilid
693
+ this.Detector.push(cloneObj)
694
+ this.customlist.push(cloneObj)
695
+ // 同时克隆统计图
696
+ // this.index = this.increaseId(this.customlist, 'index')
697
+ // let curchartobj = JSON.parse(JSON.stringify(this.DetectorChart)).filter(ele => ele.id === row.id)[0]
698
+ // curchartobj.index = this.index
699
+ // curchartobj.id = this.detectorcoilid
700
+ // curchartobj.x = 435
701
+ // curchartobj.y = 325 - 100
702
+ // this.DetectorChart.push(curchartobj)
703
+ // this.customlist.push(curchartobj)
704
+ this.detectorcoilid = this.increaseId(this.Detector, 'id')
705
+ }
706
+ this.curChooseIconIndex = this.index
707
+ this.curChooseIcon = JSON.parse(JSON.stringify(cloneObj))
708
+ this.index = this.increaseId(this.customlist, 'index')
709
+ },
710
+
711
+ loadSvgString (type, imgstr) {
712
+ // 加载用户上传的底图svg字符串
713
+ if (type === 'vectorgraph') {
714
+ // 导入矢量图
715
+ // this.getCrossMapViewbox(imgstr)
716
+ this.CrossMapData = {
717
+ ...this.CrossMapData,
718
+ type,
719
+ svgstr: imgstr
720
+ }
721
+ }
722
+ if (type === 'picture') {
723
+ // 导入图片
724
+ this.CrossMapData = {
725
+ ...this.CrossMapData,
726
+ type,
727
+ imgfilesrc: imgstr
728
+ }
729
+ }
730
+ },
731
+ loadMapSize (type, mapsize) {
732
+ this.CrossMapData = {
733
+ ...this.CrossMapData,
734
+ angle: 0,
735
+ x: Math.round(mapsize.width / 2),
736
+ y: Math.round(mapsize.height / 2),
737
+ w: Math.round(mapsize.width),
738
+ h: Math.round(mapsize.height)
739
+ }
740
+ this.MapW = mapsize.width
741
+ this.MapH = mapsize.height
742
+ },
743
+
744
+ getCrossMapViewbox (svgstr) {
745
+ // 获取户上传svg的viewBox属性的大小
746
+ let arr = svgstr.split('"')
747
+ let index, viewBox
748
+ for (let i = 0; i < arr.length - 1; i++) {
749
+ if (arr[i].indexOf('viewBox') !== -1) {
750
+ index = i
751
+ }
752
+ }
753
+ if (index) {
754
+ viewBox = arr[index + 1]
755
+ }
756
+ this.MapW = Number(viewBox.split(' ')[2])
757
+ this.MapH = Number(viewBox.split(' ')[3])
758
+ },
759
+ changeCrossMap (mapdata, fields) {
760
+ this.changeItem(mapdata, fields, [this.CrossMapData])
761
+ },
762
+
763
+ // 重置
764
+ handleReset () {
765
+ this.customlist = []
766
+ this.Texts = []
767
+ this.Motorways = []
768
+ this.Countdown = []
769
+ this.Pedwalk = []
770
+ this.Detector = []
771
+ this.DetectorChart = []
772
+ // this.CrossMapData = {
773
+ // index: -2, // 暂定为-2,用于复用图标判断逻辑
774
+ // icontype: 'crossmap',
775
+ // x: this.MapW / 2,
776
+ // y: this.MapH / 2,
777
+ // w: this.MapW,
778
+ // h: this.MapH,
779
+ // angle: 0,
780
+ // svgstr: '',
781
+ // imgfilesrc: ''
782
+ // }
783
+ this.index = 0
784
+ this.curChooseIcon = {}
785
+ axios.get('./img/CrossRoadsSvg.svg').then((val) => {
786
+ if (!val.data || val.data === '') return
787
+ this.CrossMapData = {
788
+ index: -2,
789
+ icontype: 'crossmap',
790
+ x: 435,
791
+ y: 325,
792
+ w: 870,
793
+ h: 650,
794
+ angle: 0,
795
+ imgfilesrc: '',
796
+ svgstr: val.data,
797
+ type: 'vectorgraph'
798
+ }
799
+ })
800
+ },
801
+ // 取消
802
+ cancledraw () {
803
+ this.canclesettingvisible = true
804
+ },
805
+ completeSetting () {
806
+ this.canclesettingvisible = false
807
+ this.$router.push('/overview/index')
808
+ },
809
+ cancleSetting () {
810
+ this.canclesettingvisible = false
811
+ },
812
+ handleSaveParams () {
813
+ let temp = {}
814
+ console.log(this.customlist)
815
+ for (const item of this.customlist) {
816
+ if (temp.hasOwnProperty(item.icontype)) {
817
+ temp[item.icontype].push(item)
818
+ } else {
819
+ temp[item.icontype] = [item]
820
+ }
821
+ }
822
+ if (this.CrossMapData.svgstr !== '' || this.CrossMapData.imgfilesrc !== '') {
823
+ temp.crossMap = this.CrossMapData
824
+ }
825
+ return temp
826
+ },
827
+ // 保存
828
+ savedraw () {
829
+ let temp = {}
830
+ temp = this.handleSaveParams()
831
+ this.saveChannelizatonChart(temp)
832
+ },
833
+ // 加载
834
+ load (type) {
835
+ this.curChooseIconIndex = -1
836
+ let savedTemp = JSON.parse(JSON.stringify(this.LoadedChannelizatonData))
837
+ let arr = []
838
+ for (const [key, value] of Object.entries(savedTemp)) {
839
+ if (key === 'vehile') {
840
+ this.Motorways = value
841
+ }
842
+ if (key === 'text') {
843
+ this.Texts = value
844
+ }
845
+ if (key === 'ped') {
846
+ this.Pedwalk = value
847
+ }
848
+ if (key === 'countdown') {
849
+ this.Countdown = value
850
+ }
851
+ if (key === 'detector') {
852
+ this.Detector = value.filter(ele => ele.detailtype === 'detector')
853
+ // this.DetectorChart = value.filter(ele => ele.detailtype === 'detectorChart')
854
+ }
855
+ if (key === 'crossMap') {
856
+ this.CrossMapData = JSON.parse(JSON.stringify(value))
857
+ if (value.icontype === undefined) {
858
+ this.CrossMapData.icontype = 'crossmap'
859
+ }
860
+ } else {
861
+ if (value.length > 1) {
862
+ arr = [...arr, ...value]
863
+ } else {
864
+ arr.push(value[0])
865
+ }
866
+ }
867
+ }
868
+ this.customlist = JSON.parse(JSON.stringify(arr))
869
+ if (this.customlist.length > 0) {
870
+ this.index = this.increaseId(this.customlist, 'index')
871
+ }
872
+ if (this.Motorways.length > 0) {
873
+ this.motorid = this.increaseId(this.Motorways, 'id')
874
+ }
875
+ if (this.Pedwalk.length > 0) {
876
+ this.pedid = this.increaseId(this.Pedwalk, 'id')
877
+ }
878
+ if (this.Detector.length > 0) {
879
+ this.detectorcoilid = this.increaseId(this.Detector, 'id')
880
+ }
881
+ },
882
+ increaseId (arr, field) { // 实现field对应的index或者id, 在arr的基础上寻找最小的
883
+ let List = arr.map(ele => ele[field])
884
+ let i = List.length - 1
885
+ if (i >= 0) {
886
+ for (let j = 1; j <= 200; j++) {
887
+ if (!List.includes(j)) {
888
+ return j
889
+ }
890
+ }
891
+ } else {
892
+ return 1
893
+ }
894
+ },
895
+
896
+ exitEdit () {
897
+ this.isSeletable = !this.isSeletable
898
+ },
899
+
900
+ resetAddParams () {
901
+ this.AddType = ''
902
+ this.editBtnGroup = this.editBtnGroup.map(btn => {
903
+ btn.active = false
904
+ return btn
905
+ })
906
+ },
907
+ saveChannelizatonChart (ChannelizatonData) {
908
+ // let agentid = getIframdevid()
909
+ let params = {
910
+ agentid: this.AgentId,
911
+ data: ChannelizatonData
912
+ }
913
+ if (ChannelizatonData.crossMap && ChannelizatonData.crossMap.type === 'vectorgraph') {
914
+ ChannelizatonData.crossMap.imgfilesrc = ''
915
+ }
916
+ if (ChannelizatonData.crossMap && ChannelizatonData.crossMap.type === 'picture') {
917
+ ChannelizatonData.crossMap.svgstr = ''
918
+ }
919
+ saveChannelizatonChart(params).then(data => {
920
+ this.$emit('saveCallback', data)
921
+ if (!data.data.success) {
922
+ let parrenterror = getMessageByCode(data.data.code, this.$i18n.locale)
923
+ if (data.data.data) {
924
+ // 子类型错误
925
+ let childErrorCode = data.data.data.errorCode
926
+ if (childErrorCode) {
927
+ let childerror = getMessageByCode(data.data.data.errorCode, this.$i18n.locale)
928
+ this.$message.error(parrenterror + ',' + childerror)
929
+ }
930
+ } else {
931
+ this.$message.error(parrenterror)
932
+ }
933
+ return
934
+ }
935
+ let msg = this.$t('openatccomponents.common.savesuccess')
936
+ this.$message({
937
+ message: msg,
938
+ type: 'success',
939
+ duration: 1 * 1000
940
+ })
941
+ })
942
+ },
943
+ handleClickSketchpad () {
944
+ // 监听画板区域点击事件,改变图标放置的位置
945
+ let sketchpadArea = document.getElementById('sketchpadArea')
946
+ let _this = this
947
+ sketchpadArea.addEventListener('click', function (e) {
948
+ if (_this.pointchange) {
949
+ document.getElementById('sketchpadArea').style.cursor =
950
+ 'url(resource/pic/icons/magnifier3.cur) 12 12,default'
951
+ _this.pointchange = false
952
+ let boundingClientLeft = document.getElementById('channelizationElements').getBoundingClientRect().left
953
+ let boundingClientTop = document.getElementById('channelizationElements').getBoundingClientRect().top
954
+ _this.setLeft = Math.round(e.clientX - boundingClientLeft) // 四舍五入
955
+ _this.setTop = Math.round(e.clientY - boundingClientTop)
956
+ if (_this.AddType === '') return
957
+ switch (_this.AddType) {
958
+ case 'motorway':
959
+ _this.addMotorwayIcon()
960
+ break
961
+ case 'pedcrossing':
962
+ _this.addPedwalkIcon()
963
+ break
964
+ case 'countdown':
965
+ _this.addTimer()
966
+ break
967
+ case 'detector':
968
+ _this.addAllDetector()
969
+ }
970
+ _this.resetAddParams()
971
+ }
972
+ })
973
+ },
974
+ handleLockCrossMap () {
975
+ this.isLockedCrossMap = !this.isLockedCrossMap
976
+ },
977
+ importFromFile () {
978
+ this.dialogVisible = true
979
+ },
980
+ readAsText () {
981
+ let _this = this
982
+ var file = document.getElementById('file').files[0]
983
+ var reader = new FileReader()
984
+ reader.async = true
985
+ // 将文件以文本形式读入页面
986
+ reader.readAsText(file)
987
+ reader.onload = function (f) {
988
+ setTimeout(() => {
989
+ _this.LoadedChannelizatonData = {}
990
+ _this.handleReset()
991
+ _this.dialogVisible = false
992
+ _this.LoadedChannelizatonData = JSON.parse(this.result)
993
+ _this.load()
994
+ _this.$alert(_this.$t('openatccomponents.channelizationmap.importfilesuccess'), { type: 'success' })
995
+ }, 50)
996
+ }
997
+ },
998
+ async exportToFile () {
999
+ let tscParam = this.handleSaveParams()
1000
+ let content = new Blob([JSON.stringify(tscParam)])
1001
+ // 生成url对象
1002
+ let urlObject = window.URL || window.webkitURL || window
1003
+ let url = urlObject.createObjectURL(content)
1004
+ // 生成<a></a>DOM元素
1005
+ let el = document.createElement('a')
1006
+ // 链接赋值
1007
+ el.href = url
1008
+ el.download = 'ChanelizationParam.json'
1009
+ // 必须点击否则不会下载
1010
+ el.click()
1011
+ // 移除链接释放资源
1012
+ urlObject.revokeObjectURL(url)
1013
+ }
1014
+ },
1015
+ mounted () {
1016
+ this.handleClickSketchpad()
1017
+ }
1018
+ }
1019
+ </script>
1020
+
1021
+ <style lang="css" rel="stylesheet/scss">
1022
+ </style>