fix: 延迟加载数据

This commit is contained in:
TsMask
2023-11-28 21:27:35 +08:00
parent c8e8cca410
commit 572551dd76
2 changed files with 23 additions and 15 deletions

View File

@@ -549,17 +549,21 @@ function fnLoadData() {
tableState.loading = true; // 表格loading
loadAuth(neID).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const num = res.data;
notification.success({
message: t('views.neUser.auth.loadData'),
description: t('views.neUser.auth.loadDataTip', { num: res.data }),
duration: 10,
description: t('views.neUser.auth.loadDataTip', { num }),
duration: num < 10_0000 ? 10 : 30,
});
// 延迟10s后关闭loading刷新列表
setTimeout(() => {
modalState.loadDataLoading = false;
tableState.loading = false; // 表格loading
fnQueryReset();
}, 10_000);
setTimeout(
() => {
modalState.loadDataLoading = false;
tableState.loading = false; // 表格loading
fnQueryReset();
},
num < 10_0000 ? 10_000 : 30_000
);
} else {
message.error({
content: t('common.getInfoFail'),

View File

@@ -777,17 +777,21 @@ function fnLoadData() {
tableState.loading = true; // 表格loading
loadSub(neID).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
const num = res.data;
notification.success({
message: t('views.neUser.sub.loadData'),
description: t('views.neUser.sub.loadDataTip', { num: res.data }),
duration: 10,
description: t('views.neUser.sub.loadDataTip', { num }),
duration: num < 10_0000 ? 10 : 30,
});
// 延迟10s后关闭loading刷新列表
setTimeout(() => {
modalState.loadDataLoading = false;
tableState.loading = false; // 表格loading
fnQueryReset();
}, 10_000);
// 延迟20s后关闭loading刷新列表
setTimeout(
() => {
modalState.loadDataLoading = false;
tableState.loading = false; // 表格loading
fnQueryReset();
},
num < 10_0000 ? 10_000 : 30_000
);
} else {
message.error({
content: t('common.getInfoFail'),