From 9da85995756042cf3e64854559d37e0768202331 Mon Sep 17 00:00:00 2001 From: xiongqian <2167232911@qq.com> Date: Mon, 30 Jan 2023 17:19:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/device/device-type-3.png | Bin 0 -> 1829 bytes src/api/device/category.ts | 2 +- src/api/device/product.ts | 73 ++- src/router/menu.ts | 7 +- .../Category/components/modifyModal/index.vue | 135 +++-- src/views/device/Category/index.vue | 46 +- src/views/device/Instance/index.vue | 464 ++++++++++------ src/views/device/Product/ChooseCard/index.vue | 313 +++++++++++ src/views/device/Product/Save/index.vue | 386 ++++++++++++++ src/views/device/Product/index.vue | 498 ++++++++++++++++++ src/views/device/Product/typings.d.ts | 12 + src/views/init-home/index.vue | 2 +- 12 files changed, 1701 insertions(+), 237 deletions(-) create mode 100644 public/images/device/device-type-3.png create mode 100644 src/views/device/Product/ChooseCard/index.vue create mode 100644 src/views/device/Product/Save/index.vue create mode 100644 src/views/device/Product/index.vue diff --git a/public/images/device/device-type-3.png b/public/images/device/device-type-3.png new file mode 100644 index 0000000000000000000000000000000000000000..3561237e70b88989cb0079de46a2a1befb57fc15 GIT binary patch literal 1829 zcmV+=2io|FP)>lXf00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP%hoiMphbX6EdD_V0Y_ zTl?(22~QEYd7o47<-v>AjpVsxB6Z#h50;O7|X0UIs?=A?#xSXPl+ z?EoDJ!~%rUxfd$L&ncxBs8C9okXNzSm@5(24Gjh+=+^mc`T8D#YO#wjOo zUsn#V`+nsPky~ig&H^dr41-l%tIDnSFLmB+<^G=uQuTqshyjI&oEc_+4K0KP(%Ktg z>F5TS{OymTb7%)-^cp8zH}|>$A13mq8UZ}t@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qmZdkvR2=mp+JHd@rUp1UL6^r@7-KSke+GOPJ@OT0WfoKpgArI+}IDGC6Ih$DN&gLebU|9j$6&u5+v9PBip3KV_Q?nml@wm^(hF$(-XB3djfzPV+@ zR-(Q0kxfI_He@>Kso)F~cd?=6g91Di$W9>V0%=8ZX!OTck03s`7#*MT@Rad?2##oO TVX3|?00000NkvXXu0mjfVDV!8 literal 0 HcmV?d00001 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: [