摄像头接口调整

This commit is contained in:
曹磊 2026-03-13 18:04:34 +08:00
parent d16b315351
commit f18fa858d4
5 changed files with 82 additions and 33 deletions

View File

@ -12,8 +12,11 @@ enum Api {
edit = '/iot/tplink/cameraInfo/edit', edit = '/iot/tplink/cameraInfo/edit',
rebootDevice = '/iot/tplink/cameraInfo/rebootDevice', rebootDevice = '/iot/tplink/cameraInfo/rebootDevice',
previewUrl = '/iot/tplink/cameraInfo/getPreviewUrl', previewUrl = '/iot/tplink/cameraInfo/getPreviewUrl',
getDeviceDetails = '/iot/tplink/cameraInfo/getDeviceDetails',
getImageCommon = '/iot/tplink/cameraInfo/getImageCommon', getImageCommon = '/iot/tplink/cameraInfo/getImageCommon',
setImageCommon = '/iot/tplink/cameraInfo/setImageCommon', setImageCommon = '/iot/tplink/cameraInfo/setImageCommon',
getImageSwitch = '/iot/tplink/cameraInfo/getImageSwitch',
setImageSwitch = '/iot/tplink/cameraInfo/setImageSwitch',
getOsdCapability = '/iot/tplink/cameraInfo/getOsdCapability', getOsdCapability = '/iot/tplink/cameraInfo/getOsdCapability',
getOsd = '/iot/tplink/cameraInfo/getOsd', getOsd = '/iot/tplink/cameraInfo/getOsd',
setOsd = '/iot/tplink/cameraInfo/setOsd', setOsd = '/iot/tplink/cameraInfo/setOsd',
@ -112,6 +115,12 @@ export const rebootDevice = (params) => {
return defHttp.post({ url: Api.rebootDevice, params }); return defHttp.post({ url: Api.rebootDevice, params });
} }
/**
*
* @param params
*/
export const getDeviceDetails = (params) => defHttp.get({ url: Api.getDeviceDetails, params });
/** /**
* *
* @param params * @param params
@ -124,6 +133,18 @@ export const getImageCommon = (params) => defHttp.post({ url: Api.getImageCommon
*/ */
export const setImageCommon = (params) => defHttp.post({ url: Api.setImageCommon, params }); export const setImageCommon = (params) => defHttp.post({ url: Api.setImageCommon, params });
/**
*
* @param params
*/
export const getImageSwitch = (params) => defHttp.post({ url: Api.getImageSwitch, params });
/**
*
* @param params
*/
export const setImageSwitch = (params) => defHttp.post({ url: Api.setImageSwitch, params });
/** /**
* OSD能力集参数 * OSD能力集参数
* @param params * @param params

View File

@ -34,7 +34,7 @@
<template #title> <template #title>
<a-row style="font-weight: normal;"> <a-row style="font-weight: normal;">
<a-col :span="18"> <a-col :span="18">
<div style="font-size: 14px;">SN<span style="font-weight: bold;">{{ item.sn ? item.sn : '未配置' }}</span></div> <div style="font-size: 14px;">SN<span style="font-weight: bold;">{{ item.mac ? item.mac : '未配置' }}</span></div>
<div style="font-size: 12px;">设备名称{{ item.deviceName }}</div> <div style="font-size: 12px;">设备名称{{ item.deviceName }}</div>
</a-col> </a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;"> <a-col :span="6" style="display: flex; justify-content: flex-end;">
@ -105,11 +105,11 @@
</template> </template>
<script lang="ts" name="iot-nuIotCameraInfo" setup> <script lang="ts" name="iot-nuIotCameraInfo" setup>
import { ref, reactive, createVNode, h, onMounted, watch, unref } from 'vue'; import { ref, reactive, createVNode, h, onMounted, watch, unref,nextTick } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from '../camera.data'; import { columns, searchFormSchema } from '../camera.data';
import { getImageCommon, list } from '../camera.api'; import { getDeviceDetails, list } from '../camera.api';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import { useDrawer } from "@/components/Drawer"; import { useDrawer } from "@/components/Drawer";
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
@ -166,16 +166,23 @@ function handlePreview(record: Recordable) {
if (record.deviceIndex == null) { if (record.deviceIndex == null) {
return return
} }
getImageCommon({ // getImageCommon({
"deviceIndex": record.deviceIndex, // "deviceIndex": record.deviceIndex,
"type": "switch" // "type": "switch"
// }).then(res => {
// previewModal.value.disableSubmit = true;
// previewModal.value.edit(record);
// }).catch(res => {
// reload();
// });
getDeviceDetails({
"deviceIndex": record.deviceIndex
}).then(res => { }).then(res => {
previewModal.value.disableSubmit = true; previewModal.value.disableSubmit = true;
previewModal.value.edit(record); previewModal.value.edit(record);
}).catch(res => { }).catch(res=>{
reload(); reload();
}); });
} }
/** /**
@ -188,21 +195,43 @@ function handleSuccess() {
/** /**
* 画面配置 * 画面配置
*/ */
// function handlePicConfig(record) {
// var params = {
// deviceIndex: record.deviceIndex,
// parentId: record.parentId,
// multitrans: record.multitrans,
// projectId: record.projectId,
// regionId: record.regionId,
// ip: record.ip
// }
// cameraPictureConfigModal.value.disableSubmit = true;
// cameraPictureConfigModal.value.edit(params);
// }
function handlePicConfig(record) { function handlePicConfig(record) {
var params = { if (record.deviceIndex == null) {
deviceIndex: record.deviceIndex, return
parentId: record.parentId,
multitrans: record.multitrans,
projectId: record.projectId,
regionId: record.regionId,
ip: record.ip
} }
cameraPictureConfigModal.value.disableSubmit = true; getDeviceDetails({
cameraPictureConfigModal.value.edit(params); "deviceIndex": record.deviceIndex
}).then(res => {
var params = {
deviceIndex: record.deviceIndex,
deviceName: record.deviceName,
parentId: record.parentId,
multitrans: record.multitrans,
projectId: record.projectId,
regionId: record.regionId,
ip: record.ip
}
nextTick(()=>{
cameraPictureConfigModal.value.disableSubmit = true;
cameraPictureConfigModal.value.edit(params);
})
}).catch(res=>{
reload();
});
} }
/** /**
* 左侧树选择后触发 * 左侧树选择后触发
*/ */

View File

@ -39,7 +39,7 @@
<span class="buttonSpan jtImg" @click="screenshot"><span style="margin-left:30px;">截图</span></span> <span class="buttonSpan jtImg" @click="screenshot"><span style="margin-left:30px;">截图</span></span>
<span class="buttonSpan bjImg" @click="manualAlarm"><span style="margin-left:30px;">报警</span></span> <span class="buttonSpan bjImg" @click="manualAlarm"><span style="margin-left:30px;">报警</span></span>
<a-popover > <a-popover >
<template #content> <template #content>
<div style="text-align: center;"> <div style="text-align: center;">
@ -166,10 +166,10 @@ import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils'; import { getValueType } from '/@/utils';
import { Form } from 'ant-design-vue'; import { Form } from 'ant-design-vue';
import { import {
getImageCommon, getImageSwitch,
getMultitransUrl, getMultitransUrl,
getPreviewUrl, getPreviewUrl,
setImageCommon, setImageSwitch,
testAudio, testAudio,
motionCtrl motionCtrl
} from "../camera.api"; } from "../camera.api";
@ -340,7 +340,7 @@ function getSwitch() {
if (formData.deviceIndex == null) { if (formData.deviceIndex == null) {
return return
} }
getImageCommon({ getImageSwitch({
"deviceIndex": formData.deviceIndex, "deviceIndex": formData.deviceIndex,
"type": "switch" "type": "switch"
}).then(res => { }).then(res => {
@ -354,7 +354,7 @@ function getSwitch() {
function changeSwitch(attr, value) { function changeSwitch(attr, value) {
let param = {}; let param = {};
param[attr] = value; param[attr] = value;
setImageCommon({ setImageSwitch({
"deviceIndex": formData.deviceIndex, "deviceIndex": formData.deviceIndex,
"type": "switch", "type": "switch",
"param": param "param": param

View File

@ -79,12 +79,11 @@ import { useMessage } from '@/hooks/web/useMessage';
import { getValueType } from '@/utils'; import { getValueType } from '@/utils';
import { Form } from 'ant-design-vue'; import { Form } from 'ant-design-vue';
import { import {
getImageCommon, getImageSwitch,
setImageSwitch,
getMultitransUrl, getMultitransUrl,
getPreviewUrl, getPreviewUrl,
setImageCommon, testAudio
testAudio,
motionCtrl
} from "../camera.api"; } from "../camera.api";
const props = defineProps({ const props = defineProps({
@ -300,7 +299,7 @@ function getSwitch() {
if (formData.deviceIndex == null) { if (formData.deviceIndex == null) {
return return
} }
getImageCommon({ getImageSwitch({
"deviceIndex": formData.deviceIndex, "deviceIndex": formData.deviceIndex,
"type": "switch" "type": "switch"
}).then(res => { }).then(res => {
@ -314,7 +313,7 @@ function getSwitch() {
function changeSwitch(attr, value) { function changeSwitch(attr, value) {
let param = {}; let param = {};
param[attr] = value; param[attr] = value;
setImageCommon({ setImageSwitch({
"deviceIndex": formData.deviceIndex, "deviceIndex": formData.deviceIndex,
"type": "switch", "type": "switch",
"param": param "param": param

View File

@ -109,7 +109,7 @@ import { reactive, ref, h, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import { Statistic } from 'ant-design-vue'; import { Statistic } from 'ant-design-vue';
import { Modal } from "ant-design-vue"; import { Modal } from "ant-design-vue";
import { list, eleReset, eleCutOff, eleConnected, eleRead } from './electricity.api'; import { list, eleReset, eleControl, eleRead } from './electricity.api';
import { Pagination } from 'ant-design-vue'; import { Pagination } from 'ant-design-vue';
import { JInput } from '/@/components/Form'; import { JInput } from '/@/components/Form';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
@ -170,7 +170,7 @@ async function handleControlLz(record) {
'sn' : record.sn, 'sn' : record.sn,
'type': '10' 'type': '10'
}; };
await eleCutOff(params); await eleControl(params);
setTimeout(() => { setTimeout(() => {
reload(); reload();
}, 4000); }, 4000);
@ -192,7 +192,7 @@ async function handleControlHz(record) {
'sn' : record.sn, 'sn' : record.sn,
'type': '11' 'type': '11'
}; };
await eleConnected(params); await eleControl(params);
setTimeout(() => { setTimeout(() => {
reload(); reload();
}, 4000); }, 4000);