var spread = new GC.Spread.Sheets.Workbook();
let tampName = "原始记录";
let type = "ORIGINAL_RECORD_SJS";
$.ajax({
method: "post",
url: path + '/hct/SpreadJS/getSJSFile?token=' + webplus.getToken() + '&name=' + tampName + '&type=' + type,
data: {belong: detectionAdminId},
responseType: "blob",
xhrFields: {responseType: "blob"},
headers: {
cache: false,
"Access-Control-Allow-Origin": "*",
'X-Requested-With': 'XMLHttpRequest',
crossDomain: true
},
success: function (response) {
if (response.size) {
let openMode, importOptions, spreadAPI;
openMode = GC.Spread.Sheets.OpenMode.incremental;
importOptions = {
openMode
}
console.time('渲染时间')
let blob = new Blob([response, {type: 'application/zip'});
console.log(blob)
spread.open(blob,
function () {
console.timeEnd('渲染时间')
},
function (e) {
console.log(e);
},
importOptions
);
} else {
layer.msg("文件不存在!", {time: 3000})
}
}
})
这个ajax 就是获取附件中的sjs文件
|
|