|
|
@ -161,16 +161,6 @@ openNewRecordFormHook?.on(async () => { |
|
|
|
expandForm(newRow, undefined, true) |
|
|
|
expandForm(newRow, undefined, true) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
|
|
|
() => view.value?.id, |
|
|
|
|
|
|
|
async (next, old) => { |
|
|
|
|
|
|
|
if (next && old && next !== old) { |
|
|
|
|
|
|
|
await loadData() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ immediate: true }, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onresize = (colID: string, event: any) => { |
|
|
|
const onresize = (colID: string, event: any) => { |
|
|
|
updateWidth(colID, event.detail) |
|
|
|
updateWidth(colID, event.detail) |
|
|
|
} |
|
|
|
} |
|
|
@ -239,7 +229,6 @@ useEventListener(document, 'keyup', async (e: KeyboardEvent) => { |
|
|
|
|
|
|
|
|
|
|
|
/** On clicking outside of table reset active cell */ |
|
|
|
/** On clicking outside of table reset active cell */ |
|
|
|
const smartTable = ref(null) |
|
|
|
const smartTable = ref(null) |
|
|
|
|
|
|
|
|
|
|
|
onClickOutside(smartTable, () => { |
|
|
|
onClickOutside(smartTable, () => { |
|
|
|
clearRangeRows() |
|
|
|
clearRangeRows() |
|
|
|
if (selected.col === null) return |
|
|
|
if (selected.col === null) return |
|
|
@ -247,6 +236,7 @@ onClickOutside(smartTable, () => { |
|
|
|
const activeCol = fields.value[selected.col] |
|
|
|
const activeCol = fields.value[selected.col] |
|
|
|
|
|
|
|
|
|
|
|
if (editEnabled && (isVirtualCol(activeCol) || activeCol.uidt === UITypes.JSON)) return |
|
|
|
if (editEnabled && (isVirtualCol(activeCol) || activeCol.uidt === UITypes.JSON)) return |
|
|
|
|
|
|
|
|
|
|
|
selected.row = null |
|
|
|
selected.row = null |
|
|
|
selected.col = null |
|
|
|
selected.col = null |
|
|
|
}) |
|
|
|
}) |
|
|
@ -326,7 +316,17 @@ const expandedFormOnRowIdDlg = computed({ |
|
|
|
provide(ReloadRowDataHookInj, reloadViewDataHook) |
|
|
|
provide(ReloadRowDataHookInj, reloadViewDataHook) |
|
|
|
|
|
|
|
|
|
|
|
// trigger initial data load in grid |
|
|
|
// trigger initial data load in grid |
|
|
|
reloadViewDataHook.trigger() |
|
|
|
// reloadViewDataHook.trigger() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
|
|
|
() => view.value?.id, |
|
|
|
|
|
|
|
async (next, old) => { |
|
|
|
|
|
|
|
if (next && next !== old) { |
|
|
|
|
|
|
|
await loadData() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ immediate: true }, |
|
|
|
|
|
|
|
) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -489,12 +489,7 @@ reloadViewDataHook.trigger() |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
v-model="row.row[columnObj.title]" |
|
|
|
v-model="row.row[columnObj.title]" |
|
|
|
:column="columnObj" |
|
|
|
:column="columnObj" |
|
|
|
:edit-enabled=" |
|
|
|
:edit-enabled="hasEditPermission && editEnabled && selected.col === colIndex && selected.row === rowIndex" |
|
|
|
isUIAllowed('xcDatatableEditable') && |
|
|
|
|
|
|
|
editEnabled && |
|
|
|
|
|
|
|
selected.col === colIndex && |
|
|
|
|
|
|
|
selected.row === rowIndex |
|
|
|
|
|
|
|
" |
|
|
|
|
|
|
|
:row-index="rowIndex" |
|
|
|
:row-index="rowIndex" |
|
|
|
:active="selected.col === colIndex && selected.row === rowIndex" |
|
|
|
:active="selected.col === colIndex && selected.row === rowIndex" |
|
|
|
@update:edit-enabled="editEnabled = false" |
|
|
|
@update:edit-enabled="editEnabled = false" |
|
|
@ -508,7 +503,7 @@ reloadViewDataHook.trigger() |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</LazySmartsheetRow> |
|
|
|
</LazySmartsheetRow> |
|
|
|
|
|
|
|
|
|
|
|
<tr v-if="!isView && !isLocked && isUIAllowed('xcDatatableEditable') && !isSqlView"> |
|
|
|
<tr v-if="!isView && !isLocked && hasEditPermission && !isSqlView"> |
|
|
|
<td |
|
|
|
<td |
|
|
|
v-e="['c:row:add:grid-bottom']" |
|
|
|
v-e="['c:row:add:grid-bottom']" |
|
|
|
:colspan="visibleColLength + 1" |
|
|
|
:colspan="visibleColLength + 1" |
|
|
@ -527,7 +522,7 @@ reloadViewDataHook.trigger() |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
|
|
|
|
|
|
|
|
<template v-if="!isLocked && isUIAllowed('xcDatatableEditable')" #overlay> |
|
|
|
<template v-if="!isLocked && hasEditPermission" #overlay> |
|
|
|
<a-menu class="shadow !rounded !py-0" @click="contextMenu = false"> |
|
|
|
<a-menu class="shadow !rounded !py-0" @click="contextMenu = false"> |
|
|
|
<a-menu-item v-if="contextMenuTarget" @click="deleteRow(contextMenuTarget.row)"> |
|
|
|
<a-menu-item v-if="contextMenuTarget" @click="deleteRow(contextMenuTarget.row)"> |
|
|
|
<div v-e="['a:row:delete']" class="nc-project-menu-item"> |
|
|
|
<div v-e="['a:row:delete']" class="nc-project-menu-item"> |
|
|
|