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(