From 703898e70728a0b236162daafecc028ca58e96e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 13 Jun 2022 11:37:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=A0=91=E5=8F=B3=E9=94=AE-=E6=98=BE=E7=A4=BA=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E8=AF=A6=E6=83=85=E5=BC=B9=E7=AA=97=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Asset/TreeMenu.vue | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/views/assets/Asset/TreeMenu.vue b/src/views/assets/Asset/TreeMenu.vue index b76e94b74..2ad96d81c 100644 --- a/src/views/assets/Asset/TreeMenu.vue +++ b/src/views/assets/Asset/TreeMenu.vue @@ -143,24 +143,21 @@ export default { } this.$emit('showAll', { node: currentNode, showCurrentAsset: 0 }) }, - rMenuShowNodeInfo() { - this.hideMenu() + async rMenuShowNodeInfo() { const currentNode = this.getSelectedNodes()[0] - if (!currentNode) { - return - } - this.$axios.get( - `/api/v1/assets/nodes/${currentNode.meta.data.id}/` - ).then(res => { + if (!currentNode) return + + try { + const res = await this.$axios.get(`/api/v1/assets/nodes/${currentNode.meta.data.id}/`) this.nodeInfoDialogSetting.dialogVisible = true this.nodeInfoDialogSetting.items = [ { key: 'id', label: 'ID', value: res.id }, { key: 'name', label: this.$t('assets.Name'), value: res.name }, { key: 'fullName', label: this.$t('assets.FullName'), value: res.full_value } ] - }).catch(error => { + } catch (error) { this.$message.error(this.$t('common.ErrorMsg' + ' ' + error)) - }) + } }, rCheckAssetsAmount() { this.$axios.post(