cnhis-design-vue 3.1.39-beta.3 → 3.1.39-beta.4

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.
@@ -6,6 +6,7 @@ export declare class Print {
6
6
  private dialog;
7
7
  private dialogPreview;
8
8
  private instance;
9
+ private downloadPath;
9
10
  constructor();
10
11
  private readonly messageHandlerQueue;
11
12
  private messageHandler;
@@ -27,6 +27,7 @@ class Print {
27
27
  this.dialog = new IdentityVerificationDialog();
28
28
  this.dialogPreview = new PreviewDialog();
29
29
  this.instance = null;
30
+ this.downloadPath = "";
30
31
  this.messageHandlerQueue = [];
31
32
  var _a;
32
33
  const _window = window;
@@ -35,13 +36,19 @@ class Print {
35
36
  return;
36
37
  this.currentMessageHandler = this.messageHandler.bind(this);
37
38
  this.webview.addEventListener("message", this.currentMessageHandler);
39
+ this.postMessage({ exec: "config", data: "" });
38
40
  }
39
41
  messageHandler(e) {
42
+ var _a;
40
43
  const handler = this.messageHandlerQueue.pop();
41
44
  if (!handler)
42
45
  return console.log("\u5F53\u524D\u56DE\u6267", e, "\u6CA1\u6709\u53EF\u7528\u7684handler");
43
46
  const { resolve, reject } = handler;
44
47
  try {
48
+ const { exec } = JSON.parse(e.data);
49
+ if (exec === "config") {
50
+ this.downloadPath = ((_a = JSON.parse(e.data).res) == null ? void 0 : _a.downloadpath) || "";
51
+ }
45
52
  console.log(e);
46
53
  resolve(JSON.parse(e.data).res);
47
54
  } catch (e2) {
@@ -311,6 +318,9 @@ class Print {
311
318
  return httpFn.get(PDF_URL, { params: { inputData } }).then(({ data }) => data);
312
319
  }
313
320
  downloadPDF(params, onResolve, onReject) {
321
+ if (this.webview && this.downloadPath) {
322
+ params.print.filename = this.downloadPath.replace(/\\/g, "/");
323
+ }
314
324
  this.printDirect(
315
325
  params,
316
326
  async (res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.39-beta.3",
3
+ "version": "3.1.39-beta.4",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -61,5 +61,5 @@
61
61
  "iOS 7",
62
62
  "last 3 iOS versions"
63
63
  ],
64
- "gitHead": "227dc52f4b92d7b693b824d11178c3423d292cce"
64
+ "gitHead": "38355ca6857ae71253ede4660af28c8d835d9968"
65
65
  }