From b1a0da9b1cf232537511c927a77eee5e2cff590a Mon Sep 17 00:00:00 2001 From: haohao <1036606149@qq.com> Date: Fri, 24 Oct 2025 22:33:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=80=90IoT=20=E7=89=A9=E8=81=94?= =?UTF-8?q?=E7=BD=91=E3=80=91=E4=BA=A7=E5=93=81=E8=AF=A6=E6=83=85=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=B7=AF=E7=94=B1=E5=8F=82=E6=95=B0=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E8=B7=B3=E8=BD=AC=E5=88=B0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=AE=A1=E7=90=86=E6=A0=B9=E6=8D=AE=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/device/device/index.vue | 9 ++++++++- .../iot/product/product/detail/ProductDetailsHeader.vue | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/iot/device/device/index.vue b/src/views/iot/device/device/index.vue index 42cc0438c..c9d9d826f 100644 --- a/src/views/iot/device/device/index.vue +++ b/src/views/iot/device/device/index.vue @@ -384,6 +384,7 @@ defineOptions({ name: 'IoTDevice' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 +const route = useRoute() // 路由对象 const loading = ref(true) // 列表加载中 const list = ref([]) // 列表的数据 @@ -392,7 +393,7 @@ const queryParams = reactive({ pageNo: 1, pageSize: 10, deviceName: undefined, - productId: undefined, + productId: undefined as number | undefined, deviceType: undefined, nickname: undefined, status: undefined, @@ -513,6 +514,12 @@ const handleImport = () => { /** 初始化 **/ onMounted(async () => { + // 处理路由参数中的 productId + const productId = route.query.productId + if (productId) { + queryParams.productId = Number(productId) + } + getList() // 获取产品列表 diff --git a/src/views/iot/product/product/detail/ProductDetailsHeader.vue b/src/views/iot/product/product/detail/ProductDetailsHeader.vue index 919006477..3eb999fa4 100644 --- a/src/views/iot/product/product/detail/ProductDetailsHeader.vue +++ b/src/views/iot/product/product/detail/ProductDetailsHeader.vue @@ -72,7 +72,7 @@ const copyToClipboard = async (text: string) => { /** 路由跳转到设备管理 */ const { push } = useRouter() const goToDeviceList = (productId: number) => { - push({ name: 'IoTDevice', params: { productId } }) + push({ name: 'IoTDevice', query: { productId } }) } /** 修改操作 */