Files
im-uniapp/components/Gantt/core/Interaction.js
2025-07-16 14:23:42 +08:00

27 lines
835 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Interaction交互控制器处理用户交互逻辑输出标准化事件
export default class Interaction {
constructor(dataManager, timeCalculator) {
this.dataManager = dataManager;
this.timeCalculator = timeCalculator;
}
// 处理拖拽开始
handleDragStart(taskId) {
// 可扩展:记录初始状态
}
// 处理拖拽过程
handleDragUpdate(taskId, newDate) {
// 校验新日期是否合法,可扩展
this.dataManager.updateTask(taskId, { start: newDate });
}
// 处理拖拽结束
handleDragEnd(taskId, newDate) {
// 最终更新数据
this.dataManager.updateTask(taskId, { start: newDate });
}
// 处理维度切换
handleSwitchDimension(dim) {
// 重新分组并通知视图层
this.dataManager.dimensions = [dim];
this.dataManager.notify();
}
}