fix(gantt): open task with double click from the gantt chart
This commit is contained in:
parent
09ffd9414b
commit
a6eb804fae
@ -1,5 +1,5 @@
|
|||||||
import {computed, ref, watch, type Ref} from 'vue'
|
import {computed, ref, watch, type Ref} from 'vue'
|
||||||
import {useRouter, type RouteLocationNormalized, type RouteLocationRaw} from 'vue-router'
|
import {useRouter, type RouteLocationNormalized, type RouteLocationRaw, type RouteRecordName} from 'vue-router'
|
||||||
import equal from 'fast-deep-equal/es6'
|
import equal from 'fast-deep-equal/es6'
|
||||||
|
|
||||||
export type Filters = Record<string, any>
|
export type Filters = Record<string, any>
|
||||||
@ -9,6 +9,7 @@ export function useRouteFilters<CurrentFilters extends Filters>(
|
|||||||
getDefaultFilters: (route: RouteLocationNormalized) => CurrentFilters,
|
getDefaultFilters: (route: RouteLocationNormalized) => CurrentFilters,
|
||||||
routeToFilters: (route: RouteLocationNormalized) => CurrentFilters,
|
routeToFilters: (route: RouteLocationNormalized) => CurrentFilters,
|
||||||
filtersToRoute: (filters: CurrentFilters) => RouteLocationRaw,
|
filtersToRoute: (filters: CurrentFilters) => RouteLocationRaw,
|
||||||
|
routeAllowList: RouteRecordName[] = [],
|
||||||
) {
|
) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@ -21,7 +22,8 @@ export function useRouteFilters<CurrentFilters extends Filters>(
|
|||||||
(route, oldRoute) => {
|
(route, oldRoute) => {
|
||||||
if (
|
if (
|
||||||
route?.name !== oldRoute?.name ||
|
route?.name !== oldRoute?.name ||
|
||||||
routeFromFiltersFullPath.value === route.fullPath
|
routeFromFiltersFullPath.value === route.fullPath ||
|
||||||
|
!routeAllowList.includes(route.name ?? '')
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,7 @@ export function useGanttFilters(route: Ref<RouteLocationNormalized>): UseGanttFi
|
|||||||
ganttGetDefaultFilters,
|
ganttGetDefaultFilters,
|
||||||
ganttRouteToFilters,
|
ganttRouteToFilters,
|
||||||
ganttFiltersToRoute,
|
ganttFiltersToRoute,
|
||||||
|
['project.gantt'],
|
||||||
)
|
)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user