feat(person): add pages

This commit is contained in:
2026-03-10 18:23:48 +08:00
parent 928f64a5f0
commit 062242a63c
25 changed files with 4862 additions and 4 deletions

View File

@@ -0,0 +1,49 @@
import httpFetch from "@/api/fetch"
import { Daily } from "./typing"
import { BASE_LABEL_API } from "../const"
export const getSelfDailyWorkList = (data: Daily.Request) => {
return httpFetch<Daily.Response>({
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/list/self",
method: "POST",
body: JSON.stringify(data),
})
}
export const getTeamDailyWorkList = (data: Daily.Request) => {
return httpFetch<Daily.Response>({
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/list/team",
method: "POST",
body: JSON.stringify(data),
})
}
export const addDailyWorkData = (data: Daily.CreateProps) => {
return httpFetch({
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/add",
method: "POST",
body: JSON.stringify(data),
})
}
export const editDailyWorkData = (data: Daily.CreateProps, id: number) => {
return httpFetch({
url: BASE_LABEL_API + `/api/v1/label_server/daily_work/edit/${id}`,
method: "put",
body: JSON.stringify(data),
})
}
export const deleteDailyWorkData = (id: number) => {
return httpFetch({
url: BASE_LABEL_API + `/api/v1/label_server/daily_work/delete/${id}`,
method: "delete",
})
}
export const lockDailyWorkData = (lock_status: boolean, id: number) => {
return httpFetch({
url: BASE_LABEL_API + `/api/v1/label_server/daily_work/lock/${id}`,
method: "put",
body: JSON.stringify({ lock_status }),
})
}

View File

@@ -0,0 +1,84 @@
export namespace Daily {
export interface Request {
date_end?: string
date_start?: string
/**
* 0-个人日报 1-团队日报
*/
flag?: number
name?: string
order_by?: string
page_number?: number
page_size?: number
[property: string]: any
}
export interface Summary {
total_work_time: number
total_standard_size: number
total_completed_size: number
total_residual_size: number
total_residual_work_time: number
}
export interface Response {
daily_work_list: DailyWorkList[]
total_items: number
total_pages: number
total_summary: Summary
[property: string]: any
}
export interface DailyWorkList {
accounting_type?: string | null
actual_type?: string
completed_size?: number
date?: string
end_time?: string
id?: number
leader_name?: string | null
leader_uid?: number | null
lock_status?: boolean
obj_type?: number | null
performance_accounting?: boolean | null
project_id?: number | null
project_name?: string | null
rate?: number
remarks?: string | null
residual_pm?: boolean | null
residual_size?: number
residual_work_time?: number
set_type?: string
standard_size?: number
start_time?: string
uid?: number
username?: string
work_time?: number
work_type?: string | null
[property: string]: any
}
export interface CreateProps {
accounting_type?: string
actual_type: string
completed_size?: number
date: string
end_time?: string
leader_uid?: number
obj_type?: number
performance_accounting?: boolean
project_id?: number
rate?: number
remarks?: string
residual_pm?: boolean
residual_size?: number
residual_work_time?: number
set_type: string
standard_size?: number
start_time?: string
uid: number
work_time?: number
work_type?: string
[property: string]: any
}
}