From 57e76b55709e8ea88a83ab6c3f665fd9ee7fd64c Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 03 七月 2024 14:23:48 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before into master

---
 src/components/tool/excel.vue |  131 +++++++++++++++++++++++++++----------------
 1 files changed, 81 insertions(+), 50 deletions(-)

diff --git a/src/components/tool/excel.vue b/src/components/tool/excel.vue
index ece94a6..ce500aa 100644
--- a/src/components/tool/excel.vue
+++ b/src/components/tool/excel.vue
@@ -10,7 +10,7 @@
 	}
 </style>
 <style>
-	#luckysheet .save{
+	#luckysheet .save {
 		width: 50px;
 		height: 26px;
 		color: #fff;
@@ -20,11 +20,17 @@
 		cursor: pointer;
 	}
 
-	#luckysheet .save:hover{
+  #luckysheet .save_i{
+    margin-right: 20px;
+    font-size: 20px;
+    cursor: help;
+  }
+
+	#luckysheet .save:hover {
 		opacity: .8;
 	}
 
-	#luckysheet .save:active{
+	#luckysheet .save:active {
 		opacity: .7;
 	}
 </style>
@@ -33,12 +39,12 @@
 </template>
 
 <script>
-// import { data } from 'jquery';
+import {exportExcel} from '../../util/downExcelByLuckSheet'
+	// import { data } from 'jquery';
 	export default {
-		props: ['data','title'],
+		props: ['data', 'execlTitle'],
 		data() {
-			return {
-			}
+			return {}
 		},
 		mounted() {
 			this.$nextTick(() => {
@@ -47,50 +53,75 @@
 		},
 		methods: {
 			templateWrite() {
-				if(this.data!=null&&this.data!=''){
-					let option = JSON.parse(this.data)
-					option.title = this.title
-					luckysheet.create(option)
-				}else{
-					$(function() {
-						//閰嶇疆椤�
-						var options = {
-							container: 'luckysheet',
-							title: this.title,
-							lang: "zh",
-							showsheetbar: false,
-							showstatisticBarConfig: {
-								view: false
-							},
-							data: [{
-								name: '妯℃澘',
-								order: '0'
-							}],
-							enableAddRow: false,
-							row: 60,
-							column: 26,
-							enableAddBackTop: false,
-							showtoolbarConfig: {
-								chart: false, // '鍥捐〃'
-								pivotTable: false,  //'鏁版嵁閫忚琛�'
-								protection:false, // '宸ヤ綔琛ㄤ繚鎶�'
-							},
-							cellRightClickConfig: {
-								copyAs: false, // 澶嶅埗涓�
-								hideRow: false, // 闅愯棌閫変腑琛屽拰鏄剧ず閫変腑琛�
-								hideColumn: false, // 闅愯棌閫変腑鍒楀拰鏄剧ず閫変腑鍒�
-								sort: false, // 鎺掑簭閫夊尯
-								filter: false, // 绛涢�夐�夊尯
-								chart: false, // 鍥捐〃鐢熸垚
-								image: false, // 鎻掑叆鍥剧墖
-								matrix: false, // 鐭╅樀鎿嶄綔閫夊尯
-							},
-							myFolderUrl: 'http://127.0.0.1/',
-							functionButton: '<button onClick="excelClosed()" class="save">淇濆瓨</button>'
-						}
-						luckysheet.create(options)
-					})
+				var option = {}
+				if (this.data != null && this.data != '') {
+					option = JSON.parse(this.data)
+				} else {
+					let rowlen = {}
+					let columnlen = {}
+					for(let a = 0; a<50; a++){
+						rowlen[''+a] = 40
+					}
+					for(let a = 0; a<26; a++){
+						columnlen[''+a] = 100
+					}
+					option = {
+						data: [{
+							name: '妯℃澘',
+							order: '0',
+							config: {
+								rowlen: rowlen,
+								columnlen: columnlen
+							}
+						}],
+						row: 50,
+						column: 26
+					}
 				}
+				option.title = this.execlTitle
+				option.container = 'luckysheet',
+				option.lang = "zh",
+				option.showsheetbar = false,
+				option.defaultFontSize = 14
+				option.showstatisticBarConfig = {
+					view: false
+				},
+				option.enableAddRow = false,
+				option.enableAddBackTop = false,
+				option.showtoolbarConfig = {
+					chart: false, // '鍥捐〃'
+					pivotTable: false, //'鏁版嵁閫忚琛�'
+					protection: false, // '宸ヤ綔琛ㄤ繚鎶�'
+					dataVerification: false, // '鏁版嵁楠岃瘉'
+					frozenMode: false, // '鍐荤粨鏂瑰紡'
+					currencyFormat: false, //璐у竵鏍煎紡
+					percentageFormat: true, //鐧惧垎姣旀牸寮�
+					numberDecrease: true, // '鍑忓皯灏忔暟浣嶆暟'
+					numberIncrease: true, // '澧炲姞灏忔暟浣嶆暟
+					moreFormats: true, // '鏇村鏍煎紡'
+					strikethrough: false, // '鍒犻櫎绾� (Alt+Shift+5)'
+					underline: false, // '涓嬪垝绾� (Alt+Shift+6)'
+					italic: false, // '鏂滀綋 (Ctrl+I)'
+					textWrapMode: true, // '鎹㈣鏂瑰紡'
+					textRotateMode: false, // '鏂囨湰鏃嬭浆鏂瑰紡'
+					conditionalFormat: false, // '鏉′欢鏍煎紡'
+					splitColumn: false, // '鍒嗗垪'
+				},
+				option.cellRightClickConfig = {
+					copyAs: false, // 澶嶅埗涓�
+					hideRow: false, // 闅愯棌閫変腑琛屽拰鏄剧ず閫変腑琛�
+					hideColumn: false, // 闅愯棌閫変腑鍒楀拰鏄剧ず閫変腑鍒�
+					sort: false, // 鎺掑簭閫夊尯
+					filter: false, // 绛涢�夐�夊尯
+					chart: false, // 鍥捐〃鐢熸垚
+					image: false, // 鎻掑叆鍥剧墖
+					matrix: false, // 鐭╅樀鎿嶄綔閫夊尯
+					data: false, // 鏁版嵁楠岃瘉
+					cellFormat: false // 璁剧疆鍗曞厓鏍兼牸寮�
+				},
+				option.myFolderUrl = this.LOCATIONVUE + '/',
+				option.functionButton = '<i class="save_i el-icon-info" title="绯荤粺鏀寔鐨勫彉閲忥細&#10鏍峰搧缂栧彿&#10鏍峰搧鍨嬪彿&#10搴忓彿&#10妫�楠岄」&#10妫�楠屽瓙椤�&#10璁惧鍚嶇О&#10璁惧缂栫爜&#10鍗曚綅&#10瑕佹眰鍊�&#10璇曢獙鏂规硶 | 妫�娴嬫柟娉�&#10鏈�缁堝��&#10缁撹&#10璁$畻鍊�&#10妫�楠屽��"></i><button onClick="excelClosed()" class="save">淇濆瓨</button>'
+				luckysheet.create(option)
 			}
 		}
 	}

--
Gitblit v1.9.3