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: {
...mapMutations('cmdbStore', ['SET_IS_TABLE_LOADING']),
open({ preferenceAttrList }) {
open({ preferenceAttrList, ciTypeName = undefined }) {
this.preferenceAttrList = preferenceAttrList
this.visible = true
this.$nextTick((res) => {
this.form.setFieldsValue({
filename: `cmdb-${moment().format('YYYYMMDDHHmmss')}`,
filename: ciTypeName
? `cmdb-${ciTypeName}-${moment().format('YYYYMMDDHHmmss')}`
: `cmdb-${moment().format('YYYYMMDDHHmmss')}`,
})
if (this.treeType === 'tree') {
const _check = ['ci_type_alias']

View File

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

View File

@ -576,7 +576,10 @@ export default {
},
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 }) {
const jsonAttrList = []

View File

@ -58,10 +58,10 @@
/>
<div class="relation-views-right-bar">
<a-space>
<a-button
v-if="isLeaf"
type="primary"
size="small"
<a-button
v-if="isLeaf"
type="primary"
size="small"
@click="$refs.create.handleOpen(true, 'create')"
>新建</a-button
>
@ -1322,7 +1322,10 @@ export default {
})
},
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 }) {
const jsonAttrList = []

View File

@ -18,10 +18,10 @@
属性说明
</span>
</span>
<a-button
size="small"
icon="plus"
type="primary"
<a-button
size="small"
icon="plus"
type="primary"
@click="$refs.create.handleOpen(true, 'create')"
>新建</a-button
>
@ -1054,7 +1054,10 @@ export default {
this.$refs.jsonEditor.open(column, row)
},
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 }) {
console.log(filename, type)