feat(web): adopt vuesax icons and shared skeleton loading
Replace the inline SVG icon set with the vuesax linear pack, add skeleton primitives for loading states, and keep page scroll inside the app shell. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,7 +39,6 @@ import {
|
||||
Row as ARow,
|
||||
Select as ASelect,
|
||||
Space as ASpace,
|
||||
Spin as ASpin,
|
||||
Switch as ASwitch,
|
||||
Table as ATable,
|
||||
TabPane as ATabPane,
|
||||
@@ -54,7 +53,8 @@ import {
|
||||
SendOutlined,
|
||||
StopOutlined,
|
||||
BarChartOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
} from '@/icons/ant-bridge';
|
||||
import { CrmSkeleton, CrmSkeletonList, CrmSkeletonTable } from '@/components/skeleton';
|
||||
|
||||
const { Title: ATypographyTitle, Text: ATypographyText } = Typography;
|
||||
const AListItemMeta = AList.Item.Meta;
|
||||
@@ -427,134 +427,134 @@ onMounted(() => {
|
||||
<a-alert v-if="error" type="error" show-icon :message="error" closable @close="error = ''" />
|
||||
<a-alert v-if="ok" type="success" show-icon :message="ok" closable @close="ok = ''" />
|
||||
|
||||
<a-spin :spinning="loading">
|
||||
<a-card :bordered="false" title="کمپین جدید">
|
||||
<a-form layout="vertical" @finish="createCampaign">
|
||||
<a-divider orientation="right">متن و تنظیمات</a-divider>
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :xs="24" :md="12">
|
||||
<a-form-item label="نام کمپین" required>
|
||||
<a-input
|
||||
v-model:value="name"
|
||||
placeholder="مثلاً اطلاعرسانی جشنواره"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :md="12">
|
||||
<a-form-item label="ارسال">
|
||||
<a-space :size="8">
|
||||
<a-switch v-model:checked="queueNow" />
|
||||
<a-typography-text>ارسال فوری پس از ذخیره</a-typography-text>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="متن پیامک" required>
|
||||
<template #extra>
|
||||
<a-dropdown v-model:open="fieldsOpen" :trigger="['click']">
|
||||
<a-button type="link">{ } فیلدهای پویا</a-button>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item
|
||||
v-for="item in MESSAGE_AUTOMATION_FIELDS"
|
||||
:key="item.token"
|
||||
@click="insertField(item.token)"
|
||||
>
|
||||
{{ item.token }} — {{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<a-textarea
|
||||
v-model:value="body"
|
||||
:rows="4"
|
||||
placeholder="متن پیامک را بنویسید… از فیلدهای پویا استفاده کنید. لینک http(s) برای هر مخاطب یکتا میشود."
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-card :bordered="false" title="کمپین جدید">
|
||||
<a-form layout="vertical" @finish="createCampaign">
|
||||
<a-divider orientation="right">متن و تنظیمات</a-divider>
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :xs="24" :md="12">
|
||||
<a-form-item label="نام کمپین" required>
|
||||
<a-input
|
||||
v-model:value="name"
|
||||
placeholder="مثلاً اطلاعرسانی جشنواره"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :md="12">
|
||||
<a-form-item label="ارسال">
|
||||
<a-space :size="8">
|
||||
<a-switch v-model:checked="queueNow" />
|
||||
<a-typography-text>ارسال فوری پس از ذخیره</a-typography-text>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="متن پیامک" required>
|
||||
<template #extra>
|
||||
<a-dropdown v-model:open="fieldsOpen" :trigger="['click']">
|
||||
<a-button type="link">{ } فیلدهای پویا</a-button>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item
|
||||
v-for="item in MESSAGE_AUTOMATION_FIELDS"
|
||||
:key="item.token"
|
||||
@click="insertField(item.token)"
|
||||
>
|
||||
{{ item.token }} — {{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<a-textarea
|
||||
v-model:value="body"
|
||||
:rows="4"
|
||||
placeholder="متن پیامک را بنویسید… از فیلدهای پویا استفاده کنید. لینک http(s) برای هر مخاطب یکتا میشود."
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-divider orientation="right">مخاطبان</a-divider>
|
||||
<a-tabs :active-key="audience" @change="onAudienceChange">
|
||||
<a-tab-pane key="people" tab="اشخاص" />
|
||||
<a-tab-pane key="leads" tab="لیدها" />
|
||||
</a-tabs>
|
||||
<a-divider orientation="right">مخاطبان</a-divider>
|
||||
<a-tabs :active-key="audience" @change="onAudienceChange">
|
||||
<a-tab-pane key="people" tab="اشخاص" />
|
||||
<a-tab-pane key="leads" tab="لیدها" />
|
||||
</a-tabs>
|
||||
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="جستجو">
|
||||
<a-input
|
||||
v-model:value="q"
|
||||
allow-clear
|
||||
placeholder="نام یا موبایل…"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="audience === 'people'" :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="استان">
|
||||
<a-input
|
||||
v-model:value="province"
|
||||
allow-clear
|
||||
placeholder="مثلاً اصفهان"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="شهر">
|
||||
<a-input
|
||||
v-model:value="city"
|
||||
allow-clear
|
||||
placeholder="شهر…"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="audience === 'leads'" :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="منطقه / استان">
|
||||
<a-input
|
||||
v-model:value="region"
|
||||
allow-clear
|
||||
placeholder="منطقه یا استان…"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="audience === 'leads'" :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="مرحله">
|
||||
<a-select
|
||||
v-model:value="stageId"
|
||||
:options="stageOptions"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="موبایل">
|
||||
<a-space :size="8">
|
||||
<a-checkbox v-model:checked="hasMobile" />
|
||||
<a-typography-text>فقط با موبایل</a-typography-text>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="جستجو">
|
||||
<a-input
|
||||
v-model:value="q"
|
||||
allow-clear
|
||||
placeholder="نام یا موبایل…"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="audience === 'people'" :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="استان">
|
||||
<a-input
|
||||
v-model:value="province"
|
||||
allow-clear
|
||||
placeholder="مثلاً اصفهان"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="شهر">
|
||||
<a-input
|
||||
v-model:value="city"
|
||||
allow-clear
|
||||
placeholder="شهر…"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="audience === 'leads'" :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="منطقه / استان">
|
||||
<a-input
|
||||
v-model:value="region"
|
||||
allow-clear
|
||||
placeholder="منطقه یا استان…"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="audience === 'leads'" :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="مرحله">
|
||||
<a-select
|
||||
v-model:value="stageId"
|
||||
:options="stageOptions"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="8">
|
||||
<a-form-item label="موبایل">
|
||||
<a-space :size="8">
|
||||
<a-checkbox v-model:checked="hasMobile" />
|
||||
<a-typography-text>فقط با موبایل</a-typography-text>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-flex justify="space-between" align="center" wrap="wrap" :gap="8" :style="{ marginBottom: '12px' }">
|
||||
<a-typography-text type="secondary">
|
||||
انتخابشده: {{ toFaDigits(selectedIds.length) }} نفر · نتایج فیلتر:
|
||||
{{ toFaDigits(total) }}
|
||||
</a-typography-text>
|
||||
<a-space wrap :size="8">
|
||||
<a-button @click="selectVisible">انتخاب صفحه</a-button>
|
||||
<a-button @click="selectAllFiltered">انتخاب همهٔ نتایج فیلتر</a-button>
|
||||
</a-space>
|
||||
</a-flex>
|
||||
<a-flex justify="space-between" align="center" wrap="wrap" :gap="8" :style="{ marginBottom: '12px' }">
|
||||
<a-typography-text type="secondary">
|
||||
انتخابشده: {{ toFaDigits(selectedIds.length) }} نفر · نتایج فیلتر:
|
||||
{{ toFaDigits(total) }}
|
||||
</a-typography-text>
|
||||
<a-space wrap :size="8">
|
||||
<a-button @click="selectVisible">انتخاب صفحه</a-button>
|
||||
<a-button @click="selectAllFiltered">انتخاب همهٔ نتایج فیلتر</a-button>
|
||||
</a-space>
|
||||
</a-flex>
|
||||
|
||||
<a-spin :spinning="listLoading">
|
||||
<CrmSkeleton :loading="listLoading || loading">
|
||||
<CrmSkeletonTable :rows="6" :columns="2" :card="false">
|
||||
<a-table
|
||||
:columns="audienceColumns"
|
||||
:data-source="tableData"
|
||||
@@ -589,77 +589,81 @@ onMounted(() => {
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-spin>
|
||||
</CrmSkeletonTable>
|
||||
</CrmSkeleton>
|
||||
|
||||
<a-flex justify="center" :style="{ marginTop: '12px', marginBottom: '16px' }">
|
||||
<a-pagination
|
||||
v-model:current="page"
|
||||
:total="total"
|
||||
:page-size="pageSize"
|
||||
:show-size-changer="false"
|
||||
/>
|
||||
</a-flex>
|
||||
<a-flex justify="center" :style="{ marginTop: '12px', marginBottom: '16px' }">
|
||||
<a-pagination
|
||||
v-model:current="page"
|
||||
:total="total"
|
||||
:page-size="pageSize"
|
||||
:show-size-changer="false"
|
||||
/>
|
||||
</a-flex>
|
||||
|
||||
<a-button type="primary" html-type="submit" :loading="saving" :disabled="saving">
|
||||
ساخت کمپین
|
||||
</a-button>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-button type="primary" html-type="submit" :loading="saving" :disabled="saving">
|
||||
ساخت کمپین
|
||||
</a-button>
|
||||
</a-form>
|
||||
</a-card>
|
||||
|
||||
<a-card :bordered="false" title="کمپینها" :style="{ marginTop: '16px' }">
|
||||
<a-empty
|
||||
v-if="!loading && !campaigns.length"
|
||||
description="کمپینی نیست. اولین کمپین پیامک گروهی را بسازید."
|
||||
/>
|
||||
<a-list v-else :data-source="campaigns" item-layout="horizontal">
|
||||
<template #renderItem="{ item }">
|
||||
<a-list-item>
|
||||
<a-list-item-meta
|
||||
:title="(item as SmsCampaignDto).name"
|
||||
:description="(item as SmsCampaignDto).body"
|
||||
/>
|
||||
<template #actions>
|
||||
<a-tag
|
||||
:color="statusColor[(item as SmsCampaignDto).status] || 'default'"
|
||||
:bordered="false"
|
||||
>
|
||||
{{ statusLabel[(item as SmsCampaignDto).status] ?? (item as SmsCampaignDto).status }}
|
||||
</a-tag>
|
||||
<a-typography-text type="secondary">
|
||||
کل {{ toFaDigits((item as SmsCampaignDto).totalCount) }}
|
||||
· ارسال {{ toFaDigits((item as SmsCampaignDto).sentCount) }}
|
||||
· ناموفق {{ toFaDigits((item as SmsCampaignDto).failedCount) }}
|
||||
· ردشده {{ toFaDigits((item as SmsCampaignDto).skippedCount) }}
|
||||
· {{ formatJalaliNumeric(new Date((item as SmsCampaignDto).createdAt)) }}
|
||||
</a-typography-text>
|
||||
<a-button @click="goReport((item as SmsCampaignDto).id)">
|
||||
<template #icon><BarChartOutlined /></template>
|
||||
گزارش
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="(item as SmsCampaignDto).status === 'draft' || (item as SmsCampaignDto).status === 'cancelled'"
|
||||
@click="queue((item as SmsCampaignDto).id)"
|
||||
>
|
||||
<template #icon><SendOutlined /></template>
|
||||
صف ارسال
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="
|
||||
(item as SmsCampaignDto).status === 'queued' ||
|
||||
(item as SmsCampaignDto).status === 'sending' ||
|
||||
(item as SmsCampaignDto).status === 'draft'
|
||||
"
|
||||
danger
|
||||
@click="cancel((item as SmsCampaignDto).id)"
|
||||
>
|
||||
<template #icon><StopOutlined /></template>
|
||||
لغو
|
||||
</a-button>
|
||||
</template>
|
||||
</a-list-item>
|
||||
</template>
|
||||
</a-list>
|
||||
</a-card>
|
||||
</a-spin>
|
||||
<a-card :bordered="false" title="کمپینها" :style="{ marginTop: '16px' }">
|
||||
<CrmSkeleton :loading="loading">
|
||||
<CrmSkeletonList :rows="6">
|
||||
<a-empty
|
||||
v-if="!loading && !campaigns.length"
|
||||
description="کمپینی نیست. اولین کمپین پیامک گروهی را بسازید."
|
||||
/>
|
||||
<a-list v-else :data-source="campaigns" item-layout="horizontal">
|
||||
<template #renderItem="{ item }">
|
||||
<a-list-item>
|
||||
<a-list-item-meta
|
||||
:title="(item as SmsCampaignDto).name"
|
||||
:description="(item as SmsCampaignDto).body"
|
||||
/>
|
||||
<template #actions>
|
||||
<a-tag
|
||||
:color="statusColor[(item as SmsCampaignDto).status] || 'default'"
|
||||
:bordered="false"
|
||||
>
|
||||
{{ statusLabel[(item as SmsCampaignDto).status] ?? (item as SmsCampaignDto).status }}
|
||||
</a-tag>
|
||||
<a-typography-text type="secondary">
|
||||
کل {{ toFaDigits((item as SmsCampaignDto).totalCount) }}
|
||||
· ارسال {{ toFaDigits((item as SmsCampaignDto).sentCount) }}
|
||||
· ناموفق {{ toFaDigits((item as SmsCampaignDto).failedCount) }}
|
||||
· ردشده {{ toFaDigits((item as SmsCampaignDto).skippedCount) }}
|
||||
· {{ formatJalaliNumeric(new Date((item as SmsCampaignDto).createdAt)) }}
|
||||
</a-typography-text>
|
||||
<a-button @click="goReport((item as SmsCampaignDto).id)">
|
||||
<template #icon><BarChartOutlined /></template>
|
||||
گزارش
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="(item as SmsCampaignDto).status === 'draft' || (item as SmsCampaignDto).status === 'cancelled'"
|
||||
@click="queue((item as SmsCampaignDto).id)"
|
||||
>
|
||||
<template #icon><SendOutlined /></template>
|
||||
صف ارسال
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="
|
||||
(item as SmsCampaignDto).status === 'queued' ||
|
||||
(item as SmsCampaignDto).status === 'sending' ||
|
||||
(item as SmsCampaignDto).status === 'draft'
|
||||
"
|
||||
danger
|
||||
@click="cancel((item as SmsCampaignDto).id)"
|
||||
>
|
||||
<template #icon><StopOutlined /></template>
|
||||
لغو
|
||||
</a-button>
|
||||
</template>
|
||||
</a-list-item>
|
||||
</template>
|
||||
</a-list>
|
||||
</CrmSkeletonList>
|
||||
</CrmSkeleton>
|
||||
</a-card>
|
||||
</a-flex>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user