import request from '@/config/axios' // 设备台账 VO export interface IotDeviceVO { id: number // 主键id deviceCode: string // 资产编码 deviceName: string // 设备名称 brand: number // 品牌 model: number // 规格型号 deptId: number // 所在部门id deptName: string // 所在部门名称 deviceStatus: string // 设备状态 deviceStatusName: string // 设备状态名称 assetProperty: string // 资产性质 picUrl: string // 图片 remark: string // 备注 manufacturerId: number // 制造商id supplierId: number // 供应商id manDate: Date // 生产日期 nameplate: string // 铭牌信息 expires: number // 质保到期 plPrice: number // 采购/租赁价格 plDate: Date // 采购/租赁日期 plYear: number // 折旧年限 plStartDate: number // 折旧开始日期 plMonthed: number // 已提折旧月数 plAmounted: number // 已提折旧金额 remainAmount: number // 剩余金额 infoId: number // 资料分类id infoType: string // 资料类型 infoName: string // 资料名称 infoRemark: string // 资料备注 infoUrl: string // 资料附件 templateJson: string // 动态模板信息 bomNodeId: number // bom节点id name: string // bom节点名称 code: string // bom节点编码 devicePersons: string // 设备责任人 逗号分隔 location: string lat: number lng: number hasSetMaintenanceBom: boolean // 当前设备是否已经配置了保养BOM shouldWorkOrder: boolean // 当前设备根据保养规则应当生成保养工单 runningWorkOrder: boolean // 当前设备是否已经有待执行的保养工单 } // 设备台账 API export const IotDeviceApi = { getCompany: async (params: any) => { return await request.get({ url: `/rq/iot-device/company?id=` + params }) }, getMaxCode: async (params: any) => { return await request.get({ url: `/rq/iot-device/max?yfCode=` + params }) }, getMapDevice: async (params: any) => { return await request.get({ url: `/rq/iot-device/map`, params }) }, getAllDeviceParams: async (params: any) => { return await request.get({ url: `/rq/iot-device/all/params`, params }) }, // 查询设备台账分页 getIotDevicePage: async (params: any) => { return await request.get({ url: `/rq/iot-device/page`, params }) }, getPlanDevicePage: async (params: any) => { return await request.get({ url: `/rq/iot-opeation-fill/planDevPage`, params }) }, // 获得设备关联责任人 分页 responsiblePage: async (params: any) => { return await request.get({ url: `/rq/iot-device/responsiblePage`, params }) }, // 获得设备动态 分页 deviceDynamicsPage: async (params: any) => { return await request.get({ url: `/rq/iot-device/deviceDynamicsPage`, params }) }, // 获得设备状态调整数据 分页 statusRelationDevices: async (params: any) => { return await request.get({ url: `/rq/iot-device/statusRelationDevices`, params }) }, // 获得设备调拨数据 分页 allotRelationDevices: async (params: any) => { return await request.get({ url: `/rq/iot-device/allotRelationDevices`, params }) }, // 获得设备关联责任人 分页 simpleDevices: async (params: any) => { return await request.get({ url: `/rq/iot-device/simple-list`, params }) }, // 查询 设备bom关联 列表分页 deviceAssociateBomPage: async (params: any) => { return await request.get({ url: `/rq/iot-device/deviceAssociateBomPage`, params }) }, // 项目-任务 根据选择的部门筛选设备 忽略数据权限 getDevicesByDepts: async (params: any) => { return await request.get({ url: `/rq/iot-device/getDevicesByDepts`, params }) }, // 查询 设备 bom关联 列表 deviceAssociateBomList: async (params: any) => { return await request.get({ url: `/rq/iot-device/deviceAssociateBomList`, params }) }, deviceAssociateBomListPage: async (params: any) => { return await request.get({ url: `/rq/iot-device/deviceAssociateBomListPage`, params }) }, // 查询设备台账详情 getIotDevice: async (id: number) => { return await request.get({ url: `/rq/iot-device/get?id=` + id }) }, getIotDeviceTds: async (id: number) => { return await request.get({ url: `/rq/iot-device/get/gateway/td?id=` + id }) }, getIotDeviceZHBDTds: async (id: number) => { return await request.get({ url: `/rq/iot-device/get/zhbd/td?id=` + id }) }, // 新增设备台账 createIotDevice: async (data: IotDeviceVO) => { return await request.post({ url: `/rq/iot-device/create`, data }) }, // 保存 设备-状态 的关联关系 saveDeviceStatuses: async (data: any) => { return await request.post({ url: `/rq/iot-device/saveDeviceStatuses`, data }) }, // 保存 设备调拨记录 saveDeviceAllot: async (data: any) => { return await request.post({ url: `/rq/iot-device/saveDeviceAllot`, data }) }, // 修改设备台账 updateIotDevice: async (data: IotDeviceVO) => { return await request.put({ url: `/rq/iot-device/update`, data }) }, // 删除设备台账 deleteIotDevice: async (id: number) => { return await request.delete({ url: `/rq/iot-device/delete?id=` + id }) }, // 导出设备台账 Excel exportIotDevice: async (params) => { return await request.download({ url: `/rq/iot-device/export-excel`, params }) }, getIotDeviceTdPage: async (params: any) => { return await request.get({ url: `/rq/iot-device/td/page`, params }) }, // 设备成套接口 // 查看详情时获取成套设备列表 getIotDeviceSets: async (params: any) => { return await request.get({ url: `/rq/iot-device-group-detail/page`, params }) }, // 新增时根据部门id获取设备列表 getIotDeviceSetOptions: async (id: any) => { return await request.get({ url: `/rq/iot-device/dept/${id}` }) }, // 获取成套列表 getIotDeviceSetList: async (params: any) => { return await request.get({ url: `/rq/iot-device-group/page`, params }) }, // 添加成套 createIotDeviceSet: async (data: any) => { return await request.post({ url: `/rq/iot-device-group/create`, data }) }, // 编辑成套 updateIotDeviceSet: async (data: any) => { return await request.put({ url: `/rq/iot-device-group/update`, data }) }, // 删除成套 deleteIotDeviceSet: async (id: number) => { return await request.delete({ url: `/rq/iot-device-group/delete?id=` + id }) }, // 获取关联设备 getIotDeviceSetRelation: async (params) => { return await request.get({ url: `/rq/iot-device-group/device/group`, params }) } }