feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面

This commit is contained in:
zhanjunhao
2026-11-09 21:45:37 +08:00
parent 54b3e0cc21
commit 5c0849e82b
242 changed files with 9242 additions and 5043 deletions
+32 -25
View File
@@ -569,34 +569,39 @@ export const useLogsData = () => {
});
url = `/api/log/self?${params.toString()}`;
}
const res = await API.get(url);
// 丢弃过期响应,只处理仍然是最新的请求
if (reqId !== logsRequestIdRef.current) return;
const { success, message, data } = res.data;
if (success) {
const newPageData = Array.isArray(data?.items) ? data.items : [];
setActivePage(data?.page || 1);
setPageSize(data?.page_size || pageSize);
setLogCount(data?.total || 0);
try {
const res = await API.get(url);
// 丢弃过期响应,只处理仍然是最新的请求
if (reqId !== logsRequestIdRef.current) return;
const { success, message, data } = res.data;
if (success) {
const newPageData = Array.isArray(data?.items) ? data.items : [];
setActivePage(data?.page || 1);
setPageSize(data?.page_size || pageSize);
setLogCount(data?.total || 0);
// 记录本次成功查询的筛选条件(与展示数据/总数一致),供「导出全部筛选结果」复用
appliedExportParamsRef.current = {
username,
token_name,
model_name,
start_timestamp: localStartTimestamp,
end_timestamp: localEndTimestamp,
channel,
group,
user_id,
type: currentLogType,
};
// 记录本次成功查询的筛选条件(与展示数据/总数一致),供「导出全部筛选结果」复用
appliedExportParamsRef.current = {
username,
token_name,
model_name,
start_timestamp: localStartTimestamp,
end_timestamp: localEndTimestamp,
channel,
group,
user_id,
type: currentLogType,
};
setLogsFormat(newPageData);
} else {
showError(message);
setLogsFormat(newPageData);
} else {
showError(message);
}
} catch (error) {
if (reqId === logsRequestIdRef.current) showError(error.message || error);
} finally {
if (reqId === logsRequestIdRef.current) setLoading(false);
}
if (reqId === logsRequestIdRef.current) setLoading(false);
};
// Page handlers
@@ -718,6 +723,8 @@ export const useLogsData = () => {
// Column visibility
visibleColumns,
setVisibleColumns,
getDefaultColumnVisibility,
showColumnSelector,
setShowColumnSelector,
handleColumnVisibilityChange,