From bdb42bb927261410af56c39a75a7821a3e2791ec Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 2 Oct 2025 11:25:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E3=80=90=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E4=BA=A7=E5=93=81=E8=B7=B3=E8=BD=AC=E5=88=B0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=88=97=E8=A1=A8=E6=97=B6=EF=BC=8CproductId=20?= =?UTF-8?q?=E6=9C=AA=E4=BC=A0=E9=80=92=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=20https://t.zsxq.com/jvXyq?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/device/device/index.vue | 10 ++++++++-- .../product/product/detail/ProductDetailsHeader.vue | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/iot/device/device/index.vue b/src/views/iot/device/device/index.vue index 56139be9a..67ef01cb7 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,7 +514,12 @@ const handleImport = () => { /** 初始化 **/ onMounted(async () => { - getList() + // 处理 productId 参数 + const { productId } = route.query + if (productId) { + queryParams.productId = Number(productId) + } + await getList() // 获取产品列表 products.value = await ProductApi.getSimpleProductList() 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 } }) } /** 修改操作 */