cnhis-design-vue 3.1.53-beta.1 → 3.1.53-beta.3

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 (149) hide show
  1. package/README.md +87 -87
  2. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  3. package/es/components/big-table/src/components/edit-form/edit-separate.vue.d.ts +4 -4
  4. package/es/components/big-table/src/hooks/useEdit.d.ts +4 -4
  5. package/es/components/big-table/src/hooks/useSeparateRow.d.ts +4 -4
  6. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  7. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  8. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  9. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  10. package/es/components/button-print/src/utils/dialog.d.ts +2 -2
  11. package/es/components/button-print/src/utils/print.d.ts +14 -13
  12. package/es/components/button-print/src/utils/print.js +1 -1
  13. package/es/components/callback/src/components/render/popupMaps.d.ts +69 -6
  14. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  15. package/es/components/card-reader-sdk/src/types/index.d.ts +3 -3
  16. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  17. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  18. package/es/components/form-config/index.d.ts +98 -26
  19. package/es/components/form-config/src/FormConfig.vue.d.ts +99 -27
  20. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  21. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +30 -6
  22. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +48 -12
  23. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  24. package/es/components/form-render/index.d.ts +30 -6
  25. package/es/components/form-render/index.js +1 -1
  26. package/es/components/form-render/src/FormRender.vue.d.ts +31 -7
  27. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  28. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +31 -7
  29. package/es/components/form-render/src/components/renderer/combination.js +1 -1
  30. package/es/components/form-render/src/components/renderer/inputNumber.d.ts +5 -5
  31. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.d.ts +2 -4
  32. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  33. package/es/components/form-render/src/components/renderer/searchCascade.d.ts +3 -3
  34. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  35. package/es/components/form-render/src/components/renderer/select.d.ts +4 -4
  36. package/es/components/form-render/src/components/renderer/select.js +1 -1
  37. package/es/components/form-render/src/constants/index.d.ts +3 -2
  38. package/es/components/form-render/src/hooks/index.d.ts +0 -2
  39. package/es/components/form-render/src/hooks/index.js +1 -1
  40. package/es/components/form-render/src/hooks/useAnchor.d.ts +3 -3
  41. package/es/components/form-render/src/hooks/useCommonInjection.d.ts +2 -2
  42. package/es/components/form-render/src/hooks/useFieldListAdaptor.d.ts +2 -2
  43. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  44. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +10 -2
  45. package/es/components/form-render/src/hooks/useFormContext.d.ts +3 -3
  46. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  47. package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +3 -3
  48. package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +9 -1
  49. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +5 -5
  50. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  51. package/es/components/form-render/src/types/fieldItem.d.ts +3 -2
  52. package/es/components/form-render/src/types/index.d.ts +7 -14
  53. package/es/components/form-render/src/utils/index.d.ts +1 -2
  54. package/es/components/form-render/src/utils/index.js +1 -1
  55. package/es/components/form-render/src/utils/schema.d.ts +2 -2
  56. package/es/components/form-render/src/utils/schema.js +1 -1
  57. package/es/components/guide/src/renderer.js +1 -1
  58. package/es/components/iho-table/index.d.ts +39 -0
  59. package/es/components/iho-table/src/IhoTable.vue.d.ts +40 -0
  60. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  61. package/es/components/iho-table/src/constants/index.d.ts +4 -1
  62. package/es/components/iho-table/src/constants/index.js +1 -1
  63. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +2 -2
  64. package/es/components/iho-table/src/hooks/tapHooks/useExposeHooks.d.ts +2 -2
  65. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -1
  66. package/es/components/iho-table/src/plugins/index.js +1 -1
  67. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +2 -2
  68. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
  69. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.d.ts +1 -0
  70. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +1 -0
  71. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +552 -0
  72. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.js +1 -0
  73. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -0
  74. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +4 -1
  75. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  76. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  77. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +2 -2
  78. package/es/components/iho-table/src/types/index.d.ts +5 -2
  79. package/es/components/iho-table/src/types/pluginType.d.ts +3 -3
  80. package/es/components/index.d.ts +1 -0
  81. package/es/components/index.js +1 -1
  82. package/es/components/info-header/index.d.ts +97 -29
  83. package/es/components/info-header/src/InfoHeader.vue.d.ts +98 -30
  84. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +9 -5
  85. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +10 -6
  86. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +41 -13
  87. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +30 -6
  88. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  89. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  90. package/es/components/search-cascader/index.d.ts +23 -3
  91. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +24 -4
  92. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  93. package/es/components/search-cascader/src/components/ClearIcon.vue.js +1 -0
  94. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  95. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  96. package/es/components/shortcut-setter/index.d.ts +33 -9
  97. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +34 -10
  98. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  99. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
  100. package/es/components/time-picker/src/TimePicker.vue2.js +1 -1
  101. package/es/env.d.ts +25 -25
  102. package/es/shared/assets/img/failure.png.js +1 -1
  103. package/es/shared/assets/img/no-permission.png.js +1 -1
  104. package/es/shared/assets/img/nodata.png.js +1 -1
  105. package/es/shared/assets/img/notfound.png.js +1 -1
  106. package/es/shared/assets/img/qr.png.js +1 -1
  107. package/es/shared/assets/img/success.png.js +1 -1
  108. package/es/shared/assets/img/video.png.js +1 -1
  109. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  110. package/es/shared/assets/img/xb_big.png.js +1 -1
  111. package/es/shared/assets/img/xb_small.png.js +1 -1
  112. package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +4 -4
  113. package/es/shared/components/SlotRender/SlotRender.d.ts +5 -5
  114. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  115. package/es/shared/hooks/index.d.ts +3 -0
  116. package/es/shared/hooks/index.js +1 -1
  117. package/es/shared/hooks/selectHooks/index.d.ts +4 -0
  118. package/es/shared/hooks/selectHooks/index.js +1 -0
  119. package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +10 -0
  120. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -0
  121. package/es/shared/hooks/selectHooks/useSearchContent.d.ts +6 -0
  122. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -0
  123. package/es/shared/hooks/selectHooks/useSelectAllowModify.d.ts +23 -0
  124. package/es/shared/hooks/selectHooks/useSelectAllowModify.js +1 -0
  125. package/es/shared/hooks/selectHooks/useSelectRenders.d.ts +19 -0
  126. package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -0
  127. package/es/shared/hooks/{useAsyncQueue.d.ts → useAsyncQueue/index.d.ts} +7 -15
  128. package/es/shared/hooks/useAsyncQueue/index.js +1 -0
  129. package/es/shared/hooks/useAsyncQueue/types.d.ts +20 -0
  130. package/es/shared/hooks/useAsyncQueue/types.js +1 -0
  131. package/es/shared/hooks/useDateTime.d.ts +2 -2
  132. package/es/shared/hooks/useFormRequest/index.d.ts +24 -0
  133. package/es/shared/hooks/useFormRequest/index.js +1 -0
  134. package/es/shared/hooks/useFormRequest/types.d.ts +39 -0
  135. package/es/shared/hooks/useFormRequest/types.js +1 -0
  136. package/es/shared/hooks/useLevelSearchCascader.d.ts +31 -0
  137. package/es/shared/hooks/useLevelSearchCascader.js +1 -0
  138. package/es/shared/package.json.js +1 -1
  139. package/es/shared/types/index.d.ts +1 -1
  140. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  141. package/es/shared/utils/tapable/index.d.ts +139 -0
  142. package/package.json +2 -2
  143. package/es/components/form-render/src/components/renderer/levelSearchCascader/utils.d.ts +0 -23
  144. package/es/components/form-render/src/components/renderer/levelSearchCascader/utils.js +0 -1
  145. package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +0 -16
  146. package/es/components/form-render/src/hooks/useFormAsyncQueue.js +0 -1
  147. package/es/components/form-render/src/hooks/useFormRequest.d.ts +0 -26
  148. package/es/components/form-render/src/hooks/useFormRequest.js +0 -1
  149. package/es/shared/hooks/useAsyncQueue.js +0 -1
package/README.md CHANGED
@@ -1,87 +1,87 @@
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.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
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.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,ref as a,onDeactivated as t,createVNode as l,unref as u,createTextVNode as n}from"vue";import{useTheme as i}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as r,isObject as s,isFunction as m}from"lodash-es";import{FileTrayFull as d,FileTray as v}from"@vicons/ionicons5";import{NPopover as c,NDivider as p,NEllipsis as f,NIcon as V,NInput as h}from"naive-ui";var g=e({props:{modelValue:{type:[String,Object],default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const w=i(),x=o({get:()=>r(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let a=o;s(e.modelValue)&&(a={...e.modelValue,content:o}),g("update:modelValue",a)}}),T=a(!1),k=o({get:()=>T.value,async set(e){T.value=e,!e&&b.value&&(await new Promise((e=>setTimeout(e,200))),b.value=!1)}}),b=a(!1);let y,_;function P(e){e.stopPropagation(),clearTimeout(y),k.value&&b.value?k.value=!1:u(x)||(y=setTimeout((()=>{b.value=k.value=!0}),200))}function M(e){e.stopPropagation(),clearTimeout(y),u(x)&&(k.value=!0,b.value=!0)}function R(e){e.stopPropagation(),clearTimeout(_),u(x)&&(k.value=!0)}function j(e){e.stopPropagation(),clearTimeout(_),u(x)&&!b.value&&(_=setTimeout((()=>{k.value=!1}),300))}return t((()=>{k.value=!1})),function(){return l("section",{class:["annotation-edit",{"is-active":!!u(x)}],style:{"--icon-right":"-5",...w.value},"annotation-hover-show":!u(x)&&!b.value},[l(c,{"keep-alive-on-hover":!0,style:{maxWidth:"360px",wordBreak:"break-all"},show:k.value,"onUpdate:show":e=>k.value=e,trigger:"manual",duration:100,onClickoutside:P},{default:function(){return l("section",{onMouseleave:j,onMouseenter:R},[l("div",null,[b.value?l(h,{resizable:!1,autosize:{minRows:3,maxRows:5},"show-count":!0,class:"annotation-edit__textarea",type:"textarea",value:x.value,"onUpdate:value":e=>x.value=e},null):l("span",null,[u(x)])]),s(e.modelValue)?[l(p,{style:{margin:"4px 0",minWidth:"360px"}},null),l("section",{class:"annotation-edit__footer"},[m(e.modelValue.footerRender)?e.modelValue.footerRender(e.modelValue):[l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.authorLabel)?o:"质控人",n(": "),e.modelValue.author]}}),l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.dateLabel)?o:"质控时间",n(": "),e.modelValue.date]}})]])]:null])},trigger:function(){return l("div",{class:"annotation-edit__icon",onMouseleave:j,onMouseenter:R,onDblclick:M,onClick:P},[l(V,{component:u(x)?d:v},null)])}})])}}});export{g as default};
1
+ import{defineComponent as e,computed as o,ref as t,onDeactivated as a,createVNode as l,unref as u,createTextVNode as n}from"vue";import{useTheme as i}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as r,isObject as s,isFunction as m}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import{FileTrayFull as d,FileTray as v}from"@vicons/ionicons5";import{NPopover as c,NDivider as p,NEllipsis as f,NIcon as h,NInput as V}from"naive-ui";var g=e({props:{modelValue:{type:[String,Object],default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const k=i(),w=o({get:()=>r(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let t=o;s(e.modelValue)&&(t={...e.modelValue,content:o}),g("update:modelValue",t)}}),x=t(!1),T=o({get:()=>x.value,async set(e){x.value=e,!e&&b.value&&(await new Promise((e=>setTimeout(e,200))),b.value=!1)}}),b=t(!1);let y,_;function P(e){e.stopPropagation(),clearTimeout(y),T.value&&b.value?T.value=!1:u(w)||(y=setTimeout((()=>{b.value=T.value=!0}),200))}function j(e){e.stopPropagation(),clearTimeout(y),u(w)&&(T.value=!0,b.value=!0)}function M(e){e.stopPropagation(),clearTimeout(_),u(w)&&(T.value=!0)}function R(e){e.stopPropagation(),clearTimeout(_),u(w)&&!b.value&&(_=setTimeout((()=>{T.value=!1}),300))}return a((()=>{T.value=!1})),function(){return l("section",{class:["annotation-edit",{"is-active":!!u(w)}],style:{"--icon-right":"-5",...k.value},"annotation-hover-show":!u(w)&&!b.value},[l(c,{"keep-alive-on-hover":!0,style:{maxWidth:"360px",wordBreak:"break-all"},show:T.value,"onUpdate:show":e=>T.value=e,trigger:"manual",duration:100,onClickoutside:P},{default:function(){return l("section",{onMouseleave:R,onMouseenter:M},[l("div",null,[b.value?l(V,{resizable:!1,autosize:{minRows:3,maxRows:5},"show-count":!0,class:"annotation-edit__textarea",type:"textarea",value:w.value,"onUpdate:value":e=>w.value=e},null):l("span",null,[u(w)])]),s(e.modelValue)?[l(p,{style:{margin:"4px 0",minWidth:"360px"}},null),l("section",{class:"annotation-edit__footer"},[m(e.modelValue.footerRender)?e.modelValue.footerRender(e.modelValue):[l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.authorLabel)?o:"质控人",n(": "),e.modelValue.author]}}),l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.dateLabel)?o:"质控时间",n(": "),e.modelValue.date]}})]])]:null])},trigger:function(){return l("div",{class:"annotation-edit__icon",onMouseleave:R,onMouseenter:M,onDblclick:j,onClick:P},[l(h,{component:u(w)?d:v},null)])}})])}}});export{g as default};
@@ -60,19 +60,19 @@ declare const _default: import("vue").DefineComponent<{
60
60
  style: CSSProperties;
61
61
  SlotRender: import("vue").DefineComponent<{
62
62
  renderer: {
63
- type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/shared/types").Func<any[], any>>;
63
+ type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/shared/types").AnyFn<any[], any>>;
64
64
  required: true;
65
65
  };
66
66
  rootSlots: {
67
- type: PropType<Record<string, import("../../../../../../es/shared/types").Func<any[], any>>>;
67
+ type: PropType<Record<string, import("../../../../../../es/shared/types").AnyFn<any[], any>>>;
68
68
  };
69
69
  }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
70
70
  renderer: {
71
- type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/shared/types").Func<any[], any>>;
71
+ type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../es/shared/types").AnyFn<any[], any>>;
72
72
  required: true;
73
73
  };
74
74
  rootSlots: {
75
- type: PropType<Record<string, import("../../../../../../es/shared/types").Func<any[], any>>>;
75
+ type: PropType<Record<string, import("../../../../../../es/shared/types").AnyFn<any[], any>>>;
76
76
  };
77
77
  }>>, {}>;
78
78
  NPopover: any;
@@ -252,19 +252,19 @@ export declare const comps: {
252
252
  style: import("vue").CSSProperties;
253
253
  SlotRender: import("vue").DefineComponent<{
254
254
  renderer: {
255
- type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../..").Func<any[], any>>;
255
+ type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../..").AnyFn<any[], any>>;
256
256
  required: true;
257
257
  };
258
258
  rootSlots: {
259
- type: import("vue").PropType<Record<string, import("../../..").Func<any[], any>>>;
259
+ type: import("vue").PropType<Record<string, import("../../..").AnyFn<any[], any>>>;
260
260
  };
261
261
  }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
262
262
  renderer: {
263
- type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../..").Func<any[], any>>;
263
+ type: import("vue").PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../..").AnyFn<any[], any>>;
264
264
  required: true;
265
265
  };
266
266
  rootSlots: {
267
- type: import("vue").PropType<Record<string, import("../../..").Func<any[], any>>>;
267
+ type: import("vue").PropType<Record<string, import("../../..").AnyFn<any[], any>>>;
268
268
  };
269
269
  }>>, {}>;
270
270
  NPopover: any;
@@ -1,11 +1,11 @@
1
- import { AnyObject, Func } from '../../../../../es/shared/types';
1
+ import { AnyObject, AnyFn } from '../../../../../es/shared/types';
2
2
  import { Ref } from 'vue';
3
3
  import { VxeTableEvents, VxeTableInstance } from 'vxe-table';
4
4
  import { VxeTablePropTypes } from 'vxe-table/types/table';
5
5
  export declare class SeparateHandle {
6
- callbacks: Set<Func<any[], any>>;
7
- add(cb: Func): void;
8
- remove(cb: Func): void;
6
+ callbacks: Set<AnyFn<any[], any>>;
7
+ add(cb: AnyFn): void;
8
+ remove(cb: AnyFn): void;
9
9
  clear(): void;
10
10
  trigger(): void;
11
11
  }
@@ -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';
@@ -1,9 +1,9 @@
1
- import { Func } from '../../../../../es/shared/types';
1
+ import { AnyFn } from '../../../../../es/shared/types';
2
2
  import { ComponentInternalInstance } from 'vue';
3
3
  export declare class IdentityVerificationDialog {
4
4
  rendered: boolean;
5
5
  static createMsg(message: string): string;
6
- show(instance: ComponentInternalInstance, title: string, api: Func, formatId?: string, templateId?: string): Promise<string>;
6
+ show(instance: ComponentInternalInstance, title: string, api: AnyFn, formatId?: string, templateId?: string): Promise<string>;
7
7
  }
8
8
  export declare class PreviewDialog {
9
9
  rendered: boolean;
@@ -1,4 +1,4 @@
1
- import { AnyObject, Func } from '../../../../../es/shared/types';
1
+ import { AnyObject, AnyFn } from '../../../../../es/shared/types';
2
2
  import { IdentityVerificationDialog, PreviewDialog } from '../../../../../es/components/button-print/src/utils/dialog';
3
3
  export declare class Print {
4
4
  private readonly webview;
@@ -26,15 +26,15 @@ export declare class Print {
26
26
  _queryServicesPrint(params: AnyObject): Promise<any>;
27
27
  _callPrintWithFile(queryParams: AnyObject): Promise<any>;
28
28
  _handleMonitorNotify(message: string | unknown): void;
29
- _handleResult(data: AnyObject, errorCallbackFn?: Func): false | AnyObject;
30
- _handleResultTest(result: unknown, errorCallbackFn?: Func): boolean;
31
- _handleEventQueryPrintData(templateId: string, formatId: string, params: AnyObject, messageTimeout: number, errorCallbackFn?: Func): Promise<false | {
29
+ _handleResult(data: AnyObject, errorCallbackFn?: AnyFn): false | AnyObject;
30
+ _handleResultTest(result: unknown, errorCallbackFn?: AnyFn): boolean;
31
+ _handleEventQueryPrintData(templateId: string, formatId: string, params: AnyObject, messageTimeout: number, errorCallbackFn?: AnyFn): Promise<false | {
32
32
  file: any;
33
33
  printerName: any;
34
34
  pageCount: any;
35
35
  formatId: string;
36
36
  }>;
37
- _handleQueryPrintDataResult(printData: AnyObject, formatId: string, errorCallbackFn?: Func): false | {
37
+ _handleQueryPrintDataResult(printData: AnyObject, formatId: string, errorCallbackFn?: AnyFn): false | {
38
38
  file: any;
39
39
  printerName: any;
40
40
  pageCount: any;
@@ -45,21 +45,22 @@ export declare class Print {
45
45
  _queryProxyOrigin(): Promise<void>;
46
46
  _queryPrintFile(formatId: string, params?: string): Promise<any>;
47
47
  _browserPrint(result: AnyObject, mode: string): Promise<string | void>;
48
- preview({ templateId, formatId, params, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<any>;
49
- printDirect({ templateId, formatId, params, print, signature, printdlgshow, nobillnode, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
48
+ preview({ templateId, formatId, params, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<any>;
49
+ printSync(data: AnyObject[], successCallbackFn: AnyFn, errorCallbackFn: AnyFn): Promise<void>;
50
+ printDirect({ templateId, formatId, params, print, signature, printdlgshow, nobillnode, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, mode?: string): Promise<any>;
50
51
  private _downloadPDF;
51
52
  /**
52
53
  * 下载pdf
53
54
  */
54
- downloadPDF(params: AnyObject, onResolve: Func, onReject: Func): void;
55
- print({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
56
- queryPrintData({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | {
55
+ downloadPDF(params: AnyObject, onResolve: AnyFn, onReject: AnyFn): void;
56
+ print({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | undefined>;
57
+ queryPrintData({ templateId, formatId, params, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | {
57
58
  file: any;
58
59
  printerName: any;
59
60
  pageCount: any;
60
61
  formatId: string;
61
62
  }>;
62
- printFileData({ formatId, file, printerName }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | AnyObject>;
63
- editPrintFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
64
- addPrintFormat({ templateId, params, token }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<false | undefined>;
63
+ printFileData({ formatId, file, printerName }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | AnyObject>;
64
+ editPrintFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | undefined>;
65
+ addPrintFormat({ templateId, params, token }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<false | undefined>;
65
66
  }
@@ -1 +1 @@
1
- import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as n,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as d}from"date-fns";const h=t.create({timeout:1e3,withCredentials:!1}),m=`${window.location.protocol}//${window.location.host}`,u=`${m}/fdp-api/print/assembly/printIReport`,c=`${m}/bi-api/reprot/print/open/client/getRemote`,p=`${m}/printService/file`;let w=null;class f{constructor(){var t,e,n;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],w)return w;w=this;const r=window;this.CMonitor=r.$CMonitor;try{this.webview=r.top?null==(t=r.top.chrome)?void 0:t.webview:null==(e=r.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(n=r.chrome)?void 0:n.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:n}=e;try{s(i.res||"")}catch(t){n(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{h({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const s={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(s),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,n){const r={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(r);return this._handleQueryPrintDataResult(a,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:s,print:n,signature:r,printdlgshow:a="0",nobillnode:o="1",btnprint:l="1",messageTimeout:h=0}){const m={templateId:t,formatId:e,params:i,cmdid:s,nobillnode:o,printdlgshow:a,btnprint:l,messageTimeout:h,...r?{signature:r}:{}};if(n){try{n=JSON.parse(n)}catch(t){}m.print=n}else if(this.isRemote){const t=d(new Date,"yyyyMMddHHmmss");m.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(m)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:n=0}){const r={};let a={};try{a=Object.assign({},r,JSON.parse(i))}catch(t){a=r}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:n};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:c})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=m+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await n(`${p}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",signature:s,btnprint:n,messageTimeout:l=0},d,h){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==h?void 0:h("获取文件失败!");const s=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,s),void(null==d||d({file:t}))}await this._queryProxyOrigin();const m=await this._testConnection();if(!this._handleResultTest(m,h))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",signature:s,btnprint:n,messageTimeout:l}),a=this._handleResult(r,h);if(!a)return!1;if(this.isRemote){const t=await this._browserPrint(a,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}null==d||d(a)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==h||h(i),this._handleMonitorNotify(i)}}async printDirect({templateId:t,formatId:e,params:i="",print:s,signature:n,printdlgshow:o,nobillnode:l,isDownloadFile:d=!0,messageTimeout:h=0},m,u,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==m||m({file:t}))):null==u?void 0:u("获取文件失败!")}await this._queryProxyOrigin();const p=await this._testConnection();if(!this._handleResultTest(p,u))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:s,signature:n,printdlgshow:o,nobillnode:l,messageTimeout:h}),a=this._handleResult(r,u);if(!a)return!1;d&&["downloadPDF"].includes(c)&&await this._browserPrint(a,c),null==m||m(a)}catch(t){const e="printDirect"===c?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==u||u(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=d(new Date,"yyyy-MM-dd"),i=l(),s=d(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}this.printDirect(t,(async n=>{if(n||s(null),a(t.formatId))return i(n);const r=this,o=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(n.filedir);i(o,n)}),(t=>s(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,r);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,r);if(!l)return!1;n&&n(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,r);return!!o&&(n&&n(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,n);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n=0},r,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n}),d=this._handleResult(l,a);if(!d)return!1;r&&r(d)}async addPrintFormat({templateId:t,params:e,token:i},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,n);if(!o)return!1;s&&s(o)}}export{f as Print};
1
+ import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as n,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as d}from"date-fns";const h=t.create({timeout:1e3,withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,u=`${c}/fdp-api/print/assembly/printIReport`,m=`${c}/bi-api/reprot/print/open/client/getRemote`,p=`${c}/printService/file`;let w=null;class f{constructor(){var t,e,n;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],w)return w;w=this;const r=window;this.CMonitor=r.$CMonitor;try{this.webview=r.top?null==(t=r.top.chrome)?void 0:t.webview:null==(e=r.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(n=r.chrome)?void 0:n.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:n}=e;try{s(i.res||"")}catch(t){n(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{h({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const s={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(s),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,n){const r={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(r);return this._handleQueryPrintDataResult(a,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:s,print:n,signature:r,printdlgshow:a="0",nobillnode:o="1",btnprint:l="1",messageTimeout:h=0}){const c={templateId:t,formatId:e,params:i,cmdid:s,nobillnode:o,printdlgshow:a,btnprint:l,messageTimeout:h,...r?{signature:r}:{}};if(n){try{n=JSON.parse(n)}catch(t){}c.print=n}else if(this.isRemote){const t=d(new Date,"yyyyMMddHHmmss");c.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(c)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:n=0}){const r={};let a={};try{a=Object.assign({},r,JSON.parse(i))}catch(t){a=r}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:n};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:m})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=c+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await n(`${p}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",signature:s,btnprint:n,messageTimeout:l=0},d,h){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==h?void 0:h("获取文件失败!");const s=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,s),void(null==d||d({file:t}))}await this._queryProxyOrigin();const c=await this._testConnection();if(!this._handleResultTest(c,h))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",signature:s,btnprint:n,messageTimeout:l}),a=this._handleResult(r,h);if(!a)return!1;if(this.isRemote){const t=await this._browserPrint(a,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}null==d||d(a)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==h||h(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){const s=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=l(),n=await this.messageCollect(t,{exec:"printA",data:s});if(n&&Array.isArray(n)){n.some((t=>"success"===t.res.result))?null==e||e(n):(null==i||i(n),this._handleMonitorNotify(n))}else{const t="打印命令返回无效数据";this._handleMonitorNotify(n||""),null==i||i({type:"printError",message:t,result:!1,errinfo:t})}}catch(t){const e={error:t,message:"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({templateId:t,formatId:e,params:i="",print:s,signature:n,printdlgshow:o,nobillnode:l,isDownloadFile:d=!0,messageTimeout:h=0},c,u,m="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,m),void(null==c||c({file:t}))):null==u?void 0:u("获取文件失败!")}await this._queryProxyOrigin();const p=await this._testConnection();if(!this._handleResultTest(p,u))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:s,signature:n,printdlgshow:o,nobillnode:l,messageTimeout:h}),a=this._handleResult(r,u);if(!a)return!1;d&&["downloadPDF"].includes(m)&&await this._browserPrint(a,m),null==c||c(a)}catch(t){const e="printDirect"===m?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==u||u(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=d(new Date,"yyyy-MM-dd"),i=l(),s=d(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}this.printDirect(t,(async n=>{if(n||s(null),a(t.formatId))return i(n);const r=this,o=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(n.filedir);i(o,n)}),(t=>s(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,r);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,r);if(!l)return!1;n&&n(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,r);return!!o&&(n&&n(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,n);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n=0},r,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n}),d=this._handleResult(l,a);if(!d)return!1;r&&r(d)}async addPrintFormat({templateId:t,params:e,token:i},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,n);if(!o)return!1;s&&s(o)}}export{f as Print};
@@ -115,13 +115,17 @@ export declare const CallbackMaps: Map<string, {
115
115
  lifeCycle: {
116
116
  type: import("vue").PropType<Partial<{
117
117
  onSetup(): void;
118
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
119
+ field: import("@formily/core").GeneralField;
120
+ oldValue: unknown;
121
+ }): any;
118
122
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
119
123
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
120
124
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
121
125
  }>>;
122
126
  };
123
127
  requestInstance: {
124
- type: import("vue").PropType<import("../../../../../../es/components/form-render").RequestInstance>;
128
+ type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
125
129
  };
126
130
  enterToNextWidget: {
127
131
  type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
@@ -260,13 +264,17 @@ export declare const CallbackMaps: Map<string, {
260
264
  lifeCycle: {
261
265
  type: import("vue").PropType<Partial<{
262
266
  onSetup(): void;
267
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
268
+ field: import("@formily/core").GeneralField;
269
+ oldValue: unknown;
270
+ }): any;
263
271
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
264
272
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
265
273
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
266
274
  }>>;
267
275
  };
268
276
  requestInstance: {
269
- type: import("vue").PropType<import("../../../../../../es/components/form-render").RequestInstance>;
277
+ type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
270
278
  };
271
279
  enterToNextWidget: {
272
280
  type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
@@ -320,7 +328,7 @@ export declare const CallbackMaps: Map<string, {
320
328
  changeContextCollector: import("../../../../../../es/components/form-render").ContextCollector;
321
329
  formUUID: string;
322
330
  anchorBarRef: import("vue").Ref<{
323
- syncBarPosition: import("../../../..").Func<any[], any>;
331
+ syncBarPosition: import("../../../..").AnyFn<any[], any>;
324
332
  } | undefined>;
325
333
  currentAnchor: import("vue").WritableComputedRef<string>;
326
334
  updateAnchorList: (field: import("@formily/core").GeneralField) => void;
@@ -329,13 +337,21 @@ export declare const CallbackMaps: Map<string, {
329
337
  title: string;
330
338
  }[]>;
331
339
  onScroll: (scrollEvent: Event) => void;
332
- callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
340
+ callLifeCycle: <T extends "onSetup" | "beforeSetValue" | "beforeRequest" | "afterRequest" | "afterOptionInit">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
333
341
  onSetup(): void;
342
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
343
+ field: import("@formily/core").GeneralField;
344
+ oldValue: unknown;
345
+ }): any;
334
346
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
335
347
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
336
348
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
337
349
  }>>[T]> | undefined) => import("../../../..").UndefinedAble<ReturnType<Required<Partial<{
338
350
  onSetup(): void;
351
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
352
+ field: import("@formily/core").GeneralField;
353
+ oldValue: unknown;
354
+ }): any;
339
355
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
340
356
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
341
357
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
@@ -428,12 +444,16 @@ export declare const CallbackMaps: Map<string, {
428
444
  uuid: string;
429
445
  lifeCycle: Partial<{
430
446
  onSetup(): void;
447
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
448
+ field: import("@formily/core").GeneralField;
449
+ oldValue: unknown;
450
+ }): any;
431
451
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
432
452
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
433
453
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
434
454
  }>;
435
455
  businessFormatter: import("../../../../../../es/components/form-render").FormBusinessFormatter;
436
- requestInstance: import("../../../../../../es/components/form-render").RequestInstance;
456
+ requestInstance: import("../../../..").FormRequestDefine.RequestInstance;
437
457
  enterToNextWidget: boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void);
438
458
  lowCodeReactions: import("../../../..").FormLowCodeReactions.Config[];
439
459
  linebarAutoHidden: boolean;
@@ -835,13 +855,17 @@ export declare const CallbackMaps: Map<string, {
835
855
  lifeCycle: {
836
856
  type: import("vue").PropType<Partial<{
837
857
  onSetup(): void;
858
+ beforeSetValue(fieldKey: string, value: unknown, payload: {
859
+ field: import("@formily/core").GeneralField;
860
+ oldValue: unknown;
861
+ }): any;
838
862
  beforeRequest(fieldKey: string, params?: import("../../../..").AnyObject | undefined, payload?: import("../../../..").AnyObject | undefined): void | import("../../../..").UndefinedAble<import("../../../..").AnyObject>;
839
863
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
840
864
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
841
865
  }>>;
842
866
  };
843
867
  requestInstance: {
844
- type: import("vue").PropType<import("../../../../../../es/components/form-render").RequestInstance>;
868
+ type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
845
869
  };
846
870
  enterToNextWidget: {
847
871
  type: import("vue").PropType<boolean | ((fieldItem: import("../../../../../../es/components/form-render").FieldItem) => boolean | void)>;
@@ -915,6 +939,17 @@ export declare const CallbackMaps: Map<string, {
915
939
  annotation: {
916
940
  type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
917
941
  };
942
+ requestInstance: {
943
+ type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
944
+ };
945
+ uniqueCacheData: {
946
+ type: BooleanConstructor;
947
+ default: boolean;
948
+ };
949
+ parallelism: {
950
+ type: NumberConstructor;
951
+ default: number;
952
+ };
918
953
  }, {
919
954
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
920
955
  tableConfig: {
@@ -932,6 +967,17 @@ export declare const CallbackMaps: Map<string, {
932
967
  annotation: {
933
968
  type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
934
969
  };
970
+ requestInstance: {
971
+ type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
972
+ };
973
+ uniqueCacheData: {
974
+ type: BooleanConstructor;
975
+ default: boolean;
976
+ };
977
+ parallelism: {
978
+ type: NumberConstructor;
979
+ default: number;
980
+ };
935
981
  }>> & {
936
982
  onFormChange?: ((...args: any[]) => any) | undefined;
937
983
  onCopy?: ((...args: any[]) => any) | undefined;
@@ -1006,6 +1052,10 @@ export declare const CallbackMaps: Map<string, {
1006
1052
  }>;
1007
1053
  eventListener: import("../../../../iho-table/src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
1008
1054
  emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd" | "pageChange", ...args: any[]) => void;
1055
+ asyncQueue: import("../../../..").AsyncQueue<import("../../../..").FormRequestDefine.AsyncQueueItem, any, {
1056
+ label: string;
1057
+ value: unknown;
1058
+ }[]>;
1009
1059
  hooks: Readonly<{
1010
1060
  configHooks: import("../../../../../../es/components/iho-table").AbstractConfigHooks;
1011
1061
  fieldHooks: import("../../../../../../es/components/iho-table").AbstractFieldHooks;
@@ -5557,6 +5607,17 @@ export declare const CallbackMaps: Map<string, {
5557
5607
  annotation: {
5558
5608
  type: import("vue").PropType<Record<string, import("../../../../annotation-edit/src/type").AnnotationItem>>;
5559
5609
  };
5610
+ requestInstance: {
5611
+ type: import("vue").PropType<import("../../../..").FormRequestDefine.RequestInstance>;
5612
+ };
5613
+ uniqueCacheData: {
5614
+ type: BooleanConstructor;
5615
+ default: boolean;
5616
+ };
5617
+ parallelism: {
5618
+ type: NumberConstructor;
5619
+ default: number;
5620
+ };
5560
5621
  }>> & {
5561
5622
  onFormChange?: ((...args: any[]) => any) | undefined;
5562
5623
  onCopy?: ((...args: any[]) => any) | undefined;
@@ -5625,6 +5686,8 @@ export declare const CallbackMaps: Map<string, {
5625
5686
  onRowDrag?: ((...args: any[]) => any) | undefined;
5626
5687
  }, {
5627
5688
  fieldList: import("../../../../../../es/components/iho-table").LowCodeTableFieldItem[];
5689
+ parallelism: number;
5690
+ uniqueCacheData: boolean;
5628
5691
  tableConfig: import("../../../../../../es/components/iho-table").IhoTableConfig;
5629
5692
  tableData: import("../../../..").AnyObject[];
5630
5693
  }>>;
@@ -1 +1 @@
1
- import{isFunction as a}from"lodash-es";import{TRANS_CMD as t}from"./constants/index.js";import e from"./insuranceSDK.js";import{ReadHealthCard as s}from"./utils/readHealthCard.js";let r=null;const n=class{constructor(a){if(this.options=a,this.loading=!1,this.readHealthCardDialog=new s,r)return r;r=this,this.insurance=new e}get basicParamsRes(){return a(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(a={}){return new n(a)}static destroy(){null==r||r.destroy(),r=null}destroy(){this.insurance.destroy()}createParams(a,t){return{transcmd:a,...this.basicParamsRes,...t}}checkLoading(){if(this.loading)return Promise.reject("请勿重复操作")}async checkResCodeAndLoading(a){try{this.loading=!0;const t=await a;return 3===t.returncode||"3"===t.returncode?Promise.reject(`${t.returnmsg||"操作失败"}`):t.returndata}finally{this.loading=!1}}async readHealthCard(a,t){return await this.checkLoading(),this.readHealthCardDialog.show({instance:a,...t})}async readIdCard(a={}){await this.checkLoading();const e=this.createParams(t.ID_CARD_READ,{transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"2",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readMemberCard(a={}){await this.checkLoading();const e=this.createParams(t.MEMBER_CARD_READ,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async writeMemberCard(a={}){await this.checkLoading();const e=this.createParams(t.MEMBER_CARD_WRITE,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readInsuranceCard(a={}){var e,s;await this.checkLoading();const r=this.createParams(t.NS_GETPERSONALINFO,{transchannel:"101",interfaceid:a.interfaceid,transtype:"YB0000",transdata:{...a.transdata,iar1:{acf01:"0",iak22:"0",...null==(e=a.transdata)?void 0:e.iar1},personinfo:{location:0,ownpay:"0",...null==(s=a.transdata)?void 0:s.iar1}}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(r))}async generalRequest(a={}){await this.checkLoading();const e=this.createParams(t.NS_GETPERSONALINFO,a);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}};let i=n;i.version=1,i.TRANS_CMD=t;export{i as default};
1
+ import{isFunction as a}from"lodash-es";import{TRANS_CMD as t}from"./constants/index.js";import e from"./insuranceSDK.js";import{ReadHealthCard as s}from"./utils/readHealthCard.js";let r=null;const n=class{constructor(a){if(this.options=a,this.loading=!1,this.readHealthCardDialog=new s,r)return r;r=this,this.insurance=new e}get basicParamsRes(){return a(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(a={}){return new n(a)}static destroy(){null==r||r.destroy(),r=null}destroy(){this.insurance.destroy()}createParams(a,t){return{transcmd:a,...this.basicParamsRes,...t}}checkLoading(){if(this.loading)return Promise.reject("请勿重复操作")}async checkResCodeAndLoading(a){try{this.loading=!0;const t=await a;return 3===t.returncode||"3"===t.returncode?Promise.reject(`${t.returnmsg||"操作失败"}`):t.returndata}finally{this.loading=!1}}async readHealthCard(a,t){return await this.checkLoading(),this.readHealthCardDialog.show({instance:a,...t})}async readIdCard(a={}){await this.checkLoading();const e=this.createParams(t.ID_CARD_READ,{transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"2",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readMemberCard(a={}){await this.checkLoading();const e=this.createParams(t.MEMBER_CARD_READ,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async writeMemberCard(a={}){await this.checkLoading();const e=this.createParams(t.MEMBER_CARD_WRITE,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}async readInsuranceCard(a={}){var e,s;await this.checkLoading();const r=this.createParams(t.NS_GETPERSONALINFO,{transchannel:"101",interfaceid:a.interfaceid,transtype:"YB0000",transdata:{...a.transdata,iar1:{acf01:"0",iak22:"0",...null==(e=a.transdata)?void 0:e.iar1},personinfo:{location:0,ownpay:"0",...null==(s=a.transdata)?void 0:s.personinfo}}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(r))}async generalRequest(a={}){await this.checkLoading();const e=this.createParams(t.NS_GETPERSONALINFO,a);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(e))}};let i=n;i.version=1,i.TRANS_CMD=t;export{i as default};
@@ -1,12 +1,12 @@
1
- import { AnyObject, Func, NumberRange } from '../../../../../es/shared/types';
1
+ import { AnyObject, AnyFn, NumberRange } from '../../../../../es/shared/types';
2
2
  import { TRANS_CMD } from '../../../../../es/components/card-reader-sdk/src/constants';
3
3
  export declare namespace InsuranceType {
4
4
  export type ExecType = 'hisyb' | 'login';
5
5
  export type IHOWindow = Window & {
6
6
  chrome: {
7
7
  webview: {
8
- addEventListener: (type: string, handler: Func) => void;
9
- removeEventListener: (type: string, handler: Func) => void;
8
+ addEventListener: (type: string, handler: AnyFn) => void;
9
+ removeEventListener: (type: string, handler: AnyFn) => void;
10
10
  postMessage: (payload: any) => void;
11
11
  };
12
12
  };