Skip to content

Commit

Permalink
fix: 代码生成配置表单校验错误自动跳转回错误 tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed May 16, 2024
1 parent 6705027 commit a015d9f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/views/tool/generator/GenConfigDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@before-ok="save"
@close="reset"
>
<a-tabs>
<a-tabs v-model:active-key="activeKey">
<a-tab-pane key="1" title="生成配置">
<a-form ref="formRef" :model="form" :rules="rules" class="gen-config" size="large">
<a-form-item label="作者名称" field="author">
Expand Down Expand Up @@ -194,11 +194,15 @@ const handleRefresh = async (tableName: string) => {
await getDataList(tableName, true)
}
const activeKey = ref('1')
// 保存
const save = async () => {
try {
const isInvalid = await formRef.value?.validate()
if (isInvalid) return false
if (isInvalid) {
activeKey.value = '1'
return false
}
await saveGenConfig(form.tableName, {
genConfig: form,
fieldConfigs: dataList.value
Expand Down

0 comments on commit a015d9f

Please sign in to comment.