diff --git a/src/api/device/product.ts b/src/api/device/product.ts index 9d29476b..6b3c3ce1 100644 --- a/src/api/device/product.ts +++ b/src/api/device/product.ts @@ -115,3 +115,10 @@ export const deleteProduct = (id: string) => server.patch(`/device-product/${id} * @returns */ export const saveProductMetadata = (data: Record) => server.patch('/device-product', data) + +/** + * 获取设备数量 + * @param data 查询条件 + * @returns + */ +export const getDeviceNumber = (params:any) => server.get('/device-instance/_count', params) diff --git a/src/store/product.ts b/src/store/product.ts index 32ee205d..c534a3aa 100644 --- a/src/store/product.ts +++ b/src/store/product.ts @@ -1,14 +1,28 @@ import { ProductItem } from "@/views/device/Product/typings"; import { defineStore } from "pinia"; +import { detail} from '@/api/device/product' export const useProductStore = defineStore({ id: 'product', state: () => ({ - current: {} as ProductItem | undefined + current: {} as ProductItem | undefined, + detail: {} as ProductItem | undefined, + tabActiveKey: 'Info' }), actions: { setCurrent(current: ProductItem) { this.current = current - } + this.detail = current + }, + async refresh(id: string) { + const resp = await detail(id) + if(resp.status === 200){ + this.current = resp.result + this.detail = resp.result + } + }, + setTabActiveKey(key: string) { + this.tabActiveKey = key + }, } }) \ No newline at end of file diff --git a/src/views/device/Product/Detail/BasicInfo/indev.vue b/src/views/device/Product/Detail/BasicInfo/indev.vue new file mode 100644 index 00000000..84897c6a --- /dev/null +++ b/src/views/device/Product/Detail/BasicInfo/indev.vue @@ -0,0 +1,72 @@ + + + + diff --git a/src/views/device/Product/Detail/DeviceAccess/index.vue b/src/views/device/Product/Detail/DeviceAccess/index.vue new file mode 100644 index 00000000..6becece1 --- /dev/null +++ b/src/views/device/Product/Detail/DeviceAccess/index.vue @@ -0,0 +1,153 @@ + + + + diff --git a/src/views/device/Product/Detail/index.vue b/src/views/device/Product/Detail/index.vue new file mode 100644 index 00000000..e9af3555 --- /dev/null +++ b/src/views/device/Product/Detail/index.vue @@ -0,0 +1,179 @@ + + + + diff --git a/src/views/device/Product/DialogTips/index.vue b/src/views/device/Product/DialogTips/index.vue index 6c403056..e2f00d96 100644 --- a/src/views/device/Product/DialogTips/index.vue +++ b/src/views/device/Product/DialogTips/index.vue @@ -22,8 +22,8 @@
产品创建成功
-
产品ID: 12333
-
查看详情
+
产品ID: {{ idValue.value }}
+
查看详情
接下来推荐操作:
1、配置产品接入方式
@@ -47,8 +47,12 @@