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):
|
|
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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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.
|
|
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": "
|
|
68
|
+
"gitHead": "57434af57303f24c89f1bbd3db04a50ceecf01b7"
|
|
69
69
|
}
|