feat(web): add guided page tours and tighten shell chrome.

Ship first-visit Ant tours for core menus with replay help, role-list search for large orgs, and fixed 32px workspace tabs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-12-01 13:04:57 +03:30
co-authored by Cursor
parent 892edacd3c
commit 37b732bae3
30 changed files with 1415 additions and 565 deletions
+342 -354
View File
@@ -1,12 +1,26 @@
<script setup lang="ts">
/**
* پنل فیلتر مخاطبین — پاپ‌اور دسکتاپ / شیت موبایل.
* ظاهر از توکن‌های Ant؛ منطق فیلتر بدون تغییر.
*/
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue';
import type { CustomerGroupDto, PersonImportSourceStatDto, PersonMood } from '@mento/shared';
import { ACTIVITY_EXPERIENCE_OPTIONS } from '@mento/shared';
import { PERSON_MOOD_LABELS, PERSON_MOODS } from '@/lib/person-mood';
import { groupSwatch } from '@/lib/customer-groups';
import { toFaDigits } from '@/lib/jalali';
import { UiButton } from '@/components/ui';
import UiIcon from '@/components/UiIcon.vue';
import {
Badge as ABadge,
Button as AButton,
Checkbox as ACheckbox,
Divider as ADivider,
Empty as AEmpty,
Flex as AFlex,
Input as AInput,
Typography,
theme,
} from 'ant-design-vue';
import { SearchOutlined } from '@/icons/ant-bridge';
export type ContactsFilterValue = {
groups: string[];
@@ -25,6 +39,8 @@ const props = defineProps<{
canBehavior: boolean;
/** اکشن‌شیت پایین صفحه (موبایل) به‌جای پاپ‌اور */
sheet?: boolean;
/** دکمهٔ لنگر برای پاپ‌اور دسکتاپ (Teleport به body) */
anchorEl?: HTMLElement | null;
/** اگر داده شود بخش مرتب‌سازی داخل همین پنل نمایش داده می‌شود */
sort?: string;
sortOptions?: Array<{ value: string; label: string }>;
@@ -35,6 +51,14 @@ const emit = defineEmits<{
close: [];
}>();
const { token } = theme.useToken();
const { Text: ATypographyText, Title: ATypographyTitle } = Typography;
/** دکمهٔ انتخاب‌شونده — حالت روشن/خاموش واضح */
function optionBtnType(on: boolean): 'primary' | 'default' {
return on ? 'primary' : 'default';
}
const draft = reactive<ContactsFilterValue>({
groups: [],
sources: [],
@@ -46,14 +70,48 @@ const draftSort = ref('');
const groupQuery = ref('');
const GROUP_SEARCH_MIN = 8;
const DISC_TYPES = ['D', 'I', 'S', 'C'];
const panelRef = ref<HTMLElement | null>(null);
const popStyle = ref<Record<string, string> | undefined>();
const hasSort = computed(() => Boolean(props.sortOptions?.length));
const defaultSort = computed(() => props.sortOptions?.[0]?.value ?? '');
function placePopover() {
if (props.sheet || !props.open || !props.anchorEl) {
popStyle.value = undefined;
return;
}
const rect = props.anchorEl.getBoundingClientRect();
const width = Math.min(380, window.innerWidth - 24);
const gap = 8;
const spaceBelow = window.innerHeight - rect.bottom - gap - 12;
const spaceAbove = rect.top - gap - 12;
const preferBelow = spaceBelow >= 280 || spaceBelow >= spaceAbove;
const maxHeight = Math.min(preferBelow ? spaceBelow : spaceAbove, 36 * 16);
const left = Math.min(
Math.max(12, rect.right - width),
window.innerWidth - width - 12,
);
const top = preferBelow
? rect.bottom + gap
: Math.max(12, rect.top - maxHeight - gap);
popStyle.value = {
position: 'fixed',
top: `${top}px`,
left: `${left}px`,
width: `${width}px`,
maxHeight: `${Math.max(240, maxHeight)}px`,
zIndex: '1100',
};
}
watch(
() => props.open,
(open) => {
if (!open) return;
if (!open) {
popStyle.value = undefined;
return;
}
draft.groups = [...props.value.groups];
draft.sources = [...props.value.sources];
draft.moods = [...props.value.moods];
@@ -61,15 +119,47 @@ watch(
draft.activityExperiences = [...(props.value.activityExperiences ?? [])];
draftSort.value = props.sort ?? defaultSort.value;
groupQuery.value = '';
requestAnimationFrame(placePopover);
},
{ immediate: true },
);
watch(
() => [props.anchorEl, props.sheet] as const,
() => {
if (props.open) placePopover();
},
);
function onKey(ev: KeyboardEvent) {
if (ev.key === 'Escape' && props.open && props.sheet) emit('close');
if (ev.key === 'Escape' && props.open) emit('close');
}
onMounted(() => document.addEventListener('keydown', onKey));
onBeforeUnmount(() => document.removeEventListener('keydown', onKey));
function onReposition() {
if (props.open && !props.sheet) placePopover();
}
function onDocPointer(ev: MouseEvent) {
if (!props.open || props.sheet) return;
const t = ev.target as Node | null;
if (!t) return;
if (panelRef.value?.contains(t)) return;
if (props.anchorEl?.contains(t)) return;
emit('close');
}
onMounted(() => {
document.addEventListener('keydown', onKey);
document.addEventListener('mousedown', onDocPointer);
window.addEventListener('resize', onReposition);
window.addEventListener('scroll', onReposition, true);
});
onBeforeUnmount(() => {
document.removeEventListener('keydown', onKey);
document.removeEventListener('mousedown', onDocPointer);
window.removeEventListener('resize', onReposition);
window.removeEventListener('scroll', onReposition, true);
});
const isPeople = computed(() => props.tab === 'people');
@@ -95,10 +185,15 @@ const draftCount = computed(
(hasSort.value && draftSort.value !== defaultSort.value ? 1 : 0),
);
function toggle<T extends string>(list: T[], value: T) {
const idx = list.indexOf(value);
if (idx >= 0) list.splice(idx, 1);
else list.push(value);
function onCheckableChange(list: string[], value: string, checked: boolean) {
const has = list.includes(value);
if (checked && !has) list.push(value);
if (!checked && has) list.splice(list.indexOf(value), 1);
}
function onCheckboxChange(list: string[], value: string, e: unknown) {
const checked = Boolean((e as { target?: { checked?: boolean } })?.target?.checked);
onCheckableChange(list, value, checked);
}
function clearAll() {
@@ -123,415 +218,308 @@ function apply() {
hasSort.value ? draftSort.value : undefined,
);
}
const panelShellStyle = computed(() => {
const t = token.value;
return {
background: t.colorBgElevated,
borderRadius: props.sheet ? `${t.borderRadiusLG}px ${t.borderRadiusLG}px 0 0` : `${t.borderRadiusLG}px`,
boxShadow: t.boxShadowSecondary,
border: props.sheet ? 'none' : `${t.lineWidth}px ${t.lineType} ${t.colorBorderSecondary}`,
};
});
const headStyle = computed(() => {
const t = token.value;
return {
padding: `${t.paddingSM}px ${t.padding}px`,
borderBottom: `${t.lineWidth}px ${t.lineType} ${t.colorBorderSecondary}`,
flexShrink: 0,
};
});
const bodyStyle = computed(() => {
const t = token.value;
return {
padding: `${t.paddingXS}px ${t.padding}px ${t.paddingSM}px`,
overflowY: 'auto' as const,
flex: '1 1 auto',
minHeight: 0,
};
});
const footStyle = computed(() => {
const t = token.value;
return {
padding: `${t.paddingSM}px ${t.padding}px`,
borderTop: `${t.lineWidth}px ${t.lineType} ${t.colorBorderSecondary}`,
flexShrink: 0,
background: t.colorBgElevated,
};
});
const sectionGap = computed(() => token.value.marginSM);
const countBadgeStyle = computed(() => ({
backgroundColor: token.value.colorPrimaryBg,
color: token.value.colorPrimary,
boxShadow: 'none',
fontWeight: token.value.fontWeightStrong,
}));
const dotStyle = (color: string | null | undefined) => ({
width: '8px',
height: '8px',
borderRadius: '50%',
flexShrink: 0,
background: groupSwatch(color).fg,
});
</script>
<template>
<Teleport to="body" :disabled="!sheet">
<div v-if="open && sheet" class="sheet-dim" @click="emit('close')" />
<Teleport to="body">
<div
v-if="open && sheet"
:style="{
position: 'fixed',
inset: 0,
zIndex: 1000,
background: 'rgba(15, 23, 42, 0.45)',
}"
@click="emit('close')"
/>
<div
v-if="open"
class="panel"
:class="{ sheet }"
ref="panelRef"
class="contacts-filter-panel"
:class="{ sheet, portaled: !sheet }"
:style="[panelShellStyle, popStyle]"
role="dialog"
:aria-modal="sheet ? 'true' : undefined"
aria-label="فیلترها"
@click.stop
>
<span v-if="sheet" class="grip" aria-hidden="true" />
<header class="panel-head">
<strong>{{ hasSort ? 'فیلتر و مرتب‌سازی' : 'فیلترها' }}</strong>
<button type="button" class="link" :disabled="!draftCount" @click="clearAll">پاک کردن همه</button>
</header>
<p v-if="isPeople" class="facet-hint">
گروه، منبع و وضعیت با هم جمع می‌شوند؛ هر کدام کافی است (بدون تکرار).
</p>
<span
v-if="sheet"
aria-hidden="true"
:style="{
display: 'block',
width: '40px',
height: '4px',
margin: `${token.paddingXS}px auto 0`,
borderRadius: '999px',
background: token.colorBorder,
flexShrink: 0,
}"
/>
<div class="panel-body">
<section v-if="hasSort" class="sec">
<h4>مرتب‌سازی</h4>
<div class="pills">
<button
<a-flex justify="space-between" align="center" :style="headStyle">
<a-typography-title :level="5" :style="{ margin: 0 }">
{{ hasSort ? 'فیلتر و مرتب‌سازی' : 'فیلترها' }}
</a-typography-title>
<a-button type="link" :disabled="!draftCount" @click="clearAll">
پاک کردن همه
</a-button>
</a-flex>
<div :style="bodyStyle">
<a-flex vertical :gap="sectionGap">
<section v-if="hasSort">
<a-typography-text type="secondary" :style="{ display: 'block', marginBottom: `${token.marginXS}px` }">
مرتب‌سازی
</a-typography-text>
<a-flex wrap="wrap" :gap="token.marginXS" role="group" aria-label="مرتب‌سازی">
<a-button
v-for="o in sortOptions"
:key="o.value"
type="button"
class="pill"
:class="{ on: draftSort === o.value }"
:type="optionBtnType(draftSort === o.value)"
@click="draftSort = o.value"
>
{{ o.label }}
</button>
</div>
</a-button>
</a-flex>
</section>
<section class="sec">
<h4>
گروه
<span v-if="draft.groups.length" class="sel">{{ toFaDigits(draft.groups.length) }} انتخاب</span>
</h4>
<label v-if="groups.length > GROUP_SEARCH_MIN" class="find">
<UiIcon name="search" :size="14" />
<input v-model="groupQuery" type="search" placeholder="جستجوی گروه…" />
</label>
<ul v-if="filteredGroups.length" class="checks">
<li v-for="g in filteredGroups" :key="g.id">
<label class="check">
<input
type="checkbox"
<a-divider v-if="hasSort" :style="{ margin: 0 }" />
<section>
<a-flex align="center" :gap="token.marginXS" :style="{ marginBottom: `${token.marginXS}px` }">
<a-typography-text type="secondary">گروه</a-typography-text>
<a-badge
v-if="draft.groups.length"
:count="`${toFaDigits(draft.groups.length)} انتخاب`"
:number-style="countBadgeStyle"
:overflow-count="Number.MAX_SAFE_INTEGER"
/>
</a-flex>
<a-input
v-if="groups.length > GROUP_SEARCH_MIN"
v-model:value="groupQuery"
allow-clear
placeholder="جستجوی گروه…"
:style="{ marginBottom: `${token.marginXS}px` }"
>
<template #prefix>
<SearchOutlined :style="{ color: token.colorTextTertiary }" />
</template>
</a-input>
<a-flex v-if="filteredGroups.length" vertical :gap="token.marginXXS">
<a-checkbox
v-for="g in filteredGroups"
:key="g.id"
:checked="draft.groups.includes(g.id)"
@change="toggle(draft.groups, g.id)"
@change="(e) => onCheckboxChange(draft.groups, g.id, e)"
>
<a-flex align="center" :gap="token.marginXS" :style="{ minWidth: 0 }">
<span :style="dotStyle(g.color)" aria-hidden="true" />
<a-typography-text :ellipsis="{ tooltip: g.name }" :style="{ flex: 1, minWidth: 0 }">
{{ g.name }}
</a-typography-text>
<a-typography-text type="secondary" :style="{ flexShrink: 0, fontVariantNumeric: 'tabular-nums' }">
{{ toFaDigits(groupCount(g)) }}
</a-typography-text>
</a-flex>
</a-checkbox>
</a-flex>
<a-empty
v-else
:image="AEmpty.PRESENTED_IMAGE_SIMPLE"
:description="groupQuery ? 'گروهی با این نام نیست.' : 'گروهی ثبت نشده است.'"
/>
<i class="dot" :style="{ background: groupSwatch(g.color).fg }" />
<span class="lbl">{{ g.name }}</span>
<em>{{ toFaDigits(groupCount(g)) }}</em>
</label>
</li>
</ul>
<p v-else class="empty">{{ groupQuery ? 'گروهی با این نام نیست.' : 'گروهی ثبت نشده است.' }}</p>
</section>
<template v-if="isPeople">
<section v-if="sourceStats.length" class="sec">
<h4>
منبع
<span v-if="draft.sources.length" class="sel">{{ toFaDigits(draft.sources.length) }} انتخاب</span>
</h4>
<ul class="checks">
<li v-for="row in sourceStats" :key="row.source">
<label class="check">
<input
type="checkbox"
:checked="draft.sources.includes(row.source)"
@change="toggle(draft.sources, row.source)"
<template v-if="sourceStats.length">
<a-divider :style="{ margin: 0 }" />
<section>
<a-flex align="center" :gap="token.marginXS" :style="{ marginBottom: `${token.marginXS}px` }">
<a-typography-text type="secondary">منبع</a-typography-text>
<a-badge
v-if="draft.sources.length"
:count="`${toFaDigits(draft.sources.length)} انتخاب`"
:number-style="countBadgeStyle"
:overflow-count="Number.MAX_SAFE_INTEGER"
/>
<span class="lbl">{{ row.label }}</span>
<em>{{ toFaDigits(row.count) }}</em>
</label>
</li>
</ul>
</a-flex>
<a-flex vertical :gap="token.marginXXS">
<a-checkbox
v-for="row in sourceStats"
:key="row.source"
:checked="draft.sources.includes(row.source)"
@change="(e) => onCheckboxChange(draft.sources, row.source, e)"
>
<a-flex align="center" :gap="token.marginXS" justify="space-between" :style="{ width: '100%' }">
<span>{{ row.label }}</span>
<a-typography-text type="secondary" :style="{ fontVariantNumeric: 'tabular-nums' }">
{{ toFaDigits(row.count) }}
</a-typography-text>
</a-flex>
</a-checkbox>
</a-flex>
</section>
</template>
<section class="sec">
<h4>وضعیت مشتری</h4>
<div class="pills">
<button
<a-divider :style="{ margin: 0 }" />
<section>
<a-flex align="center" :gap="token.marginXS" :style="{ marginBottom: `${token.marginXS}px` }">
<a-typography-text type="secondary">وضعیت مشتری</a-typography-text>
<a-badge
v-if="draft.moods.length"
:count="`${toFaDigits(draft.moods.length)} انتخاب`"
:number-style="countBadgeStyle"
:overflow-count="Number.MAX_SAFE_INTEGER"
/>
</a-flex>
<a-flex wrap="wrap" :gap="token.marginXS" role="group" aria-label="وضعیت مشتری">
<a-button
v-for="m in PERSON_MOODS"
:key="m"
type="button"
class="pill"
:class="{ on: draft.moods.includes(m) }"
@click="toggle(draft.moods, m)"
:type="optionBtnType(draft.moods.includes(m))"
:aria-pressed="draft.moods.includes(m)"
@click="onCheckableChange(draft.moods, m, !draft.moods.includes(m))"
>
{{ PERSON_MOOD_LABELS[m] }}
</button>
</div>
</a-button>
</a-flex>
</section>
<section class="sec">
<h4>
سابقه فعالیت
<span v-if="draft.activityExperiences.length" class="sel">
{{ toFaDigits(draft.activityExperiences.length) }} انتخاب
</span>
</h4>
<div class="pills">
<button
<a-divider :style="{ margin: 0 }" />
<section>
<a-flex align="center" :gap="token.marginXS" :style="{ marginBottom: `${token.marginXS}px` }">
<a-typography-text type="secondary">سابقه فعالیت</a-typography-text>
<a-badge
v-if="draft.activityExperiences.length"
:count="`${toFaDigits(draft.activityExperiences.length)} انتخاب`"
:number-style="countBadgeStyle"
:overflow-count="Number.MAX_SAFE_INTEGER"
/>
</a-flex>
<a-flex wrap="wrap" :gap="token.marginXS" role="group" aria-label="سابقه فعالیت">
<a-button
v-for="item in ACTIVITY_EXPERIENCE_OPTIONS"
:key="item"
type="button"
class="pill"
:class="{ on: draft.activityExperiences.includes(item) }"
@click="toggle(draft.activityExperiences, item)"
:type="optionBtnType(draft.activityExperiences.includes(item))"
:aria-pressed="draft.activityExperiences.includes(item)"
@click="onCheckableChange(draft.activityExperiences, item, !draft.activityExperiences.includes(item))"
>
{{ item }}
</button>
</div>
</a-button>
</a-flex>
</section>
<section v-if="canBehavior" class="sec">
<h4>تیپ DISC</h4>
<div class="pills">
<button
<template v-if="canBehavior">
<a-divider :style="{ margin: 0 }" />
<section>
<a-typography-text type="secondary" :style="{ display: 'block', marginBottom: `${token.marginXS}px` }">
تیپ DISC
</a-typography-text>
<a-flex wrap="wrap" :gap="token.marginXS" role="group" aria-label="تیپ DISC">
<a-button
v-for="t in DISC_TYPES"
:key="t"
type="button"
class="pill"
:class="{ on: draft.disc === t }"
:type="optionBtnType(draft.disc === t)"
:aria-pressed="draft.disc === t"
@click="draft.disc = draft.disc === t ? '' : t"
>
{{ t }}
</button>
</div>
</a-button>
</a-flex>
</section>
</template>
</template>
</a-flex>
</div>
<footer class="panel-foot">
<UiButton variant="ghost" size="sm" @click="emit('close')">انصراف</UiButton>
<UiButton variant="primary" size="sm" @click="apply">
اعمال<template v-if="draftCount"> ({{ toFaDigits(draftCount) }})</template>
</UiButton>
</footer>
<a-flex :justify="sheet ? 'stretch' : 'flex-end'" :gap="token.marginXS" :style="footStyle">
<a-button :block="sheet" @click="emit('close')">انصراف</a-button>
<a-button type="primary" :block="sheet" @click="apply">
اعمال
<template v-if="draftCount"> ({{ toFaDigits(draftCount) }})</template>
</a-button>
</a-flex>
</div>
</Teleport>
</template>
<style scoped>
.panel {
position: absolute;
inset-inline-end: 0;
top: calc(100% + 6px);
z-index: 20;
width: min(22rem, calc(100vw - 1.5rem));
background: #fff;
border: 1px solid var(--line);
border-radius: 12px;
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
/* فقط جانمایی شیت/پاپ‌اور؛ ظاهر از توکن Ant است */
.contacts-filter-panel {
display: flex;
flex-direction: column;
max-height: min(72vh, 36rem);
}
.panel-head,
.panel-foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
padding: 0.7rem 0.9rem;
}
.panel-head {
border-bottom: 1px solid var(--line);
}
.facet-hint {
margin: 0;
padding: 0.35rem 0.9rem 0.55rem;
font-size: var(--fs-sm);
color: #64748b;
line-height: 1.45;
border-bottom: 1px solid var(--line);
}
.panel-foot {
border-top: 1px solid var(--line);
justify-content: flex-end;
}
.link {
border: 0;
background: none;
color: var(--accent, #0f766e);
font: inherit;
font-size: var(--fs-sm);
cursor: pointer;
padding: 0;
}
.link:disabled {
color: #cbd5e1;
cursor: default;
}
.panel-body {
overflow-y: auto;
padding: 0.35rem 0.9rem 0.6rem;
}
.sec {
padding: 0.55rem 0;
}
.sec + .sec {
border-top: 1px dashed var(--line);
}
.sec h4 {
margin: 0 0 0.45rem;
font-size: var(--fs-sm);
color: var(--ink);
display: flex;
align-items: center;
gap: 0.4rem;
}
.sel {
font-weight: 500;
font-size: 0.72rem;
color: #0f766e;
background: #ccfbf1;
border-radius: 999px;
padding: 0.05rem 0.45rem;
}
.find {
display: flex;
align-items: center;
gap: 0.35rem;
border: 1px solid var(--line);
border-radius: 8px;
padding: 0 0.55rem;
height: 2rem;
margin-bottom: 0.4rem;
color: var(--muted);
}
.find input {
flex: 1;
min-width: 0;
border: 0;
outline: none;
background: transparent;
font: inherit;
font-size: var(--fs-sm);
}
.checks {
list-style: none;
margin: 0;
padding: 0;
max-height: 13rem;
overflow-y: auto;
}
.check {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.32rem 0.35rem;
border-radius: 6px;
cursor: pointer;
font-size: var(--fs-sm);
}
.check:hover {
background: var(--surface-subtle, #f8fafc);
}
.check input {
accent-color: #14b8a6;
margin: 0;
}
.dot {
width: 0.55rem;
height: 0.55rem;
border-radius: 50%;
flex-shrink: 0;
}
.lbl {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.check em {
font-style: normal;
font-size: 0.75rem;
color: #94a3b8;
}
.empty {
margin: 0;
font-size: 0.8rem;
color: #94a3b8;
}
.pills {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
}
.pill {
border: 1px solid var(--line);
background: #fff;
border-radius: 999px;
padding: 0.25rem 0.7rem;
font: inherit;
font-size: 0.8rem;
color: var(--ink-secondary);
cursor: pointer;
}
.pill.on {
border-color: #14b8a6;
background: #f0fdfa;
color: #0f766e;
font-weight: 600;
}
/* ===== اکشن‌شیت موبایل ===== */
.sheet-dim {
.contacts-filter-panel.portaled {
position: fixed;
inset: 0;
z-index: 1000;
background: rgba(15, 23, 42, 0.4);
animation: dim-in 0.18s ease-out;
inset: auto;
}
.panel.sheet {
.contacts-filter-panel.sheet {
position: fixed;
inset: auto 0 0 0;
top: auto;
z-index: 1001;
width: 100%;
max-height: 85vh;
border: 0;
border-radius: 16px 16px 0 0;
box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.18);
padding-bottom: env(safe-area-inset-bottom, 0);
animation: sheet-up 0.22s ease-out;
}
.grip {
display: block;
width: 2.5rem;
height: 4px;
margin: 0.5rem auto 0;
border-radius: 999px;
background: #cbd5e1;
}
.panel.sheet .panel-head {
padding-top: 0.5rem;
}
.panel.sheet .checks {
max-height: none;
}
.panel.sheet .check {
padding-block: 0.5rem;
}
.panel.sheet .pill {
padding: 0.4rem 0.85rem;
}
.panel.sheet .panel-foot > * {
flex: 1 1 0;
justify-content: center;
}
@keyframes sheet-up {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
@keyframes dim-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
-13
View File
@@ -16,7 +16,6 @@ type ItemIcon = 'user' | 'building' | 'dollar' | 'calendar-plus' | 'document';
const items: Array<{
key: string;
title: string;
desc: string;
icon: ItemIcon;
tone: string;
to: RouteLocationRaw;
@@ -24,7 +23,6 @@ const items: Array<{
{
key: 'person',
title: 'افزودن شخص',
desc: 'مخاطب جدید را ثبت کنید',
icon: 'user',
tone: 'person',
to: { name: 'person-new' },
@@ -32,7 +30,6 @@ const items: Array<{
{
key: 'company',
title: 'افزودن شرکت',
desc: 'شرکت یا سازمان جدید اضافه کنید',
icon: 'building',
tone: 'company',
to: { name: 'company-new' },
@@ -40,7 +37,6 @@ const items: Array<{
{
key: 'deal',
title: 'افزودن معامله',
desc: 'فرصت یا معامله جدید ایجاد کنید',
icon: 'dollar',
tone: 'deal',
to: { name: 'deal-new' },
@@ -48,7 +44,6 @@ const items: Array<{
{
key: 'activity',
title: 'افزودن فعالیت',
desc: 'تماس، جلسه، ایمیل و ... ثبت کنید',
icon: 'calendar-plus',
tone: 'activity',
to: { name: 'activity-new' },
@@ -56,7 +51,6 @@ const items: Array<{
{
key: 'note',
title: 'افزودن کارت (یادداشت)',
desc: 'یادداشت یا کارت جدید ایجاد کنید',
icon: 'document',
tone: 'note',
to: { name: 'notes' },
@@ -311,7 +305,6 @@ onBeforeUnmount(() => {
</span>
<span class="copy">
<strong>{{ item.title }}</strong>
<small>{{ item.desc }}</small>
</span>
</button>
</div>
@@ -547,12 +540,6 @@ onBeforeUnmount(() => {
line-height: 1.2;
}
.copy small {
font-size: var(--fs-xs);
color: var(--muted);
line-height: 1.3;
}
.fab {
--fab-ease: cubic-bezier(0.22, 1, 0.36, 1);
position: fixed;
@@ -375,7 +375,7 @@ function removeBranch(lane: BranchLane) {
</script>
<template>
<div class="canvas-shell">
<div class="canvas-shell" data-tour="automations-canvas">
<div
ref="viewportRef"
class="canvas"
@@ -391,6 +391,7 @@ function removeBranch(lane: BranchLane) {
<div class="flow">
<a-button
class="node trigger"
data-tour="automations-trigger"
type="text"
:class="{ on: selected === 'trigger' }"
@click="emit('select', 'trigger')"
@@ -53,7 +53,6 @@ onUnmounted(() => {
</button>
<h1>{{ hub.title }}</h1>
</div>
<p>{{ hub.desc }}</p>
</div>
<span class="head-ico" :class="hub.tint" aria-hidden="true">
<UiIcon :name="hub.icon" :size="20" />
@@ -77,7 +76,6 @@ onUnmounted(() => {
<UiIcon :name="card.icon" :size="16" />
</span>
</span>
<span class="card-desc">{{ card.desc }}</span>
</button>
</div>
@@ -158,12 +156,6 @@ onUnmounted(() => {
transform: none;
}
.copy p {
margin: 0.15rem 0 0;
color: #94a3b8;
font-size: 0.75rem;
}
.head-ico,
.card-ico {
display: grid;
@@ -225,16 +217,6 @@ onUnmounted(() => {
color: #0f172a;
}
.card-desc {
color: #94a3b8;
font-size: 0.72rem;
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.go {
transform: scaleX(-1);
color: #94a3b8;
+95 -10
View File
@@ -4,7 +4,7 @@
*
* چهار ردیف ثابت؛ هر صفحه فقط ردیف‌هایی را که لازم دارد روشن می‌کند:
* ۱. عنوان و اکشن‌ها — همیشه: آیکن + عنوان + شمارنده | «⋯» + اکشن فرعی + یک دکمهٔ اصلی
* ۲. تب‌ها — فقط با prop `tabs`
* ۲. تب‌ها — فقط با prop `tabs` (پیش‌فرض بعد از عنوان؛ با `tabsAfterChips` زیر چیپ‌ها)
* ۳. نوار ابزار — جستجو → سلکت‌های سریع → «فیلتر» → ذخیره‌شده | ستون‌ها → نمای نمایش
* ۳ب. ردیف چیپ — اسلات chips (FilterChips فیلترها) | اسلات chips-end (مرتب‌سازی چیپی)
* ۴. فیلترهای فعال — فقط وقتی `activeFilters` خالی نیست
@@ -36,6 +36,7 @@ import {
FilterOutlined,
MoreOutlined,
PlusOutlined,
QuestionCircleOutlined,
SearchOutlined,
} from '@/icons/ant-bridge';
import type {
@@ -62,11 +63,19 @@ const props = withDefaults(
primaryIcon?: Component;
primaryDisabled?: boolean;
primaryLoading?: boolean;
/** دکمهٔ راهنما / پخش مجدد تور آموزشی صفحه */
tourable?: boolean;
/** آیتم‌های منوی «⋯» */
menuItems?: PageHeaderMenuItem[];
/* ردیف ۲ */
tabs?: PageHeaderTab[];
/**
* جای تب‌ها:
* - false (پیش‌فرض): بعد از عنوان، بالای نوار ابزار — مخاطبین و بقیه
* - true: زیر ردیف چیپ — فقط فعالیت‌ها
*/
tabsAfterChips?: boolean;
/* ردیف ۳ */
searchable?: boolean;
@@ -92,8 +101,10 @@ const props = withDefaults(
primaryIcon: undefined,
primaryDisabled: false,
primaryLoading: false,
tourable: false,
menuItems: () => [],
tabs: () => [],
tabsAfterChips: false,
searchable: false,
searchPlaceholder: 'جستجو…',
filterable: false,
@@ -109,6 +120,7 @@ const emit = defineEmits<{
primary: [];
back: [];
menu: [key: string];
tour: [];
filters: [];
searchSubmit: [value: string];
removeFilter: [key: string];
@@ -141,7 +153,12 @@ narrowMq?.addEventListener('change', onNarrowChange);
onBeforeUnmount(() => narrowMq?.removeEventListener('change', onNarrowChange));
const hasActions = computed(
() => props.menuItems.length > 0 || !!props.primaryLabel || !!slots.actions || !!slots.primary,
() =>
props.menuItems.length > 0 ||
!!props.primaryLabel ||
props.tourable ||
!!slots.actions ||
!!slots.primary,
);
/* ---------- layout (همه از توکن) ---------- */
@@ -166,16 +183,20 @@ const chipRowStyle = computed(() => {
const t = token.value;
// زیر نوار ابزار: فقط پدینگ پایین؛ اگر نوار ابزار نباشد خودش ردیف کامل است
if (hasToolbar.value) return { padding: `0 ${t.paddingMD}px ${t.paddingSM}px` };
const tabsAbove = hasTabs.value && !props.tabsAfterChips;
return {
padding: rowPad.value,
borderTop: hasTabs.value ? undefined : `${t.lineWidth}px ${t.lineType} ${t.colorBorderSecondary}`,
borderTop: tabsAbove ? undefined : `${t.lineWidth}px ${t.lineType} ${t.colorBorderSecondary}`,
};
});
const hasChips = computed(() => props.activeFilters.length > 0);
/** تب‌ها آخرین ردیف کارت‌اند ← خط زیر نوار تب لازم نیست (بوردر کارت هست) */
const tabsAreLast = computed(() => !hasToolbar.value && !hasChipRow.value && !hasChips.value);
const tabsAreLast = computed(() => {
if (props.tabsAfterChips) return !hasChips.value;
return !hasToolbar.value && !hasChipRow.value && !hasChips.value;
});
const tabsTheme = computed(() =>
tabsAreLast.value
@@ -186,10 +207,16 @@ const tabsTheme = computed(() =>
const toolbarStyle = computed(() => ({
padding: rowPad.value,
// بدون ردیف تب، خط جداکننده را خود نوار ابزار می‌کشد
borderTop: hasTabs.value ? undefined : `${token.value.lineWidth}px ${token.value.lineType} ${token.value.colorBorderSecondary}`,
// وقتی تب‌ها بالای نوار ابزارند، جداکننده را خود تب می‌کشد
borderTop:
hasTabs.value && !props.tabsAfterChips
? undefined
: `${token.value.lineWidth}px ${token.value.lineType} ${token.value.colorBorderSecondary}`,
}));
const showTabsAbove = computed(() => hasTabs.value && !props.tabsAfterChips);
const showTabsBelow = computed(() => hasTabs.value && props.tabsAfterChips);
const chipsStyle = computed(() => ({
padding: `0 ${token.value.paddingMD}px ${token.value.paddingSM}px`,
}));
@@ -322,8 +349,19 @@ function goBack() {
<!-- a-flex نه a-space: Space تا بعد از mount از gap استفاده نمی‌کند و فریم اول پرش دارد -->
<a-flex v-if="hasActions" align="center" wrap="wrap" :gap="token.marginXS">
<a-button
v-if="tourable"
data-tour="page-tour-help"
aria-label="راهنمای این صفحه"
title="راهنمای این صفحه"
@click="emit('tour')"
>
<template #icon><QuestionCircleOutlined /></template>
راهنما
</a-button>
<a-dropdown v-if="menuItems.length" :trigger="['click']" placement="bottomLeft">
<a-button aria-label="اکشن‌های بیشتر" title="بیشتر">
<a-button data-tour="page-tour-more" aria-label="اکشن‌های بیشتر" title="بیشتر">
<template #icon><MoreOutlined /></template>
</a-button>
<template #overlay>
@@ -337,6 +375,7 @@ function goBack() {
<slot name="primary">
<a-button
v-if="primaryLabel"
data-tour="page-tour-create"
type="primary"
:disabled="primaryDisabled"
:loading="primaryLoading"
@@ -349,14 +388,15 @@ function goBack() {
</a-flex>
</a-flex>
<!-- ۲ · تب‌ها -->
<!-- ۲ · تب‌ها (پیش‌فرض بعد از عنوان) -->
<!--
وقتی تب‌ها آخرین ردیف کارت‌اند، خط زیر نوار تب با بوردر کارت دوتا می‌شود؛
رنگ خط تب را فقط برای همین Tabs شفاف می‌کنیم (توکن کامپوننت، نه CSS).
-->
<!-- direction صریح: پیش‌فرض prop در ConfigProvider «ltr» است و از والد ارث نمی‌برد؛
بدون آن تب‌ها LTR حساب می‌شوند (جای ink-bar می‌پرد و اسکرول تب‌ها برعکس می‌شود) -->
<a-config-provider v-if="hasTabs" direction="rtl" :theme="tabsTheme">
<div v-if="showTabsAbove" data-tour="page-tour-tabs">
<a-config-provider direction="rtl" :theme="tabsTheme">
<a-tabs
v-model:activeKey="activeTab"
:tab-bar-style="{ margin: 0, paddingInline: `${token.paddingMD}px` }"
@@ -377,6 +417,7 @@ function goBack() {
</a-tab-pane>
</a-tabs>
</a-config-provider>
</div>
<!-- ۳ · نوار ابزار -->
<a-flex
@@ -392,6 +433,7 @@ function goBack() {
v-if="searchable"
v-model:value="search"
allow-clear
data-tour="page-tour-search"
:placeholder="searchPlaceholder"
:style="{ flex: '1 1 220px', minWidth: '200px', maxWidth: '320px' }"
@press-enter="emit('searchSubmit', search)"
@@ -410,6 +452,7 @@ function goBack() {
<a-button
v-if="filterable"
data-tour="page-tour-filter"
:type="filterCount ? 'primary' : 'default'"
:ghost="!!filterCount"
@click="emit('filters')"
@@ -425,7 +468,13 @@ function goBack() {
</a-button>
<!-- SavedFiltersBar compact -->
<div
v-if="$slots['saved-filters']"
data-tour="page-tour-saved-filters"
:style="{ display: 'inline-flex', minWidth: 0, maxWidth: '100%' }"
>
<slot name="saved-filters" />
</div>
</a-flex>
<a-flex
@@ -435,9 +484,20 @@ function goBack() {
:gap="token.marginXS"
>
<!-- تنظیمات نما: ستون‌ها (مرتب‌سازی چیپی است و در ردیف چیپ می‌آید) -->
<div
v-if="$slots['toolbar-end']"
data-tour="page-tour-columns"
:style="{ display: 'inline-flex', alignItems: 'center' }"
>
<slot name="toolbar-end" />
</div>
<a-divider v-if="$slots['toolbar-end'] && viewOptions.length" type="vertical" :style="{ margin: 0 }" />
<a-segmented v-if="viewOptions.length" v-model:value="view" :options="segOptions">
<a-segmented
v-if="viewOptions.length"
v-model:value="view"
data-tour="page-tour-view"
:options="segOptions"
>
<template #label="{ payload }">
<span :title="payload.label" :aria-label="payload.label">
<component :is="payload.icon" />
@@ -464,6 +524,31 @@ function goBack() {
</a-flex>
</a-flex>
<!-- تب‌ها زیر چیپ‌ها — فقط با tabsAfterChips (فعلاً فعالیت‌ها) -->
<div v-if="showTabsBelow" data-tour="page-tour-tabs">
<a-config-provider direction="rtl" :theme="tabsTheme">
<a-tabs
v-model:activeKey="activeTab"
:tab-bar-style="{ margin: 0, paddingInline: `${token.paddingMD}px` }"
>
<a-tab-pane v-for="tab in tabs" :key="tab.key" :disabled="tab.disabled">
<template #tab>
<a-flex align="center" :gap="token.marginXXS">
<component :is="tab.icon" v-if="tab.icon" :style="{ margin: 0 }" />
<span>{{ tab.label }}</span>
<a-badge
v-if="tab.count != null"
:count="fa(tab.count)"
:number-style="countStyle(tabCountKind(tab))"
:overflow-count="Number.MAX_SAFE_INTEGER"
/>
</a-flex>
</template>
</a-tab-pane>
</a-tabs>
</a-config-provider>
</div>
<!-- ۴ · فیلترهای فعال -->
<a-flex v-if="hasChips" align="center" wrap="wrap" :gap="token.marginXS" :style="chipsStyle">
<a-tag
@@ -33,6 +33,8 @@ const props = withDefaults(
primaryLabel?: string;
/** آیتم‌های منوی «⋯» (خروجی/ورود اکسل و…) */
menuItems?: PageHeaderMenuItem[];
/** دکمهٔ راهنما / تور آموزشی */
tourable?: boolean;
}>(),
{
canCreate: false,
@@ -43,6 +45,7 @@ const props = withDefaults(
count: undefined,
primaryLabel: undefined,
menuItems: () => [],
tourable: false,
},
);
@@ -50,6 +53,7 @@ const emit = defineEmits<{
create: [];
primary: [];
menu: [key: string];
tour: [];
}>();
const viewMode = defineModel<PipelineViewMode>('viewMode', { required: true });
@@ -111,6 +115,7 @@ const amountMaxNum = computed({
:count="count"
:primary-label="primaryLabel"
:menu-items="menuItems"
:tourable="tourable"
searchable
search-placeholder="جستجو در معاملات…"
v-model:search="search"
@@ -119,10 +124,12 @@ const amountMaxNum = computed({
@update:view="onView"
@primary="emit('primary')"
@menu="(key) => emit('menu', key)"
@tour="emit('tour')"
>
<!-- انتخاب مسیر: زمینهٔ صفحه، نه فیلتر ← کنار عنوان -->
<template #title-extra>
<a-select
data-tour="sales-pipeline"
:value="selectedPipelineId"
:options="pipelineSelectOptions"
:style="{ width: '180px' }"
@@ -171,7 +171,7 @@ function onMenuClick({ key }: { key: string | number }) {
</a-space>
</a-flex>
<a-space :size="8" @click.stop>
<a-space data-tour="routines-actions" :size="8" @click.stop>
<a-space v-if="showAssignee && task.assignee" :size="6">
<UserAvatar :name="task.assignee.fullName" :user-id="task.assignee.id" :size="26" />
<a-typography-text type="secondary">{{ task.assignee.fullName }}</a-typography-text>
+73 -7
View File
@@ -12,6 +12,7 @@ import OrgSwitcher from '@/components/OrgSwitcher.vue';
import NavHubPanel from '@/components/nav/NavHubPanel.vue';
import GamificationToaster from '@/components/gamification/GamificationToaster.vue';
import SmsHeaderWallet from '@/components/SmsHeaderWallet.vue';
import { PageTourHost } from '@/tours';
import { NAV_HUBS, type NavHubDef, type NavHubKey } from '@/lib/nav-hubs';
import {
brand,
@@ -308,7 +309,6 @@ const openHub = computed<NavHubDef | null>(() => {
to: '/leads',
hub: 'leads',
title: 'لیدها',
desc: 'مخاطبین بالقوه قبل از تبدیل به مشتری',
icon: 'user-plus',
tint: 'sky',
module: 'leads',
@@ -361,6 +361,7 @@ const profileSecondary = computed(() => {
const roleUsers = ref<OrgUserDto[]>([]);
const roleBusy = ref(false);
const roleError = ref('');
const roleUsersQuery = ref('');
/** سوئیچ نقش فقط برای مدیر/مالک همین محیط (یا وقتی مالک در حال مشاهده است) */
const canSwitchRoles = computed(
@@ -388,6 +389,18 @@ const sortedRoleUsers = computed(() => {
});
});
const roleSearchVisible = computed(() => sortedRoleUsers.value.length > 5);
const filteredRoleUsers = computed(() => {
const q = roleUsersQuery.value.trim().toLowerCase();
if (!q) return sortedRoleUsers.value;
return sortedRoleUsers.value.filter((user) => {
const label = roleUserLabel(user).toLowerCase();
const name = user.fullName.toLowerCase();
return label.includes(q) || name.includes(q);
});
});
async function loadRoleUsers() {
if (!canSwitchRoles.value) {
roleUsers.value = [];
@@ -423,6 +436,7 @@ async function switchRoleUser(user: OrgUserDto) {
function closeUserMenu() {
userMenuOpen.value = false;
roleError.value = '';
roleUsersQuery.value = '';
}
function closeOrgSwitcher() {
@@ -597,7 +611,7 @@ async function loadActivityBadge() {
const { data } = await api.get<ActivitySummaryDto>('/activities/summary', {
params: { desk: 'mine' },
});
activityBadge.value = data.todayCount;
activityBadge.value = (data.todayCount ?? 0) + (data.overdueCount ?? 0);
} catch {
activityBadge.value = 0;
}
@@ -703,6 +717,7 @@ onMounted(() => {
void loadChatBadge();
pollTimer = setInterval(() => {
void refreshNotifs();
void loadActivityBadge();
void loadRoutineBadge();
void refreshUnreadTotal().catch(() => undefined);
}, 45000);
@@ -1036,9 +1051,19 @@ onUnmounted(() => {
aria-label="نقش‌ها"
>
<p class="user-role-hint">نقش‌ها</p>
<input
v-if="roleSearchVisible"
v-model="roleUsersQuery"
type="search"
class="user-role-search"
placeholder="جستجوی نقش یا نام…"
aria-label="جستجوی نقش"
@click.stop
@keydown.stop
/>
<div class="user-role-scroll">
<button
v-for="user in sortedRoleUsers"
v-for="user in filteredRoleUsers"
:key="user.id"
type="button"
class="user-role-item"
@@ -1066,6 +1091,9 @@ onUnmounted(() => {
:size="15"
/>
</button>
<p v-if="roleSearchVisible && !filteredRoleUsers.length" class="user-role-empty">
موردی پیدا نشد
</p>
</div>
</div>
<p v-if="roleError" class="user-role-err">{{ roleError }}</p>
@@ -1270,6 +1298,7 @@ onUnmounted(() => {
<main class="content">
<RouterView />
<GamificationToaster v-if="moduleAllowed('gamification')" />
<PageTourHost />
</main>
</div>
@@ -2034,13 +2063,13 @@ onUnmounted(() => {
--ws-tab-bar: #fff;
--ws-tab-active: var(--accent-soft, #d0ebe8);
--ws-tab-active-ink: var(--accent, #10897d);
--ws-tab-radius: 10px;
--ws-tab-radius: 8px;
display: block;
box-sizing: border-box;
flex: 0 0 auto;
min-width: 0;
width: 100%;
padding: 6px 16px 0;
padding: 4px 16px 0;
/* same chrome as .desktop-topbar */
overflow: visible;
background: #fff;
@@ -2070,7 +2099,10 @@ onUnmounted(() => {
.workspace-tabs :deep(.ant-tabs-tab) {
position: relative;
margin: 0 2px !important;
padding: 8px 12px !important;
padding: 0 10px !important;
height: 32px !important;
min-height: 32px !important;
line-height: 32px !important;
background: transparent !important;
border: 1px solid transparent !important;
border-radius: var(--ws-tab-radius) var(--ws-tab-radius) 0 0 !important;
@@ -2110,8 +2142,9 @@ onUnmounted(() => {
}
.workspace-tabs :deep(.ant-tabs-tab .ant-tabs-tab-remove) {
margin-inline-start: 6px;
margin-inline-start: 4px;
margin-inline-end: 0;
padding: 0 !important;
color: inherit;
opacity: 0.55;
}
@@ -3191,6 +3224,39 @@ onUnmounted(() => {
color: #94a3b8;
}
.user-role-search {
width: 100%;
box-sizing: border-box;
margin: 0 0 0.2rem;
padding: 0.4rem 0.55rem;
border: 1px solid #e2e8f0;
border-radius: 10px;
background: #f8fafc;
color: #0f172a;
font: inherit;
font-size: 0.78rem;
outline: none;
}
.user-role-search:focus {
border-color: #14b8a6;
background: #fff;
box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}
.user-role-search::-webkit-search-cancel-button {
cursor: pointer;
}
.user-role-empty {
margin: 0;
padding: 0.55rem 0.5rem;
font-size: 0.75rem;
font-weight: 600;
color: #94a3b8;
text-align: center;
}
.user-role-scroll {
display: grid;
gap: 0.15rem;
-50
View File
@@ -44,7 +44,6 @@ export type NavHubTint = 'mint' | 'violet' | 'peach' | 'sky' | 'rose' | 'amber';
export type NavHubCard = {
to: string;
title: string;
desc: string;
icon: NavIconName;
tint: NavHubTint;
admin?: boolean;
@@ -66,7 +65,6 @@ export type NavHubShortcut = {
export type NavHubDef = {
key: NavHubKey;
title: string;
desc: string;
icon: NavIconName;
tint: NavHubTint;
cards: NavHubCard[];
@@ -77,7 +75,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
key: 'customers',
title: 'مشتریان',
desc: 'اشخاص، شرکت‌ها و پرونده‌های ارتباطی',
icon: 'users',
tint: 'mint',
shortcuts: [
@@ -88,7 +85,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/contacts',
title: 'اشخاص',
desc: 'مخاطبان حقیقی و پرونده‌های مشتری',
icon: 'user',
tint: 'mint',
module: 'customers',
@@ -96,7 +92,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/contacts?tab=companies',
title: 'شرکت‌ها',
desc: 'سازمان‌ها و مشتریان حقوقی',
icon: 'building',
tint: 'violet',
module: 'customers',
@@ -104,7 +99,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/account-balances',
title: 'تعیین محدوده مانده',
desc: 'بازه مانده مالی و وزنی برای کاریز مطالبات',
icon: 'dollar',
tint: 'amber',
admin: true,
@@ -115,7 +109,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
key: 'leads',
title: 'لیدها',
desc: 'مخاطبین بالقوه قبل از تبدیل به مشتری',
icon: 'user-plus',
tint: 'sky',
shortcuts: [
@@ -126,7 +119,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/leads',
title: 'فهرست لیدها',
desc: 'جستجو، فیلتر، تخصیص و ایمپورت اکسل',
icon: 'users',
tint: 'sky',
module: 'leads',
@@ -134,7 +126,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/leads/board',
title: 'مسیر لیدها',
desc: 'نمای ستونی و حرکت بین مراحل',
icon: 'filter',
tint: 'violet',
module: 'leads',
@@ -142,7 +133,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/lead-stages',
title: 'مراحل و وضعیت‌ها',
desc: 'تعریف وضعیت‌ها و ستون‌های مسیر لید',
icon: 'layers',
tint: 'peach',
admin: true,
@@ -153,7 +143,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
key: 'sales',
title: 'فروش',
desc: 'مدیریت چرخه فروش و درآمد',
icon: 'briefcase',
tint: 'mint',
shortcuts: [
@@ -165,7 +154,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/pipeline',
title: 'مسیر فروش',
desc: 'معاملات و مراحل فروش',
icon: 'filter',
tint: 'mint',
module: 'pipeline',
@@ -173,7 +161,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/pipelines',
title: 'تنظیمات مسیر فروش',
desc: 'مدیریت کاریزها و ادغام مسیرهای فروش',
icon: 'filter',
tint: 'mint',
admin: true,
@@ -182,7 +169,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/products',
title: 'محصولات و خدمات',
desc: 'مدیریت محصولات، قیمت‌ها و موجودی',
icon: 'box',
tint: 'peach',
admin: true,
@@ -191,7 +177,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/invoices',
title: 'فاکتورها',
desc: 'صدور فاکتور و پیگیری پرداخت‌ها',
icon: 'mail',
tint: 'sky',
module: 'invoices',
@@ -199,7 +184,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/quotes',
title: 'پیش‌فاکتورها',
desc: 'پیشنهاد قیمت و پیگیری تایید',
icon: 'document',
tint: 'amber',
module: 'quotes',
@@ -207,7 +191,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/commissions',
title: 'پورسانت',
desc: 'سهم فروشندگان از فاکتورهای صادرشده',
icon: 'dollar',
tint: 'rose',
module: 'commissions',
@@ -215,7 +198,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/sales/forecast',
title: 'هدف و پیش‌بینی',
desc: 'تعیین اهداف و تحلیل عملکرد فروش',
icon: 'target',
tint: 'mint',
module: 'sales_forecast',
@@ -225,7 +207,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
key: 'activities',
title: 'کارها و فعالیت‌ها',
desc: 'میز کار شخصی، ارجاع و پیگیری روزانه',
icon: 'check',
tint: 'sky',
shortcuts: [
@@ -236,7 +217,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/activities',
title: 'میز کار من',
desc: 'وظایف، تماس‌ها و پیگیری‌های جاری',
icon: 'check',
tint: 'mint',
module: 'activities',
@@ -244,7 +224,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/activities/calendar',
title: 'تقویم کارها',
desc: 'نمای روز، هفته و زمان‌بندی',
icon: 'calendar',
tint: 'violet',
module: 'activities',
@@ -254,7 +233,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
key: 'support',
title: 'پشتیبانی',
desc: 'درخواست‌ها و گفتگو با مشتری',
icon: 'chat',
tint: 'peach',
shortcuts: [
@@ -265,7 +243,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/tickets',
title: 'تیکت‌ها',
desc: 'درخواست‌ها و پیام‌های پشتیبانی',
icon: 'chat',
tint: 'peach',
module: 'tickets',
@@ -275,7 +252,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
key: 'automations',
title: 'اتوماسیون',
desc: 'قوانین خودکار برای گردش کار و پیامک',
icon: 'sparkle',
tint: 'violet',
shortcuts: [
@@ -302,7 +278,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/automations',
title: 'اتوماسیون گردش کار',
desc: 'اگر این شد، آن کارها را پشت‌سرهم انجام بده',
icon: 'layers',
tint: 'violet',
admin: true,
@@ -311,7 +286,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/message-automations',
title: 'اتوماسیون پیامک‌ها',
desc: 'پیامک و ناتیف با تأخیر و تکرار',
icon: 'send',
tint: 'sky',
admin: true,
@@ -320,7 +294,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/sms-campaigns',
title: 'پیامک گروهی',
desc: 'ارسال انبوه به مخاطبان انتخاب‌شده',
icon: 'send',
tint: 'mint',
admin: true,
@@ -331,7 +304,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
key: 'tools',
title: 'ابزارها',
desc: 'پروژه، انبار و اسناد مالی',
icon: 'apps-plus',
tint: 'violet',
shortcuts: [
@@ -343,7 +315,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/projects',
title: 'تابلوی پروژه',
desc: 'میز کار تیمی: صف، انجام، بازبینی و ارجاع کارت',
icon: 'flag',
tint: 'violet',
module: 'project_boards',
@@ -351,7 +322,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/inventory',
title: 'انبار',
desc: 'موجودی کالا و گردش داخلی',
icon: 'box',
tint: 'peach',
module: 'inventory',
@@ -359,7 +329,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/cheques',
title: 'چک‌ها',
desc: 'چک‌های دریافتی و پرداختی',
icon: 'document',
tint: 'sky',
module: 'cheques',
@@ -367,7 +336,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/finance',
title: 'مدیریت مالی',
desc: 'صندوق، درآمد و هزینه داخلی',
icon: 'dollar',
tint: 'mint',
module: 'treasury',
@@ -375,7 +343,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/reservations',
title: 'رزرو و نوبت‌دهی',
desc: 'خدمات، اسلات آزاد و ثبت نوبت مشتری',
icon: 'calendar',
tint: 'mint',
module: 'reservations',
@@ -383,7 +350,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/attachments',
title: 'پیوست‌ها',
desc: 'فایل‌های متصل به یادداشت‌ها',
icon: 'document',
tint: 'amber',
module: 'attachments',
@@ -391,7 +357,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/lead-forms',
title: 'فرم‌ساز سرنخ',
desc: 'لینک عمومی، iframe و QR برای جذب سرنخ',
icon: 'document',
tint: 'mint',
admin: true,
@@ -402,7 +367,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
key: 'settings',
title: 'تنظیمات',
desc: 'سازمان، تیم و پیکربندی سیستم',
icon: 'settings',
tint: 'sky',
shortcuts: [
@@ -418,7 +382,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/team#settings-org',
title: 'تنظیمات عمومی',
desc: 'نام سازمان و تنظیمات پایه',
icon: 'building',
tint: 'mint',
module: 'team_settings',
@@ -426,7 +389,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/team#settings-team',
title: 'تیم و نقش‌ها',
desc: 'اعضا، دسترسی و نقش‌ها',
icon: 'users',
tint: 'violet',
module: 'team_settings',
@@ -434,7 +396,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/team#settings-teams',
title: 'تیم‌ها و سطح دسترسی به پرونده‌ها',
desc: 'گروه‌های کاری و سطح دسترسی هر کاربر به پرونده‌ها',
icon: 'users',
tint: 'sky',
module: 'teams',
@@ -443,7 +404,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/pipelines',
title: 'تنظیمات مسیر فروش',
desc: 'مدیریت کاریزها و ادغام مسیرهای فروش',
icon: 'filter',
tint: 'mint',
admin: true,
@@ -452,7 +412,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/audit-logs',
title: 'لاگ فعالیت کاربران',
desc: 'تاریخچه ایجاد، ویرایش و حذف',
icon: 'layers',
tint: 'rose',
module: 'audit_logs',
@@ -461,7 +420,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/deletions',
title: 'تاریخچه کارها',
desc: 'ایجاد، ویرایش و حذف؛ بازگردانی فقط برای حذف‌ها',
icon: 'trash',
tint: 'rose',
ownerOnly: true,
@@ -469,7 +427,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/public-api',
title: 'API و وب‌هوک',
desc: 'کلید عمومی و ارسال رویداد به سرور شما',
icon: 'apps-plus',
tint: 'sky',
module: 'public_api',
@@ -478,7 +435,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/custom-fields',
title: 'فیلدهای سفارشی',
desc: 'فیلدهای اضافه روی پرونده‌ها',
icon: 'pencil',
tint: 'peach',
module: 'custom_fields',
@@ -486,7 +442,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/currencies',
title: 'ارزها',
desc: 'ارز پایه و نرخ تبدیل',
icon: 'dollar',
tint: 'sky',
module: 'currencies',
@@ -494,7 +449,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/tahesab',
title: 'ته‌حساب',
desc: 'اتصال مالی و تنظیمات حسابداری',
icon: 'chart',
tint: 'amber',
module: 'tahesab',
@@ -502,7 +456,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/woocommerce',
title: 'ووکامرس',
desc: 'سفارش فروشگاه به فاکتور و مشتری',
icon: 'box',
tint: 'mint',
module: 'woocommerce',
@@ -511,7 +464,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/montify',
title: 'فروشگاه‌های مونتیفای',
desc: 'اتصال چند فروشگاه: مشتری، سفارش و محصول',
icon: 'box',
tint: 'violet',
module: 'montify',
@@ -520,7 +472,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/voip',
title: 'تلفن سازمانی',
desc: 'ثبت تماس سانترال و اعلان ورودی',
icon: 'phone',
tint: 'sky',
module: 'voip',
@@ -529,7 +480,6 @@ export const NAV_HUBS: NavHubDef[] = [
{
to: '/settings/faq',
title: 'FAQ',
desc: 'پرسش‌های پرتکرار سازمان',
icon: 'lightbulb',
tint: 'rose',
module: 'faq',
-17
View File
@@ -281,8 +281,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'مدیریت مالی',
treasuryDescription:
'دفتر داخلی درآمد، هزینه و موجودی حساب. این بخش جایگزین فاکتور فروش یا حسابداری رسمی نیست.',
},
},
{
@@ -292,7 +290,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'صندوق و حساب‌ها',
treasuryDescription: 'موجودی هر حساب از مانده افتتاحیه و گردش قطعی محاسبه می‌شود.',
},
},
{
@@ -302,7 +299,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'جزئیات حساب',
treasuryDescription: 'گردش قطعی این حساب',
},
},
{
@@ -312,8 +308,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'دریافت‌ها و درآمدها',
treasuryDescription:
'ثبت سند، موجودی را عوض نمی‌کند مگر مبلغ دریافت یا پرداخت واقعی وارد شود.',
},
},
{
@@ -323,8 +317,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'پرداخت‌ها و هزینه‌ها',
treasuryDescription:
'ثبت سند، موجودی را عوض نمی‌کند مگر مبلغ دریافت یا پرداخت واقعی وارد شود.',
},
},
{
@@ -334,8 +326,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'اقساط و مطالبات',
treasuryDescription:
'دریافت هر قسط فقط یک بار وارد حساب می‌شود و مانده همان قسط را کم می‌کند.',
},
},
{
@@ -345,8 +335,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'حقوق و دستمزد',
treasuryDescription:
'تعیین حقوق، پرداخت یکجا یا چندمرحله‌ای، و گزارش دوره‌ها. پرداخت فقط با دسترسی حقوق و دستمزد باز است.',
},
},
{
@@ -356,7 +344,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'درآمد و هزینه تکرارشونده',
treasuryDescription: 'تا تأیید دریافت یا پرداخت، موجودی حساب عوض نمی‌شود.',
},
},
{
@@ -366,8 +353,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'گزارش مالی',
treasuryDescription:
'سود از درآمد، فروش فاکتور و هزینه است. بدهکاران و بستانکاران مانده فاکتور و اسناد باز را یک‌جا نشان می‌دهند.',
},
},
{
@@ -377,7 +362,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'سوابق تغییرات مالی',
treasuryDescription: 'تسویه سند و نشستن وجه در صندوق، با مقدار ثبت‌شده.',
},
},
{
@@ -387,7 +371,6 @@ export const router = createRouter({
meta: {
roles: ['owner', 'admin'] as UserRole[],
treasuryTitle: 'دسته‌بندی',
treasuryDescription: 'دسته‌های درآمد و هزینهٔ همین محیط؛ ساخته و ویرایش فقط از اینجا.',
},
},
],
+66
View File
@@ -0,0 +1,66 @@
<script setup lang="ts">
import { computed } from 'vue';
import { Tour as ATour } from 'ant-design-vue';
import type { TourProps } from 'ant-design-vue';
import { usePageTour } from './usePageTour';
const tour = usePageTour();
const steps = computed(() =>
tour.tourSteps.value.map((step, index, all) => {
const anchor = step.anchor;
const target = !anchor
? () => null
: () => {
const el = tour.resolveTarget(anchor);
return el ?? document.body;
};
return {
title: step.title,
description: step.description,
placement: step.placement,
target,
nextButtonProps: {
children: () => (index === all.length - 1 ? 'پایان' : 'بعدی'),
},
prevButtonProps: {
children: () => 'قبلی',
},
};
}) as TourProps['steps'],
);
const open = computed({
get: () => tour.isOpen.value,
set: (value: boolean) => {
if (!value) tour.skip();
},
});
const current = computed({
get: () => tour.currentStep.value,
set: (value: number) => tour.setCurrent(value),
});
function onClose() {
tour.skip();
}
function onFinish() {
tour.finish();
}
</script>
<template>
<a-tour
v-model:current="current"
v-model:open="open"
:steps="steps"
type="primary"
:mask="{ style: { boxShadow: '0 0 0 9999px rgba(0, 0, 0, 0.45)' } }"
:animated="true"
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
@close="onClose"
@finish="onFinish"
/>
</template>
+388
View File
@@ -0,0 +1,388 @@
import type { TourDef, TourId } from './types';
const customers: TourDef = {
id: 'customers',
steps: [
{
title: 'مشتریان',
description:
'اینجا دفترچهٔ مخاطبین سازمان است: اشخاص حقیقی و شرکت‌ها. از همین صفحه جستجو، فیلتر، ورود اکسل و ساخت مخاطب جدید را انجام می‌دهید.',
},
{
anchor: 'page-tour-tabs',
title: 'اشخاص و شرکت‌ها',
description:
'با این تب‌ها بین مخاطب حقیقی و حقوقی جابه‌جا شوید. هر تب جدول، فیلتر و دکمهٔ ایجاد خودش را دارد.',
placement: 'bottom',
},
{
anchor: 'page-tour-create',
title: 'ساخت مخاطب جدید',
description:
'با دکمهٔ اصلی، کشوی ثبت سریع باز می‌شود. شخص یا شرکت (بسته به تب فعال) را بدون ترک لیست بسازید.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-search',
title: 'جستجو',
description:
'نام، تلفن، ایمیل یا کد را اینجا بنویسید تا فهرست فوری محدود شود. Enter هم جستجو را ثبت می‌کند.',
placement: 'bottom',
},
{
anchor: 'customers-filter',
title: 'فیلتر پیشرفته',
description:
'با فیلتر، مخاطبان را بر اساس گروه، منبع، وضعیت ارتباطی، DISC و سابقهٔ فعالیت جدا کنید. شمارنده روی دکمه تعداد شرط فعال را نشان می‌دهد.',
placement: 'bottom',
},
{
anchor: 'page-tour-saved-filters',
title: 'فیلتر ذخیره‌شده',
description:
'جستجوهای پرتکرار را ذخیره کنید و با یک کلیک برگردانید تا هر بار از صفر فیلتر نسازید.',
placement: 'bottom',
},
{
anchor: 'page-tour-more',
title: 'اکسل و مخاطبین گوشی',
description:
'از منوی سه‌نقطه خروجی اکسل بگیرید، فایل اکسل (از جمله خروجی دیدار) وارد کنید، یا روی موبایل از مخاطبین گوشی ایمپورت کنید.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-columns',
title: 'ستون‌های جدول',
description:
'ستون‌های نمایش‌داده‌شده را کم و زیاد کنید تا فقط اطلاعاتی که برای کار روزمره‌تان لازم است دیده شود.',
placement: 'bottomLeft',
},
{
anchor: 'customers-table',
title: 'فهرست مخاطبین',
description:
'روی هر ردیف بزنید تا پروفایل ۳۶۰ درجه باز شود: تماس‌ها، معاملات، فعالیت‌ها، حس و حال مشتری و خلاصهٔ هوشمند مُنتَکت.',
placement: 'top',
},
{
anchor: 'page-tour-help',
title: 'آمادهٔ کار با مشتریان',
description:
'هر وقت خواستید این راهنما را دوباره ببینید، همین دکمهٔ «راهنما» را بزنید. حالا می‌توانید اولین مخاطب را بسازید یا پرونده‌ای را باز کنید.',
placement: 'bottomLeft',
},
],
};
const leads: TourDef = {
id: 'leads',
steps: [
{
title: 'لیدها',
description:
'لید یعنی مخاطب بالقوه قبل از تبدیل به مشتری کامل. اینجا فهرست، فیلتر پیگیری و تبدیل به مشتری را مدیریت می‌کنید.',
},
{
anchor: 'page-tour-create',
title: 'ثبت لید جدید',
description:
'با دکمهٔ اصلی، لید تازه بسازید: نام/شرکت، موبایل، منبع و مسئول. لیدهای فرم‌ساز وب‌سایت هم همین‌جا ظاهر می‌شوند.',
placement: 'bottomLeft',
},
{
anchor: 'leads-followup',
title: 'فیلتر پیگیری',
description:
'سریع ببینید کدام لیدها قرار امروز، تماس امروز، عقب‌افتاده یا بدون پیگیری هستند تا چیزی از قلم نیفتد.',
placement: 'bottom',
},
{
anchor: 'page-tour-view',
title: 'نمای لیست و بورد',
description:
'بین جدول فاست‌دار و مسیر ستونی (کانبان) جابه‌جا شوید. در بورد می‌توانید کارت را بین مراحل بکشید.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-search',
title: 'جستجو و فیلتر',
description:
'نام، موبایل، شهر یا منبع را جستجو کنید و با فیلترهای پیشرفته لیدهای هدف را جدا کنید.',
placement: 'bottom',
},
{
anchor: 'leads-table',
title: 'جدول لیدها',
description:
'وضعیت، مسئول، آخرین فعالیت و لوگو را در یک نگاه ببینید. از منوی ردیف ویرایش، حذف، لوگو و تبدیل به مشتری در دسترس است.',
placement: 'top',
},
{
anchor: 'page-tour-more',
title: 'اکسل و تنظیمات',
description:
'از منوی بیشتر می‌توانید ورود/خروج اکسل بگیرید و به تنظیمات مراحل لید بروید (معمولاً برای مدیر).',
placement: 'bottomLeft',
},
{
title: 'مسیر لیدها',
description:
'برای کار ستونی، از منوی لیدها «مسیر لیدها» را باز کنید. روی هر لید بزنید تا جزئیات، تاریخچه و دکمهٔ تبدیل به مشتری را ببینید.',
},
{
anchor: 'page-tour-help',
title: 'پایان تور لیدها',
description:
'با همین دکمهٔ راهنما هر زمان این تور را دوباره پخش کنید. حالا یک لید جدید بسازید یا پیگیری‌های امروز را فیلتر کنید.',
placement: 'bottomLeft',
},
],
};
const sales: TourDef = {
id: 'sales',
steps: [
{
title: 'مسیر فروش',
description:
'اینجا کاریز معاملات است. هر ستون یک مرحله فروش است و ارزش ریالی همان مرحله را بالای ستون می‌بینید.',
},
{
anchor: 'sales-pipeline',
title: 'انتخاب مسیر فروش',
description:
'اگر چند کاریز دارید، از اینجا مسیر فعال را عوض کنید یا مسیر جدید بسازید. هر مسیر مراحل و معاملات خودش را دارد.',
placement: 'bottom',
},
{
anchor: 'page-tour-view',
title: 'کانبان یا لیست',
description:
'نمای ستونی برای کشیدن معامله بین مراحل مناسب است؛ نمای لیست برای مرور سریع و فیلترهای جدولی بهتر است.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-search',
title: 'جستجو و مبلغ',
description:
'عنوان یا مشتری را جستجو کنید و در صورت نیاز کف/سقف مبلغ را محدود کنید تا معاملات کلان یا خرد جدا شوند.',
placement: 'bottom',
},
{
anchor: 'sales-board',
title: 'بورد معاملات',
description:
'کارت را بکشید تا مرحله عوض شود. روی کارت بزنید تا جزئیات، محصولات، فعالیت‌ها و پیش‌فاکتور/فاکتور باز شود. معاملات راکد علامت می‌خورند.',
placement: 'top',
},
{
anchor: 'page-tour-create',
title: 'معامله جدید',
description:
'با دکمهٔ اصلی معامله تازه بسازید: مشتری، مبلغ، مرحله، مسئول و همکاران. از معامله می‌توانید پیش‌فاکتور یا فاکتور صادر کنید.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-more',
title: 'تنظیمات و اکسل',
description:
'از منوی بیشتر به تنظیمات مسیر فروش بروید یا ورود/خروج اکسل بگیرید. محصولات، فاکتورها و پیش‌بینی هم از هاب فروش در دسترس‌اند.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-help',
title: 'پایان تور فروش',
description:
'برای پخش دوباره از همین دکمهٔ راهنما استفاده کنید. یک معامله را بین مراحل جابه‌جا کنید یا معامله جدید بسازید.',
placement: 'bottomLeft',
},
],
};
const activities: TourDef = {
id: 'activities',
steps: [
{
title: 'میز کار و فعالیت‌ها',
description:
'اینجا کارهای روزمرهٔ فروش و پیگیری است: تماس، جلسه، وظیفه و انواع سفارشی سازمان شما.',
},
{
anchor: 'activities-desk-filters',
title: 'فیلتر میز کار',
description:
'زمان (امروز، عقب‌افتاده، بعداً)، وضعیت (باز/انجام‌شده) و محدودهٔ میز من یا همه تیم را اینجا تنظیم کنید.',
placement: 'bottom',
},
{
anchor: 'page-tour-create',
title: 'کار جدید',
description:
'فعالیت تازه بسازید: عنوان، نوع، موعد شمسی، مسئول‌ها و اتصال به شخص، شرکت، لید یا معامله.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-view',
title: 'سه نمای نمایش',
description:
'نمای تب (جدول هر مرحله)، نمای ستونی کانبان و میانبر تقویم شمسی. کار را بین ستون‌های کانبان بکشید تا مرحله عوض شود.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-search',
title: 'جستجو و فیلتر',
description:
'عنوان، مشتری، کارشناس یا نوع کار را جستجو کنید و با فیلترهای پیشرفته فهرست را دقیق‌تر کنید.',
placement: 'bottom',
},
{
anchor: 'activities-board',
title: 'لیست و کانبان',
description:
'کارهای هر مرحله اینجاست. روی ردیف بزنید تا جزئیات، یادداشت، ارجاع و پیوست‌ها را ببینید. ستون‌های مرحله را مدیر می‌تواند سفارشی کند.',
placement: 'top',
},
{
anchor: 'page-tour-more',
title: 'اکسل و انواع فعالیت',
description:
'از منوی بیشتر خروجی/ورود اکسل بگیرید یا (اگر دسترسی دارید) انواع فعالیت و فیلدهای اختصاصی را مدیریت کنید.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-help',
title: 'پایان تور فعالیت‌ها',
description:
'با همین دکمهٔ راهنما تور را دوباره ببینید. کار امروز را فیلتر کنید یا یک فعالیت پیگیری جدید بسازید.',
placement: 'bottomLeft',
},
],
};
const routines: TourDef = {
id: 'routines',
steps: [
{
title: 'کارهای روتین',
description:
'روتین‌ها کارهای تکراری روزانه/هفتگی/ماهانه هستند؛ مثل گزارش روزانه یا تماس با تعداد مشخص مشتری.',
},
{
anchor: 'routines-score',
title: 'امتیاز امروز',
description:
'درصد انجام و امتیاز روزانه اینجا دیده می‌شود. انجام به‌موقع در باشگاه امتیازات هم امتیاز می‌دهد.',
placement: 'bottom',
},
{
anchor: 'routines-list',
title: 'کارهای امروز',
description:
'فهرست روتین‌های امروز شماست. روی هر کار بزنید تا پنل جزئیات، راهنما و اتصال به مشتری/لید باز شود.',
placement: 'top',
},
{
anchor: 'routines-actions',
title: 'شروع، تکمیل، موکول',
description:
'وضعیت را عوض کنید: شروع، تکمیل با یادداشت، یا موکول با دلیل. کارهای اجباری بدون انجام درست در امتیاز اثر منفی می‌گذارند.',
placement: 'left',
},
{
anchor: 'page-tour-tabs',
title: 'تب‌های روتین',
description:
'عقب‌افتاده، تقویم، فهرست روتین‌ها، عملکرد من/تیم و مدیریت روتین‌ها از این تب‌ها در دسترس است.',
placement: 'bottom',
},
{
anchor: 'page-tour-help',
title: 'راهنما و کار سریع',
description:
'هر زمان این تور را از همین دکمه دوباره پخش کنید. کار یک‌بارهٔ غیرتکراری را هم می‌توانید از «کار جدید» بسازید.',
placement: 'bottomLeft',
},
{
title: 'پایان تور روتین',
description:
'اول کارهای عقب‌افتاده را ببندید، بعد روتین‌های امروز را کامل کنید تا امتیاز روزانه بالا برود.',
},
],
};
const automations: TourDef = {
id: 'automations',
steps: [
{
title: 'اتوماسیون گردش کار',
description:
'قانون بسازید: اگر رویدادی رخ داد، سیستم خودش اقدام کند — مثل ساخت فعالیت بعد از برنده شدن معامله.',
},
{
anchor: 'automations-list',
title: 'فهرست قوانین',
description:
'همهٔ قوانین اینجاست. با کلید کنار هر قانون آن را فعال یا غیرفعال کنید. قانون در حال ویرایش پررنگ می‌شود.',
placement: 'right',
},
{
anchor: 'page-tour-create',
title: 'قانون جدید',
description:
'قانون تازه بسازید، نام بگذارید و وضعیتش را مشخص کنید. بعد روی بوم محرک و اقدام‌ها را بچینید.',
placement: 'bottomLeft',
},
{
anchor: 'automations-canvas',
title: 'بوم جریان کار',
description:
'گره‌های متصل را مثل فلوچارت ببینید. در نسخهٔ حرفه‌ای می‌توانید شاخهٔ موازی و شرط روی پاسخ فرم هم داشته باشید.',
placement: 'top',
},
{
anchor: 'automations-trigger',
title: 'گره محرک',
description:
'اتفاق شروع را انتخاب کنید: تغییر مرحله، تبدیل لید، موفقیت معامله، ثبت فرم، کلیک لینک پیامک و موارد مشابه.',
placement: 'right',
},
{
anchor: 'automations-inspector',
title: 'تنظیمات گره',
description:
'با انتخاب هر گره، پنل تنظیمات باز می‌شود: نوع اقدام، واگذاری نوبتی، تأخیر زمانی و متغیرهای متن مثل نام مشتری.',
placement: 'left',
},
{
anchor: 'page-tour-more',
title: 'پیامک و کمپین',
description:
'اتوماسیون پیامک رویدادمحور و پیامک گروهی از هاب اتوماسیون در دسترس‌اند؛ برای پیگیری خودکار بعد از ارسال یا کلیک لینک.',
placement: 'bottomLeft',
},
{
anchor: 'page-tour-help',
title: 'پایان تور اتوماسیون',
description:
'با همین دکمهٔ راهنما تور را دوباره ببینید. یک قانون ساده بسازید، فعال کنید و با یک رویداد واقعی تست کنید.',
placement: 'bottomLeft',
},
],
};
const CATALOG: Record<TourId, TourDef> = {
customers,
leads,
sales,
activities,
routines,
automations,
};
export function getTourDef(tourId: TourId): TourDef {
return CATALOG[tourId];
}
export function listTourIds(): TourId[] {
return Object.keys(CATALOG) as TourId[];
}
+6
View File
@@ -0,0 +1,6 @@
export type { TourId, TourDef, TourStepDef } from './types';
export { getTourDef, listTourIds } from './catalog';
export { hasSeenTour, markTourSeen } from './storage';
export { usePageTour } from './usePageTour';
export { useLandingTour } from './useLandingTour';
export { default as PageTourHost } from './PageTourHost.vue';
+15
View File
@@ -0,0 +1,15 @@
import type { TourId } from './types';
function storageKey(userId: string, tourId: TourId): string {
return `mento.tour.${userId}.${tourId}`;
}
export function hasSeenTour(userId: string | null | undefined, tourId: TourId): boolean {
if (!userId || typeof localStorage === 'undefined') return true;
return localStorage.getItem(storageKey(userId, tourId)) === '1';
}
export function markTourSeen(userId: string | null | undefined, tourId: TourId): void {
if (!userId || typeof localStorage === 'undefined') return;
localStorage.setItem(storageKey(userId, tourId), '1');
}
+32
View File
@@ -0,0 +1,32 @@
export type TourId =
| 'customers'
| 'leads'
| 'sales'
| 'activities'
| 'routines'
| 'automations';
export type TourStepDef = {
/** مقدار `data-tour` روی عنصر هدف؛ خالی = گام مرکزی بدون هایلایت */
anchor?: string;
title: string;
description: string;
placement?:
| 'left'
| 'leftTop'
| 'leftBottom'
| 'right'
| 'rightTop'
| 'rightBottom'
| 'top'
| 'topLeft'
| 'topRight'
| 'bottom'
| 'bottomLeft'
| 'bottomRight';
};
export type TourDef = {
id: TourId;
steps: TourStepDef[];
};
+39
View File
@@ -0,0 +1,39 @@
import { nextTick, watch, type Ref, type WatchSource } from 'vue';
import type { TourId } from './types';
import { usePageTour } from './usePageTour';
/**
* Auto-start a page tour once after the landing view finishes its first load.
* Replay via the returned `replay` callback (wire to PageHeader `@tour`).
*/
export function useLandingTour(
tourId: TourId,
loading: WatchSource<boolean> | Ref<boolean>,
opts?: { enabled?: WatchSource<boolean> | Ref<boolean> | (() => boolean) },
) {
const pageTour = usePageTour();
function replay() {
pageTour.replay(tourId);
}
function isEnabled(): boolean {
if (!opts?.enabled) return true;
const src = opts.enabled;
if (typeof src === 'function') return src();
return Boolean((src as Ref<boolean>).value);
}
watch(
loading,
async (busy) => {
if (busy) return;
if (!isEnabled()) return;
await nextTick();
void pageTour.startIfNeeded(tourId);
},
{ immediate: true },
);
return { replay, pageTour };
}
+99
View File
@@ -0,0 +1,99 @@
import { computed, nextTick, ref, shallowRef } from 'vue';
import { useAuthStore } from '@/stores/auth';
import { getTourDef } from './catalog';
import { hasSeenTour, markTourSeen } from './storage';
import type { TourId, TourStepDef } from './types';
const open = ref(false);
const current = ref(0);
const activeTourId = ref<TourId | null>(null);
const steps = shallowRef<TourStepDef[]>([]);
let startToken = 0;
function resolveUserId(): string | null {
return useAuthStore().user?.id ?? null;
}
function loadSteps(tourId: TourId) {
steps.value = getTourDef(tourId).steps;
activeTourId.value = tourId;
current.value = 0;
}
function markActiveSeen() {
const id = activeTourId.value;
if (!id) return;
markTourSeen(resolveUserId(), id);
}
export function usePageTour() {
const isOpen = computed(() => open.value);
const currentStep = computed(() => current.value);
const tourSteps = computed(() => steps.value);
const activeId = computed(() => activeTourId.value);
function close() {
open.value = false;
}
function finish() {
markActiveSeen();
open.value = false;
}
function skip() {
markActiveSeen();
open.value = false;
}
function setCurrent(index: number) {
current.value = Math.max(0, Math.min(index, steps.value.length - 1));
}
function replay(tourId: TourId) {
startToken += 1;
loadSteps(tourId);
open.value = true;
}
async function startIfNeeded(tourId: TourId, opts?: { delayMs?: number }) {
const userId = resolveUserId();
if (!userId) return;
if (hasSeenTour(userId, tourId)) return;
if (open.value) return;
const token = ++startToken;
const delayMs = opts?.delayMs ?? 450;
await nextTick();
if (delayMs > 0) {
await new Promise<void>((resolve) => {
window.setTimeout(resolve, delayMs);
});
}
if (token !== startToken) return;
if (hasSeenTour(userId, tourId)) return;
loadSteps(tourId);
open.value = true;
}
function resolveTarget(anchor?: string): HTMLElement | null {
if (!anchor) return null;
return document.querySelector<HTMLElement>(`[data-tour="${anchor}"]`);
}
return {
isOpen,
currentStep,
tourSteps,
activeId,
close,
finish,
skip,
setCurrent,
replay,
startIfNeeded,
resolveTarget,
};
}
+38 -7
View File
@@ -21,7 +21,14 @@ import {
} from '@/components/ui';
import UiIcon from '@/components/UiIcon.vue';
import ExcelImportFlow from '@/components/ExcelImportFlow.vue';
import type { PageHeaderMenuItem, PageHeaderTab, PageHeaderViewOption } from '@/components/page';
import {
FilterChips,
PageHeader,
type PageHeaderMenuItem,
type PageHeaderTab,
type PageHeaderViewOption,
} from '@/components/page';
import { useLandingTour } from '@/tours';
import {
AppstoreOutlined,
FileExcelOutlined,
@@ -29,6 +36,7 @@ import {
UnorderedListOutlined,
} from '@/icons/ant-bridge';
import ActivitiesKanban from '@/components/activities/ActivitiesKanban.vue';
import ActivityAccountBalances from '@/components/activities/ActivityAccountBalances.vue';
import ActivityDeskFilters from '@/components/activities/ActivityDeskFilters.vue';
import ActivityStagesManager from '@/components/activities/ActivityStagesManager.vue';
import ActivityTypesManager from '@/components/activities/ActivityTypesManager.vue';
@@ -63,7 +71,7 @@ import { useAuthStore } from '@/stores/auth';
import { canMutateActivity } from '@/lib/activity-access';
import { canManageSettings, canViewAllRecords } from '@/lib/roles';
import { apiError } from '@/lib/routines';
import { Drawer as ADrawer, message } from 'ant-design-vue';
import { Card as ACard, Drawer as ADrawer, Flex as AFlex, message } from 'ant-design-vue';
import { PAGE_SIZE_OPTIONS, usePageSize } from '@/lib/pageSize';
import { registerTableColumns, useTableColumns } from '@/lib/tableColumns';
import TableColumnsMenu from '@/components/TableColumnsMenu.vue';
@@ -400,6 +408,10 @@ const data = computed(() => listQuery.data.value ?? null);
const loading = computed(
() => listQuery.isFetching.value && listQuery.data.value == null && viewMode.value === 'tabs',
);
const tourLoading = computed(
() => listQuery.isFetching.value && listQuery.data.value == null,
);
const { replay: replayActivitiesTour } = useLandingTour('activities', tourLoading);
const counts = computed<Record<TimeFilter, number>>(() => {
const raw = timeCountsQuery.data.value;
return {
@@ -1306,9 +1318,11 @@ onUnmounted(() => {
title="میز کار و فعالیت‌ها"
:icon="ScheduleOutlined"
:count="stageCounts.total"
tourable
primary-label="فعالیت جدید"
:menu-items="headerMenuItems"
:tabs="viewMode === 'tabs' ? stageTabs : undefined"
tabs-after-chips
:active-tab="stage"
searchable
:search-placeholder="isMobile ? 'جستجو…' : 'جستجو در عنوان، مشتری، کارشناس، نوع فعالیت...'"
@@ -1317,6 +1331,7 @@ onUnmounted(() => {
:view="viewMode"
@primary="activityModal = {}"
@menu="onHeaderMenu"
@tour="replayActivitiesTour"
@update:active-tab="onHeaderTab"
@update:search="onSearchInput"
@search-submit="onSearch"
@@ -1388,6 +1403,7 @@ onUnmounted(() => {
</a-dropdown>
</template>
<template #chips>
<a-flex data-tour="activities-desk-filters" align="center" wrap="wrap" :gap="8">
<FilterChips
v-if="showDeskTabs"
label="میز"
@@ -1405,6 +1421,7 @@ onUnmounted(() => {
:model-value="[filter]"
@update:model-value="onTimeChips"
/>
</a-flex>
</template>
</PageHeader>
@@ -1446,6 +1463,7 @@ onUnmounted(() => {
</button>
</div>
<div data-tour="activities-board">
<ActivitiesKanban
v-if="viewMode === 'board'"
:stages="stages"
@@ -1506,7 +1524,8 @@ onUnmounted(() => {
</div>
</div>
<template v-else>
<a-card v-else :bordered="false">
<a-flex vertical :gap="12">
<div class="list-head">
<strong>{{ filterLabel }} — {{ toFaDigits(total.toLocaleString('en-US')) }} فعالیت</strong>
<div class="list-head-tools">
@@ -1598,6 +1617,11 @@ onUnmounted(() => {
{{ item.title }}
</RouterLink>
<p v-if="subtitle(item)" class="sub">{{ subtitle(item) }}</p>
<ActivityAccountBalances
v-if="item.accountBalance"
:balance="item.accountBalance"
compact
/>
<p v-if="item.tags?.length" class="row-tags">
<span v-for="t in item.tags.slice(0, 3)" :key="t">#{{ t }}</span>
<span v-if="item.tags.length > 3">+{{ toFaDigits(item.tags.length - 3) }}</span>
@@ -1730,6 +1754,11 @@ onUnmounted(() => {
<UiIcon name="star" :size="14" class="star" />
</RouterLink>
<p v-if="subtitle(item)" class="sub">{{ subtitle(item) }}</p>
<ActivityAccountBalances
v-if="item.accountBalance"
:balance="item.accountBalance"
compact
/>
<p class="meta-line">
<span v-if="item.person">
<UiIcon name="user" :size="13" />
@@ -1816,7 +1845,9 @@ onUnmounted(() => {
@update:page="setPage"
@update:page-size="onPageSize"
/>
</template>
</a-flex>
</a-card>
</div>
<Teleport to="body">
<div
@@ -2691,10 +2722,10 @@ h1 {
}
.table {
background: #fff;
border-radius: var(--radius);
background: transparent;
border-radius: 0;
overflow: visible;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
box-shadow: none;
}
.thead,
@@ -18,6 +18,7 @@ import ActivityCommentSheet from '@/components/activities/ActivityCommentSheet.v
import ActivityPostponeSheet from '@/components/activities/ActivityPostponeSheet.vue';
import ActivityFieldsView from '@/components/activities/ActivityFieldsView.vue';
import StagePathStrip from '@/components/StagePathStrip.vue';
import { PageHeader } from '@/components/page';
import { ScheduleOutlined } from '@/icons/ant-bridge';
import { Button as AButton, message, Modal } from 'ant-design-vue';
import type {
+22 -1
View File
@@ -1,11 +1,14 @@
<script setup lang="ts">
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import axios from 'axios';
import { api } from '@/lib/api';
import AutomationCanvas from '@/components/automations/AutomationCanvas.vue';
import type { AutomationAddPayload } from '@/components/automations/AutomationCanvas.vue';
import AutomationInspector from '@/components/automations/AutomationInspector.vue';
import { toFaDigits } from '@/lib/jalali';
import { useLandingTour } from '@/tours';
import type { PageHeaderMenuItem } from '@/components/page';
import type {
ActivityTypeDefDto,
AutomationAction,
@@ -64,11 +67,23 @@ const { Text: ATypographyText } = Typography;
const { token } = theme.useToken();
const auth = useAuthStore();
const router = useRouter();
const advanced = computed(
() => auth.user?.enabledModules?.includes('workflow_automations_advanced') ?? false,
);
const loading = ref(false);
const loading = ref(true);
const { replay: replayAutomationsTour } = useLandingTour('automations', loading);
const headerMenuItems: PageHeaderMenuItem[] = [
{ key: 'message-automations', label: 'اتوماسیون پیامک‌ها' },
{ key: 'sms-campaigns', label: 'پیامک گروهی' },
];
function onHeaderMenu(key: string) {
if (key === 'message-automations') void router.push('/settings/message-automations');
else if (key === 'sms-campaigns') void router.push('/settings/sms-campaigns');
}
const saving = ref(false);
const error = ref('');
const items = ref<AutomationRuleDto[]>([]);
@@ -592,9 +607,13 @@ watch(trigger, (next, prev) => {
<PageHeader
title="اتوماسیون"
:icon="ThunderboltOutlined"
tourable
primary-label="قانون جدید"
:menu-items="headerMenuItems"
:style="{ flex: '0 0 auto' }"
@primary="openCreateModal"
@menu="onHeaderMenu"
@tour="replayAutomationsTour"
>
<template #actions>
<a-button :disabled="loading" aria-label="بروزرسانی" title="بروزرسانی" @click="load">
@@ -629,6 +648,7 @@ watch(trigger, (next, prev) => {
}"
>
<div
data-tour="automations-list"
:style="{
flexShrink: 0,
marginBottom: `${token.margin}px`,
@@ -796,6 +816,7 @@ watch(trigger, (next, prev) => {
<div
v-if="inspectorOpen"
ref="inspectorRef"
data-tour="automations-inspector"
:style="{
position: 'absolute',
insetInlineEnd: `${token.margin}px`,
+85 -1
View File
@@ -1,10 +1,12 @@
<script setup lang="ts">
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { RouterLink, useRoute, useRouter } from 'vue-router';
import { useLandingTour } from '@/tours';
import { useQuery } from '@tanstack/vue-query';
import axios from 'axios';
import {
Alert as AAlert,
Badge as ABadge,
Button as AButton,
Card as ACard,
Checkbox as ACheckbox,
@@ -32,6 +34,7 @@ import {
DeleteOutlined,
EditOutlined,
FileExcelOutlined,
FilterOutlined,
IdcardOutlined,
MailOutlined,
MoreOutlined,
@@ -44,6 +47,9 @@ import { formatJalaliNumeric, toFaDigits } from '@/lib/jalali';
import CustomerMoodFace from '@/components/CustomerMoodFace.vue';
import ExcelImportFlow from '@/components/ExcelImportFlow.vue';
import PhoneContactsImport from '@/components/PhoneContactsImport.vue';
import ContactsFilterPanel, {
type ContactsFilterValue,
} from '@/components/ContactsFilterPanel.vue';
import { FilterChips, PageHeader } from '@/components/page';
import type {
PageHeaderActiveFilter,
@@ -164,6 +170,7 @@ const importMsg = ref('');
const menuId = ref<string | null>(null);
const sortOpen = ref(false);
const filterOpen = ref(false);
const filterAnchorEl = ref<HTMLElement | null>(null);
const moreOpen = ref(false);
const savedSheetOpen = ref(false);
const contactModal = ref<'person' | 'company' | null>(null);
@@ -247,6 +254,22 @@ const filterGroups = computed(() =>
: (companyGroupStatsQuery.data.value ?? []),
);
const SORT_OPTIONS = [
{ value: 'name', label: 'نام' },
{ value: 'newest', label: 'جدیدترین' },
];
const filterValue = computed<ContactsFilterValue>(() => ({
groups: groupFilters.value,
sources: sourceFilters.value,
moods: moodFilters.value,
disc: discFilter.value,
activityExperiences: activityExperienceFilters.value,
}));
/** شمارنده روی دکمه فیلتر (گروه، منبع، وضعیت، DISC، سابقه) */
const filterCount = computed(() => activeTags.value.length);
const loading = computed(() => {
if (tab.value === 'people') {
return peopleQuery.isFetching.value && peopleQuery.data.value == null;
@@ -254,6 +277,8 @@ const loading = computed(() => {
return companiesQuery.isFetching.value && companiesQuery.data.value == null;
});
const { replay: replayCustomersTour } = useLandingTour('customers', loading);
watch(
() => (tab.value === 'people' ? peopleQuery.error.value : companiesQuery.error.value),
(err) => {
@@ -498,6 +523,31 @@ function clearFilters() {
});
}
function applyFilters(next: ContactsFilterValue, nextSort?: string) {
filterOpen.value = false;
const people = tab.value === 'people';
patchQuery({
group: csv(next.groups),
...(people
? {
source: csv(next.sources),
mood: csv(next.moods),
activityExperience: csv(next.activityExperiences),
disc: next.disc || undefined,
}
: {}),
...(nextSort !== undefined
? { sort: nextSort === 'newest' ? 'newest' : undefined }
: {}),
page: undefined,
});
}
function toggleFilterPanel() {
filterOpen.value = !filterOpen.value;
sortOpen.value = false;
}
function setPage(next: number) {
if (next < 1 || next > pageCount.value) return;
patchQuery({ page: next === 1 ? undefined : String(next) });
@@ -876,9 +926,11 @@ function peopleCustomRow(record: PersonDto) {
<PageHeader
title="مخاطبین"
:icon="TeamOutlined"
tourable
:primary-label="tab === 'companies' ? 'شرکت جدید' : 'شخص جدید'"
:menu-items="headerMenuItems"
:tabs="headerTabs"
:tabs-after-chips="false"
:active-tab="tab"
searchable
:search="q"
@@ -887,6 +939,7 @@ function peopleCustomRow(record: PersonDto) {
:result-count="activeFilterChips.length ? total : undefined"
@primary="contactModal = tab === 'companies' ? 'company' : 'person'"
@menu="onHeaderMenu"
@tour="replayCustomersTour"
@update:active-tab="onHeaderTab"
@update:search="onSearchInput"
@search-submit="onSearch"
@@ -909,6 +962,22 @@ function peopleCustomRow(record: PersonDto) {
@update:value="onSourceChange"
/>
</template>
<div ref="filterAnchorEl" data-tour="customers-filter" @click.stop>
<a-button
:type="filterCount ? 'primary' : 'default'"
:ghost="!!filterCount"
@click="toggleFilterPanel"
>
<template #icon><FilterOutlined /></template>
فیلتر
<a-badge
v-if="filterCount"
:count="toFaDigits(filterCount)"
:number-style="{ backgroundColor: token.colorPrimary, boxShadow: 'none' }"
:style="{ marginInlineStart: `${token.marginXXS}px` }"
/>
</a-button>
</div>
</template>
<template v-if="tab === 'people'" #saved-filters>
@@ -952,6 +1021,21 @@ function peopleCustomRow(record: PersonDto) {
</template>
</PageHeader>
<ContactsFilterPanel
:sheet="isMobile"
:open="filterOpen"
:anchor-el="filterAnchorEl"
:tab="tab"
:value="filterValue"
:groups="customerGroups"
:source-stats="sourceStats"
:can-behavior="canBehavior"
:sort="isMobile ? sort : undefined"
:sort-options="isMobile ? SORT_OPTIONS : undefined"
@apply="applyFilters"
@close="filterOpen = false"
/>
<!-- تریگرهای ورود داده؛ از منوی «⋯» هدر کلیک می‌شوند (مودال‌هایشان به body تلپورت می‌شوند) -->
<div hidden>
<ExcelImportFlow
@@ -978,7 +1062,7 @@ function peopleCustomRow(record: PersonDto) {
</div>
<a-spin :spinning="pageBusy" :tip="busyMessage">
<a-card :bordered="false">
<a-card :bordered="false" data-tour="customers-table">
<a-flex vertical :gap="16">
<a-alert v-if="importMsg" type="success" show-icon :message="importMsg" />
<a-alert v-if="error" type="error" show-icon :message="error" />
+1
View File
@@ -34,6 +34,7 @@ import {
message,
theme,
} from 'ant-design-vue';
import { PageHeader } from '@/components/page';
import {
CopyOutlined,
EditOutlined,
@@ -4,6 +4,7 @@ import { useRoute, useRouter } from 'vue-router';
import axios from 'axios';
import { theme, type UploadProps } from 'ant-design-vue';
import { api } from '@/lib/api';
import { PageHeader } from '@/components/page';
import {
AppstoreOutlined,
BarChartOutlined,
+12 -3
View File
@@ -67,6 +67,7 @@ import type {
PageHeaderTab,
PageHeaderViewOption,
} from '@/components/page';
import { useLandingTour } from '@/tours';
import {
filterPhoneContacts,
isContactPickerSupported,
@@ -135,7 +136,8 @@ const isAdmin = computed(() => canManageSettings(auth.user?.role));
const canAssignOthers = computed(() => canAssignToOthers(auth.user, 'leads'));
const q = ref(typeof route.query.q === 'string' ? route.query.q : '');
const loading = ref(false);
const loading = ref(true);
const { replay: replayLeadsTour } = useLandingTour('leads', loading);
const busy = ref(false);
const pageBusy = ref(false);
const busyMessage = ref('لطفاً صبر کنید…');
@@ -1664,6 +1666,7 @@ onBeforeUnmount(() => {
title="لیدها"
:icon="UserAddOutlined"
:count="totalLeadsCount"
tourable
:primary-label="isMobile ? 'جدید' : 'لید جدید'"
:menu-items="headerMenuItems"
:tabs="headerTabs"
@@ -1677,6 +1680,7 @@ onBeforeUnmount(() => {
:result-count="activeFilterChips.length ? total : undefined"
@primary="openCreate"
@menu="onHeaderMenu"
@tour="replayLeadsTour"
@update:active-tab="onHeaderTab"
@update:search="onSearchInput"
@search-submit="onSearch"
@@ -1685,7 +1689,12 @@ onBeforeUnmount(() => {
@clear-filters="clearMoreFilters"
>
<template #quick-filters>
<div ref="filterAnchor" :style="{ position: 'relative' }" @click.stop>
<div
ref="filterAnchor"
data-tour="leads-followup"
:style="{ position: 'relative' }"
@click.stop
>
<a-button @click.stop="toggleFilterPopover">
<template #icon><FilterOutlined /></template>
فیلتر
@@ -1983,7 +1992,7 @@ onBeforeUnmount(() => {
</a-col>
<a-col :span="24">
<a-card>
<a-card data-tour="leads-table">
<a-spin :spinning="loading || pageBusy" :tip="pageBusy ? busyMessage : undefined">
<template v-if="data?.items?.length">
<a-row v-if="isMobile" :gutter="[12, 12]">
+6 -1
View File
@@ -52,6 +52,7 @@ import {
import { useAuthStore } from '@/stores/auth';
import { canManageSettings } from '@/lib/roles';
import { bindMenuDismiss, cardMenuStyle } from '@/lib/anchored-menu';
import { useLandingTour } from '@/tours';
const dealExcelFields = DEAL_EXCEL_COLUMNS.filter((c) => c.key !== '_type').map((c) => ({
key: c.key,
@@ -87,7 +88,8 @@ const feedback = useFeedback();
const auth = useAuthStore();
const canCreatePipeline = computed(() => canManageSettings(auth.user?.role));
const loading = ref(false);
const loading = ref(true);
const { replay: replaySalesTour } = useLandingTour('sales', loading);
const saving = ref(false);
const error = ref('');
const stages = ref<PipelineStage[]>([]);
@@ -747,6 +749,7 @@ function onNewDeal() {
pipeline-name="مسیر فروش"
:count="loading && !stages.length ? undefined : dealCount"
primary-label="معامله جدید"
tourable
:menu-items="headerMenuItems"
:pipeline-options="pipelineOptions"
v-model:selected-pipeline-id="selectedPipelineId"
@@ -758,6 +761,7 @@ function onNewDeal() {
@create="showCreate = true"
@primary="onNewDeal"
@menu="onHeaderMenu"
@tour="replaySalesTour"
>
<template #filters>
<SavedFiltersBar
@@ -815,6 +819,7 @@ function onNewDeal() {
</a-flex>
<div
data-tour="sales-board"
:style="{
position: 'relative',
flex: '1 1 auto',
@@ -20,9 +20,15 @@ import {
} from '@/icons/ant-bridge';
import { PageHeader } from '@/components/page';
import type { PageHeaderTab } from '@/components/page';
import { usePageTour } from '@/tours';
const route = useRoute();
const router = useRouter();
const pageTour = usePageTour();
function replayRoutinesTour() {
pageTour.replay('routines');
}
const context = ref<RoutineContextDto | null>(null);
const contextError = ref('');
@@ -140,10 +146,12 @@ const hideHeader = computed(() => route.name === 'routine-new' || route.name ===
title="کارهای روتین"
:subtitle="todayLabel"
:icon="SyncOutlined"
tourable
primary-label="کار جدید"
:tabs="headerTabs"
:active-tab="activeTab"
@primary="quickOpen = true"
@tour="replayRoutinesTour"
@update:active-tab="onTabChange"
>
<template #actions>
@@ -19,6 +19,7 @@ import {
} from '@/lib/routines';
import { useRoutineTaskActions } from '@/lib/useRoutineTaskActions';
import { useAuthStore } from '@/stores/auth';
import { useLandingTour } from '@/tours';
import {
Affix as AAffix,
Alert as AAlert,
@@ -53,6 +54,7 @@ const loading = ref(true);
const error = ref('');
const userId = ref('');
const filter = ref<'all' | 'open' | 'done'>('all');
useLandingTour('routines', loading);
async function load(silent = false) {
if (!silent) loading.value = true;
@@ -212,7 +214,7 @@ const userOptions = computed(() => [
<a-row :gutter="[24, 24]" align="top">
<a-col :xs="24" :lg="16" :xl="17">
<a-card :bordered="false">
<a-card :bordered="false" data-tour="routines-list">
<a-segmented v-model:value="filter" :options="filterOptions" />
<div :style="{ marginTop: '16px' }">
@@ -273,7 +275,9 @@ const userOptions = computed(() => [
<a-affix :offset-top="24">
<a-flex vertical :gap="16">
<CrmSkeletonCard :rows="4">
<div data-tour="routines-score">
<DailyScoreCard :score="data?.score ?? null" :days="recent" />
</div>
</CrmSkeletonCard>
<a-card v-if="data?.overdue.length" :bordered="false">
@@ -91,7 +91,6 @@ async function load() {
items.value = data.items;
pageChrome?.set({
title: data.account.name || 'جزئیات حساب',
description: 'گردش قطعی این حساب',
});
}
@@ -42,12 +42,6 @@ const title = computed(
(typeof route.meta.treasuryTitle === 'string' ? route.meta.treasuryTitle : 'مدیریت مالی'),
);
const description = computed(
() =>
chrome.override.value.description ??
(typeof route.meta.treasuryDescription === 'string' ? route.meta.treasuryDescription : ''),
);
const links = computed(() => {
const role = auth.user?.role;
const permissions = auth.user?.permissions;
@@ -100,7 +94,6 @@ function onTabChange(key: string | number | undefined) {
<a-flex vertical :gap="token.margin" :style="{ width: '100%' }">
<PageHeader
:title="title"
:subtitle="description || undefined"
:icon="DollarOutlined"
:tabs="headerTabs"
:active-tab="activeTab"
@@ -2,7 +2,6 @@ import { inject, provide, ref, type InjectionKey, type Ref } from 'vue';
export type TreasuryChromeOverride = {
title: string | null;
description: string | null;
};
type TreasuryChromeApi = {
@@ -14,14 +13,14 @@ type TreasuryChromeApi = {
const KEY: InjectionKey<TreasuryChromeApi> = Symbol('treasuryPageChrome');
export function provideTreasuryPageChrome(): TreasuryChromeApi {
const override = ref<TreasuryChromeOverride>({ title: null, description: null });
const override = ref<TreasuryChromeOverride>({ title: null });
const api: TreasuryChromeApi = {
override,
set(next) {
override.value = next;
},
clear() {
override.value = { title: null, description: null };
override.value = { title: null };
},
};
provide(KEY, api);