|
@@ -946,6 +946,7 @@ function writeWorkSheetRels(signSheetIdx) {
|
|
|
rst.push('</Relationships>');
|
|
|
return rst;
|
|
|
}
|
|
|
+
|
|
|
function writeImage(path, pic, baseDir) {
|
|
|
let rst = null;
|
|
|
if (pic) {
|
|
@@ -954,7 +955,9 @@ function writeImage(path, pic, baseDir) {
|
|
|
// fs.createReadStream
|
|
|
} else if (path) {
|
|
|
const filePath = baseDir + '/app' + path;
|
|
|
+ // console.log(filePath);
|
|
|
rst = fs.readFileSync(filePath);
|
|
|
+ // console.log(rst);
|
|
|
}
|
|
|
return rst;
|
|
|
}
|
|
@@ -1236,10 +1239,13 @@ module.exports = {
|
|
|
}
|
|
|
resetDummuySignature(pageData, thisRoleRel); // 把草图转换一下roleRel
|
|
|
// console.log(thisRoleRel);
|
|
|
+
|
|
|
+ const hasSignature = false; // 暂时不支持电子签名、草图导出excel
|
|
|
// const hasSignature = checkAndSetSignatureCache(pageData, signKeyArr, signPathArr, thisRoleRel, signSheetIdxArr); // 因草图的关系,thisRoleRel是否为null就不是充要的条件
|
|
|
// console.log('signKeyArr');
|
|
|
// console.log(signKeyArr);
|
|
|
- const hasSignature = false;
|
|
|
+ // console.log('signPathArr');
|
|
|
+ // console.log(signPathArr);
|
|
|
// console.log('hasSignature: ' + hasSignature);
|
|
|
if (isSinglePage) {
|
|
|
sheets.push({ sheetName: '全部页' });
|
|
@@ -1259,11 +1265,13 @@ module.exports = {
|
|
|
let data = writeContentTypes(sheets, isSinglePage, hasSignature);
|
|
|
const zip = new JSZip();
|
|
|
zip.file(file, data.join(''), { compression: 'DEFLATE' });
|
|
|
+ // console.log('step 1');
|
|
|
// 2.
|
|
|
const zip_rels = zip.folder('_rels');
|
|
|
file = '.rels';
|
|
|
data = writeRootRels();
|
|
|
zip_rels.file(file, data.join(''), { compression: 'DEFLATE' });
|
|
|
+ // console.log('step 2');
|
|
|
// 3.
|
|
|
const zip_docProps = zip.folder('docProps');
|
|
|
file = 'app.xml';
|
|
@@ -1272,6 +1280,7 @@ module.exports = {
|
|
|
file = 'core.xml';
|
|
|
data = writeCore();
|
|
|
zip_docProps.file(file, data.join(''), { compression: 'DEFLATE' });
|
|
|
+ // console.log('step 3');
|
|
|
// 4.
|
|
|
const zip_xl = zip.folder('xl');
|
|
|
file = 'workbook.xml';
|
|
@@ -1281,6 +1290,7 @@ module.exports = {
|
|
|
file = 'workbook.xml.rels';
|
|
|
data = writeXlRels(sheets, isSinglePage);
|
|
|
zip_rels2.file(file, data.join(''), { compression: 'DEFLATE' });
|
|
|
+ // console.log('step 4');
|
|
|
// 5.
|
|
|
const zip_theme = zip_xl.folder('theme');
|
|
|
file = 'theme1.xml';
|
|
@@ -1329,6 +1339,7 @@ module.exports = {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // console.log('step 5');
|
|
|
// 6.
|
|
|
const zip_xl_worksheets = zip_xl.folder('worksheets');
|
|
|
const sharedStrList = [];
|
|
@@ -1345,6 +1356,7 @@ module.exports = {
|
|
|
zip_xl_worksheets.file(file, data[i].join(''), { compression: 'DEFLATE' });
|
|
|
}
|
|
|
}
|
|
|
+ // console.log('step 6');
|
|
|
// 7.
|
|
|
if (hasSignature) {
|
|
|
const zip_xl_worksheets_rels = zip_xl_worksheets.folder('_rels');
|
|
@@ -1370,6 +1382,7 @@ module.exports = {
|
|
|
file = 'styles.xml';
|
|
|
data = writeStyles(stylesObj, hasSignature);
|
|
|
zip_xl.file(file, data.join(''), { compression: 'DEFLATE' });
|
|
|
+ // console.log('step 7');
|
|
|
|
|
|
if (fName) {
|
|
|
// let newName = '' + (new Date()).valueOf();
|