You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
1.7 KiB
24 lines
1.7 KiB
/* global MyConfig */ |
|
import request, { download } from '@/utils/request' |
|
|
|
const IMPORT_EXCEL_PATH = '/business/hazard/importData' |
|
const IMPORT_ZIP_PATH = '/business/hazard/importZip' |
|
const IMPORT_TEMPLATE_PATH = '/business/hazard/importTemplate' |
|
|
|
export function listHazardLedger(query) { return request({ url: '/flowable/hazard/todoList', method: 'get', params: query }) } |
|
export function getHazardLedgerDetail(id) { return request({ url: '/business/hazard/info/' + id, method: 'get' }) } |
|
export function listHazardLedgerAttachments(reportId) { return request({ url: '/business/hazard/attachment/' + reportId, method: 'get' }) } |
|
export function exportHazardLedger(data) { return request({ url: '/business/hazard/export', method: 'post', data, responseType: 'blob' }) } |
|
|
|
// 删除隐患(后端级联删除附件);ids 支持逗号分隔批量 |
|
export function deleteHazardLedger(ids) { return request({ url: '/business/hazard/' + ids, method: 'delete' }) } |
|
|
|
// el-upload 的上传地址需要完整 URL,统一在 API 层拼接,避免页面直接写请求地址。 |
|
// mode: 'excel' 导入历史隐患数据 Excel;'image' 导入历史隐患数据 ZIP 包(Excel + 图片附件)。 |
|
export function getHazardImportAction(mode) { return MyConfig.BASE_API.replace(/\/$/, '') + (mode === 'image' ? IMPORT_ZIP_PATH : IMPORT_EXCEL_PATH) } |
|
|
|
// 下载历史隐患导入模板(POST,后端直接返回 Excel 文件流)。 |
|
export function downloadHazardImportTemplate() { return download(IMPORT_TEMPLATE_PATH, {}, '历史隐患导入模板_' + new Date().getTime() + '.xlsx') } |
|
|
|
// api.json 当前未声明同步重试接口,禁止在前端猜测 URL。 |
|
export function retryHazardSync() { return Promise.reject(new Error('后端接口文档未提供隐患同步重试接口')) }
|
|
|