diff --git a/CHANGELOG.md b/CHANGELOG.md index 87ce669..d1c7c3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.6] - 2025-12-09 + +### Fixed +- 修复:内置TaskDrawer中负责人列表可以外部初始化 +- Fixed: The assignee list in the built-in TaskDrawer can be initialized externally + ## [1.4.5] - 2025-12-06 ### Changed diff --git a/README-EN.md b/README-EN.md index 1118b09..9b67581 100644 --- a/README-EN.md +++ b/README-EN.md @@ -23,7 +23,8 @@

中文 | - English + English | + Release Notes

A modern Vue 3 Gantt chart component library providing complete solutions for project management and task scheduling

@@ -188,8 +189,9 @@ npm run dev | `useDefaultDrawer` | `boolean` | `true` | Whether to use the built-in task edit drawer (TaskDrawer) | | `useDefaultMilestoneDialog` | `boolean` | `true` | Whether to use the built-in milestone edit dialog (MilestoneDialog) | | `autoSortByStartDate` | `boolean` | `false` | Whether to automatically sort tasks by start date | -| `allowDragAndResize` | `boolean` | `true` | Whether to allow dragging and resizing tasks/milestones | -| `enableTaskRowMove` | `boolean` | `false` | Whether to alloww dragging and dropping TaskRow +| `allowDragAndResize` | `boolean` | `true` | Whether to allow dragging and resizing tasks/milestones | +| `enableTaskRowMove` | `boolean` | `false` | Whether to allow dragging and dropping TaskRow | +| `assigneeOptions` | `Array<{ key?: string \| number; value: string \| number; label: string }>` | `[]` | Assignee dropdown options in task edit drawer | #### Configuration Object Props @@ -251,7 +253,7 @@ For complete event documentation, see: ```vue @@ -269,6 +271,12 @@ const tasks = ref([ progress: 100, }, ]) + +const assigneeOptions = ref([ + { value: 'alice', label: 'Alice' }, + { value: 'bob', label: 'Bob' }, + { value: 'charlie', label: 'Charlie' }, +]) ``` @@ -277,7 +285,7 @@ const tasks = ref([ ```vue @@ -305,6 +313,12 @@ const milestones = ref([ icon: 'diamond', }, ]) + +const assigneeOptions = ref([ + { value: 'alice', label: 'Alice' }, + { value: 'bob', label: 'Bob' }, + { value: 'charlie', label: 'Charlie' }, +]) ``` @@ -325,6 +339,7 @@ const milestones = ref([ :tasks="tasks" :milestones="milestones" :show-toolbar="false" + :assignee-options="assigneeOptions" @task-added="handleTaskAdded" @milestone-saved="handleMilestoneSaved" /> @@ -340,6 +355,12 @@ import 'jordium-gantt-vue3/dist/assets/jordium-gantt-vue3.css' const tasks = ref([]) const milestones = ref([]) +const assigneeOptions = ref([ + { value: 'alice', label: 'Alice' }, + { value: 'bob', label: 'Bob' }, + { value: 'charlie', label: 'Charlie' }, +]) + const addTask = () => { const newTask = { id: Date.now(), @@ -387,7 +408,8 @@ Tasks are the core elements of the Gantt chart. The component provides complete | `endDate` | `string` | - | - | End date, format: 'YYYY-MM-DD' or 'YYYY-MM-DD HH:mm' | | `progress` | `number` | - | `0` | Task progress, range 0-100 | | `predecessor` | `number[]` | - | - | Array of predecessor task IDs, standard format: `[1, 2, 3]`
**Compatible formats**: Also supports string `'1,2,3'` or string array `['1', '2', '3']`, component will auto-parse | -| `assignee` | `string` | - | - | Task assignee | +| `assignee` | `string` | - | - | Task assignee, used as the value binding for the assignee dropdown menu | +| `assigneeName` | `string` | - | - | Task assignee name, automatically obtained from the label in the bound `assigneeOptions` dataset; for custom display, you can set it in the `task-added` callback event of GanttChart | | `avatar` | `string` | - | - | Avatar URL of task assignee | | `estimatedHours` | `number` | - | - | Estimated hours | | `actualHours` | `number` | - | - | Actual hours | @@ -426,7 +448,8 @@ Tasks are the core elements of the Gantt chart. The component provides complete | `taskBarConfig` | `TaskBarConfig` | `{}` | Task bar style configuration, see [TaskBarConfig Configuration](#taskbarconfig-configuration) | | `taskListConfig` | `TaskListConfig` | `undefined` | Task list configuration, see [TaskListConfig Configuration](#tasklistconfig-configuration) | | `autoSortByStartDate` | `boolean` | `false` | Whether to automatically sort tasks by start date | -| `enableTaskRowMove` | `boolean` | `false` | Whether to alloww dragging and dropping TaskRow +| `enableTaskRowMove` | `boolean` | `false` | Whether to alloww dragging and dropping TaskRow | +| `assigneeOptions` | `Array<{ key?: string \| number; value: string \| number; label: string }>` | `[]` | Assignee dropdown options in task edit drawer | **Configuration Notes**: @@ -467,6 +490,7 @@ Tasks are the core elements of the Gantt chart. The component provides complete
([ }, ]) +const assigneeOptions = ref([ + { value: 'alice', label: 'Alice' }, + { value: 'bob', label: 'Bob' }, + { value: 'charlie', label: 'Charlie' }, +]) + // Toolbar "Add Task" button click event const handleAddTask = () => { console.log('Preparing to add task...') @@ -556,6 +586,7 @@ Tasks can configure predecessors via the `predecessor` field, and the component