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