From 1eb2719ae966dbb0952471599892f12ba52726b6 Mon Sep 17 00:00:00 2001 From: linbangquan <1437892690@qq.com> Date: Mon, 18 Dec 2023 17:29:34 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE-=E5=90=8C=E5=90=8D=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=8E=BB=E9=87=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1049271686627328]视图设置-同名属性去重优化 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1049271686627328 --- .../typecomponent/attr-type.vue | 6 ++-- .../typecomponent/const-type.vue | 31 ++++++++++++++++++- .../typecomponent/globalattr-type.vue | 4 ++- .../resourceentity/typecomponent/rel-type.vue | 2 +- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/views/pages/cmdb/resourceentity/typecomponent/attr-type.vue b/src/views/pages/cmdb/resourceentity/typecomponent/attr-type.vue index fe1174aa..935ab46b 100644 --- a/src/views/pages/cmdb/resourceentity/typecomponent/attr-type.vue +++ b/src/views/pages/cmdb/resourceentity/typecomponent/attr-type.vue @@ -54,7 +54,7 @@ export default { validateList: ['required'] }, attrConfig: { - url: '/api/rest/cmdb/ci/listattr', + url: '/api/rest/cmdb/ci/listattr/forview', validateList: ['required'], valueName: 'name', textName: 'label', @@ -99,7 +99,9 @@ export default { }; }, beforeCreate() {}, - created() {}, + created() { + this.item.fromCi = this.mainCi; + }, beforeMount() {}, mounted() {}, beforeUpdate() {}, diff --git a/src/views/pages/cmdb/resourceentity/typecomponent/const-type.vue b/src/views/pages/cmdb/resourceentity/typecomponent/const-type.vue index e700014e..da693753 100644 --- a/src/views/pages/cmdb/resourceentity/typecomponent/const-type.vue +++ b/src/views/pages/cmdb/resourceentity/typecomponent/const-type.vue @@ -106,7 +106,36 @@ export default { }; }, beforeCreate() {}, - created() {}, + created() { + this.item.fromCi = this.mainCi; + if (this.item.field == 'id') { + this.item.fromAttr = '_id'; + } else if (this.item.field == 'name') { + this.item.fromAttr = '_name'; + } else if (this.item.field == 'type_id') { + this.item.fromAttr = '_typeId'; + } else if (this.item.field == 'type_name') { + this.item.fromAttr = '_typeName'; + } else if (this.item.field == 'type_label') { + this.item.fromAttr = '_typeLabel'; + } else if (this.item.field == 'fcu') { + this.item.fromAttr = '_fcu'; + } else if (this.item.field == 'fcd') { + this.item.fromAttr = '_fcd'; + } else if (this.item.field == 'lcu') { + this.item.fromAttr = '_lcu'; + } else if (this.item.field == 'lcd') { + this.item.fromAttr = '_lcd'; + } else if (this.item.field == 'inspect_status') { + this.item.fromAttr = '_inspectStatus'; + } else if (this.item.field == 'inspect_time') { + this.item.fromAttr = '_inspectTime'; + } else if (this.item.field == 'monitor_status') { + this.item.fromAttr = '_monitorStatus'; + } else if (this.item.field == 'monitor_time') { + this.item.fromAttr = '_monitorTime'; + } + }, beforeMount() {}, mounted() {}, beforeUpdate() {}, diff --git a/src/views/pages/cmdb/resourceentity/typecomponent/globalattr-type.vue b/src/views/pages/cmdb/resourceentity/typecomponent/globalattr-type.vue index 68867baf..2f24a3cc 100644 --- a/src/views/pages/cmdb/resourceentity/typecomponent/globalattr-type.vue +++ b/src/views/pages/cmdb/resourceentity/typecomponent/globalattr-type.vue @@ -80,7 +80,9 @@ export default { }; }, beforeCreate() {}, - created() {}, + created() { + this.item.fromCi = this.mainCi; + }, beforeMount() {}, mounted() {}, beforeUpdate() {}, diff --git a/src/views/pages/cmdb/resourceentity/typecomponent/rel-type.vue b/src/views/pages/cmdb/resourceentity/typecomponent/rel-type.vue index b7ff9fea..c66c4c0e 100644 --- a/src/views/pages/cmdb/resourceentity/typecomponent/rel-type.vue +++ b/src/views/pages/cmdb/resourceentity/typecomponent/rel-type.vue @@ -79,7 +79,7 @@ export default { } ], attrConfig: { - url: '/api/rest/cmdb/ci/listattr', + url: '/api/rest/cmdb/ci/listattr/forview', validateList: ['required'], valueName: 'name', textName: 'label', -- Gitee