新增数据,开始安全巡检模块
This commit is contained in:
63
src/api/system/InspectionRecord/index.ts
Normal file
63
src/api/system/InspectionRecord/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { RecordVO, RecordForm, RecordQuery } from '@/api/system/InspectionRecord/type';
|
||||
|
||||
/**
|
||||
* 查询巡检记录主列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listRecord = (query?: RecordQuery): AxiosPromise<RecordVO[]> => {
|
||||
return request({
|
||||
url: '/inspection/record/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询巡检记录主详细
|
||||
* @param id
|
||||
*/
|
||||
export const getRecord = (id: string | number): AxiosPromise<RecordVO> => {
|
||||
return request({
|
||||
url: '/inspection/record/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增巡检记录主
|
||||
* @param data
|
||||
*/
|
||||
export const addRecord = (data: RecordForm) => {
|
||||
return request({
|
||||
url: '/inspection/record',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改巡检记录主
|
||||
* @param data
|
||||
*/
|
||||
export const updateRecord = (data: RecordForm) => {
|
||||
return request({
|
||||
url: '/inspection/record',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除巡检记录主
|
||||
* @param id
|
||||
*/
|
||||
export const delRecord = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/inspection/record/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
109
src/api/system/InspectionRecord/type.ts
Normal file
109
src/api/system/InspectionRecord/type.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
export interface RecordVO {
|
||||
actualEndTime?: null;
|
||||
actualStartTime?: null;
|
||||
createByName?: null;
|
||||
createTime?: string;
|
||||
details?: null;
|
||||
id?: string;
|
||||
inspectorId?: number;
|
||||
inspectorName?: string;
|
||||
planId?: string;
|
||||
planName?: string;
|
||||
remark?: null;
|
||||
routeId?: string;
|
||||
routeName?: string;
|
||||
status?: number;
|
||||
statusLabel?: null;
|
||||
taskName?: string;
|
||||
taskTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface RecordForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 关联巡检任务ID
|
||||
*/
|
||||
taskId?: string | number;
|
||||
|
||||
/**
|
||||
* 关联巡检计划ID
|
||||
*/
|
||||
planId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检人员ID
|
||||
*/
|
||||
inspectorId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检路线ID
|
||||
*/
|
||||
routeId?: string | number;
|
||||
|
||||
/**
|
||||
* 任务开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 任务结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 执行状态(字典:inspection_exec_status 0-按时完成 1-超时完成 2-未完成)
|
||||
*/
|
||||
execStatus?: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface RecordQuery extends PageQuery {
|
||||
/**
|
||||
* 关联巡检任务ID
|
||||
*/
|
||||
taskId?: string | number;
|
||||
|
||||
/**
|
||||
* 关联巡检计划ID
|
||||
*/
|
||||
planId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检人员ID
|
||||
*/
|
||||
inspectorId?: string | number;
|
||||
|
||||
/**
|
||||
* 巡检路线ID
|
||||
*/
|
||||
routeId?: string | number;
|
||||
|
||||
/**
|
||||
* 任务开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 任务结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 执行状态(字典:inspection_exec_status 0-按时完成 1-超时完成 2-未完成)
|
||||
*/
|
||||
execStatus?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
Reference in New Issue
Block a user