diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index 4d12477..00fca52 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -2,40 +2,75 @@
-
+
- - - + + + \ No newline at end of file diff --git a/src/utlis/Export2Excel.js b/src/utlis/Export2Excel.js index 861f545..0805734 100644 --- a/src/utlis/Export2Excel.js +++ b/src/utlis/Export2Excel.js @@ -192,4 +192,22 @@ export function exportToExcel(idSelector, fileName, isNew, list, titleNum = 1) { } } return wbout +} +export function exportJsonToExcel(th, jsonData, defaultTitle) { + + /* original data */ + var data = jsonData; + data.unshift(th); + var ws_name = "SheetJS"; + var wb = new Workbook() + var ws = sheet_from_array_of_arrays(data); + console.log(wb,ws) + + + /* add worksheet to workbook */ + wb.SheetNames.push(ws_name); + wb.Sheets[ws_name] = ws; + var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'}); + var title = defaultTitle || '列表' + saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), title + ".xlsx") } \ No newline at end of file