27 lines
957 B
JavaScript
27 lines
957 B
JavaScript
import { get, post } from './api'
|
||
|
||
export const getCableList = (deptId) =>
|
||
get('/business/OdfCables/list', { deptId })
|
||
|
||
export const getFaultList = (cableId, pageNum, pageSize) =>
|
||
get('/business/OdfCableFaults/list', { cableId, pageNum, pageSize })
|
||
|
||
export const getFaultDetail = (id) =>
|
||
get(`/business/OdfCableFaults/${id}`)
|
||
|
||
/**
|
||
* 新增故障(JSON 提交,图片已上传至 COS)
|
||
* @param {object} data - 故障信息,含 imageUrls 数组
|
||
* @returns {Promise}
|
||
*/
|
||
export const addFault = (data) => post('/business/OdfCableFaults/add', data, { timeout: 120000 })
|
||
|
||
export const incrementFaultCount = (id) =>
|
||
post(`/business/OdfCableFaults/incrementFaultCount/${id}`)
|
||
|
||
export const updateMileageCorrection = (id, mileageCorrection) =>
|
||
post(`/business/OdfCableFaults/updateMileageCorrection/${id}`, { mileageCorrection })
|
||
|
||
export const searchCablesAndFaults = (deptId, keyword) =>
|
||
get('/business/OdfCables/search', { deptId, keyword })
|