Merge pull request #604 from veops/dev_ui_240826

feat: export remove reference attr
This commit is contained in:
Leo Song 2024-08-26 22:22:43 +08:00 committed by GitHub
commit 834054e216
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 7 deletions

View File

@ -417,7 +417,7 @@ export default {
async openBatchDownload() {
this.$refs.batchDownload.open({
preferenceAttrList: this.preferenceAttrList,
preferenceAttrList: this.preferenceAttrList.filter((attr) => !attr?.is_reference),
ciTypeName: this.$route.meta.title || this.$route.meta.name,
})
},

View File

@ -1259,7 +1259,7 @@ export default {
},
async openBatchDownload() {
this.$refs.batchDownload.open({
preferenceAttrList: this.preferenceAttrList,
preferenceAttrList: this.preferenceAttrList.filter((attr) => !attr?.is_reference),
ciTypeName: this.$route.meta.name,
})
},

View File

@ -592,11 +592,21 @@ export default {
return ''
},
handleExport() {
const preferenceAttrList = [
{ id: `ci_type_alias`, value: 'ci_type_alias', label: this.$t('cmdb.ciType.ciType') },
...this.columnsGroup,
]
preferenceAttrList.forEach((attr) => {
if (Array.isArray(attr?.children) && attr?.children?.length) {
attr.children = attr.filter((child) => {
return !child?.is_reference
})
}
})
this.$refs.batchDownload.open({
preferenceAttrList: [
{ id: `ci_type_alias`, value: 'ci_type_alias', label: this.$t('cmdb.ciType.ciType') },
...this.columnsGroup,
],
preferenceAttrList,
})
},
batchDownload({ filename, type, checkedKeys }) {

View File

@ -808,7 +808,7 @@ export default {
})
},
async openBatchDownload() {
this.$refs.batchDownload.open({ preferenceAttrList: this.currentAttrList, ciTypeName: this.currentCiTypeName })
this.$refs.batchDownload.open({ preferenceAttrList: this.currentAttrList.filter((attr) => !attr?.is_reference), ciTypeName: this.currentCiTypeName })
},
batchDownload({ filename, type, checkedKeys }) {
console.log(filename, type)