完成
Former-commit-id: fecd36e23769415d3e36d3f8cc032d987aea2d8a [formerly fecd36e23769415d3e36d3f8cc032d987aea2d8a [formerly fecd36e23769415d3e36d3f8cc032d987aea2d8a [formerly fecd36e23769415d3e36d3f8cc032d987aea2d8a [formerly 759d40ac36de68510e861e2d0ecce3482a70fd24 [formerly b3dec19cec2be3c8c57fba0c5ac597daacda1d76]]]]] Former-commit-id: 47d1371298c5eba1bd2b0529fea8f31bd7b0d8f4 Former-commit-id: 24887a2265f94dcd186c597beee9df65360f8d9f Former-commit-id: 8d2355929d7ea131309f9984f86e93208442b831 [formerly 04c2e63aa138e17f58f1a5d68788e621aef61bf6] Former-commit-id: dab965a72e93b7b7695d06ba2ce670418e0f1625 Former-commit-id: c13e304c52d597527ae9780760ab5835733ea9c5 Former-commit-id: bf2f63acd0a9e6a7b950d18752fc5db2f7bd7244 Former-commit-id: 4578fed754987fc9a30be468683294c1903845bf Former-commit-id: 0ce3bb9c6052a318d801b24c7744a488f0f3c5d6
This commit is contained in:
@@ -165,7 +165,17 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
currentTableData: [],
|
||||
multipleSelection: []
|
||||
multipleSelection: [],
|
||||
downloadColumns: [
|
||||
{ label: '卡密', prop: 'key' },
|
||||
{ label: '面值', prop: 'value' },
|
||||
{ label: '状态', prop: 'type' },
|
||||
{ label: '管理员', prop: 'admin' },
|
||||
{ label: '管理员备注', prop: 'adminNote' },
|
||||
{ label: '创建时间', prop: 'dateTimeCreat' },
|
||||
{ label: '使用状态', prop: 'used' },
|
||||
{ label: '使用时间', prop: 'dateTimeUse' }
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -188,25 +198,28 @@ export default {
|
||||
handleSelectionChange (val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
downloadDataTranslate (data) {
|
||||
return data.map(row => ({
|
||||
...row,
|
||||
type: row.type ? '禁用' : '正常',
|
||||
used: row.used ? '已使用' : '未使用'
|
||||
}))
|
||||
},
|
||||
handleDownloadXlsx (data) {
|
||||
const columns = [
|
||||
{ label: '卡密', prop: 'key' }
|
||||
]
|
||||
this.$export.excel({
|
||||
columns,
|
||||
data
|
||||
title: 'D2Admin 表格示例',
|
||||
columns: this.downloadColumns,
|
||||
data: this.downloadDataTranslate(data)
|
||||
})
|
||||
.then(() => {
|
||||
this.$message('导出表格成功')
|
||||
})
|
||||
},
|
||||
handleDownloadCsv (data) {
|
||||
const columns = [
|
||||
{ label: '卡密', prop: 'key' }
|
||||
]
|
||||
this.$export.csv({
|
||||
columns,
|
||||
data
|
||||
title: 'D2Admin 表格示例',
|
||||
columns: this.downloadColumns,
|
||||
data: this.downloadDataTranslate(data)
|
||||
})
|
||||
.then(() => {
|
||||
this.$message('导出CSV成功')
|
||||
|
||||
Reference in New Issue
Block a user