From 77bdf1df47514d00794b38e06d45ea7446d33815 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Mon, 4 Aug 2025 17:46:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=BC=B9=E7=AA=97load?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/license/customer/modules/form.vue | 10 ++++------ .../src/views/license/license/modules/detail.vue | 7 +------ .../src/views/license/license/modules/form.vue | 9 +++------ .../src/views/license/license/modules/history.vue | 4 ++-- .../src/views/license/project/modules/form.vue | 9 +++------ 5 files changed, 13 insertions(+), 26 deletions(-) diff --git a/apps/web-antd/src/views/license/customer/modules/form.vue b/apps/web-antd/src/views/license/customer/modules/form.vue index 281e746..b8c72be 100644 --- a/apps/web-antd/src/views/license/customer/modules/form.vue +++ b/apps/web-antd/src/views/license/customer/modules/form.vue @@ -74,12 +74,8 @@ const [Modal, modalApi] = useVbenModal({ return; } if (data.id) { - modalApi.lock(); - try { - data = await getCustomer(data.id); - } finally { - modalApi.unlock(); - } + modalApi.setState({ loading: true }); + data = await getCustomer(data.id); } // 设置到 values @@ -91,6 +87,8 @@ const [Modal, modalApi] = useVbenModal({ if (!formData.value?.code) { formApi.setFieldValue('code', maxSn); } + + modalApi.setState({ loading: false }); }, }); diff --git a/apps/web-antd/src/views/license/license/modules/detail.vue b/apps/web-antd/src/views/license/license/modules/detail.vue index 54256ae..f4f9640 100644 --- a/apps/web-antd/src/views/license/license/modules/detail.vue +++ b/apps/web-antd/src/views/license/license/modules/detail.vue @@ -29,12 +29,7 @@ const [Modal, modalApi] = useVbenModal({ if (!data || !data.id) { return; } - modalApi.lock(); - try { - formData.value = data; - } finally { - modalApi.unlock(); - } + formData.value = data; }, }); diff --git a/apps/web-antd/src/views/license/license/modules/form.vue b/apps/web-antd/src/views/license/license/modules/form.vue index f8ccfd7..db37d5c 100644 --- a/apps/web-antd/src/views/license/license/modules/form.vue +++ b/apps/web-antd/src/views/license/license/modules/form.vue @@ -113,12 +113,8 @@ const [Modal, modalApi] = useVbenModal({ return; } if (data.id) { - modalApi.lock(); - try { - data = await getLicense(data.id); - } finally { - modalApi.unlock(); - } + modalApi.setState({ loading: true }); + data = await getLicense(data.id); } // 处理数据 data.expiryDate = data.expiryDate ? data.expiryDate.toString() : ''; @@ -129,6 +125,7 @@ const [Modal, modalApi] = useVbenModal({ { neList: [], activationCode: '', id: 1 }, ]; await formApi.setValues(formData.value); + modalApi.setState({ loading: false }); }, }); diff --git a/apps/web-antd/src/views/license/license/modules/history.vue b/apps/web-antd/src/views/license/license/modules/history.vue index 4d52e79..6284038 100644 --- a/apps/web-antd/src/views/license/license/modules/history.vue +++ b/apps/web-antd/src/views/license/license/modules/history.vue @@ -25,11 +25,11 @@ const [Modal, modalApi] = useVbenModal({ if (!data || !data.id) { return; } - modalApi.lock(); + modalApi.setState({ loading: true }); try { formDataList.value = await getLicenseHistory(data.id); } finally { - modalApi.unlock(); + modalApi.setState({ loading: false }); } }, }); diff --git a/apps/web-antd/src/views/license/project/modules/form.vue b/apps/web-antd/src/views/license/project/modules/form.vue index 371bf9c..b558d8c 100644 --- a/apps/web-antd/src/views/license/project/modules/form.vue +++ b/apps/web-antd/src/views/license/project/modules/form.vue @@ -70,12 +70,8 @@ const [Modal, modalApi] = useVbenModal({ return; } if (data.id) { - modalApi.lock(); - try { - data = await getProject(data.id); - } finally { - modalApi.unlock(); - } + modalApi.setState({ loading: true }); + data = await getProject(data.id); } data.startTime = data.startTime ? data.startTime.toString() : ''; data.endTime = data.endTime ? data.endTime.toString() : ''; @@ -88,6 +84,7 @@ const [Modal, modalApi] = useVbenModal({ if (!formData.value?.code) { formApi.setFieldValue('code', maxSn); } + modalApi.setState({ loading: false }); }, });