Spaces:
Running
Running
Upload lucky.html
Browse files- lucky.html +63 -0
lucky.html
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<head>
|
2 |
+
<title>��ţ��</title>
|
3 |
+
<link rel="stylesheet" href="https://huggingface.co/spaces/changxin/highcharts/raw/main/pluginsCss.css" />
|
4 |
+
<link rel="stylesheet" href="https://huggingface.co/spaces/changxin/highcharts/raw/main/plugins.css" />
|
5 |
+
<link rel="stylesheet" href="https://huggingface.co/spaces/changxin/highcharts/raw/main/luckysheet.css" />
|
6 |
+
<link rel="stylesheet" href="https://huggingface.co/spaces/changxin/highcharts/raw/main/iconfont.css" />
|
7 |
+
<script src="https://huggingface.co/spaces/changxin/highcharts/raw/main/plugin.js"></script>
|
8 |
+
<script src="https://huggingface.co/spaces/changxin/highcharts/raw/main/luckysheet.umd.js"></script>
|
9 |
+
<script>
|
10 |
+
$(function () {
|
11 |
+
var options = {
|
12 |
+
container: "pq",
|
13 |
+
title: "���IJ���",
|
14 |
+
lang: "zh",
|
15 |
+
myFolderUrl: "https://pbihub.cn/users/44",
|
16 |
+
userInfo: {userName:"����"},
|
17 |
+
data: [{"name":"��ˮ","index":0,"status":1,"order":0,"color":"#ff0066","row":18,"column":12,"celldata":luckysheet.transToCellData([["ά�ȱ�","����ֵ����","����ʽ"],])}]
|
18 |
+
}
|
19 |
+
luckysheet.create(options)
|
20 |
+
})
|
21 |
+
</script>
|
22 |
+
</head>
|
23 |
+
<body>
|
24 |
+
<div id="md" 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>
|
25 |
+
<p style="text-align:center;"> <input style="font-size:16px;" type="file" id="test" name="test" change="demoHandler" /></p>
|
26 |
+
<div id="pq" style="margin:0px;padding:0px;position:absolute;width:100%;left: 0px;top: 50px;bottom: 0px;outline: none;"></div>
|
27 |
+
<script src="https://huggingface.co/spaces/changxin/highcharts/raw/main/luckyexcel.umd.js"></script>
|
28 |
+
<script>
|
29 |
+
function demoHandler(){
|
30 |
+
let upload = document.getElementById("test");
|
31 |
+
let mask = document.getElementById("md");
|
32 |
+
if(upload){
|
33 |
+
|
34 |
+
window.onload = () => {
|
35 |
+
upload.addEventListener("change", function(evt){
|
36 |
+
var files = evt.target.files;
|
37 |
+
if(files==null || files.length==0){alert("û�д������ļ���");return;}
|
38 |
+
|
39 |
+
let name = files[0].name;
|
40 |
+
let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length-1];
|
41 |
+
if(suffix!="xlsx"){alert("Ŀǰֻ֧��xlsx�ĵ����룡");return;}
|
42 |
+
LuckyExcel.transformExcelToLucky(files[0], function(exportJson, luckysheetfile){
|
43 |
+
|
44 |
+
if(exportJson.sheets==null || exportJson.sheets.length==0){alert("��ȡʧ��, Ŀǰ��֧��xls�ļ�!");return;}
|
45 |
+
console.log(exportJson, luckysheetfile);
|
46 |
+
window.luckysheet.destroy();
|
47 |
+
|
48 |
+
window.luckysheet.create({
|
49 |
+
container: 'pq',
|
50 |
+
showinfobar:false,
|
51 |
+
data:exportJson.sheets,
|
52 |
+
title:exportJson.info.name,
|
53 |
+
userInfo:exportJson.info.name.creator
|
54 |
+
});
|
55 |
+
});
|
56 |
+
});
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
demoHandler();
|
61 |
+
</script>
|
62 |
+
</body>
|
63 |
+
|