Spaces:
Running
Running
Update lucky.html
Browse files- lucky.html +8 -8
lucky.html
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<head>
|
2 |
-
<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" />
|
@@ -10,11 +10,11 @@
|
|
10 |
$(function () {
|
11 |
var options = {
|
12 |
container: "pq",
|
13 |
-
title: "
|
14 |
lang: "zh",
|
15 |
myFolderUrl: "https://pbihub.cn/users/44",
|
16 |
-
userInfo: {userName:"
|
17 |
-
data: [{"name":"
|
18 |
}
|
19 |
luckysheet.create(options)
|
20 |
})
|
@@ -24,7 +24,7 @@
|
|
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="
|
28 |
<script>
|
29 |
function demoHandler(){
|
30 |
let upload = document.getElementById("test");
|
@@ -34,14 +34,14 @@
|
|
34 |
window.onload = () => {
|
35 |
upload.addEventListener("change", function(evt){
|
36 |
var files = evt.target.files;
|
37 |
-
if(files==null || files.length==0){alert("
|
38 |
|
39 |
let name = files[0].name;
|
40 |
let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length-1];
|
41 |
-
if(suffix!="xlsx"){alert("
|
42 |
LuckyExcel.transformExcelToLucky(files[0], function(exportJson, luckysheetfile){
|
43 |
|
44 |
-
if(exportJson.sheets==null || exportJson.sheets.length==0){alert("
|
45 |
console.log(exportJson, luckysheetfile);
|
46 |
window.luckysheet.destroy();
|
47 |
|
|
|
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" />
|
|
|
10 |
$(function () {
|
11 |
var options = {
|
12 |
container: "pq",
|
13 |
+
title: "畅心测试",
|
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 |
})
|
|
|
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="luckyexcel.umd.js"></script>
|
28 |
<script>
|
29 |
function demoHandler(){
|
30 |
let upload = document.getElementById("test");
|
|
|
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 |
|