From 054da5dd74a5f8026965dcc51c21db2abb5b9d64 Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Tue, 15 Jul 2025 17:10:48 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/add-account-modal/index.vue | 2 +- .../components/authorized-account-modal/index.vue | 11 +++++++---- .../components/select-sub-account-modal/index.vue | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/views/property-marketing/put-account/account-manage/components/add-account-modal/index.vue b/src/views/property-marketing/put-account/account-manage/components/add-account-modal/index.vue index ed5de94..64f2acd 100644 --- a/src/views/property-marketing/put-account/account-manage/components/add-account-modal/index.vue +++ b/src/views/property-marketing/put-account/account-manage/components/add-account-modal/index.vue @@ -299,7 +299,7 @@ const handleAdd = async () => { authorizedAccountModalRef.value.open({ accountId: data?.id }); } } else { - authorizedAccountModalRef.value.open({ form: form.value }); + authorizedAccountModalRef.value.open({ form: form.value, needSelectSubAccount: true }); } }; const handleEdit = async () => { diff --git a/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue b/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue index 572636b..b3ce517 100644 --- a/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue +++ b/src/views/property-marketing/put-account/account-manage/components/authorized-account-modal/index.vue @@ -94,6 +94,7 @@ const id = ref(''); const selectSubAccountModalRef = ref(null); const lastSyncedAt = ref(null); // 上次同步时间戳 const showSyncTip = ref(false); +const shouldSelectSubAccount = ref(false); const syncType = ref(INITIAL_SYNC_TYPE); // sync | no_sync const addAccountFormData = ref(null); // 添加账户表单数据 @@ -132,12 +133,13 @@ const getDaysDiffText = (lastSyncedAt) => { return `${daysDiff}天`; }; -const open = ({ accountId, last_synced_at = null, form = null }) => { +const open = ({ accountId, last_synced_at = null, form = null, needSelectSubAccount = false }) => { reset(); id.value = accountId; lastSyncedAt.value = last_synced_at; addAccountFormData.value = form; + shouldSelectSubAccount.value = needSelectSubAccount; visible.value = true; }; @@ -155,6 +157,7 @@ const reset = () => { lastSyncedAt.value = null; syncType.value = INITIAL_SYNC_TYPE; showSyncTip.value = false; + shouldSelectSubAccount.value = false; addAccountFormData.value = null; clearFakeProgressTimer(); clearStatusPollingTimer(); @@ -276,14 +279,14 @@ const handleOk = () => { // 未完成,校验表单 formRef.value.validate(async (errors) => { if (errors) return; - if (form.value.platform === ENUM_PLATFORM.jg) { - startLoading(); - } else { + if (shouldSelectSubAccount.value) { visible.value = false; selectSubAccountModalRef.value.open({ ...addAccountFormData.value, ...form.value, }); + } else { + startLoading(); } }); }; diff --git a/src/views/property-marketing/put-account/account-manage/components/select-sub-account-modal/index.vue b/src/views/property-marketing/put-account/account-manage/components/select-sub-account-modal/index.vue index 56de81b..126350a 100644 --- a/src/views/property-marketing/put-account/account-manage/components/select-sub-account-modal/index.vue +++ b/src/views/property-marketing/put-account/account-manage/components/select-sub-account-modal/index.vue @@ -160,7 +160,7 @@ const onClose = () => { selectedAccounts.value = []; selectedRowKeys.value = []; query.value = cloneDeep(INITIAL_FORM); - pageInfo.value = cloneDeep(INITIAL_FORM); + pageInfo.value = cloneDeep(INITIAL_PAGE_INFO); visible.value = false; };