fix: 代码生成器

This commit is contained in:
xingyu
2022-10-14 17:52:04 +08:00
parent ff938a9e30
commit aa983a6fa9
14 changed files with 30 additions and 19 deletions

View File

@@ -26,6 +26,10 @@ const activeName = ref('cloum')
const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>()
const genInfoRef = ref<ComponentRef<typeof GenInfoForm>>()
const cloumInfoRef = ref(null)
const parentMenuId = ref<number>()
const menu = (id: number) => {
parentMenuId.value = id
}
const submitForm = async () => {
const basicInfo = unref(basicInfoRef)
const genInfo = unref(genInfoRef)
@@ -38,6 +42,11 @@ const submitForm = async () => {
table: Object.assign({}, basicInfoData, genInfoData),
columns: cloumCurrentRow.value
}
if (parentMenuId.value) {
genInfoData.parentMenuId = parentMenuId.value
} else {
genInfoData.parentMenuId = 0
}
await updateCodegenTableApi(genTable)
ElMessage.success(t('common.updateSuccess'))
push('/infra/codegen')
@@ -57,7 +66,7 @@ onMounted(() => {
<CloumInfoForm ref="cloumInfoRef" :info="cloumCurrentRow" />
</el-tab-pane>
<el-tab-pane label="生成信息" name="genInfo">
<GenInfoForm ref="genInfoRef" :genInfo="tableCurrentRow" />
<GenInfoForm ref="genInfoRef" :genInfo="tableCurrentRow" @menu="menu" />
</el-tab-pane>
</el-tabs>
<template #right>