cnhis-design-vue 3.1.18-beta.11 → 3.1.18-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,7 +38,7 @@ export declare class Print {
38
38
  /**
39
39
  * 下载pdf
40
40
  */
41
- downloadPDF(params: AnyObject): Promise<unknown>;
41
+ downloadPDF(params: AnyObject, onResolve: Func, onReject: Func): void;
42
42
  print({ templateId, formatId, params }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
43
43
  queryPrintData({ templateId, formatId, params }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | {
44
44
  file: any;
@@ -260,18 +260,16 @@ class Print {
260
260
  _downloadPDF(inputData) {
261
261
  return httpFn.get(PDF_URL, { params: { inputData } }).then(({ data }) => data);
262
262
  }
263
- downloadPDF(params) {
264
- return new Promise((resolve, reject) => {
265
- this.printDirect(params, async (res) => {
266
- if (!res)
267
- reject(null);
268
- resolve(await this._downloadPDF(getFiledir(res.filedir)));
269
- function getFiledir(filedir) {
270
- const result = JSON.parse(filedir);
271
- return isArray(result) ? result[0] || "" : "";
272
- }
273
- }, (err) => reject(err));
274
- });
263
+ downloadPDF(params, onResolve, onReject) {
264
+ this.printDirect(params, async (res) => {
265
+ if (!res)
266
+ onReject(null);
267
+ onResolve(await this._downloadPDF(getFiledir(res.filedir)));
268
+ function getFiledir(filedir) {
269
+ const result = JSON.parse(filedir);
270
+ return isArray(result) ? result[0] || "" : "";
271
+ }
272
+ }, (err) => onReject(err));
275
273
  }
276
274
  async print({ templateId, formatId, params = "" }, successCallbackFn, errorCallbackFn) {
277
275
  const testResult = await this._testConnection();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.18-beta.11",
3
+ "version": "3.1.18-beta.12",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -65,5 +65,5 @@
65
65
  "iOS 7",
66
66
  "last 3 iOS versions"
67
67
  ],
68
- "gitHead": "ddac4cda80933a6f08ce893aa194d5507077e95d"
68
+ "gitHead": "57434af57303f24c89f1bbd3db04a50ceecf01b7"
69
69
  }