/** * 井管理接口 */ import request from '@/utils/request' import qs from 'qs' // 井查询 export function getWellList(params) { return request({ url: 'well/list', method: 'get', params }) } // 获取井详情 export function getWellInfo(id) { return request({ url: 'well/info', method: 'get', params: { id: id } }) } // 井类别 export function getWellType(params) { return request({ url: '/sys/dict/code/sluicewellType', method: 'get', params }) } // 通讯方式 export function communicationType(params) { return request({ url: '/sys/dict/code/communicationType', method: 'get', params }) } // 添加井 export function addWell(params) { return request({ url: 'well/add', method: 'post', params }) } // 修改井 export function updateWell(params) { return request({ url: 'well/update', method: 'post', params }) } // 删除井 export function delWell(ids) { return request({ url: 'well/delete', method: 'post', params: { ids: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) } }) } // 批量导入 export function batchImportWell(fileobj) { const param = new FormData() param.append('file', fileobj) return request({ url: 'well/batchImport', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param }) } export function batchImportLine(fileobj) { const param = new FormData() param.append('file', fileobj) return request({ url: 'pipeline/batchImport', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, data: param }) } // 批量导出 export function batchExportWell(params, config) { return request({ url: 'well/batchExport', method: 'get', timeout: 120000, params, ...config, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } // export function batchExportWell(params) { // return request({ // url: 'well/batchExport', // method: 'get', // timeout: 120000, // params, // responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob // }) // } // 获取某井内监控数据 export function watchDataByWell(id) { return request({ url: 'well/watchDataByWell', method: 'get', params: { id: id } }) } // 布防撤防 export function bfcf(wellId, bfzt) { return request({ url: 'well/bfcf', method: 'post', params: { wellId: wellId, bfzt: bfzt } }) } // 井批量布防 export function batchBfcf(params) { return request({ url: 'well/batchBfcf', method: 'post', params }) } // 根据布防状态统计井数量 export function wellCountByBfzt() { return request({ url: 'well/countByBfzt', method: 'get' }) } // 单个井查询 export function getWellOne(params) { return request({ url: 'well/selectOne', method: 'get', params }) } export function getLineListPage(params) { return request({ url: 'pipeline/listPage', method: 'get', params }) } // 批量导出 export function batchExportLine(params, config) { return request({ url: 'pipeline/batchExport', method: 'get', timeout: 120000, params, ...config, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } // 删除井 export function delLines(ids) { return request({ url: 'pipeline/delete', method: 'post', params: { ids: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) } }) } // 添加井 export function addLine(params) { return request({ url: 'pipeline/add', method: 'post', params }) } // 修改井 export function updateLine(params) { return request({ url: 'pipeline/update', method: 'post', params }) } // 井查询 export function getKkjList(params) { return request({ url: 'kkj/listPage', method: 'get', params }) } // 删除井 export function delKkj(ids) { return request({ url: 'kkj/batchDelete', method: 'post', params: { ids: ids }, paramsSerializer: params => { return qs.stringify(params, { indices: false }) } }) } // 批量导出 export function batchExportKkj(params, config) { return request({ url: 'kkj/export', method: 'get', timeout: 120000, params, ...config, responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } // // 获取某井内监控数据 // export function watchDataByWell(id) { // return request({ // url: 'well/watchDataByWell', // method: 'get', // params: { // id: id // } // }) // } export function addKkj(params) { return request({ url: 'kkj/add', method: 'post', params }) } // 修改井 export function updateKkj(params) { return request({ url: 'kkj/update', method: 'post', params }) }