diff --git a/inventory-web/src/components/ImageSearchDialog.vue b/inventory-web/src/components/ImageSearchDialog.vue index 902f91e..22aae49 100644 --- a/inventory-web/src/components/ImageSearchDialog.vue +++ b/inventory-web/src/components/ImageSearchDialog.vue @@ -203,14 +203,13 @@ const handleUse = (item: ImageSearchItem) => { } const handleView = (item: ImageSearchItem) => { - // 从 business_data 获取跳转 URL - const url = item.business_data?.url - if (url) { - router.push(url) + const biz = item.business_data + if (biz?.spec_model) { + router.push({ path: '/material/index', query: { keyword: biz.spec_model } }) + } else if (biz?.url) { + router.push(biz.url) } else { - // 兜底:使用 product_name 作为 keyword 搜索 - ElMessage.info(`未找到详情页链接,已将 "${item.product_name}" 作为关键词搜索`) - emit('view', item) + ElMessage.warning('无法定位目标页面') } handleClose() }