From 5f232d125c0aefc1602bf8d9b1ca3eeb2336705b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Sat, 28 Feb 2026 16:18:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E6=8E=A7=E8=AE=BE=E5=A4=87=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/tplink/camera/camera.api.ts | 27 +- src/views/iot/tplink/camera/camera.data.ts | 205 ++++++++++++---- .../camera/components/CameraInfoForm.vue | 230 ++++++++++++++++++ .../camera/components/ConfigInfoForm.vue | 203 ++++++++++++++++ .../tplink/camera/components/DrawerModal.vue | 137 +++++++++++ src/views/iot/tplink/camera/index.vue | 59 ++++- 6 files changed, 797 insertions(+), 64 deletions(-) create mode 100644 src/views/iot/tplink/camera/components/CameraInfoForm.vue create mode 100644 src/views/iot/tplink/camera/components/ConfigInfoForm.vue create mode 100644 src/views/iot/tplink/camera/components/DrawerModal.vue diff --git a/src/views/iot/tplink/camera/camera.api.ts b/src/views/iot/tplink/camera/camera.api.ts index 7ae9b63..f569096 100644 --- a/src/views/iot/tplink/camera/camera.api.ts +++ b/src/views/iot/tplink/camera/camera.api.ts @@ -8,6 +8,7 @@ enum Api { list = '/iot/tplink/cameraInfo/list', syncProjectIpcDevice = '/iot/tplink/cameraInfo/syncProjectIpcDevice', syncAllDevices = '/iot/tplink/cameraInfo/syncAllDevices', + syncDevicesStatus = '/iot/tplink/cameraInfo/syncDevicesStatus', ipcCapability = '/iot/tplink/cameraInfo/getIpcCapability', nuList = '/iot/tplink/cameraInfo/nuList', edit = '/iot/tplink/cameraInfo/edit', @@ -42,6 +43,10 @@ enum Api { getUploadToServerProcess = '/iot/tplink/cameraInfo/getUploadToServerProcess', motionCtrl = '/iot/tplink/cameraInfo/motionCtrl', + getConfig = '/iot/tplink/config/getByCode', + addConfig = '/iot/tplink/config/add', + editConfig = '/iot/tplink/config/edit', + } /** @@ -87,6 +92,12 @@ export const syncProjectIpcDevice = (params) => defHttp.get({ url: Api.syncProje */ export const syncAllDevices = (params) => defHttp.get({ url: Api.syncAllDevices, params }); +/** + * 同步设备在线状态 + * @param params + */ +export const syncDevicesStatus = (params) => defHttp.get({ url: Api.syncDevicesStatus, params }); + /** * 获取IPC能力集 * @param params @@ -109,7 +120,7 @@ export const nuList = (params) => defHttp.get({ url: Api.nuList, params }); * @param params */ export const update = (params) => { - return defHttp.post({ url: Api.edit, params }); + return defHttp.post({ url: Api.edit, params },{ isTransformResponse: false }); } /** * 重启 @@ -287,4 +298,18 @@ export const getUploadToServerProcess = (params) => defHttp.get({ url: Api.getUp */ export const motionCtrl = (params) => defHttp.get({ url: Api.motionCtrl, params }); +/** + * 获取配置数据 + * @param params + */ +export const getConfig = (params) => defHttp.get({ url: Api.getConfig, params }); +/** + * 保存或者更新配置 + * @param params + * @param isUpdate + */ +export const saveOrUpdateConfig = (params, isUpdate) => { + let url = isUpdate ? Api.editConfig : Api.addConfig; + return defHttp.post({ url: url, params }, { isTransformResponse: false }); +}; diff --git a/src/views/iot/tplink/camera/camera.data.ts b/src/views/iot/tplink/camera/camera.data.ts index 8fa9305..dd549f3 100644 --- a/src/views/iot/tplink/camera/camera.data.ts +++ b/src/views/iot/tplink/camera/camera.data.ts @@ -10,35 +10,61 @@ export const columns: BasicColumn[] = [ dataIndex: 'deviceIndex' }, { - title: 'SN', - align: "center", - dataIndex: 'sn' - }, - { - title: '设备名称', + title: '设备标识', align: "center", dataIndex: 'deviceName' }, - { - title: '设备状态', - align: "center", - dataIndex: 'deviceStatus_dictText' - }, { title: '设备型号', align: "center", dataIndex: 'deviceModel' }, + { + title: '设备类型', + align: "center", + dataIndex: 'deviceType', + customRender:({record})=>{ + if(record.deviceType=='NETWORKVIDEORECORDER'){ + return "录像机"; + } + if(record.deviceType=='SURVEILLANCECAMERA'){ + return "摄像头"; + } + }, + }, + // { + // title: 'SN', + // align: "center", + // dataIndex: 'sn' + // }, + + { + title: '在线状态', + align: "center", + dataIndex: 'deviceStatus_dictText' + }, + { + title: '分配状态', + align: "center", + dataIndex: 'izAllocate', + customRender:({record})=>{ + if(record.izAllocate=='Y'){ + return "已分配"; + }else{ + return "未分配"; + } + }, + }, // { // title: 'IP地址', // align: "center", // dataIndex: 'ip' // }, - // { - // title: 'MAC地址', - // align: "center", - // dataIndex: 'mac' - // }, + { + title: 'MAC地址', + align: "center", + dataIndex: 'mac' + }, // { // title: '区域名称', // align: "center", @@ -69,36 +95,41 @@ export const columns: BasicColumn[] = [ // align: "center", // dataIndex: 'nuName' // }, - { - title: 'MAC地址', - align: "center", - dataIndex: 'mac' - }, - { - title: 'FTP地址', - align: "center", - dataIndex: 'ftpIp' - }, - { - title: 'FTP端口', - align: "center", - dataIndex: 'ftpPort' - }, - { - title: 'FTP用户', - align: "center", - dataIndex: 'ftpUsername' - }, - { - title: 'FTP密码', - align: "center", - dataIndex: 'ftpPassword' - }, - { - title: 'FTP上传路径', - align: "center", - dataIndex: 'ftpUploadpath' - }, + // { + // title: 'MAC地址', + // align: "center", + // dataIndex: 'mac' + // }, + // { + // title: 'FTP地址', + // align: "center", + // dataIndex: 'ftpIp' + // }, + // { + // title: 'FTP端口', + // align: "center", + // dataIndex: 'ftpPort' + // }, + // { + // title: 'FTP用户', + // align: "center", + // dataIndex: 'ftpUsername' + // }, + // { + // title: 'FTP密码', + // align: "center", + // dataIndex: 'ftpPassword' + // }, + // { + // title: 'FTP上传路径', + // align: "center", + // dataIndex: 'ftpUploadpath' + // }, + // { + // title: '备注', + // align: "center", + // dataIndex: 'remarks' + // }, ]; export const formSchema: FormSchema[] = [ @@ -118,10 +149,23 @@ export const formSchema: FormSchema[] = [ dynamicDisabled: true }, { - label: 'SN', - field: 'sn', - component: 'Input', + label: '设备类型', + field: 'deviceType', + component: 'JDictSelectTag', + componentProps: { + placeholder: '请选择设备类型', + options: [ + { label: '录像机', value: 'NETWORKVIDEORECORDER' }, + { label: '摄像头', value: 'SURVEILLANCECAMERA' }, + ], + }, + dynamicDisabled: true }, + // { + // label: 'SN', + // field: 'sn', + // component: 'Input', + // }, { label: '设备名称', field: 'deviceName', @@ -199,32 +243,80 @@ export const formSchema: FormSchema[] = [ label: 'FTP地址', field: 'ftpIp', component: 'Input', + show: ({model})=>{ + if(model.deviceType == 'SURVEILLANCECAMERA'){ + return true; + }else{ + return false; + } + } }, { label: 'FTP端口', field: 'ftpPort', component: 'Input', + show: ({model})=>{ + if(model.deviceType == 'SURVEILLANCECAMERA'){ + return true; + }else{ + return false; + } + } }, { label: 'FTP用户', field: 'ftpUsername', component: 'Input', + show: ({model})=>{ + if(model.deviceType == 'SURVEILLANCECAMERA'){ + return true; + }else{ + return false; + } + } }, { label: 'FTP密码', field: 'ftpPassword', component: 'Input', + show: ({model})=>{ + if(model.deviceType == 'SURVEILLANCECAMERA'){ + return true; + }else{ + return false; + } + } }, { label: 'FTP上传路径', field: 'ftpUploadpath', component: 'Input', + show: ({model})=>{ + if(model.deviceType == 'SURVEILLANCECAMERA'){ + return true; + }else{ + return false; + } + } } ]; export const searchFormSchema: FormSchema[] = [ { - label: '设备状态', + label: '设备类型', + field: 'deviceType', + component: 'JDictSelectTag', + componentProps: { + placeholder: '请选择设备类型', + options: [ + { label: '录像机', value: 'NETWORKVIDEORECORDER' }, + { label: '摄像头', value: 'SURVEILLANCECAMERA' }, + ], + }, + //colProps: { span: 6 }, + }, + { + label: '在线状态', field: 'deviceStatus', component: 'JDictSelectTag', componentProps: { @@ -234,6 +326,19 @@ export const searchFormSchema: FormSchema[] = [ }, //colProps: { span: 6 }, }, + { + label: '分配状态', + field: 'izAllocate', + component: 'JDictSelectTag', + componentProps: { + placeholder: '请选择分配状态', + options: [ + { label: '已分配', value: 'Y' }, + { label: '未分配', value: 'N' }, + ], + }, + //colProps: { span: 6 }, + }, ]; //列表数据 diff --git a/src/views/iot/tplink/camera/components/CameraInfoForm.vue b/src/views/iot/tplink/camera/components/CameraInfoForm.vue new file mode 100644 index 0000000..ed391ad --- /dev/null +++ b/src/views/iot/tplink/camera/components/CameraInfoForm.vue @@ -0,0 +1,230 @@ + + + + + diff --git a/src/views/iot/tplink/camera/components/ConfigInfoForm.vue b/src/views/iot/tplink/camera/components/ConfigInfoForm.vue new file mode 100644 index 0000000..e78c2af --- /dev/null +++ b/src/views/iot/tplink/camera/components/ConfigInfoForm.vue @@ -0,0 +1,203 @@ + + + + + diff --git a/src/views/iot/tplink/camera/components/DrawerModal.vue b/src/views/iot/tplink/camera/components/DrawerModal.vue new file mode 100644 index 0000000..6fb7e44 --- /dev/null +++ b/src/views/iot/tplink/camera/components/DrawerModal.vue @@ -0,0 +1,137 @@ + + + + + + diff --git a/src/views/iot/tplink/camera/index.vue b/src/views/iot/tplink/camera/index.vue index 181afa3..bdfa21e 100644 --- a/src/views/iot/tplink/camera/index.vue +++ b/src/views/iot/tplink/camera/index.vue @@ -48,12 +48,15 @@ -->