|
|
@ -41,6 +41,8 @@ const injectedColumn = inject(ColumnInj, ref()) |
|
|
|
|
|
|
|
|
|
|
|
const readOnly = inject(ReadonlyInj, ref(false)) |
|
|
|
const readOnly = inject(ReadonlyInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const filterQueryRef = ref<HTMLInputElement>() |
|
|
|
|
|
|
|
|
|
|
|
const { isSharedBase } = storeToRefs(useBase()) |
|
|
|
const { isSharedBase } = storeToRefs(useBase()) |
|
|
|
|
|
|
|
|
|
|
|
const { |
|
|
|
const { |
|
|
@ -92,8 +94,6 @@ const attachmentCol = computedInject(FieldsInj, (_fields) => { |
|
|
|
return (relatedTableMeta.value.columns ?? []).filter((col) => isAttachment(col))[0] |
|
|
|
return (relatedTableMeta.value.columns ?? []).filter((col) => isAttachment(col))[0] |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const isFocused = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)) |
|
|
@ -175,6 +175,12 @@ const linkOrUnLink = (rowRef: Record<string, string>, id: string) => { |
|
|
|
linkRow(rowRef, parseInt(id)) |
|
|
|
linkRow(rowRef, parseInt(id)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch([filterQueryRef, isDataExist], () => { |
|
|
|
|
|
|
|
if (readOnly.value || isPublic.value ? isDataExist.value : true) { |
|
|
|
|
|
|
|
filterQueryRef.value?.focus() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -198,11 +204,8 @@ const linkOrUnLink = (rowRef: Record<string, string>, id: string) => { |
|
|
|
:display-value="headerDisplayValue" |
|
|
|
:display-value="headerDisplayValue" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<div v-if="!isForm" class="flex mt-2 mb-2 items-center gap-2"> |
|
|
|
<div v-if="!isForm" 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 !focus-within:border-primary"> |
|
|
|
class="flex items-center border-1 p-1 rounded-md w-full border-gray-200" |
|
|
|
<MdiMagnify class="w-5 h-5 ml-2 text-gray-500" /> |
|
|
|
:class="{ '!border-primary': childrenListPagination.query.length !== 0 || isFocused }" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<MdiMagnify class="w-5 h-5 ml-2" /> |
|
|
|
|
|
|
|
<a-input |
|
|
|
<a-input |
|
|
|
ref="filterQueryRef" |
|
|
|
ref="filterQueryRef" |
|
|
|
v-model:value="childrenListPagination.query" |
|
|
|
v-model:value="childrenListPagination.query" |
|
|
@ -210,9 +213,13 @@ const linkOrUnLink = (rowRef: Record<string, string>, id: string) => { |
|
|
|
class="w-full !sm:rounded-md xs:min-h-8 !xs:rounded-xl" |
|
|
|
class="w-full !sm:rounded-md xs:min-h-8 !xs:rounded-xl" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
:bordered="false" |
|
|
|
:bordered="false" |
|
|
|
@focus="isFocused = true" |
|
|
|
@keydown.capture.stop=" |
|
|
|
@blur="isFocused = false" |
|
|
|
(e) => { |
|
|
|
@keydown.capture.stop |
|
|
|
if (e.key === 'Escape') { |
|
|
|
|
|
|
|
filterQueryRef?.blur() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
" |
|
|
|
@change="childrenListPagination.page = 1" |
|
|
|
@change="childrenListPagination.page = 1" |
|
|
|
> |
|
|
|
> |
|
|
|
</a-input> |
|
|
|
</a-input> |
|
|
|