mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 20:55:14 +00:00
Merge pull request #201 from 1014TaoTao/v2.0.0
fix(gencode): 确保提交表单时columns字段存在
This commit is contained in:
@@ -682,7 +682,7 @@ import type { EditorConfiguration } from "codemirror";
|
|||||||
import type { CmComponentRef } from "codemirror-editor-vue3";
|
import type { CmComponentRef } from "codemirror-editor-vue3";
|
||||||
import { ElMessage, ElMessageBox, type FormInstance, type TableInstance } from 'element-plus';
|
import { ElMessage, ElMessageBox, type FormInstance, type TableInstance } from 'element-plus';
|
||||||
import { QuestionFilled, CopyDocument, Close } from '@element-plus/icons-vue';
|
import { QuestionFilled, CopyDocument, Close } from '@element-plus/icons-vue';
|
||||||
import GencodeAPI, { type GenTableOutVO, type DatabaseTable, type GenTableQueryParam, type GenTableColumnOutSchema } from "@/api/generator/gencode";
|
import GencodeAPI, { type GenTableOutVO, type DatabaseTable, type GenTableQueryParam, type GenTableColumnOutSchema, type GenTableSchema } from "@/api/generator/gencode";
|
||||||
|
|
||||||
|
|
||||||
// 表格列配置接口
|
// 表格列配置接口
|
||||||
@@ -1416,8 +1416,12 @@ async function submitForm() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交表单数据
|
// 提交表单数据,确保columns是必需的
|
||||||
const response = await GencodeAPI.updateTable(info, info.id || 0);
|
const tableData = {
|
||||||
|
...info,
|
||||||
|
columns: info.columns || [] // 确保columns存在
|
||||||
|
};
|
||||||
|
const response = await GencodeAPI.updateTable(tableData as GenTableSchema, info.id || 0);
|
||||||
|
|
||||||
if (response?.data?.code === 200) {
|
if (response?.data?.code === 200) {
|
||||||
ElMessage.success((response?.data as any)?.message || '保存成功');
|
ElMessage.success((response?.data as any)?.message || '保存成功');
|
||||||
|
|||||||
Reference in New Issue
Block a user