Compare commits
1 Commits
main
...
fix/gantt-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b233449c5 |
@@ -104,7 +104,7 @@ const GanttChart = createAsyncComponent(() => import('@/components/tasks/GanttCh
|
|||||||
const baseStore = useBaseStore()
|
const baseStore = useBaseStore()
|
||||||
const canWrite = computed(() => baseStore.currentProject?.maxRight > RIGHTS.READ)
|
const canWrite = computed(() => baseStore.currentProject?.maxRight > RIGHTS.READ)
|
||||||
|
|
||||||
const {route} = toRefs(props)
|
const {route, viewId} = toRefs(props)
|
||||||
const {
|
const {
|
||||||
filters,
|
filters,
|
||||||
hasDefaultFilters,
|
hasDefaultFilters,
|
||||||
@@ -113,7 +113,7 @@ const {
|
|||||||
isLoading,
|
isLoading,
|
||||||
addTask,
|
addTask,
|
||||||
updateTask,
|
updateTask,
|
||||||
} = useGanttFilters(route, props.viewId)
|
} = useGanttFilters(route, viewId)
|
||||||
|
|
||||||
const DEFAULT_DATE_RANGE_DAYS = 7
|
const DEFAULT_DATE_RANGE_DAYS = 7
|
||||||
|
|
||||||
@@ -218,4 +218,4 @@ const flatPickerConfig = computed<Options>(() => ({
|
|||||||
font-size: .9rem;
|
font-size: .9rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export type UseGanttFiltersReturn =
|
|||||||
ReturnType<typeof useRouteFilters<GanttFilters>> &
|
ReturnType<typeof useRouteFilters<GanttFilters>> &
|
||||||
ReturnType<typeof useGanttTaskList<GanttFilters>>
|
ReturnType<typeof useGanttTaskList<GanttFilters>>
|
||||||
|
|
||||||
export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: IProjectView['id']): UseGanttFiltersReturn {
|
export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: Ref<IProjectView['id']>): UseGanttFiltersReturn {
|
||||||
const {
|
const {
|
||||||
filters,
|
filters,
|
||||||
hasDefaultFilters,
|
hasDefaultFilters,
|
||||||
@@ -128,4 +128,4 @@ export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: IPr
|
|||||||
addTask,
|
addTask,
|
||||||
updateTask,
|
updateTask,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import type {IProjectView} from '@/modelTypes/IProjectView'
|
|||||||
export function useGanttTaskList<F extends Filters>(
|
export function useGanttTaskList<F extends Filters>(
|
||||||
filters: Ref<F>,
|
filters: Ref<F>,
|
||||||
filterToApiParams: (filters: F) => TaskFilterParams,
|
filterToApiParams: (filters: F) => TaskFilterParams,
|
||||||
viewId: IProjectView['id'],
|
viewId: Ref<IProjectView['id']>,
|
||||||
loadAll: boolean = true,
|
loadAll: boolean = true,
|
||||||
) {
|
) {
|
||||||
const taskCollectionService = shallowReactive(new TaskCollectionService())
|
const taskCollectionService = shallowReactive(new TaskCollectionService())
|
||||||
@@ -33,7 +33,7 @@ export function useGanttTaskList<F extends Filters>(
|
|||||||
params.filter_timezone = authStore.settings.timezone
|
params.filter_timezone = authStore.settings.timezone
|
||||||
}
|
}
|
||||||
|
|
||||||
const tasks = await taskCollectionService.getAll({projectId: filters.value.projectId, viewId}, params, page) as ITask[]
|
const tasks = await taskCollectionService.getAll({projectId: filters.value.projectId, viewId: viewId.value}, params, page) as ITask[]
|
||||||
if (loadAll && page < taskCollectionService.totalPages) {
|
if (loadAll && page < taskCollectionService.totalPages) {
|
||||||
const nextTasks = await fetchTasks(params, page + 1)
|
const nextTasks = await fetchTasks(params, page + 1)
|
||||||
return tasks.concat(nextTasks)
|
return tasks.concat(nextTasks)
|
||||||
@@ -105,4 +105,4 @@ export function useGanttTaskList<F extends Filters>(
|
|||||||
addTask,
|
addTask,
|
||||||
updateTask,
|
updateTask,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user