From 8f51ec9a69eaed9f3edb727a56829f34b95c93f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Mon, 2 Mar 2026 13:44:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=A9=E6=B9=BF=E5=BA=A6=E8=AE=A1=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tplink/camera/components/DrawerModal.vue | 3 - .../humid/components/ConfigInfoForm.vue | 162 ++++++++++++++++++ .../humid/components/ConfigModal.vue | 82 +++++++++ src/views/iot/yiweilian/humid/humid.api.ts | 21 +++ src/views/iot/yiweilian/humid/index.vue | 36 ++-- 5 files changed, 288 insertions(+), 16 deletions(-) create mode 100644 src/views/iot/yiweilian/humid/components/ConfigInfoForm.vue create mode 100644 src/views/iot/yiweilian/humid/components/ConfigModal.vue diff --git a/src/views/iot/tplink/camera/components/DrawerModal.vue b/src/views/iot/tplink/camera/components/DrawerModal.vue index 6fb7e44..899b54e 100644 --- a/src/views/iot/tplink/camera/components/DrawerModal.vue +++ b/src/views/iot/tplink/camera/components/DrawerModal.vue @@ -65,7 +65,6 @@ function edit(record) { */ async function configEdit() { await getConfig({}).then((res) => { - console.log(res); configVisible.value = true; if(res!=null){ title.value = '编辑配置'; @@ -79,8 +78,6 @@ async function configEdit() { }); } }) - - } /** diff --git a/src/views/iot/yiweilian/humid/components/ConfigInfoForm.vue b/src/views/iot/yiweilian/humid/components/ConfigInfoForm.vue new file mode 100644 index 0000000..a349258 --- /dev/null +++ b/src/views/iot/yiweilian/humid/components/ConfigInfoForm.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/views/iot/yiweilian/humid/components/ConfigModal.vue b/src/views/iot/yiweilian/humid/components/ConfigModal.vue new file mode 100644 index 0000000..fe46609 --- /dev/null +++ b/src/views/iot/yiweilian/humid/components/ConfigModal.vue @@ -0,0 +1,82 @@ + + + + + + diff --git a/src/views/iot/yiweilian/humid/humid.api.ts b/src/views/iot/yiweilian/humid/humid.api.ts index a2bf6ff..c547a7f 100644 --- a/src/views/iot/yiweilian/humid/humid.api.ts +++ b/src/views/iot/yiweilian/humid/humid.api.ts @@ -9,6 +9,11 @@ enum Api { updateDeviceRealTime = '/iot/yiweilian/humidDevice/updateDeviceRealTime', logList = '/iot/yiweilian/humidDevice/logList', alarmList = '/iot/yiweilian/humidAlarm/list', + + getConfig = '/iot/yiweilian/config/getConfig', + addConfig = '/iot/yiweilian/config/add', + editConfig = '/iot/yiweilian/config/edit', + } /** @@ -58,3 +63,19 @@ export const logList = (params?) => defHttp.get({ url: Api.logList, params }); * @param params */ export const alarmList = (params?) => defHttp.get({ url: Api.alarmList, 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/yiweilian/humid/index.vue b/src/views/iot/yiweilian/humid/index.vue index d8073bd..38b86d5 100644 --- a/src/views/iot/yiweilian/humid/index.vue +++ b/src/views/iot/yiweilian/humid/index.vue @@ -5,6 +5,7 @@