提交 282a2767 authored 作者: leon's avatar leon

医院操作action 添加loading状态

上级 7cb5a337
......@@ -86,7 +86,7 @@
};
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerTable, { reload }] = useTable({
const [registerTable, { reload, setLoading }] = useTable({
title: '医院管理',
api: (params) => HospitalApi.search(handleParams(params)),
columns,
......@@ -156,15 +156,25 @@
};
const handleDelete = (record: Recordable) => {
HospitalApi.remove(record.id).then((_) => {
reload();
});
setLoading(true);
HospitalApi.remove(record.id)
.then((_) => {
reload();
})
.catch(() => {
setLoading(false);
});
};
const handleBatchDelete = () => {
HospitalApi.batchRemove(checkedKeys.value).then((_) => {
reload();
});
setLoading(true);
HospitalApi.batchRemove(checkedKeys.value)
.then((_) => {
reload();
})
.catch(() => {
setLoading(false);
});
};
const handleSuccess = () => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论