Skip to content

Commit 1107812

Browse files
committed
gantt drag modifyData
1 parent d0d07dd commit 1107812

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/components/layout/gantt/GanttTimelineRows.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { GanttShowKind, SubDataShowKind } from '../../../props/enumProps'
77
88
import type { GanttLayoutProps, TableStyleProps } from '../../../props'
99
import { registerRowTreeTriggerEvent, unregisterRowTreeTriggerEvent } from '../../function/RowTree'
10+
import * as eb from '../../eventbus'
1011
import { type GanttInfo, dragLinePositionEnum, getTimelineColumnWidth, getWeekdays, operationDateEnum } from './gantt'
1112
1213
const props = defineProps<{
@@ -400,9 +401,18 @@ async function stopResize(e: PointerEvent, isSave = false) {
400401
}
401402
// 获取到拖拽到哪个格子
402403
if (cellIdx || cellIdx === 0) {
403-
console.log(
404-
curTimelineRowRef.value.children[cellIdx].dataset,
405-
)
404+
let columnConfName = ''
405+
if (operationDate.value === operationDateEnum.PLAN) {
406+
columnConfName = dragLinePosition.value === dragLinePositionEnum.LEFT ? props.ganttProps.planStartTimeColumnName : props.ganttProps.planEndTimeColumnName
407+
}
408+
else if (operationDate.value === operationDateEnum.ACT) {
409+
columnConfName = (dragLinePosition.value === dragLinePositionEnum.LEFT ? props.ganttProps.actualStartTimeColumnName : props.ganttProps.actualEndTimeColumnName) as string
410+
}
411+
412+
await eb.modifyData([{
413+
[props.pkColumnName]: curTimelineRowRef.value.dataset.pk,
414+
[columnConfName]: `${curTimelineRowRef.value.children[cellIdx].dataset.groupValue}-${curTimelineRowRef.value.children[cellIdx].dataset.value}`,
415+
}])
406416
}
407417
}
408418
}

0 commit comments

Comments
 (0)