changes of giftCard page

This commit is contained in:
2026-10-20 12:11:46 +03:30
parent 2927d64c64
commit e5b3d0c931
55 changed files with 1495 additions and 140 deletions
@@ -18,19 +18,21 @@
<div class="truncate font-bold text-slate-800 dark:text-slate-100">{{ item.name }}</div>
<div class="text-xs text-gray-500">{{ item.code }}</div>
</div>
<a-switch :checked="item.is_active" size="small" @change="emits('toggle', item)" />
<a-switch v-if="can('toggle')" :checked="item.is_active" size="small" @change="emits('toggle', item)" />
</div>
<div class="line-clamp-2 text-sm text-slate-600 dark:text-slate-300">{{ item.body }}</div>
<div class="flex items-center justify-between text-xs text-gray-500">
<span>ارسال {{ Number(item.sent_count ?? 0) }} · ناموفق {{ Number(item.failed_count ?? 0) }}</span>
<div class="flex gap-3">
<Icon
v-if="can('edit')"
icon="vuesax-linear:edit"
color="#4572E9"
class="cursor-pointer"
@click="emits('edit', item)"
/>
<Icon
v-if="can('delete')"
icon="vuesax-linear:trash"
color="#C53030"
class="cursor-pointer"
@@ -46,11 +48,11 @@
<BaseTable v-else class="h-full min-h-0 min-w-0" v-bind="tblProps" @register="submit" ref="tbl">
<template #is_active="{ record }">
<a-switch :checked="record.is_active" size="small" @change="emits('toggle', record)" />
<a-switch v-if="can('toggle')" :checked="record.is_active" size="small" @change="emits('toggle', record)" />
</template>
<template #action="{ record }">
<div class="flex justify-center gap-2">
<a-tooltip placement="bottom">
<a-tooltip v-if="can('preview')" placement="bottom">
<template #title>اجرای آزمایشی</template>
<Icon
icon="vuesax-linear:play"
@@ -59,7 +61,7 @@
@click="emits('runNow', record)"
/>
</a-tooltip>
<a-tooltip placement="bottom">
<a-tooltip v-if="can('log')" placement="bottom">
<template #title>لاگ ارسال</template>
<Icon
icon="vuesax-linear:document-text"
@@ -68,7 +70,7 @@
@click="emits('sends', record)"
/>
</a-tooltip>
<a-tooltip placement="bottom">
<a-tooltip v-if="can('edit')" placement="bottom">
<template #title>ویرایش</template>
<Icon
icon="vuesax-linear:edit"
@@ -77,7 +79,7 @@
@click="emits('edit', record)"
/>
</a-tooltip>
<a-tooltip placement="bottom">
<a-tooltip v-if="can('delete')" placement="bottom">
<template #title>حذف</template>
<Icon
icon="vuesax-linear:trash"
@@ -104,6 +106,9 @@ import { getAutomationsTable } from '@/api/automations'
import type { Automation } from '@/model/automations'
import { useMobileTableList } from '@/components/mobile/composables/useMobileTableList'
import { automationsPageIntro } from '@/utils/adminHelpCopy'
import { usePageActionAccess } from '@/composables/usePageActionAccess'
const { can } = usePageActionAccess()
const [submit, reload] = useBaseTable()