diff --git a/src/views/pages/cmdb/group/group-edit.vue b/src/views/pages/cmdb/group/group-edit.vue index 7fc294152c49d644894e9354a42f64fff4e9feb4..6444f68fbb1ba94bb4b5612161dab59220d48bbf 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'),