mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-08 18:49:09 +00:00
refactor(gencode): 将导入弹窗查询表单改为ref类型以保持响应性
This commit is contained in:
@@ -302,7 +302,7 @@ const tableNames = ref<string[]>([]);
|
||||
// 导入弹窗专用状态
|
||||
const importLoading = ref(false);
|
||||
const importTotal = ref<number>(0);
|
||||
const importQueryFormData = reactive<GenTablePageQuery>({
|
||||
const importQueryFormData = ref<GenTablePageQuery>({
|
||||
page_no: 1,
|
||||
page_size: 10,
|
||||
table_name: undefined,
|
||||
@@ -974,7 +974,7 @@ async function handleImportTable(): Promise<void> {
|
||||
async function getDbList(): Promise<void> {
|
||||
importLoading.value = true;
|
||||
try {
|
||||
const res = await GencodeAPI.listDbTable(importQueryFormData);
|
||||
const res = await GencodeAPI.listDbTable(importQueryFormData.value);
|
||||
if (res.data && res.data.data) {
|
||||
dbTableList.value = res.data.data.items;
|
||||
importTotal.value = res.data.data.total;
|
||||
@@ -988,7 +988,7 @@ async function getDbList(): Promise<void> {
|
||||
|
||||
/** 导入弹窗搜索按钮操作 */
|
||||
async function handleImportQuery(): Promise<void> {
|
||||
importQueryFormData.page_no = 1;
|
||||
importQueryFormData.value.page_no = 1;
|
||||
await getDbList();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user