index.ts 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. import request from '@/config/axios'
  2. // 设备台账 VO
  3. export interface IotDeviceVO {
  4. id: number // 主键id
  5. totalRunTime: number // 累计运行时长H
  6. totalMileage: number // 累计运行里程KM
  7. multiAttrsTotalMileage: Record<string, number> // 多属性累计运行里程KM
  8. multiAttrsTotalRuntime: Record<string, number> // 多属性累计运行时长H
  9. deviceCode: string // 资产编码
  10. deviceName: string // 设备名称
  11. brand: number // 品牌
  12. model: number // 规格型号
  13. deptId: number // 所在部门id
  14. deptName: string // 所在部门名称
  15. deviceStatus: string // 设备状态
  16. deviceStatusName: string // 设备状态名称
  17. assetProperty: string // 资产性质
  18. picUrl: string // 图片
  19. remark: string // 备注
  20. manufacturerId: number // 制造商id
  21. supplierId: number // 供应商id
  22. manDate: Date // 生产日期
  23. nameplate: string // 铭牌信息
  24. expires: number // 质保到期
  25. plPrice: number // 采购/租赁价格
  26. plDate: Date // 采购/租赁日期
  27. plYear: number // 折旧年限
  28. plStartDate: number // 折旧开始日期
  29. plMonthed: number // 已提折旧月数
  30. plAmounted: number // 已提折旧金额
  31. remainAmount: number // 剩余金额
  32. infoId: number // 资料分类id
  33. infoType: string // 资料类型
  34. infoName: string // 资料名称
  35. infoRemark: string // 资料备注
  36. infoUrl: string // 资料附件
  37. templateJson: string // 动态模板信息
  38. bomNodeId: number // bom节点id
  39. name: string // bom节点名称
  40. code: string // bom节点编码
  41. devicePersons: string // 设备责任人 逗号分隔
  42. location: string
  43. lat: number
  44. lng: number
  45. hasSetMaintenanceBom: boolean // 当前设备是否已经配置了保养BOM
  46. shouldWorkOrder: boolean // 当前设备根据保养规则应当生成保养工单
  47. runningWorkOrder: boolean // 当前设备是否已经有待执行的保养工单
  48. }
  49. // 设备台账 API
  50. export const IotDeviceApi = {
  51. saveMaxMin: async (data: any) => {
  52. return await request.post({ url: `rq/iot-alarm-setting/save`, data })
  53. },
  54. getToken: async () => {
  55. return await request.get({ url: `/rq/iot-device/yf/token` })
  56. },
  57. deleteMaxMin: async (params: any) => {
  58. return await request.delete({ url: `rq/iot-alarm-setting/delete`, params })
  59. },
  60. getCompany: async (params: any) => {
  61. return await request.get({ url: `/rq/iot-device/company?id=` + params })
  62. },
  63. getDevice: async (params: any) => {
  64. return await request.get({ url: `rq/iot-device/ly/device`, params })
  65. },
  66. getCompanyByDevice: async (params: any) => {
  67. return await request.get({ url: `/rq/iot-device/company/` + params })
  68. },
  69. getMaxCode: async (params: any) => {
  70. return await request.get({ url: `/rq/iot-device/max?yfCode=` + params })
  71. },
  72. getMapDevice: async (params: any) => {
  73. return await request.get({ url: `/rq/iot-device/map`, params })
  74. },
  75. getAllDeviceParams: async (params: any) => {
  76. return await request.get({ url: `/rq/iot-device/all/params`, params })
  77. },
  78. // 查询设备台账分页
  79. getIotDevicePage: async (params: any) => {
  80. return await request.get({ url: `/rq/iot-device/page`, params })
  81. },
  82. getPlanDevicePage: async (params: any) => {
  83. return await request.get({ url: `/rq/iot-opeation-fill/planDevPage`, params })
  84. },
  85. // 获得设备关联责任人 分页
  86. responsiblePage: async (params: any) => {
  87. return await request.get({ url: `/rq/iot-device/responsiblePage`, params })
  88. },
  89. // 获得设备动态 分页
  90. deviceDynamicsPage: async (params: any) => {
  91. return await request.get({ url: `/rq/iot-device/deviceDynamicsPage`, params })
  92. },
  93. // 获得设备状态调整数据 分页
  94. statusRelationDevices: async (params: any) => {
  95. return await request.get({ url: `/rq/iot-device/statusRelationDevices`, params })
  96. },
  97. // 获得设备调拨数据 分页
  98. allotRelationDevices: async (params: any) => {
  99. return await request.get({ url: `/rq/iot-device/allotRelationDevices`, params })
  100. },
  101. // 获得设备关联责任人 分页
  102. simpleDevices: async (params: any) => {
  103. return await request.get({ url: `/rq/iot-device/simple-list`, params })
  104. },
  105. // 查询 设备bom关联 列表分页
  106. deviceAssociateBomPage: async (params: any) => {
  107. return await request.get({ url: `/rq/iot-device/deviceAssociateBomPage`, params })
  108. },
  109. // 项目-任务 根据选择的部门筛选设备 忽略数据权限
  110. getDevicesByDepts: async (params: any) => {
  111. return await request.get({ url: `/rq/iot-device/getDevicesByDepts`, params })
  112. },
  113. // 查询 设备 bom关联 列表
  114. deviceAssociateBomList: async (params: any) => {
  115. return await request.get({ url: `/rq/iot-device/deviceAssociateBomList`, params })
  116. },
  117. deviceAssociateBomListPage: async (params: any) => {
  118. return await request.get({ url: `/rq/iot-device/deviceAssociateBomListPage`, params })
  119. },
  120. // 查询设备台账详情
  121. getIotDevice: async (id: number) => {
  122. return await request.get({ url: `/rq/iot-device/get?id=` + id })
  123. },
  124. getIotDeviceTds: async (id: number) => {
  125. return await request.get({ url: `/rq/iot-device/get/gateway/td?id=` + id })
  126. },
  127. getIotDeviceZHBDTds: async (id: number) => {
  128. return await request.get({ url: `/rq/iot-device/get/zhbd/td?id=` + id })
  129. },
  130. // 新增设备台账
  131. createIotDevice: async (data: IotDeviceVO) => {
  132. return await request.post({ url: `/rq/iot-device/create`, data })
  133. },
  134. createLyDevice: async (data: any) => {
  135. return await request.post({ url: `/rq/ly-device/create`, data })
  136. },
  137. // 保存 设备-状态 的关联关系
  138. saveDeviceStatuses: async (data: any) => {
  139. return await request.post({ url: `/rq/iot-device/saveDeviceStatuses`, data })
  140. },
  141. // 保存 设备调拨记录
  142. saveDeviceAllot: async (data: any) => {
  143. return await request.post({ url: `/rq/iot-device/saveDeviceAllot`, data })
  144. },
  145. // 修改设备台账
  146. updateIotDevice: async (data: IotDeviceVO) => {
  147. return await request.put({ url: `/rq/iot-device/update`, data })
  148. },
  149. // 删除设备台账
  150. deleteIotDevice: async (id: number) => {
  151. return await request.delete({ url: `/rq/iot-device/delete?id=` + id })
  152. },
  153. // 导出设备台账 Excel
  154. exportIotDevice: async (params) => {
  155. return await request.download({ url: `/rq/iot-device/export-excel`, params })
  156. },
  157. exportIotDeviceAdjust: async (params) => {
  158. return await request.download({ url: `/pms/iot-device-status-log/export-excel`, params })
  159. },
  160. exportIotDevicePerson: async (params) => {
  161. return await request.download({ url: `/pms/iot-device-person-log/export-excel`, params })
  162. },
  163. exportIotDeviceAllot: async (params) => {
  164. return await request.download({ url: `/pms/iot-device-allot-log/export-excel`, params })
  165. },
  166. exportIotDeviceMainAlarm: async (params) => {
  167. return await request.download({ url: `/pms/iot-main-work-order/exportMaintenances`, params })
  168. },
  169. getIotDeviceTdPage: async (params: any) => {
  170. return await request.get({ url: `/rq/iot-device/td/page`, params })
  171. },
  172. getIotDeviceOliConnectPage: async (params: any) => {
  173. return await request.get({ url: `/rq/iot-device/td/ly/page`, params })
  174. },
  175. getBoardDevice: async (params: any) => {
  176. return await request.get({ url: `/rq/iot-device/td/ly/screen`, params })
  177. },
  178. getMonitoringQuery: async (params: any) => {
  179. return await request.get({ url: `rq/stat/td/ly/chart`, params })
  180. },
  181. exportMonitoringQuery: async (params: any) => {
  182. return await request.download({ url: `rq/ly/export`, params })
  183. },
  184. // 新增时根据部门id获取设备列表
  185. getIotDeviceSetOptions: async (id: any) => {
  186. return await request.get({ url: `/rq/iot-device/dept/${id}` })
  187. },
  188. // 设备总数量
  189. getIotDeviceCount: async (params: any) => {
  190. return await request.get({ url: `/rq/report/device/count`, params })
  191. },
  192. // 设备状态
  193. getIotDeviceStatus: async (params: any) => {
  194. return await request.get({ url: `/rq/report/device/status`, params })
  195. },
  196. // 分类top
  197. getIotDeviceClassify: async (params: any) => {
  198. return await request.get({ url: `/rq/report/device/type`, params })
  199. },
  200. // 列表
  201. getIotDeviceList: async (params: any) => {
  202. return await request.get({ url: `/rq/report/device/page`, params })
  203. },
  204. // 查看详情时获取成套设备列表
  205. getIotDeviceSets: async (params: any) => {
  206. return await request.get({ url: `/rq/iot-device-group-detail/page`, params })
  207. },
  208. // 获取成套列表
  209. getIotDeviceSetList: async (params: any) => {
  210. return await request.get({ url: `/rq/iot-device-group/page`, params })
  211. },
  212. // 添加成套
  213. createIotDeviceSet: async (data: any) => {
  214. return await request.post({ url: `/rq/iot-device-group/create`, data })
  215. },
  216. // 编辑成套
  217. updateIotDeviceSet: async (data: any) => {
  218. return await request.put({ url: `/rq/iot-device-group/update`, data })
  219. },
  220. // 删除成套
  221. deleteIotDeviceSet: async (id: number) => {
  222. return await request.delete({ url: `/rq/iot-device-group/delete?id=` + id })
  223. },
  224. // 获取关联设备
  225. getIotDeviceSetRelation: async (params) => {
  226. return await request.get({ url: `/rq/iot-device-group/device/group`, params })
  227. },
  228. // 设备报表导出
  229. exportDeviceReport: async (params) => {
  230. return await request.download({ url: `/rq/report/export-excel`, params })
  231. },
  232. // 获取成套设备参数
  233. getDeviceSetParams: async (id) => {
  234. return await request.get({ url: `/rq/iot-device-group/td/${id}` })
  235. },
  236. // 获取所有设备品牌
  237. getDeviceBrand: async () => {
  238. return await request.get({ url: `/supplier/base/all` })
  239. }
  240. }