From 8b867709b28ae67c0798e8f5c81f9e02ccc1f8bb Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sun, 9 Aug 2026 15:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B4=A6=E5=8F=B7=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=A1=AE=E8=AE=A4=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/account/AccountTable.vue | 44 ++++++++++++++++++- frontend/src/composables/useAccounts.ts | 1 - 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/account/AccountTable.vue b/frontend/src/components/account/AccountTable.vue index 79b8a18..9a082ca 100644 --- a/frontend/src/components/account/AccountTable.vue +++ b/frontend/src/components/account/AccountTable.vue @@ -36,6 +36,8 @@ const productFilterMap = ref>({}) const qrImage = ref('') const recordsModal = ref<{ accountName: string; loading: boolean; error: string; records: any[] } | null>(null) const exchangeLookup = ref<{ productId: string; productName: string; loading: boolean; results: Record } | null>(null) +const deleteTargetAccount = ref(null) +const deletingAccount = ref(false) watch(xiaodianQRCode, async (value) => { qrImage.value = '' @@ -56,6 +58,25 @@ const handleBind = async () => { await bindXiaodianRole() } +const requestDeleteAccount = (accountName: string) => { + deleteTargetAccount.value = accountName +} + +const closeDeleteAccount = () => { + if (!deletingAccount.value) deleteTargetAccount.value = null +} + +const confirmDeleteAccount = async () => { + const accountName = deleteTargetAccount.value + if (!accountName || deletingAccount.value) return + deletingAccount.value = true + try { + if (await deleteAccount(accountName)) deleteTargetAccount.value = null + } finally { + deletingAccount.value = false + } +} + const allSelected = computed(() => accounts.value.length > 0 && selectedIndices.value.size === accounts.value.length ) @@ -385,7 +406,7 @@ const closeExchangeRecords = () => { @@ -431,6 +452,23 @@ const closeExchangeRecords = () => { +
+ +
+