feat(web): 人员工时台账表格+多维搜索+CSV导出+新流转红点标注+分页中文

This commit is contained in:
2026-08-13 16:04:29 +08:00
parent 91b1426ccb
commit f4fc23be42
3 changed files with 534 additions and 101 deletions

View File

@ -46,6 +46,8 @@ export interface PersonDevice {
material_name: string;
spec_model: string;
task_status: string;
duration_hours: number;
received_at: string | null;
}
export interface PersonWorkload {
@ -55,6 +57,32 @@ export interface PersonWorkload {
devices: PersonDevice[];
}
export interface PersonHistoryRecord {
task_id: string;
task_name: string;
assignee_id: string;
assignee_name: string;
product_sn: string;
external_serial: string | null;
material_name: string;
spec_model: string;
status: string;
received_at: string | null;
completed_at: string | null;
duration_hours: number;
latest_valid_remark: string | null;
record_count: number;
}
export interface PeopleHistoryQuery {
since?: string;
until?: string;
assignee_id?: string;
spec_model?: string;
product_sn?: string;
task_name?: string;
}
export interface ProductMessageItem {
id: string;
content: string;
@ -96,6 +124,34 @@ export async function fetchPeopleWorkload(): Promise<PersonWorkload[]> {
return data;
}
export async function fetchPeopleHistory(query: PeopleHistoryQuery = {}): Promise<PersonHistoryRecord[]> {
const params: Record<string, string> = {};
for (const [k, v] of Object.entries(query)) {
if (v) params[k] = v;
}
const { data } = await api.get<PersonHistoryRecord[]>("/dashboard/people-history", { params });
return data;
}
export async function downloadPeopleHistory(query: PeopleHistoryQuery = {}): Promise<void> {
const params: Record<string, string> = {};
for (const [k, v] of Object.entries(query)) {
if (v) params[k] = v;
}
const res = await api.get("/dashboard/people-history/export", {
params,
responseType: "blob",
});
const url = window.URL.createObjectURL(res.data as Blob);
const a = document.createElement("a");
a.href = url;
a.download = "people_history.csv";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}
export async function fetchDashboardMessages(
keyword = "", skip = 0, limit = 30,
): Promise<ProductMessageList> {