|
|
@ -12,6 +12,7 @@ import { |
|
|
|
OpenNewRecordFormHookInj, |
|
|
|
OpenNewRecordFormHookInj, |
|
|
|
PaginationDataInj, |
|
|
|
PaginationDataInj, |
|
|
|
ReadonlyInj, |
|
|
|
ReadonlyInj, |
|
|
|
|
|
|
|
ReloadRowDataHookInj, |
|
|
|
ReloadViewMetaHookInj, |
|
|
|
ReloadViewMetaHookInj, |
|
|
|
extractPkFromRow, |
|
|
|
extractPkFromRow, |
|
|
|
inject, |
|
|
|
inject, |
|
|
@ -29,6 +30,7 @@ interface Attachment { |
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
const reloadViewMetaHook = inject(ReloadViewMetaHookInj) |
|
|
|
const reloadViewMetaHook = inject(ReloadViewMetaHookInj) |
|
|
|
|
|
|
|
const reloadViewDataHook = inject(ReloadViewDataHookInj) |
|
|
|
const openNewRecordFormHook = inject(OpenNewRecordFormHookInj, createEventHook()) |
|
|
|
const openNewRecordFormHook = inject(OpenNewRecordFormHookInj, createEventHook()) |
|
|
|
|
|
|
|
|
|
|
|
const expandedFormDlg = ref(false) |
|
|
|
const expandedFormDlg = ref(false) |
|
|
@ -85,7 +87,7 @@ const attachments = (record: any): Array<Attachment> => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const expandForm = (row: RowType, _state?: Record<string, any>) => { |
|
|
|
const expandForm = (row: RowType, state?: Record<string, any>) => { |
|
|
|
if (!isUIAllowed('xcDatatableEditable')) return |
|
|
|
if (!isUIAllowed('xcDatatableEditable')) return |
|
|
|
|
|
|
|
|
|
|
|
const rowId = extractPkFromRow(row.row, meta.value.columns) |
|
|
|
const rowId = extractPkFromRow(row.row, meta.value.columns) |
|
|
@ -140,11 +142,17 @@ reloadViewMetaHook?.on(async () => { |
|
|
|
reloadAttachments.value = false |
|
|
|
reloadAttachments.value = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
reloadViewDataHook?.on(async () => { |
|
|
|
|
|
|
|
await loadData() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
onMounted(async () => { |
|
|
|
await loadData() |
|
|
|
await loadData() |
|
|
|
await loadGalleryData() |
|
|
|
await loadGalleryData() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// provide view data reload hook as fallback to row data reload |
|
|
|
|
|
|
|
provide(ReloadRowDataHookInj, reloadViewDataHook) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|