|
|
@ -66,6 +66,7 @@ const { |
|
|
|
deleteStack, |
|
|
|
deleteStack, |
|
|
|
removeRowFromUncategorizedStack, |
|
|
|
removeRowFromUncategorizedStack, |
|
|
|
shouldScrollToRight, |
|
|
|
shouldScrollToRight, |
|
|
|
|
|
|
|
deleteRow, |
|
|
|
} = useKanbanViewStoreOrThrow() |
|
|
|
} = useKanbanViewStoreOrThrow() |
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
@ -82,6 +83,8 @@ provide(IsKanbanInj, ref(true)) |
|
|
|
|
|
|
|
|
|
|
|
provide(ReadonlyInj, !isUIAllowed('xcDatatableEditable')) |
|
|
|
provide(ReadonlyInj, !isUIAllowed('xcDatatableEditable')) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const hasEditPermission = $computed(() => isUIAllowed('xcDatatableEditable')) |
|
|
|
|
|
|
|
|
|
|
|
const fields = inject(FieldsInj, ref([])) |
|
|
|
const fields = inject(FieldsInj, ref([])) |
|
|
|
|
|
|
|
|
|
|
|
const kanbanContainerRef = ref() |
|
|
|
const kanbanContainerRef = ref() |
|
|
@ -105,7 +108,7 @@ reloadViewMetaHook?.on(async () => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const expandForm = (row: RowType, state?: Record<string, any>) => { |
|
|
|
const expandForm = (row: RowType, state?: Record<string, any>) => { |
|
|
|
if (!isUIAllowed('xcDatatableEditable')) return |
|
|
|
if (!hasEditPermission) return |
|
|
|
|
|
|
|
|
|
|
|
const rowId = extractPkFromRow(row.row, meta.value!.columns!) |
|
|
|
const rowId = extractPkFromRow(row.row, meta.value!.columns!) |
|
|
|
|
|
|
|
|
|
|
@ -123,6 +126,25 @@ const expandForm = (row: RowType, state?: Record<string, any>) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _contextMenu = ref(false) |
|
|
|
|
|
|
|
const contextMenu = computed({ |
|
|
|
|
|
|
|
get: () => _contextMenu.value, |
|
|
|
|
|
|
|
set: (val) => { |
|
|
|
|
|
|
|
if (hasEditPermission) { |
|
|
|
|
|
|
|
_contextMenu.value = val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const contextMenuTarget = ref<RowType | null>(null) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showContextMenu = (e: MouseEvent, target?: RowType) => { |
|
|
|
|
|
|
|
e.preventDefault() |
|
|
|
|
|
|
|
if (target) { |
|
|
|
|
|
|
|
contextMenuTarget.value = target |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const expandedFormOnRowIdDlg = computed({ |
|
|
|
const expandedFormOnRowIdDlg = computed({ |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
return !!route.query.rowId |
|
|
|
return !!route.query.rowId |
|
|
@ -250,11 +272,19 @@ watch( |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// reset context menu target on hide |
|
|
|
|
|
|
|
watch(contextMenu, () => { |
|
|
|
|
|
|
|
if (!contextMenu.value) { |
|
|
|
|
|
|
|
contextMenuTarget.value = null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex h-full bg-white px-2"> |
|
|
|
<div class="flex h-full bg-white px-2"> |
|
|
|
<div ref="kanbanContainerRef" class="nc-kanban-container flex my-4 px-3 overflow-x-scroll overflow-y-hidden"> |
|
|
|
<div ref="kanbanContainerRef" class="nc-kanban-container flex my-4 px-3 overflow-x-scroll overflow-y-hidden"> |
|
|
|
|
|
|
|
<a-dropdown v-model:visible="contextMenu" :trigger="['contextmenu']" overlay-class-name="nc-dropdown-kanban-context-menu"> |
|
|
|
<!-- Draggable Stack --> |
|
|
|
<!-- Draggable Stack --> |
|
|
|
<Draggable |
|
|
|
<Draggable |
|
|
|
v-model="groupingFieldColOptions" |
|
|
|
v-model="groupingFieldColOptions" |
|
|
@ -276,8 +306,8 @@ watch( |
|
|
|
:key="stack.id" |
|
|
|
:key="stack.id" |
|
|
|
class="mx-4 !bg-[#f0f2f5] flex flex-col w-[280px] h-full rounded-[12px]" |
|
|
|
class="mx-4 !bg-[#f0f2f5] flex flex-col w-[280px] h-full rounded-[12px]" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'not-draggable': stack.id === 'uncategorized' || isLocked || isPublic || !isUIAllowed('xcDatatableEditable'), |
|
|
|
'not-draggable': stack.id === 'uncategorized' || isLocked || isPublic || !hasEditPermission, |
|
|
|
'!cursor-default': isLocked || !isUIAllowed('xcDatatableEditable'), |
|
|
|
'!cursor-default': isLocked || !hasEditPermission, |
|
|
|
}" |
|
|
|
}" |
|
|
|
:head-style="{ paddingBottom: '0px' }" |
|
|
|
:head-style="{ paddingBottom: '0px' }" |
|
|
|
:body-style="{ padding: '0px', height: '100%' }" |
|
|
|
:body-style="{ padding: '0px', height: '100%' }" |
|
|
@ -305,7 +335,7 @@ watch( |
|
|
|
<template v-if="!isLocked" #overlay> |
|
|
|
<template v-if="!isLocked" #overlay> |
|
|
|
<a-menu class="ml-6 !text-sm !px-0 !py-2 !rounded"> |
|
|
|
<a-menu class="ml-6 !text-sm !px-0 !py-2 !rounded"> |
|
|
|
<a-menu-item |
|
|
|
<a-menu-item |
|
|
|
v-if="isUIAllowed('xcDatatableEditable') && !isPublic" |
|
|
|
v-if="hasEditPermission && !isPublic" |
|
|
|
v-e="['c:kanban:add-new-record']" |
|
|
|
v-e="['c:kanban:add-new-record']" |
|
|
|
@click="openNewRecordFormHook.trigger(stack.title === 'uncategorized' ? null : stack.title)" |
|
|
|
@click="openNewRecordFormHook.trigger(stack.title === 'uncategorized' ? null : stack.title)" |
|
|
|
> |
|
|
|
> |
|
|
@ -321,7 +351,7 @@ watch( |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-menu-item> |
|
|
|
</a-menu-item> |
|
|
|
<a-menu-item |
|
|
|
<a-menu-item |
|
|
|
v-if="stack.title !== 'uncategorized' && !isPublic && isUIAllowed('xcDatatableEditable')" |
|
|
|
v-if="stack.title !== 'uncategorized' && !isPublic && hasEditPermission" |
|
|
|
v-e="['c:kanban:delete-stack']" |
|
|
|
v-e="['c:kanban:delete-stack']" |
|
|
|
@click="handleDeleteStackClick(stack.title, stackIdx)" |
|
|
|
@click="handleDeleteStackClick(stack.title, stackIdx)" |
|
|
|
> |
|
|
|
> |
|
|
@ -358,11 +388,12 @@ watch( |
|
|
|
:data-stack="stack.title" |
|
|
|
:data-stack="stack.title" |
|
|
|
class="!rounded-lg h-full overflow-hidden break-all max-w-[450px] shadow-lg" |
|
|
|
class="!rounded-lg h-full overflow-hidden break-all max-w-[450px] shadow-lg" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'not-draggable': isLocked || !isUIAllowed('xcDatatableEditable') || isPublic, |
|
|
|
'not-draggable': isLocked || !hasEditPermission || isPublic, |
|
|
|
'!cursor-default': isLocked || !isUIAllowed('xcDatatableEditable') || isPublic, |
|
|
|
'!cursor-default': isLocked || !hasEditPermission || isPublic, |
|
|
|
}" |
|
|
|
}" |
|
|
|
:body-style="{ padding: '10px' }" |
|
|
|
:body-style="{ padding: '10px' }" |
|
|
|
@click="expandFormClick($event, record)" |
|
|
|
@click="expandFormClick($event, record)" |
|
|
|
|
|
|
|
@contextmenu="showContextMenu($event, record)" |
|
|
|
> |
|
|
|
> |
|
|
|
<div |
|
|
|
<div |
|
|
|
v-for="col in fields" |
|
|
|
v-for="col in fields" |
|
|
@ -433,7 +464,7 @@ watch( |
|
|
|
:style="`background-color: ${stack.color} !important`" |
|
|
|
:style="`background-color: ${stack.color} !important`" |
|
|
|
class="nc-kanban-stack nc-kanban-collapsed-stack mx-4 flex items-center w-[300px] h-[50px] rounded-[12px] cursor-pointer h-full !pr-[10px]" |
|
|
|
class="nc-kanban-stack nc-kanban-collapsed-stack mx-4 flex items-center w-[300px] h-[50px] rounded-[12px] cursor-pointer h-full !pr-[10px]" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'not-draggable': stack.id === 'uncategorized' || isLocked || isPublic || !isUIAllowed('xcDatatableEditable'), |
|
|
|
'not-draggable': stack.id === 'uncategorized' || isLocked || isPublic || !hasEditPermission, |
|
|
|
}" |
|
|
|
}" |
|
|
|
:body-style="{ padding: '0px', height: '100%', width: '100%', background: '#f0f2f5 !important' }" |
|
|
|
:body-style="{ padding: '0px', height: '100%', width: '100%', background: '#f0f2f5 !important' }" |
|
|
|
> |
|
|
|
> |
|
|
@ -456,6 +487,18 @@ watch( |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</Draggable> |
|
|
|
</Draggable> |
|
|
|
|
|
|
|
<!-- Drop down Menu --> |
|
|
|
|
|
|
|
<template v-if="!isLocked && hasEditPermission" #overlay> |
|
|
|
|
|
|
|
<a-menu class="shadow !rounded !py-0" @click="contextMenu = false"> |
|
|
|
|
|
|
|
<a-menu-item v-if="contextMenuTarget" @click="deleteRow(contextMenuTarget)"> |
|
|
|
|
|
|
|
<div v-e="['a:row:delete']" class="nc-project-menu-item"> |
|
|
|
|
|
|
|
<!-- Delete Row --> |
|
|
|
|
|
|
|
{{ $t('activity.deleteRow') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</a-menu-item> |
|
|
|
|
|
|
|
</a-menu> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</a-dropdown> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|