修复 代码生成信息 反显问题

This commit is contained in:
吕金泽
2022-06-08 22:06:49 +08:00
parent 476760a9b5
commit 00dad13df3
5 changed files with 24 additions and 17 deletions
@@ -1,6 +1,6 @@
<template>
<el-form ref="dataForm" :model="genInfo" :rules="genInfoRules" label-position="right" label-width="120px">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tabs v-model="activeName">
<el-tab-pane label="表信息" name="basic">
<el-row :gutter="24">
<el-col :span="8">
@@ -151,11 +151,6 @@ import {reactive, ref, watch, getCurrentInstance, onMounted, nextTick} from 'vue
})
}
watch(() => genInfo.value.datasource, () => {
datasourceChange()
genInfo.value.tableName = ''
})
function formInitClearValidate(){
genInfo.value.tableComment = ''
genInfo.value.info.moduleName = '';
@@ -170,6 +165,13 @@ import {reactive, ref, watch, getCurrentInstance, onMounted, nextTick} from 'vue
},1)
}
function watchDatasource(){
watch(() => genInfo.value.datasource, () => {
datasourceChange()
genInfo.value.tableName = ''
})
}
function watchTableName(){
datasourceChange()
watch(() => genInfo.value.tableName, (value) => {
@@ -199,6 +201,11 @@ import {reactive, ref, watch, getCurrentInstance, onMounted, nextTick} from 'vue
})
}
function watchInfo(){
watchTableName()
watchDatasource()
}
const activeName = ref('basic')
const formData = reactive({
groupName: ''
@@ -399,10 +406,10 @@ import {reactive, ref, watch, getCurrentInstance, onMounted, nextTick} from 'vue
formData.info = JSON.parse(formData.info)
formData.columns = JSON.parse(formData.columns)
genInfo.value = formData
watchTableName()
watchInfo()
})
}
defineExpose({ save, getDetail, watchTableName })
defineExpose({ save, getDetail, watchInfo })
</script>
@@ -20,7 +20,7 @@
permission: 'code:gen:save',
click: () => {
formDialog.value.show()
nextTick(() => magicForm.value.watchTableName())
nextTick(() => magicForm.value.watchInfo())
}
}],
table: {