|
|
|
@ -2,6 +2,7 @@ import type { ColumnType, LinkToAnotherRecordType, PaginatedType, TableType } fr
|
|
|
|
|
import type { ComputedRef, Ref } from 'vue' |
|
|
|
|
import { Modal, message } from 'ant-design-vue' |
|
|
|
|
import { |
|
|
|
|
IsPublicInj, |
|
|
|
|
NOCO, |
|
|
|
|
computed, |
|
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
@ -39,6 +40,8 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
|
|
|
|
|
size: 10, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const isPublic: boolean = $(inject(IsPublicInj, ref(false))) |
|
|
|
|
|
|
|
|
|
const colOptions = $computed(() => column?.value.colOptions as LinkToAnotherRecordType) |
|
|
|
|
|
|
|
|
|
// getters
|
|
|
|
@ -79,8 +82,29 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
|
|
|
|
|
|
|
|
|
|
const loadChildrenExcludedList = async () => { |
|
|
|
|
try { |
|
|
|
|
/** if new row load all records */ |
|
|
|
|
if (isNewRow?.value) { |
|
|
|
|
if (isPublic) { |
|
|
|
|
const route = useRoute() |
|
|
|
|
childrenExcludedList.value = await $api.public.dataRelationList( |
|
|
|
|
route.params.viewId as string, |
|
|
|
|
column?.value?.id, |
|
|
|
|
{}, |
|
|
|
|
{ |
|
|
|
|
headers: { |
|
|
|
|
'xc-password': '', |
|
|
|
|
}, |
|
|
|
|
query: { |
|
|
|
|
limit: childrenExcludedListPagination.size, |
|
|
|
|
offset: childrenExcludedListPagination.size * (childrenExcludedListPagination.page - 1), |
|
|
|
|
where: |
|
|
|
|
childrenExcludedListPagination.query && |
|
|
|
|
`(${relatedTablePrimaryValueProp.value},like,${childrenExcludedListPagination.query})`, |
|
|
|
|
fields: [relatedTablePrimaryValueProp.value, ...relatedTablePrimaryKeyProps.value], |
|
|
|
|
} as any, |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
/** if new row load all records */ |
|
|
|
|
} else if (isNewRow?.value) { |
|
|
|
|
childrenExcludedList.value = await $api.dbTableRow.list( |
|
|
|
|
NOCO, |
|
|
|
|
project.value.id as string, |
|
|
|
|