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 5d3221b93a
4 changed files with 17 additions and 7 deletions

View File

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

View File

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

View File

@ -592,11 +592,21 @@ export default {
return '' return ''
}, },
handleExport() { handleExport() {
this.$refs.batchDownload.open({ const preferenceAttrList = [
preferenceAttrList: [
{ id: `ci_type_alias`, value: 'ci_type_alias', label: this.$t('cmdb.ciType.ciType') }, { id: `ci_type_alias`, value: 'ci_type_alias', label: this.$t('cmdb.ciType.ciType') },
...this.columnsGroup, ...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,
}) })
}, },
batchDownload({ filename, type, checkedKeys }) { batchDownload({ filename, type, checkedKeys }) {

View File

@ -808,7 +808,7 @@ export default {
}) })
}, },
async openBatchDownload() { 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 }) { batchDownload({ filename, type, checkedKeys }) {
console.log(filename, type) console.log(filename, type)