feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -123,6 +123,7 @@ const OrgRecharge = ({ orgId }) => {
|
||||
const [history, setHistory] = useState([]);
|
||||
const [historyTotal, setHistoryTotal] = useState(0);
|
||||
const [historyPage, setHistoryPage] = useState(1);
|
||||
const [historyPageSize, setHistoryPageSize] = useState(10);
|
||||
const [historyLoading, setHistoryLoading] = useState(false);
|
||||
const [refreshHistory, setRefreshHistory] = useState(0);
|
||||
|
||||
@@ -186,21 +187,26 @@ const OrgRecharge = ({ orgId }) => {
|
||||
async (page = 1) => {
|
||||
setHistoryLoading(true);
|
||||
try {
|
||||
const res = await API.get(`/api/org/topup?p=${page}&page_size=10`, {
|
||||
headers: orgHeaders,
|
||||
});
|
||||
const res = await API.get(
|
||||
`/api/org/topup?p=${page}&page_size=${historyPageSize}`,
|
||||
{
|
||||
headers: orgHeaders,
|
||||
},
|
||||
);
|
||||
if (res.data.success) {
|
||||
const data = res.data.data;
|
||||
setHistory(data.items || []);
|
||||
setHistoryTotal(data.total || 0);
|
||||
} else {
|
||||
showError(res.data.message);
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
showError(e.message);
|
||||
} finally {
|
||||
setHistoryLoading(false);
|
||||
}
|
||||
},
|
||||
[orgId],
|
||||
[orgId, historyPageSize],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -772,8 +778,12 @@ const OrgRecharge = ({ orgId }) => {
|
||||
pagination={{
|
||||
currentPage: historyPage,
|
||||
total: historyTotal,
|
||||
pageSize: 10,
|
||||
pageSize: historyPageSize,
|
||||
onPageChange: setHistoryPage,
|
||||
onPageSizeChange: (size) => {
|
||||
setHistoryPage(1);
|
||||
setHistoryPageSize(size);
|
||||
},
|
||||
showTotal: (n) => t('共 {{total}} 条', { total: n }),
|
||||
}}
|
||||
empty={<Text type='tertiary'>{t('暂无充值记录')}</Text>}
|
||||
|
||||
Reference in New Issue
Block a user