|
|
@ -21,6 +21,8 @@ const emit = defineEmits(['update:modelValue', 'addNewRecord']) |
|
|
|
|
|
|
|
|
|
|
|
const vModel = useVModel(props, 'modelValue', emit) |
|
|
|
const vModel = useVModel(props, 'modelValue', emit) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isMobileMode } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const injectedColumn = inject(ColumnInj) |
|
|
|
const injectedColumn = inject(ColumnInj) |
|
|
|
|
|
|
|
|
|
|
|
const filterQueryRef = ref() |
|
|
|
const filterQueryRef = ref() |
|
|
@ -138,7 +140,7 @@ const attachmentCol = computedInject(FieldsInj, (_fields) => { |
|
|
|
const fields = computedInject(FieldsInj, (_fields) => { |
|
|
|
const fields = computedInject(FieldsInj, (_fields) => { |
|
|
|
return (relatedTableMeta.value.columns ?? []) |
|
|
|
return (relatedTableMeta.value.columns ?? []) |
|
|
|
.filter((col) => !isSystemColumn(col) && !isPrimary(col) && !isLinksOrLTAR(col) && !isAttachment(col)) |
|
|
|
.filter((col) => !isSystemColumn(col) && !isPrimary(col) && !isLinksOrLTAR(col) && !isAttachment(col)) |
|
|
|
.slice(0, 4) |
|
|
|
.slice(0, isMobileMode.value ? 1 : 4) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const relation = computed(() => { |
|
|
|
const relation = computed(() => { |
|
|
@ -157,13 +159,13 @@ onKeyStroke('Escape', () => { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<a-modal |
|
|
|
<NcModal |
|
|
|
v-model:visible="vModel" |
|
|
|
v-model:visible="vModel" |
|
|
|
:class="{ active: vModel }" |
|
|
|
:class="{ active: vModel }" |
|
|
|
:footer="null" |
|
|
|
:footer="null" |
|
|
|
:width="isForm ? 600 : 800" |
|
|
|
:width="isForm ? 600 : 800" |
|
|
|
:closable="false" |
|
|
|
:closable="false" |
|
|
|
:body-style="{ 'padding': 0, 'margin': 0, 'min-height': '500px' }" |
|
|
|
:body-style="{ 'max-height': '640px', 'height': '85vh' }" |
|
|
|
wrap-class-name="nc-modal-link-record" |
|
|
|
wrap-class-name="nc-modal-link-record" |
|
|
|
> |
|
|
|
> |
|
|
|
<LazyVirtualCellComponentsHeader |
|
|
|
<LazyVirtualCellComponentsHeader |
|
|
@ -173,7 +175,7 @@ onKeyStroke('Escape', () => { |
|
|
|
:related-table-title="relatedTableMeta?.title" |
|
|
|
:related-table-title="relatedTableMeta?.title" |
|
|
|
:display-value="row.row[displayValueProp]" |
|
|
|
:display-value="row.row[displayValueProp]" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<div class="m-4 bg-gray-50 border-gray-50 border-b-2"></div> |
|
|
|
<div class="!xs:hidden my-3 bg-gray-50 border-gray-50 border-b-2"></div> |
|
|
|
<div class="flex mt-2 mb-2 items-center gap-2"> |
|
|
|
<div class="flex mt-2 mb-2 items-center gap-2"> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="flex items-center border-1 p-1 rounded-md w-full border-gray-200" |
|
|
|
class="flex items-center border-1 p-1 rounded-md w-full border-gray-200" |
|
|
@ -184,7 +186,7 @@ onKeyStroke('Escape', () => { |
|
|
|
ref="filterQueryRef" |
|
|
|
ref="filterQueryRef" |
|
|
|
v-model:value="childrenExcludedListPagination.query" |
|
|
|
v-model:value="childrenExcludedListPagination.query" |
|
|
|
:placeholder="`${$t('general.searchIn')} ${relatedTableMeta?.title}`" |
|
|
|
:placeholder="`${$t('general.searchIn')} ${relatedTableMeta?.title}`" |
|
|
|
class="w-full !rounded-md nc-excluded-search" |
|
|
|
class="w-full !rounded-md nc-excluded-search xs:min-h-8" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
:bordered="false" |
|
|
|
:bordered="false" |
|
|
|
@focus="isFocused = true" |
|
|
|
@focus="isFocused = true" |
|
|
@ -202,7 +204,7 @@ onKeyStroke('Escape', () => { |
|
|
|
v-if="!isPublic" |
|
|
|
v-if="!isPublic" |
|
|
|
v-e="['c:row-expand:open']" |
|
|
|
v-e="['c:row-expand:open']" |
|
|
|
type="secondary" |
|
|
|
type="secondary" |
|
|
|
size="xl" |
|
|
|
:size="isMobileMode ? 'medium' : 'small'" |
|
|
|
class="!text-brand-500" |
|
|
|
class="!text-brand-500" |
|
|
|
@click=" |
|
|
|
@click=" |
|
|
|
() => { |
|
|
|
() => { |
|
|
@ -211,13 +213,12 @@ onKeyStroke('Escape', () => { |
|
|
|
} |
|
|
|
} |
|
|
|
" |
|
|
|
" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="flex items-center gap-1"><MdiPlus /> {{ $t('activity.newRecord') }}</div> |
|
|
|
<div class="flex items-center gap-1 px-4"><MdiPlus v-if="!isMobileMode" /> {{ $t('activity.newRecord') }}</div> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<template v-if="childrenExcludedList?.pageInfo?.totalRows || isChildrenExcludedLoading"> |
|
|
|
<template v-if="childrenExcludedList?.pageInfo?.totalRows"> |
|
|
|
<div class="pb-2 pt-1"> |
|
|
|
<div class="overflow-scroll nc-scrollbar-md pr-1 cursor-pointer flex flex-col flex-grow"> |
|
|
|
<div class="h-[420px] overflow-scroll nc-scrollbar-md pr-1 cursor-pointer"> |
|
|
|
|
|
|
|
<template v-if="isChildrenExcludedLoading"> |
|
|
|
<template v-if="isChildrenExcludedLoading"> |
|
|
|
<div |
|
|
|
<div |
|
|
|
v-for="(x, i) in Array.from({ length: 10 })" |
|
|
|
v-for="(x, i) in Array.from({ length: 10 })" |
|
|
@ -226,23 +227,23 @@ onKeyStroke('Escape', () => { |
|
|
|
> |
|
|
|
> |
|
|
|
<a-skeleton-image class="h-24 w-24 !rounded-xl" /> |
|
|
|
<a-skeleton-image class="h-24 w-24 !rounded-xl" /> |
|
|
|
<div class="flex flex-col m-[.5rem] gap-2 flex-grow justify-center"> |
|
|
|
<div class="flex flex-col m-[.5rem] gap-2 flex-grow justify-center"> |
|
|
|
<a-skeleton-input class="!w-48 !rounded-xl" active size="small" /> |
|
|
|
<a-skeleton-input class="!xs:w-30 !w-48 !rounded-xl" active size="small" /> |
|
|
|
<div class="flex flex-row gap-6 w-10/12"> |
|
|
|
<div class="flex flex-row gap-6 w-10/12"> |
|
|
|
<div class="flex flex-col gap-0.5"> |
|
|
|
<div class="flex flex-col gap-0.5"> |
|
|
|
<a-skeleton-input class="!h-4 !w-12" active size="small" /> |
|
|
|
<a-skeleton-input class="!h-4 !w-12" active size="small" /> |
|
|
|
<a-skeleton-input class="!h-4 !w-24" active size="small" /> |
|
|
|
<a-skeleton-input class="!xs:hidden !h-4 !w-24" active size="small" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex flex-col gap-0.5"> |
|
|
|
<div class="flex flex-col gap-0.5"> |
|
|
|
<a-skeleton-input class="!h-4 !w-12" active size="small" /> |
|
|
|
<a-skeleton-input class="!h-4 !w-12" active size="small" /> |
|
|
|
<a-skeleton-input class="!h-4 !w-24" active size="small" /> |
|
|
|
<a-skeleton-input class="!xs:hidden !h-4 !w-24" active size="small" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex flex-col gap-0.5"> |
|
|
|
<div class="flex flex-col gap-0.5"> |
|
|
|
<a-skeleton-input class="!h-4 !w-12" active size="small" /> |
|
|
|
<a-skeleton-input class="!h-4 !w-12" active size="small" /> |
|
|
|
<a-skeleton-input class="!h-4 !w-24" active size="small" /> |
|
|
|
<a-skeleton-input class="!xs:hidden !h-4 !w-24" active size="small" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex flex-col gap-0.5"> |
|
|
|
<div class="flex flex-col gap-0.5"> |
|
|
|
<a-skeleton-input class="!h-4 !w-12" active size="small" /> |
|
|
|
<a-skeleton-input class="!h-4 !w-12" active size="small" /> |
|
|
|
<a-skeleton-input class="!h-4 !w-24" active size="small" /> |
|
|
|
<a-skeleton-input class="!xs:hidden !h-4 !w-24" active size="small" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -274,36 +275,41 @@ onKeyStroke('Escape', () => { |
|
|
|
/> |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<div |
|
|
|
<div v-else class="my-auto py-2 flex flex-col gap-3 items-center justify-center text-gray-500"> |
|
|
|
v-if="!isChildrenExcludedLoading && !childrenExcludedList?.pageInfo?.totalRows" |
|
|
|
|
|
|
|
class="py-2 h-[420px] flex flex-col gap-3 items-center justify-center text-gray-500" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<InboxIcon class="w-16 h-16 mx-auto" /> |
|
|
|
<InboxIcon class="w-16 h-16 mx-auto" /> |
|
|
|
<p> |
|
|
|
<p> |
|
|
|
{{ $t('msg.thereAreNoRecordsInTable') }} |
|
|
|
{{ $t('msg.thereAreNoRecordsInTable') }} |
|
|
|
{{ relatedTableMeta?.title }} |
|
|
|
{{ relatedTableMeta?.title }} |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="my-2 bg-gray-50 border-gray-50 border-b-2"></div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-row justify-between bg-white relative pt-1"> |
|
|
|
<div v-if="isMobileMode" class="flex flex-row justify-center items-center w-full my-2"> |
|
|
|
<div v-if="!isForm" class="flex items-center justify-center px-2 rounded-md text-gray-500 bg-brand-50"> |
|
|
|
<NcPagination |
|
|
|
|
|
|
|
v-if="childrenExcludedList?.pageInfo" |
|
|
|
|
|
|
|
v-model:current="childrenExcludedListPagination.page" |
|
|
|
|
|
|
|
v-model:page-size="childrenExcludedListPagination.size" |
|
|
|
|
|
|
|
:total="+childrenExcludedList.pageInfo.totalRows" |
|
|
|
|
|
|
|
entity-name="links-excluded-list" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="mb-2 bg-gray-50 border-gray-50 border-b-2"></div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex flex-row justify-between items-center bg-white relative pt-1"> |
|
|
|
|
|
|
|
<div v-if="!isForm" class="flex items-center justify-center px-2 rounded-md text-gray-500 bg-brand-50 h-9.5"> |
|
|
|
{{ relation === 'bt' ? (row.row[relatedTableMeta?.title] ? '1' : 0) : childrenListCount ?? 'No' }} |
|
|
|
{{ relation === 'bt' ? (row.row[relatedTableMeta?.title] ? '1' : 0) : childrenListCount ?? 'No' }} |
|
|
|
{{ $t('objects.records') }} {{ childrenListCount !== 0 ? 'are' : '' }} {{ $t('general.linked') }} |
|
|
|
{{ !isMobileMode ? $t('objects.records') : '' }} {{ !isMobileMode && childrenListCount !== 0 ? 'are' : '' }} |
|
|
|
|
|
|
|
{{ $t('general.linked') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex absolute items-center py-2 justify-center w-full"> |
|
|
|
<div class="!xs:hidden flex absolute -mt-0.75 items-center py-2 justify-center w-full"> |
|
|
|
<a-pagination |
|
|
|
<NcPagination |
|
|
|
v-if="childrenExcludedList?.pageInfo" |
|
|
|
v-if="childrenExcludedList?.pageInfo" |
|
|
|
v-model:current="childrenExcludedListPagination.page" |
|
|
|
v-model:current="childrenExcludedListPagination.page" |
|
|
|
v-model:page-size="childrenExcludedListPagination.size" |
|
|
|
v-model:page-size="childrenExcludedListPagination.size" |
|
|
|
:total="+childrenExcludedList.pageInfo.totalRows" |
|
|
|
:total="+childrenExcludedList.pageInfo.totalRows" |
|
|
|
:show-size-changer="false" |
|
|
|
entity-name="links-excluded-list" |
|
|
|
class="mt-2 mx-auto" |
|
|
|
mode="simple" |
|
|
|
size="small" |
|
|
|
|
|
|
|
hide-on-single-page |
|
|
|
|
|
|
|
show-less-items |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<NcButton class="nc-close-btn ml-auto" type="ghost" @click="vModel = false"> {{ $t('general.finish') }} </NcButton> |
|
|
|
<NcButton class="nc-close-btn ml-auto" type="ghost" @click="vModel = false"> {{ $t('general.finish') }} </NcButton> |
|
|
@ -327,5 +333,11 @@ onKeyStroke('Escape', () => { |
|
|
|
use-meta-fields |
|
|
|
use-meta-fields |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Suspense> |
|
|
|
</Suspense> |
|
|
|
</a-modal> |
|
|
|
</NcModal> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
|
|
|
.nc-modal-link-record > .ant-modal > .ant-modal-content { |
|
|
|
|
|
|
|
@apply !p-0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|