51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
export interface WorkStatisticsQuery {
|
|
month?: string
|
|
date?: string
|
|
data_type?: string
|
|
process_id?: string | number
|
|
step_id?: string | number
|
|
scan_result?: string | number
|
|
user_code?: string
|
|
operator?: string
|
|
process_name?: string
|
|
step_name?: string
|
|
}
|
|
|
|
export interface WorkStatisticsColumn {
|
|
key: string
|
|
label: string
|
|
}
|
|
|
|
export interface WorkStatisticsOption {
|
|
label: string
|
|
value: string | number
|
|
}
|
|
|
|
export interface WorkStatisticsResponse {
|
|
columns: WorkStatisticsColumn[]
|
|
items: Array<Record<string, string | number | null>>
|
|
}
|
|
|
|
export const ProduceWorkStatisticsService = {
|
|
monthly(params: WorkStatisticsQuery = {}) {
|
|
return request.get<WorkStatisticsResponse>({ url: '/produce/statistics/monthly', params })
|
|
},
|
|
daily(params: WorkStatisticsQuery = {}) {
|
|
return request.get<WorkStatisticsResponse>({ url: '/produce/statistics/daily', params })
|
|
},
|
|
getProcessOptions() {
|
|
return request.get<WorkStatisticsOption[]>({
|
|
url: '/produce/process',
|
|
params: { format: 'select' }
|
|
})
|
|
},
|
|
getStepOptions(processId?: string | number) {
|
|
return request.get<WorkStatisticsOption[]>({
|
|
url: '/produce/process-step',
|
|
params: { format: 'select', process_id: processId || undefined }
|
|
})
|
|
}
|
|
}
|