Browse Source

feat(nc-gui): pass m2mColumn to ItemChip & ListItems

pull/5724/head
Wing-Kam Wong 2 years ago
parent
commit
c3649b8eb6
  1. 11
      packages/nc-gui/components/virtual-cell/ManyToMany.vue

11
packages/nc-gui/components/virtual-cell/ManyToMany.vue

@ -42,7 +42,7 @@ const { isUIAllowed } = useUIPermission()
const { state, isNew, removeLTARRef } = useSmartsheetRowStoreOrThrow() const { state, isNew, removeLTARRef } = useSmartsheetRowStoreOrThrow()
const { loadRelatedTableMeta, relatedTableDisplayValueProp, unlink } = useProvideLTARStore( const { relatedTableMeta, loadRelatedTableMeta, relatedTableDisplayValueProp, unlink } = useProvideLTARStore(
column as Ref<Required<ColumnType>>, column as Ref<Required<ColumnType>>,
row, row,
isNew, isNew,
@ -93,6 +93,11 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEven
break break
} }
}) })
const m2mColumn = computed(
() =>
relatedTableMeta.value?.columns?.find((c: any) => c.title === relatedTableDisplayValueProp.value) as ColumnType | undefined,
)
</script> </script>
<template> <template>
@ -105,6 +110,7 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEven
:key="i" :key="i"
:item="cell.item" :item="cell.item"
:value="cell.value" :value="cell.value"
:column="m2mColumn"
@unlink="unlinkRef(cell.item)" @unlink="unlinkRef(cell.item)"
/> />
@ -130,11 +136,12 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEven
</div> </div>
</template> </template>
<LazyVirtualCellComponentsListItems v-model="listItemsDlg" /> <LazyVirtualCellComponentsListItems v-model="listItemsDlg" :column="m2mColumn" />
<LazyVirtualCellComponentsListChildItems <LazyVirtualCellComponentsListChildItems
v-model="childListDlg" v-model="childListDlg"
:cell-value="localCellValue" :cell-value="localCellValue"
:column="m2mColumn"
@attach-record="onAttachRecord" @attach-record="onAttachRecord"
/> />
</div> </div>

Loading…
Cancel
Save