Commit 291f31be98f5586a7265413a3b084c18b241c2ac

Authored by xingyu
1 parent 607f6e4b

refactor: codegen

yudao-ui-admin-vue3/src/api/infra/codegen/index.ts
1 import { useAxios } from '@/hooks/web/useAxios' 1 import { useAxios } from '@/hooks/web/useAxios'
2 -import type { CodegenTableVO } from './types' 2 +import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types'
3 3
4 const request = useAxios() 4 const request = useAxios()
5 5
@@ -14,12 +14,12 @@ export const getCodegenTableApi = (id: number) => { @@ -14,12 +14,12 @@ export const getCodegenTableApi = (id: number) => {
14 } 14 }
15 15
16 // 新增代码生成表定义 16 // 新增代码生成表定义
17 -export const createCodegenTableApi = (data: CodegenTableVO) => { 17 +export const createCodegenTableApi = (data: CodegenCreateListReqVO) => {
18 return request.post({ url: '/infra/codegen/create', data }) 18 return request.post({ url: '/infra/codegen/create', data })
19 } 19 }
20 20
21 // 修改代码生成表定义 21 // 修改代码生成表定义
22 -export const updateCodegenTableApi = (data: CodegenTableVO) => { 22 +export const updateCodegenTableApi = (data: CodegenUpdateReqVO) => {
23 return request.put({ url: '/infra/codegen/update', data }) 23 return request.put({ url: '/infra/codegen/update', data })
24 } 24 }
25 25
yudao-ui-admin-vue3/src/api/infra/codegen/types.ts
1 export type CodegenTableVO = { 1 export type CodegenTableVO = {
2 - id: number 2 + tableId: number
  3 + isParentMenuIdValid: boolean
3 dataSourceConfigId: number 4 dataSourceConfigId: number
4 scene: number 5 scene: number
5 tableName: string 6 tableName: string
@@ -49,3 +50,11 @@ export type CodegenPreviewVO = { @@ -49,3 +50,11 @@ export type CodegenPreviewVO = {
49 filePath: string 50 filePath: string
50 code: string 51 code: string
51 } 52 }
  53 +export type CodegenUpdateReqVO = {
  54 + table: CodegenTableVO
  55 + columns: CodegenColumnVO[]
  56 +}
  57 +export type CodegenCreateListReqVO = {
  58 + dataSourceConfigId: number
  59 + tableNames: string[]
  60 +}
yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue
1 -<script lang="ts">  
2 -import { defineComponent, onMounted, onUpdated, PropType, ref } from 'vue' 1 +<script setup lang="ts">
  2 +import { onMounted, onUpdated, PropType, ref } from 'vue'
3 import { getDictOptions, DictDataType } from '@/utils/dict' 3 import { getDictOptions, DictDataType } from '@/utils/dict'
4 import { ElTag } from 'element-plus' 4 import { ElTag } from 'element-plus'
5 -  
6 -export default defineComponent({  
7 - name: 'DictTag',  
8 - components: {  
9 - ElTag  
10 - },  
11 - props: {  
12 - type: {  
13 - type: String as PropType<string>,  
14 - required: true  
15 - },  
16 - value: {  
17 - type: [String, Number] as PropType<string | number>,  
18 - required: true  
19 - } 5 +const props = defineProps({
  6 + type: {
  7 + type: String as PropType<string>,
  8 + required: true
20 }, 9 },
21 - setup(props) {  
22 - const dictData = ref<DictDataType>()  
23 - function getDictObj(dictType: string, value: string) {  
24 - const dictOptions = getDictOptions(dictType)  
25 - dictOptions.forEach((dict: DictDataType) => {  
26 - if (dict.value === value) {  
27 - dictData.value = dict  
28 - }  
29 - }) 10 + value: {
  11 + type: [String, Number] as PropType<string | number>,
  12 + required: true
  13 + }
  14 +})
  15 +const dictData = ref<DictDataType>()
  16 +const getDictObj = (dictType: string, value: string) => {
  17 + const dictOptions = getDictOptions(dictType)
  18 + dictOptions.forEach((dict: DictDataType) => {
  19 + if (dict.value === value) {
  20 + dictData.value = dict
30 } 21 }
  22 + })
  23 +}
31 24
32 - onMounted(() => {  
33 - return getDictObj(props.type, props.value?.toString())  
34 - }) 25 +onMounted(() => {
  26 + return getDictObj(props.type, props.value?.toString())
  27 +})
35 28
36 - onUpdated(() => {  
37 - getDictObj(props.type, props.value?.toString())  
38 - })  
39 - return {  
40 - props,  
41 - dictData  
42 - }  
43 - } 29 +onUpdated(() => {
  30 + getDictObj(props.type, props.value?.toString())
44 }) 31 })
45 </script> 32 </script>
46 <template> 33 <template>
yudao-ui-admin-vue3/src/views/infra/codegen/components/EditTable.vue renamed to yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 import { ref, unref, onMounted } from 'vue' 2 import { ref, unref, onMounted } from 'vue'
3 import { ContentDetailWrap } from '@/components/ContentDetailWrap' 3 import { ContentDetailWrap } from '@/components/ContentDetailWrap'
4 -import BasicInfoForm from './BasicInfoForm.vue'  
5 -import CloumInfoFormVue from './CloumInfoForm.vue'  
6 -import GenInfoFormVue from './GenInfoForm.vue'  
7 -import { ElTabs, ElTabPane, ElButton } from 'element-plus'  
8 -import { getCodegenTableApi } from '@/api/infra/codegen' 4 +import { BasicInfoForm, CloumInfoForm, GenInfoForm } from './components'
  5 +import { ElTabs, ElTabPane, ElButton, ElMessage } from 'element-plus'
  6 +import { getCodegenTableApi, updateCodegenTableApi } from '@/api/infra/codegen'
9 import { useRouter, useRoute } from 'vue-router' 7 import { useRouter, useRoute } from 'vue-router'
10 import { useI18n } from '@/hooks/web/useI18n' 8 import { useI18n } from '@/hooks/web/useI18n'
11 -import { CodegenColumnVO, CodegenTableVO } from '@/api/infra/codegen/types' 9 +import { CodegenTableVO, CodegenColumnVO, CodegenUpdateReqVO } from '@/api/infra/codegen/types'
12 const { t } = useI18n() 10 const { t } = useI18n()
13 const { push } = useRouter() 11 const { push } = useRouter()
14 const { query } = useRoute() 12 const { query } = useRoute()
15 -const tableCurrentRow = ref<Nullable<CodegenTableVO>>(null) 13 +const tableCurrentRow = ref<CodegenTableVO>()
16 const cloumCurrentRow = ref<CodegenColumnVO[]>() 14 const cloumCurrentRow = ref<CodegenColumnVO[]>()
17 const getList = async () => { 15 const getList = async () => {
18 const id = query.id as unknown as number 16 const id = query.id as unknown as number
@@ -26,17 +24,23 @@ const getList = async () =&gt; { @@ -26,17 +24,23 @@ const getList = async () =&gt; {
26 const loading = ref(false) 24 const loading = ref(false)
27 const activeName = ref('cloum') 25 const activeName = ref('cloum')
28 const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>() 26 const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>()
29 -const genInfoRef = ref<ComponentRef<typeof GenInfoFormVue>>() 27 +const genInfoRef = ref<ComponentRef<typeof GenInfoForm>>()
  28 +const cloumInfoRef = ref(null)
30 const submitForm = async () => { 29 const submitForm = async () => {
31 const basicInfo = unref(basicInfoRef) 30 const basicInfo = unref(basicInfoRef)
32 const genInfo = unref(genInfoRef) 31 const genInfo = unref(genInfoRef)
33 - const basicValidate = await basicInfo?.elFormRef?.validate()?.catch(() => {})  
34 - const genValidate = await genInfo?.elFormRef?.validate()?.catch(() => {})  
35 - if (basicValidate && genValidate) { 32 + const basicForm = await basicInfo?.elFormRef?.validate()?.catch(() => {})
  33 + const genForm = await genInfo?.elFormRef?.validate()?.catch(() => {})
  34 + if (basicForm && genForm) {
36 const basicInfoData = (await basicInfo?.getFormData()) as CodegenTableVO 35 const basicInfoData = (await basicInfo?.getFormData()) as CodegenTableVO
37 const genInfoData = (await genInfo?.getFormData()) as CodegenTableVO 36 const genInfoData = (await genInfo?.getFormData()) as CodegenTableVO
38 - console.info(basicInfoData)  
39 - console.info(genInfoData) 37 + const genTable: CodegenUpdateReqVO = {
  38 + table: Object.assign({}, basicInfoData, genInfoData),
  39 + columns: cloumCurrentRow.value
  40 + }
  41 + await updateCodegenTableApi(genTable)
  42 + ElMessage.success(t('common.updateSuccess'))
  43 + push('/infra/codegen')
40 } 44 }
41 } 45 }
42 onMounted(() => { 46 onMounted(() => {
@@ -46,14 +50,14 @@ onMounted(() =&gt; { @@ -46,14 +50,14 @@ onMounted(() =&gt; {
46 <template> 50 <template>
47 <ContentDetailWrap title="代码生成" @back="push('/infra/codegen')"> 51 <ContentDetailWrap title="代码生成" @back="push('/infra/codegen')">
48 <el-tabs v-model="activeName"> 52 <el-tabs v-model="activeName">
49 - <el-tab-pane label="基本信息" name="basic">  
50 - <BasicInfoForm ref="basicInfoRef" :current-row="tableCurrentRow" /> 53 + <el-tab-pane label="基本信息" name="basicInfo">
  54 + <BasicInfoForm ref="basicInfoRef" :basicInfo="tableCurrentRow" />
51 </el-tab-pane> 55 </el-tab-pane>
52 <el-tab-pane label="字段信息" name="cloum"> 56 <el-tab-pane label="字段信息" name="cloum">
53 - <CloumInfoFormVue ref="cloumInfoRef" :current-row="cloumCurrentRow" /> 57 + <CloumInfoForm ref="cloumInfoRef" :info="cloumCurrentRow" />
54 </el-tab-pane> 58 </el-tab-pane>
55 <el-tab-pane label="生成信息" name="genInfo"> 59 <el-tab-pane label="生成信息" name="genInfo">
56 - <GenInfoFormVue ref="basicInfoRef" :current-row="tableCurrentRow" /> 60 + <GenInfoForm ref="genInfoRef" :genInfo="tableCurrentRow" />
57 </el-tab-pane> 61 </el-tab-pane>
58 </el-tabs> 62 </el-tabs>
59 <template #right> 63 <template #right>
yudao-ui-admin-vue3/src/views/infra/codegen/components/BasicInfoForm.vue
@@ -5,7 +5,7 @@ import { CodegenTableVO } from &#39;@/api/infra/codegen/types&#39; @@ -5,7 +5,7 @@ import { CodegenTableVO } from &#39;@/api/infra/codegen/types&#39;
5 import { Form } from '@/components/Form' 5 import { Form } from '@/components/Form'
6 import { useForm } from '@/hooks/web/useForm' 6 import { useForm } from '@/hooks/web/useForm'
7 const props = defineProps({ 7 const props = defineProps({
8 - currentRow: { 8 + basicInfo: {
9 type: Object as PropType<Nullable<CodegenTableVO>>, 9 type: Object as PropType<Nullable<CodegenTableVO>>,
10 default: () => null 10 default: () => null
11 } 11 }
@@ -66,11 +66,11 @@ const { register, methods, elFormRef } = useForm({ @@ -66,11 +66,11 @@ const { register, methods, elFormRef } = useForm({
66 schema 66 schema
67 }) 67 })
68 watch( 68 watch(
69 - () => props.currentRow,  
70 - (currentRow) => {  
71 - if (!currentRow) return 69 + () => props.basicInfo,
  70 + (basicInfo) => {
  71 + if (!basicInfo) return
72 const { setValues } = methods 72 const { setValues } = methods
73 - setValues(currentRow) 73 + setValues(basicInfo)
74 }, 74 },
75 { 75 {
76 deep: true, 76 deep: true,
yudao-ui-admin-vue3/src/views/infra/codegen/components/CloumInfoForm.vue
@@ -4,8 +4,8 @@ import { onMounted, PropType, ref } from &#39;vue&#39; @@ -4,8 +4,8 @@ import { onMounted, PropType, ref } from &#39;vue&#39;
4 import { CodegenColumnVO } from '@/api/infra/codegen/types' 4 import { CodegenColumnVO } from '@/api/infra/codegen/types'
5 import { listSimpleDictTypeApi } from '@/api/system/dict/dict.type' 5 import { listSimpleDictTypeApi } from '@/api/system/dict/dict.type'
6 import { DictTypeVO } from '@/api/system/dict/types' 6 import { DictTypeVO } from '@/api/system/dict/types'
7 -defineProps({  
8 - currentRow: { 7 +const props = defineProps({
  8 + info: {
9 type: Array as unknown as PropType<CodegenColumnVO[]>, 9 type: Array as unknown as PropType<CodegenColumnVO[]>,
10 default: () => null 10 default: () => null
11 } 11 }
@@ -20,18 +20,21 @@ const tableHeight = document.documentElement.scrollHeight - 245 + &#39;px&#39; @@ -20,18 +20,21 @@ const tableHeight = document.documentElement.scrollHeight - 245 + &#39;px&#39;
20 onMounted(async () => { 20 onMounted(async () => {
21 await getDictOptions() 21 await getDictOptions()
22 }) 22 })
  23 +defineExpose({
  24 + info: props.info
  25 +})
23 </script> 26 </script>
24 <template> 27 <template>
25 - <el-table ref="dragTable" :data="currentRow" row-key="columnId" :max-height="tableHeight"> 28 + <el-table ref="dragTable" :data="info" row-key="columnId" :max-height="tableHeight">
26 <el-table-column 29 <el-table-column
27 label="字段列名" 30 label="字段列名"
28 prop="columnName" 31 prop="columnName"
29 min-width="10%" 32 min-width="10%"
30 :show-overflow-tooltip="true" 33 :show-overflow-tooltip="true"
31 /> 34 />
32 - <el-table-column label="字段描述" min-width="10%">  
33 - <template #default="scope">  
34 - <el-input v-model="scope.row.columnComment" /> 35 + <el-table-column label="字段描述" min-width="10%" prop="columnComment">
  36 + <template #default="{ row }">
  37 + <el-input v-model="row.columnComment" />
35 </template> 38 </template>
36 </el-table-column> 39 </el-table-column>
37 <el-table-column 40 <el-table-column
@@ -40,9 +43,9 @@ onMounted(async () =&gt; { @@ -40,9 +43,9 @@ onMounted(async () =&gt; {
40 min-width="10%" 43 min-width="10%"
41 :show-overflow-tooltip="true" 44 :show-overflow-tooltip="true"
42 /> 45 />
43 - <el-table-column label="Java类型" min-width="11%">  
44 - <template #default="scope">  
45 - <el-select v-model="scope.row.javaType"> 46 + <el-table-column label="Java类型" min-width="11%" prop="javaType">
  47 + <template #default="{ row }">
  48 + <el-select v-model="row.javaType">
46 <el-option label="Long" value="Long" /> 49 <el-option label="Long" value="Long" />
47 <el-option label="String" value="String" /> 50 <el-option label="String" value="String" />
48 <el-option label="Integer" value="Integer" /> 51 <el-option label="Integer" value="Integer" />
@@ -53,38 +56,34 @@ onMounted(async () =&gt; { @@ -53,38 +56,34 @@ onMounted(async () =&gt; {
53 </el-select> 56 </el-select>
54 </template> 57 </template>
55 </el-table-column> 58 </el-table-column>
56 - <el-table-column label="java属性" min-width="10%">  
57 - <template #default="scope">  
58 - <el-input v-model="scope.row.javaField" /> 59 + <el-table-column label="java属性" min-width="10%" prop="javaField">
  60 + <template #default="{ row }">
  61 + <el-input v-model="row.javaField" />
59 </template> 62 </template>
60 </el-table-column> 63 </el-table-column>
61 - <el-table-column label="插入" min-width="4%">  
62 - <template #default="scope">  
63 - <el-checkbox true-label="true" false-label="false" v-model="scope.row.createOperation" /> 64 + <el-table-column label="插入" min-width="4%" prop="createOperation">
  65 + <template #default="{ row }">
  66 + <el-checkbox true-label="true" false-label="false" v-model="row.createOperation" />
64 </template> 67 </template>
65 </el-table-column> 68 </el-table-column>
66 - <el-table-column label="编辑" min-width="4%">  
67 - <template #default="scope">  
68 - <el-checkbox true-label="true" false-label="false" v-model="scope.row.updateOperation" /> 69 + <el-table-column label="编辑" min-width="4%" prop="updateOperation">
  70 + <template #default="{ row }">
  71 + <el-checkbox true-label="true" false-label="false" v-model="row.updateOperation" />
69 </template> 72 </template>
70 </el-table-column> 73 </el-table-column>
71 - <el-table-column label="列表" min-width="4%">  
72 - <template #default="scope">  
73 - <el-checkbox  
74 - true-label="true"  
75 - false-label="false"  
76 - v-model="scope.row.listOperationResult"  
77 - /> 74 + <el-table-column label="列表" min-width="4%" prop="listOperationResult">
  75 + <template #default="{ row }">
  76 + <el-checkbox true-label="true" false-label="false" v-model="row.listOperationResult" />
78 </template> 77 </template>
79 </el-table-column> 78 </el-table-column>
80 - <el-table-column label="查询" min-width="4%">  
81 - <template #default="scope">  
82 - <el-checkbox true-label="true" false-label="false" v-model="scope.row.listOperation" /> 79 + <el-table-column label="查询" min-width="4%" prop="listOperation">
  80 + <template #default="{ row }">
  81 + <el-checkbox true-label="true" false-label="false" v-model="row.listOperation" />
83 </template> 82 </template>
84 </el-table-column> 83 </el-table-column>
85 - <el-table-column label="查询方式" min-width="10%">  
86 - <template #default="scope">  
87 - <el-select v-model="scope.row.listOperationCondition"> 84 + <el-table-column label="查询方式" min-width="10%" prop="listOperationCondition">
  85 + <template #default="{ row }">
  86 + <el-select v-model="row.listOperationCondition">
88 <el-option label="=" value="=" /> 87 <el-option label="=" value="=" />
89 <el-option label="!=" value="!=" /> 88 <el-option label="!=" value="!=" />
90 <el-option label=">" value=">" /> 89 <el-option label=">" value=">" />
@@ -96,14 +95,14 @@ onMounted(async () =&gt; { @@ -96,14 +95,14 @@ onMounted(async () =&gt; {
96 </el-select> 95 </el-select>
97 </template> 96 </template>
98 </el-table-column> 97 </el-table-column>
99 - <el-table-column label="允许空" min-width="5%">  
100 - <template #default="scope">  
101 - <el-checkbox true-label="true" false-label="false" v-model="scope.row.nullable" /> 98 + <el-table-column label="允许空" min-width="5%" prop="nullable">
  99 + <template #default="{ row }">
  100 + <el-checkbox true-label="true" false-label="false" v-model="row.nullable" />
102 </template> 101 </template>
103 </el-table-column> 102 </el-table-column>
104 - <el-table-column label="显示类型" min-width="12%">  
105 - <template #default="scope">  
106 - <el-select v-model="scope.row.htmlType"> 103 + <el-table-column label="显示类型" min-width="12%" prop="htmlType">
  104 + <template #default="{ row }">
  105 + <el-select v-model="row.htmlType">
107 <el-option label="文本框" value="input" /> 106 <el-option label="文本框" value="input" />
108 <el-option label="文本域" value="textarea" /> 107 <el-option label="文本域" value="textarea" />
109 <el-option label="下拉框" value="select" /> 108 <el-option label="下拉框" value="select" />
@@ -116,9 +115,9 @@ onMounted(async () =&gt; { @@ -116,9 +115,9 @@ onMounted(async () =&gt; {
116 </el-select> 115 </el-select>
117 </template> 116 </template>
118 </el-table-column> 117 </el-table-column>
119 - <el-table-column label="字典类型" min-width="12%">  
120 - <template #default="scope">  
121 - <el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择"> 118 + <el-table-column label="字典类型" min-width="12%" prop="dictType">
  119 + <template #default="{ row }">
  120 + <el-select v-model="row.dictType" clearable filterable placeholder="请选择">
122 <el-option 121 <el-option
123 v-for="dict in dictOptions" 122 v-for="dict in dictOptions"
124 :key="dict.id" 123 :key="dict.id"
@@ -128,9 +127,9 @@ onMounted(async () =&gt; { @@ -128,9 +127,9 @@ onMounted(async () =&gt; {
128 </el-select> 127 </el-select>
129 </template> 128 </template>
130 </el-table-column> 129 </el-table-column>
131 - <el-table-column label="示例" min-width="10%">  
132 - <template #default="scope">  
133 - <el-input v-model="scope.row.example" /> 130 + <el-table-column label="示例" min-width="10%" prop="example">
  131 + <template #default="{ row }">
  132 + <el-input v-model="row.example" />
134 </template> 133 </template>
135 </el-table-column> 134 </el-table-column>
136 </el-table> 135 </el-table>
yudao-ui-admin-vue3/src/views/infra/codegen/components/GenInfoForm.vue
@@ -4,9 +4,9 @@ import { required } from &#39;@/utils/formRules&#39; @@ -4,9 +4,9 @@ import { required } from &#39;@/utils/formRules&#39;
4 import { CodegenTableVO } from '@/api/infra/codegen/types' 4 import { CodegenTableVO } from '@/api/infra/codegen/types'
5 import { Form } from '@/components/Form' 5 import { Form } from '@/components/Form'
6 import { useForm } from '@/hooks/web/useForm' 6 import { useForm } from '@/hooks/web/useForm'
7 -import { DICT_TYPE, getDictOptions } from '@/utils/dict' 7 +import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
8 const props = defineProps({ 8 const props = defineProps({
9 - currentRow: { 9 + genInfo: {
10 type: Object as PropType<Nullable<CodegenTableVO>>, 10 type: Object as PropType<Nullable<CodegenTableVO>>,
11 default: () => null 11 default: () => null
12 } 12 }
@@ -20,13 +20,15 @@ const rules = reactive({ @@ -20,13 +20,15 @@ const rules = reactive({
20 className: [required], 20 className: [required],
21 classComment: [required] 21 classComment: [required]
22 }) 22 })
  23 +const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
  24 +const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
23 const schema = reactive<FormSchema[]>([ 25 const schema = reactive<FormSchema[]>([
24 { 26 {
25 label: '生成模板', 27 label: '生成模板',
26 field: 'templateType', 28 field: 'templateType',
27 component: 'Select', 29 component: 'Select',
28 componentProps: { 30 componentProps: {
29 - options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE) 31 + options: templateTypeOptions
30 }, 32 },
31 colProps: { 33 colProps: {
32 span: 12 34 span: 12
@@ -37,7 +39,7 @@ const schema = reactive&lt;FormSchema[]&gt;([ @@ -37,7 +39,7 @@ const schema = reactive&lt;FormSchema[]&gt;([
37 field: 'scene', 39 field: 'scene',
38 component: 'Select', 40 component: 'Select',
39 componentProps: { 41 componentProps: {
40 - options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE) 42 + options: sceneOptions
41 }, 43 },
42 colProps: { 44 colProps: {
43 span: 12 45 span: 12
@@ -93,11 +95,11 @@ const { register, methods, elFormRef } = useForm({ @@ -93,11 +95,11 @@ const { register, methods, elFormRef } = useForm({
93 schema 95 schema
94 }) 96 })
95 watch( 97 watch(
96 - () => props.currentRow,  
97 - (currentRow) => {  
98 - if (!currentRow) return 98 + () => props.genInfo,
  99 + (genInfo) => {
  100 + if (!genInfo) return
99 const { setValues } = methods 101 const { setValues } = methods
100 - setValues(currentRow) 102 + setValues(genInfo)
101 }, 103 },
102 { 104 {
103 deep: true, 105 deep: true,
yudao-ui-admin-vue3/src/views/infra/codegen/components/ImportTable.vue
@@ -21,8 +21,8 @@ const emit = defineEmits([&#39;ok&#39;]) @@ -21,8 +21,8 @@ const emit = defineEmits([&#39;ok&#39;])
21 const visible = ref(false) 21 const visible = ref(false)
22 const dbLoading = ref(true) 22 const dbLoading = ref(true)
23 const queryParams = reactive({ 23 const queryParams = reactive({
24 - tableName: undefined,  
25 - tableComment: undefined, 24 + name: undefined,
  25 + comment: undefined,
26 dataSourceConfigId: 0 26 dataSourceConfigId: 0
27 }) 27 })
28 const dataSourceConfigs = ref<DataSourceConfigVO[]>([]) 28 const dataSourceConfigs = ref<DataSourceConfigVO[]>([])
@@ -49,8 +49,9 @@ const handleQuery = async () =&gt; { @@ -49,8 +49,9 @@ const handleQuery = async () =&gt; {
49 } 49 }
50 // 重置操作 50 // 重置操作
51 const resetQuery = async () => { 51 const resetQuery = async () => {
52 - queryParams.tableName = undefined  
53 - queryParams.tableComment = undefined 52 + queryParams.name = undefined
  53 + queryParams.comment = undefined
  54 + queryParams.dataSourceConfigId = 0
54 await getList() 55 await getList()
55 } 56 }
56 /** 多选框选中数据 */ 57 /** 多选框选中数据 */
@@ -90,11 +91,11 @@ defineExpose({ @@ -90,11 +91,11 @@ defineExpose({
90 /> 91 />
91 </el-select> 92 </el-select>
92 </el-form-item> 93 </el-form-item>
93 - <el-form-item label="表名称" prop="tableName">  
94 - <el-input v-model="queryParams.tableName" placeholder="请输入表名称" clearable /> 94 + <el-form-item label="表名称" prop="name">
  95 + <el-input v-model="queryParams.name" placeholder="请输入表名称" clearable />
95 </el-form-item> 96 </el-form-item>
96 - <el-form-item label="表描述" prop="tableComment">  
97 - <el-input v-model="queryParams.tableComment" placeholder="请输入表描述" clearable /> 97 + <el-form-item label="表描述" prop="comment">
  98 + <el-input v-model="queryParams.comment" placeholder="请输入表描述" clearable />
98 </el-form-item> 99 </el-form-item>
99 <el-form-item> 100 <el-form-item>
100 <el-button type="primary" @click="handleQuery"> 101 <el-button type="primary" @click="handleQuery">
yudao-ui-admin-vue3/src/views/infra/codegen/components/index.ts
1 import BasicInfoForm from './BasicInfoForm.vue' 1 import BasicInfoForm from './BasicInfoForm.vue'
2 import CloumInfoForm from './CloumInfoForm.vue' 2 import CloumInfoForm from './CloumInfoForm.vue'
3 -import EditTable from './EditTable.vue'  
4 import GenInfoForm from './GenInfoForm.vue' 3 import GenInfoForm from './GenInfoForm.vue'
5 import ImportTable from './ImportTable.vue' 4 import ImportTable from './ImportTable.vue'
6 import Preview from './Preview.vue' 5 import Preview from './Preview.vue'
7 -export { BasicInfoForm, CloumInfoForm, EditTable, GenInfoForm, ImportTable, Preview } 6 +export { BasicInfoForm, CloumInfoForm, GenInfoForm, ImportTable, Preview }