Browse Source

fix: avoid unwanted api calls

pull/6360/head
DarkPhoenix2704 1 year ago
parent
commit
4edee65b8e
  1. 4
      packages/nc-gui/components/cell/Checkbox.vue
  2. 4
      packages/nc-gui/components/virtual-cell/Links.vue
  3. 2
      packages/nc-gui/components/virtual-cell/components/ListItem.vue
  4. 2
      packages/nc-gui/components/virtual-cell/components/ListItems.vue

4
packages/nc-gui/components/cell/Checkbox.vue

@ -78,7 +78,7 @@ useSelectedCellKeyupListener(active, (e) => {
<template> <template>
<div <div
class="flex cursor-pointer w-full h-full py-1" class="flex cursor-pointer w-full h-full"
:class="{ :class="{
'justify-center': !isForm, 'justify-center': !isForm,
'w-full': isForm, 'w-full': isForm,
@ -92,7 +92,7 @@ useSelectedCellKeyupListener(active, (e) => {
:class="{ '!ml-[-8px]': readOnly, 'w-full justify-start': isEditColumnMenu }" :class="{ '!ml-[-8px]': readOnly, 'w-full justify-start': isEditColumnMenu }"
@click="onClick(true)" @click="onClick(true)"
> >
<div class="p-1" :class="{ 'bg-gray-100 rounded-full ': !vModel }"> <div :class="{ 'bg-gray-100 rounded-full ': !vModel }">
<Transition name="layout" mode="out-in" :duration="100"> <Transition name="layout" mode="out-in" :duration="100">
<component <component
:is="getMdiIcon(vModel ? checkboxMeta.icon.checked : checkboxMeta.icon.unchecked)" :is="getMdiIcon(vModel ? checkboxMeta.icon.checked : checkboxMeta.icon.unchecked)"

4
packages/nc-gui/components/virtual-cell/Links.vue

@ -46,7 +46,9 @@ loadRelatedTableMeta()
const textVal = computed(() => { const textVal = computed(() => {
if (isForm?.value) { if (isForm?.value) {
return state.value?.[colTitle.value]?.length ? `${state.value?.[colTitle.value]?.length} records Linked` : 'No records linked' return state.value?.[colTitle.value]?.length
? `${+state.value?.[colTitle.value]?.length} records Linked`
: 'No records linked'
} }
const parsedValue = +value?.value || 0 const parsedValue = +value?.value || 0

2
packages/nc-gui/components/virtual-cell/components/ListItem.vue

@ -88,7 +88,7 @@ const attachments: Attachment[] = computed(() => {
/> />
</div> </div>
<div v-if="fields.length > 0 && !isPublic" class="flex flex-row gap-4 w-10/12"> <div v-if="fields.length > 0 && !isPublic && !isForm" class="flex flex-row gap-4 w-10/12">
<div v-for="field in fields" :key="field.id" :class="attachment ? 'w-1/3' : 'w-1/4'"> <div v-for="field in fields" :key="field.id" :class="attachment ? 'w-1/3' : 'w-1/4'">
<div class="flex flex-col gap-[-1] max-w-72"> <div class="flex flex-col gap-[-1] max-w-72">
<LazySmartsheetHeaderVirtualCell <LazySmartsheetHeaderVirtualCell

2
packages/nc-gui/components/virtual-cell/components/ListItems.vue

@ -79,7 +79,7 @@ watch(vModel, (nextVal, prevVal) => {
/** reset query and limit */ /** reset query and limit */
childrenExcludedListPagination.query = '' childrenExcludedListPagination.query = ''
childrenExcludedListPagination.page = 1 childrenExcludedListPagination.page = 1
if (!isForm) { if (!isForm.value) {
loadChildrenList() loadChildrenList()
} }
loadChildrenExcludedList() loadChildrenExcludedList()

Loading…
Cancel
Save