cnhis-design-vue 3.1.39-release.2 → 3.1.39

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.
Files changed (81) hide show
  1. package/README.md +123 -123
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/button-print/index.d.ts +16 -1
  7. package/es/components/button-print/src/ButtonPrint.vue.d.ts +16 -1
  8. package/es/components/button-print/src/ButtonPrint.vue2.js +37 -6
  9. package/es/components/button-print/src/utils/print.d.ts +1 -0
  10. package/es/components/button-print/src/utils/print.js +10 -0
  11. package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
  12. package/es/components/form-render/index.js +2 -2
  13. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +3 -0
  14. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.js +9 -4
  15. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +3 -0
  16. package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +4 -4
  17. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  18. package/es/components/form-render/src/components/renderer/select.js +26 -8
  19. package/es/components/form-render/src/hooks/index.js +1 -1
  20. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +2 -1
  21. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +4 -3
  22. package/es/components/form-render/src/hooks/useFormRenderOptions.js +53 -13
  23. package/es/components/form-render/src/utils/index.d.ts +2 -4
  24. package/es/components/form-render/src/utils/index.js +1 -15
  25. package/es/components/form-render/style/index.css +1 -1
  26. package/es/components/iho-table/index.d.ts +120 -120
  27. package/es/components/iho-table/src/IhoTable.vue.d.ts +120 -120
  28. package/es/components/iho-table/src/IhoTable.vue.js +6 -6
  29. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +60 -62
  30. package/es/components/iho-table/src/hooks/tapHooks/index.js +2 -6
  31. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
  32. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +2 -2
  33. package/es/components/iho-table/src/plugins/anchorPlugin/tableAnchor.js +2 -1
  34. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.d.ts +2 -2
  35. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +11 -11
  36. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -0
  37. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +4 -1
  38. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +31 -4
  39. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +12 -7
  40. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.js +13 -8
  41. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +8 -6
  42. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin.js +1 -2
  43. package/es/components/iho-table/src/types/index.d.ts +9 -4
  44. package/es/components/index.css +1 -1
  45. package/es/components/index.js +2 -2
  46. package/es/components/keyboard/index.d.ts +4 -0
  47. package/es/components/keyboard/src/Keyboard.vue.d.ts +4 -0
  48. package/es/components/keyboard/src/Keyboard.vue.js +10 -2
  49. package/es/components/keyboard/src/components/InputNumber.vue.d.ts +3 -1
  50. package/es/components/keyboard/src/components/InputNumber.vue.js +13 -1
  51. package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +2 -0
  52. package/es/components/scale-view/src/ScaleView.vue.d.ts +0 -3
  53. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  54. package/es/env.d.ts +24 -24
  55. package/es/shared/assets/img/failure.js +1 -1
  56. package/es/shared/assets/img/failure.png.js +1 -1
  57. package/es/shared/assets/img/icon-asc.js +1 -1
  58. package/es/shared/assets/img/icon-desc.js +1 -1
  59. package/es/shared/assets/img/no-permission.js +1 -1
  60. package/es/shared/assets/img/no-permission.png.js +1 -1
  61. package/es/shared/assets/img/nodata.js +1 -1
  62. package/es/shared/assets/img/nodata.png.js +1 -1
  63. package/es/shared/assets/img/notfound.js +1 -1
  64. package/es/shared/assets/img/notfound.png.js +1 -1
  65. package/es/shared/assets/img/qr.js +1 -1
  66. package/es/shared/assets/img/qr.png.js +1 -1
  67. package/es/shared/assets/img/success.js +1 -1
  68. package/es/shared/assets/img/success.png.js +1 -1
  69. package/es/shared/assets/img/video.js +1 -1
  70. package/es/shared/assets/img/video.png.js +1 -1
  71. package/es/shared/assets/img/video_default_cover.js +1 -1
  72. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  73. package/es/shared/assets/img/video_hover.js +1 -1
  74. package/es/shared/assets/img/video_play_hover.js +1 -1
  75. package/es/shared/assets/img/xb_big.js +1 -1
  76. package/es/shared/assets/img/xb_big.png.js +1 -1
  77. package/es/shared/assets/img/xb_small.js +1 -1
  78. package/es/shared/assets/img/xb_small.png.js +1 -1
  79. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  80. package/es/shared/utils/tapable/index.d.ts +139 -0
  81. package/package.json +2 -2
package/README.md CHANGED
@@ -1,123 +1,123 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式 1(按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式 2(全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3. 注意
65
-
66
- 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
-
68
- ```typescript
69
- // main.ts
70
- import { createApp } from 'vue';
71
- import App from './App.vue';
72
-
73
- import { CGrid } from 'cnhis-design-vue';
74
- // 或者
75
- import { CBigTable } from 'cnhis-design-vue';
76
-
77
- const app = createApp(App);
78
- app.use(CGrid);
79
- // 或者
80
- app.use(CBigTable);
81
- app.mount('#app');
82
- ```
83
-
84
- ## 4.FAQ
85
-
86
- ### 4.1 项目打包后样式丢失
87
-
88
- > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
-
90
- ```typescript
91
- // vite.config.ts
92
- import { defineConfig } from 'vite';
93
-
94
- export default defineConfig({
95
- rollupOptions: {
96
- // ..otherOptions
97
- output: {
98
- dir: './dist',
99
- manualChunks(id: string) {
100
- if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
- return 'vendor';
102
- }
103
- }
104
- }
105
- }
106
- });
107
- ```
108
-
109
- ### 4.2 找不到文件
110
-
111
- > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
-
113
- ```javascript
114
- // vite.config.ts
115
- const config = {
116
- // ...otherOptions
117
- resolve: {
118
- // ...otherOptions
119
- // 如果没有配置, 则不用考虑
120
- extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
- }
122
- };
123
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式 1(按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式 2(全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3. 注意
65
+
66
+ 由于 vxe-table 目前的引入方式是由组件 install 触发的,所以如果需要使用 c-grid/c-big-table 组件,需要全局注册二者任意一个
67
+
68
+ ```typescript
69
+ // main.ts
70
+ import { createApp } from 'vue';
71
+ import App from './App.vue';
72
+
73
+ import { CGrid } from 'cnhis-design-vue';
74
+ // 或者
75
+ import { CBigTable } from 'cnhis-design-vue';
76
+
77
+ const app = createApp(App);
78
+ app.use(CGrid);
79
+ // 或者
80
+ app.use(CBigTable);
81
+ app.mount('#app');
82
+ ```
83
+
84
+ ## 4.FAQ
85
+
86
+ ### 4.1 项目打包后样式丢失
87
+
88
+ > 处理方法, 将 cnhis-design-vue 从 vendor 包中移除
89
+
90
+ ```typescript
91
+ // vite.config.ts
92
+ import { defineConfig } from 'vite';
93
+
94
+ export default defineConfig({
95
+ rollupOptions: {
96
+ // ..otherOptions
97
+ output: {
98
+ dir: './dist',
99
+ manualChunks(id: string) {
100
+ if (id.includes('node_modules') && !id.includes('cnhis-design-vue')) {
101
+ return 'vendor';
102
+ }
103
+ }
104
+ }
105
+ }
106
+ });
107
+ ```
108
+
109
+ ### 4.2 找不到文件
110
+
111
+ > 由于组件库输出文件类型由 js 修改成了 mjs, 如果配置了 resolve 属性的项目, 需要将 mjs 文件类型添加至 extensions 中
112
+
113
+ ```javascript
114
+ // vite.config.ts
115
+ const config = {
116
+ // ...otherOptions
117
+ resolve: {
118
+ // ...otherOptions
119
+ // 如果没有配置, 则不用考虑
120
+ extensions: ['.js', '.ts', '.vue', '.json', '.mjs']
121
+ }
122
+ };
123
+ ```
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/Viewer';
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/features/modeling';
@@ -0,0 +1 @@
1
+ declare module 'diagram-js/lib/navigation/movecanvas';
@@ -64,6 +64,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
64
64
  type: StringConstructor;
65
65
  default: string;
66
66
  };
67
+ directPrint: {
68
+ type: BooleanConstructor;
69
+ default: boolean;
70
+ };
67
71
  }, {
68
72
  $message: import("naive-ui").MessageApi;
69
73
  printInstance: import("./src/utils").Print | null;
@@ -130,6 +134,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
130
134
  type: StringConstructor;
131
135
  default: string;
132
136
  };
137
+ directPrint: {
138
+ type: BooleanConstructor;
139
+ default: boolean;
140
+ };
133
141
  }>> & {
134
142
  onError?: ((...args: any[]) => any) | undefined;
135
143
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -154,6 +162,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
154
162
  currentFormatItem: import("vue").ComputedRef<{} | undefined>;
155
163
  formatTitle: import("vue").ComputedRef<any>;
156
164
  getTemplateIdByFormatId: import("vue").ComputedRef<any>;
165
+ buttonClick: (origin: string) => Promise<false | undefined>;
157
166
  renderLabel: (option: import("naive-ui").MenuOption) => JSX.Element;
158
167
  callLocalServicesSuccessCb: (res: any, type: any) => void;
159
168
  callLocalServicesErrorCb: (res: unknown) => void;
@@ -179,9 +188,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
179
188
  }, params?: any[]) => any;
180
189
  initCRM: (formatListResult: any) => Promise<boolean | undefined>;
181
190
  init: () => Promise<boolean>;
182
- handleClickBtn: () => Promise<false | undefined>;
191
+ handleClickBtn: (visible?: boolean) => Promise<false | undefined>;
183
192
  reformatPrintParams: () => void;
184
193
  verifiySuccess: (token: string) => void;
194
+ directPrint: () => Promise<void>;
185
195
  NDropdown: any;
186
196
  NButton: any;
187
197
  NIcon: any;
@@ -1878,6 +1888,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1878
1888
  type: StringConstructor;
1879
1889
  default: string;
1880
1890
  };
1891
+ directPrint: {
1892
+ type: BooleanConstructor;
1893
+ default: boolean;
1894
+ };
1881
1895
  }>> & {
1882
1896
  onError?: ((...args: any[]) => any) | undefined;
1883
1897
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -1897,5 +1911,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1897
1911
  noDataMsg: string;
1898
1912
  printdlgshow: string;
1899
1913
  btnprint: string;
1914
+ directPrint: boolean;
1900
1915
  }>>;
1901
1916
  export default ButtonPrint;
@@ -69,6 +69,10 @@ declare const _default: import("vue").DefineComponent<{
69
69
  type: StringConstructor;
70
70
  default: string;
71
71
  };
72
+ directPrint: {
73
+ type: BooleanConstructor;
74
+ default: boolean;
75
+ };
72
76
  }, {
73
77
  $message: import("naive-ui").MessageApi;
74
78
  printInstance: Print | null;
@@ -138,6 +142,10 @@ declare const _default: import("vue").DefineComponent<{
138
142
  type: StringConstructor;
139
143
  default: string;
140
144
  };
145
+ directPrint: {
146
+ type: BooleanConstructor;
147
+ default: boolean;
148
+ };
141
149
  }>> & {
142
150
  onError?: ((...args: any[]) => any) | undefined;
143
151
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -162,6 +170,7 @@ declare const _default: import("vue").DefineComponent<{
162
170
  currentFormatItem: import("vue").ComputedRef<{} | undefined>;
163
171
  formatTitle: import("vue").ComputedRef<any>;
164
172
  getTemplateIdByFormatId: import("vue").ComputedRef<any>;
173
+ buttonClick: (origin: string) => Promise<false | undefined>;
165
174
  renderLabel: (option: DropdownOption) => JSX.Element;
166
175
  callLocalServicesSuccessCb: (res: any, type: any) => void;
167
176
  callLocalServicesErrorCb: (res: unknown) => void;
@@ -187,9 +196,10 @@ declare const _default: import("vue").DefineComponent<{
187
196
  }, params?: any[]) => any;
188
197
  initCRM: (formatListResult: any) => Promise<boolean | undefined>;
189
198
  init: () => Promise<boolean>;
190
- handleClickBtn: () => Promise<false | undefined>;
199
+ handleClickBtn: (visible?: boolean) => Promise<false | undefined>;
191
200
  reformatPrintParams: () => void;
192
201
  verifiySuccess: (token: string) => void;
202
+ directPrint: () => Promise<void>;
193
203
  NDropdown: any;
194
204
  NButton: any;
195
205
  NIcon: any;
@@ -1889,6 +1899,10 @@ declare const _default: import("vue").DefineComponent<{
1889
1899
  type: StringConstructor;
1890
1900
  default: string;
1891
1901
  };
1902
+ directPrint: {
1903
+ type: BooleanConstructor;
1904
+ default: boolean;
1905
+ };
1892
1906
  }>> & {
1893
1907
  onError?: ((...args: any[]) => any) | undefined;
1894
1908
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -1908,5 +1922,6 @@ declare const _default: import("vue").DefineComponent<{
1908
1922
  noDataMsg: string;
1909
1923
  printdlgshow: string;
1910
1924
  btnprint: string;
1925
+ directPrint: boolean;
1911
1926
  }>;
1912
1927
  export default _default;
@@ -71,10 +71,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
71
71
  btnprint: {
72
72
  type: String,
73
73
  default: "1"
74
+ },
75
+ directPrint: {
76
+ type: Boolean,
77
+ default: false
74
78
  }
75
79
  },
76
80
  emits: ["success", "error", "clickoutside"],
77
81
  setup(__props, {
82
+ expose,
78
83
  emit
79
84
  }) {
80
85
  const props = __props;
@@ -118,6 +123,19 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
118
123
  let find = state.formatList.find((item) => item.id === state.currentFormatId);
119
124
  return find == null ? void 0 : find.templateId;
120
125
  });
126
+ const buttonClick = async (origin) => {
127
+ if (props.directPrint) {
128
+ if (state.spinning)
129
+ return;
130
+ if (origin === "button") {
131
+ await directPrint();
132
+ return;
133
+ } else {
134
+ return handleClickBtn();
135
+ }
136
+ }
137
+ return handleClickBtn();
138
+ };
121
139
  const renderLabel = (option) => {
122
140
  return createVNode("span", {
123
141
  "class": {
@@ -402,7 +420,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
402
420
  state.spinning = false;
403
421
  return true;
404
422
  };
405
- const handleClickBtn = async () => {
423
+ const handleClickBtn = async (visible = true) => {
406
424
  var _a;
407
425
  const status = await props.clickPrevFn();
408
426
  if (!status)
@@ -416,7 +434,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
416
434
  if (!result)
417
435
  return false;
418
436
  }
419
- state.visible = !state.visible;
437
+ if (visible) {
438
+ state.visible = !state.visible;
439
+ }
420
440
  };
421
441
  const reformatPrintParams = () => {
422
442
  state.watchPrintParamsReformatFn && state.watchPrintParamsReformatFn();
@@ -457,6 +477,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
457
477
  }, {
458
478
  deep: true
459
479
  });
480
+ async function directPrint() {
481
+ await handleClickBtn(false);
482
+ handleClickPrint();
483
+ }
484
+ expose({
485
+ directPrint
486
+ });
460
487
  return (_ctx, _cache) => {
461
488
  return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(NDropdown), {
462
489
  class: "c-dropdown",
@@ -475,17 +502,21 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
475
502
  printVisible: state.visible
476
503
  }, () => [createVNode(unref(NButton), {
477
504
  class: "dropdown-button",
478
- onClick: withModifiers(handleClickBtn, ["stop"])
505
+ onClick: _cache[1] || (_cache[1] = withModifiers(() => buttonClick("button"), ["stop"]))
479
506
  }, {
480
507
  default: withCtx(() => [createCommentVNode(' <n-spin v-show="state.spinning" size="small"></n-spin> '), createTextVNode(toDisplayString(__props.btnText) + " ", 1), createVNode(unref(NIcon), {
481
- component: unref(ChevronDown)
508
+ component: unref(ChevronDown),
509
+ style: {
510
+ "margin-left": "5px"
511
+ },
512
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => buttonClick("icon"), ["stop"]))
482
513
  }, null, 8, ["component"])]),
483
514
  _: 1
484
- }, 8, ["onClick"])])]),
515
+ })])]),
485
516
  _: 3
486
517
  }, 8, ["show", "options"]), createVNode(IdentityVerification, mergeProps(_ctx.$attrs, {
487
518
  modelValue: state.identityVerification.visible,
488
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.identityVerification.visible = $event),
519
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => state.identityVerification.visible = $event),
489
520
  formatId: state.currentFormatId,
490
521
  templateId: unref(getTemplateIdByFormatId),
491
522
  onSuccess: verifiySuccess
@@ -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) => {