Browse Source

fix: empty fields state

pull/6558/head
DarkPhoenix2704 1 year ago
parent
commit
614ffbba2a
  1. 4
      packages/nc-gui/components/smartsheet/Gallery.vue
  2. 28
      packages/nc-gui/components/virtual-cell/components/ListItem.vue

4
packages/nc-gui/components/smartsheet/Gallery.vue

@ -347,9 +347,7 @@ watch(
:read-only="true"
/>
</div>
<div v-else class="flex flex-row w-full h-[1.375rem] pl-1 items-center justify-start">
<span class="bg-gray-200 h-2 w-16 rounded-md"></span>
</div>
<div v-else class="flex flex-row w-full h-[1.375rem] pl-1 items-center justify-start">-</div>
</div>
</div>
</a-card>

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

@ -47,6 +47,13 @@ interface Attachment {
mimetype: string
}
const isRowEmpty = (row: any, col: any) => {
const val = row[col.title]
if (!val) return true
return Array.isArray(val) && val.length === 0
}
const attachments: ComputedRef<Attachment[]> = computed(() => {
try {
if (props.attachment && row.value[props.attachment.title]) {
@ -126,15 +133,18 @@ const attachments: ComputedRef<Attachment[]> = computed(() => {
/>
<LazySmartsheetHeaderCell v-else class="!scale-70" :column="field" :hide-menu="true" :hide-icon="true" />
<LazySmartsheetVirtualCell v-if="isVirtualCol(field)" v-model="row[field.title]" :row="row" :column="field" />
<LazySmartsheetCell
v-else
v-model="row[field.title]"
class="!text-gray-600 ml-1"
:column="field"
:edit-enabled="false"
:read-only="true"
/>
<div v-if="!isRowEmpty(row, field)">
<LazySmartsheetVirtualCell v-if="isVirtualCol(field)" v-model="row[field.title]" :row="row" :column="field" />
<LazySmartsheetCell
v-else
v-model="row[field.title]"
class="!text-gray-600 ml-1"
:column="field"
:edit-enabled="false"
:read-only="true"
/>
</div>
<div v-else class="flex flex-row w-full h-[1.375rem] pl-1 items-center justify-start">-</div>
</div>
</div>
</div>

Loading…
Cancel
Save