diff --git a/yudao-ui-admin-vue3/src/api/infra/codegen/index.ts b/yudao-ui-admin-vue3/src/api/infra/codegen/index.ts
index dbce9518b..8b4c30f97 100644
--- a/yudao-ui-admin-vue3/src/api/infra/codegen/index.ts
+++ b/yudao-ui-admin-vue3/src/api/infra/codegen/index.ts
@@ -1,5 +1,5 @@
import { useAxios } from '@/hooks/web/useAxios'
-import type { CodegenTableVO } from './types'
+import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types'
const request = useAxios()
@@ -14,12 +14,12 @@ export const getCodegenTableApi = (id: number) => {
}
// 新增代码生成表定义
-export const createCodegenTableApi = (data: CodegenTableVO) => {
+export const createCodegenTableApi = (data: CodegenCreateListReqVO) => {
return request.post({ url: '/infra/codegen/create', data })
}
// 修改代码生成表定义
-export const updateCodegenTableApi = (data: CodegenTableVO) => {
+export const updateCodegenTableApi = (data: CodegenUpdateReqVO) => {
return request.put({ url: '/infra/codegen/update', data })
}
diff --git a/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts b/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts
index 237be1488..d4f87f3a9 100644
--- a/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts
+++ b/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts
@@ -1,5 +1,6 @@
export type CodegenTableVO = {
- id: number
+ tableId: number
+ isParentMenuIdValid: boolean
dataSourceConfigId: number
scene: number
tableName: string
@@ -49,3 +50,11 @@ export type CodegenPreviewVO = {
filePath: string
code: string
}
+export type CodegenUpdateReqVO = {
+ table: CodegenTableVO
+ columns: CodegenColumnVO[]
+}
+export type CodegenCreateListReqVO = {
+ dataSourceConfigId: number
+ tableNames: string[]
+}
diff --git a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue
index 05f123040..0ad3ec69a 100644
--- a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue
+++ b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue
@@ -1,47 +1,34 @@
-
diff --git a/yudao-ui-admin-vue3/src/views/infra/codegen/components/EditTable.vue b/yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue
similarity index 57%
rename from yudao-ui-admin-vue3/src/views/infra/codegen/components/EditTable.vue
rename to yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue
index 47e2c89e6..fc52ce51c 100644
--- a/yudao-ui-admin-vue3/src/views/infra/codegen/components/EditTable.vue
+++ b/yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue
@@ -1,18 +1,16 @@
-
+
-
-
-
+
+
+
{
min-width="10%"
:show-overflow-tooltip="true"
/>
-
-
-
+
+
+
@@ -53,38 +56,34 @@ onMounted(async () => {
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
@@ -96,14 +95,14 @@ onMounted(async () => {
-
-
-
+
+
+
-
-
-
+
+
+
@@ -116,9 +115,9 @@ onMounted(async () => {
-
-
-
+
+
+
{
-
-
-
+
+
+
diff --git a/yudao-ui-admin-vue3/src/views/infra/codegen/components/GenInfoForm.vue b/yudao-ui-admin-vue3/src/views/infra/codegen/components/GenInfoForm.vue
index d8b1b4d0d..e0172b3af 100644
--- a/yudao-ui-admin-vue3/src/views/infra/codegen/components/GenInfoForm.vue
+++ b/yudao-ui-admin-vue3/src/views/infra/codegen/components/GenInfoForm.vue
@@ -4,9 +4,9 @@ import { required } from '@/utils/formRules'
import { CodegenTableVO } from '@/api/infra/codegen/types'
import { Form } from '@/components/Form'
import { useForm } from '@/hooks/web/useForm'
-import { DICT_TYPE, getDictOptions } from '@/utils/dict'
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
const props = defineProps({
- currentRow: {
+ genInfo: {
type: Object as PropType>,
default: () => null
}
@@ -20,13 +20,15 @@ const rules = reactive({
className: [required],
classComment: [required]
})
+const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
+const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
const schema = reactive([
{
label: '生成模板',
field: 'templateType',
component: 'Select',
componentProps: {
- options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
+ options: templateTypeOptions
},
colProps: {
span: 12
@@ -37,7 +39,7 @@ const schema = reactive([
field: 'scene',
component: 'Select',
componentProps: {
- options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
+ options: sceneOptions
},
colProps: {
span: 12
@@ -93,11 +95,11 @@ const { register, methods, elFormRef } = useForm({
schema
})
watch(
- () => props.currentRow,
- (currentRow) => {
- if (!currentRow) return
+ () => props.genInfo,
+ (genInfo) => {
+ if (!genInfo) return
const { setValues } = methods
- setValues(currentRow)
+ setValues(genInfo)
},
{
deep: true,
diff --git a/yudao-ui-admin-vue3/src/views/infra/codegen/components/ImportTable.vue b/yudao-ui-admin-vue3/src/views/infra/codegen/components/ImportTable.vue
index 703e78ddc..933d128ef 100644
--- a/yudao-ui-admin-vue3/src/views/infra/codegen/components/ImportTable.vue
+++ b/yudao-ui-admin-vue3/src/views/infra/codegen/components/ImportTable.vue
@@ -21,8 +21,8 @@ const emit = defineEmits(['ok'])
const visible = ref(false)
const dbLoading = ref(true)
const queryParams = reactive({
- tableName: undefined,
- tableComment: undefined,
+ name: undefined,
+ comment: undefined,
dataSourceConfigId: 0
})
const dataSourceConfigs = ref([])
@@ -49,8 +49,9 @@ const handleQuery = async () => {
}
// 重置操作
const resetQuery = async () => {
- queryParams.tableName = undefined
- queryParams.tableComment = undefined
+ queryParams.name = undefined
+ queryParams.comment = undefined
+ queryParams.dataSourceConfigId = 0
await getList()
}
/** 多选框选中数据 */
@@ -90,11 +91,11 @@ defineExpose({
/>
-
-
+
+
-
-
+
+
diff --git a/yudao-ui-admin-vue3/src/views/infra/codegen/components/index.ts b/yudao-ui-admin-vue3/src/views/infra/codegen/components/index.ts
index 58be849da..f6fc155b7 100644
--- a/yudao-ui-admin-vue3/src/views/infra/codegen/components/index.ts
+++ b/yudao-ui-admin-vue3/src/views/infra/codegen/components/index.ts
@@ -1,7 +1,6 @@
import BasicInfoForm from './BasicInfoForm.vue'
import CloumInfoForm from './CloumInfoForm.vue'
-import EditTable from './EditTable.vue'
import GenInfoForm from './GenInfoForm.vue'
import ImportTable from './ImportTable.vue'
import Preview from './Preview.vue'
-export { BasicInfoForm, CloumInfoForm, EditTable, GenInfoForm, ImportTable, Preview }
+export { BasicInfoForm, CloumInfoForm, GenInfoForm, ImportTable, Preview }