|
|
@ -1,7 +1,7 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
|
|
|
|
import { onMounted } from '@vue/runtime-core' |
|
|
|
import useTableCreate from '../../composables/useTableCreate' |
|
|
|
import useTableCreate from '../../composables/useTableCreate' |
|
|
|
import { validateTableName } from '~/utils/validation' |
|
|
|
import { validateTableName } from '~/utils/validation' |
|
|
|
import useProject from '~/composables/useProject' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { modelValue } = defineProps<{ modelValue?: boolean }>() |
|
|
|
const { modelValue } = defineProps<{ modelValue?: boolean }>() |
|
|
|
|
|
|
|
|
|
|
@ -18,8 +18,7 @@ const dialogShow = computed({ |
|
|
|
|
|
|
|
|
|
|
|
const valid = ref(false) |
|
|
|
const valid = ref(false) |
|
|
|
const isAdvanceOptVisible = ref(false) |
|
|
|
const isAdvanceOptVisible = ref(false) |
|
|
|
const { table, createTable } = useTableCreate() |
|
|
|
const { table, createTable, generateUniqueTitle, tables, project } = useTableCreate() |
|
|
|
const { tables, project } = useProject() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const prefix = computed(() => project?.value?.prefix || '') |
|
|
|
const prefix = computed(() => project?.value?.prefix || '') |
|
|
|
|
|
|
|
|
|
|
@ -33,6 +32,10 @@ const validateDuplicate = (v: string) => { |
|
|
|
return (tables?.value || []).every((t) => t.table_name.toLowerCase() !== (v || '').toLowerCase()) || 'Duplicate table name' |
|
|
|
return (tables?.value || []).every((t) => t.table_name.toLowerCase() !== (v || '').toLowerCase()) || 'Duplicate table name' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
|
|
|
generateUniqueTitle() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
/* import { validateTableName } from '~/helpers' |
|
|
|
/* import { validateTableName } from '~/helpers' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|