|
|
@ -46,6 +46,10 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
|
|
|
|
|
|
|
|
const colOptions = $computed(() => column?.value.colOptions as LinkToAnotherRecordType) |
|
|
|
const colOptions = $computed(() => column?.value.colOptions as LinkToAnotherRecordType) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { sharedView } = useSharedView() as Record<string, any> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const projectId = project?.value?.id || sharedView.value.view.project_id |
|
|
|
|
|
|
|
|
|
|
|
// getters
|
|
|
|
// getters
|
|
|
|
const meta = computed(() => metas?.value?.[column?.value?.fk_model_id as string]) |
|
|
|
const meta = computed(() => metas?.value?.[column?.value?.fk_model_id as string]) |
|
|
|
const relatedTableMeta = computed<TableType>(() => { |
|
|
|
const relatedTableMeta = computed<TableType>(() => { |
|
|
@ -109,7 +113,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
} else if (isNewRow?.value) { |
|
|
|
} else if (isNewRow?.value) { |
|
|
|
childrenExcludedList.value = await $api.dbTableRow.list( |
|
|
|
childrenExcludedList.value = await $api.dbTableRow.list( |
|
|
|
NOCO, |
|
|
|
NOCO, |
|
|
|
project.value.id as string, |
|
|
|
projectId, |
|
|
|
relatedTableMeta?.value?.id as string, |
|
|
|
relatedTableMeta?.value?.id as string, |
|
|
|
{ |
|
|
|
{ |
|
|
|
limit: childrenExcludedListPagination.size, |
|
|
|
limit: childrenExcludedListPagination.size, |
|
|
@ -123,7 +127,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
childrenExcludedList.value = await $api.dbTableRow.nestedChildrenExcludedList( |
|
|
|
childrenExcludedList.value = await $api.dbTableRow.nestedChildrenExcludedList( |
|
|
|
NOCO, |
|
|
|
NOCO, |
|
|
|
project.value.id as string, |
|
|
|
projectId, |
|
|
|
meta.value.id, |
|
|
|
meta.value.id, |
|
|
|
rowId.value, |
|
|
|
rowId.value, |
|
|
|
colOptions.type as 'mm' | 'hm', |
|
|
|
colOptions.type as 'mm' | 'hm', |
|
|
@ -146,10 +150,10 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
const loadChildrenList = async () => { |
|
|
|
const loadChildrenList = async () => { |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (colOptions.type === 'bt') return |
|
|
|
if (colOptions.type === 'bt') return |
|
|
|
|
|
|
|
// console.log(sharedView.value.view.project_id)
|
|
|
|
childrenList.value = await $api.dbTableRow.nestedList( |
|
|
|
childrenList.value = await $api.dbTableRow.nestedList( |
|
|
|
NOCO, |
|
|
|
NOCO, |
|
|
|
project.value.id as string, |
|
|
|
(project?.value?.id || sharedView?.value?.view?.project_id) as string, |
|
|
|
meta.value.id, |
|
|
|
meta.value.id, |
|
|
|
rowId.value, |
|
|
|
rowId.value, |
|
|
|
colOptions.type as 'mm' | 'hm', |
|
|
|
colOptions.type as 'mm' | 'hm', |
|
|
@ -172,7 +176,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
onOk: async () => { |
|
|
|
onOk: async () => { |
|
|
|
const id = getRelatedTableRowId(row) |
|
|
|
const id = getRelatedTableRowId(row) |
|
|
|
try { |
|
|
|
try { |
|
|
|
$api.dbTableRow.delete(NOCO, project.value.id as string, relatedTableMeta.value.id as string, id as string) |
|
|
|
$api.dbTableRow.delete(NOCO, projectId, relatedTableMeta.value.id as string, id as string) |
|
|
|
reloadData?.() |
|
|
|
reloadData?.() |
|
|
|
|
|
|
|
|
|
|
|
/** reload child list if not a new row */ |
|
|
|
/** reload child list if not a new row */ |
|
|
|