fix(web): restore page header bindings so typecheck can pass.
The form builder, activities, contacts, and lead screens referenced header actions that were no longer in script, which blocked the push check. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -31,12 +31,10 @@ import {
|
||||
Textarea as ATextarea,
|
||||
Timeline as ATimeline,
|
||||
TimelineItem as ATimelineItem,
|
||||
Typography,
|
||||
message,
|
||||
theme,
|
||||
} from 'ant-design-vue';
|
||||
import {
|
||||
ArrowLeftOutlined,
|
||||
CopyOutlined,
|
||||
EditOutlined,
|
||||
MessageOutlined,
|
||||
@@ -52,7 +50,6 @@ import {
|
||||
leadNoteFileIsImage,
|
||||
parseLeadFormNotes,
|
||||
} from '@/lib/lead-form-notes';
|
||||
import { ACTIVITY_EXPERIENCE_OPTIONS } from '@mento/shared';
|
||||
import {
|
||||
formatClockFa,
|
||||
formatJalaliNumeric,
|
||||
@@ -79,8 +76,6 @@ import { ACTIVITY_TYPE_LABELS, PERSON_GENDERS, PERSON_GENDER_LABELS, splitPerson
|
||||
import { canUseBehavior } from '@/lib/behavior-access';
|
||||
import SalesCopilotPanel from '@/components/behavior/SalesCopilotPanel.vue';
|
||||
|
||||
const { Title: ATypographyTitle, Text: ATypographyText, Paragraph: ATypographyParagraph } =
|
||||
Typography;
|
||||
const { token } = theme.useToken();
|
||||
|
||||
type LeadDetail = LeadDto & { events: LeadEventDto[] };
|
||||
@@ -94,17 +89,6 @@ const copilotOpen = ref(false);
|
||||
|
||||
const id = computed(() => String(route.params.id));
|
||||
|
||||
/** برگشت به همان جایی که از آن آمدهایم (فهرست یا مسیر/بورد لیدها). */
|
||||
function goBack() {
|
||||
const back = String((window.history.state as { back?: string | null } | null)?.back ?? '');
|
||||
const path = back.split('?')[0];
|
||||
if (path === '/leads' || path === '/leads/board') {
|
||||
router.back();
|
||||
return;
|
||||
}
|
||||
void router.push({ name: 'leads' });
|
||||
}
|
||||
|
||||
const loading = ref(false);
|
||||
const busy = ref(false);
|
||||
const error = ref('');
|
||||
@@ -150,11 +134,6 @@ const editForm = ref({
|
||||
notes: '',
|
||||
});
|
||||
|
||||
const activityExperienceOptions = [
|
||||
{ value: '', label: '—' },
|
||||
...ACTIVITY_EXPERIENCE_OPTIONS.map((value) => ({ value, label: value })),
|
||||
];
|
||||
|
||||
function formatDate(value: string | null | undefined) {
|
||||
if (!value) return '—';
|
||||
try {
|
||||
@@ -172,14 +151,6 @@ const shownBirthDate = computed(() => {
|
||||
if (lead.value?.birthDate) return formatDate(lead.value.birthDate);
|
||||
return formBirthDate.value || '—';
|
||||
});
|
||||
const formActivityExperience = computed(
|
||||
() =>
|
||||
noteView.value.rows.find((row) => isActivityExperienceAnswer(row.label) && !row.file)?.text ??
|
||||
'',
|
||||
);
|
||||
const shownActivityExperience = computed(
|
||||
() => lead.value?.activityExperience || formActivityExperience.value || '—',
|
||||
);
|
||||
const answerRows = computed(() =>
|
||||
noteView.value.rows.filter(
|
||||
(row) => !isBirthDateAnswer(row.label) && !isActivityExperienceAnswer(row.label),
|
||||
@@ -309,20 +280,6 @@ async function saveEdit() {
|
||||
}
|
||||
}
|
||||
|
||||
function openStageMove() {
|
||||
if (!stageId.value || stageId.value === lead.value?.stageId) return;
|
||||
stageMoveReason.value = '';
|
||||
stageMoveError.value = '';
|
||||
stageMoveOpen.value = true;
|
||||
}
|
||||
|
||||
function cancelStageMove() {
|
||||
stageMoveOpen.value = false;
|
||||
stageMoveReason.value = '';
|
||||
stageMoveError.value = '';
|
||||
if (lead.value) stageId.value = lead.value.stageId;
|
||||
}
|
||||
|
||||
async function changeStage() {
|
||||
if (!stageId.value || stageId.value === lead.value?.stageId) {
|
||||
return Promise.reject();
|
||||
@@ -475,6 +432,19 @@ function convertLead() {
|
||||
});
|
||||
}
|
||||
|
||||
const leadMenuItems = computed(() => [
|
||||
{
|
||||
key: 'archive',
|
||||
label: 'بایگانی',
|
||||
danger: true,
|
||||
disabled: busy.value || !lead.value,
|
||||
},
|
||||
]);
|
||||
|
||||
function onLeadMenu(key: string) {
|
||||
if (key === 'archive') archiveLead();
|
||||
}
|
||||
|
||||
function archiveLead() {
|
||||
AModal.confirm({
|
||||
title: 'این لید بایگانی شود؟',
|
||||
|
||||
Reference in New Issue
Block a user