diff --git a/src/views/mes/components/ScheduleGanttPanel.vue b/src/views/mes/components/ScheduleGanttPanel.vue index 79cc0e64..bb19e14c 100644 --- a/src/views/mes/components/ScheduleGanttPanel.vue +++ b/src/views/mes/components/ScheduleGanttPanel.vue @@ -209,7 +209,26 @@ const buildPreviewGanttData = (scheduleList: any[]) => { return { data: tasks, links } } +const cleanupTaskTooltips = () => { + const tooltipsExt = (gantt.ext as any)?.tooltips + const tooltip = tooltipsExt?.tooltip + if (tooltipsExt?.detach) { + tooltipsExt.detach('.gantt_task_line') + tooltipsExt.detach('.gantt_task_content') + } + if (tooltip?.hide) { + tooltip.hide() + } + const node = tooltip?.getNode?.() + if (node) { + node.style.display = 'none' + node.style.visibility = 'hidden' + node.style.opacity = '0' + } +} + const destroyGantt = () => { + cleanupTaskTooltips() ganttEventIds.value.forEach((eventId) => gantt.detachEvent(eventId)) ganttEventIds.value = [] gantt.clearAll()