From 6135c4345371c66a934bae0a5337bcf5700e87fa Mon Sep 17 00:00:00 2001 From: yaojn Date: Thu, 24 Jul 2025 16:42:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=9B=A2=E4=BD=93=E7=BC=96=E8=BE=91=E8=A7=84?= =?UTF-8?q?=E5=88=99=E7=BB=84=E5=90=88=E9=80=89=E6=8B=A9=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=8E=AF=E5=A2=83=E6=97=B6=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E5=80=BC=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BA=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=20=20=20=20-=20[=E5=85=B3=E8=81=94]#[1472356575313920?= =?UTF-8?q?]=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86=E5=9B=A2=E4=BD=93?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=A7=84=E5=88=99=E7=BB=84=E5=90=88=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=85=A8=E5=B1=80=E5=B1=9E=E6=80=A7=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=97=B6=E5=AF=B9=E5=BA=94=E7=9A=84=E5=80=BC=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5=20http://192.168.0.96:8090?= =?UTF-8?q?/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1472?= =?UTF-8?q?356575313920?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/pages/cmdb/group/group-edit.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/views/pages/cmdb/group/group-edit.vue b/src/views/pages/cmdb/group/group-edit.vue index 7fc29415..106dc05d 100644 --- a/src/views/pages/cmdb/group/group-edit.vue +++ b/src/views/pages/cmdb/group/group-edit.vue @@ -361,12 +361,17 @@ export default { value: 'is-not-null' } ]; - if (!this.globalMap['global_' + attr.id]) { - this.$set(this.globalMap, 'global_' + attr.id, attr); - } }); return globalAttrList; }, + async getGlobalAttrItemByAttrId(attrId, attr) { + await this.$api.cmdb.ci.getGlobalAttrItemByAttrId({attrId: attrId}).then(res => { + const globalAttrList = res.Return || []; + if (!this.globalMap['global_' + attrId]) { + this.$set(this.globalMap, ['global_' + attrId], {...attr, itemList: globalAttrList}); + } + }); + }, async getAttrByCiId(ciId) { if (ciId) { let attrList; @@ -428,7 +433,7 @@ export default { const attrList = await this.getAttrByCiId(ciId); const relList = await this.getRelByCiId(ciId); const globalAttrList = await this.getGlobalAttrByCiId(ciId); - globalAttrList.forEach(attr => { + for (const attr of globalAttrList) { elementList.push({ typeText: this.$t('term.cmdb.globalattr'), type: 'global', @@ -437,7 +442,8 @@ export default { label: attr.label, expressionList: attr.expressionList }); - }); + await this.getGlobalAttrItemByAttrId(attr.id, attr); + } attrList.forEach(attr => { elementList.push({ typeText: this.$t('page.attribute'), -- Gitee From a7eefe29c00d99ad1ab5fa1b27f937c9cb87a83c Mon Sep 17 00:00:00 2001 From: yaojn Date: Thu, 24 Jul 2025 16:43:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=9B=A2=E4=BD=93=E7=BC=96=E8=BE=91=E8=A7=84?= =?UTF-8?q?=E5=88=99=E7=BB=84=E5=90=88=E9=80=89=E6=8B=A9=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=8E=AF=E5=A2=83=E6=97=B6=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E5=80=BC=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BA=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=20=20=20-=20[=E5=85=B3=E8=81=94]#[1472356575313920]?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86=E5=9B=A2=E4=BD=93=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E8=A7=84=E5=88=99=E7=BB=84=E5=90=88=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E5=B1=9E=E6=80=A7=E7=8E=AF=E5=A2=83=E6=97=B6?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84=E5=80=BC=E6=B2=A1=E6=9C=89=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=87=BA=E6=9D=A5=20http://192.168.0.96:8090/demo/rdm?= =?UTF-8?q?.html#/bug-detail/939050947543040/939050947543057/1472356575313?= =?UTF-8?q?920?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/pages/cmdb/group/group-edit.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/pages/cmdb/group/group-edit.vue b/src/views/pages/cmdb/group/group-edit.vue index 106dc05d..6444f68f 100644 --- a/src/views/pages/cmdb/group/group-edit.vue +++ b/src/views/pages/cmdb/group/group-edit.vue @@ -368,7 +368,7 @@ export default { await this.$api.cmdb.ci.getGlobalAttrItemByAttrId({attrId: attrId}).then(res => { const globalAttrList = res.Return || []; if (!this.globalMap['global_' + attrId]) { - this.$set(this.globalMap, ['global_' + attrId], {...attr, itemList: globalAttrList}); + this.$set(this.globalMap, ['global_' + attrId], {...(attr || {}), itemList: globalAttrList}); } }); }, -- Gitee