|
|
@ -1,7 +1,10 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import type { SelectProps } from 'ant-design-vue' |
|
|
|
import type { SelectProps } from 'ant-design-vue' |
|
|
|
|
|
|
|
import { isVirtualCol } from 'nocodb-sdk' |
|
|
|
import { computed } from 'vue' |
|
|
|
import { computed } from 'vue' |
|
|
|
import { MetaInj } from '~/context' |
|
|
|
import { MetaInj } from '~/context' |
|
|
|
|
|
|
|
import VirtualCellIcon from '~/components/smartsheet-header/VirtualCellIcon.vue' |
|
|
|
|
|
|
|
import CellIcon from '~/components/smartsheet-header/CellIcon.vue' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
modelValue?: string |
|
|
|
modelValue?: string |
|
|
@ -48,6 +51,10 @@ const options = computed<SelectProps['options']>(() => |
|
|
|
meta?.value?.columns?.map((c) => ({ |
|
|
|
meta?.value?.columns?.map((c) => ({ |
|
|
|
value: c.id, |
|
|
|
value: c.id, |
|
|
|
label: c.title, |
|
|
|
label: c.title, |
|
|
|
|
|
|
|
icon: h(isVirtualCol(c) ? VirtualCellIcon : CellIcon, { |
|
|
|
|
|
|
|
columnMeta: c, |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
c, |
|
|
|
})), |
|
|
|
})), |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -57,42 +64,9 @@ const filterOption = (input: string, option: any) => { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<a-select |
|
|
|
<a-select v-model:value="localValue" size="small" show-search placeholder="Select a field" :filter-option="filterOption"> |
|
|
|
v-model:value="localValue" |
|
|
|
<a-select-option v-for="option in options" :key="option.value" :value="option.value"> |
|
|
|
size="small" |
|
|
|
<div class="flex gap-2 align-center"><component :is="option.icon" class="!text-xs !mx-0" /> {{ option.label }}</div> |
|
|
|
show-search |
|
|
|
</a-select-option> |
|
|
|
placeholder="Select a field" |
|
|
|
</a-select> |
|
|
|
:options="options" |
|
|
|
|
|
|
|
:filter-option="filterOption" |
|
|
|
|
|
|
|
></a-select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <v-autocomplete |
|
|
|
|
|
|
|
ref="field" |
|
|
|
|
|
|
|
v-model="localValue" |
|
|
|
|
|
|
|
class="caption" |
|
|
|
|
|
|
|
:items="meta.columns" |
|
|
|
|
|
|
|
item-value="id" |
|
|
|
|
|
|
|
item-text="title" |
|
|
|
|
|
|
|
:label="$t('objects.field')" |
|
|
|
|
|
|
|
variant="solo" |
|
|
|
|
|
|
|
hide-details |
|
|
|
|
|
|
|
@click.stop |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<!– <!– @change="$emit('change')" –> –> |
|
|
|
|
|
|
|
<!– <template #selection="{ item }"> –> |
|
|
|
|
|
|
|
<!– <v-icon small class="mr-1"> –> |
|
|
|
|
|
|
|
<!– {{ item.icon }} –> |
|
|
|
|
|
|
|
<!– </v-icon> –> |
|
|
|
|
|
|
|
<!– {{ item.title }} –> |
|
|
|
|
|
|
|
<!– </template> –> |
|
|
|
|
|
|
|
<!– <template #item="{ item }"> –> |
|
|
|
|
|
|
|
<!– <span :class="`caption font-weight-regular nc-fld-${item.title}`"> –> |
|
|
|
|
|
|
|
<!– <v-icon color="grey" small class="mr-1"> –> |
|
|
|
|
|
|
|
<!– {{ item.icon }} –> |
|
|
|
|
|
|
|
<!– </v-icon> –> |
|
|
|
|
|
|
|
<!– {{ item.title }} –> |
|
|
|
|
|
|
|
<!– </span> –> |
|
|
|
|
|
|
|
<!– </template> –> |
|
|
|
|
|
|
|
</v-autocomplete> --> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|