Commit 29d69267f9747f268a967a039f685da7e85da3a8
1 parent
ad4afd9d
优化通道选择页面样式和优化拉框放大与缩小的接口路径
Showing
5 changed files
with
103 additions
and
141 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceControl.java
| @@ -296,4 +296,103 @@ public class DeviceControl { | @@ -296,4 +296,103 @@ public class DeviceControl { | ||
| 296 | resultHolder.put(key, uuid, result); | 296 | resultHolder.put(key, uuid, result); |
| 297 | return result; | 297 | return result; |
| 298 | } | 298 | } |
| 299 | + | ||
| 300 | + /** | ||
| 301 | + * 拉框放大 | ||
| 302 | + * @param deviceId 设备id | ||
| 303 | + * @param channelId 通道id | ||
| 304 | + * @param length 播放窗口长度像素值 | ||
| 305 | + * @param width 播放窗口宽度像素值 | ||
| 306 | + * @param midpointx 拉框中心的横轴坐标像素值 | ||
| 307 | + * @param midpointy 拉框中心的纵轴坐标像素值 | ||
| 308 | + * @param lengthx 拉框长度像素值 | ||
| 309 | + * @param lengthy 拉框宽度像素值 | ||
| 310 | + * @return | ||
| 311 | + */ | ||
| 312 | + @ApiOperation("拉框放大") | ||
| 313 | + @ApiImplicitParams({ | ||
| 314 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), | ||
| 315 | + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 316 | + @ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class), | ||
| 317 | + @ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class), | ||
| 318 | + @ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class), | ||
| 319 | + @ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class), | ||
| 320 | + @ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class), | ||
| 321 | + @ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class), | ||
| 322 | + }) | ||
| 323 | + @GetMapping("drag_zoom/zoom_in") | ||
| 324 | + public ResponseEntity<String> dragZoomIn(@RequestParam String deviceId, | ||
| 325 | + @RequestParam(required = false) String channelId, | ||
| 326 | + @RequestParam int length, | ||
| 327 | + @RequestParam int width, | ||
| 328 | + @RequestParam int midpointx, | ||
| 329 | + @RequestParam int midpointy, | ||
| 330 | + @RequestParam int lengthx, | ||
| 331 | + @RequestParam int lengthy){ | ||
| 332 | + if (logger.isDebugEnabled()) { | ||
| 333 | + logger.debug(String.format("设备拉框放大 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy)); | ||
| 334 | + } | ||
| 335 | + Device device = storager.queryVideoDevice(deviceId); | ||
| 336 | + StringBuffer cmdXml = new StringBuffer(200); | ||
| 337 | + cmdXml.append("<DragZoomIn>\r\n"); | ||
| 338 | + cmdXml.append("<Length>" + length+ "</Length>\r\n"); | ||
| 339 | + cmdXml.append("<Width>" + width+ "</Width>\r\n"); | ||
| 340 | + cmdXml.append("<MidPointX>" + midpointx+ "</MidPointX>\r\n"); | ||
| 341 | + cmdXml.append("<MidPointY>" + midpointy+ "</MidPointY>\r\n"); | ||
| 342 | + cmdXml.append("<LengthX>" + lengthx+ "</LengthX>\r\n"); | ||
| 343 | + cmdXml.append("<LengthY>" + lengthy+ "</LengthY>\r\n"); | ||
| 344 | + cmdXml.append("</DragZoomIn>\r\n"); | ||
| 345 | + cmder.dragZoomCmd(device, channelId, cmdXml.toString()); | ||
| 346 | + return new ResponseEntity<String>("success", HttpStatus.OK); | ||
| 347 | + } | ||
| 348 | + | ||
| 349 | + /** | ||
| 350 | + * 拉框缩小 | ||
| 351 | + * @param deviceId 设备id | ||
| 352 | + * @param channelId 通道id | ||
| 353 | + * @param length 播放窗口长度像素值 | ||
| 354 | + * @param width 播放窗口宽度像素值 | ||
| 355 | + * @param midpointx 拉框中心的横轴坐标像素值 | ||
| 356 | + * @param midpointy 拉框中心的纵轴坐标像素值 | ||
| 357 | + * @param lengthx 拉框长度像素值 | ||
| 358 | + * @param lengthy 拉框宽度像素值 | ||
| 359 | + * @return | ||
| 360 | + */ | ||
| 361 | + @ApiOperation("拉框缩小") | ||
| 362 | + @ApiImplicitParams({ | ||
| 363 | + @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), | ||
| 364 | + @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 365 | + @ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class), | ||
| 366 | + @ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class), | ||
| 367 | + @ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class), | ||
| 368 | + @ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class), | ||
| 369 | + @ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class), | ||
| 370 | + @ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class), | ||
| 371 | + }) | ||
| 372 | + @GetMapping("/drag_zoom/zoom_out") | ||
| 373 | + public ResponseEntity<String> dragZoomOut(@RequestParam String deviceId, | ||
| 374 | + @RequestParam(required = false) String channelId, | ||
| 375 | + @RequestParam int length, | ||
| 376 | + @RequestParam int width, | ||
| 377 | + @RequestParam int midpointx, | ||
| 378 | + @RequestParam int midpointy, | ||
| 379 | + @RequestParam int lengthx, | ||
| 380 | + @RequestParam int lengthy){ | ||
| 381 | + | ||
| 382 | + if (logger.isDebugEnabled()) { | ||
| 383 | + logger.debug(String.format("设备拉框缩小 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy)); | ||
| 384 | + } | ||
| 385 | + Device device = storager.queryVideoDevice(deviceId); | ||
| 386 | + StringBuffer cmdXml = new StringBuffer(200); | ||
| 387 | + cmdXml.append("<DragZoomOut>\r\n"); | ||
| 388 | + cmdXml.append("<Length>" + length+ "</Length>\r\n"); | ||
| 389 | + cmdXml.append("<Width>" + width+ "</Width>\r\n"); | ||
| 390 | + cmdXml.append("<MidPointX>" + midpointx+ "</MidPointX>\r\n"); | ||
| 391 | + cmdXml.append("<MidPointY>" + midpointy+ "</MidPointY>\r\n"); | ||
| 392 | + cmdXml.append("<LengthX>" + lengthx+ "</LengthX>\r\n"); | ||
| 393 | + cmdXml.append("<LengthY>" + lengthy+ "</LengthY>\r\n"); | ||
| 394 | + cmdXml.append("</DragZoomOut>\r\n"); | ||
| 395 | + cmder.dragZoomCmd(device, channelId, cmdXml.toString()); | ||
| 396 | + return new ResponseEntity<String>("success",HttpStatus.OK); | ||
| 397 | + } | ||
| 299 | } | 398 | } |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/dragZoom/DragZoomControl.java deleted
100644 → 0
| 1 | -package com.genersoft.iot.vmp.vmanager.gb28181.dragZoom; | ||
| 2 | - | ||
| 3 | -import com.genersoft.iot.vmp.gb28181.bean.Device; | ||
| 4 | -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | ||
| 5 | -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | ||
| 6 | -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | ||
| 7 | -import io.swagger.annotations.Api; | ||
| 8 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 9 | -import io.swagger.annotations.ApiImplicitParams; | ||
| 10 | -import io.swagger.annotations.ApiOperation; | ||
| 11 | -import org.slf4j.Logger; | ||
| 12 | -import org.slf4j.LoggerFactory; | ||
| 13 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | -import org.springframework.http.HttpStatus; | ||
| 15 | -import org.springframework.http.ResponseEntity; | ||
| 16 | -import org.springframework.web.bind.annotation.*; | ||
| 17 | - | ||
| 18 | -/** | ||
| 19 | - * @author szy | ||
| 20 | - * @date 21:55 2022/1/15 | ||
| 21 | - */ | ||
| 22 | -@Api(tags = "拉框控制") | ||
| 23 | -@CrossOrigin | ||
| 24 | -@RestController | ||
| 25 | -@RequestMapping("/api/dragZoom") | ||
| 26 | -public class DragZoomControl { | ||
| 27 | - | ||
| 28 | - private final static Logger logger = LoggerFactory.getLogger(DragZoomControl.class); | ||
| 29 | - | ||
| 30 | - @Autowired | ||
| 31 | - private SIPCommander cmder; | ||
| 32 | - | ||
| 33 | - @Autowired | ||
| 34 | - private IVideoManagerStorager storager; | ||
| 35 | - | ||
| 36 | - @Autowired | ||
| 37 | - private DeferredResultHolder resultHolder; | ||
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 拉框放大 | ||
| 41 | - * @param deviceId 设备id | ||
| 42 | - * @param channelId 通道id | ||
| 43 | - * @param length 播放窗口长度像素值 | ||
| 44 | - * @param width 播放窗口宽度像素值 | ||
| 45 | - * @param midpointx 拉框中心的横轴坐标像素值 | ||
| 46 | - * @param midpointy 拉框中心的纵轴坐标像素值 | ||
| 47 | - * @param lengthx 拉框长度像素值 | ||
| 48 | - * @param lengthy 拉框宽度像素值 | ||
| 49 | - * @return | ||
| 50 | - */ | ||
| 51 | - @ApiOperation("拉框放大") | ||
| 52 | - @ApiImplicitParams({ | ||
| 53 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), | ||
| 54 | - @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 55 | - @ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class), | ||
| 56 | - @ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class), | ||
| 57 | - @ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class), | ||
| 58 | - @ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class), | ||
| 59 | - @ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class), | ||
| 60 | - @ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class), | ||
| 61 | - }) | ||
| 62 | - @GetMapping("/dragzoomin") | ||
| 63 | - public ResponseEntity<String> dragZoomIn(@RequestParam String deviceId, | ||
| 64 | - @RequestParam(required = false) String channelId, | ||
| 65 | - @RequestParam int length, | ||
| 66 | - @RequestParam int width, | ||
| 67 | - @RequestParam int midpointx, | ||
| 68 | - @RequestParam int midpointy, | ||
| 69 | - @RequestParam int lengthx, | ||
| 70 | - @RequestParam int lengthy){ | ||
| 71 | - if (logger.isDebugEnabled()) { | ||
| 72 | - logger.debug(String.format("设备拉框放大 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy)); | ||
| 73 | - } | ||
| 74 | - Device device = storager.queryVideoDevice(deviceId); | ||
| 75 | - StringBuffer cmdXml = new StringBuffer(200); | ||
| 76 | - cmdXml.append("<DragZoomIn>\r\n"); | ||
| 77 | - cmdXml.append("<Length>" + length+ "</Length>\r\n"); | ||
| 78 | - cmdXml.append("<Width>" + width+ "</Width>\r\n"); | ||
| 79 | - cmdXml.append("<MidPointX>" + midpointx+ "</MidPointX>\r\n"); | ||
| 80 | - cmdXml.append("<MidPointY>" + midpointy+ "</MidPointY>\r\n"); | ||
| 81 | - cmdXml.append("<LengthX>" + lengthx+ "</LengthX>\r\n"); | ||
| 82 | - cmdXml.append("<LengthY>" + lengthy+ "</LengthY>\r\n"); | ||
| 83 | - cmdXml.append("</DragZoomIn>\r\n"); | ||
| 84 | - cmder.dragZoomCmd(device, channelId, cmdXml.toString()); | ||
| 85 | - return new ResponseEntity<String>("success", HttpStatus.OK); | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - /** | ||
| 89 | - * 拉框缩小 | ||
| 90 | - * @param deviceId 设备id | ||
| 91 | - * @param channelId 通道id | ||
| 92 | - * @param length 播放窗口长度像素值 | ||
| 93 | - * @param width 播放窗口宽度像素值 | ||
| 94 | - * @param midpointx 拉框中心的横轴坐标像素值 | ||
| 95 | - * @param midpointy 拉框中心的纵轴坐标像素值 | ||
| 96 | - * @param lengthx 拉框长度像素值 | ||
| 97 | - * @param lengthy 拉框宽度像素值 | ||
| 98 | - * @return | ||
| 99 | - */ | ||
| 100 | - @ApiOperation("拉框缩小") | ||
| 101 | - @ApiImplicitParams({ | ||
| 102 | - @ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class), | ||
| 103 | - @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), | ||
| 104 | - @ApiImplicitParam(name = "length", value = "播放窗口长度像素值", required = true, dataTypeClass = Integer.class), | ||
| 105 | - @ApiImplicitParam(name = "width", value = "播放窗口宽度像素值", required = true, dataTypeClass = Integer.class), | ||
| 106 | - @ApiImplicitParam(name = "midpointx", value = "拉框中心的横轴坐标像素值", required = true, dataTypeClass = Integer.class), | ||
| 107 | - @ApiImplicitParam(name = "midpointy", value = "拉框中心的纵轴坐标像素值", required = true, dataTypeClass = Integer.class), | ||
| 108 | - @ApiImplicitParam(name = "lengthx", value = "拉框长度像素值", required = true, dataTypeClass = Integer.class), | ||
| 109 | - @ApiImplicitParam(name = "lengthy", value = "拉框宽度像素值", required = true, dataTypeClass = Integer.class), | ||
| 110 | - }) | ||
| 111 | - @GetMapping("/dragzoomout") | ||
| 112 | - public ResponseEntity<String> dragZoomOut(@RequestParam String deviceId, | ||
| 113 | - @RequestParam(required = false) String channelId, | ||
| 114 | - @RequestParam int length, | ||
| 115 | - @RequestParam int width, | ||
| 116 | - @RequestParam int midpointx, | ||
| 117 | - @RequestParam int midpointy, | ||
| 118 | - @RequestParam int lengthx, | ||
| 119 | - @RequestParam int lengthy){ | ||
| 120 | - | ||
| 121 | - if (logger.isDebugEnabled()) { | ||
| 122 | - logger.debug(String.format("设备拉框缩小 API调用,deviceId:%s ,channelId:%s ,length:%d ,width:%d ,midpointx:%d ,midpointy:%d ,lengthx:%d ,lengthy:%d",deviceId, channelId, length, width, midpointx, midpointy,lengthx, lengthy)); | ||
| 123 | - } | ||
| 124 | - Device device = storager.queryVideoDevice(deviceId); | ||
| 125 | - StringBuffer cmdXml = new StringBuffer(200); | ||
| 126 | - cmdXml.append("<DragZoomOut>\r\n"); | ||
| 127 | - cmdXml.append("<Length>" + length+ "</Length>\r\n"); | ||
| 128 | - cmdXml.append("<Width>" + width+ "</Width>\r\n"); | ||
| 129 | - cmdXml.append("<MidPointX>" + midpointx+ "</MidPointX>\r\n"); | ||
| 130 | - cmdXml.append("<MidPointY>" + midpointy+ "</MidPointY>\r\n"); | ||
| 131 | - cmdXml.append("<LengthX>" + lengthx+ "</LengthX>\r\n"); | ||
| 132 | - cmdXml.append("<LengthY>" + lengthy+ "</LengthY>\r\n"); | ||
| 133 | - cmdXml.append("</DragZoomOut>\r\n"); | ||
| 134 | - cmder.dragZoomCmd(device, channelId, cmdXml.toString()); | ||
| 135 | - return new ResponseEntity<String>("success",HttpStatus.OK); | ||
| 136 | - } | ||
| 137 | - | ||
| 138 | -} |
web_src/src/components/dialog/chooseChannel.vue
| @@ -70,7 +70,8 @@ export default { | @@ -70,7 +70,8 @@ export default { | ||
| 70 | platformName: "", | 70 | platformName: "", |
| 71 | defaultCatalogId: "", | 71 | defaultCatalogId: "", |
| 72 | showDialog: false, | 72 | showDialog: false, |
| 73 | - chooseData: {} | 73 | + chooseData: {}, |
| 74 | + winHeight: window.innerHeight - 250, | ||
| 74 | 75 | ||
| 75 | }; | 76 | }; |
| 76 | }, | 77 | }, |
web_src/src/components/dialog/chooseChannelForGb.vue
web_src/src/components/dialog/importChannel.vue
| @@ -38,7 +38,7 @@ export default { | @@ -38,7 +38,7 @@ export default { | ||
| 38 | showDialog: false, | 38 | showDialog: false, |
| 39 | isLoging: false, | 39 | isLoging: false, |
| 40 | isEdit: false, | 40 | isEdit: false, |
| 41 | - uploadUrl: "debug/api/push/upload", | 41 | + uploadUrl: process.env.NODE_ENV === 'development'?`debug/api/push/upload`:`api/push/upload`, |
| 42 | }; | 42 | }; |
| 43 | }, | 43 | }, |
| 44 | methods: { | 44 | methods: { |