@icreate/ics-chromely-plugin-report-js-sdk
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -33,5 +33,4 @@ import icsChromelyRequest from '@icreate/ics-chromely-js-sdk'; | ||
} | ||
Report.prototype.OperateEx = function (url, data, method, headers) { | ||
Report.prototype.OperateEx = function (url, data, method) { | ||
if (method === void 0) { method = 'GET'; } | ||
if (headers === void 0) { headers = {}; } | ||
// let opts = | ||
@@ -42,3 +41,2 @@ return icsChromelyRequest.function({ | ||
data: __assign(__assign({}, data), { instanceId: this.instanceId }), | ||
headers: headers, | ||
}); | ||
@@ -69,3 +67,3 @@ }; | ||
* @param fileName 文件名称,如果不传则返回流 | ||
* @returns 文件地址或者文件流 | ||
* @returns 文件或者文件流 | ||
*/ | ||
@@ -77,3 +75,3 @@ Report.prototype.ExportToPdf = function (fileName) { | ||
else { | ||
return this.OperateEx('ExportToPdfStream', null, "GET"); | ||
return this.OperateEx('ExportToPdfStream', null, 'GET'); | ||
} | ||
@@ -80,0 +78,0 @@ }; |
@@ -41,5 +41,4 @@ (function (global, factory) { | ||
} | ||
Report.prototype.OperateEx = function (url, data, method, headers) { | ||
Report.prototype.OperateEx = function (url, data, method) { | ||
if (method === void 0) { method = 'GET'; } | ||
if (headers === void 0) { headers = {}; } | ||
// let opts = | ||
@@ -50,3 +49,2 @@ return icsChromelyRequest__default["default"].function({ | ||
data: __assign(__assign({}, data), { instanceId: this.instanceId }), | ||
headers: headers, | ||
}); | ||
@@ -77,3 +75,3 @@ }; | ||
* @param fileName 文件名称,如果不传则返回流 | ||
* @returns 文件地址或者文件流 | ||
* @returns 文件或者文件流 | ||
*/ | ||
@@ -85,3 +83,3 @@ Report.prototype.ExportToPdf = function (fileName) { | ||
else { | ||
return this.OperateEx('ExportToPdfStream', null, "GET"); | ||
return this.OperateEx('ExportToPdfStream', null, 'GET'); | ||
} | ||
@@ -88,0 +86,0 @@ }; |
@@ -18,3 +18,3 @@ "use strict"; | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-12-10 23:50:25 | ||
* @LastEditTime: 2022-12-13 11:37:27 | ||
* @Description: | ||
@@ -28,5 +28,4 @@ * @FilePath: \ics-chromely-plugin-report\src\core\report.ts | ||
} | ||
Report.prototype.OperateEx = function (url, data, method, headers) { | ||
Report.prototype.OperateEx = function (url, data, method) { | ||
if (method === void 0) { method = 'GET'; } | ||
if (headers === void 0) { headers = {}; } | ||
// let opts = | ||
@@ -37,3 +36,2 @@ return ics_chromely_js_sdk_1.default.function({ | ||
data: __assign(__assign({}, data), { instanceId: this.instanceId }), | ||
headers: headers, | ||
}); | ||
@@ -64,3 +62,3 @@ }; | ||
* @param fileName 文件名称,如果不传则返回流 | ||
* @returns 文件地址或者文件流 | ||
* @returns 文件或者文件流 | ||
*/ | ||
@@ -72,3 +70,3 @@ Report.prototype.ExportToPdf = function (fileName) { | ||
else { | ||
return this.OperateEx('ExportToPdfStream', null, "GET"); | ||
return this.OperateEx('ExportToPdfStream', null, 'GET'); | ||
} | ||
@@ -75,0 +73,0 @@ }; |
@@ -13,3 +13,3 @@ export default class Report { | ||
* @param fileName 文件名称,如果不传则返回流 | ||
* @returns 文件地址或者文件流 | ||
* @returns 文件或者文件流 | ||
*/ | ||
@@ -16,0 +16,0 @@ ExportToPdf(fileName: string): Promise<any>; |
{ | ||
"name": "@icreate/ics-chromely-plugin-report-js-sdk", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "提供报表设计、清空、预览、打印、注册数据源等功能", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
<!-- | ||
* @Author: 文贝 | ||
* @Date: 2022-02-08 21:36:57 | ||
* @LastEditors: 文贝 | ||
* @LastEditTime: 2022-09-15 13:25:42 | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-12-13 13:39:23 | ||
* @Descripttion: | ||
@@ -17,2 +17,5 @@ * @FilePath: \ics-chromely-plugin-report\README.md | ||
``` | ||
0.0.9 优化和完善导出pdf流 | ||
0.0.8-beta.1 增加导出pdf流示例 | ||
0.0.8 增加导出pdf流支持 | ||
0.0.7 修复打印和准备打印方法调用不传打印机名称时使用默认打印机 | ||
@@ -63,3 +66,3 @@ 0.0.6 修改print和printPrepared的printerName允许为空 | ||
printPrepared(printerName?: string): Promise<any> | ||
// 导出pdf | ||
// 导出pdf:文件名称,如果不传则返回流 | ||
ExportToPdf(fileName: string): Promise<any> | ||
@@ -76,4 +79,4 @@ // 导出html | ||
const reportHelper = new ReportHelper() | ||
await reportHelper.clearData() | ||
await reportHelper.load('xxxx.frx') | ||
await reportHelper.clearData() | ||
await reportHelper.registerData('患者基本信息',[{ id:"1",name:"张三"}]) | ||
@@ -91,9 +94,9 @@ await reportHelper.design() //设计报表 | ||
//加载报表1 | ||
await reportHelper.clearData() | ||
await reportHelper.load('xxxx.frx') | ||
await reportHelper.clearData() | ||
await reportHelper.registerData('患者基本信息',[{ id:"1",name:"张三"}]) | ||
await reportHelper.prepare(false) | ||
//加载报表2 | ||
await reportHelper.clearData() | ||
await reportHelper.load('xxxx.frx') | ||
await reportHelper.clearData() | ||
await reportHelper.registerData('患者基本信息',[{ id:"1",name:"李四"}]) | ||
@@ -104,1 +107,19 @@ await reportHelper.prepare(true) | ||
``` | ||
### 导出pdf流示例 | ||
```javascript | ||
const reportHelper = new ReportHelper() | ||
await reportHelper.clearData() | ||
await reportHelper.load('xxxx.frx') | ||
await reportHelper.registerData('患者基本信息', [ | ||
{ id: '1', name: '张三' } | ||
]) | ||
await reportHelper.prepare(true) | ||
const blob = await reportHelper.ExportToPdf() // 设计报表 | ||
//直接使用blob展示[vue-pdf-embed](https://github.com/hrynko/vue-pdf-embed) | ||
const source = await blob.arrayBuffer() | ||
console.log(source, 'arrayBuffer') | ||
//生成pdf内存url | ||
const source = URL.createObjectURL(blob) | ||
console.log(source, 'url') | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39420
121
390