fix selectExcel bug
This commit is contained in:
parent
77ff823037
commit
83e8dfc494
|
@ -66,6 +66,7 @@
|
||||||
this.multipleSelection = val;
|
this.multipleSelection = val;
|
||||||
},
|
},
|
||||||
handleDownload() {
|
handleDownload() {
|
||||||
|
if (this.multipleSelection.length) {
|
||||||
require.ensure([], () => {
|
require.ensure([], () => {
|
||||||
const { export_json_to_excel } = require('vendor/Export2Excel');
|
const { export_json_to_excel } = require('vendor/Export2Excel');
|
||||||
const tHeader = ['序号', '文章标题', '作者', '阅读数', '发布时间'];
|
const tHeader = ['序号', '文章标题', '作者', '阅读数', '发布时间'];
|
||||||
|
@ -75,6 +76,12 @@
|
||||||
export_json_to_excel(tHeader, data, '列表excel');
|
export_json_to_excel(tHeader, data, '列表excel');
|
||||||
this.$refs.multipleTable.clearSelection();
|
this.$refs.multipleTable.clearSelection();
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: '请选择一条或多条记录导出',
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
formatJson(filterVal, jsonData) {
|
formatJson(filterVal, jsonData) {
|
||||||
return jsonData.map(v => filterVal.map(j => v[j]))
|
return jsonData.map(v => filterVal.map(j => v[j]))
|
||||||
|
|
Loading…
Reference in New Issue