Pre Merge pull request !27 from harston/结构优化

This commit is contained in:
harston 2024-02-04 07:24:48 +00:00 committed by Gitee
commit eee8214136
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 69 additions and 48 deletions

View File

@ -508,6 +508,7 @@ public class DeviceServiceImpl implements IDeviceService {
} }
deviceChannelMapper.clearPlay(device.getDeviceId()); deviceChannelMapper.clearPlay(device.getDeviceId());
inviteStreamService.clearInviteInfo(device.getDeviceId()); inviteStreamService.clearInviteInfo(device.getDeviceId());
deviceInStore.setSwitchPrimarySubStream(device.isSwitchPrimarySubStream());
} }
if (!ObjectUtils.isEmpty(device.getName())) { if (!ObjectUtils.isEmpty(device.getName())) {
@ -597,6 +598,7 @@ public class DeviceServiceImpl implements IDeviceService {
} }
deviceChannelMapper.cleanChannelsByDeviceId(deviceId); deviceChannelMapper.cleanChannelsByDeviceId(deviceId);
deviceMapper.del(deviceId); deviceMapper.del(deviceId);
redisCatchStorage.removeDevice(deviceId);
return true; return true;
} }

View File

@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.channel;
import com.genersoft.iot.vmp.common.CommonGbChannel; import com.genersoft.iot.vmp.common.CommonGbChannel;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.conf.security.JwtUtils;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.service.ICommonGbChannelService; import com.genersoft.iot.vmp.service.ICommonGbChannelService;
@ -17,6 +18,7 @@ import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -56,7 +58,7 @@ public class CommonChannelPlatformController {
/** /**
* 向上级平台添加国标通道 * 向上级平台添加国标通道
*/ */
@Operation(summary = "向上级平台添加国标通道") @Operation(summary = "向上级平台添加国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
@PostMapping("/add") @PostMapping("/add")
@ResponseBody @ResponseBody
public void addChannelForGB(@RequestBody UpdateChannelParam param) { public void addChannelForGB(@RequestBody UpdateChannelParam param) {
@ -85,7 +87,7 @@ public class CommonChannelPlatformController {
* @param param 通道关联参数 * @param param 通道关联参数
* @return * @return
*/ */
@Operation(summary = "从上级平台移除国标通道") @Operation(summary = "从上级平台移除国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ResponseBody @ResponseBody
public void delChannelForGB(@RequestBody UpdateChannelParam param) { public void delChannelForGB(@RequestBody UpdateChannelParam param) {

View File

@ -1,12 +1,14 @@
package com.genersoft.iot.vmp.vmanager.group; package com.genersoft.iot.vmp.vmanager.group;
import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.conf.security.JwtUtils;
import com.genersoft.iot.vmp.service.IGroupService; import com.genersoft.iot.vmp.service.IGroupService;
import com.genersoft.iot.vmp.service.bean.Group; import com.genersoft.iot.vmp.service.bean.Group;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -26,7 +28,7 @@ public class GroupController {
@Autowired @Autowired
private IGroupService groupService; private IGroupService groupService;
@Operation(summary = "添加区域") @Operation(summary = "添加区域", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "group", description = "Group", required = true) @Parameter(name = "group", description = "Group", required = true)
@ResponseBody @ResponseBody
@PostMapping("/add") @PostMapping("/add")
@ -34,7 +36,7 @@ public class GroupController {
groupService.add(group); groupService.add(group);
} }
@Operation(summary = "查询区域") @Operation(summary = "查询区域", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "query", description = "查询内容", required = true) @Parameter(name = "query", description = "查询内容", required = true)
@Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "page", description = "当前页", required = true)
@Parameter(name = "count", description = "每页查询数量", required = true) @Parameter(name = "count", description = "每页查询数量", required = true)
@ -48,7 +50,7 @@ public class GroupController {
return groupService.queryGroup(query, page, count); return groupService.queryGroup(query, page, count);
} }
@Operation(summary = "更新区域") @Operation(summary = "更新区域", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "group", description = "Group", required = true) @Parameter(name = "group", description = "Group", required = true)
@ResponseBody @ResponseBody
@PostMapping("/update") @PostMapping("/update")
@ -56,7 +58,7 @@ public class GroupController {
groupService.update(group); groupService.update(group);
} }
@Operation(summary = "删除区域") @Operation(summary = "删除区域", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "groupDeviceId", description = "待删除的节点编号", required = true) @Parameter(name = "groupDeviceId", description = "待删除的节点编号", required = true)
@ResponseBody @ResponseBody
@GetMapping("/delete") @GetMapping("/delete")
@ -68,7 +70,7 @@ public class GroupController {
} }
} }
@Operation(summary = "查询区域的子节点") @Operation(summary = "查询区域的子节点", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "groupParentId", description = "待查询的节点", required = true) @Parameter(name = "groupParentId", description = "待查询的节点", required = true)
@Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "page", description = "当前页", required = true)
@Parameter(name = "count", description = "每页查询数量", required = true) @Parameter(name = "count", description = "每页查询数量", required = true)

View File

@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.vmanager.region; package com.genersoft.iot.vmp.vmanager.region;
import com.genersoft.iot.vmp.conf.exception.ControllerException; import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.conf.security.JwtUtils;
import com.genersoft.iot.vmp.gb28181.bean.Gb28181CodeType; import com.genersoft.iot.vmp.gb28181.bean.Gb28181CodeType;
import com.genersoft.iot.vmp.service.IRegionService; import com.genersoft.iot.vmp.service.IRegionService;
import com.genersoft.iot.vmp.service.bean.Region; import com.genersoft.iot.vmp.service.bean.Region;
@ -8,6 +9,7 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -27,7 +29,7 @@ public class RegionController {
@Autowired @Autowired
private IRegionService regionService; private IRegionService regionService;
@Operation(summary = "添加区域") @Operation(summary = "添加区域",security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "region", description = "Region", required = true) @Parameter(name = "region", description = "Region", required = true)
@ResponseBody @ResponseBody
@PostMapping("/add") @PostMapping("/add")
@ -35,7 +37,7 @@ public class RegionController {
regionService.add(region); regionService.add(region);
} }
@Operation(summary = "查询区域") @Operation(summary = "查询区域", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "query", description = "要搜索的内容", required = true) @Parameter(name = "query", description = "要搜索的内容", required = true)
@Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "page", description = "当前页", required = true)
@Parameter(name = "count", description = "每页查询数量", required = true) @Parameter(name = "count", description = "每页查询数量", required = true)
@ -49,7 +51,7 @@ public class RegionController {
return regionService.query(query, page, count); return regionService.query(query, page, count);
} }
@Operation(summary = "更新区域") @Operation(summary = "更新区域" , security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "region", description = "Region", required = true) @Parameter(name = "region", description = "Region", required = true)
@ResponseBody @ResponseBody
@PostMapping("/update") @PostMapping("/update")
@ -57,7 +59,7 @@ public class RegionController {
regionService.update(region); regionService.update(region);
} }
@Operation(summary = "删除区域") @Operation(summary = "删除区域" , security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "regionDeviceId", description = "区域编码", required = true) @Parameter(name = "regionDeviceId", description = "区域编码", required = true)
@ResponseBody @ResponseBody
@GetMapping("/delete") @GetMapping("/delete")
@ -69,7 +71,7 @@ public class RegionController {
} }
} }
@Operation(summary = "分页区域子节点") @Operation(summary = "分页区域子节点", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "regionParentId", description = "行政区划父节点编号", required = true) @Parameter(name = "regionParentId", description = "行政区划父节点编号", required = true)
@Parameter(name = "page", description = "当前页", required = true) @Parameter(name = "page", description = "当前页", required = true)
@Parameter(name = "count", description = "每页查询数量", required = true) @Parameter(name = "count", description = "每页查询数量", required = true)
@ -86,7 +88,7 @@ public class RegionController {
return regionService.queryChildRegionList(regionParentId, page, count); return regionService.queryChildRegionList(regionParentId, page, count);
} }
@Operation(summary = "根据区域Id查询区域") @Operation(summary = "根据区域Id查询区域", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "regionDeviceId", description = "行政区划节点编号", required = true) @Parameter(name = "regionDeviceId", description = "行政区划节点编号", required = true)
@ResponseBody @ResponseBody
@GetMapping("/one") @GetMapping("/one")
@ -99,7 +101,7 @@ public class RegionController {
return regionService.queryRegionByDeviceId(regionDeviceId); return regionService.queryRegionByDeviceId(regionDeviceId);
} }
@Operation(summary = "获取所属的行政区划下的行政区划") @Operation(summary = "获取所属的行政区划下的行政区划", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "parent", description = "所属的行政区划", required = false) @Parameter(name = "parent", description = "所属的行政区划", required = false)
@ResponseBody @ResponseBody
@GetMapping("/base/child/list") @GetMapping("/base/child/list")

View File

@ -36,7 +36,6 @@
:error="videoError" :error="videoError"
:message="videoError" :message="videoError"
:hasAudio="hasAudio" :hasAudio="hasAudio"
style="max-height: 100%"
fluent autoplay live ></player> fluent autoplay live ></player>
</div> </div>
<div class="player-option-box"> <div class="player-option-box">
@ -137,8 +136,11 @@
margin: "10px auto 10px auto" margin: "10px auto 10px auto"
}, },
playerStyle: { playerStyle: {
"display": "flex",
"justify-content": "center",
"align-items": "center",
"margin": "0 auto 20px auto", "margin": "0 auto 20px auto",
"height": this.winHeight + "px", "height": this.winHeight + "px"
}, },
winHeight: window.innerHeight - 240, winHeight: window.innerHeight - 240,
playTime: null, playTime: null,
@ -178,17 +180,25 @@
}, },
mounted() { mounted() {
this.recordListStyle.height = this.winHeight + "px"; this.$nextTick(() => {
this.playerStyle["height"] = this.winHeight + "px"; this.updateWinHeight();
this.chooseDate = moment().format('YYYY-MM-DD') this.chooseDate = moment().format('YYYY-MM-DD')
this.dateChange(); this.dateChange();
window.addEventListener('beforeunload', this.stopPlayRecord) window.addEventListener('resize',this.updateWinHeight)
window.addEventListener('beforeunload', this.stopPlayRecord)
})
}, },
destroyed() { destroyed() {
this.$destroy('recordVideoPlayer'); this.$destroy('recordVideoPlayer');
window.removeEventListener('beforeunload', this.stopPlayRecord) window.removeEventListener('beforeunload', this.stopPlayRecord)
window.removeEventListener('resize',this.updateWinHeight)
}, },
methods: { methods: {
updateWinHeight(){
this.winHeight=window.innerHeight - 240;
this.recordListStyle.height = this.winHeight + "px";
this.playerStyle.height = this.winHeight + "px";
},
dateChange(){ dateChange(){
if (!this.chooseDate) { if (!this.chooseDate) {
return; return;

View File

@ -1,23 +1,25 @@
<template> <template>
<div ref="container" @dblclick="fullscreenSwich" <div ref="container">
style="width:100%;height:518px; min-height: 200px;background-color: #000000;margin:0 auto;position: relative;"> <div ref="playerContainer" @dblclick="fullscreenSwich"
<div class="buttons-box" id="buttonsBox"> style="width:100%;height:100%;background-color: #000000;margin:0 auto;position: relative;">
<div class="buttons-box-left"> <div class="buttons-box" id="buttonsBox">
<i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> <div class="buttons-box-left">
<i v-if="playing" class="iconfont icon-pause jessibuca-btn" @click="pause"></i> <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i>
<i class="iconfont icon-stop jessibuca-btn" @click="destroy"></i> <i v-if="playing" class="iconfont icon-pause jessibuca-btn" @click="pause"></i>
<i v-if="isNotMute" class="iconfont icon-audio-high jessibuca-btn" @click="mute()"></i> <i class="iconfont icon-stop jessibuca-btn" @click="destroy"></i>
<i v-if="!isNotMute" class="iconfont icon-audio-mute jessibuca-btn" @click="cancelMute()"></i> <i v-if="isNotMute" class="iconfont icon-audio-high jessibuca-btn" @click="mute()"></i>
</div> <i v-if="!isNotMute" class="iconfont icon-audio-mute jessibuca-btn" @click="cancelMute()"></i>
<div class="buttons-box-right"> </div>
<span class="jessibuca-btn">{{ kBps }} kb/s</span> <div class="buttons-box-right">
<!-- <i class="iconfont icon-file-record1 jessibuca-btn"></i>--> <span class="jessibuca-btn">{{ kBps }} kb/s</span>
<!-- <i class="iconfont icon-xiangqing2 jessibuca-btn" ></i>--> <!-- <i class="iconfont icon-file-record1 jessibuca-btn"></i>-->
<i class="iconfont icon-camera1196054easyiconnet jessibuca-btn" @click="screenshot" <!-- <i class="iconfont icon-xiangqing2 jessibuca-btn" ></i>-->
style="font-size: 1rem !important"></i> <i class="iconfont icon-camera1196054easyiconnet jessibuca-btn" @click="screenshot"
<i class="iconfont icon-shuaxin11 jessibuca-btn" @click="playBtnClick"></i> style="font-size: 1rem !important"></i>
<i v-if="!fullscreen" class="iconfont icon-weibiaoti10 jessibuca-btn" @click="fullscreenSwich"></i> <i class="iconfont icon-shuaxin11 jessibuca-btn" @click="playBtnClick"></i>
<i v-if="fullscreen" class="iconfont icon-weibiaoti11 jessibuca-btn" @click="fullscreenSwich"></i> <i v-if="!fullscreen" class="iconfont icon-weibiaoti10 jessibuca-btn" @click="fullscreenSwich"></i>
<i v-if="fullscreen" class="iconfont icon-weibiaoti11 jessibuca-btn" @click="fullscreenSwich"></i>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -46,13 +48,11 @@ export default {
}; };
}, },
props: ['videoUrl', 'error', 'hasAudio', 'height'], props: ['videoUrl', 'error', 'hasAudio', 'height'],
created() { mounted() {
let paramUrl = decodeURIComponent(this.$route.params.url) let paramUrl = decodeURIComponent(this.$route.params.url)
this.$nextTick(() => { this.$nextTick(() => {
this.updatePlayerDomSize() this.updatePlayerDomSize()
window.onresize = () => { window.addEventListener('resize',this.updatePlayerDomSize)
this.updatePlayerDomSize()
}
if (typeof (this.videoUrl) == "undefined") { if (typeof (this.videoUrl) == "undefined") {
this.videoUrl = paramUrl; this.videoUrl = paramUrl;
} }
@ -63,7 +63,10 @@ export default {
videoUrl: { videoUrl: {
handler(val, _) { handler(val, _) {
this.$nextTick(() => { this.$nextTick(() => {
this.play(val); if(val) {
this.play(val);
}
this.updatePlayerDomSize()
}) })
}, },
immediate: true immediate: true
@ -74,8 +77,7 @@ export default {
let dom = this.$refs.container; let dom = this.$refs.container;
let width = dom.parentNode.clientWidth let width = dom.parentNode.clientWidth
let height = (9 / 16) * width let height = (9 / 16) * width
const clientHeight = Math.min(dom.parentNode.clientHeight?dom.parentNode.clientHeight:document.body.clientHeight, document.documentElement.clientHeight)
const clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight)
if (height > clientHeight) { if (height > clientHeight) {
height = clientHeight height = clientHeight
width = (16 / 9) * height width = (16 / 9) * height
@ -87,7 +89,7 @@ export default {
}, },
create() { create() {
let options = { let options = {
container: this.$refs.container, container: this.$refs.playerContainer,
autoWasm: true, autoWasm: true,
background: "", background: "",
controlAutoHide: false, controlAutoHide: false,
@ -257,6 +259,7 @@ export default {
this.playing = false; this.playing = false;
this.loaded = false; this.loaded = false;
this.performance = ""; this.performance = "";
window.removeEventListener('resize',this.updatePlayerDomSize);
}, },
} }
</script> </script>