Introduce the new Vue admin project into version control while tightening gitignore patterns to keep env files, logs, build artifacts, and test outputs out of commits. Made-with: Cursor
31 lines
1.2 KiB
JavaScript
Executable File
31 lines
1.2 KiB
JavaScript
Executable File
// +----------------------------------------------------------------------
|
||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||
// +----------------------------------------------------------------------
|
||
// | Author: CRMEB Team <admin@crmeb.com>
|
||
// +----------------------------------------------------------------------
|
||
import { export_json_to_excel } from '../vendor/Export1Excel';
|
||
|
||
/**
|
||
* @method exportExcel
|
||
* @param {Array} header 表头
|
||
* @param {Array} filterVal 表头属性字段
|
||
* @param {String} filename 文件名称
|
||
* @param {Array} tableData 列表数据
|
||
**/
|
||
export default function exportExcel(header, filterVal, filename, tableData) {
|
||
var data = formatJson(filterVal, tableData);
|
||
export_json_to_excel(header, data, filename);
|
||
}
|
||
|
||
function formatJson(filterVal, tableData) {
|
||
return tableData.map((v) => {
|
||
return filterVal.map((j) => {
|
||
return v[j];
|
||
});
|
||
});
|
||
}
|