From f0bf740d7049364fbf100376ae2077dc1357b3db Mon Sep 17 00:00:00 2001
From: wang-liang0615 <53748875+wang-liang0615@users.noreply.github.com>
Date: Wed, 27 Dec 2023 13:24:01 +0800
Subject: [PATCH] fix(cmdb-ui):model relation table (#343)
---
.../modules/modelRelationTable.vue | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue b/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
index 05901e3..13d5f48 100644
--- a/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
+++ b/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
@@ -13,12 +13,7 @@
>
-
+
{{ row.relation_type.name }}
@@ -63,9 +58,8 @@ export default {
components: {
CMDBGrant,
},
- async created() {
- await this.getRelationTypes()
- await this.getMainData()
+ created() {
+ this.refresh()
},
computed: {
windowHeight() {
@@ -73,6 +67,10 @@ export default {
},
},
methods: {
+ async refresh() {
+ await this.getRelationTypes()
+ await this.getMainData()
+ },
async getMainData() {
const res = await getCITypeRelations()
res.forEach((item) => {
@@ -106,7 +104,7 @@ export default {
deleteRelation(row) {
deleteRelation(row.parent_id, row.child_id).then((res) => {
this.$message.success(`删除成功!`)
- this.getRelationTypes()
+ this.refresh()
})
},
},