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:
@@ -21,8 +21,14 @@ import {
|
||||
} from '@/components/ui';
|
||||
import UiIcon from '@/components/UiIcon.vue';
|
||||
import ExcelImportFlow from '@/components/ExcelImportFlow.vue';
|
||||
import type { PageHeaderMenuItem, PageHeaderTab, PageHeaderViewOption } from '@/components/page';
|
||||
import {
|
||||
AppstoreOutlined,
|
||||
FileExcelOutlined,
|
||||
ScheduleOutlined,
|
||||
UnorderedListOutlined,
|
||||
} from '@/icons/ant-bridge';
|
||||
import ActivitiesKanban from '@/components/activities/ActivitiesKanban.vue';
|
||||
import ActivityAccountBalances from '@/components/activities/ActivityAccountBalances.vue';
|
||||
import ActivityDeskFilters from '@/components/activities/ActivityDeskFilters.vue';
|
||||
import ActivityStagesManager from '@/components/activities/ActivityStagesManager.vue';
|
||||
import ActivityTypesManager from '@/components/activities/ActivityTypesManager.vue';
|
||||
@@ -201,8 +207,6 @@ const stagesQuery = useQuery({
|
||||
});
|
||||
const stages = computed(() => stagesQuery.data.value ?? []);
|
||||
const currentBoard = computed(() => boards.value.find((b) => b.id === board.value) ?? null);
|
||||
const boardMenuOpen = ref(false);
|
||||
const actionsMenuOpen = ref(false);
|
||||
const importBtn = ref<HTMLButtonElement | null>(null);
|
||||
|
||||
function triggerImport() {
|
||||
@@ -802,6 +806,70 @@ function onSearch() {
|
||||
});
|
||||
}
|
||||
|
||||
function onSearchInput(value: string) {
|
||||
q.value = value;
|
||||
}
|
||||
|
||||
const headerMenuItems = computed<PageHeaderMenuItem[]>(() => [
|
||||
{ key: 'export', label: 'خروجی اکسل', icon: FileExcelOutlined },
|
||||
{ key: 'import', label: 'ورود از اکسل', icon: FileExcelOutlined },
|
||||
]);
|
||||
|
||||
function onHeaderMenu(key: string) {
|
||||
if (key === 'export') void exportExcel();
|
||||
else if (key === 'import') triggerImport();
|
||||
}
|
||||
|
||||
const stageTabs = computed<PageHeaderTab[]>(() => [
|
||||
{ key: 'all', label: 'همه', count: stageCounts.value.total },
|
||||
...stages.value.map((s) => ({
|
||||
key: s.id,
|
||||
label: s.name,
|
||||
count: stageCounts.value.counts[s.id] ?? 0,
|
||||
})),
|
||||
]);
|
||||
|
||||
const viewOptions: PageHeaderViewOption[] = [
|
||||
{ value: 'tabs', label: 'فهرست', icon: UnorderedListOutlined },
|
||||
{ value: 'board', label: 'بورد', icon: AppstoreOutlined },
|
||||
];
|
||||
|
||||
function onHeaderTab(key: string | undefined) {
|
||||
setStage(key || 'all');
|
||||
}
|
||||
|
||||
function onHeaderView(value: string | undefined) {
|
||||
setViewMode(value === 'board' ? 'board' : 'tabs');
|
||||
}
|
||||
|
||||
const deskOptions = computed(() =>
|
||||
DESK_TABS.map((tab) => ({ value: tab.key, label: tab.label })),
|
||||
);
|
||||
|
||||
function onDeskChips(values: DeskScope[] | undefined) {
|
||||
const next = values?.[0];
|
||||
if (next === 'mine' || next === 'team') setDesk(next);
|
||||
}
|
||||
|
||||
const timeOptions = computed(() =>
|
||||
TIME_TABS.map((tab) => ({
|
||||
value: tab.key,
|
||||
label: `${tab.label} (${toFaDigits(counts.value[tab.key])})`,
|
||||
})),
|
||||
);
|
||||
|
||||
function onTimeChips(values: TimeFilter[] | undefined) {
|
||||
const next = values?.[0];
|
||||
if (next && TIME_KEYS.includes(next)) setFilter(next);
|
||||
}
|
||||
|
||||
function onBoardMenuClick(info: { key: string | number }) {
|
||||
const key = String(info.key);
|
||||
if (key === '__create') openCreateBoard();
|
||||
else if (key === '__edit') openEditBoard();
|
||||
else setBoard(key);
|
||||
}
|
||||
|
||||
function patchFacetQuery(patch: Record<string, string | undefined>) {
|
||||
void router.replace({
|
||||
name: 'activities',
|
||||
@@ -1250,10 +1318,10 @@ onUnmounted(() => {
|
||||
:view="viewMode"
|
||||
@primary="activityModal = {}"
|
||||
@menu="onHeaderMenu"
|
||||
@update:active-tab="(k) => setStage(k ?? 'all')"
|
||||
@update:active-tab="onHeaderTab"
|
||||
@update:search="onSearchInput"
|
||||
@search-submit="onSearch"
|
||||
@update:view="(v) => setViewMode(v === 'board' ? 'board' : 'tabs')"
|
||||
@update:view="onHeaderView"
|
||||
>
|
||||
<template #actions>
|
||||
<a-button aria-label="تقویم" title="تقویم" @click="router.push({ name: 'activities-calendar' })">
|
||||
|
||||
Reference in New Issue
Block a user