|
@ -6,30 +6,34 @@ |
|
|
*/ |
|
|
*/ |
|
|
--> |
|
|
--> |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div class="camera-control" @mousewheel="wheel"> |
|
|
<div class="camera-control"> |
|
|
|
|
|
<div class="camera-operate"> |
|
|
|
|
|
<div class="camera-direct"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a-row> |
|
|
<!--上--> |
|
|
<!--上--> |
|
|
<div class="upButton" style="background-position:-30px 0" @mousedown="upStart()" @mouseup="stopMove()"> |
|
|
<div class="upButton" @mousedown="upStart()" @mouseup="stopMove()"> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</a-row> |
|
|
|
|
|
<a-row> |
|
|
<!--左--> |
|
|
<!--左--> |
|
|
<div class="leftButton" style="background-position:0 -30px" @mousedown="leftStart()" @mouseup="stopMove()"> |
|
|
<div class="leftButton" @mousedown="leftStart()" @mouseup="stopMove()"> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!--右--> |
|
|
<!--右--> |
|
|
<div class="rightButton" style="background-position:-60px -30px" @mousedown="rightStart()" |
|
|
<div class="rightButton" @mousedown="rightStart()" |
|
|
@mouseup="stopMove()"> |
|
|
@mouseup="stopMove()"> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</a-row> |
|
|
|
|
|
<a-row> |
|
|
<!--下--> |
|
|
<!--下--> |
|
|
<div class="downButton" style="background-position:-30px -60px" @mousedown="downStart()" |
|
|
<div class="downButton" @mousedown="downStart()" |
|
|
@mouseup="stopMove()"> |
|
|
@mouseup="stopMove()"> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</a-row> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
<!-- <div class="camera-function"> |
|
|
<!-- <div class="camera-function"> |
|
|
<div class="function-box"> |
|
|
<div class="function-box"> |
|
|
<div class="function-item" |
|
|
<div class="function-item" |
|
@ -58,9 +62,6 @@ |
|
|
title="抓拍列表"> |
|
|
title="抓拍列表"> |
|
|
</div> |
|
|
</div> |
|
|
</div> --> |
|
|
</div> --> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
@ -113,6 +114,7 @@ function onvifOperateHandler(url: any, method: any, params: any, callback: any = |
|
|
if (!res.Errors) { |
|
|
if (!res.Errors) { |
|
|
// console.log("成功"); |
|
|
// console.log("成功"); |
|
|
if (callback && typeof callback === 'function') { |
|
|
if (callback && typeof callback === 'function') { |
|
|
|
|
|
// console.log("执行回调"); |
|
|
callback(res) |
|
|
callback(res) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
@ -130,12 +132,12 @@ function checkExistOnvif() { |
|
|
// Check onvif server is exists, if not exists , add it |
|
|
// Check onvif server is exists, if not exists , add it |
|
|
let params = { cameraId: ip.value } |
|
|
let params = { cameraId: ip.value } |
|
|
onvifOperateHandler(url.value.isExist, 'get', params, (res: any) => { |
|
|
onvifOperateHandler(url.value.isExist, 'get', params, (res: any) => { |
|
|
console.log(res); |
|
|
// console.log(res); |
|
|
if (!res.isSuccess || res.data !== true) { |
|
|
if (!res.isSuccess || res.data !== true) { |
|
|
console.log("不存在,请先注册"); |
|
|
// console.log("不存在,请先注册"); |
|
|
onvifOperateHandler(url.value.add, 'post', params, (res: any) => { |
|
|
onvifOperateHandler(url.value.add, 'post', params, (res: any) => { |
|
|
console.log("注册信息", res); |
|
|
console.log("注册成功", res); |
|
|
console.log("注册成功"); |
|
|
// console.log("注册成功"); |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -230,13 +232,19 @@ function rightStart() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//变倍+ |
|
|
//变倍+ |
|
|
function zoomIn() { |
|
|
async function zoomIn() { |
|
|
let instruct = 'zoomIn' |
|
|
let instruct = 'zoomIn' |
|
|
let step = currentStep.value |
|
|
let step = currentStep.value |
|
|
let params = { cameraId: ip.value } |
|
|
let params = { cameraId: ip.value } |
|
|
let ptzParams = createPtzParam(instruct, step) |
|
|
let ptzParams = createPtzParam(instruct, step) |
|
|
Object.assign(params, ptzParams) |
|
|
Object.assign(params, ptzParams) |
|
|
onvifOperateHandler(url.value.ptzMove, 'post', params) |
|
|
onvifOperateHandler(url.value.ptzMove, 'post', params, (res:any)=>{ |
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
|
// console.log("回调"); |
|
|
|
|
|
stopMove() |
|
|
|
|
|
},400) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
//变倍- |
|
|
//变倍- |
|
|
function zoomOut() { |
|
|
function zoomOut() { |
|
@ -245,7 +253,12 @@ function zoomOut() { |
|
|
let params = { cameraId: ip.value } |
|
|
let params = { cameraId: ip.value } |
|
|
let ptzParams = createPtzParam(instruct, step) |
|
|
let ptzParams = createPtzParam(instruct, step) |
|
|
Object.assign(params, ptzParams) |
|
|
Object.assign(params, ptzParams) |
|
|
onvifOperateHandler(url.value.ptzMove, 'post', params) |
|
|
onvifOperateHandler(url.value.ptzMove, 'post', params,(res:any)=>{ |
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
|
// console.log("回调"); |
|
|
|
|
|
stopMove() |
|
|
|
|
|
},400) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//变焦+ |
|
|
//变焦+ |
|
@ -276,19 +289,41 @@ function openImgListDialog(){ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function wheel(e:any){ |
|
|
|
|
|
console.log(e); |
|
|
|
|
|
e.stopPropagation() |
|
|
|
|
|
if(e.wheelDelta==120){ |
|
|
|
|
|
zoomIn(); |
|
|
|
|
|
// stopMove(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
else if(e.wheelDelta== -120 ){ |
|
|
|
|
|
zoomOut(); |
|
|
|
|
|
// stopMove(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped lang="less"> |
|
|
<style scoped lang="less"> |
|
|
.camera-control { |
|
|
.camera-control { |
|
|
/* color: #080000; */ |
|
|
/* color: #080000; */ |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
width: 100vw; |
|
|
|
|
|
height: 100vh; |
|
|
|
|
|
left: 0; |
|
|
|
|
|
top: 0; |
|
|
|
|
|
// background: blue; |
|
|
|
|
|
z-index: 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.camera-control .camera-operate { |
|
|
.camera-control .camera-operate { |
|
|
display: -webkit-flex; |
|
|
// display: -webkit-flex; |
|
|
/* Safari */ |
|
|
// /* Safari */ |
|
|
display: flex; |
|
|
// display: flex; |
|
|
flex-direction: row; |
|
|
// flex-direction: row; |
|
|
justify-content: center; |
|
|
// justify-content: center; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -420,11 +455,64 @@ input[type='range']::-webkit-slider-thumb:active { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.upButton{ |
|
|
.upButton{ |
|
|
width: 100%; |
|
|
position: fixed; |
|
|
|
|
|
left: 50%; |
|
|
|
|
|
transform: translateX(-50%); |
|
|
|
|
|
height: 5vh; |
|
|
|
|
|
width: 60vw; |
|
|
|
|
|
// background: red; |
|
|
|
|
|
} |
|
|
|
|
|
.upButton:hover{ |
|
|
|
|
|
background: linear-gradient(to top, transparent,rgba(59, 59, 238, 0.637)); |
|
|
|
|
|
transition:all 1s ease-out; |
|
|
|
|
|
cursor:pointer |
|
|
|
|
|
} |
|
|
|
|
|
.leftButton{ |
|
|
|
|
|
position: fixed; |
|
|
|
|
|
top: 50%; |
|
|
|
|
|
transform: translateY(-50%); |
|
|
|
|
|
height: 80vh; |
|
|
|
|
|
width: 50px; |
|
|
|
|
|
// background: green; |
|
|
|
|
|
} |
|
|
|
|
|
.leftButton:hover{ |
|
|
|
|
|
background: linear-gradient(to left, transparent,80%,rgba(59, 59, 238, 0.637)); |
|
|
|
|
|
transition:all 1s ease-out; |
|
|
|
|
|
cursor:pointer |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.rightButton{ |
|
|
|
|
|
position: fixed; |
|
|
|
|
|
left: 85%; |
|
|
|
|
|
transform: translateY(-50%); |
|
|
|
|
|
top: 50%; |
|
|
|
|
|
height: 80vh; |
|
|
|
|
|
width: 50px; |
|
|
|
|
|
// background: url("@/assets/images/ptzIcons/a.png") center no-repeat; |
|
|
|
|
|
// background-size: contain; |
|
|
|
|
|
// transition:1s |
|
|
|
|
|
} |
|
|
|
|
|
.rightButton:hover{ |
|
|
|
|
|
background: linear-gradient(to right, transparent,80%,rgba(59, 59, 238, 0.637)); |
|
|
|
|
|
transition:all 1s ease-out; |
|
|
|
|
|
cursor:pointer |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.downButton{ |
|
|
|
|
|
position: fixed; |
|
|
|
|
|
left: 50%; |
|
|
|
|
|
transform: translateX(-50%); |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
bottom: 0; |
|
|
|
|
|
height: 5vh; |
|
|
|
|
|
width: 60vw; |
|
|
|
|
|
// background: yellow; |
|
|
|
|
|
} |
|
|
|
|
|
.downButton:hover{ |
|
|
|
|
|
background: linear-gradient( transparent,rgba(59, 59, 238, 0.637)); |
|
|
|
|
|
transition:all 1s ease-out; |
|
|
|
|
|
cursor:pointer |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |
|
|