diff --git a/public/images/device/device-type-3.png b/public/images/device/device-type-3.png new file mode 100644 index 00000000..3561237e Binary files /dev/null and b/public/images/device/device-type-3.png differ diff --git a/src/api/device/category.ts b/src/api/device/category.ts index d18e3587..53c93ec4 100644 --- a/src/api/device/category.ts +++ b/src/api/device/category.ts @@ -16,7 +16,7 @@ export const queryTree = (params?: Record) => server.post server.put(`/device/category/${id}`, data) + export const updateTree = (id:string,data: any,) => server.put(`/device/category/${id}`, data) /** * 根据Id删除数据 diff --git a/src/api/device/product.ts b/src/api/device/product.ts index 6f318dcf..17100b3f 100644 --- a/src/api/device/product.ts +++ b/src/api/device/product.ts @@ -1,5 +1,5 @@ import server from '@/utils/request' -import { DeviceMetadata, ProductItem } from '@/views/device/Product/typings' +import { DeviceMetadata, ProductItem, DepartmentItem } from '@/views/device/Product/typings' /** * 根据条件查询产品(不带翻页) @@ -40,6 +40,73 @@ export const detail = (id: string) => server.get(`/device-product/$ /** * 产品分类 - * @param data + * @param data 查询条件 */ -export const category = (data: any) => server.post('/device/category/_tree', data) \ No newline at end of file +export const category = (data: any) => server.post('/device/category/_tree', data) + +/** + * 获取网关类型 + */ + export const getProviders = () => server.get('/gateway/device/providers') + + /** + * 查询所属部门 + * @param params 查询条件 + */ + export const queryOrgThree = (params?: Record) => server.post('/organization/_all/tree', params) + + /** + * 获取接入方式 + * @param data 查询条件 + */ + export const queryGatewayList = (data: any) => server.post('/gateway/device/_query/no-paging', data) + + /** + * 查询产品列表(分页) + * @param data 查询条件 + */ + export const queryProductList = (data: any) => server.post('/device-product/_query', data) + + /** + * 启用产品 + * @param productId 产品ID + * @param data + * @returns + */ +export const _deploy = (productId: string) => server.post(`/device-product/${productId}/deploy`) + +/** + * 禁用产品 + * @param productId 产品ID + * @param data + * @returns + */ +export const _undeploy = (productId: string) => server.post(`/device-product/${productId}/undeploy`) + +/** + * 新增产品 + * @param data + * @returns + */ +export const addProduct = (data:any) => server.post('/device-product',data) + +/** + * 修改产品 + * @param id 产品ID + * @param data + * @returns + */ +export const editProduct = (data: any) => server.patch('/device-product', data) + +/** + * 删除产品 + * @param id 产品ID + */ +export const deleteProduct = (id: string) => server.patch(`/device-product/${id}`) + +/** + * 检测产品Id唯一性 + * @param id 产品ID + */ + export const queryProductId = (id: string) => server.post(`/device-product/${id}/exists`) + \ No newline at end of file diff --git a/src/router/menu.ts b/src/router/menu.ts index 78683b84..fbc5fc7e 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -141,5 +141,10 @@ export default [ { path: '/iot/device/Category', component: () => import('@/views/device/Category/index.vue') - } + } , + // 产品 + { + path: '/iot/device/Product', + component: () => import('@/views/device/Product/index.vue') + } ] \ No newline at end of file diff --git a/src/views/device/Category/components/modifyModal/index.vue b/src/views/device/Category/components/modifyModal/index.vue index ea420fa9..371b7900 100644 --- a/src/views/device/Category/components/modifyModal/index.vue +++ b/src/views/device/Category/components/modifyModal/index.vue @@ -13,23 +13,24 @@ > - - + + - + @@ -37,6 +38,7 @@ v-model:value="formModel.description" show-count :maxlength="200" + placeholder="请输入说明" /> @@ -44,10 +46,12 @@ \ No newline at end of file +}; + diff --git a/src/views/device/Product/ChooseCard/index.vue b/src/views/device/Product/ChooseCard/index.vue new file mode 100644 index 00000000..a60c1753 --- /dev/null +++ b/src/views/device/Product/ChooseCard/index.vue @@ -0,0 +1,313 @@ + + + + + diff --git a/src/views/device/Product/Save/index.vue b/src/views/device/Product/Save/index.vue new file mode 100644 index 00000000..1c928ba6 --- /dev/null +++ b/src/views/device/Product/Save/index.vue @@ -0,0 +1,386 @@ + + + + + diff --git a/src/views/device/Product/index.vue b/src/views/device/Product/index.vue new file mode 100644 index 00000000..c5d6d505 --- /dev/null +++ b/src/views/device/Product/index.vue @@ -0,0 +1,498 @@ + + + + + diff --git a/src/views/device/Product/typings.d.ts b/src/views/device/Product/typings.d.ts index d7b9c831..3cdffb00 100644 --- a/src/views/device/Product/typings.d.ts +++ b/src/views/device/Product/typings.d.ts @@ -177,3 +177,15 @@ type ObserverMetadata = { subscribe: (data: any) => void; next: (data: any) => void; }; + +// 部门 +export type DepartmentItem = { + id: string; + name: string; + path: string; + sortIndex: number; + level: number; + code: string; + parentId: string; + children: DepartmentItem[]; +}; \ No newline at end of file diff --git a/src/views/init-home/index.vue b/src/views/init-home/index.vue index 20585ac9..896f2983 100644 --- a/src/views/init-home/index.vue +++ b/src/views/init-home/index.vue @@ -801,7 +801,7 @@ const rulesFrom = ref({ { required: true, message: '请输入系统名称', - trigger: 'blur', + trigger: 'change', }, ], headerTheme: [