本帖最后由 sunyuantao 于 2021-1-5 14:46 编辑
附件中解压后是android 平板app安装文件。
- var spread=null;
- var excelIo=null;
- var host="";
- window.onload = function() {
- var height=document.body.clientHeight;
- $("#ss").height(height);
- spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
- excelIo = new GC.Spread.Excel.IO();
- initSpread();
- };
- function initSpread() {
- zoom=1.2;
- var xhr = new XMLHttpRequest();
- xhr.open('GET', "http://124.134.133.102:8089/measureServer/mobile/downloadSpreadDemoExcel.do", true);
- xhr.responseType = 'blob';
- xhr.onload = function(e) {
- if (this.status == 200) {
- var blob = this.response;
- excelIo.open(blob, function (json) {
- var workbookObj = json;
- spread.fromJSON(workbookObj);
- spread.setActiveSheetIndex(1);
- spread.options.tabStripRatio = 0.7;
- spread.options.scroolbarMaxAlign=true;
- spread.options.allowUserZoom = false;
- spread.options.scrollByPixel = true;
- var activeSheet = spread.getActiveSheet();
- activeSheet.zoom(zoom);//缩放比例
- }, function (e) {
- alert('文件加载异常');
- }, {});
- }else{
- alert('系统异常');
- }
- };
- xhr.send();
- }
复制代码
|
|