12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- "use strict";
- // import * as edge from 'edge-js';
- exports.__esModule = true;
- // let designerReport = edge.func({
- // assemblyFile: 'lib/GetEasy.Node.Printer.dll',
- // typeName: 'GetEasy.Node.Printer.NodeReportDesigner',
- // methodName: 'DesignerReport'
- // });
- // designerReport('', true);
- var ffi = require("ffi");
- var os = require("os");
- var cpu = os.arch() === "x64" ? "64" : "86";
- var callback = ffi.Callback('void', ['int', 'string'], function (id, name) {
- console.log("id: ", id);
- console.log("name: ", name);
- });
- var dll = ffi.Library(__dirname + "/dll/GetEasy.Node.Printer." + cpu + ".dll", {
- designerReport: ["void", ["string", "string", "pointer"]],
- reportShowPreview: ["void", ["string", "string"]],
- reportPrinter: ["void", ["string", "string"]]
- });
- var ReportApi = /** @class */ (function () {
- function ReportApi() {
- }
- /**
- *设计模板
- *
- * @param {string} fileName 模板
- * @param {string} tempData 临时演示数据
- * @memberof ReportApi
- */
- ReportApi.designerReport = function (template, tempData, saveCallback) {
- var callbackPointer = ffi.Callback('bool', ['string'], saveCallback);
- dll.designerReport(template, tempData, callbackPointer);
- };
- /**
- *打印预览
- *
- * @param {string} fileName 模板路径
- * @param {string} jsonData 数据
- * @memberof ReportApi
- */
- ReportApi.reportShowPreview = function (fileName, jsonData) {
- dll.reportPrinter(fileName, jsonData);
- };
- /**
- *打印
- *
- * @param {string} fileName 模板路径
- * @param {string} jsonData 数据
- * @memberof ReportApi
- */
- ReportApi.reportPrinter = function (fileName, jsonData) {
- dll.reportPrinter(fileName, jsonData);
- };
- return ReportApi;
- }());
- exports["default"] = ReportApi;
|