浏览代码

Merge remote-tracking branch 'origin/master'

lipenghui 5 月之前
父节点
当前提交
b9ad2e6a02
共有 2 个文件被更改,包括 62 次插入11 次删除
  1. 50 0
      src/api/pms/devicetemplate/index.ts
  2. 12 11
      src/api/pms/model/index.ts

+ 50 - 0
src/api/pms/devicetemplate/index.ts

@@ -0,0 +1,50 @@
+import request from '@/config/axios'
+
+export interface DeviceAttrTemplateVO {
+  id?: number
+  name: string
+  deviceCategoryId: number
+  code: string
+  attrs: DeviceTemplateAttrs
+  description: string
+  status: number
+  sort: number
+  remark: string
+}
+
+/**
+ * 设备专有属性 类型
+ */
+export interface DeviceTemplateAttrs {
+  [key: string]: any
+}
+
+// 根据设备分类id查询设备专有属性模板
+export const getAttrTemplateByDeviceCategoryId = async (params: any): Promise<any> => {
+  return await request.get({ url: '/rq/iot-device-template/list-by-device-category-id', params })
+}
+
+// 查询物料组列表
+export const getMaterialGroupPage = async (params: PageParam) => {
+  return await request.get({ url: '/rq/iot-material-group/list', params })
+}
+
+// 查询物料组详情
+export const getMaterialGroup = async (id: number) => {
+  return await request.get({ url: '/rq/iot-material-group/get?id=' + id })
+}
+
+// 新增物料组
+export const createMaterialGroup = async (data: DeviceAttrTemplateVO) => {
+  return await request.post({ url: '/rq/iot-material-group/create', data: data })
+}
+
+// 修改物料组
+export const updateMaterialGroup = async (params: DeviceAttrTemplateVO) => {
+  return await request.put({ url: '/rq/iot-material-group/update', data: params })
+}
+
+// 删除物料组
+export const deleteMaterialGroup = async (id: number) => {
+  return await request.delete({ url: '/rq/iot-material-group/delete?id=' + id })
+}

+ 12 - 11
src/api/pms/model/index.ts

@@ -1,22 +1,23 @@
 import request from '@/config/axios'
 
-export interface MaterialGroupVO {
+export interface ModelVO {
   id?: number
   name: string
-  parentId: number
-  status: number
+  brand: string
+  standard: string
   sort: number
-  createTime: Date
+  status: number
+  remark: string
 }
 
-// 查询物料组(精简)列表
-export const getSimpleDeptList = async (): Promise<MaterialGroupVO[]> => {
+// 查询规格型号列表
+export const getModelList = async (): Promise<ModelVO[]> => {
   return await request.get({ url: '/system/dept/simple-list' })
 }
 
-// 查询部门列表
-export const getDeptPage = async (params: PageParam) => {
-  return await request.get({ url: '/system/dept/list', params })
+// 查询规格型号列表
+export const getModelPage = async (params: PageParam) => {
+  return await request.get({ url: '/rq/iot-model/page', params })
 }
 
 // 查询部门详情
@@ -25,12 +26,12 @@ export const getDept = async (id: number) => {
 }
 
 // 新增部门
-export const createDept = async (data: MaterialGroupVO) => {
+export const createDept = async (data: ModelVO) => {
   return await request.post({ url: '/system/dept/create', data: data })
 }
 
 // 修改部门
-export const updateDept = async (params: MaterialGroupVO) => {
+export const updateDept = async (params: ModelVO) => {
   return await request.put({ url: '/system/dept/update', data: params })
 }