UNPKG

jordium-gantt-vue3

Version:

A Vue 3 Gantt chart component for project management, task scheduling, resource planning, calendar, resource usage and timeline visualization.

237 lines (236 loc) 8.1 kB
import { Ref } from 'vue'; import { TaskBarConfig } from '../models/configs/TaskBarConfig'; import { Task } from '../models/classes/Task'; import { Resource } from '../models/classes/Resource'; import { Milestone } from '../models/classes/Milestone'; import { TimelineConfig } from '../models/configs/TimelineConfig'; import { TimelineScale, TimelineScaleConfig } from '../models/types/TimelineScale'; interface Props { tasks?: Task[]; milestones?: Milestone[]; startDate: Date; endDate: Date; useDefaultDrawer?: boolean; useDefaultMilestoneDialog?: boolean; onTaskDelete?: (task: Task) => void; onTaskUpdate?: (task: Task) => void; onMilestoneDelete?: (milestone: Milestone) => void; onMilestoneUpdate?: (milestone: Milestone) => void; onMilestoneSave?: (milestone: Task) => void; workingHours?: { morning?: { start: number; end: number; }; afternoon?: { start: number; end: number; }; }; taskBarConfig?: TaskBarConfig; allowDragAndResize?: boolean; showActualTaskbar?: boolean; enableTaskBarTooltip?: boolean; enableMilestoneTooltip?: boolean; milestoneLabelPosition?: 'left' | 'top' | 'right' | 'bottom'; pendingTaskBackgroundColor?: string; delayTaskBackgroundColor?: string; completeTaskBackgroundColor?: string; ongoingTaskBackgroundColor?: string; scaleConfigs?: Record<TimelineScale, TimelineScaleConfig>; enableParentTaskAutoSchedule?: boolean; /** R1: 连线样式配置(透传给 GanttLinks) */ linkConfig?: import('../models/configs/TaskBarConfig').LinkConfig; } declare var __VLS_20: { milestone: Milestone; task: Task; rowHeight: number; dayWidth: number; currentTimeScale?: TimelineScale | null; labelPosition: "right" | "left" | "top" | "bottom"; }, __VLS_33: { milestone: Milestone; task: Task; rowHeight: number; dayWidth: number; currentTimeScale?: TimelineScale | null; labelPosition: "right" | "left" | "top" | "bottom"; }, __VLS_61: { type: string; task: Task; status: import('./TaskBar.vue').TaskStatus; statusType: string; isParent?: boolean; progress: number; currentTimeScale?: TimelineScale; rowHeight: number; dayWidth: number; }, __VLS_63: any, __VLS_91: { type: string; task: Task; status: import('./TaskBar.vue').TaskStatus; statusType: string; isParent?: boolean; progress: number; currentTimeScale?: TimelineScale; rowHeight: number; dayWidth: number; }, __VLS_93: any, __VLS_102: { task: any; taskStatus: { color: string; label: string; type?: string | undefined; }; resourcePercent: number; }, __VLS_108: { milestone: { id?: number | undefined; name: string; startDate: string; endDate?: string | undefined; assignee?: string | string[] | undefined; assigneeName?: string | string[] | undefined; avatar?: string | string[] | undefined; type: string; icon?: string | undefined; description?: string | undefined; } | null; }; type __VLS_Slots = {} & { 'custom-milestone-content'?: (props: typeof __VLS_20) => any; } & { 'custom-milestone-content'?: (props: typeof __VLS_33) => any; } & { 'custom-task-content'?: (props: typeof __VLS_61) => any; } & { 'task-bar-context-menu'?: (props: typeof __VLS_63) => any; } & { 'custom-task-content'?: (props: typeof __VLS_91) => any; } & { 'task-bar-context-menu'?: (props: typeof __VLS_93) => any; } & { 'taskbar-tooltip'?: (props: typeof __VLS_102) => any; } & { 'milestone-tooltip'?: (props: typeof __VLS_108) => any; }; declare const __VLS_component: import('vue').DefineComponent<Props, { scrollToTasks: () => void; scrollToToday: () => void; scrollToTodayCenter: (retry?: number) => void; scrollToDate: (date: Date | string) => void; timelineConfig: Ref<{ startDate: Date; endDate: Date; zoomLevel: number; }, TimelineConfig | { startDate: Date; endDate: Date; zoomLevel: number; }>; updateTimeScale: (scale: TimelineScale) => void; highlightedTaskId: Ref<number | null, number | null>; clearHighlight: () => void; }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, { delete: (task: Task, deleteChildren?: boolean | undefined) => any; "start-timer": (task: Task) => any; "stop-timer": (task: Task) => any; "add-predecessor": (task: Task) => any; "add-successor": (task: Task) => any; "milestone-double-click": (milestone: Milestone) => any; "timeline-scale-changed": (scale: TimelineScale) => any; "click-task": (task: Task, event: MouseEvent) => any; "edit-task": (task: Task) => any; "predecessor-added": (args_0: { targetTask: Task; newTask: Task; }) => any; "successor-added": (args_0: { targetTask: Task; newTask: Task; }) => any; "link-deleted": (args_0: { sourceTaskId: number; targetTaskId: number; updatedTask: Task; }) => any; "resource-drag-end": (args_0: { task: Task; sourceResourceIndex: number; targetResourceIndex: number; targetResource: Resource; newStartDate?: string; newEndDate?: string; }) => any; }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{ onDelete?: ((task: Task, deleteChildren?: boolean | undefined) => any) | undefined; "onStart-timer"?: ((task: Task) => any) | undefined; "onStop-timer"?: ((task: Task) => any) | undefined; "onAdd-predecessor"?: ((task: Task) => any) | undefined; "onAdd-successor"?: ((task: Task) => any) | undefined; "onMilestone-double-click"?: ((milestone: Milestone) => any) | undefined; "onTimeline-scale-changed"?: ((scale: TimelineScale) => any) | undefined; "onClick-task"?: ((task: Task, event: MouseEvent) => any) | undefined; "onEdit-task"?: ((task: Task) => any) | undefined; "onPredecessor-added"?: ((args_0: { targetTask: Task; newTask: Task; }) => any) | undefined; "onSuccessor-added"?: ((args_0: { targetTask: Task; newTask: Task; }) => any) | undefined; "onLink-deleted"?: ((args_0: { sourceTaskId: number; targetTaskId: number; updatedTask: Task; }) => any) | undefined; "onResource-drag-end"?: ((args_0: { task: Task; sourceResourceIndex: number; targetResourceIndex: number; targetResource: Resource; newStartDate?: string; newEndDate?: string; }) => any) | undefined; }>, { taskBarConfig: TaskBarConfig; tasks: Task[]; onTaskUpdate: (task: Task) => void; enableParentTaskAutoSchedule: boolean; useDefaultDrawer: boolean; allowDragAndResize: boolean; showActualTaskbar: boolean; enableTaskBarTooltip: boolean; pendingTaskBackgroundColor: string; delayTaskBackgroundColor: string; completeTaskBackgroundColor: string; ongoingTaskBackgroundColor: string; milestones: Milestone[]; useDefaultMilestoneDialog: boolean; onTaskDelete: (task: Task) => void; onMilestoneDelete: (milestone: Milestone) => void; onMilestoneUpdate: (milestone: Milestone) => void; onMilestoneSave: (milestone: Task) => void; workingHours: { morning?: { start: number; end: number; }; afternoon?: { start: number; end: number; }; }; enableMilestoneTooltip: boolean; milestoneLabelPosition: "left" | "top" | "right" | "bottom"; scaleConfigs: Record<TimelineScale, TimelineScaleConfig>; }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>; declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>; export default _default; type __VLS_WithSlots<T, S> = T & { new (): { $slots: S; }; };