feat: 完成登录与栅格下载桌面端

This commit is contained in:
2026-10-25 02:09:12 +08:00
commit 5ca491834e
76 changed files with 10637 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
import { api } from "../../shared/http";
export interface GroupOption {
id: string;
label: string;
columns: string[];
}
export interface Meta {
networks: { value: string; label: string }[];
cities: { name: string; code: string }[];
groups: Record<string, GroupOption[]>;
fixed: { grid: string[]; cell: Record<string, string[]> };
}
export interface DownloadJob {
id: string;
name: string;
status: string;
message: string;
network: string;
cityName: string;
month: string;
total: number;
completed: number;
failed: number;
writtenRows: number;
csvPath: string;
failures: { id: string; message: string }[];
createdAt: string;
}
export function loadMeta() {
return api<Meta>("/api/download/meta");
}
export function loadJobs() {
return api<{ jobs: DownloadJob[] }>("/api/download/jobs");
}
export function createJob(form: FormData) {
return api<DownloadJob>("/api/download/jobs", { method: "POST", body: form });
}
export function cancelJob(id: string) {
return api<DownloadJob>(`/api/download/jobs/${id}/cancel`, { method: "POST" });
}
export function resumeJob(id: string) {
return api<DownloadJob>(`/api/download/jobs/${id}/resume`, { method: "POST" });
}