2026-08-29 21:06:30 +03:30
|
|
|
|
<script setup lang="ts">
|
2026-10-21 20:01:16 +03:30
|
|
|
|
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
2026-08-29 21:06:30 +03:30
|
|
|
|
import { RouterLink, useRoute, useRouter } from 'vue-router';
|
2026-11-25 16:53:04 +03:30
|
|
|
|
import { useQuery } from '@tanstack/vue-query';
|
2026-08-29 21:06:30 +03:30
|
|
|
|
import axios from 'axios';
|
2026-11-25 16:53:04 +03:30
|
|
|
|
import {
|
|
|
|
|
|
Alert as AAlert,
|
|
|
|
|
|
Button as AButton,
|
|
|
|
|
|
Card as ACard,
|
|
|
|
|
|
Checkbox as ACheckbox,
|
|
|
|
|
|
Dropdown as ADropdown,
|
|
|
|
|
|
Empty as AEmpty,
|
|
|
|
|
|
Flex as AFlex,
|
|
|
|
|
|
Grid,
|
|
|
|
|
|
List as AList,
|
|
|
|
|
|
ListItem as AListItem,
|
|
|
|
|
|
Menu as AMenu,
|
|
|
|
|
|
MenuItem as AMenuItem,
|
|
|
|
|
|
Modal as AModal,
|
|
|
|
|
|
Pagination as APagination,
|
|
|
|
|
|
Select as ASelect,
|
|
|
|
|
|
Space as ASpace,
|
|
|
|
|
|
Spin as ASpin,
|
|
|
|
|
|
Table as ATable,
|
|
|
|
|
|
Tag as ATag,
|
|
|
|
|
|
Typography,
|
|
|
|
|
|
theme,
|
|
|
|
|
|
} from 'ant-design-vue';
|
|
|
|
|
|
import type { TableColumnsType } from 'ant-design-vue';
|
|
|
|
|
|
import {
|
|
|
|
|
|
BankOutlined,
|
|
|
|
|
|
DeleteOutlined,
|
|
|
|
|
|
EditOutlined,
|
|
|
|
|
|
FileExcelOutlined,
|
|
|
|
|
|
IdcardOutlined,
|
|
|
|
|
|
MailOutlined,
|
|
|
|
|
|
MoreOutlined,
|
|
|
|
|
|
PhoneOutlined,
|
|
|
|
|
|
TeamOutlined,
|
|
|
|
|
|
} from '@/icons/ant-bridge';
|
2026-08-29 21:06:30 +03:30
|
|
|
|
import { api } from '@/lib/api';
|
2026-10-18 21:04:26 +03:30
|
|
|
|
import { useAuthStore } from '@/stores/auth';
|
2026-09-03 14:20:55 +03:30
|
|
|
|
import { formatJalaliNumeric, toFaDigits } from '@/lib/jalali';
|
|
|
|
|
|
import CustomerMoodFace from '@/components/CustomerMoodFace.vue';
|
2026-09-19 15:30:31 +03:30
|
|
|
|
import ExcelImportFlow from '@/components/ExcelImportFlow.vue';
|
2026-09-21 18:27:37 +03:30
|
|
|
|
import PhoneContactsImport from '@/components/PhoneContactsImport.vue';
|
2026-11-25 16:53:04 +03:30
|
|
|
|
import { FilterChips, PageHeader } from '@/components/page';
|
|
|
|
|
|
import type {
|
|
|
|
|
|
PageHeaderActiveFilter,
|
|
|
|
|
|
PageHeaderMenuItem,
|
|
|
|
|
|
PageHeaderTab,
|
|
|
|
|
|
} from '@/components/page';
|
|
|
|
|
|
import { CrmSkeleton, CrmSkeletonTable } from '@/components/skeleton';
|
2026-09-10 01:22:24 +03:30
|
|
|
|
import PersonFormView from '@/views/PersonFormView.vue';
|
|
|
|
|
|
import CompanyFormView from '@/views/CompanyFormView.vue';
|
2026-09-27 14:25:32 +03:30
|
|
|
|
import SavedFiltersBar from '@/components/SavedFiltersBar.vue';
|
2026-10-05 11:56:49 +03:30
|
|
|
|
import TableColumnsMenu from '@/components/TableColumnsMenu.vue';
|
2026-11-25 16:53:04 +03:30
|
|
|
|
import { registerTableColumns, useTableColumns } from '@/lib/tableColumns';
|
2026-08-29 21:06:30 +03:30
|
|
|
|
import type {
|
|
|
|
|
|
CompanyDto,
|
|
|
|
|
|
ImportContactsResult,
|
|
|
|
|
|
PersonDto,
|
2026-10-04 12:01:21 +03:30
|
|
|
|
PersonImportSource,
|
2026-09-03 14:20:55 +03:30
|
|
|
|
PersonMood,
|
2026-08-29 21:06:30 +03:30
|
|
|
|
} from '@mento/shared';
|
2026-10-04 12:01:21 +03:30
|
|
|
|
import {
|
|
|
|
|
|
brand,
|
|
|
|
|
|
PERSON_IMPORT_SOURCE_LABELS,
|
2026-11-25 16:53:04 +03:30
|
|
|
|
PERSON_IMPORT_SOURCES,
|
2026-10-04 12:01:21 +03:30
|
|
|
|
} from '@mento/shared';
|
2026-09-03 14:20:55 +03:30
|
|
|
|
import { PERSON_MOOD_LABELS, PERSON_MOODS } from '@/lib/person-mood';
|
2026-10-18 21:04:26 +03:30
|
|
|
|
import { canUseBehavior } from '@/lib/behavior-access';
|
|
|
|
|
|
import DiscBadge from '@/components/behavior/DiscBadge.vue';
|
2026-10-05 20:00:21 +03:30
|
|
|
|
import { PAGE_SIZE_OPTIONS, usePageSize } from '@/lib/pageSize';
|
2026-11-25 16:53:04 +03:30
|
|
|
|
import { useCustomerGroups } from '@/lib/customer-groups';
|
|
|
|
|
|
import { type ContactsFilterValue } from '@/components/ContactsFilterPanel.vue';
|
2026-10-21 17:16:31 +03:30
|
|
|
|
import { canManageSettings } from '@/lib/roles';
|
2026-11-25 16:53:04 +03:30
|
|
|
|
import { contactKeys } from '@/queries/keys';
|
|
|
|
|
|
import {
|
|
|
|
|
|
fetchCompanies,
|
|
|
|
|
|
fetchCompanyGroupStats,
|
|
|
|
|
|
fetchPeople,
|
|
|
|
|
|
fetchPeopleGroupStats,
|
|
|
|
|
|
fetchPeopleSourceStats,
|
|
|
|
|
|
invalidateContactQueries,
|
|
|
|
|
|
} from '@/queries/contacts';
|
|
|
|
|
|
|
|
|
|
|
|
const { Link: ATypographyLink, Text: ATypographyText } = Typography;
|
|
|
|
|
|
const { token } = theme.useToken();
|
|
|
|
|
|
const screens = Grid.useBreakpoint();
|
2026-08-29 21:06:30 +03:30
|
|
|
|
|
|
|
|
|
|
type Tab = 'people' | 'companies';
|
2026-09-03 14:20:55 +03:30
|
|
|
|
type SortKey = 'name' | 'newest';
|
|
|
|
|
|
|
2026-10-05 20:00:21 +03:30
|
|
|
|
const pageSize = usePageSize('contacts', 10);
|
2026-08-29 21:06:30 +03:30
|
|
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
|
|
const tab = computed<Tab>(() =>
|
|
|
|
|
|
route.query.tab === 'companies' ? 'companies' : 'people',
|
|
|
|
|
|
);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
const page = computed(() => {
|
|
|
|
|
|
const raw = Number(route.query.page);
|
|
|
|
|
|
return Number.isFinite(raw) && raw > 0 ? raw : 1;
|
|
|
|
|
|
});
|
|
|
|
|
|
const sort = computed<SortKey>(() => (route.query.sort === 'newest' ? 'newest' : 'name'));
|
2026-10-21 18:07:21 +03:30
|
|
|
|
function queryList(key: string): string[] {
|
|
|
|
|
|
const raw = route.query[key];
|
|
|
|
|
|
if (typeof raw !== 'string') return [];
|
|
|
|
|
|
return [...new Set(raw.split(',').map((v) => v.trim()).filter(Boolean))];
|
|
|
|
|
|
}
|
|
|
|
|
|
function csv(list: string[]): string | undefined {
|
|
|
|
|
|
return list.length ? list.join(',') : undefined;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const moodFilters = computed(() =>
|
|
|
|
|
|
queryList('mood').filter((m): m is PersonMood => PERSON_MOODS.includes(m as PersonMood)),
|
|
|
|
|
|
);
|
2026-10-18 21:04:26 +03:30
|
|
|
|
const auth = useAuthStore();
|
|
|
|
|
|
const canBehavior = computed(() => canUseBehavior(auth.user));
|
|
|
|
|
|
const discFilter = computed(() => {
|
|
|
|
|
|
const value = typeof route.query.disc === 'string' ? route.query.disc.toUpperCase() : '';
|
|
|
|
|
|
return /^[DISC](\/[DISC]){0,3}$/.test(value) ? value : '';
|
|
|
|
|
|
});
|
2026-10-21 18:07:21 +03:30
|
|
|
|
const sourceFilters = computed(() => queryList('source'));
|
2026-11-19 21:04:43 +03:30
|
|
|
|
const activityExperienceFilters = computed(() => queryList('activityExperience'));
|
2026-10-21 18:07:21 +03:30
|
|
|
|
const groupFilters = computed(() => queryList('group'));
|
2026-11-25 16:53:04 +03:30
|
|
|
|
const { groups: customerGroups } = useCustomerGroups();
|
2026-10-21 17:16:31 +03:30
|
|
|
|
const canManageGroups = computed(() => canManageSettings(auth.user?.role));
|
|
|
|
|
|
const groupsManagerOpen = ref(false);
|
2026-10-21 18:07:21 +03:30
|
|
|
|
|
|
|
|
|
|
const filterValue = computed<ContactsFilterValue>(() => ({
|
|
|
|
|
|
groups: groupFilters.value,
|
|
|
|
|
|
sources: sourceFilters.value,
|
|
|
|
|
|
moods: moodFilters.value,
|
|
|
|
|
|
disc: discFilter.value,
|
2026-11-19 21:04:43 +03:30
|
|
|
|
activityExperiences: activityExperienceFilters.value,
|
2026-10-21 18:07:21 +03:30
|
|
|
|
}));
|
|
|
|
|
|
|
2026-11-19 21:04:43 +03:30
|
|
|
|
type FilterTag = {
|
|
|
|
|
|
kind: 'group' | 'source' | 'mood' | 'disc' | 'activityExperience';
|
|
|
|
|
|
value: string;
|
|
|
|
|
|
label: string;
|
|
|
|
|
|
color?: string;
|
|
|
|
|
|
};
|
2026-10-21 18:07:21 +03:30
|
|
|
|
const activeTags = computed<FilterTag[]>(() => {
|
|
|
|
|
|
const tags: FilterTag[] = groupFilters.value.map((id) => {
|
2026-10-24 22:25:27 +03:30
|
|
|
|
const g =
|
|
|
|
|
|
filterGroups.value.find((x) => x.id === id) ??
|
|
|
|
|
|
customerGroups.value.find((x) => x.id === id);
|
2026-10-21 18:07:21 +03:30
|
|
|
|
return { kind: 'group', value: id, label: g?.name ?? 'گروه حذفشده', color: g?.color };
|
|
|
|
|
|
});
|
|
|
|
|
|
if (tab.value !== 'people') return tags;
|
|
|
|
|
|
for (const s of sourceFilters.value) {
|
|
|
|
|
|
tags.push({ kind: 'source', value: s, label: `منبع: ${sourceLabel(s)}` });
|
|
|
|
|
|
}
|
|
|
|
|
|
for (const m of moodFilters.value) {
|
|
|
|
|
|
tags.push({ kind: 'mood', value: m, label: moodLabel(m) });
|
|
|
|
|
|
}
|
2026-11-19 21:04:43 +03:30
|
|
|
|
for (const exp of activityExperienceFilters.value) {
|
|
|
|
|
|
tags.push({ kind: 'activityExperience', value: exp, label: `سابقه: ${exp}` });
|
|
|
|
|
|
}
|
2026-10-21 18:07:21 +03:30
|
|
|
|
if (discFilter.value) tags.push({ kind: 'disc', value: discFilter.value, label: `DISC: ${discFilter.value}` });
|
|
|
|
|
|
return tags;
|
2026-10-04 12:01:21 +03:30
|
|
|
|
});
|
2026-08-29 21:06:30 +03:30
|
|
|
|
const q = ref(typeof route.query.q === 'string' ? route.query.q : '');
|
|
|
|
|
|
const busy = ref(false);
|
2026-10-03 12:29:11 +03:30
|
|
|
|
const pageBusy = ref(false);
|
|
|
|
|
|
const busyMessage = ref('لطفاً صبر کنید…');
|
2026-08-29 21:06:30 +03:30
|
|
|
|
const error = ref('');
|
|
|
|
|
|
const importMsg = ref('');
|
2026-09-03 14:20:55 +03:30
|
|
|
|
const menuId = ref<string | null>(null);
|
|
|
|
|
|
const sortOpen = ref(false);
|
|
|
|
|
|
const filterOpen = ref(false);
|
2026-10-21 20:01:16 +03:30
|
|
|
|
const moreOpen = ref(false);
|
|
|
|
|
|
const savedSheetOpen = ref(false);
|
2026-09-10 01:22:24 +03:30
|
|
|
|
const contactModal = ref<'person' | 'company' | null>(null);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
/** همراستا با بریکپوینت CSS صفحه (۹۰۰px) */
|
|
|
|
|
|
const mobileMq =
|
|
|
|
|
|
typeof window !== 'undefined' ? window.matchMedia('(max-width: 900px)') : null;
|
|
|
|
|
|
const isMobile = ref(mobileMq?.matches ?? false);
|
|
|
|
|
|
function onMobileChange(e: MediaQueryListEvent) {
|
|
|
|
|
|
isMobile.value = e.matches;
|
|
|
|
|
|
filterOpen.value = false;
|
|
|
|
|
|
sortOpen.value = false;
|
|
|
|
|
|
savedSheetOpen.value = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
onMounted(() => mobileMq?.addEventListener('change', onMobileChange));
|
|
|
|
|
|
onBeforeUnmount(() => mobileMq?.removeEventListener('change', onMobileChange));
|
|
|
|
|
|
|
|
|
|
|
|
const SORT_OPTIONS = [
|
|
|
|
|
|
{ value: 'name', label: 'نام' },
|
|
|
|
|
|
{ value: 'newest', label: 'جدیدترین' },
|
|
|
|
|
|
];
|
|
|
|
|
|
|
2026-11-25 16:53:04 +03:30
|
|
|
|
const peopleParams = computed(() => ({
|
|
|
|
|
|
q: q.value || undefined,
|
|
|
|
|
|
page: page.value,
|
|
|
|
|
|
limit: pageSize.value,
|
|
|
|
|
|
sort: sort.value,
|
|
|
|
|
|
mood: csv(moodFilters.value),
|
|
|
|
|
|
importSource: csv(sourceFilters.value),
|
|
|
|
|
|
activityExperience: csv(activityExperienceFilters.value),
|
|
|
|
|
|
disc: discFilter.value || undefined,
|
|
|
|
|
|
groupId: csv(groupFilters.value),
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
const companyParams = computed(() => ({
|
|
|
|
|
|
q: q.value || undefined,
|
|
|
|
|
|
page: page.value,
|
|
|
|
|
|
limit: pageSize.value,
|
|
|
|
|
|
groupId: csv(groupFilters.value),
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
const peopleQuery = useQuery({
|
|
|
|
|
|
queryKey: computed(() => contactKeys.people({ ...peopleParams.value })),
|
|
|
|
|
|
queryFn: () => fetchPeople({ ...peopleParams.value }),
|
|
|
|
|
|
enabled: computed(() => tab.value === 'people'),
|
|
|
|
|
|
placeholderData: (prev) => prev,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const companiesQuery = useQuery({
|
|
|
|
|
|
queryKey: computed(() => contactKeys.companies({ ...companyParams.value })),
|
|
|
|
|
|
queryFn: () => fetchCompanies({ ...companyParams.value }),
|
|
|
|
|
|
enabled: computed(() => tab.value === 'companies'),
|
|
|
|
|
|
placeholderData: (prev) => prev,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const peopleSourceStatsQuery = useQuery({
|
|
|
|
|
|
queryKey: computed(() => contactKeys.peopleSourceStats({ ...peopleParams.value })),
|
|
|
|
|
|
queryFn: () => fetchPeopleSourceStats({ ...peopleParams.value }),
|
|
|
|
|
|
enabled: computed(() => tab.value === 'people'),
|
|
|
|
|
|
staleTime: 60_000,
|
|
|
|
|
|
placeholderData: (prev) => prev,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const peopleGroupStatsQuery = useQuery({
|
|
|
|
|
|
queryKey: computed(() => contactKeys.peopleGroupStats({ ...peopleParams.value })),
|
|
|
|
|
|
queryFn: () => fetchPeopleGroupStats({ ...peopleParams.value }),
|
|
|
|
|
|
enabled: computed(() => tab.value === 'people'),
|
|
|
|
|
|
staleTime: 60_000,
|
|
|
|
|
|
placeholderData: (prev) => prev,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const companyGroupStatsQuery = useQuery({
|
|
|
|
|
|
queryKey: computed(() => contactKeys.companyGroupStats({ ...companyParams.value })),
|
|
|
|
|
|
queryFn: () => fetchCompanyGroupStats({ ...companyParams.value }),
|
|
|
|
|
|
enabled: computed(() => tab.value === 'companies'),
|
|
|
|
|
|
staleTime: 60_000,
|
|
|
|
|
|
placeholderData: (prev) => prev,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const people = computed(() => peopleQuery.data.value ?? null);
|
|
|
|
|
|
const companies = computed(() => companiesQuery.data.value ?? null);
|
|
|
|
|
|
const sourceStats = computed(() => peopleSourceStatsQuery.data.value ?? []);
|
|
|
|
|
|
const filterGroups = computed(() =>
|
|
|
|
|
|
tab.value === 'people'
|
|
|
|
|
|
? (peopleGroupStatsQuery.data.value ?? [])
|
|
|
|
|
|
: (companyGroupStatsQuery.data.value ?? []),
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const loading = computed(() => {
|
|
|
|
|
|
if (tab.value === 'people') {
|
|
|
|
|
|
return peopleQuery.isFetching.value && peopleQuery.data.value == null;
|
|
|
|
|
|
}
|
|
|
|
|
|
return companiesQuery.isFetching.value && companiesQuery.data.value == null;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => (tab.value === 'people' ? peopleQuery.error.value : companiesQuery.error.value),
|
|
|
|
|
|
(err) => {
|
|
|
|
|
|
if (!err) return;
|
|
|
|
|
|
if (axios.isAxiosError(err) && !err.response) {
|
|
|
|
|
|
error.value = 'اتصال به API برقرار نشد.';
|
|
|
|
|
|
} else {
|
|
|
|
|
|
error.value = 'بارگذاری مخاطبین ناموفق بود.';
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
);
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
const total = computed(() =>
|
|
|
|
|
|
tab.value === 'people' ? people.value?.total ?? 0 : companies.value?.total ?? 0,
|
|
|
|
|
|
);
|
2026-10-05 20:00:21 +03:30
|
|
|
|
const pageCount = computed(() => Math.max(1, Math.ceil(total.value / pageSize.value)));
|
|
|
|
|
|
const rowOffset = computed(() => (page.value - 1) * pageSize.value);
|
|
|
|
|
|
|
|
|
|
|
|
const selectedIds = ref<string[]>([]);
|
|
|
|
|
|
const pageIds = computed(() => people.value?.items.map((p) => p.id) ?? []);
|
2026-11-25 16:53:04 +03:30
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => people.value?.items.map((p) => p.id) ?? [],
|
|
|
|
|
|
(ids) => {
|
|
|
|
|
|
const visible = new Set(ids);
|
|
|
|
|
|
selectedIds.value = selectedIds.value.filter((id) => visible.has(id));
|
|
|
|
|
|
},
|
|
|
|
|
|
);
|
2026-10-05 20:00:21 +03:30
|
|
|
|
const allSelected = computed(
|
|
|
|
|
|
() => pageIds.value.length > 0 && pageIds.value.every((id) => selectedIds.value.includes(id)),
|
|
|
|
|
|
);
|
|
|
|
|
|
const someSelected = computed(() => selectedIds.value.length > 0 && !allSelected.value);
|
|
|
|
|
|
|
|
|
|
|
|
function toggleAll() {
|
|
|
|
|
|
selectedIds.value = allSelected.value ? [] : [...pageIds.value];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function toggleOne(id: string) {
|
|
|
|
|
|
selectedIds.value = selectedIds.value.includes(id)
|
|
|
|
|
|
? selectedIds.value.filter((x) => x !== id)
|
|
|
|
|
|
: [...selectedIds.value, id];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function deleteSelected() {
|
|
|
|
|
|
const ids = [...selectedIds.value];
|
|
|
|
|
|
if (!ids.length) return;
|
|
|
|
|
|
if (!confirm(`${toFaDigits(ids.length)} شخص انتخابشده حذف شوند؟ این کار قابل بازگشت نیست.`)) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
busy.value = true;
|
|
|
|
|
|
pageBusy.value = true;
|
|
|
|
|
|
busyMessage.value = 'در حال حذف اشخاص…';
|
|
|
|
|
|
try {
|
|
|
|
|
|
const { data } = await api.post<{ deleted: number }>('/people/bulk-delete', { ids });
|
|
|
|
|
|
importMsg.value = `${toFaDigits(data.deleted)} شخص حذف شد.`;
|
|
|
|
|
|
selectedIds.value = [];
|
|
|
|
|
|
if (data.deleted >= pageIds.value.length && page.value > 1) setPage(page.value - 1);
|
|
|
|
|
|
else await load();
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
error.value = 'حذف اشخاص ناموفق بود.';
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
busy.value = false;
|
|
|
|
|
|
pageBusy.value = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onPageSize(size: number) {
|
|
|
|
|
|
pageSize.value = size;
|
2026-11-25 16:53:04 +03:30
|
|
|
|
/* peopleParams/companyParams include limit → query key refetch */
|
2026-10-05 20:00:21 +03:30
|
|
|
|
}
|
2026-09-03 14:20:55 +03:30
|
|
|
|
|
2026-10-21 18:46:12 +03:30
|
|
|
|
const peopleSavedFilters = computed(() => {
|
|
|
|
|
|
const out: Record<string, string> = {};
|
|
|
|
|
|
const nextQ = q.value.trim();
|
|
|
|
|
|
if (nextQ) out.q = nextQ;
|
|
|
|
|
|
if (sort.value !== 'name') out.sort = sort.value;
|
|
|
|
|
|
const mood = csv(moodFilters.value);
|
|
|
|
|
|
if (mood) out.mood = mood;
|
|
|
|
|
|
const source = csv(sourceFilters.value);
|
|
|
|
|
|
if (source) out.source = source;
|
2026-11-19 21:04:43 +03:30
|
|
|
|
const activityExperience = csv(activityExperienceFilters.value);
|
|
|
|
|
|
if (activityExperience) out.activityExperience = activityExperience;
|
2026-10-21 18:46:12 +03:30
|
|
|
|
if (discFilter.value) out.disc = discFilter.value;
|
|
|
|
|
|
const group = csv(groupFilters.value);
|
|
|
|
|
|
if (group) out.group = group;
|
|
|
|
|
|
return out;
|
|
|
|
|
|
});
|
2026-09-27 14:25:32 +03:30
|
|
|
|
|
2026-10-21 18:46:12 +03:30
|
|
|
|
/** مقدار ذخیرهشده: رشته یا آرایه → رشتهٔ کاماجدا برای URL */
|
|
|
|
|
|
function savedCsv(raw: unknown): string | undefined {
|
|
|
|
|
|
if (Array.isArray(raw)) {
|
|
|
|
|
|
const list = raw.map((v) => String(v).trim()).filter(Boolean);
|
|
|
|
|
|
return list.length ? list.join(',') : undefined;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (typeof raw === 'string' && raw.trim()) return raw.trim();
|
|
|
|
|
|
return undefined;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
}
|
2026-09-27 14:25:32 +03:30
|
|
|
|
|
|
|
|
|
|
function applyPeopleSavedFilters(filters: Record<string, unknown>) {
|
|
|
|
|
|
const nextQ = typeof filters.q === 'string' ? filters.q : '';
|
|
|
|
|
|
q.value = nextQ;
|
2026-10-21 18:46:12 +03:30
|
|
|
|
// کلیدهای فیلتر را از نو میسازیم تا فیلتر قبلی روی صفحه نماند
|
|
|
|
|
|
const query: Record<string, string | string[]> = {};
|
|
|
|
|
|
for (const [key, value] of Object.entries(route.query)) {
|
2026-11-19 21:04:43 +03:30
|
|
|
|
if (['q', 'sort', 'mood', 'source', 'activityExperience', 'disc', 'group', 'page', 'tab'].includes(key)) continue;
|
2026-10-21 18:46:12 +03:30
|
|
|
|
if (value == null || value === '') continue;
|
|
|
|
|
|
if (Array.isArray(value)) {
|
|
|
|
|
|
const list = value.filter((v): v is string => typeof v === 'string' && v !== '');
|
|
|
|
|
|
if (list.length) query[key] = list;
|
|
|
|
|
|
} else if (typeof value === 'string') {
|
|
|
|
|
|
query[key] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (nextQ.trim()) query.q = nextQ.trim();
|
|
|
|
|
|
if (filters.sort === 'newest') query.sort = 'newest';
|
|
|
|
|
|
const mood = savedCsv(filters.mood);
|
|
|
|
|
|
if (mood) query.mood = mood;
|
|
|
|
|
|
const source = savedCsv(filters.source);
|
|
|
|
|
|
if (source) query.source = source;
|
2026-11-19 21:04:43 +03:30
|
|
|
|
const activityExperience = savedCsv(filters.activityExperience);
|
|
|
|
|
|
if (activityExperience) query.activityExperience = activityExperience;
|
2026-10-21 18:46:12 +03:30
|
|
|
|
const disc = savedCsv(filters.disc);
|
|
|
|
|
|
if (disc) query.disc = disc;
|
|
|
|
|
|
const group = savedCsv(filters.group);
|
|
|
|
|
|
if (group) query.group = group;
|
|
|
|
|
|
void router.replace({ name: 'contacts', query }).then(() => {
|
|
|
|
|
|
void load();
|
2026-09-27 14:25:32 +03:30
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-04 12:01:21 +03:30
|
|
|
|
function sourceLabel(source: string) {
|
|
|
|
|
|
if (source in PERSON_IMPORT_SOURCE_LABELS) {
|
|
|
|
|
|
return PERSON_IMPORT_SOURCE_LABELS[source as PersonImportSource];
|
|
|
|
|
|
}
|
|
|
|
|
|
return source || 'دستی';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
function moodOf(person: PersonDto): PersonMood {
|
|
|
|
|
|
return person.mood || 'newcomer';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function moodLabel(mood: PersonMood) {
|
|
|
|
|
|
return PERSON_MOOD_LABELS[mood];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-03 12:00:46 +03:30
|
|
|
|
/** کد شخص در نرمافزار مبدأ (دیدار و مشابه) */
|
|
|
|
|
|
function externalCode(person: PersonDto): string {
|
2026-10-04 12:01:21 +03:30
|
|
|
|
if (person.sourceRef?.trim()) return person.sourceRef.trim();
|
2026-10-03 12:00:46 +03:30
|
|
|
|
const fields = person.customFields ?? {};
|
|
|
|
|
|
for (const key of ['didarId', 'customerCode'] as const) {
|
|
|
|
|
|
const raw = fields[key];
|
|
|
|
|
|
if (typeof raw === 'string' && raw.trim()) return raw.trim();
|
|
|
|
|
|
if (typeof raw === 'number' && Number.isFinite(raw)) return String(raw);
|
|
|
|
|
|
}
|
|
|
|
|
|
return '';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function externalCodeLabel(person: PersonDto): string {
|
|
|
|
|
|
const code = externalCode(person);
|
|
|
|
|
|
return code ? toFaDigits(code) : '—';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
function formatDate(value: string) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
return formatJalaliNumeric(new Date(value));
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
return value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function closePopups() {
|
|
|
|
|
|
menuId.value = null;
|
|
|
|
|
|
sortOpen.value = false;
|
|
|
|
|
|
filterOpen.value = false;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
moreOpen.value = false;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
2026-08-29 21:06:30 +03:30
|
|
|
|
|
|
|
|
|
|
async function load() {
|
|
|
|
|
|
error.value = '';
|
2026-09-03 14:20:55 +03:30
|
|
|
|
closePopups();
|
2026-11-25 16:53:04 +03:30
|
|
|
|
await invalidateContactQueries();
|
|
|
|
|
|
if (tab.value === 'people') {
|
|
|
|
|
|
await Promise.all([
|
|
|
|
|
|
peopleQuery.refetch(),
|
|
|
|
|
|
peopleSourceStatsQuery.refetch(),
|
|
|
|
|
|
peopleGroupStatsQuery.refetch(),
|
|
|
|
|
|
]);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
await Promise.all([companiesQuery.refetch(), companyGroupStatsQuery.refetch()]);
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
function patchQuery(next: Record<string, string | undefined>) {
|
|
|
|
|
|
const query = { ...route.query, ...next };
|
|
|
|
|
|
for (const key of Object.keys(query)) {
|
|
|
|
|
|
if (query[key] == null || query[key] === '') delete query[key];
|
|
|
|
|
|
}
|
|
|
|
|
|
void router.replace({ name: 'contacts', query });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-08-29 21:06:30 +03:30
|
|
|
|
function setTab(next: Tab) {
|
2026-09-03 14:20:55 +03:30
|
|
|
|
patchQuery({
|
|
|
|
|
|
tab: next === 'people' ? undefined : next,
|
|
|
|
|
|
page: undefined,
|
2026-08-29 21:06:30 +03:30
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onSearch() {
|
2026-09-03 14:20:55 +03:30
|
|
|
|
patchQuery({ q: q.value.trim() || undefined, page: undefined });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function setSort(next: SortKey) {
|
|
|
|
|
|
sortOpen.value = false;
|
|
|
|
|
|
patchQuery({ sort: next === 'name' ? undefined : next, page: undefined });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
function applyFilters(next: ContactsFilterValue, nextSort?: string) {
|
2026-09-03 14:20:55 +03:30
|
|
|
|
filterOpen.value = false;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
const people = tab.value === 'people';
|
2026-10-04 12:01:21 +03:30
|
|
|
|
patchQuery({
|
2026-10-21 18:07:21 +03:30
|
|
|
|
group: csv(next.groups),
|
|
|
|
|
|
...(people
|
2026-11-19 21:04:43 +03:30
|
|
|
|
? {
|
|
|
|
|
|
source: csv(next.sources),
|
|
|
|
|
|
mood: csv(next.moods),
|
|
|
|
|
|
activityExperience: csv(next.activityExperiences),
|
|
|
|
|
|
disc: next.disc || undefined,
|
|
|
|
|
|
}
|
2026-10-21 18:07:21 +03:30
|
|
|
|
: {}),
|
2026-10-21 20:01:16 +03:30
|
|
|
|
// در موبایل مرتبسازی داخل همان شیت فیلتر است؛ یک patch تا query قبلی overwrite نشود
|
|
|
|
|
|
...(nextSort !== undefined
|
|
|
|
|
|
? { sort: nextSort === 'newest' ? 'newest' : undefined }
|
|
|
|
|
|
: {}),
|
2026-10-04 12:01:21 +03:30
|
|
|
|
page: undefined,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
/** شمارنده روی دکمه فیلتر موبایل (فیلترها + مرتبسازی غیرپیشفرض) */
|
|
|
|
|
|
const mobileFilterCount = computed(
|
|
|
|
|
|
() => activeTags.value.length + (sort.value !== 'name' ? 1 : 0),
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
function openSavedSheet() {
|
|
|
|
|
|
moreOpen.value = false;
|
|
|
|
|
|
savedSheetOpen.value = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function applySavedFromSheet(filters: Record<string, unknown>) {
|
|
|
|
|
|
savedSheetOpen.value = false;
|
|
|
|
|
|
applyPeopleSavedFilters(filters);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 18:07:21 +03:30
|
|
|
|
function removeTag(tag: FilterTag) {
|
|
|
|
|
|
const without = (list: string[]) => csv(list.filter((v) => v !== tag.value));
|
|
|
|
|
|
if (tag.kind === 'group') patchQuery({ group: without(groupFilters.value), page: undefined });
|
|
|
|
|
|
else if (tag.kind === 'source') patchQuery({ source: without(sourceFilters.value), page: undefined });
|
|
|
|
|
|
else if (tag.kind === 'mood') patchQuery({ mood: without(moodFilters.value), page: undefined });
|
2026-11-19 21:04:43 +03:30
|
|
|
|
else if (tag.kind === 'activityExperience') {
|
|
|
|
|
|
patchQuery({
|
|
|
|
|
|
activityExperience: without(activityExperienceFilters.value),
|
|
|
|
|
|
page: undefined,
|
|
|
|
|
|
});
|
|
|
|
|
|
} else patchQuery({ disc: undefined, page: undefined });
|
2026-10-18 21:04:26 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 18:07:21 +03:30
|
|
|
|
function clearFilters() {
|
|
|
|
|
|
patchQuery({
|
|
|
|
|
|
group: undefined,
|
2026-11-19 21:04:43 +03:30
|
|
|
|
...(tab.value === 'people'
|
|
|
|
|
|
? {
|
|
|
|
|
|
source: undefined,
|
|
|
|
|
|
mood: undefined,
|
|
|
|
|
|
activityExperience: undefined,
|
|
|
|
|
|
disc: undefined,
|
|
|
|
|
|
}
|
|
|
|
|
|
: {}),
|
2026-10-21 18:07:21 +03:30
|
|
|
|
page: undefined,
|
|
|
|
|
|
});
|
2026-10-21 17:16:31 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function onGroupsChanged() {
|
|
|
|
|
|
await load();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
function setPage(next: number) {
|
|
|
|
|
|
if (next < 1 || next > pageCount.value) return;
|
|
|
|
|
|
patchQuery({ page: next === 1 ? undefined : String(next) });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function setMoodFor(person: PersonDto, mood: PersonMood) {
|
|
|
|
|
|
menuId.value = null;
|
|
|
|
|
|
try {
|
|
|
|
|
|
await api.patch(`/people/${person.id}`, { mood });
|
|
|
|
|
|
await load();
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
error.value = 'تغییر وضعیت مشتری ناموفق بود.';
|
|
|
|
|
|
}
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function exportExcel() {
|
|
|
|
|
|
busy.value = true;
|
2026-10-03 12:29:11 +03:30
|
|
|
|
pageBusy.value = true;
|
|
|
|
|
|
busyMessage.value = 'در حال تهیه خروجی اکسل…';
|
2026-08-29 21:06:30 +03:30
|
|
|
|
importMsg.value = '';
|
|
|
|
|
|
error.value = '';
|
|
|
|
|
|
try {
|
|
|
|
|
|
const path = tab.value === 'people' ? '/people/export' : '/companies/export';
|
|
|
|
|
|
const { data } = await api.get<Blob>(path, {
|
|
|
|
|
|
params: { q: q.value || undefined },
|
|
|
|
|
|
responseType: 'blob',
|
|
|
|
|
|
});
|
|
|
|
|
|
const url = URL.createObjectURL(data);
|
|
|
|
|
|
const a = document.createElement('a');
|
|
|
|
|
|
a.href = url;
|
|
|
|
|
|
a.download =
|
2026-09-07 11:49:54 +03:30
|
|
|
|
tab.value === 'people' ? `${brand.filePrefix}-people.xlsx` : `${brand.filePrefix}-companies.xlsx`;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
a.click();
|
|
|
|
|
|
URL.revokeObjectURL(url);
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
error.value = 'خروجی اکسل ناموفق بود.';
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
busy.value = false;
|
2026-10-03 12:29:11 +03:30
|
|
|
|
pageBusy.value = false;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-19 15:30:31 +03:30
|
|
|
|
const importPreviewPath = computed(() =>
|
|
|
|
|
|
tab.value === 'people' ? '/people/import/preview' : '/companies/import/preview',
|
|
|
|
|
|
);
|
|
|
|
|
|
const importPath = computed(() =>
|
|
|
|
|
|
tab.value === 'people' ? '/people/import' : '/companies/import',
|
|
|
|
|
|
);
|
2026-08-29 21:06:30 +03:30
|
|
|
|
|
2026-09-19 15:30:31 +03:30
|
|
|
|
function onImportStart() {
|
2026-08-29 21:06:30 +03:30
|
|
|
|
busy.value = true;
|
2026-10-03 12:29:11 +03:30
|
|
|
|
pageBusy.value = false;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
importMsg.value = '';
|
|
|
|
|
|
error.value = '';
|
2026-09-19 15:30:31 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function onImportDone(data: ImportContactsResult) {
|
|
|
|
|
|
importMsg.value = `وارد شد: ${data.created} · تکراری رد شد: ${data.skipped}${
|
|
|
|
|
|
data.errors.length ? ` · خطا: ${data.errors.length}` : ''
|
|
|
|
|
|
}`;
|
|
|
|
|
|
if (data.errors.length) {
|
|
|
|
|
|
error.value = data.errors
|
|
|
|
|
|
.slice(0, 3)
|
|
|
|
|
|
.map((e) => `ردیف ${e.row}: ${e.message}`)
|
|
|
|
|
|
.join(' | ');
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
2026-09-19 15:30:31 +03:30
|
|
|
|
await load();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-21 18:27:37 +03:30
|
|
|
|
function onPhoneImportStart() {
|
|
|
|
|
|
busy.value = true;
|
2026-10-03 12:29:11 +03:30
|
|
|
|
pageBusy.value = true;
|
|
|
|
|
|
busyMessage.value = 'در حال ورود مخاطبین گوشی…';
|
2026-09-21 18:27:37 +03:30
|
|
|
|
importMsg.value = '';
|
|
|
|
|
|
error.value = '';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function onPhoneImportDone(data: {
|
|
|
|
|
|
created: number;
|
|
|
|
|
|
skipped: number;
|
|
|
|
|
|
failed: number;
|
|
|
|
|
|
}) {
|
|
|
|
|
|
importMsg.value = `از گوشی وارد شد: ${toFaDigits(data.created)} · تکراری: ${toFaDigits(data.skipped)}${
|
|
|
|
|
|
data.failed ? ` · ناموفق: ${toFaDigits(data.failed)}` : ''
|
|
|
|
|
|
}`;
|
|
|
|
|
|
await load();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onPhoneImportFail(message: string) {
|
|
|
|
|
|
error.value = message;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onPhoneImportSettled() {
|
|
|
|
|
|
busy.value = false;
|
2026-10-03 12:29:11 +03:30
|
|
|
|
pageBusy.value = false;
|
2026-09-21 18:27:37 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-19 15:30:31 +03:30
|
|
|
|
function onImportFail(message: string) {
|
|
|
|
|
|
error.value = message;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onImportSettled() {
|
|
|
|
|
|
busy.value = false;
|
2026-10-03 12:29:11 +03:30
|
|
|
|
pageBusy.value = false;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
watch(
|
2026-11-25 16:53:04 +03:30
|
|
|
|
() => route.query.q,
|
2026-08-29 21:06:30 +03:30
|
|
|
|
() => {
|
|
|
|
|
|
q.value = typeof route.query.q === 'string' ? route.query.q : '';
|
|
|
|
|
|
},
|
|
|
|
|
|
);
|
|
|
|
|
|
|
2026-11-25 16:53:04 +03:30
|
|
|
|
const isCompact = computed(() => !screens.value.lg);
|
|
|
|
|
|
const excelImportTrigger = ref<HTMLElement | null>(null);
|
|
|
|
|
|
const phoneImportTrigger = ref<HTMLElement | null>(null);
|
|
|
|
|
|
|
|
|
|
|
|
const contactModalOpen = computed({
|
|
|
|
|
|
get: () => contactModal.value !== null,
|
|
|
|
|
|
set: (open: boolean) => {
|
|
|
|
|
|
if (!open) contactModal.value = null;
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/** سلکت سریع هدر — تکمقدار روی query چندمقداری */
|
|
|
|
|
|
const moodFilter = computed<PersonMood | 'all'>(() => moodFilters.value[0] ?? 'all');
|
|
|
|
|
|
const sourceFilter = computed<PersonImportSource | 'all'>(() => {
|
|
|
|
|
|
const value = sourceFilters.value[0];
|
|
|
|
|
|
return value && PERSON_IMPORT_SOURCES.includes(value as PersonImportSource)
|
|
|
|
|
|
? (value as PersonImportSource)
|
|
|
|
|
|
: 'all';
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const headerTabs: PageHeaderTab[] = [
|
|
|
|
|
|
{ key: 'people', label: 'اشخاص' },
|
|
|
|
|
|
{ key: 'companies', label: 'شرکتها' },
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const headerMenuItems = computed<PageHeaderMenuItem[]>(() => {
|
|
|
|
|
|
const items: PageHeaderMenuItem[] = [
|
|
|
|
|
|
{ key: 'export', label: 'خروجی اکسل', icon: FileExcelOutlined },
|
|
|
|
|
|
{ key: 'import', label: 'ورود از اکسل', icon: FileExcelOutlined },
|
|
|
|
|
|
];
|
|
|
|
|
|
if (tab.value === 'people') {
|
|
|
|
|
|
items.push({ key: 'phone', label: 'از مخاطبین گوشی', icon: PhoneOutlined });
|
|
|
|
|
|
}
|
|
|
|
|
|
if (canManageGroups.value) {
|
|
|
|
|
|
items.push({
|
|
|
|
|
|
key: 'groups',
|
|
|
|
|
|
label: 'مدیریت گروهها',
|
|
|
|
|
|
dividerBefore: true,
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
return items;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const KIND_LABEL: Record<FilterTag['kind'], string> = {
|
|
|
|
|
|
group: 'گروه',
|
|
|
|
|
|
source: 'منبع',
|
|
|
|
|
|
mood: 'وضعیت',
|
|
|
|
|
|
disc: 'DISC',
|
|
|
|
|
|
activityExperience: 'سابقه',
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const activeFilterChips = computed<PageHeaderActiveFilter[]>(() =>
|
|
|
|
|
|
activeTags.value.map((tag) => ({
|
|
|
|
|
|
key: `${tag.kind}:${tag.value}`,
|
|
|
|
|
|
label: KIND_LABEL[tag.kind],
|
|
|
|
|
|
value: tag.label,
|
|
|
|
|
|
})),
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
function onHeaderMenu(key: string) {
|
|
|
|
|
|
if (key === 'export') void exportExcel();
|
|
|
|
|
|
else if (key === 'import') excelImportTrigger.value?.click();
|
|
|
|
|
|
else if (key === 'phone') phoneImportTrigger.value?.click();
|
|
|
|
|
|
else if (key === 'groups') groupsManagerOpen.value = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onHeaderTab(key: string | number) {
|
|
|
|
|
|
setTab(String(key) === 'companies' ? 'companies' : 'people');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onSearchInput(value: string) {
|
|
|
|
|
|
q.value = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onRemoveFilter(key: string) {
|
|
|
|
|
|
const sep = key.indexOf(':');
|
|
|
|
|
|
if (sep < 0) return;
|
|
|
|
|
|
const kind = key.slice(0, sep) as FilterTag['kind'];
|
|
|
|
|
|
const value = key.slice(sep + 1);
|
|
|
|
|
|
const tag = activeTags.value.find((t) => t.kind === kind && t.value === value);
|
|
|
|
|
|
if (tag) removeTag(tag);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function clearPeopleFilters() {
|
|
|
|
|
|
clearFilters();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const PEOPLE_COL_LABELS = [
|
|
|
|
|
|
'#',
|
|
|
|
|
|
'وضعیت',
|
|
|
|
|
|
'نام شخص',
|
|
|
|
|
|
'منبع',
|
|
|
|
|
|
'کد مبدأ',
|
|
|
|
|
|
'سمت',
|
|
|
|
|
|
'شرکت',
|
|
|
|
|
|
'تلفن',
|
|
|
|
|
|
'ایمیل',
|
|
|
|
|
|
'تاریخ ثبت',
|
|
|
|
|
|
];
|
|
|
|
|
|
const COMPANY_COL_LABELS = [
|
|
|
|
|
|
'#',
|
|
|
|
|
|
'نام شرکت',
|
|
|
|
|
|
'کد دیدار شرکت',
|
|
|
|
|
|
'کد شرکت',
|
|
|
|
|
|
'منبع',
|
|
|
|
|
|
'گروه بندی',
|
|
|
|
|
|
'استان',
|
|
|
|
|
|
'شهرستان',
|
|
|
|
|
|
'تلفن شرکت',
|
|
|
|
|
|
'ایمیل شرکت',
|
|
|
|
|
|
'شناسه ملی',
|
|
|
|
|
|
'شماره اقتصادی',
|
|
|
|
|
|
'مسئول شرکت',
|
|
|
|
|
|
'تاریخ ثبت',
|
|
|
|
|
|
'افراد',
|
|
|
|
|
|
];
|
|
|
|
|
|
registerTableColumns('contacts.people', PEOPLE_COL_LABELS);
|
|
|
|
|
|
registerTableColumns('contacts.companies', COMPANY_COL_LABELS);
|
|
|
|
|
|
const peopleCols = useTableColumns(() => 'contacts.people');
|
|
|
|
|
|
const companyCols = useTableColumns(() => 'contacts.companies');
|
|
|
|
|
|
|
|
|
|
|
|
function shownColumns<T>(cols: TableColumnsType<T>, visible: (label: string) => boolean) {
|
|
|
|
|
|
return cols.filter((col) => {
|
|
|
|
|
|
const title = typeof col.title === 'string' ? col.title : '';
|
|
|
|
|
|
if (!title || col.key === 'select' || col.key === 'actions') return true;
|
|
|
|
|
|
return visible(title);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const peopleColumns = computed<TableColumnsType<PersonDto>>(() =>
|
|
|
|
|
|
shownColumns(
|
|
|
|
|
|
[
|
|
|
|
|
|
{ title: '', key: 'select', width: 48 },
|
|
|
|
|
|
{ title: '#', key: 'row', width: 72 },
|
|
|
|
|
|
{ title: 'وضعیت', key: 'mood', width: 88 },
|
|
|
|
|
|
{ title: 'نام شخص', key: 'name' },
|
|
|
|
|
|
{ title: 'منبع', key: 'source' },
|
|
|
|
|
|
{ title: 'کد مبدأ', key: 'code', width: 120 },
|
|
|
|
|
|
{ title: 'سمت', key: 'position' },
|
|
|
|
|
|
{ title: 'شرکت', key: 'company' },
|
|
|
|
|
|
{ title: 'تلفن', key: 'phone' },
|
|
|
|
|
|
{ title: 'ایمیل', key: 'email' },
|
|
|
|
|
|
{ title: 'تاریخ ثبت', key: 'createdAt', width: 130 },
|
|
|
|
|
|
{ title: '', key: 'actions', width: 56 },
|
|
|
|
|
|
],
|
|
|
|
|
|
(label) => peopleCols.isVisible(label),
|
|
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const companyColumns = computed<TableColumnsType<CompanyDto>>(() =>
|
|
|
|
|
|
shownColumns(
|
|
|
|
|
|
[
|
|
|
|
|
|
{ title: '#', key: 'row', width: 72 },
|
|
|
|
|
|
{ title: 'نام شرکت', key: 'name' },
|
|
|
|
|
|
{ title: 'کد دیدار شرکت', key: 'sourceRef' },
|
|
|
|
|
|
{ title: 'کد شرکت', key: 'code' },
|
|
|
|
|
|
{ title: 'منبع', key: 'source' },
|
|
|
|
|
|
{ title: 'گروه بندی', key: 'group' },
|
|
|
|
|
|
{ title: 'استان', key: 'province' },
|
|
|
|
|
|
{ title: 'شهرستان', key: 'city' },
|
|
|
|
|
|
{ title: 'تلفن شرکت', key: 'phone' },
|
|
|
|
|
|
{ title: 'ایمیل شرکت', key: 'email' },
|
|
|
|
|
|
{ title: 'شناسه ملی', key: 'nationalId' },
|
|
|
|
|
|
{ title: 'شماره اقتصادی', key: 'economicCode' },
|
|
|
|
|
|
{ title: 'مسئول شرکت', key: 'owner' },
|
|
|
|
|
|
{ title: 'تاریخ ثبت', key: 'createdAt', width: 130 },
|
|
|
|
|
|
{ title: 'افراد', key: 'peopleCount', width: 80 },
|
|
|
|
|
|
],
|
|
|
|
|
|
(label) => companyCols.isVisible(label),
|
|
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const sortOptions: Array<{ value: SortKey; label: string }> = [
|
|
|
|
|
|
{ value: 'name', label: 'نام' },
|
|
|
|
|
|
{ value: 'newest', label: 'جدیدترین' },
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const moodOptions = computed(() => [
|
|
|
|
|
|
{ value: 'all', label: 'همه' },
|
|
|
|
|
|
...PERSON_MOODS.map((mood) => ({ value: mood, label: moodLabel(mood) })),
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
const sourceOptions = computed(() => [
|
|
|
|
|
|
{ value: 'all', label: 'همه منابع' },
|
|
|
|
|
|
...sourceStats.value.map((row) => ({
|
|
|
|
|
|
value: row.source,
|
|
|
|
|
|
label: `${row.label} (${toFaDigits(row.count)})`,
|
|
|
|
|
|
})),
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
const discOptions = [
|
|
|
|
|
|
{ value: 'D', label: 'D' },
|
|
|
|
|
|
{ value: 'I', label: 'I' },
|
|
|
|
|
|
{ value: 'S', label: 'S' },
|
|
|
|
|
|
{ value: 'C', label: 'C' },
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const discSelected = computed(() =>
|
|
|
|
|
|
discFilter.value ? discFilter.value.split('/').filter(Boolean) : [],
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
function onDiscChange(next: string[]) {
|
|
|
|
|
|
const cleaned = discOptions.map((o) => o.value).filter((v) => next.includes(v));
|
|
|
|
|
|
patchQuery({ disc: cleaned.length ? cleaned.join('/') : undefined, page: undefined });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function moodTagColor(mood: PersonMood) {
|
|
|
|
|
|
if (mood === 'happy') return 'purple';
|
|
|
|
|
|
if (mood === 'unhappy') return 'error';
|
|
|
|
|
|
if (mood === 'special') return 'warning';
|
|
|
|
|
|
return 'success';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onSortChange(value: unknown) {
|
|
|
|
|
|
if (Array.isArray(value)) {
|
|
|
|
|
|
setSort(value[0] === 'newest' ? 'newest' : 'name');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
setSort(value === 'newest' ? 'newest' : 'name');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onMoodChange(value: unknown) {
|
|
|
|
|
|
const next =
|
|
|
|
|
|
typeof value === 'string' && PERSON_MOODS.includes(value as PersonMood)
|
|
|
|
|
|
? (value as PersonMood)
|
|
|
|
|
|
: undefined;
|
|
|
|
|
|
patchQuery({ mood: next, page: undefined });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onSourceChange(value: unknown) {
|
|
|
|
|
|
const next =
|
|
|
|
|
|
typeof value === 'string' && PERSON_IMPORT_SOURCES.includes(value as PersonImportSource)
|
|
|
|
|
|
? value
|
|
|
|
|
|
: undefined;
|
|
|
|
|
|
patchQuery({ source: next, page: undefined });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onPersonMenu(id: string, prefix: 't' | 'm', open: boolean) {
|
|
|
|
|
|
menuId.value = open ? `${prefix}:${id}` : null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onTablePage(nextPage: number, nextSize: number) {
|
|
|
|
|
|
const size = Number(nextSize);
|
|
|
|
|
|
if (size !== pageSize.value) onPageSize(size);
|
|
|
|
|
|
if (nextPage !== page.value) setPage(nextPage);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function pageTotalText(totalCount: number, range: [number, number]) {
|
|
|
|
|
|
return `نمایش ${toFaDigits(range[0])} تا ${toFaDigits(range[1])} از ${toFaDigits(totalCount)}`;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function peopleCustomRow(record: PersonDto) {
|
|
|
|
|
|
return {
|
|
|
|
|
|
style: selectedIds.value.includes(record.id)
|
|
|
|
|
|
? { background: token.value.colorPrimaryBg }
|
|
|
|
|
|
: undefined,
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
2026-08-29 21:06:30 +03:30
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<a-flex vertical :gap="16" @click="closePopups">
|
2026-11-25 16:53:04 +03:30
|
|
|
|
<PageHeader
|
|
|
|
|
|
title="مخاطبین"
|
|
|
|
|
|
:icon="TeamOutlined"
|
|
|
|
|
|
:primary-label="tab === 'companies' ? 'شرکت جدید' : 'شخص جدید'"
|
|
|
|
|
|
:menu-items="headerMenuItems"
|
|
|
|
|
|
:tabs="headerTabs"
|
|
|
|
|
|
:active-tab="tab"
|
|
|
|
|
|
searchable
|
|
|
|
|
|
:search="q"
|
|
|
|
|
|
:search-placeholder="tab === 'people' ? 'جستجو در اشخاص…' : 'جستجو در شرکتها…'"
|
|
|
|
|
|
:active-filters="activeFilterChips"
|
|
|
|
|
|
:result-count="activeFilterChips.length ? total : undefined"
|
|
|
|
|
|
@primary="contactModal = tab === 'companies' ? 'company' : 'person'"
|
|
|
|
|
|
@menu="onHeaderMenu"
|
|
|
|
|
|
@update:active-tab="onHeaderTab"
|
|
|
|
|
|
@update:search="onSearchInput"
|
|
|
|
|
|
@search-submit="onSearch"
|
|
|
|
|
|
@remove-filter="onRemoveFilter"
|
|
|
|
|
|
@clear-filters="clearPeopleFilters"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #quick-filters>
|
|
|
|
|
|
<template v-if="tab === 'people'">
|
|
|
|
|
|
<a-select
|
|
|
|
|
|
:value="moodFilter"
|
|
|
|
|
|
:options="moodOptions"
|
|
|
|
|
|
:style="{ width: '150px' }"
|
|
|
|
|
|
@update:value="onMoodChange"
|
2026-11-03 16:51:51 +03:30
|
|
|
|
/>
|
2026-11-25 16:53:04 +03:30
|
|
|
|
<a-select
|
|
|
|
|
|
v-if="sourceStats.length"
|
|
|
|
|
|
:value="sourceFilter"
|
|
|
|
|
|
:options="sourceOptions"
|
|
|
|
|
|
:style="{ width: '170px' }"
|
|
|
|
|
|
@update:value="onSourceChange"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</template>
|
2026-10-18 21:04:26 +03:30
|
|
|
|
|
2026-11-25 16:53:04 +03:30
|
|
|
|
<template v-if="tab === 'people'" #saved-filters>
|
|
|
|
|
|
<div :style="{ width: '280px', maxWidth: '100%' }">
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<SavedFiltersBar
|
|
|
|
|
|
scope="people"
|
2026-11-25 16:53:04 +03:30
|
|
|
|
compact
|
2026-11-03 16:51:51 +03:30
|
|
|
|
:current-filters="peopleSavedFilters"
|
|
|
|
|
|
@apply="applyPeopleSavedFilters"
|
|
|
|
|
|
/>
|
2026-11-25 16:53:04 +03:30
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2026-08-29 21:06:30 +03:30
|
|
|
|
|
2026-11-25 16:53:04 +03:30
|
|
|
|
<template #toolbar-end>
|
|
|
|
|
|
<TableColumnsMenu
|
|
|
|
|
|
icon-only
|
|
|
|
|
|
align="end"
|
|
|
|
|
|
:table-key="tab === 'people' ? 'contacts.people' : 'contacts.companies'"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
2026-09-03 14:20:55 +03:30
|
|
|
|
|
2026-11-25 16:53:04 +03:30
|
|
|
|
<template v-if="tab === 'people' && canBehavior" #chips>
|
|
|
|
|
|
<FilterChips
|
|
|
|
|
|
label="DISC"
|
|
|
|
|
|
:options="discOptions"
|
|
|
|
|
|
:model-value="discSelected"
|
|
|
|
|
|
@update:model-value="onDiscChange"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- مرتبسازی فقط روی لیست اشخاص اثر دارد -->
|
|
|
|
|
|
<template v-if="tab === 'people'" #chips-end>
|
|
|
|
|
|
<FilterChips
|
|
|
|
|
|
label="مرتبسازی"
|
|
|
|
|
|
:options="sortOptions"
|
|
|
|
|
|
:multiple="false"
|
|
|
|
|
|
:show-all="false"
|
|
|
|
|
|
:model-value="[sort]"
|
|
|
|
|
|
@update:model-value="onSortChange"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</PageHeader>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- تریگرهای ورود داده؛ از منوی «⋯» هدر کلیک میشوند (مودالهایشان به body تلپورت میشوند) -->
|
|
|
|
|
|
<div hidden>
|
|
|
|
|
|
<ExcelImportFlow
|
|
|
|
|
|
:preview-path="importPreviewPath"
|
|
|
|
|
|
:import-path="importPath"
|
|
|
|
|
|
:disabled="busy"
|
|
|
|
|
|
@start="onImportStart"
|
|
|
|
|
|
@done="onImportDone"
|
|
|
|
|
|
@fail="onImportFail"
|
|
|
|
|
|
@settled="onImportSettled"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span ref="excelImportTrigger"></span>
|
|
|
|
|
|
</ExcelImportFlow>
|
|
|
|
|
|
<PhoneContactsImport
|
|
|
|
|
|
v-if="tab === 'people'"
|
|
|
|
|
|
:disabled="busy"
|
|
|
|
|
|
@start="onPhoneImportStart"
|
|
|
|
|
|
@done="onPhoneImportDone"
|
|
|
|
|
|
@fail="onPhoneImportFail"
|
|
|
|
|
|
@settled="onPhoneImportSettled"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span ref="phoneImportTrigger"></span>
|
|
|
|
|
|
</PhoneContactsImport>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<a-spin :spinning="pageBusy" :tip="busyMessage">
|
|
|
|
|
|
<a-card :bordered="false">
|
|
|
|
|
|
<a-flex vertical :gap="16">
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<a-alert v-if="importMsg" type="success" show-icon :message="importMsg" />
|
|
|
|
|
|
<a-alert v-if="error" type="error" show-icon :message="error" />
|
2026-10-05 20:00:21 +03:30
|
|
|
|
|
2026-11-05 14:46:35 +03:30
|
|
|
|
<CrmSkeleton v-if="!error" :loading="loading">
|
|
|
|
|
|
<CrmSkeletonTable :rows="8" :columns="10" :card="false">
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<template v-if="tab === 'people'">
|
|
|
|
|
|
<template v-if="people?.items.length">
|
|
|
|
|
|
<a-alert v-if="selectedIds.length" type="info" show-icon>
|
|
|
|
|
|
<template #message>
|
|
|
|
|
|
<a-flex justify="space-between" align="center" wrap="wrap" :gap="8">
|
|
|
|
|
|
<span>{{ toFaDigits(selectedIds.length) }} شخص انتخاب شده</span>
|
|
|
|
|
|
<a-space>
|
|
|
|
|
|
<a-button type="link" @click="selectedIds = []">لغو انتخاب</a-button>
|
|
|
|
|
|
<a-button danger :disabled="busy" @click="deleteSelected">
|
|
|
|
|
|
<template #icon><DeleteOutlined /></template>
|
|
|
|
|
|
حذف انتخابشدهها
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</a-flex>
|
2026-09-22 11:02:08 +03:30
|
|
|
|
</template>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
</a-alert>
|
2026-09-03 14:20:55 +03:30
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<a-list v-if="isCompact" :data-source="people.items" :row-key="(item: PersonDto) => item.id">
|
|
|
|
|
|
<template #renderItem="{ item }">
|
|
|
|
|
|
<a-list-item>
|
|
|
|
|
|
<a-flex align="flex-start" :gap="12" style="width: 100%">
|
|
|
|
|
|
<CustomerMoodFace :mood="moodOf(item)" :size="48" />
|
|
|
|
|
|
<div style="min-width: 0; flex: 1">
|
|
|
|
|
|
<a-flex justify="space-between" align="flex-start" :gap="8">
|
|
|
|
|
|
<a-space wrap :size="8">
|
|
|
|
|
|
<RouterLink
|
|
|
|
|
|
v-slot="{ href, navigate }"
|
|
|
|
|
|
custom
|
|
|
|
|
|
:to="{ name: 'person-detail', params: { id: item.id } }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-typography-link :href="href" @click="navigate">{{ item.fullName }}</a-typography-link>
|
|
|
|
|
|
</RouterLink>
|
|
|
|
|
|
<DiscBadge v-if="canBehavior" :label="item.discLabel" />
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
<a-dropdown
|
|
|
|
|
|
:trigger="['click']"
|
|
|
|
|
|
:open="menuId === `m:${item.id}`"
|
|
|
|
|
|
@click.stop
|
|
|
|
|
|
@update:open="(open: boolean) => onPersonMenu(item.id, 'm', open)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-button type="text" aria-label="عملیات" @click.stop>
|
|
|
|
|
|
<template #icon><MoreOutlined /></template>
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
<template #overlay>
|
|
|
|
|
|
<a-menu>
|
2026-11-04 10:01:11 +03:30
|
|
|
|
<a-menu-item
|
|
|
|
|
|
key="detail"
|
|
|
|
|
|
@click="
|
|
|
|
|
|
router.push({
|
|
|
|
|
|
name: 'person-detail',
|
|
|
|
|
|
params: { id: item.id },
|
|
|
|
|
|
})
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #icon><IdcardOutlined /></template>
|
|
|
|
|
|
پرونده
|
2026-11-03 16:51:51 +03:30
|
|
|
|
</a-menu-item>
|
2026-11-04 10:01:11 +03:30
|
|
|
|
<a-menu-item
|
|
|
|
|
|
key="edit"
|
|
|
|
|
|
@click="
|
|
|
|
|
|
router.push({
|
|
|
|
|
|
name: 'person-edit',
|
|
|
|
|
|
params: { id: item.id },
|
|
|
|
|
|
})
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #icon><EditOutlined /></template>
|
|
|
|
|
|
ویرایش
|
2026-11-03 16:51:51 +03:30
|
|
|
|
</a-menu-item>
|
|
|
|
|
|
<a-menu-item
|
|
|
|
|
|
v-for="mood in PERSON_MOODS"
|
|
|
|
|
|
:key="mood"
|
|
|
|
|
|
@click="setMoodFor(item, mood)"
|
|
|
|
|
|
>
|
2026-11-04 10:01:11 +03:30
|
|
|
|
<template #icon>
|
|
|
|
|
|
<CustomerMoodFace :mood="mood" :size="18" />
|
|
|
|
|
|
</template>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
{{ moodLabel(mood) }}
|
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
|
</a-menu>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-dropdown>
|
|
|
|
|
|
</a-flex>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<a-typography-text type="secondary">
|
|
|
|
|
|
{{ [item.position, item.company?.name].filter(Boolean).join(' • ') || 'بدون سمت' }}
|
|
|
|
|
|
</a-typography-text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<a-typography-text type="secondary">
|
|
|
|
|
|
منبع: {{ sourceLabel(item.importSource || 'manual') }}
|
|
|
|
|
|
<template v-if="externalCode(item)"> · کد: {{ externalCodeLabel(item) }}</template>
|
|
|
|
|
|
</a-typography-text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.previousFullName">
|
|
|
|
|
|
<a-typography-text type="secondary">نام قبلی: {{ item.previousFullName }}</a-typography-text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.mobile || item.phone" dir="ltr">
|
|
|
|
|
|
<a-space :size="4">
|
|
|
|
|
|
<PhoneOutlined />
|
|
|
|
|
|
<span>{{ item.mobile || item.phone }}</span>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.email" dir="ltr">
|
|
|
|
|
|
<a-space :size="4">
|
|
|
|
|
|
<MailOutlined />
|
|
|
|
|
|
<span>{{ item.email }}</span>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<a-tag :color="moodTagColor(moodOf(item))">{{ moodLabel(moodOf(item)) }}</a-tag>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-flex>
|
|
|
|
|
|
</a-list-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-list>
|
2026-09-03 14:20:55 +03:30
|
|
|
|
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<a-table
|
|
|
|
|
|
v-else
|
|
|
|
|
|
:columns="peopleColumns"
|
|
|
|
|
|
:data-source="people.items"
|
|
|
|
|
|
:pagination="false"
|
|
|
|
|
|
:row-key="(row: PersonDto) => row.id"
|
|
|
|
|
|
:scroll="{ x: 1100 }"
|
|
|
|
|
|
:custom-row="peopleCustomRow"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #headerCell="{ column }">
|
|
|
|
|
|
<a-checkbox
|
|
|
|
|
|
v-if="column.key === 'select'"
|
|
|
|
|
|
:checked="allSelected"
|
|
|
|
|
|
:indeterminate="someSelected"
|
|
|
|
|
|
aria-label="انتخاب همه"
|
|
|
|
|
|
@change="toggleAll"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<template v-else>{{ column.title }}</template>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template #bodyCell="{ column, record, index }">
|
|
|
|
|
|
<template v-if="column.key === 'select'">
|
|
|
|
|
|
<a-checkbox
|
|
|
|
|
|
:checked="selectedIds.includes(record.id)"
|
|
|
|
|
|
:aria-label="`انتخاب ${record.fullName}`"
|
|
|
|
|
|
@click.stop
|
|
|
|
|
|
@change="toggleOne(record.id)"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'row'">
|
|
|
|
|
|
{{ toFaDigits(rowOffset + Number(index) + 1) }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'mood'">
|
|
|
|
|
|
<CustomerMoodFace :mood="moodOf(record as PersonDto)" :size="34" />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'name'">
|
|
|
|
|
|
<RouterLink
|
|
|
|
|
|
v-slot="{ href, navigate }"
|
|
|
|
|
|
custom
|
|
|
|
|
|
:to="{ name: 'person-detail', params: { id: record.id } }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-typography-link :href="href" @click="navigate">{{ record.fullName }}</a-typography-link>
|
|
|
|
|
|
</RouterLink>
|
|
|
|
|
|
<DiscBadge v-if="canBehavior" :label="record.discLabel" />
|
|
|
|
|
|
<div v-if="record.previousFullName">
|
|
|
|
|
|
<a-typography-text type="secondary">قبلی: {{ record.previousFullName }}</a-typography-text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'source'">
|
|
|
|
|
|
{{ sourceLabel(record.importSource || 'manual') }}
|
|
|
|
|
|
<div v-if="record.previousImportSource">
|
|
|
|
|
|
<a-typography-text type="secondary">
|
|
|
|
|
|
قبلاً: {{ sourceLabel(record.previousImportSource) }}
|
|
|
|
|
|
<bdi v-if="record.previousSourceRef">{{ toFaDigits(record.previousSourceRef) }}</bdi>
|
|
|
|
|
|
</a-typography-text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'code'">
|
|
|
|
|
|
<span dir="ltr">{{ externalCodeLabel(record as PersonDto) }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'position'">
|
|
|
|
|
|
{{ record.position || '—' }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'company'">
|
|
|
|
|
|
<RouterLink
|
|
|
|
|
|
v-if="record.company"
|
|
|
|
|
|
v-slot="{ href, navigate }"
|
|
|
|
|
|
custom
|
|
|
|
|
|
:to="{ name: 'company-detail', params: { id: record.company.id } }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-typography-link :href="href" @click="navigate">{{ record.company.name }}</a-typography-link>
|
|
|
|
|
|
</RouterLink>
|
|
|
|
|
|
<a-typography-text v-else type="secondary">—</a-typography-text>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'phone'">
|
|
|
|
|
|
<span dir="ltr">{{ record.mobile || record.phone || '—' }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'email'">
|
|
|
|
|
|
<a-space v-if="record.email" :size="4">
|
|
|
|
|
|
<span dir="ltr">{{ record.email }}</span>
|
|
|
|
|
|
<MailOutlined />
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
<template v-else>—</template>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'createdAt'">
|
|
|
|
|
|
{{ formatDate(record.createdAt) }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'actions'">
|
|
|
|
|
|
<a-dropdown
|
|
|
|
|
|
:trigger="['click']"
|
|
|
|
|
|
:open="menuId === `t:${record.id}`"
|
|
|
|
|
|
@click.stop
|
|
|
|
|
|
@update:open="(open: boolean) => onPersonMenu(record.id, 't', open)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-button type="text" aria-label="عملیات" @click.stop>
|
|
|
|
|
|
<template #icon><MoreOutlined /></template>
|
|
|
|
|
|
</a-button>
|
|
|
|
|
|
<template #overlay>
|
|
|
|
|
|
<a-menu>
|
2026-11-04 10:01:11 +03:30
|
|
|
|
<a-menu-item
|
|
|
|
|
|
key="detail"
|
|
|
|
|
|
@click="
|
|
|
|
|
|
router.push({
|
|
|
|
|
|
name: 'person-detail',
|
|
|
|
|
|
params: { id: record.id },
|
|
|
|
|
|
})
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #icon><IdcardOutlined /></template>
|
|
|
|
|
|
پرونده
|
2026-11-03 16:51:51 +03:30
|
|
|
|
</a-menu-item>
|
2026-11-04 10:01:11 +03:30
|
|
|
|
<a-menu-item
|
|
|
|
|
|
key="edit"
|
|
|
|
|
|
@click="
|
|
|
|
|
|
router.push({
|
|
|
|
|
|
name: 'person-edit',
|
|
|
|
|
|
params: { id: record.id },
|
|
|
|
|
|
})
|
|
|
|
|
|
"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #icon><EditOutlined /></template>
|
|
|
|
|
|
ویرایش
|
2026-11-03 16:51:51 +03:30
|
|
|
|
</a-menu-item>
|
|
|
|
|
|
<a-menu-item
|
|
|
|
|
|
v-for="mood in PERSON_MOODS"
|
|
|
|
|
|
:key="mood"
|
|
|
|
|
|
@click="setMoodFor(record as PersonDto, mood)"
|
|
|
|
|
|
>
|
2026-11-04 10:01:11 +03:30
|
|
|
|
<template #icon>
|
|
|
|
|
|
<CustomerMoodFace :mood="mood" :size="18" />
|
|
|
|
|
|
</template>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
{{ moodLabel(mood) }}
|
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
|
</a-menu>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-dropdown>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-table>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<a-empty
|
|
|
|
|
|
v-else-if="!loading"
|
|
|
|
|
|
description="شخصی ثبت نشده است. اولین مخاطب یا مشتری را اضافه کنید."
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-else>
|
|
|
|
|
|
<template v-if="companies?.items.length">
|
|
|
|
|
|
<a-list v-if="isCompact" :data-source="companies.items" :row-key="(item: CompanyDto) => item.id">
|
|
|
|
|
|
<template #renderItem="{ item }">
|
|
|
|
|
|
<a-list-item>
|
|
|
|
|
|
<a-flex align="flex-start" :gap="12">
|
|
|
|
|
|
<BankOutlined />
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<RouterLink
|
|
|
|
|
|
v-slot="{ href, navigate }"
|
|
|
|
|
|
custom
|
|
|
|
|
|
:to="{ name: 'company-detail', params: { id: item.id } }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-typography-link :href="href" @click="navigate">{{ item.name }}</a-typography-link>
|
|
|
|
|
|
</RouterLink>
|
|
|
|
|
|
<div v-if="item.phone" dir="ltr">
|
|
|
|
|
|
<a-space :size="4">
|
|
|
|
|
|
<PhoneOutlined />
|
|
|
|
|
|
<span>{{ item.phone }}</span>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.email" dir="ltr">
|
|
|
|
|
|
<a-space :size="4">
|
|
|
|
|
|
<MailOutlined />
|
|
|
|
|
|
<span>{{ item.email }}</span>
|
|
|
|
|
|
</a-space>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-if="item.sourceRef || item.code">
|
|
|
|
|
|
<a-typography-text type="secondary">
|
|
|
|
|
|
{{ item.sourceRef ? `کد دیدار: ${toFaDigits(item.sourceRef)}` : '' }}
|
|
|
|
|
|
{{ item.sourceRef && item.code ? ' • ' : '' }}
|
|
|
|
|
|
{{ item.code ? `کد: ${toFaDigits(item.code)}` : '' }}
|
|
|
|
|
|
</a-typography-text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<a-typography-text type="secondary">
|
|
|
|
|
|
{{ [item.city, item.owner?.fullName].filter(Boolean).join(' • ') }}
|
|
|
|
|
|
{{ item.city || item.owner ? ' • ' : '' }}افراد: {{ toFaDigits(item.peopleCount) }}
|
|
|
|
|
|
</a-typography-text>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-flex>
|
|
|
|
|
|
</a-list-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-list>
|
|
|
|
|
|
<a-table
|
|
|
|
|
|
v-else
|
|
|
|
|
|
:columns="companyColumns"
|
|
|
|
|
|
:data-source="companies.items"
|
|
|
|
|
|
:pagination="false"
|
|
|
|
|
|
:row-key="(row: CompanyDto) => row.id"
|
|
|
|
|
|
:scroll="{ x: 1600 }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #bodyCell="{ column, record, index }">
|
|
|
|
|
|
<template v-if="column.key === 'row'">
|
|
|
|
|
|
{{ toFaDigits(rowOffset + Number(index) + 1) }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'name'">
|
|
|
|
|
|
<RouterLink
|
|
|
|
|
|
v-slot="{ href, navigate }"
|
|
|
|
|
|
custom
|
|
|
|
|
|
:to="{ name: 'company-detail', params: { id: record.id } }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-typography-link :href="href" @click="navigate">{{ record.name }}</a-typography-link>
|
|
|
|
|
|
</RouterLink>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'sourceRef'">
|
|
|
|
|
|
<span dir="ltr">{{ record.sourceRef ? toFaDigits(record.sourceRef) : '—' }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'code'">
|
|
|
|
|
|
<span dir="ltr">{{ record.code ? toFaDigits(record.code) : '—' }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'source'">
|
|
|
|
|
|
{{ sourceLabel(record.importSource || 'manual') }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'group'">
|
|
|
|
|
|
{{ record.groupName || '—' }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'province'">
|
|
|
|
|
|
{{ record.province || '—' }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'city'">
|
|
|
|
|
|
{{ record.city || '—' }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'phone'">
|
|
|
|
|
|
<span dir="ltr">{{ record.phone || '—' }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'email'">
|
|
|
|
|
|
<span dir="ltr">{{ record.email || '—' }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'nationalId'">
|
|
|
|
|
|
<span dir="ltr">{{ record.nationalId || '—' }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'economicCode'">
|
|
|
|
|
|
<span dir="ltr">{{ record.economicCode || '—' }}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'owner'">
|
|
|
|
|
|
{{ record.owner?.fullName || '—' }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'createdAt'">
|
|
|
|
|
|
{{ formatDate(record.registeredAt || record.createdAt) }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="column.key === 'peopleCount'">
|
|
|
|
|
|
{{ toFaDigits(record.peopleCount) }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-table>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<a-empty
|
|
|
|
|
|
v-else-if="!loading"
|
|
|
|
|
|
description="شرکتی ثبت نشده است. اولین شرکت یا سازمان را اضافه کنید."
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
2026-11-05 14:46:35 +03:30
|
|
|
|
</CrmSkeletonTable>
|
|
|
|
|
|
</CrmSkeleton>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
|
2026-11-25 16:53:04 +03:30
|
|
|
|
<a-flex v-if="total" justify="flex-start">
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<a-pagination
|
|
|
|
|
|
:current="page"
|
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
:page-size-options="PAGE_SIZE_OPTIONS.map(String)"
|
|
|
|
|
|
show-size-changer
|
|
|
|
|
|
:show-total="pageTotalText"
|
|
|
|
|
|
@change="onTablePage"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</a-flex>
|
2026-11-25 16:53:04 +03:30
|
|
|
|
</a-flex>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
</a-card>
|
|
|
|
|
|
</a-spin>
|
|
|
|
|
|
</a-flex>
|
|
|
|
|
|
|
|
|
|
|
|
<a-modal
|
|
|
|
|
|
v-model:open="contactModalOpen"
|
|
|
|
|
|
:title="contactModal === 'company' ? 'شرکت جدید' : 'شخص جدید'"
|
|
|
|
|
|
:footer="null"
|
|
|
|
|
|
:width="960"
|
|
|
|
|
|
>
|
|
|
|
|
|
<PersonFormView
|
|
|
|
|
|
v-if="contactModal === 'person'"
|
|
|
|
|
|
embedded
|
|
|
|
|
|
@saved="contactModal = null; void load()"
|
|
|
|
|
|
@cancel="contactModal = null"
|
2026-09-12 01:33:07 +03:30
|
|
|
|
/>
|
2026-11-03 16:51:51 +03:30
|
|
|
|
<CompanyFormView
|
|
|
|
|
|
v-else-if="contactModal === 'company'"
|
|
|
|
|
|
embedded
|
|
|
|
|
|
@saved="contactModal = null; void load()"
|
|
|
|
|
|
@cancel="contactModal = null"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</a-modal>
|
2026-08-29 21:06:30 +03:30
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.page {
|
|
|
|
|
|
display: grid;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
/* بدون این، ردیفهای grid ارتفاع اضافهٔ صفحه را بین خودشان پخش میکنند */
|
|
|
|
|
|
align-content: start;
|
|
|
|
|
|
gap: 0.5rem;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
width: 100%;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
min-width: 0;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
overflow-x: clip;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.page > * {
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
max-width: 100%;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.page-head {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.45rem 0.75rem;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
flex-wrap: nowrap;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.head-start {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.55rem;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
min-width: 0;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
flex: 1 1 auto;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
|
|
margin: 0;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 1.1rem;
|
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
|
line-height: 1.25;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.muted {
|
2026-09-03 14:20:55 +03:30
|
|
|
|
color: #64748b;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
|
|
word-break: break-word;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-08-29 21:06:30 +03:30
|
|
|
|
.actions {
|
|
|
|
|
|
display: flex;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.3rem;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
flex-wrap: nowrap;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
justify-content: flex-end;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
flex: 0 0 auto;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.actions-desktop {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 0.3rem;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.actions-more {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-05 01:49:19 +03:30
|
|
|
|
.btn-short {
|
|
|
|
|
|
display: none;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
/* از عرض متوسط لیبل کوتاه تا اکشنها به ردیف دوم نروند */
|
|
|
|
|
|
@media (max-width: 1280px) {
|
|
|
|
|
|
.actions .btn-full {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.actions .btn-short {
|
|
|
|
|
|
display: inline;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.chrome {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.4rem;
|
|
|
|
|
|
min-width: 0;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tabs {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
gap: 0.15rem;
|
|
|
|
|
|
padding: 0.15rem;
|
|
|
|
|
|
background: #f1f5f9;
|
|
|
|
|
|
border-radius: var(--radius);
|
|
|
|
|
|
flex-shrink: 0;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tabs button {
|
|
|
|
|
|
border: 0;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
background: transparent;
|
|
|
|
|
|
padding: 0.35rem 0.65rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
font: inherit;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: var(--fs-sm);
|
|
|
|
|
|
color: #64748b;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.3rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
cursor: pointer;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
white-space: nowrap;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
border-radius: calc(var(--radius) - 2px);
|
|
|
|
|
|
line-height: 1.2;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
.tabs .on {
|
|
|
|
|
|
color: #0f766e;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
font-weight: 600;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
background: #fff;
|
|
|
|
|
|
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
.tabs em {
|
|
|
|
|
|
font-style: normal;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.72rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
color: #94a3b8;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 18:07:21 +03:30
|
|
|
|
.filter-tags {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.3rem;
|
2026-10-21 17:16:31 +03:30
|
|
|
|
}
|
2026-10-21 18:07:21 +03:30
|
|
|
|
.filter-tag {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.2rem;
|
|
|
|
|
|
padding: 0.1rem 0.25rem 0.1rem 0.5rem;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
border-radius: 999px;
|
|
|
|
|
|
background: #f0fdfa;
|
|
|
|
|
|
color: #0f766e;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.75rem;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
.filter-tag button {
|
|
|
|
|
|
display: inline-grid;
|
|
|
|
|
|
place-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
width: 1rem;
|
|
|
|
|
|
height: 1rem;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
border: 0;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
background: rgba(15, 23, 42, 0.08);
|
|
|
|
|
|
color: inherit;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.filter-clear {
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
color: #64748b;
|
|
|
|
|
|
font: inherit;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.75rem;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
text-decoration: underline;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
.tool.active {
|
|
|
|
|
|
border-color: #14b8a6;
|
|
|
|
|
|
color: #0f766e;
|
|
|
|
|
|
background: #f0fdfa;
|
|
|
|
|
|
}
|
|
|
|
|
|
.tool-count {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
min-width: 1.05rem;
|
|
|
|
|
|
height: 1.05rem;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
border-radius: 999px;
|
|
|
|
|
|
background: #14b8a6;
|
|
|
|
|
|
color: #fff;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.68rem;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
display: inline-grid;
|
|
|
|
|
|
place-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0 0.2rem;
|
2026-10-21 18:07:21 +03:30
|
|
|
|
}
|
2026-10-04 12:01:21 +03:30
|
|
|
|
.tiny {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.72rem;
|
|
|
|
|
|
margin-top: 0.1rem;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.toolbar-tools {
|
|
|
|
|
|
display: flex;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.3rem;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
align-items: center;
|
|
|
|
|
|
flex-shrink: 0;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
/* دسکتاپ: wrapper شفاف تا جستجو مثل قبل آیتم مستقیم flex بماند */
|
|
|
|
|
|
.search-row {
|
|
|
|
|
|
display: contents;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.search-filter {
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.2rem;
|
|
|
|
|
|
height: 28px;
|
|
|
|
|
|
padding: 0 0.4rem;
|
|
|
|
|
|
margin-inline-end: -0.3rem;
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
border-radius: calc(var(--radius) - 2px);
|
|
|
|
|
|
background: transparent;
|
|
|
|
|
|
color: var(--ink-secondary);
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.search-filter.active {
|
|
|
|
|
|
color: #0f766e;
|
|
|
|
|
|
background: #f0fdfa;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.saved-slot {
|
|
|
|
|
|
/* فقط عرض؛ در ستون موبایل flex-basis نباید ارتفاع بسازد */
|
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
width: min(20rem, 100%);
|
|
|
|
|
|
min-width: 11rem;
|
|
|
|
|
|
max-width: 20rem;
|
|
|
|
|
|
margin-inline-start: auto;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
min-height: 0;
|
|
|
|
|
|
overflow: visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.saved-slot :deep(.ant-space-compact) {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
max-height: var(--control-h, 36px);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-08-29 21:06:30 +03:30
|
|
|
|
.search {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
flex: 1 1 12rem;
|
|
|
|
|
|
min-width: 10rem;
|
|
|
|
|
|
max-width: 22rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.35rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
background: #fff;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
border: 1px solid var(--line);
|
2026-09-10 23:45:11 +03:30
|
|
|
|
border-radius: var(--radius);
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0 0.6rem;
|
2026-09-10 23:45:11 +03:30
|
|
|
|
min-height: var(--control-h);
|
|
|
|
|
|
height: var(--control-h);
|
2026-09-12 01:33:07 +03:30
|
|
|
|
color: var(--muted);
|
2026-09-10 23:45:11 +03:30
|
|
|
|
box-sizing: border-box;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.search:focus-within {
|
|
|
|
|
|
border-color: var(--accent);
|
|
|
|
|
|
box-shadow: 0 0 0 2px var(--accent-soft);
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.search input {
|
|
|
|
|
|
flex: 1;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
min-width: 0;
|
|
|
|
|
|
border: 0;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
outline: none;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
background: transparent;
|
|
|
|
|
|
font: inherit;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
font-size: var(--fs-sm);
|
|
|
|
|
|
color: var(--ink);
|
|
|
|
|
|
padding: 0;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tool {
|
2026-09-10 23:45:11 +03:30
|
|
|
|
min-height: var(--control-h);
|
|
|
|
|
|
height: var(--control-h);
|
2026-09-12 01:33:07 +03:30
|
|
|
|
border: 1px solid var(--line);
|
2026-08-29 21:06:30 +03:30
|
|
|
|
background: #fff;
|
2026-09-10 23:45:11 +03:30
|
|
|
|
border-radius: var(--radius);
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0 0.55rem;
|
2026-09-10 23:45:11 +03:30
|
|
|
|
box-sizing: border-box;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.3rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
font: inherit;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
font-size: var(--fs-sm);
|
|
|
|
|
|
color: var(--ink-secondary);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
white-space: nowrap;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
transition: background var(--transition-fast), border-color var(--transition-fast);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tool:hover {
|
|
|
|
|
|
background: var(--surface-subtle);
|
|
|
|
|
|
border-color: var(--line-strong);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pop {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
inset-inline-start: 0;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
top: calc(100% + 4px);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
z-index: 8;
|
|
|
|
|
|
margin: 0;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0.25rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
list-style: none;
|
|
|
|
|
|
background: #fff;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
border-radius: var(--radius);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
|
2026-09-05 01:49:19 +03:30
|
|
|
|
min-width: min(12rem, calc(100vw - 2rem));
|
|
|
|
|
|
max-width: calc(100vw - 1.5rem);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu button,
|
|
|
|
|
|
.menu a {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
background: none;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0.4rem 0.55rem;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
border-radius: var(--radius);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
font: inherit;
|
|
|
|
|
|
text-align: start;
|
|
|
|
|
|
color: inherit;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu .on,
|
|
|
|
|
|
.menu button:hover,
|
|
|
|
|
|
.menu a:hover {
|
|
|
|
|
|
background: #f0fdfa;
|
|
|
|
|
|
color: #0f766e;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ok {
|
|
|
|
|
|
margin: 0;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: var(--fs-sm);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
color: #0f766e;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.error {
|
|
|
|
|
|
margin: 0;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: var(--fs-sm);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
color: #b91c1c;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.table-wrap {
|
2026-09-03 14:20:55 +03:30
|
|
|
|
background: #fff;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
border-radius: var(--radius);
|
2026-10-21 20:01:16 +03:30
|
|
|
|
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
|
2026-08-29 21:06:30 +03:30
|
|
|
|
overflow: auto;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
-webkit-overflow-scrolling: touch;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.data-table {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
border-collapse: collapse;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
min-width: 640px;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
th,
|
|
|
|
|
|
td {
|
2026-09-03 14:20:55 +03:30
|
|
|
|
text-align: start;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0.35rem 0.5rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
border-bottom: 1px solid #f1f5f9;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
white-space: nowrap;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.8125rem;
|
|
|
|
|
|
line-height: 1.35;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
th {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.72rem;
|
|
|
|
|
|
font-weight: 600;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
color: #94a3b8;
|
|
|
|
|
|
background: #f8fafc;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding-block: 0.4rem;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
.status {
|
2026-08-29 21:06:30 +03:30
|
|
|
|
display: flex;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.4rem;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
.status strong {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.8rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-05 20:00:21 +03:30
|
|
|
|
.check-col {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
width: 2rem;
|
|
|
|
|
|
padding-inline: 0.5rem 0.2rem;
|
2026-10-05 20:00:21 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.check-col input {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
width: 0.95rem;
|
|
|
|
|
|
height: 0.95rem;
|
2026-10-05 20:00:21 +03:30
|
|
|
|
margin: 0;
|
|
|
|
|
|
accent-color: #0d9488;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.num-col {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
width: 2.2rem;
|
2026-10-05 20:00:21 +03:30
|
|
|
|
color: #94a3b8;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
font-size: 0.75rem;
|
2026-10-05 20:00:21 +03:30
|
|
|
|
font-variant-numeric: tabular-nums;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding-inline: 0.2rem;
|
2026-10-05 20:00:21 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tr.picked td {
|
|
|
|
|
|
background: #f0fdfa;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bulk-bar {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.5rem;
|
2026-10-05 20:00:21 +03:30
|
|
|
|
flex-wrap: wrap;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0.4rem 0.65rem;
|
2026-10-05 20:00:21 +03:30
|
|
|
|
border: 1px solid #99f6e4;
|
|
|
|
|
|
background: #f0fdfa;
|
|
|
|
|
|
border-radius: var(--radius);
|
|
|
|
|
|
font-size: var(--fs-sm);
|
|
|
|
|
|
color: #0f766e;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bulk-bar > :last-child {
|
|
|
|
|
|
margin-inline-start: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bulk-clear {
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
font: inherit;
|
|
|
|
|
|
font-size: var(--fs-xs);
|
|
|
|
|
|
color: #64748b;
|
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-03 14:20:55 +03:30
|
|
|
|
.name {
|
|
|
|
|
|
color: #0f766e;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
font-weight: 600;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
min-width: 0;
|
|
|
|
|
|
overflow-wrap: anywhere;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.mail {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.3rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ops {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.more {
|
|
|
|
|
|
border: 0;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
color: #94a3b8;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
place-items: center;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
width: 32px;
|
|
|
|
|
|
height: 32px;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
border-radius: var(--radius);
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dot {
|
|
|
|
|
|
width: 8px;
|
|
|
|
|
|
height: 8px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
background: #22c55e;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dot.happy,
|
|
|
|
|
|
strong.happy {
|
|
|
|
|
|
color: #7c3aed;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dot.happy {
|
|
|
|
|
|
background: #8b5cf6;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dot.unhappy,
|
|
|
|
|
|
strong.unhappy {
|
|
|
|
|
|
color: #e11d48;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dot.unhappy {
|
|
|
|
|
|
background: #fb7185;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dot.special,
|
|
|
|
|
|
strong.special {
|
|
|
|
|
|
color: #d97706;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dot.special {
|
|
|
|
|
|
background: #f59e0b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dot.newcomer,
|
|
|
|
|
|
strong.newcomer {
|
|
|
|
|
|
color: #0f766e;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.cards {
|
|
|
|
|
|
display: none;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.5rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
/* کارت موبایل: هدر (آواتار + نام + وضعیت) | منو، سپس ردیف تماس/منبع، سپس جزئیات اختیاری */
|
2026-09-03 14:20:55 +03:30
|
|
|
|
.m-card {
|
|
|
|
|
|
display: grid;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
|
|
|
|
grid-template-areas:
|
|
|
|
|
|
'main menu'
|
|
|
|
|
|
'meta meta'
|
|
|
|
|
|
'extra extra';
|
|
|
|
|
|
column-gap: 0.25rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
background: #fff;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
border: 1px solid #eef2f6;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
border-radius: var(--radius);
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0.55rem 0.6rem 0.5rem;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
min-width: 0;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.m-card.no-menu {
|
|
|
|
|
|
grid-template-areas:
|
|
|
|
|
|
'main main'
|
|
|
|
|
|
'meta meta'
|
|
|
|
|
|
'extra extra';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-main {
|
|
|
|
|
|
grid-area: main;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.55rem;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
min-width: 0;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
color: inherit;
|
|
|
|
|
|
text-decoration: none;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.m-card > :deep(.ui-dd-anchor) {
|
|
|
|
|
|
grid-area: menu;
|
|
|
|
|
|
align-self: start;
|
|
|
|
|
|
margin-inline-end: -0.35rem;
|
|
|
|
|
|
margin-top: -0.2rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-id {
|
|
|
|
|
|
min-width: 0;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
display: grid;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.2rem;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.m-title {
|
2026-09-03 14:20:55 +03:30
|
|
|
|
display: flex;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.35rem;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-title .name {
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
font-size: 0.92rem;
|
|
|
|
|
|
line-height: 1.3;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-title .name.unnamed {
|
|
|
|
|
|
color: #94a3b8;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-sub {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.35rem;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-sub-text {
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
|
color: #64748b;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-meta {
|
|
|
|
|
|
grid-area: meta;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
|
|
padding-top: 0.45rem;
|
|
|
|
|
|
border-top: 1px dashed #e2e8f0;
|
|
|
|
|
|
font-size: 0.78rem;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-phone {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
gap: 0.3rem;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0.2rem 0.5rem;
|
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
|
background: #f0fdfa;
|
|
|
|
|
|
color: #0f766e;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
font-variant-numeric: tabular-nums;
|
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-src {
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
color: #64748b;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-muted {
|
|
|
|
|
|
color: #94a3b8;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.m-extra {
|
|
|
|
|
|
grid-area: extra;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.3rem 0.6rem;
|
|
|
|
|
|
margin-top: 0.4rem;
|
|
|
|
|
|
font-size: 0.75rem;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.m-line {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.25rem;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
color: #64748b;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.m-line > span {
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
flex-shrink: 0;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
border-radius: 999px;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding: 0.05rem 0.45rem;
|
|
|
|
|
|
font-size: 0.68rem;
|
2026-09-12 01:33:07 +03:30
|
|
|
|
font-weight: 600;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
line-height: 1.5;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge.newcomer {
|
|
|
|
|
|
background: #ecfdf5;
|
|
|
|
|
|
color: #0f766e;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge.happy {
|
|
|
|
|
|
background: #f3e8ff;
|
|
|
|
|
|
color: #7c3aed;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge.unhappy {
|
|
|
|
|
|
background: #ffe4e6;
|
|
|
|
|
|
color: #e11d48;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.badge.special {
|
|
|
|
|
|
background: #fef3c7;
|
|
|
|
|
|
color: #d97706;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.co-ico {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
width: 36px;
|
|
|
|
|
|
height: 36px;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
place-items: center;
|
|
|
|
|
|
background: #ecfdf5;
|
|
|
|
|
|
color: #0f766e;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
flex-shrink: 0;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
:deep(.ui-pagination) {
|
|
|
|
|
|
padding-top: 0.35rem;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (max-width: 900px) {
|
2026-09-05 01:49:19 +03:30
|
|
|
|
.page {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
gap: 0.45rem;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.page-head {
|
2026-10-21 20:01:16 +03:30
|
|
|
|
flex-wrap: wrap;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
align-items: stretch;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.head-start {
|
2026-09-05 01:49:19 +03:30
|
|
|
|
width: 100%;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.actions {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
gap: 0.35rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.actions-desktop {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.actions-more {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tabs {
|
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tabs button {
|
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.chrome {
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
|
gap: 0.35rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* جستجو + گروهها در یک ردیف، فاصله ۸px */
|
|
|
|
|
|
.search-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.search {
|
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
width: auto;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
max-width: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.groups-tool {
|
|
|
|
|
|
flex-shrink: 0;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.toolbar-tools {
|
|
|
|
|
|
width: 100%;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
flex-wrap: nowrap;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.toolbar-tools .pop {
|
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.toolbar-tools .tool {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-21 20:01:16 +03:30
|
|
|
|
.saved-slot {
|
|
|
|
|
|
flex: 0 0 auto;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
max-width: none;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
margin-inline-start: 0;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-09-05 01:49:19 +03:30
|
|
|
|
.table-wrap {
|
|
|
|
|
|
display: none;
|
2026-09-03 14:20:55 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.cards {
|
|
|
|
|
|
display: grid;
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
2026-09-05 01:49:19 +03:30
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (max-width: 520px) {
|
|
|
|
|
|
.tool-label {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.toolbar-tools .tool {
|
|
|
|
|
|
width: auto;
|
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
|
min-width: 44px;
|
|
|
|
|
|
justify-content: center;
|
2026-10-21 20:01:16 +03:30
|
|
|
|
padding-inline: 0.5rem;
|
2026-09-05 01:49:19 +03:30
|
|
|
|
}
|
2026-08-29 21:06:30 +03:30
|
|
|
|
}
|
|
|
|
|
|
</style>
|