From f195b5479fa47ed307792ad74a11f5c684de3267 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Wed, 22 May 2024 09:15:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=B0=E8=B4=A6=E8=AF=AF?= =?UTF-8?q?=E5=88=A0=E4=BB=A3=E7=A0=81=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/equipmentMainPart/index.ts | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/api/eam/equipmentMainPart/index.ts diff --git a/src/api/eam/equipmentMainPart/index.ts b/src/api/eam/equipmentMainPart/index.ts new file mode 100644 index 000000000..b92db6d86 --- /dev/null +++ b/src/api/eam/equipmentMainPart/index.ts @@ -0,0 +1,67 @@ +import request from '@/config/axios' + +export interface EquipmentMainPartVO { + id: number + name: string + code: string + type: string + departmentCode: string + remark: string + siteId: string + available: string + deletionTime: Date + deleterId: byte[] + concurrencyStamp: number +} + +// 查询主要部件列表 +export const getEquipmentMainPartPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/equipment-main-part/senior', data }) + } else { + return await request.get({ url: `/eam/equipment-main-part/page`, params }) + } +} + +// 查询主要部件详情 +export const getEquipmentMainPart = async (id: number) => { + return await request.get({ url: `/eam/equipment-main-part/get?id=` + id }) +} + +// 新增主要部件 +export const createEquipmentMainPart = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/equipment-main-part/create`, data }) +} + +// 修改主要部件 +export const updateEquipmentMainPart = async (data: EquipmentMainPartVO) => { + console.log(data) + return await request.put({ url: `/eam/equipment-main-part/update`, data }) +} + +// 删除主要部件 +export const deleteEquipmentMainPart = async (id: number) => { + return await request.delete({ url: `/eam/equipment-main-part/delete?id=` + id }) +} + +// 导出主要部件 Excel +export const exportEquipmentMainPart = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/eam/equipment-main-part/export-excel-senior`, data }) + }else{ + return await request.download({ url: `/eam/equipment-main-part/export-excel`, params }) + } +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/equipment-main-part/get-import-template' }) +} + +// 启用 / 禁用 +export const updateEnableCode = async (data: EquipmentMainPartVO) => { + return await request.post({ url: `/eam/equipment-main-part/ables` , data }) +} \ No newline at end of file