feat: improve types
This commit is contained in:
parent
2f820e517f
commit
3b244dfdbe
@ -203,8 +203,12 @@ async function createTask(title: TaskModel['title']) {
|
|||||||
return newTask
|
return newTask
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateTask(e) {
|
async function updateTask(e: {
|
||||||
const task = tasks.value.get(e.bar.ganttBarConfig.id)
|
bar: GanttBarObject;
|
||||||
|
e: MouseEvent;
|
||||||
|
datetime?: string | undefined;
|
||||||
|
}) {
|
||||||
|
const task = tasks.value.get(Number(e.bar.ganttBarConfig.id))
|
||||||
|
|
||||||
if (!task) return
|
if (!task) return
|
||||||
|
|
||||||
@ -212,13 +216,17 @@ async function updateTask(e) {
|
|||||||
task.endDate = e.bar.endDate
|
task.endDate = e.bar.endDate
|
||||||
const updatedTask = await taskService.update(task)
|
const updatedTask = await taskService.update(task)
|
||||||
ganttBars.value.map(gantBar => {
|
ganttBars.value.map(gantBar => {
|
||||||
return gantBar[0].ganttBarConfig.id === task.id
|
return Number(gantBar[0].ganttBarConfig.id) === task.id
|
||||||
? transformTaskToGanttBar(updatedTask)
|
? transformTaskToGanttBar(updatedTask)
|
||||||
: gantBar
|
: gantBar
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function openTask(e) {
|
function openTask(e: {
|
||||||
|
bar: GanttBarObject;
|
||||||
|
e: MouseEvent;
|
||||||
|
datetime?: string | undefined;
|
||||||
|
}) {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'task.detail',
|
name: 'task.detail',
|
||||||
params: {id: e.bar.ganttBarConfig.id},
|
params: {id: e.bar.ganttBarConfig.id},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user