视频端排序及修改bug

main
jinna 3 years ago
parent ed551129e5
commit 53371ef0d0
  1. 6
      src/api/wirelessintrusion/wirelessintrusion.js
  2. BIN
      src/assets/image/btn.gif
  3. BIN
      src/assets/image/btn1.png
  4. 64
      src/page/index/index.vue
  5. 201
      src/views/h5Player/player.vue
  6. 130
      src/views/wirelessintrusion/device/list.vue
  7. 65
      src/views/wirelessintrusion/oneClick/list.vue

@ -178,9 +178,9 @@ export const selectPatientPage = (token, params) => {
return request({
url: baseUrl + "/api/safeCare/patient/selectPatientPage",
method: "get",
headers: {
Authorization: token,
},
// headers: {
// Authorization: token,
// },
params: params,
authorization: false,
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

@ -61,12 +61,15 @@
title="诊间报警"
:visible.sync="dialogWarnVisible"
width="80%"
class="warn_dialog"
custom-class="warn_dialog"
:lock-scroll="true"
@close="closeDia"
>
<iframe src="http://192.168.131.107:9000/vocalldemo/index.html" frameborder="0" width="1000px" height="600px"></iframe>
<iframe src="http://171.16.8.51:1889" frameborder="0" width="100%" height="600px"></iframe>
<!-- <iframe src="http://192.168.3.109:89/vocalldemo/index.html" frameborder="0" width="100%" height="600px"></iframe> -->
</el-dialog>
<div class="warn_box" @click="showWarn"></div>
<div class="warn_box" v-show="isShowBtn" @click="showWarn"></div>
<div class="warn_right" v-show="!isShowBtn" @click="isShowBtn = true">诊间报警</div>
</div>
</template>
@ -115,7 +118,9 @@
isShowAlarm:false,
timer:null,
isLoop:false,
dialogWarnVisible: false
dialogWarnVisible: false,
isHeight:'',
isShowBtn:false
};
},
beforeCreate(){
@ -179,12 +184,21 @@
methods: {
showWarn() {
this.dialogWarnVisible = true;
// console.log(document.body.clientHeight)
// if(document.body.clientHeight <= 800){
// this.isHeight = 600
// }else{
// this.isHeight = document.body.clientHeight - 200
// }
},
getAlarmInfo(){
getAlarm().then(res =>{
console.log(res)
})
},
closeDia(){
this.isShowBtn = false
},
closeAlarm(){
this.isAlarm = !this.isAlarm
if(this.isAlarm){
@ -402,8 +416,10 @@
</script>
<style lang="scss" scoped>
.top_alarm{
padding-left: 240px;
// padding-left: 240px;
height: 40px;
position: relative;
z-index: 9999;
.alarm_mess{
padding: 0 20px;
@ -440,20 +456,33 @@
}
}
}
.warn_dialog {
.el-dialog__body{
padding: 0 !important;
}
}
.warn_box{
position: fixed;
right: 20px;
bottom: 100px;
width:100px;
height:100px;
border-radius:50px;
background: red;
z-index: 999;
width:86px;
height:86px;
border-radius:50%;
background: url("~@/assets/image/btn.gif") no-repeat;
z-index: 9999;
cursor: pointer;
}
.warn_right{
width: 20px;
height: 80px;
background: #2a82ea;
position: fixed;
right: 2px;
bottom: 100px;
z-index: 9999;
display: flex;
align-items: center;
text-align: center;
border-radius: 10px;
font-size: 12px;
color: #fff;
cursor: pointer;
}
</style>
<style lang="scss">
@ -461,4 +490,9 @@
width: 70%;
height: 700px;
}
.warn_dialog {
.el-dialog__body{
padding: 0 !important;
}
}
</style>

@ -1,6 +1,13 @@
<template>
<div class="container">
<div id="player" :style="{width:!showLeft ? '100%' : '65%'}"></div>
<div id="mask_con" class="mask_box" :style="{width:!showLeft ? '100%' : '65%'}" v-show="isOrder">
<div :id="'mask_video' + item.num" v-for="item in videoList" :key="item" class="mask_item_box">
<div class="input_box" style="width:50px;margin-bottom:10px;">
<el-input type="number" v-model="item.num"></el-input>
</div>
</div>
</div>
<div class="form_box" v-show="showLeft">
<el-form>
<el-form-item label="当前选中摄像头">
@ -81,7 +88,7 @@
>
</el-form-item>
<div>
<div>排序</div>
<!-- <div>排序</div>
<div v-for="(item,index) in playUrlList" :key="index" style="display:flex;align-items:center;margin-bottom:20px">
<div>
摄像头名称:{{item.name}}
@ -89,8 +96,8 @@
<div style="width:10%;margin-left:20px">
<el-input v-model="item.num" placeholder="序号"></el-input>
</div>
</div>
<el-button @click="orderBy">排序</el-button>
</div> -->
<el-button :type="isOrder ? 'primary' : ''" @click="orderBy">排序</el-button>
</div>
@ -155,7 +162,10 @@ export default {
timeRange:[],
cameraList:[],
list:[],
showLeft:true
showLeft:true,
videoList:[],
isOrder:false,
};
},
created() {
@ -191,43 +201,6 @@ export default {
setTimeout(() => {
this.init();
this.createPlayer();
// this.orderBy()
// this.arrangeWindow();
// let list = document.querySelector('.sub-wnd')
// let currentLi
// document.getElementsByClassName('sub-wnd').forEach((item,index) =>{
// item.setAttribute("draggable", true);
// })
// list.addEventListener('dragstart',(e)=>{
// e.dataTransfer.effectAllowed = 'move' // "move"
// currentLi = e.target
// currentLi.classList.add('moving')
// })
// list.addEventListener('dragenter',(e)=>{
// console.log('e===========>',e)
// e.preventDefault()
// if(e.target === currentLi||e.target === list){
// return
// }
// let liArray = Array.from(list.childNodes)
// let currentIndex = liArray.indexOf(currentLi)
// let targetindex = liArray.indexOf(e.target)
// if(currentIndex<targetindex){
// list.insertBefore(currentLi,e.target.nextElementSibling)
// }else{
// list.insertBefore(currentLi,e.target)
// }
// })
// list.addEventListener('dragover',(e)=>{
// e.preventDefault()
// })
// list.addEventListener('dragend',(e)=>{
// currentLi.classList.remove('moving')
// })
});
},
mounted(){
@ -245,30 +218,76 @@ export default {
return false;
},
orderBy(){
if(this.isRepeat(this.playUrlList,'num')){
this.$message.error('顺序不能存在相同数')
if(!this.isOrder){
let arr = []
this.videoList = []
for(let i = 0;i < this.splitNum * this.splitNum;i++){
arr.push({num:i + 1})
}
arr.map(item =>{
this.playUrlList.map(item1 =>{
if(item.num == item1.num){
item.url = item1.url
}
})
})
this.videoList = arr
// console.log('videp1 ===>',this.videoList)
this.$nextTick(() =>{
this.isOrder = true;
var alist = document.getElementsByClassName( "mask_item_box" );
if (alist){
for ( var idx = 0; idx < alist.length; idx ++){
var mya = alist[idx];
mya.style.width = document.getElementById('player').offsetWidth / this.splitNum + 'px';
mya.style.height = document.getElementById('player').offsetHeight / this.splitNum + 'px';
}
}
})
}else{
console.log('split ===>',this.splitNum)
this.playUrlList = this.playUrlList.sort((a,b) => a.num - b.num)
console.log(this.playUrlList)
if(this.playUrlList[this.playUrlList.length - 1].num > this.splitNum * this.splitNum){
this.$message.error('顺序数不可大于当前窗口数')
}else{
this.player.JS_StopRealPlayAll().then(
() => {
console.info('停止播放成功====>,JS_StopRealPlayAll success');
// do you want...
this.playUrlList.map(item =>{
this.realplay(parseInt(item.num) - 1,item.url)
})
},
(err) => {
console.info('JS_StopRealPlayAll failed');
// do you want...
let arr = JSON.parse(JSON.stringify(this.videoList))
console.log('videoList ====>',this.videoList)
this.$nextTick(() =>{
let tmp = arr.find(item => item.num == '')
let isNum = arr.find(item => item.num == 0)
console.log(isNum)
console.log(tmp)
if(tmp){
this.$message.error('不能存在空值')
}else if(isNum){
this.$message.error('不能存在0')
}else if(this.isRepeat(arr,'num')){
this.$message.error('不能存在重复值')
}else{
arr = arr.sort((a,b) => a.num - b.num)
if(arr[arr.length - 1].num > this.splitNum * this.splitNum){
this.$message.error('数值不可大于当前窗口值')
}else{
console.log('videoList1111 ====>',this.videoList)
arr.map(item =>{
this.playUrlList.forEach(item1 =>{
if(item.url == item1.url){
item1.num = parseInt(item.num)
}
})
})
console.log('playerUrl =======>',this.playUrlList)
this.player.JS_StopRealPlayAll().then(
() => {
console.info('停止播放成功====>,JS_StopRealPlayAll success');
this.playUrlList.map(item =>{
this.realplay(parseInt(item.num) - 1,item.url)
})
this.isOrder = false
},
(err) => {
console.info('JS_StopRealPlayAll failed');
// // // do you want...
})
}
}
);
}
})
}
@ -358,7 +377,31 @@ export default {
arrangeWindow() {
// const splitNum = this.splitNum;
// console.log(this.player)
// this.videoList
if(this.isOrder){
let arr = []
this.videoList = []
for(let i = 0;i < this.splitNum * this.splitNum;i++){
if(this.playUrlList[i]){
console.log('url ====>',this.playUrlList[i],i)
arr.push({url:this.playUrlList[i].url,num:this.playUrlList[i].num})
}else{
arr.push({num:i + 1})
}
}
this.videoList = arr
this.$nextTick(() =>{
this.isOrder = true;
var alist = document.getElementsByClassName( "mask_item_box" );
if (alist){
for ( var idx = 0; idx < alist.length; idx ++){
var mya = alist[idx];
mya.style.width = document.getElementById('player').offsetWidth / this.splitNum + 'px';
mya.style.height = document.getElementById('player').offsetHeight / this.splitNum + 'px';
}
}
})
}
let splitNum = Number(this.splitNum)
this.player.JS_ArrangeWindow(splitNum).then(
() => { console.log(`arrangeWindow to ${splitNum}x${splitNum} success`) },
@ -368,6 +411,7 @@ export default {
//
//
realplay(index, url) {
console.log('index ====>',index)
if (this.playUrlList.length === 0) {
this.$message.warning("当前没有可播放的摄像头");
return;
@ -564,6 +608,35 @@ export default {
}
// }
.mask_box{
height: calc((50vw - 8px) * 5 / 8);
background: transparent;
position: absolute;
display: flex;
flex-wrap: wrap;
.mask_item_box{
display: flex;
align-items: flex-end;
justify-content: center;
.input_box{
/deep/ .el-input__inner{
text-align: center;
font-size: 26px;
padding: 0;
}
::v-deep input::-webkit-outer-spin-button,
::v-deep input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
::v-deep input[type='number'] {
-moz-appearance: textfield !important;
}
}
}
}
.form_box{
width: 35%;
display: flex;

@ -4,6 +4,10 @@
:before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad">
<template slot="deviceType" slot-scope="{row}">
<div>{{JSON.parse(row.tags).type == 2 ? '防区' : '子系统'}}</div>
<!-- <div></div> -->
</template>
<template slot="menuLeft">
<el-button type="danger" size="small" icon="el-icon-turn-off" @click="doSetupAlarm" plain>布防
</el-button>
@ -19,7 +23,7 @@
</template>
<script>
import { bizLogin, bizDeviceList, bizDeviceStatus, bizNodeType, warnClear, setupAlarm, closeAlarm, bypass, unBypass } from "@/api/wirelessintrusion/wirelessintrusion";
import { bizLogin, bizDeviceList, bizDeviceStatus, bizNodeType, warnClear, setupAlarm, closeAlarm, bypass, unBypass,setUpDecive,closeDecive } from "@/api/wirelessintrusion/wirelessintrusion";
export default {
data() {
@ -135,6 +139,12 @@ export default {
},
labelWidth: 120
},
{
label: "设备类型",
prop:'deviceType',
span: 12,
slot:true
},
{
label: "设备状态",
type: "select",
@ -173,7 +183,7 @@ export default {
let ids = [];
this.selectionList.forEach(ele => {
let tags = JSON.parse(ele.tags)
ids.push(tags.sectorNo);
ids.push(tags.pmac);
});
return ids.join(",");
}
@ -220,21 +230,28 @@ export default {
this.$message.warning("只能选择一条数据");
return;
}
if(JSON.parse(this.selectionList[0].tags).type == 2){
this.$message.warning("只能选择设备类型为子系统的数据");
return;
}
this.$confirm("确定对该防区布防吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return setupAlarm({ num: this.ids });
return setUpDecive({ num: this.ids,hostSerialNumber:JSON.parse(this.selectionList[0].tags).hostNumber });
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
.then((res) => {
if(res.data.code == 200){
this.onLoad(this.page);
this.$message({
type: "success",
message: res.data.msg
});
this.$refs.crud.toggleSelection();
}
});
},
//
@ -243,21 +260,28 @@ export default {
this.$message.warning("只能选择一条数据");
return;
}
if(JSON.parse(this.selectionList[0].tags).type == 2){
this.$message.warning("只能选择设备类型为子系统的数据");
return;
}
this.$confirm("确定对该防区撤防吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return closeAlarm({ num: this.ids });
return closeDecive({ num: this.ids,hostSerialNumber:JSON.parse(this.selectionList[0].tags).hostNumber });
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
.then((res) => {
if(res.data.code == 200){
this.onLoad(this.page);
this.$message({
type: "success",
message: res.data.msg
});
this.$refs.crud.toggleSelection();
}
});
},
//
@ -266,21 +290,33 @@ export default {
this.$message.warning("只能选择一条数据");
return;
}
if(JSON.parse(this.selectionList[0].tags).type == 3){
this.$message.warning("只能选择设备类型为防区的数据");
return;
}
this.$confirm("确定对该防区进行旁路吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return bypass({ num: this.ids });
return bypass({ num: this.ids,hostSerialNumber:JSON.parse(this.selectionList[0].tags).hostNumber });
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
.then((res) => {
if(res.data.code == 200){
this.onLoad(this.page);
this.$message({
type: "success",
message: res.data.msg
});
this.$refs.crud.toggleSelection();
}else{
this.$message({
type: "error",
message: "操作失败!"
});
}
});
},
//
@ -289,21 +325,33 @@ export default {
this.$message.warning("只能选择一条数据");
return;
}
if(JSON.parse(this.selectionList[0].tags).type == 3){
this.$message.warning("只能选择设备类型为防区的数据");
return;
}
this.$confirm("确定对该防区进行旁路恢复吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return unBypass({ num: this.ids });
return unBypass({ num: this.ids,hostSerialNumber:JSON.parse(this.selectionList[0].tags).hostNumber });
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
.then((res) => {
if(res.data.code == 200){
this.onLoad(this.page);
this.$message({
type: "success",
message: res.data.msg
});
this.$refs.crud.toggleSelection();
}else{
this.$message({
type: "error",
message: "操作失败!"
});
}
});
},
//
@ -374,7 +422,12 @@ export default {
item.buildingNo = tags.buildingNo;
item.floorNo = tags.floorNo;
// console.log('tags ====>',tags)
item.xy = tags.coordinate.replace('-',',');
// item.xy = tags.coordinate.replace('-',',');
if(tags.coordinate){
item.xy = tags.coordinate.replace('-',',');
}else{
item.xy = tags.lng + ',' + tags.lat;
}
item.position = tags.buildingNo + '号楼' + tags.floorNo + '层' + tags.address;
}
})
@ -408,8 +461,11 @@ export default {
let tags = JSON.parse(item.tags);
item.buildingNo = tags.buildingNo;
item.floorNo = tags.floorNo;
// item.xy = tags.lng + ',' + tags.lat;
item.xy = tags.coordinate.replace('-',',');
if(tags.coordinate){
item.xy = tags.coordinate.replace('-',',');
}else{
item.xy = tags.lng + ',' + tags.lat;
}
item.position = tags.buildingNo + '号楼' + tags.floorNo + '层' + tags.address;
}
})

@ -315,14 +315,21 @@ export default {
this.submitLoading = true;
console.log('addForm ===>',this.addForm)
if (this.addForm.id > 0) {
this.addForm.executeTime = null
cornJobUpdate(this.addForm).then((res) => {
this.submitLoading = false;
this.dialogVisible = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
if(res.data.code == 200){
this.submitLoading = false;
this.dialogVisible = false;
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
}else if(res.data.code == 400){
this.submitLoading = false;
this.$message.error(res.data.msg)
}
}, () => {
this.submitLoading = false;
})
@ -414,23 +421,23 @@ export default {
});
},
handleSetup(row){
let arr = []
if(row.deviceId.indexOf(',') > -1){
row.deviceId.split(',').map(item =>{
arr.push(item)
})
}else{
arr.push(row.deviceId.substr(-1))
}
console.log('arr =========>',arr.join(','))
// let arr = []
// if(row.deviceId.indexOf(',') > -1){
// row.deviceId.split(',').map(item =>{
// arr.push(item)
// })
// }else{
// arr.push(row.deviceId.substr(-1))
// }
// console.log('arr =========>',arr.join(','))
this.$confirm("确定进行布防吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() =>{
setUpDecive({hostSerialNumber:row.hostSerialNumber,num:arr.join(',')}).then(res =>{
setUpDecive({hostSerialNumber:row.hostSerialNumber,num:row.deviceId}).then(res =>{
if(res.data.code == 200){
this.$message.success('布防成功');
this.$message.success(res.data.msg);
this.onLoad(this.page);
}else{
this.$message.error('布防失败')
@ -440,23 +447,23 @@ export default {
},
//
handleClose(row){
let arr = []
if(row.deviceId.indexOf(',') > -1){
row.deviceId.split(',').map(item =>{
arr.push(item)
})
}else{
arr.push(row.deviceId.substr(-1))
}
console.log('arr =========>',arr.join(','))
// let arr = []
// if(row.deviceId.indexOf(',') > -1){
// row.deviceId.split(',').map(item =>{
// arr.push(item)
// })
// }else{
// arr.push(row.deviceId.substr(-1))
// }
// console.log('arr =========>',arr.join(','))
this.$confirm("确定进行撤防吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() =>{
closeDecive({hostSerialNumber:row.hostSerialNumber,num:arr.join(',')}).then(res =>{
closeDecive({hostSerialNumber:row.hostSerialNumber,num:row.deviceId}).then(res =>{
if(res.data.code == 200){
this.$message.success('撤防成功');
this.$message.success(res.data.msg);
this.onLoad(this.page);
}else{
this.$message.error('撤防失败')

Loading…
Cancel
Save