highcharts / lucky.html
changxin's picture
Upload lucky.html
9ba1976
raw
history blame
3.56 kB
<head>
<title>��ţ��</title>
<link rel="stylesheet" href="https://huggingface.co/spaces/changxin/highcharts/raw/main/pluginsCss.css" />
<link rel="stylesheet" href="https://huggingface.co/spaces/changxin/highcharts/raw/main/plugins.css" />
<link rel="stylesheet" href="https://huggingface.co/spaces/changxin/highcharts/raw/main/luckysheet.css" />
<link rel="stylesheet" href="https://huggingface.co/spaces/changxin/highcharts/raw/main/iconfont.css" />
<script src="https://huggingface.co/spaces/changxin/highcharts/raw/main/plugin.js"></script>
<script src="https://huggingface.co/spaces/changxin/highcharts/raw/main/luckysheet.umd.js"></script>
<script>
$(function () {
var options = {
container: "pq",
title: "���IJ���",
lang: "zh",
myFolderUrl: "https://pbihub.cn/users/44",
userInfo: {userName:"����"},
data: [{"name":"��ˮ","index":0,"status":1,"order":0,"color":"#ff0066","row":18,"column":12,"celldata":luckysheet.transToCellData([["ά�ȱ�","����ֵ����","����ʽ"],])}]
}
luckysheet.create(options)
})
</script>
</head>
<body>
<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>
<p style="text-align:center;"> <input style="font-size:16px;" type="file" id="test" name="test" change="demoHandler" /></p>
<div id="pq" style="margin:0px;padding:0px;position:absolute;width:100%;left: 0px;top: 50px;bottom: 0px;outline: none;"></div>
<script src="https://huggingface.co/spaces/changxin/highcharts/raw/main/luckyexcel.umd.js"></script>
<script>
function demoHandler(){
let upload = document.getElementById("test");
let mask = document.getElementById("md");
if(upload){
window.onload = () => {
upload.addEventListener("change", function(evt){
var files = evt.target.files;
if(files==null || files.length==0){alert("û�д������ļ���");return;}
let name = files[0].name;
let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length-1];
if(suffix!="xlsx"){alert("Ŀǰֻ֧��xlsx�ĵ����룡");return;}
LuckyExcel.transformExcelToLucky(files[0], function(exportJson, luckysheetfile){
if(exportJson.sheets==null || exportJson.sheets.length==0){alert("��ȡʧ��, Ŀǰ��֧��xls�ļ�!");return;}
console.log(exportJson, luckysheetfile);
window.luckysheet.destroy();
window.luckysheet.create({
container: 'pq',
showinfobar:false,
data:exportJson.sheets,
title:exportJson.info.name,
userInfo:exportJson.info.name.creator
});
});
});
}
}
}
demoHandler();
</script>
</body>