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)