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 = () => { +
+ +
+