From 3106135677cf04f1e25a49899073842d0dba2f3e Mon Sep 17 00:00:00 2001 From: "LINING-PC\\lining" Date: Tue, 9 Dec 2025 14:18:04 +0800 Subject: [PATCH] v1.4.6 - bugfix --- CHANGELOG.md | 8 ++++++++ demo/App.vue | 7 +++---- demo/version-history.json | 8 ++++++++ npm-demo/src/components/GanttTest.vue | 3 +-- package.json | 2 +- src/components/TaskDrawer.vue | 3 ++- src/components/TaskRow.vue | 2 -- src/composables/useTaskRowDrag.ts | 24 ------------------------ 8 files changed, 23 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1c7c3c..ec32d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,19 @@ 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-patch.1] - 2025-12-09 + +### Fixed +- 修复:Github编译错误 +- Fixed: build errors From github + ## [1.4.6] - 2025-12-09 ### Fixed - 修复:内置TaskDrawer中负责人列表可以外部初始化 +- 修复:未设置startDate和endDate时,任务无法正确显示的问题 - Fixed: The assignee list in the built-in TaskDrawer can be initialized externally +- Fixed: The issue where tasks could not be displayed correctly when startDate and endDate were not set ## [1.4.5] - 2025-12-06 diff --git a/demo/App.vue b/demo/App.vue index 2ec1a85..ea9b516 100644 --- a/demo/App.vue +++ b/demo/App.vue @@ -627,10 +627,9 @@ const handleTaskRowMoved = async (payload: { const successMsg = demoMessages.value.taskMoveConfirm.messages.moveSuccess showMessage(`${successMsg}: ${message}`, 'success', { closable: true }) - // ⚠️ 重要:必须更新 tasks.value 以同步 TaskList 和 Timeline - // TaskList 已更新内部视图,但 Timeline 依赖 props.tasks - // 此赋值会触发 GanttChart 的 watch,进而触发 Timeline 重新渲染 - tasks.value = updatedTasks + // ⚠️ 注意:组件内部已通过对象引用自动完成数据移动,TaskList 和 Timeline 自动同步 + // 无需手动更新 tasks.value,因为移动操作直接修改了原始对象引用 + // 如果需要触发响应式更新,可以使用: tasks.value = [...tasks.value] // 调用后端API保存任务层级变更 // try { diff --git a/demo/version-history.json b/demo/version-history.json index f856540..70fa791 100644 --- a/demo/version-history.json +++ b/demo/version-history.json @@ -354,5 +354,13 @@ "Fixed: The issue where tasks could not be displayed correctly when startDate and endDate were not set", "Special thanks to yue-xiaochuan & YQ6494@gitee for their valuable use and feedback" ] + }, + { + "version": "1.4.6-patch.1", + "date": "2025-12-09", + "notes": [ + "修复:Github编译错误", + "Fixed: The build errors on Github" + ] } ] diff --git a/npm-demo/src/components/GanttTest.vue b/npm-demo/src/components/GanttTest.vue index 839d7bd..e92bb37 100644 --- a/npm-demo/src/components/GanttTest.vue +++ b/npm-demo/src/components/GanttTest.vue @@ -123,9 +123,8 @@ const addMilestone = () => { startDate: newTask.value.startDate, progress: 0, type: 'milestone', - icon: 'diamond' + icon: 'diamond', }); - console.log('milestones: ', milestones.value) newTask.value = { name: '', startDate: '', endDate: '' }; showAddMilestoneDialog.value = false; } diff --git a/package.json b/package.json index fe1654d..cee9db7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jordium-gantt-vue3", - "version": "1.4.6", + "version": "1.4.6-patch.1", "type": "module", "main": "dist/jordium-gantt-vue3.cjs.js", "module": "dist/jordium-gantt-vue3.es.js", diff --git a/src/components/TaskDrawer.vue b/src/components/TaskDrawer.vue index 27b9a49..6f883be 100644 --- a/src/components/TaskDrawer.vue +++ b/src/components/TaskDrawer.vue @@ -644,7 +644,8 @@ function confirmTimer(desc: string) { } // 处理负责人变更 -const handleAssigneeChanged = (value: string) => { +const handleAssigneeChanged = (event: Event) => { + const value = (event.target as HTMLSelectElement).value // 通过value过滤props.assigneeOptions获取对应的label const selected = props.assigneeOptions?.find(option => option.value === value) if (selected) { diff --git a/src/components/TaskRow.vue b/src/components/TaskRow.vue index 6bea355..a7b9841 100644 --- a/src/components/TaskRow.vue +++ b/src/components/TaskRow.vue @@ -309,8 +309,6 @@ const handleTaskRowDragOver = (event: CustomEvent) => { const { taskId, event: mouseEvent } = event.detail if (taskId === props.task.id) { - // eslint-disable-next-line no-console - console.log('[TaskRow] 接收到drag-over事件,任务:', props.task.name) props.dragOver(props.task, taskRowRef.value, mouseEvent) } } diff --git a/src/composables/useTaskRowDrag.ts b/src/composables/useTaskRowDrag.ts index eafceb3..c468a7b 100644 --- a/src/composables/useTaskRowDrag.ts +++ b/src/composables/useTaskRowDrag.ts @@ -38,9 +38,6 @@ export function useTaskRowDrag(options: UseDragOptions) { event.preventDefault() event.stopPropagation() - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] 开始拖拽任务:', task.name) - dragState.value.isDragging = true dragState.value.draggedTask = task dragState.value.draggedElement = element @@ -99,16 +96,12 @@ export function useTaskRowDrag(options: UseDragOptions) { // 不能拖拽到自己身上 if (task.id === dragState.value.draggedTask.id) { - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] 跳过:不能拖拽到自己身上') clearDropTarget() return } // 不能拖拽到自己的子任务上 if (isDescendant(dragState.value.draggedTask, task)) { - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] 跳过:不能拖拽到自己的子任务上') clearDropTarget() return } @@ -136,19 +129,12 @@ export function useTaskRowDrag(options: UseDragOptions) { element.classList.add('drop-child') } - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] 悬停在任务上:', task.name, 'position:', position) - if (options.onDragOver) { options.onDragOver(task, position) } } const clearDropTarget = () => { - if (dragState.value.dropTargetTask) { - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] 清除放置目标') - } dragState.value.dropTargetTask = null dragState.value.dropPosition = null document.querySelectorAll('.task-row-drop-target').forEach(el => { @@ -163,9 +149,6 @@ export function useTaskRowDrag(options: UseDragOptions) { const dropTargetTask = dragState.value.dropTargetTask const dropPosition = dragState.value.dropPosition - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] endDrag - dropTargetTask:', dropTargetTask?.name, 'dropPosition:', dropPosition) - // 恢复原始元素样式 if (dragState.value.draggedElement) { dragState.value.draggedElement.style.opacity = '' @@ -189,12 +172,7 @@ export function useTaskRowDrag(options: UseDragOptions) { // 如果有有效的放置目标,触发drop回调 if (draggedTask && dropTargetTask && dropPosition && options.onDrop) { - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] 放置任务:', draggedTask.name, '到', dropTargetTask.name, 'position:', dropPosition) options.onDrop(draggedTask, dropTargetTask, dropPosition) - } else { - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] 结束拖拽,没有有效的放置目标') } // 重置状态 @@ -231,8 +209,6 @@ export function useTaskRowDrag(options: UseDragOptions) { const taskRow = elementUnderMouse.closest('.task-row') as HTMLElement if (taskRow && taskRow.dataset.taskId) { const taskId = Number(taskRow.dataset.taskId) - // eslint-disable-next-line no-console - console.log('[TaskRowDrag] 检测到taskRow:', taskId) // 触发全局事件,让TaskRow组件处理 window.dispatchEvent(