提交代码
parent
f31d243dcf
commit
6db214839c
|
@ -52,6 +52,15 @@ export function updateVideoConfigSort(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 修改视频配置
|
||||
export function editPassageState(data) {
|
||||
return request({
|
||||
url: '/video/videoConfig/editPassageState',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除视频配置
|
||||
export function delVideoConfig(id) {
|
||||
return request({
|
||||
|
|
|
@ -139,7 +139,11 @@
|
|||
width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="通道数量" align="center" prop="videoPassageCount" />
|
||||
<el-table-column label="通道数量" align="center" prop="videoPassageCount">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.videoPassageCount }} / {{ scope.row.passagePassCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备排序" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
|
@ -152,7 +156,7 @@
|
|||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="通信状态" align="center" prop="signalState" v-if="false">
|
||||
<el-table-column label="通信状态" align="center" prop="signalState">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.project_video_signal_state"
|
||||
|
@ -166,11 +170,6 @@
|
|||
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数据状态" align="center" prop="isDel">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
|
@ -323,7 +322,7 @@ export default {
|
|||
components: {
|
||||
videoPlayDrawer,
|
||||
},
|
||||
dicts: ["project_video_type", "project_video_signal_state", "sys_common_isdel"],
|
||||
dicts: ["project_video_type", "project_video_signal_state"],
|
||||
data() {
|
||||
return {
|
||||
projectOptions: [],
|
||||
|
|
|
@ -95,8 +95,12 @@
|
|||
width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="通道数量" align="center" prop="videoPassageCount" />
|
||||
<el-table-column label="通信状态" align="center" prop="signalState" v-if="false">
|
||||
<el-table-column label="通道数量" align="center" prop="videoPassageCount">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.videoPassageCount }} / {{ scope.row.passagePassCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="通信状态" align="center" prop="signalState">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.project_video_signal_state"
|
||||
|
|
|
@ -8,24 +8,36 @@
|
|||
@close="onClose"
|
||||
style="padding-left: 20px"
|
||||
>
|
||||
<div class="videoView">
|
||||
<H265Player :url="url0" @on-error="handleOnError" />
|
||||
<div class="videoView" v-if="showVideoView0">
|
||||
<H265Player :url="url0" @on-error="handleOnError0" />
|
||||
</div>
|
||||
<div class="videoView">
|
||||
<H265Player :url="url1" @on-error="handleOnError" />
|
||||
<div class="videoView videoViewError" v-if="showVideoView0 == false">
|
||||
设备0通道链接失败!请及时检查!
|
||||
</div>
|
||||
<div class="videoView">
|
||||
<H265Player :url="url2" @on-error="handleOnError" />
|
||||
<div class="videoView" v-if="showVideoView1">
|
||||
<H265Player :url="url1" @on-error="handleOnError1" />
|
||||
</div>
|
||||
<div class="videoView">
|
||||
<H265Player :url="url3" @on-error="handleOnError" />
|
||||
<div class="videoView videoViewError" v-if="showVideoView1 == false">
|
||||
设备1通道链接失败!请及时检查!
|
||||
</div>
|
||||
<div class="videoView" v-if="showVideoView2">
|
||||
<H265Player :url="url2" @on-error="handleOnError2" />
|
||||
</div>
|
||||
<div class="videoView videoViewError" v-if="showVideoView2 == false">
|
||||
设备2通道链接失败!请及时检查!
|
||||
</div>
|
||||
<div class="videoView" v-if="showVideoView3">
|
||||
<H265Player :url="url3" @on-error="handleOnError3" />
|
||||
</div>
|
||||
<div class="videoView videoViewError" v-if="showVideoView3 == false">
|
||||
设备3通道链接失败!请及时检查!
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getVideoPassage } from "@/api/video/videoConfig";
|
||||
import { getVideoPassage, editPassageState } from "@/api/video/videoConfig";
|
||||
import H265Player from "vue-h265-player";
|
||||
|
||||
export default {
|
||||
|
@ -46,6 +58,11 @@ export default {
|
|||
url1: "",
|
||||
url2: "",
|
||||
url3: "",
|
||||
showVideoView0: true,
|
||||
showVideoView1: true,
|
||||
showVideoView2: true,
|
||||
showVideoView3: true,
|
||||
videoPassageList: [],
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
|
@ -59,6 +76,7 @@ export default {
|
|||
);
|
||||
this.initVideo();
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
|
@ -67,13 +85,31 @@ export default {
|
|||
methods: {
|
||||
onOpen() {},
|
||||
onClose() {},
|
||||
handleOnError(error) {
|
||||
handleOnError0(error) {
|
||||
this.showVideoView0 = false;
|
||||
console.log("error: ", error);
|
||||
this.updatePassageState(this.videoPassageList[0].id);
|
||||
},
|
||||
handleOnError1(error) {
|
||||
this.showVideoView1 = false;
|
||||
console.log("error: ", error);
|
||||
this.updatePassageState(this.videoPassageList[1].id);
|
||||
},
|
||||
handleOnError2(error) {
|
||||
this.showVideoView2 = false;
|
||||
console.log("error: ", error);
|
||||
this.updatePassageState(this.videoPassageList[2].id);
|
||||
},
|
||||
handleOnError3(error) {
|
||||
this.showVideoView3 = false;
|
||||
console.log("error: ", error);
|
||||
this.updatePassageState(this.videoPassageList[3].id);
|
||||
},
|
||||
//查询视频通道
|
||||
initVideo() {
|
||||
getVideoPassage(this.formData.videoDvrNumber).then((response) => {
|
||||
let data = response.data;
|
||||
this.videoPassageList = data;
|
||||
data.forEach((it, idx) => {
|
||||
if (idx == 0) {
|
||||
this.url0 = this.request.replace("{{passage}}", it.passageValue);
|
||||
|
@ -90,6 +126,14 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
updatePassageState(id) {
|
||||
let param = {
|
||||
id: id,
|
||||
videoDvrNumber: this.formData.videoDvrNumber,
|
||||
passageState: "2",
|
||||
};
|
||||
editPassageState(param);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -105,4 +149,9 @@ export default {
|
|||
width: 50%;
|
||||
height: 50%;
|
||||
}
|
||||
.videoViewError {
|
||||
background-color: #575e65;
|
||||
text-align: center;
|
||||
line-height: 324px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -7,30 +7,57 @@
|
|||
:title="item.videoName"
|
||||
@click="handlePlay(item, index)"
|
||||
:class="{ bg_color: currentIndex == index }"
|
||||
>{{ item.videoName }}</span
|
||||
:style="{
|
||||
'--bgColor':
|
||||
item.signalState == 1
|
||||
? 'green'
|
||||
: item.signalState == 2
|
||||
? 'red'
|
||||
: '#aaaaaa',
|
||||
}"
|
||||
>
|
||||
{{ item.videoName }}({{ item.videoPassageCount }}/{{
|
||||
item.passagePassCount
|
||||
}})</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right" v-if="showVideo">
|
||||
<div class="videoView">
|
||||
<H265Player :url="url0" @on-error="handleOnError" />
|
||||
<div class="videoView" v-if="showVideoView0">
|
||||
<H265Player :url="url0" @on-error="handleOnError0" />
|
||||
</div>
|
||||
<div class="videoView">
|
||||
<H265Player :url="url1" @on-error="handleOnError" />
|
||||
<div class="videoView videoViewError" v-if="showVideoView0 == false">
|
||||
设备0通道链接失败!请及时检查!
|
||||
</div>
|
||||
<div class="videoView">
|
||||
<H265Player :url="url2" @on-error="handleOnError" />
|
||||
<div class="videoView" v-if="showVideoView1">
|
||||
<H265Player :url="url1" @on-error="handleOnError1" />
|
||||
</div>
|
||||
<div class="videoView">
|
||||
<H265Player :url="url3" @on-error="handleOnError" />
|
||||
<div class="videoView videoViewError" v-if="showVideoView1 == false">
|
||||
设备1通道链接失败!请及时检查!
|
||||
</div>
|
||||
<div class="videoView" v-if="showVideoView2">
|
||||
<H265Player :url="url2" @on-error="handleOnError2" />
|
||||
</div>
|
||||
<div class="videoView videoViewError" v-if="showVideoView2 == false">
|
||||
设备2通道链接失败!请及时检查!
|
||||
</div>
|
||||
<div class="videoView" v-if="showVideoView3">
|
||||
<H265Player :url="url3" @on-error="handleOnError3" />
|
||||
</div>
|
||||
<div class="videoView videoViewError" v-if="showVideoView3 == false">
|
||||
设备3通道链接失败!请及时检查!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listVideoView, getVideoPassage } from "@/api/video/videoConfig";
|
||||
import {
|
||||
listVideoView,
|
||||
getVideoPassage,
|
||||
editPassageState,
|
||||
} from "@/api/video/videoConfig";
|
||||
import H265Player from "vue-h265-player";
|
||||
|
||||
export default {
|
||||
|
@ -52,6 +79,12 @@ export default {
|
|||
url1: "",
|
||||
url2: "",
|
||||
url3: "",
|
||||
showVideoView0: true,
|
||||
showVideoView1: true,
|
||||
showVideoView2: true,
|
||||
showVideoView3: true,
|
||||
videoPassageList: [],
|
||||
videoDvrNumber: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -72,6 +105,11 @@ export default {
|
|||
this.url1 = "";
|
||||
this.url2 = "";
|
||||
this.url3 = "";
|
||||
this.showVideoView0 = true;
|
||||
this.showVideoView1 = true;
|
||||
this.showVideoView2 = true;
|
||||
this.showVideoView3 = true;
|
||||
this.videoDvrNumber = it.videoDvrNumber;
|
||||
this.initVideo(
|
||||
it.videoDvrNumber,
|
||||
this.request.replace("{{videoDvrNumber}}", it.videoDvrNumber)
|
||||
|
@ -82,6 +120,7 @@ export default {
|
|||
let that = this;
|
||||
getVideoPassage(videoDvrNumber).then((response) => {
|
||||
let data = response.data;
|
||||
this.videoPassageList = data;
|
||||
that.showVideo = true;
|
||||
data.forEach((it, idx) => {
|
||||
if (idx == 0) {
|
||||
|
@ -99,8 +138,33 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
handleOnError(error) {
|
||||
handleOnError0(error) {
|
||||
this.showVideoView0 = false;
|
||||
console.log("error: ", error);
|
||||
this.updatePassageState(this.videoPassageList[0].id);
|
||||
},
|
||||
handleOnError1(error) {
|
||||
this.showVideoView1 = false;
|
||||
console.log("error: ", error);
|
||||
this.updatePassageState(this.videoPassageList[1].id);
|
||||
},
|
||||
handleOnError2(error) {
|
||||
this.showVideoView2 = false;
|
||||
console.log("error: ", error);
|
||||
this.updatePassageState(this.videoPassageList[2].id);
|
||||
},
|
||||
handleOnError3(error) {
|
||||
this.showVideoView3 = false;
|
||||
console.log("error: ", error);
|
||||
this.updatePassageState(this.videoPassageList[3].id);
|
||||
},
|
||||
updatePassageState(id) {
|
||||
let param = {
|
||||
id: id,
|
||||
videoDvrNumber: this.videoDvrNumber,
|
||||
passageState: "2",
|
||||
};
|
||||
editPassageState(param);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -108,7 +172,7 @@ export default {
|
|||
<style lang="scss" scoped>
|
||||
.app-container {
|
||||
.left {
|
||||
width: 220px;
|
||||
width: 250px;
|
||||
height: calc(100% - 45px);
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
|
@ -118,7 +182,7 @@ export default {
|
|||
height: 820px;
|
||||
overflow-y: scroll;
|
||||
.nav-item {
|
||||
width: 200px;
|
||||
width: 230px;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
height: 40px;
|
||||
|
@ -129,6 +193,7 @@ export default {
|
|||
font-weight: 400;
|
||||
|
||||
span {
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.bg_color {
|
||||
|
@ -138,10 +203,20 @@ export default {
|
|||
.nav-item :hover {
|
||||
color: #409eff;
|
||||
}
|
||||
.nav-item ::before {
|
||||
content: " ";
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
display: block;
|
||||
float: left;
|
||||
margin-top: 6px;
|
||||
background-color: var(--bgColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
.right {
|
||||
width: calc(100% - 240px);
|
||||
width: calc(100% - 270px);
|
||||
margin-left: 15px;
|
||||
height: 820px;
|
||||
float: left;
|
||||
|
@ -151,6 +226,11 @@ export default {
|
|||
width: 50%;
|
||||
height: 50%;
|
||||
}
|
||||
.videoViewError {
|
||||
background-color: #575e65;
|
||||
text-align: center;
|
||||
line-height: 324px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.yanzhu.jh.bigscreen.web.controller;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.yanzhu.jh.video.domain.SurProjectVideoConfig;
|
||||
import com.yanzhu.jh.video.domain.SurProjectVideoPassage;
|
||||
import com.yanzhu.jh.video.service.ISurProjectVideoConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实时视频Conller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bgscreen/video")
|
||||
public class VideoController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ISurProjectVideoConfigService surProjectVideoConfigService;
|
||||
|
||||
/**
|
||||
* 查询视频配置列表
|
||||
*/
|
||||
@GetMapping("/listView")
|
||||
public AjaxResult listView(String deptId,String projectId)
|
||||
{
|
||||
SurProjectVideoConfig surProjectVideoConfig = new SurProjectVideoConfig();
|
||||
if(deptId!=null && !"0".equals(deptId)){
|
||||
surProjectVideoConfig.setProjectDeptId(deptId);
|
||||
}
|
||||
if(projectId!=null && !"0".equals(projectId)){
|
||||
surProjectVideoConfig.setProjectId(Convert.toLong(projectId));
|
||||
}
|
||||
List<SurProjectVideoConfig> list = surProjectVideoConfigService.selectSurProjectVideoConfigList(surProjectVideoConfig);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改视频通道状态
|
||||
*/
|
||||
@GetMapping("/editPassageState")
|
||||
public AjaxResult editPassageState(@RequestParam Long id, String videoDvrNumber, String passageState)
|
||||
{
|
||||
SurProjectVideoPassage surProjectVideoPassage = new SurProjectVideoPassage();
|
||||
surProjectVideoPassage.setVideoId(id);
|
||||
surProjectVideoPassage.setVideoDvrNumber(videoDvrNumber);
|
||||
surProjectVideoPassage.setPassageState(passageState);
|
||||
return success(surProjectVideoConfigService.editPassageState(surProjectVideoPassage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取视频配置详细信息
|
||||
*/
|
||||
@GetMapping(value = "/getVideoPassage/{videoDvrNumberd}")
|
||||
public AjaxResult getVideoPassage(@PathVariable("videoDvrNumberd") String videoDvrNumberd)
|
||||
{
|
||||
return success(surProjectVideoConfigService.getVideoPassage(videoDvrNumberd));
|
||||
}
|
||||
}
|
|
@ -151,9 +151,9 @@ public class SurProjectVideoConfigController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:videoConfig:query')")
|
||||
@PostMapping("/editPassageState")
|
||||
public AjaxResult editPassageState(SurProjectVideoPassage SurProjectVideoPassage)
|
||||
public AjaxResult editPassageState(@RequestBody SurProjectVideoPassage surProjectVideoPassage)
|
||||
{
|
||||
return success(surProjectVideoConfigService.editPassageState(SurProjectVideoPassage));
|
||||
return success(surProjectVideoConfigService.editPassageState(surProjectVideoPassage));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="videoDvrNumber" column="sub_video_dvr_number" />
|
||||
<result property="passageName" column="sub_passage_name" />
|
||||
<result property="passageValue" column="sub_passage_value" />
|
||||
<result property="passageState" column="sub_passage_state" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectVideoConfigVo">
|
||||
|
@ -79,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectSurProjectVideoConfigByDvrNumber" parameterType="String" resultMap="SurProjectVideoConfigSurProjectVideoPassageResult">
|
||||
select a.id, a.project_id, a.video_name, a.video_only_type, a.video_dvr_number, a.video_dvr_security, a.video_passage_count, a.passage_pass_count, a.video_sort, a.signal_type, a.signal_state, a.signal_code, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, p.projectName,
|
||||
b.id as sub_id, b.video_id as sub_video_id, b.video_dvr_number as sub_video_dvr_number, b.passage_name as sub_passage_name, b.passage_value as sub_passage_value
|
||||
b.id as sub_id, b.video_id as sub_video_id, b.video_dvr_number as sub_video_dvr_number, b.passage_name as sub_passage_name, b.passage_value as sub_passage_value, b.passage_state as sub_passage_state
|
||||
from sur_project_video_config a
|
||||
left join sur_project p on a.project_id=p.id
|
||||
left join sur_project_video_passage b on b.video_id = a.id
|
||||
|
@ -176,9 +177,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<insert id="batchSurProjectVideoPassage">
|
||||
insert into sur_project_video_passage( id, video_id, video_dvr_number, passage_name, passage_value) values
|
||||
insert into sur_project_video_passage( id, video_id, video_dvr_number, passage_name, passage_value,passage_state) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.videoId}, #{item.videoDvrNumber}, #{item.passageName}, #{item.passageValue})
|
||||
( #{item.id}, #{item.videoId}, #{item.videoDvrNumber}, #{item.passageName}, #{item.passageValue}, #{item.passageState})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
|
Loading…
Reference in New Issue