|
|
@ -1,5 +1,6 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { UITypes, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import { UITypes, isVirtualCol } from 'nocodb-sdk' |
|
|
|
|
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { computed, inject, useMetas, watchEffect } from '#imports' |
|
|
|
import { computed, inject, useMetas, watchEffect } from '#imports' |
|
|
|
import { MetaInj, ReloadViewDataHookInj } from '~/context' |
|
|
|
import { MetaInj, ReloadViewDataHookInj } from '~/context' |
|
|
|
import { uiTypes } from '~/utils/columnUtils' |
|
|
|
import { uiTypes } from '~/utils/columnUtils' |
|
|
@ -9,17 +10,19 @@ import MdiIdentifierIcon from '~icons/mdi/identifier' |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['submit', 'cancel']) |
|
|
|
const emit = defineEmits(['submit', 'cancel']) |
|
|
|
|
|
|
|
|
|
|
|
const meta = inject(MetaInj) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { formState, generateNewColumnMeta, addOrUpdate, onAlter, onUidtOrIdTypeChange, validateInfos, isEdit } = |
|
|
|
const { formState, generateNewColumnMeta, addOrUpdate, onAlter, onUidtOrIdTypeChange, validateInfos, isEdit } = |
|
|
|
useColumnCreateStoreOrThrow() |
|
|
|
useColumnCreateStoreOrThrow() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { getMeta } = useMetas() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const meta = inject(MetaInj) |
|
|
|
|
|
|
|
|
|
|
|
const reloadDataTrigger = inject(ReloadViewDataHookInj) |
|
|
|
const reloadDataTrigger = inject(ReloadViewDataHookInj) |
|
|
|
|
|
|
|
|
|
|
|
const advancedOptions = ref(false) |
|
|
|
const advancedOptions = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const { getMeta } = useMetas() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber] |
|
|
|
const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber] |
|
|
|
|
|
|
|
|
|
|
|
const onlyNameUpdateOnEditColumns = [UITypes.LinkToAnotherRecord, UITypes.Lookup, UITypes.Rollup] |
|
|
|
const onlyNameUpdateOnEditColumns = [UITypes.LinkToAnotherRecord, UITypes.Lookup, UITypes.Rollup] |
|
|
@ -70,6 +73,11 @@ watchEffect(() => { |
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
if (isEdit.value === false) { |
|
|
|
if (isEdit.value === false) { |
|
|
|
generateNewColumnMeta() |
|
|
|
generateNewColumnMeta() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (formState.value.pk) { |
|
|
|
|
|
|
|
message.info(t('msg.info.editingPKnotSupported')) |
|
|
|
|
|
|
|
emit('cancel') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// for cases like formula |
|
|
|
// for cases like formula |
|
|
|