소스 검색

update xlsx文档改成xls

linweizeng 2 년 전
부모
커밋
258128b1e7
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/plugins/export/_export2Excel.js

+ 4 - 2
src/plugins/export/_export2Excel.js

@@ -141,7 +141,9 @@ export function export_json_to_excel(th, jsonData, defaultTitle, options = { mer
   wb.SheetNames.push(ws_name)
   wb.Sheets[ws_name] = ws
 
-  var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: false, type: 'binary' })
+//   var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: false, type: 'binary' })
+  var wbout = XLSX.write(wb, { bookType: 'xls', bookSST: false, type: 'binary' })
   var title = defaultTitle || '列表'
-  FileSaver.saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), title + '.xlsx')
+//   FileSaver.saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), title + '.xlsx')
+FileSaver.saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), title + '.xls')
 }