diff --git a/src/views/pages/cmdb/group/group-edit.vue b/src/views/pages/cmdb/group/group-edit.vue
index 7fc294152c49d644894e9354a42f64fff4e9feb4..fa5317e41a7531a534abe1841fe6e6606cb7eff4 100644
--- a/src/views/pages/cmdb/group/group-edit.vue
+++ b/src/views/pages/cmdb/group/group-edit.vue
@@ -79,8 +79,13 @@
{
+ 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 +438,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 +447,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'),
@@ -574,11 +585,6 @@ export default {
return this.ciMap['ci' + ciId];
};
},
- getGlobalAttrById() {
- return attrId => {
- return this.globalMap[attrId];
- };
- },
getAttrById() {
return attrId => {
return this.attrMap[attrId];
@@ -589,20 +595,6 @@ export default {
return this.relMap[relId];
};
},
- getGlobalSelectConfig() {
- return id => {
- const globalAttr = this.getGlobalAttrById(id);
- if (globalAttr) {
- return {
- border: 'border',
- multiple: true,
- dataList: globalAttr.itemList,
- textName: 'value',
- valueName: 'id'
- };
- }
- };
- },
getRelSelectConfig() {
return id => {
const rel = this.getRelById(id);