|
|
@ -3,11 +3,26 @@ import Draggable from 'vuedraggable' |
|
|
|
import { RelationTypes, UITypes, getSystemColumns, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import { RelationTypes, UITypes, getSystemColumns, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import type { Permission } from '~/composables/useUIPermission/rolePermissions' |
|
|
|
import type { Permission } from '~/composables/useUIPermission/rolePermissions' |
|
|
|
import { computed, inject, onClickOutside, useDebounceFn } from '#imports' |
|
|
|
import { |
|
|
|
import { ActiveViewInj, IsFormInj, MetaInj } from '~/context' |
|
|
|
ActiveViewInj, |
|
|
|
import { extractSdkResponseErrorMsg } from '~/utils' |
|
|
|
IsFormInj, |
|
|
|
|
|
|
|
MetaInj, |
|
|
|
provide(IsFormInj, true) |
|
|
|
computed, |
|
|
|
|
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
|
|
|
|
inject, |
|
|
|
|
|
|
|
onClickOutside, |
|
|
|
|
|
|
|
provide, |
|
|
|
|
|
|
|
reactive, |
|
|
|
|
|
|
|
ref, |
|
|
|
|
|
|
|
useDebounceFn, |
|
|
|
|
|
|
|
useGlobal, |
|
|
|
|
|
|
|
useNuxtApp, |
|
|
|
|
|
|
|
useUIPermission, |
|
|
|
|
|
|
|
useViewData, |
|
|
|
|
|
|
|
watch, |
|
|
|
|
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
provide(IsFormInj, ref(true)) |
|
|
|
|
|
|
|
|
|
|
|
// todo: generate hideCols based on default values |
|
|
|
// todo: generate hideCols based on default values |
|
|
|
const hiddenCols = ['created_at', 'updated_at'] |
|
|
|
const hiddenCols = ['created_at', 'updated_at'] |
|
|
@ -76,7 +91,8 @@ async function submitForm() { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
insertRow(formState) |
|
|
|
await insertRow(formState) |
|
|
|
|
|
|
|
|
|
|
|
submitted.value = true |
|
|
|
submitted.value = true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -199,17 +215,23 @@ function setFormData() { |
|
|
|
formViewData.value = { |
|
|
|
formViewData.value = { |
|
|
|
...formViewData.value, |
|
|
|
...formViewData.value, |
|
|
|
submit_another_form: !!(formViewData?.value?.submit_another_form ?? 0), |
|
|
|
submit_another_form: !!(formViewData?.value?.submit_another_form ?? 0), |
|
|
|
show_blank_form: !!(formViewData?.value?.show_blank_form ?? 0), |
|
|
|
// todo: show_blank_form missing from FormType |
|
|
|
} |
|
|
|
show_blank_form: !!((formViewData?.value as any)?.show_blank_form ?? 0), |
|
|
|
|
|
|
|
} as any |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
// email me |
|
|
|
// email me |
|
|
|
let data: Record<string, boolean> = {} |
|
|
|
let data: Record<string, boolean> = {} |
|
|
|
try { |
|
|
|
try { |
|
|
|
data = JSON.parse(formViewData.value.email as string) || {} |
|
|
|
data = JSON.parse(formViewData.value?.email || '') || {} |
|
|
|
} catch (e) {} |
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
// noop |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
data[state.user.value?.email as string] = emailMe.value |
|
|
|
data[state.user.value?.email as string] = emailMe.value |
|
|
|
formViewData.value.email = JSON.stringify(data) |
|
|
|
|
|
|
|
|
|
|
|
formViewData.value!.email = JSON.stringify(data) |
|
|
|
|
|
|
|
|
|
|
|
checkSMTPStatus() |
|
|
|
checkSMTPStatus() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -265,7 +287,7 @@ const updateColMeta = useDebounceFn(async (col: Record<string, any>) => { |
|
|
|
}, 250) |
|
|
|
}, 250) |
|
|
|
|
|
|
|
|
|
|
|
watch(submitted, (v) => { |
|
|
|
watch(submitted, (v) => { |
|
|
|
if (v && formViewData?.value?.show_blank_form) { |
|
|
|
if (v && (formViewData?.value as any)?.show_blank_form) { |
|
|
|
secondsRemain.value = 5 |
|
|
|
secondsRemain.value = 5 |
|
|
|
const intvl = setInterval(() => { |
|
|
|
const intvl = setInterval(() => { |
|
|
|
if (--secondsRemain.value < 0) { |
|
|
|
if (--secondsRemain.value < 0) { |
|
|
|