From d66eade2e194c38170930961fc67375400967aa6 Mon Sep 17 00:00:00 2001
From: 李林 <z1292839451@163.com>
Date: 星期一, 25 三月 2024 16:02:08 +0800
Subject: [PATCH] 功能调整

---
 src/components/tool/excel.vue |  127 +++++++++++++++++++++++++-----------------
 1 files changed, 75 insertions(+), 52 deletions(-)

diff --git a/src/components/tool/excel.vue b/src/components/tool/excel.vue
index 52a3a71..c410db2 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,11 @@
 		cursor: pointer;
 	}
 
-	#luckysheet .save:hover{
+	#luckysheet .save:hover {
 		opacity: .8;
 	}
 
-	#luckysheet .save:active{
+	#luckysheet .save:active {
 		opacity: .7;
 	}
 </style>
@@ -33,12 +33,12 @@
 </template>
 
 <script>
-// import { data } from 'jquery';
+import { data } from 'jquery';
+	// import { data } from 'jquery';
 	export default {
-		props: ['data','execlTitle'],
+		props: ['data', 'execlTitle'],
 		data() {
-			return {
-			}
+			return {}
 		},
 		mounted() {
 			this.$nextTick(() => {
@@ -47,52 +47,75 @@
 		},
 		methods: {
 			templateWrite() {
-				if(this.data!=null&&this.data!=''){
-					let option = JSON.parse(this.data)
-					option.title = this.execlTitle
-					luckysheet.create(option)
-				}else{
-					console.log(this.execlTitle);
-					$(function() {
-						//閰嶇疆椤�
-						var options = {
-							container: 'luckysheet',
-							title: this.execlTitle,
-							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>'
-						}
-						options.title = this.execlTitle
-						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<60; 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: 60,
+						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: false, //鐧惧垎姣旀牸寮�
+					numberDecrease: false, // '鍑忓皯灏忔暟浣嶆暟'
+					numberIncrease: false, // '澧炲姞灏忔暟浣嶆暟
+					moreFormats: false, // '鏇村鏍煎紡'
+					strikethrough: false, // '鍒犻櫎绾� (Alt+Shift+5)'
+					underline: false, // '涓嬪垝绾� (Alt+Shift+6)'
+					italic: false, // '鏂滀綋 (Ctrl+I)'
+					textWrapMode: false, // '鎹㈣鏂瑰紡'
+					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 = '<button onClick="excelClosed()" class="save">淇濆瓨</button>'
+				luckysheet.create(option)
 			}
 		}
 	}

--
Gitblit v1.9.3