From 391ed4836554cb6c09da1464c4da4e6ce6207fd6 Mon Sep 17 00:00:00 2001 From: wangshuaiswim Date: Sat, 1 Apr 2023 15:13:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=A9=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=AF=BC=E5=85=A5=E5=90=8E=E8=B0=83=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/product.ts | 2 +- .../device/components/Metadata/Import/index.vue | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/store/product.ts b/src/store/product.ts index b3216727..7122c8cb 100644 --- a/src/store/product.ts +++ b/src/store/product.ts @@ -25,7 +25,7 @@ export const useProductStore = defineStore({ } }, async refresh(id: string) { - this.getDetail(id) + await this.getDetail(id) const res = await getDeviceNumber(encodeQuery({ terms: { productId: id } })) if (res.status === 200) { this.current.count = res.result diff --git a/src/views/device/components/Metadata/Import/index.vue b/src/views/device/components/Metadata/Import/index.vue index abdb4010..7bda1309 100644 --- a/src/views/device/components/Metadata/Import/index.vue +++ b/src/views/device/components/Metadata/Import/index.vue @@ -227,7 +227,7 @@ const handleImport = async () => { if (props?.type === 'device') { await instanceStore.refresh(id as string) } else { - await productStore.refresh(id as string) + await productStore.getDetail(id as string) } metadataStore.set('importMetadata', true) // Store.set(SystemConst.GET_METADATA, true) @@ -257,22 +257,12 @@ const handleImport = async () => { } loading.value = false if (resp.success) { - if (props?.type === 'device') { - // const detail = instanceStore.current - // detail.metadata = JSON.stringify(paramsDevice) - // instanceStore.setCurrent(detail) - message.success('导入成功') - } else { - // const detail = productStore.current - // detail.metadata = params.metadata - // productStore.setCurrent(detail) - message.success('导入成功') - } + message.success('导入成功') } if (props?.type === 'device') { await instanceStore.refresh(id as string) } else { - await productStore.refresh(id as string) + await productStore.getDetail(id as string) } metadataStore.set('importMetadata', true) // Store.set(SystemConst.GET_METADATA, true)