added notif 2

This commit is contained in:
2026-07-23 22:24:26 +03:30
parent d505f3b5bd
commit bd441a0e8e
31 changed files with 2105 additions and 34 deletions
@@ -0,0 +1,80 @@
<template>
<div>
<BasicShowContext title="اعلان‌های اپ">
<template #extra>
<div class="flex items-center gap-2">
<AdminFieldHelp
text="اعلان‌های ثبت‌شده برای همهٔ مشتریان فعال در اپ نمایش داده می‌شود. فقط وقتی سوییچ «اعلان داخل اپ» روشن باشد."
/>
<BaseButton type="primary" size="small" @click="emits('add')">
<span>افزودن اعلان</span>
<BaseIcon icon="vuesax-linear:add" size="16" />
</BaseButton>
</div>
</template>
<BaseTable v-bind="tblProps" @register="submit" ref="tbl">
<template #action="{ record }">
<div class="flex justify-center gap-2">
<a-tooltip placement="bottom">
<template #title>ویرایش</template>
<Icon
icon="vuesax-linear:edit"
color="#4572E9"
class="cursor-pointer"
@click="emits('edit', record)"
/>
</a-tooltip>
<a-tooltip placement="bottom">
<template #title>{{ record.is_active ? 'غیرفعال کردن' : 'فعال کردن' }}</template>
<Icon
:icon="record.is_active ? 'vuesax-linear:eye-slash' : 'vuesax-linear:eye'"
:color="record.is_active ? '#C53030' : '#25855A'"
class="cursor-pointer"
@click="emits('toggle', record)"
/>
</a-tooltip>
<a-tooltip placement="bottom">
<template #title>حذف</template>
<Icon
icon="vuesax-linear:trash"
color="#C53030"
class="cursor-pointer"
@click="emits('delete', record.id)"
/>
</a-tooltip>
</div>
</template>
</BaseTable>
</BasicShowContext>
</div>
</template>
<script lang="tsx" setup>
import type { TableInput } from '@core/type/baseTable'
import useBaseTable from '@core/components/BaseTableOld/hooks/useBaseTable'
import Icon from '@core/components/BaseIcon/src/Icon.vue'
import { cols } from '../hooks/appNotificationsColumns'
import { getAppNotificationsTable } from '@/api/appNotifications'
import AdminFieldHelp from '@/components/AdminFieldHelp.vue'
const [submit, reload] = useBaseTable()
const emits = defineEmits<{
add: []
edit: [record: Record<string, unknown>]
toggle: [record: Record<string, unknown>]
delete: [id: number]
}>()
const tblProps = {
columns: cols,
api: (params: TableInput) => getAppNotificationsTable(params),
}
function fetch() {
reload()
}
defineExpose({ fetch })
</script>