v1.4.6 - bugfix

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