MS-CIAZDCOIXVRW\Administrator пре 3 година
родитељ
комит
8444784b6c
6 измењених фајлова са 25831 додато и 34 уклоњено
  1. 25 15
      public/index.html
  2. 188 0
      public/js/FileSaver.js
  3. 17 0
      public/js/xlsx.core.min.js
  4. 24184 0
      public/js/xlsxStyle.core.min.js
  5. 939 0
      public/js/xlsxStyle.utils.js
  6. 478 19
      src/components/Home/index.vue

+ 25 - 15
public/index.html

@@ -1,17 +1,27 @@
 <!DOCTYPE html>
 <html lang="">
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= htmlWebpackPlugin.options.title %></title>
-  </head>
-  <body>
-    <noscript>
-      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
-</html>
+
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width,initial-scale=1.0">
+  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+  <title>
+    <%= htmlWebpackPlugin.options.title %>
+  </title>
+</head>
+<script src="./js/FileSaver.js"></script>
+<script src="./js/xlsx.core.min.js"></script>
+<script src="./js/xlsxStyle.core.min.js"></script>
+<script src="./js/xlsxStyle.utils.js"></script>
+
+<body>
+  <noscript>
+    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
+        Please enable it to continue.</strong>
+  </noscript>
+  <div id="app"></div>
+  <!-- built files will be auto injected -->
+</body>
+
+</html>

+ 188 - 0
public/js/FileSaver.js

@@ -0,0 +1,188 @@
+/* FileSaver.js
+ * A saveAs() FileSaver implementation.
+ * 1.3.2
+ * 2016-06-16 18:25:19
+ *
+ * By Eli Grey, http://eligrey.com
+ * License: MIT
+ *   See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
+ */
+
+/*global self */
+/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
+
+/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
+
+var saveAs = saveAs || (function(view) {
+	"use strict";
+	// IE <10 is explicitly unsupported
+	if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
+		return;
+	}
+	var
+		  doc = view.document
+		  // only get URL when necessary in case Blob.js hasn't overridden it yet
+		, get_URL = function() {
+			return view.URL || view.webkitURL || view;
+		}
+		, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
+		, can_use_save_link = "download" in save_link
+		, click = function(node) {
+			var event = new MouseEvent("click");
+			node.dispatchEvent(event);
+		}
+		, is_safari = /constructor/i.test(view.HTMLElement) || view.safari
+		, is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent)
+		, throw_outside = function(ex) {
+			(view.setImmediate || view.setTimeout)(function() {
+				throw ex;
+			}, 0);
+		}
+		, force_saveable_type = "application/octet-stream"
+		// the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to
+		, arbitrary_revoke_timeout = 1000 * 40 // in ms
+		, revoke = function(file) {
+			var revoker = function() {
+				if (typeof file === "string") { // file is an object URL
+					get_URL().revokeObjectURL(file);
+				} else { // file is a File
+					file.remove();
+				}
+			};
+			setTimeout(revoker, arbitrary_revoke_timeout);
+		}
+		, dispatch = function(filesaver, event_types, event) {
+			event_types = [].concat(event_types);
+			var i = event_types.length;
+			while (i--) {
+				var listener = filesaver["on" + event_types[i]];
+				if (typeof listener === "function") {
+					try {
+						listener.call(filesaver, event || filesaver);
+					} catch (ex) {
+						throw_outside(ex);
+					}
+				}
+			}
+		}
+		, auto_bom = function(blob) {
+			// prepend BOM for UTF-8 XML and text/* types (including HTML)
+			// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
+			if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
+				return new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});
+			}
+			return blob;
+		}
+		, FileSaver = function(blob, name, no_auto_bom) {
+			if (!no_auto_bom) {
+				blob = auto_bom(blob);
+			}
+			// First try a.download, then web filesystem, then object URLs
+			var
+				  filesaver = this
+				, type = blob.type
+				, force = type === force_saveable_type
+				, object_url
+				, dispatch_all = function() {
+					dispatch(filesaver, "writestart progress write writeend".split(" "));
+				}
+				// on any filesys errors revert to saving with object URLs
+				, fs_error = function() {
+					if ((is_chrome_ios || (force && is_safari)) && view.FileReader) {
+						// Safari doesn't allow downloading of blob urls
+						var reader = new FileReader();
+						reader.onloadend = function() {
+							var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
+							var popup = view.open(url, '_blank');
+							if(!popup) view.location.href = url;
+							url=undefined; // release reference before dispatching
+							filesaver.readyState = filesaver.DONE;
+							dispatch_all();
+						};
+						reader.readAsDataURL(blob);
+						filesaver.readyState = filesaver.INIT;
+						return;
+					}
+					// don't create more object URLs than needed
+					if (!object_url) {
+						object_url = get_URL().createObjectURL(blob);
+					}
+					if (force) {
+						view.location.href = object_url;
+					} else {
+						var opened = view.open(object_url, "_blank");
+						if (!opened) {
+							// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html
+							view.location.href = object_url;
+						}
+					}
+					filesaver.readyState = filesaver.DONE;
+					dispatch_all();
+					revoke(object_url);
+				}
+			;
+			filesaver.readyState = filesaver.INIT;
+
+			if (can_use_save_link) {
+				object_url = get_URL().createObjectURL(blob);
+				setTimeout(function() {
+					save_link.href = object_url;
+					save_link.download = name;
+					click(save_link);
+					dispatch_all();
+					revoke(object_url);
+					filesaver.readyState = filesaver.DONE;
+				});
+				return;
+			}
+
+			fs_error();
+		}
+		, FS_proto = FileSaver.prototype
+		, saveAs = function(blob, name, no_auto_bom) {
+			return new FileSaver(blob, name || blob.name || "download", no_auto_bom);
+		}
+	;
+	// IE 10+ (native saveAs)
+	if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
+		return function(blob, name, no_auto_bom) {
+			name = name || blob.name || "download";
+
+			if (!no_auto_bom) {
+				blob = auto_bom(blob);
+			}
+			return navigator.msSaveOrOpenBlob(blob, name);
+		};
+	}
+
+	FS_proto.abort = function(){};
+	FS_proto.readyState = FS_proto.INIT = 0;
+	FS_proto.WRITING = 1;
+	FS_proto.DONE = 2;
+
+	FS_proto.error =
+	FS_proto.onwritestart =
+	FS_proto.onprogress =
+	FS_proto.onwrite =
+	FS_proto.onabort =
+	FS_proto.onerror =
+	FS_proto.onwriteend =
+		null;
+
+	return saveAs;
+}(
+	   typeof self !== "undefined" && self
+	|| typeof window !== "undefined" && window
+	|| this.content
+));
+// `self` is undefined in Firefox for Android content script context
+// while `this` is nsIContentFrameMessageManager
+// with an attribute `content` that corresponds to the window
+
+if (typeof module !== "undefined" && module.exports) {
+  module.exports.saveAs = saveAs;
+} else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) {
+  define("FileSaver.js", function() {
+    return saveAs;
+  });
+}

Разлика између датотеке није приказан због своје велике величине
+ 17 - 0
public/js/xlsx.core.min.js


Разлика између датотеке није приказан због своје велике величине
+ 24184 - 0
public/js/xlsxStyle.core.min.js


+ 939 - 0
public/js/xlsxStyle.utils.js

@@ -0,0 +1,939 @@
+/*
+@author Ctrl
+@version 20190917
+@aim 对xlsx-style方法进行二次封装 方便调用以导出带样式Excel
+@usage XSU.xxxFunction()
+*/
+
+
+var XSU;
+
+XSU=({
+
+	//字符串转字符流
+	s2ab: function(s) {
+		var buf = new ArrayBuffer(s.length);
+		var view = new Uint8Array(buf);
+		for (var i = 0; i != s.length; ++i)
+			view[i] = s.charCodeAt(i) & 0xFF;
+		return buf;
+	},
+
+	//初始化
+	init: function(workBook, sheetName, cell) {
+		if (!workBook.Sheets[sheetName][cell].s) {
+			workBook.Sheets[sheetName][cell].s = {};
+		}
+	},
+
+	init1: function(workBook, sheetName, cell, attr) {
+		this.init(workBook, sheetName, cell);
+		if (!workBook.Sheets[sheetName][cell].s[attr]) {
+			workBook.Sheets[sheetName][cell].s[attr] = {};
+		}
+	},
+
+	init2: function(workBook, sheetName, cell, attr1, attr2) {
+		this.init(workBook, sheetName, cell);
+		this.init1(workBook, sheetName, cell, attr1);
+		if (!workBook.Sheets[sheetName][cell].s[attr1][attr2]) {
+			workBook.Sheets[sheetName][cell].s[attr1][attr2] = {};
+		}
+	},
+
+	//根据ref的单元格范围新建范围内所有单元格,不存在的单元格置为空值,已存在的不处理
+	initAllCell: function(workBook, sheetName) {
+		var ref = workBook.Sheets[sheetName]["!ref"].split(":");
+		var startCell = ref[0];
+		var endCell = ref[1];
+		var sc = XLSX.utils.decode_cell(startCell).c;
+		var sr = XLSX.utils.decode_cell(startCell).r;
+		var ec = XLSX.utils.decode_cell(endCell).c;
+		var er = XLSX.utils.decode_cell(endCell).r;
+		var isExist;
+		for (c = sc; c <= ec; c++) { //初始化所有单元格
+			for (r = sr; r <= er; r++) {
+				var temp = XLSX.utils.encode_cell({
+					c: c,
+					r: r
+				});
+				isExist = false;
+				for (cell in workBook.Sheets[sheetName]) {
+					if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+						if (temp == cell) {
+							isExist = true;
+							break;
+						}
+					}
+				}
+				if (!isExist) { //单元格不存在则新建单元格
+					XLSX.utils.sheet_add_aoa(workBook.Sheets[sheetName], [
+						['']
+					], {
+						origin: temp
+					});
+				}
+
+			}
+		}
+	},
+
+	//单元格合并 startCell=A1 endCell=B5
+	mergeCells: function(workBook, sheetName, startCell, endCell) {
+		/*var sc = startCell.substr(0, 1).charCodeAt(0) - 65;
+		var sr = startCell.substr(1);
+		sr = parseInt(sr) - 1;
+		var ec = endCell.substr(0, 1).charCodeAt(0) - 65;
+		var er = endCell.substr(1)
+		er = parseInt(er) - 1;*/
+
+		var sc = XLSX.utils.decode_cell(startCell).c;
+		var sr = XLSX.utils.decode_cell(startCell).r;
+		var ec = XLSX.utils.decode_cell(endCell).c;
+		var er = XLSX.utils.decode_cell(endCell).r;
+
+		var merges = [{
+			s: { //s start 始单元格
+				c: sc, //cols 开始列
+				r: sr //rows 开始行
+			},
+			e: { //e end  末单元格
+				c: ec, //cols 结束列
+				r: er //rows 结束行
+			}
+		}];
+		if (!workBook.Sheets[sheetName]["!merges"]) {
+			workBook.Sheets[sheetName]["!merges"] = merges;
+		} else {
+			workBook.Sheets[sheetName]["!merges"] = workBook.Sheets[sheetName]["!merges"].concat(merges);
+		}
+
+		return workBook;
+
+	},
+
+	//merges=[{s: {c: 0, r: 0},e: {c: 3, r: 0}}]
+	mergeCellsByObj: function(workBook, sheetName, merges) {
+		if (workBook.Sheets[sheetName]["!merges"]) {
+			workBook.Sheets[sheetName]["!merges"] = workBook.Sheets[sheetName]["!merges"].concat(merges);
+		} else {
+			workBook.Sheets[sheetName]["!merges"] = merges;
+		}
+
+		return workBook;
+
+	},
+
+
+	//设置每列列宽,单位px cols= [{wpx: 45}, {wpx: 165}, {wpx: 45}, {wpx: 45}]
+	setColWidth: function(workBook, sheetName, cols) {
+		workBook.Sheets[sheetName]["!cols"] = cols;
+		return workBook;
+	},
+
+	//一次性设置多样式 styles etc: 
+	/*
+	{
+	  "font": {
+	    "sz": 14,
+	    "bold": true,
+	    "color": {
+	      "rgb": "FFFFAA00"
+	    }
+	  },
+	  "fill": {
+	    "bgColor": {
+	      "indexed": 64
+	    },
+	    "fgColor": {
+	      "rgb": "FFFFFF00"
+	    }
+	  }
+	}
+	*/
+	setCellStyle: function(workBook, sheetName, cell, styles) {
+		workBook.Sheets[sheetName][cell].s = styles;
+		return workBook;
+	},
+
+	/*Fill*/
+
+	//填充颜色 fill={"bgColor": {"indexed": 64},"fgColor": {"rgb": "FFFFFF00"}}
+	setFillStyles: function(workBook, sheetName, cell, styles) {
+		this.init(workBook, sheetName, cell);
+		workBook.Sheets[sheetName][cell].s.fill = styles;
+		return workBook;
+	},
+
+	setFillStylesAll: function(workBook, sheetName, styles) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFillStyles(workBook, sheetName, cell, styles);
+			}
+		}
+	},
+
+	//patternType="solid" or "none"”
+	setFillPatternType: function(workBook, sheetName, cell, patternType) {
+		this.init1(workBook, sheetName, cell, "fill");
+		workBook.Sheets[sheetName][cell].s.fill.patternType = patternType;
+		return workBook;
+	},
+
+	setFillPatternTypeAll: function(workBook, sheetName, patternType) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFillPatternType(workBook, sheetName, cell, patternType);
+			}
+		}
+	},
+
+	//前景颜色(单元格颜色) rgb 
+	//COLOR_SPEC属性值:{ auto: 1}指定自动值,{ rgb: "FFFFAA00" }指定16进制的ARGB,{ theme: "1", tint: "-0.25"}指定主题颜色和色调的整数索引(默认值为0),{ indexed: 64} 默认值 fill.bgColor
+	setFillFgColor: function(workBook, sheetName, cell, COLOR_SPEC) {
+		this.init1(workBook, sheetName, cell, "fill");
+		workBook.Sheets[sheetName][cell].s.fill.fgColor = COLOR_SPEC;
+		return workBook;
+	},
+
+	setFillFgColorAll: function(workBook, sheetName, COLOR_SPEC) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFillFgColor(workBook, sheetName, cell, COLOR_SPEC);
+			}
+		}
+	},
+
+	//使用RGB值设置颜色
+	setFillFgColorRGB: function(workBook, sheetName, cell, rgb) {
+		this.init2(workBook, sheetName, cell, "fill", "fgColor");
+		workBook.Sheets[sheetName][cell].s.fill.fgColor.rgb = rgb;
+		return workBook;
+	},
+
+	setFillFgColorRGBAll: function(workBook, sheetName, rgb) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFillFgColorRGB(workBook, sheetName, cell, rgb);
+			}
+		}
+	},
+
+	//单元格背景颜色(貌似没用)
+	setFillBgColor: function(workBook, sheetName, cell, COLOR_SPEC) {
+		this.init1(workBook, sheetName, cell, "fill");
+		workBook.Sheets[sheetName][cell].s.fill.bgColor = COLOR_SPEC;
+		return workBook;
+	},
+
+	setFillBgColorAll: function(workBook, sheetName, COLOR_SPEC) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFillBgColor(workBook, sheetName, cell, COLOR_SPEC);
+			}
+		}
+	},
+
+	//单元格背景颜色
+	setFillBgColorRGB: function(workBook, sheetName, cell, rgb) {
+		this.init2(workBook, sheetName, cell, "fill", "bgColor");
+		workBook.Sheets[sheetName][cell].s.fill.bgColor.rgb = rgb;
+		return workBook;
+	},
+
+	setFillBgColorRGBAll: function(workBook, sheetName, rgb) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFillBgColorRGB(workBook, sheetName, cell, rgb);
+			}
+		}
+	},
+
+	/*Font*/
+
+	//字体风格,可一次性在styles中设置所有font风格
+	setFontStyles: function(workBook, sheetName, cell, styles) {
+		this.init(workBook, sheetName, cell);
+		workBook.Sheets[sheetName][cell].s.font = styles;
+		return workBook;
+	},
+
+	setFontStylesAll: function(workBook, sheetName, styles) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontStyles(workBook, sheetName, cell, styles);
+			}
+		}
+	},
+
+	//字体 type="Calibri" 
+	setFontType: function(workBook, sheetName, cell, type) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.name = type;
+		return workBook;
+	},
+
+	setFontTypeAll: function(workBook, sheetName, type) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontType(workBook, sheetName, cell, type);
+			}
+		}
+	},
+
+	//字体大小
+	setFontSize: function(workBook, sheetName, cell, size) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.sz = size;
+		return workBook;
+	},
+
+	setFontSizeAll: function(workBook, sheetName, size) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontSize(workBook, sheetName, cell, size);
+			}
+		}
+	},
+
+	//字体颜色 COLOR_SPEC
+	setFontColor: function(workBook, sheetName, cell, COLOR_SPEC) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.color = COLOR_SPEC;
+		//workBook.Sheets[sheetName][cell].s.font.color.rgb = rgb;
+		return workBook;
+	},
+
+	setFontColorAll: function(workBook, sheetName, COLOR_SPEC) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontColor(workBook, sheetName, cell, COLOR_SPEC);
+			}
+		}
+	},
+
+	//字体颜色RGB
+	setFontColorRGB: function(workBook, sheetName, cell, rgb) {
+		this.init2(workBook, sheetName, cell, "font", "color");
+		workBook.Sheets[sheetName][cell].s.font.color.rgb = rgb;
+		return workBook;
+	},
+
+	setFontColorRGBAll: function(workBook, sheetName, rgb) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontColorRGB(workBook, sheetName, cell, rgb);
+			}
+		}
+	},
+
+	//是否粗体 boolean isBold
+	setFontBold: function(workBook, sheetName, cell, isBold) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.bold = isBold;
+		return workBook;
+	},
+
+	setFontBoldAll: function(workBook, sheetName, isBold) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontBold(workBook, sheetName, cell, isBold);
+			}
+		}
+	},
+
+	//设置某列为粗体
+	setFontBoldOfCols: function(workBook, sheetName, isBold, col) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				if (cell.substr(0, 1) == col) {
+					this.setFontBold(workBook, sheetName, cell, isBold);
+				}
+			}
+		}
+	},
+
+	//设置某行为粗体
+	setFontBoldOfRows: function(workBook, sheetName, isBold, row) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				if (cell.substr(1) == row) {
+					this.setFontBold(workBook, sheetName, cell, isBold);
+				}
+			}
+		}
+	},
+
+	//是否下划线 boolean isUnderline
+	setFontUnderline: function(workBook, sheetName, cell, isUnderline) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.underline = isUnderline;
+		return workBook;
+	},
+
+	setFontUnderlineAll: function(workBook, sheetName, isUnderline) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontUnderline(workBook, sheetName, cell, isUnderline);
+			}
+		}
+	},
+
+	//是否斜体 boolean isItalic
+	setFontItalic: function(workBook, sheetName, cell, isItalic) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.italic = isItalic;
+		return workBook;
+	},
+
+	setFontItalicAll: function(workBook, sheetName, isItalic) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontItalic(workBook, sheetName, cell, isItalic);
+			}
+		}
+	},
+
+	//是否删除线 boolean isStrike
+	setFontStrike: function(workBook, sheetName, cell, isStrike) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.strike = isStrike;
+		return workBook;
+	},
+
+	setFontStrikeAll: function(workBook, sheetName, isStrike) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontStrike(workBook, sheetName, cell, isStrike);
+			}
+		}
+	},
+
+	//是否outline boolean isOutline
+	setFontOutline: function(workBook, sheetName, cell, isOutline) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.outline = isOutline;
+		return workBook;
+	},
+
+	setFontOutlineAll: function(workBook, sheetName, isOutline) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontOutline(workBook, sheetName, cell, isOutline);
+			}
+		}
+	},
+
+	//是否阴影 boolean isShadow
+	setFontShadow: function(workBook, sheetName, cell, isShadow) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.shadow = isShadow;
+		return workBook;
+	},
+
+	setFontShadowAll: function(workBook, sheetName, isShadow) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontShadow(workBook, sheetName, cell, isShadow);
+			}
+		}
+	},
+
+	//是否vertAlign boolean isVertAlign
+	setFontVertAlign: function(workBook, sheetName, cell, isVertAlign) {
+		this.init1(workBook, sheetName, cell, "font");
+		workBook.Sheets[sheetName][cell].s.font.vertAlign = isVertAlign;
+		return workBook;
+	},
+
+	setFontVertAlignAll: function(workBook, sheetName, isVertAlign) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontVertAlign(workBook, sheetName, cell, isVertAlign);
+			}
+		}
+	},
+
+	/*numFmt*/
+
+	setNumFmt: function(workBook, sheetName, cell, numFmt) {
+		this.init(workBook, sheetName, cell);
+		workBook.Sheets[sheetName][cell].s.numFmt = numFmt;
+		return workBook;
+	},
+
+	setNumFmtAll: function(workBook, sheetName, numFmt) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setNumFmt(workBook, sheetName, cell, numFmt);
+			}
+		}
+	},
+
+	/*Alignment*/
+
+	//文本对齐 alignment={vertical:top,horizontal:top,}
+	setAlignmentStyles: function(workBook, sheetName, cell, styles) {
+		this.init(workBook, sheetName, cell);
+		workBook.Sheets[sheetName][cell].s.alignment = styles;
+		return workBook;
+	},
+
+	setAlignmentStylesAll: function(workBook, sheetName, styles) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setAlignmentStyles(workBook, sheetName, cell, styles);
+			}
+		}
+	},
+
+	//文本垂直对齐 vertical	="bottom" or "center" or "top"
+	setAlignmentVertical: function(workBook, sheetName, cell, vertical) {
+		this.init1(workBook, sheetName, cell, "alignment");
+		workBook.Sheets[sheetName][cell].s.alignment.vertical = vertical;
+		return workBook;
+	},
+
+	setAlignmentVerticalAll: function(workBook, sheetName, vertical) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setAlignmentVertical(workBook, sheetName, cell, vertical);
+			}
+		}
+	},
+
+	//文本水平对齐 "bottom" or "center" or "top"
+	setAlignmentHorizontal: function(workBook, sheetName, cell, horizontal) {
+		this.init1(workBook, sheetName, cell, "alignment");
+		workBook.Sheets[sheetName][cell].s.alignment.horizontal = horizontal;
+		return workBook;
+	},
+
+	setAlignmentHorizontalAll: function(workBook, sheetName, horizontal) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setAlignmentHorizontal(workBook, sheetName, cell, horizontal);
+			}
+		}
+	},
+
+	//自动换行
+	setAlignmentWrapText: function(workBook, sheetName, cell, isWrapText) {
+		this.init1(workBook, sheetName, cell, "alignment");
+		workBook.Sheets[sheetName][cell].s.alignment.wrapText = isWrapText;
+		return workBook;
+	},
+
+	setAlignmentWrapTextAll: function(workBook, sheetName, isWrapText) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setAlignmentWrapText(workBook, sheetName, cell, isWrapText);
+			}
+		}
+	},
+
+	setAlignmentReadingOrder: function(workBook, sheetName, cell, readingOrder) {
+		this.init1(workBook, sheetName, cell, "alignment");
+		workBook.Sheets[sheetName][cell].s.alignment.readingOrder = readingOrder;
+		return workBook;
+	},
+
+	setAlignmentReadingOrderAll: function(workBook, sheetName, readingOrder) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setAlignmentReadingOrder(workBook, sheetName, cell, readingOrder);
+			}
+		}
+	},
+
+	//文本旋转角度 0-180,255 is special, aligned vertically
+	setAlignmentTextRotation: function(workBook, sheetName, cell, textRotation) {
+		this.init1(workBook, sheetName, cell, "alignment");
+		workBook.Sheets[sheetName][cell].s.alignment.textRotation = textRotation;
+		return workBook;
+	},
+
+	setAlignmentTextRotationAll: function(workBook, sheetName, textRotation) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setAlignmentTextRotation(workBook, sheetName, cell, textRotation);
+			}
+		}
+	},
+
+	/*Border*/
+
+	//单元格四周边框默认样式
+	borderAll :{
+		top: {
+			style: 'thin'
+		},
+		bottom: {
+			style: 'thin'
+		},
+		left: {
+			style: 'thin'
+		},
+		right: {
+			style: 'thin'
+		}
+	},
+
+	//边框默样式:细线黑色
+	defaultBorderStyle : {
+		style: 'thin'
+	},
+
+	//边框 styles={top:{ style:"thin",color:"FFFFAA00"},bottom:{},...}
+	setBorderStyles: function(workBook, sheetName, cell, styles) {
+		this.init(workBook, sheetName, cell);
+		workBook.Sheets[sheetName][cell].s.border = styles;
+		return workBook;
+	},
+
+	setBorderStylesAll: function(workBook, sheetName, styles) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderStyles(workBook, sheetName, cell, styles);
+			}
+		}
+	},
+
+	//设置单元格上下左右边框默认样式
+	setBorderDefault: function(workBook, sheetName, cell) {
+		this.init(workBook, sheetName, cell);
+		workBook.Sheets[sheetName][cell].s.border = this.borderAll;
+		return workBook;
+	},
+
+	//设置所有单元默认格边框
+	setBorderDefaultAll: function(workBook, sheetName) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderDefault(workBook, sheetName, cell);
+			}
+		}
+	},
+
+	//上边框
+	setBorderTop: function(workBook, sheetName, cell, top) {
+		this.init(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.top = top;
+		return workBook;
+	},
+
+	setBorderTopAll: function(workBook, sheetName, top) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderTop(workBook, sheetName, cell, top);
+			}
+		}
+	},
+
+	//上边框默样式
+	setBorderTopDefault: function(workBook, sheetName, cell) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.top = this.defaultBorderStyle;
+		return workBook;
+	},
+
+	setBorderTopDefaultAll: function(workBook, sheetName) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderTopDefault(workBook, sheetName, cell);
+			}
+		}
+	},
+
+	//下边框
+	setBorderBottom: function(workBook, sheetName, cell, bottom) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.bottom = bottom;
+		return workBook;
+	},
+
+	setBorderBottomAll: function(workBook, sheetName, bottom) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderBottom(workBook, sheetName, cell, bottom);
+			}
+		}
+	},
+
+
+	//下边框默样式
+	setBorderBottomDefault: function(workBook, sheetName, cell) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.bottom = this.defaultBorderStyle;
+		return workBook;
+	},
+
+	setBorderBottomDefaultAll: function(workBook, sheetName) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderBottomDefault(workBook, sheetName, cell);
+			}
+		}
+	},
+
+	//左边框
+	setBorderLeft: function(workBook, sheetName, cell, left) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.left = left;
+		return workBook;
+	},
+
+	setBorderLeftAll: function(workBook, sheetName, left) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderLeft(workBook, sheetName, cell, left);
+			}
+		}
+	},
+
+	setBorderLeftDefault: function(workBook, sheetName, cell) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.left = this.defaultBorderStyle;
+		return workBook;
+	},
+
+	setBorderLeftDefaultAll: function(workBook, sheetName) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderLeftDefault(workBook, sheetName, cell);
+			}
+		}
+	},
+
+	//右边框
+	setBorderRight: function(workBook, sheetName, cell, right) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.right = right;
+		return workBook;
+	},
+
+	setBorderRightAll: function(workBook, sheetName, right) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderRight(workBook, sheetName, cell, right);
+			}
+		}
+	},
+	setBorderRightDefault: function(workBook, sheetName, cell) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.right = this.defaultBorderStyle;
+		return workBook;
+	},
+
+	setBorderRightDefaultAll: function(workBook, sheetName) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderRightDefault(workBook, sheetName, cell);
+			}
+		}
+	},
+
+	//对角线
+	setBorderDiagonal: function(workBook, sheetName, cell, diagonal) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.diagonal = diagonal;
+		return workBook;
+	},
+
+	setBorderDiagonalAll: function(workBook, sheetName, diagonal) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderDiagonal(workBook, sheetName, cell, diagonal);
+			}
+		}
+	},
+
+	setBorderDiagonalDefault: function(workBook, sheetName, cell) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.diagonal = this.defaultBorderStyle;
+		return workBook;
+	},
+
+	setBorderDiagonalDefaultAll: function(workBook, sheetName) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderDiagonalDefault(workBook, sheetName, cell);
+			}
+		}
+	},
+
+	setBorderDiagonalUp: function(workBook, sheetName, cell, isDiagonalUp) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.diagonalUp = isDiagonalUp;
+		return workBook;
+	},
+
+	setBorderDiagonalUpAll: function(workBook, sheetName, isDiagonalUp) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderDiagonalUp(workBook, sheetName, cell, isDiagonalUp);
+			}
+		}
+	},
+
+	setBorderDiagonalDown: function(workBook, sheetName, cell, isDiagonalDown) {
+		this.init1(workBook, sheetName, cell, "border");
+		workBook.Sheets[sheetName][cell].s.border.diagonalDown = isDiagonalDown;
+		return workBook;
+	},
+
+	setBorderDiagonalDownAll: function(workBook, sheetName, isDiagonalDown) {
+		this.initAllCell(workBook, sheetName);
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setBorderDiagonalDown(workBook, sheetName, cell, isDiagonalDown);
+			}
+		}
+	},
+
+	//默认样式,多单元格设置样式
+
+	//设置所有单元格字体样式
+	setFgColorStylesAll: function(workBook, sheetName, fontType, fontColor, fontSize) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				this.setFontType(workBook, sheetName, cell, fontType);
+				this.setFontColorRGB(workBook, sheetName, cell, fontColor);
+				this.setFontSize(workBook, sheetName, cell, fontSize);
+			}
+		}
+	},
+
+	//设置第一行标题自定义样式
+	setTitleStyles: function(workBook, sheetName, fgColor, fontColor, alignment, isBold, fontSize, ) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				row = cell.substr(1);
+				if (row == '1') {
+					this.setFillFgColorRGB(workBook, sheetName, cell, fgColor);
+					this.setFontColor(workBook, sheetName, cell, fontColor);
+					this.setAlignmentHorizontal(workBook, sheetName, cell, alignment);
+					this.setFontBold(workBook, sheetName, cell, isBold);
+					this.setFontSize(workBook, sheetName, cell, fontSize);
+				}
+			}
+		}
+	},
+
+	//设置第一行标题默认样式
+	setTitleStylesDefault: function(workBook, sheetName) {
+		for (cell in workBook.Sheets[sheetName]) {
+			row = cell.substr(1);
+			if (row == '1') {
+				//setFillFgColorRGB(workBook, sheetName, cell, 'FFFF00');
+				this.setAlignmentHorizontal(workBook, sheetName, cell, 'center');
+				this.setFontBold(workBook, sheetName, cell, true);
+				this.setFontSize(workBook, sheetName, cell, '20');
+			}
+		}
+	},
+
+	//设置双数行背景色灰色,便于阅读
+	setEvenRowColorGrey: function(workBook, sheetName) {
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				row = parseInt(cell.substr(1));
+				if (row % 2 == 0) {
+					this.setFillFgColorRGB(workBook, sheetName, cell, 'DCDCDC');
+				}
+
+			}
+		}
+	},
+
+	//合并同一列中内容一样的相邻行
+	mergeSameColCells: function(workBook,sheetName,col) {
+		var cells=[];
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				if (cell.substr(0, 1) == col) {
+					cells.push(cell);//获得该列单元格数组,升序
+				}
+			}
+		}
+		for(var i = 0;i<cells.length-1;){
+			for(var j=i+1;j<cells.length;j++){
+				//内容一样且不为空则合并
+				if(workBook.Sheets[sheetName][cells[i]].v == workBook.Sheets[sheetName][cells[j]].v && workBook.Sheets[sheetName][cells[i]].v != ""){
+					this.mergeCells(workBook,sheetName,cells[i],cells[j]);
+					if(j==cells.length-1){
+						i=j;
+					}
+				}
+				else{	//当且仅当相邻的两个cell值相同时才合并
+					i=j;
+					break;
+				}
+			}
+		}
+	},
+
+	//合并同一行中内容一样的相邻列
+	mergeSameRowCells: function(workBook,sheetName,row) {
+		var cells=[];
+		for (cell in workBook.Sheets[sheetName]) {
+			if (cell != '!cols' && cell != '!merges' && cell != '!ref') {
+				if (cell.substr(1) == row) {
+					cells.push(cell);//获得该列单元格数组,升序
+				}
+			}
+		}
+		for(var i = 0;i<cells.length-1;){
+			for(var j=i+1;j<cells.length;j++){
+				if(workBook.Sheets[sheetName][cells[i]].v == workBook.Sheets[sheetName][cells[j]].v){
+					this.mergeCells(workBook,sheetName,cells[i],cells[j]);
+					if(j==cells.length-1){
+						i=j;
+					}
+				}
+				else{	//当且仅当相邻的两个cell值相同时才合并
+					i=j;
+					break;
+				}
+			}
+		}
+	},
+
+	//当前表格最大行数 return int
+	getMaxRow: function(workBook,sheetName) {
+		var length = 0;
+		for (var ever in workBook.Sheets[sheetName]) {
+			temp = parseInt(ever.substr(1));
+			if (temp > length) {
+				length = temp;
+			}
+		}
+		return length;
+	},
+
+	//当前表格最大列数 A起步 return string
+	getMaxCol: function(workBook,sheetName) {
+		var length = 'A';
+		for (var ever in workBook.Sheets[sheetName]) {
+			temp = ever.substr(0, 1);
+			if (temp > length) {
+				length = temp;
+			}
+		}
+		return length;
+	},
+
+})

+ 478 - 19
src/components/Home/index.vue

@@ -197,6 +197,238 @@
       <el-dialog title="预览" :visible.sync="dialogVisible" fullscreen center>
         <Form :excelList="excelList" :TemHeader="TemHeader" />
       </el-dialog>
+
+      <!-- 隐藏区域 -->
+      <el-table
+        :data="excelList"
+        height="85vh"
+        style="width: 100%; display: none"
+        id="table"
+      >
+        <el-table-column
+          prop="workName"
+          label="姓名"
+          width="100"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="groupOfCheck"
+          label="考勤组"
+          width="120"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column prop="department" label="部门" show-overflow-tooltip>
+        </el-table-column>
+        <el-table-column prop="workNum" label="工号"> </el-table-column>
+        <el-table-column prop="idCard" label="身份证" width="180">
+        </el-table-column>
+        <el-table-column
+          prop="daysOfAttendanceInHuangjiahu"
+          label="黄家湖出勤天数"
+          width="130"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="daysOfcardShortageInHuangjiahu"
+          label="黄家湖缺卡天数"
+          width="180"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="recondOfcardShortageInHuangjiahu"
+          label="黄家湖缺卡记录"
+          width="180"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="sumAttendanceInHuangjiahu"
+          label="黄家湖总出勤天数"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="daysOfAttendanceInMoxuanhu"
+          label="墨轩湖出勤天数"
+          width="130"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="daysOfcardShortageInMoxuanhu"
+          label="墨轩湖缺卡天数"
+          width="180"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="recondOfcardShortageInMoxuanhu"
+          label="墨轩湖缺卡记录"
+          width="180"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="sumAttendanceInMoxuanhu"
+          label="墨轩湖总出勤天数"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="abnormalClockNumber"
+          label="异常地点打卡天数"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="abnormalClockRecond"
+          label="异常地点打卡记录"
+          width="150"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="leTwentyLateNumber"
+          label="0-20分钟迟到次数"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="lequalThirtyLateNumber"
+          label="20-30分钟迟到次数"
+          width="150"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="geThirtyLateNumber"
+          label=">30分钟迟到次数"
+          width="140"
+        >
+        </el-table-column>
+
+        <el-table-column
+          prop="lateOfRecond"
+          label="迟到次数记录"
+          width="130"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="leTwentyLeaveNumber"
+          label="0-20分钟早退次数"
+          width="150"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="lequalThirtyLeaveNumber"
+          label="20-30分钟早退次数"
+          width="150"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="geThirtyLeaveNumber"
+          label=">30分钟早退次数"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="leaveOfRecond"
+          label="早退次数记录"
+          width="140"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column prop="attendanceDays" label="出勤天数">
+        </el-table-column>
+        <el-table-column
+          prop="userId"
+          label="userId"
+          width="180"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column prop="attendanceDay" label="出勤天数">
+        </el-table-column>
+        <el-table-column prop="restDay" label="休息天数"> </el-table-column>
+        <el-table-column
+          prop="workHours"
+          label="工作时长"
+          width="130"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column prop="numberOfLate" label="迟到次数">
+        </el-table-column>
+        <el-table-column prop="numberOfLateTime" label="迟到时长">
+        </el-table-column>
+        <el-table-column
+          prop="numberOfSeriousLateness"
+          label="严重迟到次数"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="durationOfSevereLateness"
+          label="严重迟到时长"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="daysOfAbsenteeismAndLateness"
+          label="旷工迟到天数"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column prop="leaveEarlyNumber" label="早退次数">
+        </el-table-column>
+        <el-table-column
+          prop="leaveEarlyTimes"
+          label="早退时长"
+          width="150"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="lackOfWorkCardTimes"
+          label="上班缺卡次数"
+          width="140"
+        >
+        </el-table-column>
+
+        <el-table-column
+          prop="lackOfMissingWorkCardTimes"
+          label="下班缺卡次数"
+          width="140"
+        >
+        </el-table-column>
+        <el-table-column prop="absenteeismDay" label="旷工天数">
+        </el-table-column>
+        <el-table-column prop="goOutDay" label="外出"> </el-table-column>
+        <el-table-column label="请假">
+          <el-table-column prop="bereavementLeave" label="丧假(天)">
+          </el-table-column>
+          <el-table-column prop="privateAffairLeaveDay" label="事假(天)">
+          </el-table-column>
+          <el-table-column prop="maternityLeaveDay" label="产假(天)">
+          </el-table-column>
+          <el-table-column prop="sickLeaveDay" label="病假(天)">
+          </el-table-column>
+          <el-table-column prop="escortFalse" label="陪护假(天)" width="90">
+          </el-table-column>
+        </el-table-column>
+
+        <template v-for="(item, index) in TemHeader">
+          <el-table-column
+            :prop="item.column_comment"
+            :label="item.column_name"
+            :key="index"
+            show-overflow-tooltip
+          >
+          </el-table-column>
+        </template>
+      </el-table>
     </div>
   </div>
 </template>
@@ -615,7 +847,7 @@ export default {
             this.percentage = Math.floor(
               (progressEvent.loaded / progressEvent.total) * 100
             );
-            this.percentage = this.percentage == 100 ? 60 : this.percentage;
+            this.percentage = this.percentage == 100 ? 90 : this.percentage;
           },
         };
         let res = await this.$axios.post(
@@ -648,7 +880,7 @@ export default {
         // 计算出解析的时间
         this.timer = setInterval(() => {
           this.time_s += 1;
-          this.parsePercentage += 1;
+          this.parsePercentage += 8;
           if (this.parsePercentage >= 90) {
             this.parsePercentage = 90;
           }
@@ -700,24 +932,69 @@ export default {
       });
       // console.log(res);
       if (res.data.success) {
-        this.multiHeader = [...this.multiHeader, ...res.data.data];
-        import("@/util/Export2Excel").then((excel) => {
-          const multiHeader = [this.multiHeader];
-          const multiHeader2 = [this.multiHeader2];
-          const filterVal = this.filterVal; // 表头所对应的字段
-          const data = this.excelList.map((v) => filterVal.map((j) => v[j]));
-          // 进行所有表头的单元格合并
-          const merges = this.merges;
+        // this.multiHeader = [...this.multiHeader, ...res.data.data];
+        // import("@/util/Export2Excel").then((excel) => {
+        //   const multiHeader = [this.multiHeader];
+        //   const multiHeader2 = [this.multiHeader2];
+        //   const filterVal = this.filterVal; // 表头所对应的字段
+        //   const data = this.excelList.map((v) => filterVal.map((j) => v[j]));
+        //   // 进行所有表头的单元格合并
+        //   const merges = this.merges;
+
+        //   excel.export_json_to_excel({
+        //     multiHeader,
+        //     // 这里是第一行的表头
+        //     multiHeader2,
+        //     // 这里是第二行的表头
+        //     data,
+        //     filename: "考勤",
+        //     merges,
+        //   });
+        // });
 
-          excel.export_json_to_excel({
-            multiHeader,
-            // 这里是第一行的表头
-            multiHeader2,
-            // 这里是第二行的表头
-            data,
-            filename: "考勤",
-            merges,
-          });
+        let temList = [
+          "oneOfMonth",
+          "twoOfMonth",
+          "threeOfMonth",
+          "fourOfMonth",
+          "fiveOfMonth",
+          "sixOfMonth",
+          "sevenOfMonth",
+          "eightOfMonth",
+          "nineOfMonth",
+          "tenOfMonth",
+          "elevenOfMonth",
+          "twelveOfMonth",
+          "thirteenOfMonth",
+          "fourteenOfMonth",
+          "fifteenOfMonth",
+          "sixteenOfMonth",
+          "seventeenOfMonth",
+          "eighteenOfMonth",
+          "nineteenOfMonth",
+          "twentyOfMonth",
+          "twentyOneOfMonth",
+          "twentyTwoOfMonth",
+          "twentyThreeOfMonth",
+          "twentyFourOfMonth",
+          "twentyFiveOfMonth",
+          "twentySixOfMonth",
+          "twentySevenOfMonth",
+          "twentyEightOfMonth",
+          "twentyNineOfMonth",
+          "thirtyOfMonth",
+          "thirtyOneOfMonth",
+        ];
+        let temList2 = res.data.data;
+        let size = temList.length;
+        for (let i = 0; i < size; i++) {
+          let a = {};
+          a.column_comment = temList[i];
+          a.column_name = temList2[i];
+          this.TemHeader.push(a);
+        }
+        this.$nextTick(() => {
+          this.exportExcel3();
         });
       } else {
         this.$message.error(res.data.message);
@@ -813,6 +1090,188 @@ export default {
     handleClose() {
       this.drawer = false;
     },
+
+    // 测试
+    exportExcel3() {
+      const table1 = document.querySelector("#table");
+      // raw 原始数据,不会科学计数和省略%
+      let sheet = XLSX.utils.table_to_sheet(table1, { raw: true });
+      // console.log(sheet);
+
+      //第一次使用的朋友可以添加一句输出看看sheet的数据结构
+      // console.log(sheet);
+
+      //遍历每个格子
+      for (const key in sheet) {
+        // console.log(key);
+        // console.log(sheet[key]);
+        //给每个格子修改样式
+        if (key !== "!ref" && key !== "!merges") {
+          sheet[key].s = {
+            border: {
+              //添加边框
+              bottom: {
+                style: "thin",
+                color: "000000",
+              },
+              left: {
+                style: "thin",
+                color: "000000",
+              },
+              right: {
+                style: "thin",
+                color: "000000",
+              },
+              top: {
+                style: "thin",
+                color: "000000",
+              },
+            },
+            //字体水平居中、垂直居中、自动换行、缩进
+            alignment: {
+              horizontal: "center", //水平居中
+              vertical: "center",
+              wrapText: 1,
+              indent: 0,
+            },
+            //字体类型、大小、是否加粗
+            font: {
+              //字体
+              name: "等线",
+              sz: 9,
+              bold: false,
+            },
+          };
+        }
+
+        //给特定格子(带'1'的,即首行 标题)添加样式,下面同理
+        if (key.replace(/[^0-9]/gi, "") === "1") {
+          sheet[key].s = {
+            ...sheet[key].s,
+            fill: {
+              //背景色
+              fgColor: { rgb: "EBF1DE" },
+            },
+            font: {
+              //覆盖字体
+              name: "等线",
+              sz: 11,
+              bold: true,
+            },
+          };
+        }
+        if (key === "A1") {
+          sheet[key].s = {
+            ...sheet[key].s,
+            fill: {
+              //背景色
+              fgColor: { rgb: "E4DFEC" },
+            },
+          };
+        }
+        if (
+          key === "C1" ||
+          key === "D1" ||
+          key === "E1" ||
+          key === "F1" ||
+          key === "G1" ||
+          key === "H1"
+        ) {
+          sheet[key].s = {
+            ...sheet[key].s,
+            fill: {
+              //背景色
+              fgColor: { rgb: "FDE9D9" },
+            },
+          };
+        }
+      }
+      //列宽
+      let colsP = [
+        {
+          wch: 8.11, //A
+        },
+        {
+          wch: 12.67, //B
+        },
+        {
+          wch: 8.11, //C
+        },
+        {
+          wch: 8.11, //D
+        },
+        {
+          wch: 8.11, //E
+        },
+        {
+          wch: 6.78, //F
+        },
+        {
+          wch: 8.11, //G
+        },
+        {
+          wch: 16.11, //H
+        },
+      ];
+      sheet["!cols"] = colsP;
+      //console.log('1111:', sheet)
+      //打印
+      let excelName = "汇报单.xlsx"; //excel文件名
+      this.openDownload(this.sheet2blob(sheet, "汇报单详细"), excelName);
+    },
+    //下面两个函数是处理数据流的,可以直接拿来用
+    //导出excel辅助函数
+    sheet2blob(sheet, sheetName) {
+      let wb = XLSX.utils.book_new();
+      wb.SheetNames.push(sheetName);
+      wb.Sheets[sheetName] = sheet;
+      var wbout = xlsxStyle.write(wb, {
+        bookType: "",
+        bookSST: false,
+        type: "binary",
+      });
+      var blob = new Blob([s2ab(wbout)], { type: "" }, sheetName);
+      // 字符串转ArrayBuffer
+      function s2ab(s) {
+        var buf = new ArrayBuffer(s.length);
+        var view = new Uint8Array(buf);
+        for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xff;
+        return buf;
+      }
+      return blob;
+    },
+    //导出excel辅助函数
+    openDownload(url, saveName) {
+      if (typeof url == "object" && url instanceof Blob) {
+        url = URL.createObjectURL(url); // 创建blob地址
+      }
+      var aLink = document.createElement("a");
+      aLink.href = url;
+      aLink.download = saveName || ""; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效
+      var event;
+      if (window.MouseEvent) event = new MouseEvent("click");
+      else {
+        event = document.createEvent("MouseEvents");
+        event.initMouseEvent(
+          "click",
+          true,
+          false,
+          window,
+          0,
+          0,
+          0,
+          0,
+          0,
+          false,
+          false,
+          false,
+          false,
+          0,
+          null
+        );
+      }
+      aLink.dispatchEvent(event);
+    },
   },
 };
 </script>