import request from '@/utils/request'
|
|
// ==================== 培训资料接口 ====================
|
export function getMaterialList(query) {
|
return request({
|
url: '/safety/training/material/list',
|
method: 'get',
|
params: query
|
})
|
}
|
|
export function uploadMaterial(data) {
|
return request({
|
url: '/safety/training/material/upload',
|
method: 'post',
|
data: data
|
})
|
}
|
|
export function updateMaterial(data) {
|
return request({
|
url: '/safety/training/material/update',
|
method: 'put',
|
data: data
|
})
|
}
|
|
export function deleteMaterial(id) {
|
return request({
|
url: '/safety/training/material/delete/' + id,
|
method: 'delete'
|
})
|
}
|
|
export function getMaterialDetail(id) {
|
return request({
|
url: '/safety/training/material/detail/' + id,
|
method: 'get'
|
})
|
}
|
|
// ==================== 培训计划接口 ====================
|
export function getPlanList(query) {
|
return request({
|
url: '/safety/training/plan/list',
|
method: 'get',
|
params: query
|
})
|
}
|
|
export function addPlan(data) {
|
return request({
|
url: '/safety/training/plan/add',
|
method: 'post',
|
data: data
|
})
|
}
|
|
export function updatePlan(data) {
|
return request({
|
url: '/safety/training/plan/update',
|
method: 'put',
|
data: data
|
})
|
}
|
|
export function deletePlan(id) {
|
return request({
|
url: '/safety/training/plan/delete/' + id,
|
method: 'delete'
|
})
|
}
|
|
export function getPlanDetail(id) {
|
return request({
|
url: '/safety/training/plan/detail/' + id,
|
method: 'get'
|
})
|
}
|
|
// ==================== 完成记录接口 ====================
|
export function getRecordList(query) {
|
return request({
|
url: '/safety/training/record/list',
|
method: 'get',
|
params: query
|
})
|
}
|
|
export function addRecord(data) {
|
return request({
|
url: '/safety/training/record/add',
|
method: 'post',
|
data: data
|
})
|
}
|
|
export function updateRecord(data) {
|
return request({
|
url: '/safety/training/record/update',
|
method: 'put',
|
data: data
|
})
|
}
|
|
export function deleteRecord(id) {
|
return request({
|
url: '/safety/training/record/delete/' + id,
|
method: 'delete'
|
})
|
}
|
|
export function getRecordDetail(id) {
|
return request({
|
url: '/safety/training/record/detail/' + id,
|
method: 'get'
|
})
|
}
|
|
export function exportRecord(query) {
|
return request({
|
url: '/safety/training/record/export',
|
method: 'get',
|
params: query,
|
responseType: 'blob'
|
})
|
}
|
|
// 获取学习统计(用于员工学习页面)
|
export function getLearningStatistics() {
|
return request({
|
url: '/safety/training/record/statistics',
|
method: 'get'
|
})
|
}
|