| 
														
															@@ -4,12 +4,42 @@ var Excel = 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     open : function(data, filename, sheetname) {
 
														 | 
														
														 | 
														
															     open : function(data, filename, sheetname) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         this.name = sheetname || 'sheet1';
 
														 | 
														
														 | 
														
															         this.name = sheetname || 'sheet1';
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         this.sheet = XLSX.utils.aoa_to_sheet(data, {raw: true});
 
														 | 
														
														 | 
														
															         this.sheet = XLSX.utils.aoa_to_sheet(data, {raw: true});
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.autoWidthFunc(this.sheet, data);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (filename.substr(-5).toLowerCase() !== '.xlsx') {
 
														 | 
														
														 | 
														
															         if (filename.substr(-5).toLowerCase() !== '.xlsx') {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             filename += '.xlsx';
 
														 | 
														
														 | 
														
															             filename += '.xlsx';
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         }
 
														 | 
														
														 | 
														
															         }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         this.openDownloadDialog(this.sheet2blob(this.sheet, this.name), filename);
 
														 | 
														
														 | 
														
															         this.openDownloadDialog(this.sheet2blob(this.sheet, this.name), filename);
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     },
 
														 | 
														
														 | 
														
															     },
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
 
														 | 
														
														 | 
														
															 
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    autoWidthFunc : function (ws, data) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      // set worksheet max width per col
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      const colWidth = data.map(row =>
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        row.map(val => {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          var l = val.toString().length;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          var n = l + l*0.5;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          // if null/undefined
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          if (val == null) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return { wch: 10 };
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          } else if (val.toString().charCodeAt(0) > 255) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            // if chinese
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return { wch: n * 2 };
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          } else {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            return { wch: n };
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        })
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      );
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      // start in the first row
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      const result = colWidth[0];
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      for (let i = 1; i < colWidth.length; i++) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        for (let j = 0; j < colWidth[i].length; j++) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          if (result[j].wch < colWidth[i][j].wch) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            result[j].wch = colWidth[i][j].wch;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      }
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      ws['!cols'] = result;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    },
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     export : function (url, data) {
 
														 | 
														
														 | 
														
															     export : function (url, data) {
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     	var self = this;
 
														 | 
														
														 | 
														
															     	var self = this;
 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         var filename = '';
 
														 | 
														
														 | 
														
															         var filename = '';
 
														 |