This commit is contained in:
liushuai
2018-12-17 20:37:10 +08:00
parent 916996c1ab
commit 05f44d8b7d
13 changed files with 1501 additions and 233 deletions

View File

@@ -20,7 +20,7 @@ export function Cleanup() {
}
const tableToExcel = (function() {
const uri = 'data:application/vnd.ms-excel;base64,'
const template = '<html><head><meta charset="UTF-8"></head><body><table border>{table}</table></body></html>'
const template = `<html xmlns:x="urn:schemas-microsoft-com:office:excel"><head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><meta charset="UTF-8"><style type="text/css">table td {border: 2px solid #000000;width:100px;text-align: center;color: #000000;}</style></head><body><table>{table}</table></body></html>`
const base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
const format = function(s, c) {
return s.replace(/{(\w+)}/g,