tplink摄像头变焦
This commit is contained in:
parent
304fa86fbb
commit
686fe4edca
|
@ -6,6 +6,7 @@ enum Api {
|
||||||
syncProject = '/iot/tplink/projectInfo/sync',
|
syncProject = '/iot/tplink/projectInfo/sync',
|
||||||
syncRegion = '/iot/tplink/regionInfo/sync',
|
syncRegion = '/iot/tplink/regionInfo/sync',
|
||||||
list = '/iot/tplink/cameraInfo/list',
|
list = '/iot/tplink/cameraInfo/list',
|
||||||
|
syncProjectIpcDevice = '/iot/tplink/cameraInfo/syncProjectIpcDevice',
|
||||||
ipcCapability = '/iot/tplink/cameraInfo/getIpcCapability',
|
ipcCapability = '/iot/tplink/cameraInfo/getIpcCapability',
|
||||||
nuList = '/iot/tplink/cameraInfo/nuList',
|
nuList = '/iot/tplink/cameraInfo/nuList',
|
||||||
edit = '/iot/tplink/cameraInfo/edit',
|
edit = '/iot/tplink/cameraInfo/edit',
|
||||||
|
@ -38,6 +39,7 @@ enum Api {
|
||||||
uploadToServer = '/iot/tplink/cameraInfo/uploadToServer',
|
uploadToServer = '/iot/tplink/cameraInfo/uploadToServer',
|
||||||
stopUploadToServer = '/iot/tplink/cameraInfo/stopUploadToServer',
|
stopUploadToServer = '/iot/tplink/cameraInfo/stopUploadToServer',
|
||||||
getUploadToServerProcess = '/iot/tplink/cameraInfo/getUploadToServerProcess',
|
getUploadToServerProcess = '/iot/tplink/cameraInfo/getUploadToServerProcess',
|
||||||
|
motionCtrl = '/iot/tplink/cameraInfo/motionCtrl',
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +74,12 @@ export const syncRegion = (params?) => defHttp.get({ url: Api.syncRegion, params
|
||||||
*/
|
*/
|
||||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步此项目下的IPC设备
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const syncProjectIpcDevice = (params) => defHttp.get({ url: Api.syncProjectIpcDevice, params });
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取IPC能力集
|
* 获取IPC能力集
|
||||||
* @param params
|
* @param params
|
||||||
|
@ -266,3 +274,9 @@ export const stopUploadToServer = (params) => defHttp.get({ url: Api.stopUploadT
|
||||||
*/
|
*/
|
||||||
export const getUploadToServerProcess = (params) => defHttp.get({ url: Api.getUploadToServerProcess, params });
|
export const getUploadToServerProcess = (params) => defHttp.get({ url: Api.getUploadToServerProcess, params });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制球机转动
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const motionCtrl = (params) => defHttp.get({ url: Api.motionCtrl, params });
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,7 @@
|
||||||
<a-spin :spinning="syncoading">
|
<a-spin :spinning="syncoading">
|
||||||
<div class="j-table-operator" style="width: 100%">
|
<div class="j-table-operator" style="width: 100%">
|
||||||
<a-button preIcon="ant-design:sync-outlined" @click="loadRootTreeData">刷新</a-button>
|
<a-button preIcon="ant-design:sync-outlined" @click="loadRootTreeData">刷新</a-button>
|
||||||
<!-- <a-button type="primary" preIcon="ant-design:sync-outlined" @click="syncProjectInfo">同步项目</a-button>-->
|
<a-button type="primary" preIcon="ant-design:sync-outlined" @click="getProjectIpcDevice">同步设备</a-button>
|
||||||
<!-- <template v-if="currentRegion !=null">-->
|
|
||||||
<!-- <a-button preIcon="ant-design:sync-outlined" @click="syncRegionInfo">同步区域</a-button>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
</div>
|
</div>
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<!--区域树-->
|
<!--区域树-->
|
||||||
|
@ -35,8 +32,9 @@
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useMethods } from '/@/hooks/system/useMethods';
|
import { useMethods } from '/@/hooks/system/useMethods';
|
||||||
|
import { syncProjectIpcDevice,queryProjectTreeSync, queryRegionTreeSync, syncProject, syncRegion } from '../camera.api';
|
||||||
|
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
import { queryProjectTreeSync, queryRegionTreeSync, syncProject, syncRegion } from '../camera.api';
|
|
||||||
|
|
||||||
const emit = defineEmits(['select', 'rootTreeData']);
|
const emit = defineEmits(['select', 'rootTreeData']);
|
||||||
const syncoading = ref<boolean>(false);
|
const syncoading = ref<boolean>(false);
|
||||||
|
@ -172,31 +170,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步项目
|
* 同步设备
|
||||||
*/
|
*/
|
||||||
// async function syncProjectInfo(){
|
async function getProjectIpcDevice(){
|
||||||
// syncoading.value = true;
|
let data = currentRegion.value;
|
||||||
// await syncProject();
|
if (data == null) {
|
||||||
// await loadRootTreeData();
|
createMessage.warning('请先选择一个区域');
|
||||||
// }
|
return;
|
||||||
|
}
|
||||||
/**
|
const record = {
|
||||||
* 同步区域
|
projectId: data.projectId
|
||||||
*/
|
};
|
||||||
// async function syncRegionInfo(){
|
await syncProjectIpcDevice(record);
|
||||||
// let data = currentRegion.value;
|
currentRegion.value["timestamp"] = new Date().getTime();
|
||||||
// if (data == null) {
|
emit('select', currentRegion.value);
|
||||||
// createMessage.warning('请先选择一个区域');
|
}
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// const record = {
|
|
||||||
// projectId: data.projectId,
|
|
||||||
// regionId: data.regionId
|
|
||||||
// };
|
|
||||||
// syncoading.value = true;
|
|
||||||
// await syncRegion(record);
|
|
||||||
// await loadRootTreeData();
|
|
||||||
// }
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
loadRootTreeData,
|
loadRootTreeData,
|
||||||
|
|
|
@ -61,6 +61,17 @@
|
||||||
<a-button preIcon="ant-design:alert-outlined" @click="manualAlarm">报警</a-button>
|
<a-button preIcon="ant-design:alert-outlined" @click="manualAlarm">报警</a-button>
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="24" style="padding: 5px;">
|
||||||
|
<span style="margin-left: 5px;">
|
||||||
|
变焦
|
||||||
|
</span>
|
||||||
|
<span style="margin-left: 5px;">
|
||||||
|
<a-button preIcon="ant-design:zoom-out-outlined" @click="zoomInOut('out')" title="缩小"></a-button>
|
||||||
|
</span>
|
||||||
|
<span style="margin-left: 5px;">
|
||||||
|
<a-button preIcon="ant-design:zoom-in-outlined" @click="zoomInOut('in')" title="放大"></a-button>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
|
@ -76,7 +87,8 @@
|
||||||
getMultitransUrl,
|
getMultitransUrl,
|
||||||
getPreviewUrl,
|
getPreviewUrl,
|
||||||
setImageCommon,
|
setImageCommon,
|
||||||
testAudio
|
testAudio,
|
||||||
|
motionCtrl
|
||||||
} from "../camera.api";
|
} from "../camera.api";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -328,6 +340,59 @@
|
||||||
izPhone.value = false;
|
izPhone.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缩放
|
||||||
|
*/
|
||||||
|
function zoomInOut(type){
|
||||||
|
let delayTime = 6000;
|
||||||
|
if(type == 'in'){
|
||||||
|
formData.zoom = formData.zoom+0.4;
|
||||||
|
if(formData.zoom > 4){
|
||||||
|
formData.zoom = 4;
|
||||||
|
}
|
||||||
|
formData.sliderValue = formData.zoom;
|
||||||
|
moveCtrl(10,1,1);
|
||||||
|
if(formData.sliderValue<=2){
|
||||||
|
delayTime = 0.4*6000;
|
||||||
|
}else{
|
||||||
|
delayTime = 0.2*6000;
|
||||||
|
}
|
||||||
|
delayExecute(moveCtrl,[10,0,1],delayTime);
|
||||||
|
}else{
|
||||||
|
formData.zoom = formData.zoom-0.4;
|
||||||
|
if(formData.zoom < 1){
|
||||||
|
formData.zoom = 1;
|
||||||
|
}
|
||||||
|
formData.sliderValue = formData.zoom;
|
||||||
|
moveCtrl(9,1,1);
|
||||||
|
if(formData.sliderValue<=2){
|
||||||
|
delayTime = 0.4*6000;
|
||||||
|
}else{
|
||||||
|
delayTime = 0.2*6000;
|
||||||
|
}
|
||||||
|
delayExecute(moveCtrl,[9,0,1],delayTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制球机
|
||||||
|
*/
|
||||||
|
function moveCtrl(direction,startOrNot,speed){
|
||||||
|
let params = {
|
||||||
|
"deviceIndex": formData.deviceIndex,
|
||||||
|
"direction": direction,
|
||||||
|
"startOrNot": startOrNot,
|
||||||
|
"speed": speed,
|
||||||
|
};
|
||||||
|
motionCtrl(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
function delayExecute(fn, args, delay) {
|
||||||
|
setTimeout(() => {
|
||||||
|
fn.apply(this,args) // 使用apply传递参数数组
|
||||||
|
}, delay)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 销毁
|
* 销毁
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -63,5 +63,10 @@
|
||||||
.jee-hidden {
|
.jee-hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-modal-body {
|
||||||
|
height: auto !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
Loading…
Reference in New Issue