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