用户增加导出、操作日志添加条件,导出、修复svg无法设置fill属性问题等

This commit is contained in:
吕金泽
2022-04-04 00:50:10 +08:00
parent 782484259d
commit f85efa67d0
18 changed files with 163 additions and 32 deletions
+9
View File
@@ -1,6 +1,7 @@
import request from '@/scripts/request'
import { ElMessageBox, ElNotification } from 'element-plus'
import global from '@/scripts/global'
import { utils, writeFile } from 'xlsx'
const common = {}
@@ -175,4 +176,12 @@ common.isComma = (value) => {
return value.toString().indexOf(',') !== -1
}
common.exportExcel = (options) => {
options.suffix = options.suffix || 'xlsx'
const workBook = utils.json_to_sheet(options.data);
const wb = utils.book_new()
utils.book_append_sheet(wb, workBook, 'sheet1');
writeFile(wb, `${options.fileName}.${options.suffix || 'xlsx'}`);
}
export default common