喜喜检查
This commit is contained in:
69
src/api/xixi-inspection.js
Normal file
69
src/api/xixi-inspection.js
Normal file
@@ -0,0 +1,69 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 恋爱检查项 love_check_item(LoveCheckItemController)
|
||||
* - axios baseURL 为 /api,默认请求 /api/loveCheckItem/...
|
||||
* - 若 Spring 已配置 server.servlet.context-path=/api,且类上仍是 @RequestMapping("/api/loveCheckItem"),
|
||||
* 实际路径为 /api/api/loveCheckItem/...,可在 .env 设置:VUE_APP_LOVE_CHECK_ITEM_SEGMENT=api/loveCheckItem(不要首尾斜杠)
|
||||
*/
|
||||
function lcUrl(action) {
|
||||
const seg = (process.env.VUE_APP_LOVE_CHECK_ITEM_SEGMENT || 'loveCheckItem').replace(/^\/+|\/+$/g, '')
|
||||
return seg.startsWith('api/') ? `${seg}/${action}` : `/${seg}/${action}`
|
||||
}
|
||||
|
||||
export function fetchXixiInspectionList(params) {
|
||||
return request({
|
||||
url: lcUrl('list'),
|
||||
method: 'get',
|
||||
params: {
|
||||
current: params.page || 1,
|
||||
size: params.limit || 10,
|
||||
parentId: params.parentId,
|
||||
projectName: params.projectName,
|
||||
type: params.type,
|
||||
hazardStars: params.hazardStars,
|
||||
createStartTime: params.createStartTime,
|
||||
createEndTime: params.createEndTime,
|
||||
updateStartTime: params.updateStartTime,
|
||||
updateEndTime: params.updateEndTime
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function getXixiInspectionById(id) {
|
||||
return request({
|
||||
url: lcUrl(`get/${id}`),
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addXixiInspection(data) {
|
||||
return request({
|
||||
url: lcUrl('add'),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateXixiInspection(data) {
|
||||
return request({
|
||||
url: lcUrl('update'),
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteXixiInspection(id) {
|
||||
return request({
|
||||
url: lcUrl(`delete/${id}`),
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function batchDeleteXixiInspection(ids) {
|
||||
return request({
|
||||
url: lcUrl('batchDelete'),
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user