Browse Source

feat: Show lookup cell same as referred cell

re #416

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/445/head
Pranav C 3 years ago
parent
commit
8541eaf3ee
  1. 3
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/itemChip.vue
  2. 19
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/lookupCell.vue

3
packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/itemChip.vue

@ -7,7 +7,8 @@
:color="isDark ? '' : 'primary lighten-5'"
@click="!readonly && active && $emit('edit',item)"
>
<span class="name" :title="value">{{ value }}</span>
<!-- <span class="name" :title="value">{{ value }}</span>-->
<slot><span class="name" :title="value">{{ value }}</span></slot>
<div v-show="active" v-if="!readonly" class="mr-n1 ml-2">
<x-icon
:color="['text' , 'textLight']"

19
packages/nc-gui/components/project/spreadsheet/components/virtualCell/lookupCell.vue

@ -8,7 +8,15 @@
:active="active"
:value="value"
:readonly="true"
/>
>
<table-cell
:column="lookUpColumn"
:meta="lookUpMeta"
:db-alias="nodes.dbAlias"
:value="value"
:sql-ui="sqlUi"
/>
</item-chip>
</template>
<span
v-if="localValue && localValue.length === 10"
@ -39,10 +47,11 @@
import ItemChip from '@/components/project/spreadsheet/components/virtualCell/components/itemChip'
import ListChildItemsModal
from '@/components/project/spreadsheet/components/virtualCell/components/listChildItemsModal'
import TableCell from '../cell'
export default {
name: 'LookupCell',
components: { ListChildItemsModal, ItemChip },
components: { TableCell, ListChildItemsModal, ItemChip },
props: {
meta: [Object],
column: [Object],
@ -78,6 +87,12 @@ export default {
}
return (this.$store.state.meta.metas[this.column.lk.ltn].columns.find(cl => cl.cn === this.column.lk.lcn) || {})._cn
},
lookUpColumn() {
if (!this.lookUpMeta || !this.column.lk.lcn) {
return
}
return (this.$store.state.meta.metas[this.column.lk.ltn].columns.find(cl => cl.cn === this.column.lk.lcn) || {})
},
localValueObj() {
if (!this.column || !this.row) {
return null

Loading…
Cancel
Save