Files
sunProduct/src/api/system/Inspection/index.ts
2026-09-02 17:32:15 +08:00

136 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
/**
* 查询巡检数据 概况
* @param query
* @returns {*}
*/
export const listItem = (query?: Request): AxiosPromise<any[]> => {
return request({
url: '/inspection/data/list',
method: 'get',
params: query
});
};
export const overview = (query?: Request): AxiosPromise<any[]> => {
return request({
url: '/inspection/data/generate/overview',
method: 'POST',
params: query
});
};
export interface Request {
/**
* 进行中的任务数
*/
activeTask?: string;
/**
* 按时完成任务数
*/
completedTask?: string;
/**
* 创建时间
*/
createTime?: string;
/**
* 详细数据
*/
dataContent?: string;
/**
* 数据类型:0-概况/1-日报/2-周报/3-月报/4-统计
*/
dataType?: string;
/**
* 巡检人员id
*/
inspectorId?: string;
/**
* 完成率
*/
onTimeRate?: string;
/**
* 超时完成数
*/
outCompletedTasks?: string;
/**
* 超时未完成数
*/
outUncompletedTasks?: string;
/**
* 未开始的任务数
*/
pendingTask?: string;
statDate?: string;
/**
* 总任务数
*/
totalTasks?: string;
/**
* 更新时间
*/
updateTime?: string;
[property: string]: any;
}
/**
* 查询 巡检业务统计
* @param query
* @returns {*}
*/
export const list_statapi = (query?: { queryDateBegin: string; queryDateEnd: string }): AxiosPromise<any[]> => {
return request({
url: '/inspection/data/role/stat',
method: 'get',
params: query
});
};
export type exportPageApiQuery = {
/**
* 数据类型:1-日报 / 2-周报 / 3-月报
*/
dataType?: string;
/**
* 页码
*/
pageNum: number;
/**
* 每页条数
*/
pageSize: number;
/**
* 查询开始日期
*/
queryDateBegin?: string;
/**
* 查询结束日期
*/
queryDateEnd?: string;
/**
* 日期
*/
statDate?: string;
};
type exportAllApiQuery = Omit<exportPageApiQuery, 'pageSize' | 'pageNum'>;
/** 导出当前页 数据api */
export const exportPageApi = (data: exportPageApiQuery): AxiosPromise<any[]> => {
return request({
url: '/inspection/data/export/page',
method: 'POST',
data
});
};
/** 导出 所有 数据api */
export const exportAllApi = (data: exportAllApiQuery): AxiosPromise<any[]> => {
return request({
url: '/inspection/data/export',
method: 'POST',
data
});
};