From 167e1291e21032d9a14b47174e57dd1dbcc3fefb Mon Sep 17 00:00:00 2001 From: hwj Date: Tue, 10 Feb 2026 14:10:54 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E9=87=87=E9=9B=86=E8=AE=BE?= =?UTF-8?q?=E5=A4=87-=E6=96=B0=E5=A2=9E/=E7=BC=96=E8=BE=91=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E6=89=93=E5=BC=80=E6=97=B6=E8=AF=B7=E6=B1=82=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/device/DeviceForm.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/views/iot/device/DeviceForm.vue b/src/views/iot/device/DeviceForm.vue index 6a53b879..e5a744ac 100644 --- a/src/views/iot/device/DeviceForm.vue +++ b/src/views/iot/device/DeviceForm.vue @@ -167,7 +167,14 @@ const open = async (type: string, id?: number) => { type === 'setting' ? t('DataCollection.Device.settingDialogTitle') : t('action.' + type) formType.value = type resetForm() - // 修改时,设置数据 + + try { + const models = await DeviceModelApi.getDeviceModelList() + modelList.value = Array.isArray(models) ? models : [] + } catch { + modelList.value = [] + } + if (id) { formLoading.value = true try { @@ -244,8 +251,4 @@ const resetForm = () => { } /** 初始化 **/ -onMounted(async () => { - modelList.value = await DeviceModelApi.getDeviceModelList() - -})