|
|
@ -7,6 +7,7 @@ import { |
|
|
|
type TableType, |
|
|
|
type TableType, |
|
|
|
dateFormats, |
|
|
|
dateFormats, |
|
|
|
timeFormats, |
|
|
|
timeFormats, |
|
|
|
|
|
|
|
parseStringDateTime, |
|
|
|
} from 'nocodb-sdk' |
|
|
|
} from 'nocodb-sdk' |
|
|
|
import type { ComputedRef, Ref } from 'vue' |
|
|
|
import type { ComputedRef, Ref } from 'vue' |
|
|
|
import { |
|
|
|
import { |
|
|
@ -131,8 +132,16 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
return (relatedTableMeta.value?.columns?.find((c) => c.pv) || relatedTableMeta?.value?.columns?.[0])?.title || '' |
|
|
|
return (relatedTableMeta.value?.columns?.find((c) => c.pv) || relatedTableMeta?.value?.columns?.[0])?.title || '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const relatedTableDisplayValueTypeAndFormatProp = computed(() => { |
|
|
|
const relatedTablePrimaryKeyProps = computed(() => { |
|
|
|
let dateOrDateTimeFieldTypeAndFormat = { |
|
|
|
return relatedTableMeta.value?.columns?.filter((c) => c.pk)?.map((c) => c.title) ?? [] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const displayValueProp = computed(() => { |
|
|
|
|
|
|
|
return (meta.value?.columns?.find((c: Required<ColumnType>) => c.pv) || relatedTableMeta?.value?.columns?.[0])?.title |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const displayValueTypeAndFormatProp = computed(() => { |
|
|
|
|
|
|
|
let displayValueTypeAndFormat = { |
|
|
|
type: '', |
|
|
|
type: '', |
|
|
|
format: '', |
|
|
|
format: '', |
|
|
|
} |
|
|
|
} |
|
|
@ -140,7 +149,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
|
|
|
|
|
|
|
|
if (currentColumn) { |
|
|
|
if (currentColumn) { |
|
|
|
if (currentColumn?.uidt === UITypes.DateTime) { |
|
|
|
if (currentColumn?.uidt === UITypes.DateTime) { |
|
|
|
dateOrDateTimeFieldTypeAndFormat = { |
|
|
|
displayValueTypeAndFormat = { |
|
|
|
type: currentColumn?.uidt, |
|
|
|
type: currentColumn?.uidt, |
|
|
|
format: `${parseProp(currentColumn?.meta)?.date_format ?? dateFormats[0]} ${ |
|
|
|
format: `${parseProp(currentColumn?.meta)?.date_format ?? dateFormats[0]} ${ |
|
|
|
parseProp(currentColumn?.meta)?.time_format ?? timeFormats[0] |
|
|
|
parseProp(currentColumn?.meta)?.time_format ?? timeFormats[0] |
|
|
@ -148,21 +157,28 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (currentColumn?.uidt === UITypes.Time) { |
|
|
|
if (currentColumn?.uidt === UITypes.Time) { |
|
|
|
dateOrDateTimeFieldTypeAndFormat = { |
|
|
|
displayValueTypeAndFormat = { |
|
|
|
type: currentColumn?.uidt, |
|
|
|
type: currentColumn?.uidt, |
|
|
|
format: `${timeFormats[0]}`, |
|
|
|
format: `${timeFormats[0]}`, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return dateOrDateTimeFieldTypeAndFormat |
|
|
|
return displayValueTypeAndFormat |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const relatedTablePrimaryKeyProps = computed(() => { |
|
|
|
const headerDisplayValue = computed(() => { |
|
|
|
return relatedTableMeta.value?.columns?.filter((c) => c.pk)?.map((c) => c.title) ?? [] |
|
|
|
if ( |
|
|
|
}) |
|
|
|
row.value.row[displayValueProp.value] && |
|
|
|
|
|
|
|
displayValueTypeAndFormatProp.value.type && |
|
|
|
const displayValueProp = computed(() => { |
|
|
|
displayValueTypeAndFormatProp.value.format |
|
|
|
return (meta.value?.columns?.find((c: Required<ColumnType>) => c.pv) || relatedTableMeta?.value?.columns?.[0])?.title |
|
|
|
) { |
|
|
|
|
|
|
|
return parseStringDateTime( |
|
|
|
|
|
|
|
row.value.row[displayValueProp.value], |
|
|
|
|
|
|
|
displayValueTypeAndFormatProp.value.format, |
|
|
|
|
|
|
|
!(displayValueTypeAndFormatProp.value.format === UITypes.Time), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return row.value.row[displayValueProp.value] |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const loadChildrenExcludedList = async (activeState?: any) => { |
|
|
|
const loadChildrenExcludedList = async (activeState?: any) => { |
|
|
@ -507,7 +523,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
relatedTableMeta, |
|
|
|
relatedTableMeta, |
|
|
|
loadRelatedTableMeta, |
|
|
|
loadRelatedTableMeta, |
|
|
|
relatedTableDisplayValueProp, |
|
|
|
relatedTableDisplayValueProp, |
|
|
|
relatedTableDisplayValueTypeAndFormatProp, |
|
|
|
displayValueTypeAndFormatProp, |
|
|
|
childrenExcludedList, |
|
|
|
childrenExcludedList, |
|
|
|
childrenList, |
|
|
|
childrenList, |
|
|
|
childrenListCount, |
|
|
|
childrenListCount, |
|
|
@ -529,6 +545,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( |
|
|
|
isChildrenExcludedLoading, |
|
|
|
isChildrenExcludedLoading, |
|
|
|
deleteRelatedRow, |
|
|
|
deleteRelatedRow, |
|
|
|
getRelatedTableRowId, |
|
|
|
getRelatedTableRowId, |
|
|
|
|
|
|
|
headerDisplayValue |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
'ltar-store', |
|
|
|
'ltar-store', |
|
|
|