|
|
@ -5,6 +5,7 @@ import { MetaInj, ReloadViewDataHookInj } from '~/context' |
|
|
|
import { uiTypes } from '~/utils/columnUtils' |
|
|
|
import { uiTypes } from '~/utils/columnUtils' |
|
|
|
import MdiPlusIcon from '~icons/mdi/plus-circle-outline' |
|
|
|
import MdiPlusIcon from '~icons/mdi/plus-circle-outline' |
|
|
|
import MdiMinusIcon from '~icons/mdi/minus-circle-outline' |
|
|
|
import MdiMinusIcon from '~icons/mdi/minus-circle-outline' |
|
|
|
|
|
|
|
import MdiIdentifierIcon from '~icons/mdi/identifier' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
editColumnDropdown: boolean |
|
|
|
editColumnDropdown: boolean |
|
|
@ -37,7 +38,7 @@ const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber] |
|
|
|
const uiTypesOptions = computed<typeof uiTypes>(() => { |
|
|
|
const uiTypesOptions = computed<typeof uiTypes>(() => { |
|
|
|
return [ |
|
|
|
return [ |
|
|
|
...uiTypes.filter((t) => !isEdit || !t.virtual), |
|
|
|
...uiTypes.filter((t) => !isEdit || !t.virtual), |
|
|
|
...(!isEdit && meta?.value?.columns?.every((c) => !c.pk) |
|
|
|
...(!isEdit?.value && meta?.value?.columns?.every((c) => !c.pk) |
|
|
|
? [ |
|
|
|
? [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: 'ID', |
|
|
|
name: 'ID', |
|
|
@ -107,7 +108,7 @@ watch( |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item :label="$t('labels.columnType')"> |
|
|
|
<a-form-item :label="$t('labels.columnType')"> |
|
|
|
<a-select v-model:value="formState.uidt" size="small" class="nc-column-name-input" @change="onUidtOrIdTypeChange"> |
|
|
|
<a-select v-model:value="formState.uidt" size="small" class="nc-column-name-input" @change="onUidtOrIdTypeChange"> |
|
|
|
<a-select-option v-for="opt in uiTypesOptions" :key="opt.name" :value="opt.name" v-bind="validateInfos.uidt"> |
|
|
|
<a-select-option v-for="opt of uiTypesOptions" :key="opt.name" :value="opt.name" v-bind="validateInfos.uidt"> |
|
|
|
<div class="flex gap-1 align-center text-xs"> |
|
|
|
<div class="flex gap-1 align-center text-xs"> |
|
|
|
<component :is="opt.icon" class="text-grey" /> |
|
|
|
<component :is="opt.icon" class="text-grey" /> |
|
|
|
{{ opt.name }} |
|
|
|
{{ opt.name }} |
|
|
|