From 958ee855acb3431d2da10aa67e2e9453a268fcd4 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 26 十二月 2024 14:33:11 +0800 Subject: [PATCH] 修改cnasbug --- src/components/tool/excel.vue | 144 +++++++++++++++++++++++++++++++----------------- 1 files changed, 93 insertions(+), 51 deletions(-) diff --git a/src/components/tool/excel.vue b/src/components/tool/excel.vue index ece94a6..956fa10 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,25 +20,40 @@ 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; } + #luckysheet .returnView { + width: 50px; + height: 26px; + background-color: #fff; + border: 1px solid #DCDFE6; + color: #606266; + border-radius: 4px; + margin-right: 12px; + cursor: pointer; + } </style> <template> <div id="luckysheet"></div> </template> <script> -// import { data } from 'jquery'; + // import { data } from 'jquery'; export default { - props: ['data','title'], + props: ['data', 'execlTitle'], data() { - return { - } + return {} }, mounted() { this.$nextTick(() => { @@ -47,51 +62,78 @@ }, 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="绯荤粺鏀寔鐨勫彉閲忥細
鏍峰搧缂栧彿
鏍峰搧鍨嬪彿
搴忓彿
妫�楠岄」
妫�楠屽瓙椤�
璁惧鍚嶇О
璁惧缂栫爜
鍗曚綅
瑕佹眰鍊�
璇曢獙鏂规硶 | 妫�娴嬫柟娉�
鏈�缁堝��
缁撹
璁$畻鍊�
妫�楠屽��"></i><button onClick="excelExport()" class="save">瀵煎嚭</button><button onClick="excelClosed()" class="save">淇濆瓨</button>' + option.functionButton = '<i class="save_i el-icon-info" title="绯荤粺鏀寔鐨勫彉閲忥細
鏍峰搧缂栧彿
鏍峰搧鍨嬪彿
搴忓彿
妫�楠岄」
妫�楠屽瓙椤�
璁惧鍚嶇О
璁惧缂栫爜
鍗曚綅
瑕佹眰鍊�
璇曢獙鏂规硶 | 妫�娴嬫柟娉�
鏈�缁堝��
缁撹
璁$畻鍊�
妫�楠屽��"></i><button onClick="returnView()" class="returnView">鍙栨秷</button><button onClick="excelClosed()" class="save">淇濆瓨</button>' + console.log(luckysheet) + luckysheet.create(option) + }, } } </script> -- Gitblit v1.9.3