pref(cmdb-ui):download ci xlsx name

This commit is contained in:
wang-liang0615 2023-12-22 15:32:38 +08:00
parent 72b2f8b6de
commit 1651f7d6c1
5 changed files with 24 additions and 14 deletions

View File

@ -111,12 +111,14 @@ export default {
}, },
methods: { methods: {
...mapMutations('cmdbStore', ['SET_IS_TABLE_LOADING']), ...mapMutations('cmdbStore', ['SET_IS_TABLE_LOADING']),
open({ preferenceAttrList }) { open({ preferenceAttrList, ciTypeName = undefined }) {
this.preferenceAttrList = preferenceAttrList this.preferenceAttrList = preferenceAttrList
this.visible = true this.visible = true
this.$nextTick((res) => { this.$nextTick((res) => {
this.form.setFieldsValue({ this.form.setFieldsValue({
filename: `cmdb-${moment().format('YYYYMMDDHHmmss')}`, filename: ciTypeName
? `cmdb-${ciTypeName}-${moment().format('YYYYMMDDHHmmss')}`
: `cmdb-${moment().format('YYYYMMDDHHmmss')}`,
}) })
if (this.treeType === 'tree') { if (this.treeType === 'tree') {
const _check = ['ci_type_alias'] const _check = ['ci_type_alias']

View File

@ -106,7 +106,6 @@ export default {
this.uploadData = _uploadData.slice(1) this.uploadData = _uploadData.slice(1)
this.hasError = false this.hasError = false
this.isUploading = false this.isUploading = false
this.$refs.uploadResult.visible = false
}, },
handleUpload() { handleUpload() {
if (!this.ciType) { if (!this.ciType) {

View File

@ -576,7 +576,10 @@ export default {
}, },
async openBatchDownload() { async openBatchDownload() {
this.$refs.batchDownload.open({ preferenceAttrList: this.preferenceAttrList }) this.$refs.batchDownload.open({
preferenceAttrList: this.preferenceAttrList,
ciTypeName: this.$route.meta.title || this.$route.meta.name,
})
}, },
batchDownload({ filename, type, checkedKeys }) { batchDownload({ filename, type, checkedKeys }) {
const jsonAttrList = [] const jsonAttrList = []

View File

@ -1322,7 +1322,10 @@ export default {
}) })
}, },
async openBatchDownload() { async openBatchDownload() {
this.$refs.batchDownload.open({ preferenceAttrList: this.preferenceAttrList }) this.$refs.batchDownload.open({
preferenceAttrList: this.preferenceAttrList,
ciTypeName: this.$route.meta.title || this.$route.meta.name,
})
}, },
batchDownload({ filename, type, checkedKeys }) { batchDownload({ filename, type, checkedKeys }) {
const jsonAttrList = [] const jsonAttrList = []

View File

@ -1054,7 +1054,10 @@ export default {
this.$refs.jsonEditor.open(column, row) this.$refs.jsonEditor.open(column, row)
}, },
async openBatchDownload() { async openBatchDownload() {
this.$refs.batchDownload.open({ preferenceAttrList: this.currentAttrList }) this.$refs.batchDownload.open({
preferenceAttrList: this.currentAttrList,
ciTypeName: this.$route.meta.title || this.$route.meta.name,
})
}, },
batchDownload({ filename, type, checkedKeys }) { batchDownload({ filename, type, checkedKeys }) {
console.log(filename, type) console.log(filename, type)