Browse Source

!155 更新xlsx前端解析组件
Merge pull request !155 from 高雄/master

陈精华 1 year ago
parent
commit
4ee8926d5f

File diff suppressed because it is too large
+ 8598 - 1
server/src/main/resources/static/xlsx/css/luckysheet.css


File diff suppressed because it is too large
+ 5496 - 0
server/src/main/resources/static/xlsx/demoData/getTargetData.js


+ 28 - 1
server/src/main/resources/static/xlsx/demoData/sheetConditionFormat.js

@@ -6450,7 +6450,34 @@ window.sheetConditionFormat = {
 		"conditionName": "occurrenceDate",
 		"conditionRange": [],
 		"conditionValue": ["2020/07/23 - 2020/07/29"]
-	}, {
+	},{
+		"type": "default",
+		"cellrange": [{
+			"row": [10, 19],
+			"column": [0, 0]
+		}],
+		"format": {
+			"textColor": "#000000",
+			"cellColor": "#ff0000"
+		},
+		"conditionName": "regExp",
+		"conditionRange": [],
+		"conditionValue": [/^\d{1,}\.\d{1,}$/]
+	},{
+		"type": "default",
+		"cellrange": [{
+			"row": [0, 9],
+			"column": [0, 0]
+		}],
+		"format": {
+			"textColor": "#000000",
+			"cellColor": "#ff0000"
+		},
+		"conditionName": "sort",
+		"conditionRange": [],
+		"conditionValue": ['desc']
+	},
+	{
 		"type": "colorGradation",
 		"cellrange": [{
 			"left": 422,

File diff suppressed because it is too large
+ 4 - 18
server/src/main/resources/static/xlsx/expendPlugins/chart/chartmix.umd.min.js


File diff suppressed because it is too large
+ 1 - 0
server/src/main/resources/static/xlsx/expendPlugins/chart/chartmix.umd.min.js.map


+ 46 - 0
server/src/main/resources/static/xlsx/expendPlugins/print/print.css

@@ -0,0 +1,46 @@
+.luckysheet-print span[role="heading"] {
+    font-size: 30px;
+    font-weight: bold;
+}
+
+.luckysheet-print-suggest {
+    font-size: 12px;
+}
+
+.luckysheet-print-title {
+    font-weight: bold;
+    font-size: 18px;
+}
+
+.luckysheet-print-radio {
+    display: flex;
+}
+
+.luckysheet-print-radio > div {
+    width: 50%;
+}
+
+.luckysheet-print select {
+    height: 30px;
+}
+
+.luckysheet-print .luckysheet-modal-dialog-buttons {
+    display: flex;
+    flex-direction: row-reverse;
+}
+
+.luckysheet-print-box canvas {
+    display: block;
+}
+
+@media print {
+    :not(html, head, body, .luckysheet-print-preview, .luckysheet-print-preview *) {
+        display: none;
+    }
+    .luckysheet-print-break {
+        page-break-after: always;
+    }
+    #print-layout-options {
+        display: none;
+    }
+}

+ 0 - 0
server/src/main/resources/static/xlsx/expendPlugins/print/print.js


+ 33 - 21
server/src/main/resources/static/xlsx/index.html

@@ -2,13 +2,14 @@
 <html>
     <head>
         <meta charset="UTF-8" />
-        <title>Hello xlsx!</title>
+        <title>xlsx在线预览</title>
         <link rel='stylesheet' href='plugins/css/pluginsCss.css' />
         <link rel='stylesheet' href='plugins/plugins.css' />
         <link rel='stylesheet' href='css/luckysheet.css' />
         <link rel='stylesheet' href='assets/iconfont/iconfont.css' />
         <script src="plugins/js/plugin.js"></script>
         <script src="luckysheet.umd.js"></script>
+        <script src="../js/base64.min.js" type="text/javascript"></script>
     </head>
     <body>
         <div id="lucky-mask-demo" style="position: absolute;z-index: 1000000;left: 0px;top: 0px;bottom: 0px;right: 0px; background: rgba(255, 255, 255, 0.8); text-align: center;font-size: 40px;align-items:center;justify-content: center;display: none;">Downloading</div>
@@ -17,56 +18,67 @@
 		<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;left: 0px;top: 50px;bottom: 0px;outline: none;"></div>
         <script src="luckyexcel.umd.js"></script>
         <script>
-            function demoHandler(){
-           
+       let str =location.search;
+       let search =str.substr(1);
+        //console.log(search); 
+           search = Base64.decode(decodeURIComponent(search));
+         //  console.log(search); 
+          
                 let mask = document.getElementById("lucky-mask-demo");
-
-                    window.onload = () => {
-                            var value = 'kex.xlsx';
-                            var name = 'xlsx';
+                    function loadText() {
+                            var value = search;
+                            var name = 'xlsx.xlsx';
                             if(value==""){
                                 return;
                             }
-                          //  mask.style.display = "flex";
+                           // mask.style.display = "flex";
                             LuckyExcel.transformExcelToLuckyByUrl(value, name, function(exportJson, luckysheetfile){
-                                
                                 if(exportJson.sheets==null || exportJson.sheets.length==0){
-                                    alert("Failed to read the content of the excel file, currently does not support xls files!");
+                                    alert("读取excel文件内容失败!");
                                     return;
                                 }
-                              //  console.log(exportJson, luckysheetfile);
                                 mask.style.display = "none";
                                 window.luckysheet.destroy();
-                                
                                 window.luckysheet.create({
-                                    container: 'luckysheet', //luckysheet is the container id
-									lang: "zh",
+                                container: 'luckysheet', //luckysheet is the container id
+                                lang: "zh",
+                             showtoolbarConfig:{
+                             image: true,
+                             print: false, //关闭打印按钮  启用也不能用 等以后看情况而定
+                             exportXlsx: false, //关闭导出按钮  启用也不能用  等以后看情况而定
+                                  },
+
                                allowCopy: true, // 是否允许拷贝
                                showtoolbar: true, // 是否显示工具栏
                                showinfobar: false, // 是否显示顶部信息栏
+                               // myFolderUrl: "/",//作用:左上角<返回按钮的链接
                                showsheetbar: true, // 是否显示底部sheet页按钮
                                showstatisticBar: true, // 是否显示底部计数栏
-                               sheetBottomConfig: false, // sheet页下方的添加行按钮和回到顶部按钮配置
+                               sheetBottomConfig: true, // sheet页下方的添加行按钮和回到顶部按钮配置
                                allowEdit: true, // 是否允许前台编辑
                                enableAddRow: false, // 允许增加行
                                enableAddCol: false, // 允许增加列
                                userInfo: false, // 右上角的用户信息展示样式
                                showRowBar: true, // 是否显示行号区域
                                showColumnBar: false, // 是否显示列号区域
-                               sheetFormulaBar: true, // 是否显示公式栏
+                               sheetFormulaBar: false, // 是否显示公式栏
                                enableAddBackTop: true,//返回头部按钮
-                                
+                               forceCalculation: false, //下面是导出插件 默认关闭
+                               enableAddRow: false, // 允许增加行
+                               plugins: [{ name: 'chart' }, { name: 'exportXlsx', config: { url: 'luckyToXlsx' } }, {
+                               name: 'print', config: {
+                               license: ''
+                               }
+                               }],
                                     data:exportJson.sheets,
                                     title:exportJson.info.name,
                                     userInfo:exportJson.info.name.creator
                                 });
                             });
-                       
-
                     }
 
-            }
-            demoHandler();
+   loadText();
+
         </script>
     </body>
 </html>

File diff suppressed because it is too large
+ 131175 - 2456
server/src/main/resources/static/xlsx/luckysheet.umd.js


File diff suppressed because it is too large
+ 3 - 3
server/src/main/resources/static/xlsx/luckysheet.umd.js.map


File diff suppressed because it is too large
+ 687 - 1
server/src/main/resources/static/xlsx/plugins/css/pluginsCss.css


File diff suppressed because it is too large
+ 249 - 1
server/src/main/resources/static/xlsx/plugins/js/plugin.js


File diff suppressed because it is too large
+ 138 - 3
server/src/main/resources/static/xlsx/plugins/plugins.css