fix edits for borsemes

This commit is contained in:
2026-07-23 17:53:28 +03:30
parent 73feee2048
commit d505f3b5bd
12 changed files with 353 additions and 261 deletions
@@ -17,6 +17,7 @@
:item="item"
@open="openSheet"
@toggle-sts="confirmToggleSts"
@delete="confirmDelete"
/>
</MobileCardList>
@@ -37,6 +38,7 @@ type AccountRow = Card & { sts_str?: string; created_at?: string; customer_id?:
const emit = defineEmits<{
(e: 'toggleSts', item: AccountRow): void
(e: 'delete', id: number): void
}>()
const { sheetVisible, selectedItem, openSheet, syncSelectedItem } = useMobileDetailSheet<AccountRow>()
@@ -55,6 +57,11 @@ function confirmToggleSts(item: AccountRow) {
})
}
function confirmDelete(item: AccountRow) {
if (item.id == null) return
emit('delete', item.id)
}
const { loading, search, items, hasMore, reload, loadMore, fetch } = useMobileTableList<AccountRow>({
fetchApi: getAccountTable,
onFetched: (rows) => syncSelectedItem(rows)
@@ -20,6 +20,12 @@
:size="20"
@click="$emit('toggleSts', item)"
/>
<MobileIconButton
icon="vuesax-linear:trash"
color="#DC2626"
:size="20"
@click="$emit('delete', item)"
/>
</div>
</MobileCard>
</template>
@@ -38,6 +44,7 @@ const props = defineProps<{
defineEmits<{
(e: 'open', item: AccountRow): void
(e: 'toggleSts', item: AccountRow): void
(e: 'delete', item: AccountRow): void
}>()
const customerName = computed(() => props.item.customer?.name || '-')
@@ -10,7 +10,7 @@
</BaseButton>-->
</template>
<template #action="{ column, record }">
<div class="gap-2 flex justify-center">
<div class="gap-2 flex justify-center items-center">
<a-tooltip
:key="record.sts"
placement="bottom"
@@ -25,6 +25,12 @@
:color="record.sts !== 2 ? 'red' : 'green'"
/>
</a-tooltip>
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('delete', record.id)">
<template #title>
<span>حذف کارت</span>
</template>
<Icon icon="vuesax-linear:trash" color="red" />
</a-tooltip>
</div>
</template>
</BaseTable>
@@ -34,6 +40,7 @@
ref="mobileListRef"
class="min-h-0 flex-1"
@toggle-sts="changeAccountStsFunction"
@delete="(id) => emits('delete', id)"
/>
</div>
</BasicShowContext>