123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- /**
- * Created by Tony on 2017/4/1.
- */
- var JV = require('../rpt_component/Jpc_ValueDefine');
- const dftHeadXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
- function writeContentTypes(sheets) {
- var rst = [];
- rst.push[dftHeadXml + '\r\n'];
- rst.push['<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">'];
- //...
- rst.push['<Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>'];
- rst.push['<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>'];
- rst.push['<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>'];
- rst.push['<Default Extension="xml" ContentType="application/xml"/>'];
- rst.push['<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>'];
- rst.push['<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>'];
- rst.push['<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>'];
- for (var i = 0; i < sheets.length; i++) {
- rst.push('<Override PartName="/xl/worksheets/' + sheets[i].sheetName + '.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>')
- }
- rst.push['<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>'];
- rst.push['</Types>'];
- return rst;
- }
- function writeRootRels(){
- var rst = [];
- rst.push[dftHeadXml + '\r\n'];
- rst.push['<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">'];
- rst.push['<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>'];
- rst.push['<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>'];
- rst.push['<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>'];
- //rst.push['']; ...
- rst.push['</Relationships>'];
- return rst;
- }
- function writeApp(sheets) {
- var rst = [];
- rst.push[dftHeadXml + '\r\n'];
- rst.push['<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">'];
- rst.push['<Application>Microsoft Excel</Application>'];
- rst.push['<DocSecurity>0</DocSecurity>'];
- rst.push['<ScaleCrop>false</ScaleCrop>'];
- rst.push['<HeadingPairs>'];
- rst.push['<vt:vector size="2" baseType="variant">'];
- rst.push['<vt:variant><vt:lpstr>¹¤×÷±í</vt:lpstr></vt:variant>'];
- rst.push['<vt:variant><vt:i4>' + sheets.length + '</vt:i4></vt:variant>'];
- rst.push['</vt:vector>'];
- rst.push['</HeadingPairs>'];
- rst.push['<TitlesOfParts>'];
- rst.push['<vt:vector size="' + sheets.length + '" baseType="lpstr">'];
- for (var i = 0; i < sheets.length; i++) {
- rst.push('<vt:lpstr>' + sheets[i].sheetName + '</vt:lpstr>')
- }
- rst.push['</vt:vector>'];
- rst.push['</TitlesOfParts>'];
- rst.push['<Company>SmartCost</Company>'];
- rst.push['<LinksUpToDate>false</LinksUpToDate>'];
- rst.push['<SharedDoc>false</SharedDoc>'];
- rst.push['<HyperlinksChanged>false</HyperlinksChanged>'];
- rst.push['<AppVersion>12.0000</AppVersion>'];
- //rst.push[''];
- rst.push['</Properties>'];
- return rst;
- }
- function writeCore() {
- //
- }
- module.exports = {
- exportExcel: function (pageData, options) {
- var rptOptions = (options || {singlePage: false, fileName: 'report'});
- }
- }
|