cnhis-design-vue 3.3.1-beta.3 → 3.3.1-beta.44

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 (248) hide show
  1. package/es/components/ai-chat/index.d.ts +289 -68
  2. package/es/components/ai-chat/src/Index.vue.d.ts +289 -68
  3. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  4. package/es/components/ai-chat/src/api/index.d.ts +5 -3
  5. package/es/components/ai-chat/src/api/index.js +1 -1
  6. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +9 -15
  7. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +1 -1
  8. package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +2 -2
  9. package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -1
  10. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  11. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +46 -55
  12. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  13. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  14. package/es/components/ai-chat/src/components/ChatMainDefault.js +1 -0
  15. package/es/components/ai-chat/src/components/ChatPatient.vue.d.ts +2 -2
  16. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  17. package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +2 -2
  18. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
  19. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +6 -5
  20. package/es/components/ai-chat/src/components/ChatRight.vue2.js +1 -1
  21. package/es/components/ai-chat/src/components/card/JsonCard.js +1 -1
  22. package/es/components/ai-chat/src/components/{card/SelectIcon.d.ts → message-render/CardRender.d.ts} +9 -7
  23. package/es/components/ai-chat/src/components/message-render/CardRender.js +1 -0
  24. package/es/components/ai-chat/src/components/message-render/FormRender.d.ts +16 -0
  25. package/es/components/ai-chat/src/components/message-render/FormRender.js +1 -0
  26. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.d.ts +36 -0
  27. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue.js +1 -0
  28. package/es/components/ai-chat/src/components/mobile/MobileChatAudio.vue2.js +1 -0
  29. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.d.ts +105 -0
  30. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue.js +1 -0
  31. package/es/components/ai-chat/src/components/mobile/MobileChatFooter.vue2.js +1 -0
  32. package/es/components/ai-chat/src/components/svgs/AddIcon.vue.js +1 -0
  33. package/es/components/ai-chat/src/components/svgs/AudioIcon.vue.js +1 -0
  34. package/es/components/ai-chat/src/components/svgs/KeyboardIcon.vue.js +1 -0
  35. package/es/components/ai-chat/src/components/svgs/MicroPhone.vue.js +1 -0
  36. package/es/components/ai-chat/src/hooks/index.d.ts +2 -0
  37. package/es/components/ai-chat/src/hooks/index.js +1 -0
  38. package/es/components/ai-chat/src/hooks/useChartAudioContext.d.ts +18 -0
  39. package/es/components/ai-chat/src/hooks/useChartAudioContext.js +1 -0
  40. package/es/components/ai-chat/src/hooks/useData.d.ts +77 -0
  41. package/es/components/ai-chat/src/hooks/useData.js +1 -0
  42. package/es/components/ai-chat/src/hooks/useFooterContext.d.ts +38 -0
  43. package/es/components/ai-chat/src/hooks/useFooterContext.js +1 -0
  44. package/es/components/ai-chat/src/hooks/useProgram.d.ts +12 -4
  45. package/es/components/ai-chat/src/hooks/useProgram.js +1 -1
  46. package/es/components/ai-chat/src/hooks/useSSE.d.ts +9 -0
  47. package/es/components/ai-chat/src/hooks/useSSE.js +1 -0
  48. package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +3 -1
  49. package/es/components/ai-chat/src/hooks/useWebsocket.js +1 -1
  50. package/es/components/ai-chat/src/types/index.d.ts +1 -3
  51. package/es/components/ai-chat/src/types/index.js +1 -1
  52. package/es/components/ai-chat/src/utils/index.d.ts +6 -1
  53. package/es/components/ai-chat/src/utils/index.js +1 -1
  54. package/es/components/ai-chat/style/index.css +1 -1
  55. package/es/components/audio-sdk/index.d.ts +274 -2
  56. package/es/components/audio-sdk/index.js +1 -1
  57. package/es/components/audio-sdk/src/Index.vue.d.ts +274 -0
  58. package/es/components/audio-sdk/src/Index.vue.js +1 -0
  59. package/es/components/audio-sdk/src/Index.vue2.js +1 -0
  60. package/es/components/audio-sdk/src/audioSDK.d.ts +59 -26
  61. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  62. package/es/components/audio-sdk/src/components/form.vue.d.ts +51 -0
  63. package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +100 -0
  64. package/es/components/audio-sdk/src/components/recording-modal.vue.js +1 -0
  65. package/es/components/audio-sdk/src/components/recording-modal.vue2.js +1 -0
  66. package/es/components/audio-sdk/src/components/recording.vue.d.ts +53 -4
  67. package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
  68. package/es/components/audio-sdk/src/utils/index.d.ts +7 -0
  69. package/es/components/audio-sdk/src/utils/index.js +1 -0
  70. package/es/components/audio-sdk/src/utils/recordingModal.d.ts +7 -4
  71. package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
  72. package/es/components/audio-sdk/style/index.css +1 -1
  73. package/es/components/button-print/index.d.ts +30 -0
  74. package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -0
  75. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  76. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -0
  77. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  78. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  79. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  80. package/es/components/button-print/src/utils/print.d.ts +2 -2
  81. package/es/components/button-print/src/utils/print.js +1 -1
  82. package/es/components/calendar/index.d.ts +126 -3
  83. package/es/components/calendar/src/Calendar.vue.d.ts +126 -2
  84. package/es/components/callback/src/components/render/popupMaps.d.ts +7 -1
  85. package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +4 -8
  86. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  87. package/es/components/card-render/src/components/Button.vue.d.ts +3 -0
  88. package/es/components/card-render/src/components/Button.vue2.js +1 -1
  89. package/es/components/card-render/src/components/ScaleView.vue.d.ts +39 -0
  90. package/es/components/card-render/src/components/ScaleView.vue.js +1 -0
  91. package/es/components/card-render/src/components/ScaleView.vue2.js +1 -0
  92. package/es/components/card-render/src/components/Table.vue.d.ts +104 -0
  93. package/es/components/card-render/src/components/Table.vue.js +1 -0
  94. package/es/components/card-render/src/components/Table.vue2.js +1 -0
  95. package/es/components/card-render/src/components/Text.vue.d.ts +1 -0
  96. package/es/components/card-render/src/components/Text.vue2.js +1 -1
  97. package/es/components/card-render/src/components/index.d.ts +139 -0
  98. package/es/components/card-render/src/components/index.js +1 -1
  99. package/es/components/card-render/src/constants/index.d.ts +4 -1
  100. package/es/components/card-render/src/constants/index.js +1 -1
  101. package/es/components/card-render/style/index.css +1 -1
  102. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  103. package/es/components/fabric-chart/index.d.ts +6 -2
  104. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +6 -2
  105. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  106. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  107. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  108. package/es/components/field-editor/index.d.ts +7 -1
  109. package/es/components/field-editor/src/FieldEditor.vue.d.ts +7 -1
  110. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  111. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  112. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  113. package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
  114. package/es/components/form-config/index.d.ts +73 -13
  115. package/es/components/form-config/src/FormConfig.vue.d.ts +73 -13
  116. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +7 -1
  117. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +45 -9
  118. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +15 -3
  119. package/es/components/form-render/index.d.ts +7 -1
  120. package/es/components/form-render/index.js +1 -1
  121. package/es/components/form-render/src/FormRender.vue.d.ts +7 -1
  122. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  123. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +7 -1
  124. package/es/components/form-render/src/components/renderer/date.d.ts +4 -2
  125. package/es/components/form-render/src/components/renderer/date.js +1 -1
  126. package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
  127. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  128. package/es/components/form-render/src/components/renderer/input.d.ts +5 -0
  129. package/es/components/form-render/src/components/renderer/input.js +1 -1
  130. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.d.ts +9 -0
  131. package/es/components/form-render/src/components/renderer/levelSearchCascader/index.js +1 -1
  132. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +14 -1
  133. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +14 -1
  134. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  135. package/es/components/form-render/src/components/renderer/select.d.ts +5 -0
  136. package/es/components/form-render/src/components/renderer/select.js +1 -1
  137. package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +12 -1
  138. package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -1
  139. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  140. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  141. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +4 -0
  142. package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
  143. package/es/components/form-render/src/types/fieldItem.d.ts +9 -3
  144. package/es/components/form-render/src/types/index.d.ts +2 -0
  145. package/es/components/form-render/src/utils/index.d.ts +1 -0
  146. package/es/components/form-render/src/utils/index.js +1 -1
  147. package/es/components/form-render/style/index.css +1 -1
  148. package/es/components/guide/src/renderer.d.ts +2 -2
  149. package/es/components/iho-chat/index.d.ts +206 -4
  150. package/es/components/iho-chat/src/Index.vue.d.ts +206 -4
  151. package/es/components/iho-chat/src/api/index.d.ts +1 -0
  152. package/es/components/iho-chat/src/api/index.js +1 -1
  153. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +8 -0
  154. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  155. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +11 -3
  156. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  157. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +7 -0
  158. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  159. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +96 -2
  160. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +77 -0
  161. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  162. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +71 -1
  163. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  164. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +8 -2
  165. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  166. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +10 -0
  167. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  168. package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +70 -1
  169. package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +1 -1
  170. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +7 -0
  171. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +3 -0
  172. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  173. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +3 -1
  174. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  175. package/es/components/iho-chat/src/constants/index.d.ts +9 -2
  176. package/es/components/iho-chat/src/constants/index.js +1 -1
  177. package/es/components/iho-chat/src/hooks/useSearchPatientList.d.ts +11 -0
  178. package/es/components/iho-chat/src/hooks/useSearchPatientList.js +1 -0
  179. package/es/components/iho-chat/src/utils/chatSock.js +1 -1
  180. package/es/components/iho-chat/src/utils/index.d.ts +6 -0
  181. package/es/components/iho-chat/src/utils/index.js +1 -1
  182. package/es/components/iho-chat/style/index.css +1 -1
  183. package/es/components/iho-table/index.d.ts +3 -0
  184. package/es/components/iho-table/index.js +1 -1
  185. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  186. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -1
  187. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  188. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +3 -3
  189. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  190. package/es/components/iho-table/src/hooks/useTablePlugin.js +1 -1
  191. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  192. package/es/components/iho-table/src/plugins/headerPlugin/index.d.ts +1 -1
  193. package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
  194. package/es/components/iho-table/src/plugins/highLightSetPlugin.js +1 -1
  195. package/es/components/iho-table/src/plugins/index.d.ts +79 -3
  196. package/es/components/iho-table/src/plugins/index.js +1 -1
  197. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +7 -0
  198. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -1
  199. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  200. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +1 -2
  201. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
  202. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  203. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
  204. package/es/components/iho-table/src/plugins/stickyFixedPlugin.js +1 -1
  205. package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
  206. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
  207. package/es/components/iho-table/src/types/index.d.ts +1 -0
  208. package/es/components/iho-table/src/types/pluginType.d.ts +2 -2
  209. package/es/components/iho-table/src/utils/index.js +1 -1
  210. package/es/components/index.css +1 -1
  211. package/es/components/index.d.ts +2 -1
  212. package/es/components/index.js +1 -1
  213. package/es/components/info-header/index.d.ts +24 -2
  214. package/es/components/info-header/src/InfoHeader.vue.d.ts +24 -2
  215. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +2 -0
  216. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +2 -0
  217. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +9 -1
  218. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +7 -1
  219. package/es/components/scale-view/index.d.ts +17 -3
  220. package/es/components/scale-view/src/ScaleView.vue.d.ts +17 -3
  221. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  222. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +1 -1
  223. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  224. package/es/components/scale-view/src/hooks/scaleview-init.d.ts +3 -1
  225. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  226. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  227. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  228. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -2189
  229. package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -1
  230. package/es/components/shortcut-setter/index.d.ts +15 -3
  231. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +15 -3
  232. package/es/components/steps-wheel/index.d.ts +18 -0
  233. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +18 -0
  234. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  235. package/es/shared/assets/img/use.png.js +1 -1
  236. package/es/shared/components/ArrowIcon/ArrowIcon.vue.js +1 -0
  237. package/es/shared/components/ArrowIcon/index.d.ts +2 -0
  238. package/es/shared/components/ArrowIcon/index.js +1 -0
  239. package/es/shared/components/DateIcon/DateIcon.vue.js +1 -0
  240. package/es/shared/components/DateIcon/index.d.ts +2 -0
  241. package/es/shared/components/DateIcon/index.js +1 -0
  242. package/es/shared/hooks/useLevelSearchCascader.d.ts +1 -0
  243. package/es/shared/hooks/useLevelSearchCascader.js +1 -1
  244. package/es/shared/package.json.js +1 -1
  245. package/package.json +5 -3
  246. package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
  247. package/es/components/ai-chat/src/components/card/SelectIcon.js +0 -1
  248. /package/es/components/ai-chat/src/components/{ChatMainInner.d.ts → ChatMainDefault.d.ts} +0 -0
@@ -1,31 +1,80 @@
1
+ import { PropType } from 'vue';
2
+ import { AnyObject } from '../../../../shared/types';
1
3
  declare const _default: import("vue").DefineComponent<{
2
4
  content: {
3
5
  type: StringConstructor;
4
6
  default: string;
5
7
  };
8
+ showBtn: {
9
+ type: BooleanConstructor;
10
+ };
11
+ token: {
12
+ type: StringConstructor;
13
+ };
14
+ intentionCode: {
15
+ type: StringConstructor;
16
+ };
17
+ configs: {
18
+ type: PropType<AnyObject>;
19
+ };
6
20
  }, {
7
- cssVars: import("vue").ComputedRef<import("../../../../shared/types").AnyObject>;
21
+ consultationRecordUrl: string;
8
22
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
9
23
  content: {
10
24
  type: StringConstructor;
11
25
  default: string;
12
26
  };
27
+ showBtn: {
28
+ type: BooleanConstructor;
29
+ };
30
+ token: {
31
+ type: StringConstructor;
32
+ };
33
+ intentionCode: {
34
+ type: StringConstructor;
35
+ };
36
+ configs: {
37
+ type: PropType<AnyObject>;
38
+ };
13
39
  }>> & {
40
+ onSuccess?: ((...args: any[]) => any) | undefined;
14
41
  onClose?: ((...args: any[]) => any) | undefined;
42
+ onFail?: ((...args: any[]) => any) | undefined;
43
+ onEnd?: ((...args: any[]) => any) | undefined;
15
44
  }>>;
16
- emit: (event: "close", ...args: any[]) => void;
45
+ emit: (event: "close" | "success" | "end" | "fail", ...args: any[]) => void;
46
+ loading: import("vue").Ref<boolean>;
47
+ handleKeydown: (event: KeyboardEvent) => void;
17
48
  close: () => void;
18
- NModal: any;
49
+ toAnalyzing: () => Promise<void>;
19
50
  NIcon: any;
51
+ NButton: any;
52
+ NSpin: any;
20
53
  Mic: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
21
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
54
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "success" | "end" | "fail")[], "close" | "success" | "end" | "fail", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
22
55
  content: {
23
56
  type: StringConstructor;
24
57
  default: string;
25
58
  };
59
+ showBtn: {
60
+ type: BooleanConstructor;
61
+ };
62
+ token: {
63
+ type: StringConstructor;
64
+ };
65
+ intentionCode: {
66
+ type: StringConstructor;
67
+ };
68
+ configs: {
69
+ type: PropType<AnyObject>;
70
+ };
26
71
  }>> & {
72
+ onSuccess?: ((...args: any[]) => any) | undefined;
27
73
  onClose?: ((...args: any[]) => any) | undefined;
74
+ onFail?: ((...args: any[]) => any) | undefined;
75
+ onEnd?: ((...args: any[]) => any) | undefined;
28
76
  }, {
29
77
  content: string;
78
+ showBtn: boolean;
30
79
  }>;
31
80
  export default _default;
@@ -1 +1 @@
1
- import{createElementVNode as o,defineComponent as e,openBlock as s,createBlock as t,unref as r,normalizeStyle as i,withCtx as n,toDisplayString as a,createVNode as c}from"vue";import{NModal as l,NIcon as p}from"naive-ui";import{Mic as m}from"@vicons/ionicons5";import{useTheme as d}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";var u;const f={class:"c-recording-wrapper"},h={class:"content"},v=o("div",{class:"animation"},null,-1),g=o("p",{class:"tip"},(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.141"))||"按下空格键停止录音",-1);var k=e({__name:"recording",props:{content:{type:String,default:""}},emits:["close"],setup(e,{emit:u}){const k=d();function w(){u("close")}return(d,u)=>(s(),t(r(l),{style:i(r(k))},{default:n((()=>[o("div",f,[o("p",h,a(e.content||"正在聆听..."),1),v,o("div",{class:"icon-box",onClick:w},[c(r(p),{size:"60",color:"#fff",component:r(m)},null,8,["component"])]),g])])),_:1},8,["style"]))}});export{k as default};
1
+ import{createElementVNode as e,defineComponent as n,ref as o,onMounted as t,onBeforeUnmount as i,openBlock as c,createElementBlock as s,createBlock as a,unref as l,Fragment as r,toDisplayString as d,createVNode as u,withCtx as f,createTextVNode as p,createCommentVNode as v}from"vue";import{NSpin as m,NIcon as y,NButton as g}from"naive-ui";import{Mic as k}from"@vicons/ionicons5";import w from"axios";var C;const b={class:"c-recording-wrapper"},h={class:"content"},x=e("p",null,(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.141"))||"按下空格键停止录音",-1),B={key:0,class:"btns"};var S=n({__name:"recording",props:{content:{type:String,default:""},showBtn:{type:Boolean},token:{type:String},intentionCode:{type:String},configs:{type:Object}},emits:["close","success","end","fail"],setup(n,{expose:C,emit:S}){const _=n,z=o(!1);function A(e){if(" "===e.key||"Space"===e.code){if(z.value)return;e.preventDefault(),L()}}function L(){S("close")}async function E(){S("end"),z.value=!0;try{const{data:e}=await w.post("/flow/openApi/consultationRecord",{taskId:1,audioText:_.content||"",intentionCode:_.intentionCode,configs:_.configs||{}},{headers:{Authorization:`bearer ${_.token}`}});if(!(null==e?void 0:e.success))return void S("fail",{result:"fail",msg:e.msg});const n=(null==e?void 0:e.data)||{};S("success",n)}catch(e){S("fail",e)}finally{z.value=!1}}return t((()=>{document.addEventListener("keydown",A)})),i((()=>{document.removeEventListener("keydown",A)})),C({toAnalyzing:E}),(o,t)=>(c(),s("div",b,[z.value?(c(),a(l(m),{key:0,description:"加载中..."})):(c(),s(r,{key:1},[e("p",h,d(n.content||"正在聆听..."),1),e("div",{class:"icon-box",onClick:L},[u(l(y),{size:"60",color:"#fff",component:l(k)},null,8,["component"])]),x,n.showBtn?(c(),s("div",B,[u(l(g),{type:"primary",onClick:E,disabled:!n.content},{default:f((()=>[p("结束录音")])),_:1},8,["disabled"]),u(l(g),{onClick:L},{default:f((()=>[p("取消录音")])),_:1})])):v("v-if",!0)],64))]))}});export{S as default};
@@ -0,0 +1,7 @@
1
+ import { AnyObject } from '../../../../shared/types';
2
+ export declare const $message: import("naive-ui").MessageApi;
3
+ export declare function getConfigs(medicalTemplateInfo: AnyObject[]): {
4
+ basicData: string;
5
+ configs: AnyObject;
6
+ };
7
+ export declare function getMedicalTemplateInfo(data: AnyObject, originList?: AnyObject[]): AnyObject[];
@@ -0,0 +1 @@
1
+ import{createDiscreteApi as e}from"naive-ui";const{message:n}=e(["message"]);function t(e){let n="";const i=e.reduce(((e,i)=>{var r;if(null==(r=i.children)?void 0:r.length){const{configs:r,basicData:a}=t(i.children);n+=a,Object.assign(e,r)}else e[i.innerIdentifier||i.dataId]=i.elementName,n+=i.innerIdentifier+i.elementName+":"+i.text+",";return e}),{});return{basicData:n,configs:i}}function i(e,n=[]){const t=[];return n.forEach((n=>{var r;if(null==(r=n.children)?void 0:r.length){const r={...n,children:i(e,n.children)};t.push(r)}else t.push({...n,text:e[n.innerIdentifier||n.dataId]||n.text})})),t}export{n as $message,t as getConfigs,i as getMedicalTemplateInfo};
@@ -1,11 +1,14 @@
1
- import { ComponentInternalInstance, Ref } from 'vue';
1
+ import { ComponentInternalInstance } from 'vue';
2
+ import { AnyObject } from '../../../../shared/types';
2
3
  export declare class RecordingModal {
3
4
  rendered: boolean;
4
5
  target: HTMLElement | null;
5
- show({ contentRef, onClose, instance }: {
6
- contentRef: Ref<string>;
7
- onClose: () => void;
6
+ modalType: string;
7
+ show({ instance, modalType, onClose, props }: {
8
8
  instance?: ComponentInternalInstance;
9
+ onClose: () => void;
10
+ modalType?: string;
11
+ props: AnyObject;
9
12
  }): void;
10
13
  hide(): void;
11
14
  }
@@ -1 +1 @@
1
- import{ref as e,render as t,createVNode as n,withCtx as r,nextTick as o}from"vue";import{createProviderWrapper as s}from"../../../../shared/utils/index.js";import i from"../components/recording.vue.js";class l{constructor(){this.rendered=!1,this.target=null}show({contentRef:l,onClose:a,instance:d}){if(this.rendered)return;this.rendered=!0;const u=document.createElement("div"),h=e(!1),c=s(d);t(n(c,null,{default:r((()=>n(i,{to:u,content:l.value,show:h.value,"onUpdate:show":e=>h.value=e,onClose:()=>p(),onAfterLeave:()=>p()},null)),d)}),u);const m=this;var v;function p(){a()}v=u,document.body.appendChild(v),m.target=v,o((()=>h.value=!0))}hide(){var e;(null==(e=this.target)?void 0:e.parentElement)&&(this.rendered=!1,this.target.parentElement.removeChild(this.target),this.target=null)}}export{l as RecordingModal};
1
+ import{ref as e,render as t,createVNode as r,withCtx as o,mergeProps as n,nextTick as d}from"vue";import{createProviderWrapper as l}from"../../../../shared/utils/index.js";import s from"../components/recording-modal.vue.js";class i{constructor(){this.rendered=!1,this.target=null,this.modalType="recording"}show({instance:i,modalType:a,onClose:h,props:m}){if(this.modalType=a||"recording",this.rendered)return;this.rendered=!0;const u=document.createElement("div"),p=e(!1),c=l(i),v=this;var g;t(r(c,null,{default:o((()=>r(s,n({show:p.value,"onUpdate:show":e=>p.value=e},{to:u,onClose:h,onAfterLeave:h},{content:m.contentRef.value}),null)),i)}),u),g=u,document.body.appendChild(g),v.target=g,d((()=>p.value=!0))}hide(){var e;(null==(e=this.target)?void 0:e.parentElement)&&(this.rendered=!1,this.target.parentElement.removeChild(this.target),this.target=null)}}export{i as RecordingModal};
@@ -1 +1 @@
1
- .c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}
1
+ .c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;display:flex;flex-flow:column nowrap;height:350px;justify-content:center;padding:20px;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{-webkit-box-orient:vertical;-webkit-line-clamp:3;display:-webkit-box;font-size:18px;overflow:hidden;text-align:center}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer;margin:30px auto;position:relative}.c-recording-wrapper .icon-box,.c-recording-wrapper .icon-box:before{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box:before{animation:toScale 1s infinite;background-color:#5585f54d;content:"";left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);transform-origin:center center}.c-recording-wrapper .title{height:50px;width:100%}.c-recording-wrapper .title h5{font-size:15px}.c-recording-wrapper .btns{display:flex;margin-top:10px}.c-recording-wrapper .btns .n-button:first-child{margin-right:30px}.c-recording-sdk-wrapper{display:flex;flex-flow:column nowrap;height:100%;padding:20px;width:100%}.c-recording-sdk-wrapper .c-recording-wrapper{flex:1;width:100%}.c-recording-sdk-wrapper .n-scrollbar{flex:1}.c-recording-sdk-wrapper .n-scrollbar .n-form{text-align:left}
@@ -111,6 +111,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
111
111
  svrUpdateIp: {
112
112
  type: StringConstructor;
113
113
  };
114
+ hidePreviewBtns: {
115
+ type: StringConstructor;
116
+ };
114
117
  }, {
115
118
  $attrs: {
116
119
  [x: string]: unknown;
@@ -225,6 +228,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
225
228
  svrUpdateIp: {
226
229
  type: StringConstructor;
227
230
  };
231
+ hidePreviewBtns: {
232
+ type: StringConstructor;
233
+ };
228
234
  }>> & {
229
235
  onSuccess?: ((...args: any[]) => any) | undefined;
230
236
  onError?: ((...args: any[]) => any) | undefined;
@@ -338,6 +344,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
338
344
  svrUpdateIp: {
339
345
  type: StringConstructor;
340
346
  };
347
+ hidePreviewBtns: {
348
+ type: StringConstructor;
349
+ };
341
350
  }, {
342
351
  isDomestic: boolean;
343
352
  baseDownListSetting: {
@@ -453,6 +462,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
453
462
  svrUpdateIp: {
454
463
  type: StringConstructor;
455
464
  };
465
+ hidePreviewBtns: {
466
+ type: StringConstructor;
467
+ };
456
468
  }>> & {}>>;
457
469
  emit: any;
458
470
  defaultFormatInfo: import("../../shared/types").AnyObject;
@@ -825,6 +837,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
825
837
  svrUpdateIp: {
826
838
  type: StringConstructor;
827
839
  };
840
+ hidePreviewBtns: {
841
+ type: StringConstructor;
842
+ };
828
843
  }>>, {
829
844
  params: import("../../shared/types").AnyObject[];
830
845
  btnText: string;
@@ -952,6 +967,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
952
967
  svrUpdateIp: {
953
968
  type: StringConstructor;
954
969
  };
970
+ hidePreviewBtns: {
971
+ type: StringConstructor;
972
+ };
955
973
  }, {
956
974
  $attrs: {
957
975
  [x: string]: unknown;
@@ -1066,6 +1084,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1066
1084
  svrUpdateIp: {
1067
1085
  type: StringConstructor;
1068
1086
  };
1087
+ hidePreviewBtns: {
1088
+ type: StringConstructor;
1089
+ };
1069
1090
  }>> & {}>>;
1070
1091
  emit: any;
1071
1092
  defaultFormatInfo: import("../../shared/types").AnyObject;
@@ -1409,6 +1430,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1409
1430
  svrUpdateIp: {
1410
1431
  type: StringConstructor;
1411
1432
  };
1433
+ hidePreviewBtns: {
1434
+ type: StringConstructor;
1435
+ };
1412
1436
  }>>, {
1413
1437
  params: import("../../shared/types").AnyObject[];
1414
1438
  btnText: string;
@@ -1544,6 +1568,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1544
1568
  svrUpdateIp: {
1545
1569
  type: StringConstructor;
1546
1570
  };
1571
+ hidePreviewBtns: {
1572
+ type: StringConstructor;
1573
+ };
1547
1574
  }>> & {
1548
1575
  onSuccess?: ((...args: any[]) => any) | undefined;
1549
1576
  onError?: ((...args: any[]) => any) | undefined;
@@ -1665,6 +1692,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1665
1692
  svrUpdateIp: {
1666
1693
  type: StringConstructor;
1667
1694
  };
1695
+ hidePreviewBtns: {
1696
+ type: StringConstructor;
1697
+ };
1668
1698
  }>> & {
1669
1699
  onSuccess?: ((...args: any[]) => any) | undefined;
1670
1700
  onError?: ((...args: any[]) => any) | undefined;
@@ -114,6 +114,9 @@ declare const _default: import("vue").DefineComponent<{
114
114
  svrUpdateIp: {
115
115
  type: StringConstructor;
116
116
  };
117
+ hidePreviewBtns: {
118
+ type: StringConstructor;
119
+ };
117
120
  }, {
118
121
  $attrs: {
119
122
  [x: string]: unknown;
@@ -231,6 +234,9 @@ declare const _default: import("vue").DefineComponent<{
231
234
  svrUpdateIp: {
232
235
  type: StringConstructor;
233
236
  };
237
+ hidePreviewBtns: {
238
+ type: StringConstructor;
239
+ };
234
240
  }>> & {
235
241
  onSuccess?: ((...args: any[]) => any) | undefined;
236
242
  onError?: ((...args: any[]) => any) | undefined;
@@ -344,6 +350,9 @@ declare const _default: import("vue").DefineComponent<{
344
350
  svrUpdateIp: {
345
351
  type: StringConstructor;
346
352
  };
353
+ hidePreviewBtns: {
354
+ type: StringConstructor;
355
+ };
347
356
  }, {
348
357
  isDomestic: boolean;
349
358
  baseDownListSetting: {
@@ -459,6 +468,9 @@ declare const _default: import("vue").DefineComponent<{
459
468
  svrUpdateIp: {
460
469
  type: StringConstructor;
461
470
  };
471
+ hidePreviewBtns: {
472
+ type: StringConstructor;
473
+ };
462
474
  }>> & {}>>;
463
475
  emit: any;
464
476
  defaultFormatInfo: AnyObject;
@@ -831,6 +843,9 @@ declare const _default: import("vue").DefineComponent<{
831
843
  svrUpdateIp: {
832
844
  type: StringConstructor;
833
845
  };
846
+ hidePreviewBtns: {
847
+ type: StringConstructor;
848
+ };
834
849
  }>>, {
835
850
  params: AnyObject[];
836
851
  btnText: string;
@@ -958,6 +973,9 @@ declare const _default: import("vue").DefineComponent<{
958
973
  svrUpdateIp: {
959
974
  type: StringConstructor;
960
975
  };
976
+ hidePreviewBtns: {
977
+ type: StringConstructor;
978
+ };
961
979
  }, {
962
980
  $attrs: {
963
981
  [x: string]: unknown;
@@ -1072,6 +1090,9 @@ declare const _default: import("vue").DefineComponent<{
1072
1090
  svrUpdateIp: {
1073
1091
  type: StringConstructor;
1074
1092
  };
1093
+ hidePreviewBtns: {
1094
+ type: StringConstructor;
1095
+ };
1075
1096
  }>> & {}>>;
1076
1097
  emit: any;
1077
1098
  defaultFormatInfo: AnyObject;
@@ -1415,6 +1436,9 @@ declare const _default: import("vue").DefineComponent<{
1415
1436
  svrUpdateIp: {
1416
1437
  type: StringConstructor;
1417
1438
  };
1439
+ hidePreviewBtns: {
1440
+ type: StringConstructor;
1441
+ };
1418
1442
  }>>, {
1419
1443
  params: AnyObject[];
1420
1444
  btnText: string;
@@ -1553,6 +1577,9 @@ declare const _default: import("vue").DefineComponent<{
1553
1577
  svrUpdateIp: {
1554
1578
  type: StringConstructor;
1555
1579
  };
1580
+ hidePreviewBtns: {
1581
+ type: StringConstructor;
1582
+ };
1556
1583
  }>> & {
1557
1584
  onSuccess?: ((...args: any[]) => any) | undefined;
1558
1585
  onError?: ((...args: any[]) => any) | undefined;
@@ -1677,6 +1704,9 @@ declare const _default: import("vue").DefineComponent<{
1677
1704
  svrUpdateIp: {
1678
1705
  type: StringConstructor;
1679
1706
  };
1707
+ hidePreviewBtns: {
1708
+ type: StringConstructor;
1709
+ };
1680
1710
  }>> & {
1681
1711
  onSuccess?: ((...args: any[]) => any) | undefined;
1682
1712
  onError?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- import{defineComponent as t,useAttrs as e,ref as n,computed as r,provide as o,openBlock as i,createBlock as a,resolveDynamicComponent as l,unref as u,mergeProps as d,withCtx as p,createCommentVNode as s,renderSlot as y,normalizeProps as g,guardReactiveProps as f}from"vue";import{InjectionButtonPrintEmits as c}from"./constants/index.js";import m from"./components/NewPrintComponent.vue.js";import w from"./components/OldPrintComponent.vue.js";var v,P,S,b,C,B,x=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(P=window.getLanguageByCode)?void 0:P.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.483"))||"请选中需要打印的数据",type:String},noDefaultFormatMsg:{default:"获取打印格式失败,请联系管理员!",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},printCustomProps:{type:Object,default:()=>({})},resolution:{type:Number},placement:{type:String,default:"bottom-start"},newPrintSetting:{type:Object,default:()=>({})},svrUpdateIp:{type:String}},emits:["success","error","cancel","clickoutside","saveOuterPrint"],setup(t,{expose:v,emit:P}){const S=t,b=e(),C=n(),B=r((()=>{var t;return(null==(t=Object.keys(S.newPrintSetting))?void 0:t.length)>0?m:w})),x=r((()=>Object.assign({},S,b)));o(c,(function(t,...e){P(t,...e)}));return v({directPrint:async()=>{var t;null==(t=C.value)||t.directPrint()}}),(t,e)=>(i(),a(l(u(B)),d({ref_key:"printComponentRef",ref:C},u(x)),{button:p((e=>[s(" 自定义按钮样式 "),y(t.$slots,"button",g(f(e)))])),_:3},16))}});export{x as default};
1
+ import{defineComponent as t,useAttrs as e,ref as n,computed as r,provide as o,openBlock as i,createBlock as a,resolveDynamicComponent as l,unref as u,mergeProps as d,withCtx as p,createCommentVNode as s,renderSlot as y,normalizeProps as g,guardReactiveProps as f}from"vue";import{InjectionButtonPrintEmits as c}from"./constants/index.js";import m from"./components/NewPrintComponent.vue.js";import w from"./components/OldPrintComponent.vue.js";var v,P,S,b,B,C,x=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(P=window.getLanguageByCode)?void 0:P.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.483"))||"请选中需要打印的数据",type:String},noDefaultFormatMsg:{default:"获取打印格式失败,请联系管理员!",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},printCustomProps:{type:Object,default:()=>({})},resolution:{type:Number},placement:{type:String,default:"bottom-start"},newPrintSetting:{type:Object,default:()=>({})},svrUpdateIp:{type:String},hidePreviewBtns:{type:String}},emits:["success","error","cancel","clickoutside","saveOuterPrint"],setup(t,{expose:v,emit:P}){const S=t,b=e(),B=n(),C=r((()=>{var t;return(null==(t=Object.keys(S.newPrintSetting))?void 0:t.length)>0?m:w})),x=r((()=>Object.assign({},S,b)));o(c,(function(t,...e){P(t,...e)}));return v({directPrint:async()=>{var t;null==(t=B.value)||t.directPrint()}}),(t,e)=>(i(),a(l(u(C)),d({ref_key:"printComponentRef",ref:B},u(x)),{button:p((e=>[s(" 自定义按钮样式 "),y(t.$slots,"button",g(f(e)))])),_:3},16))}});export{x as default};
@@ -109,6 +109,9 @@ declare const _default: import("vue").DefineComponent<{
109
109
  svrUpdateIp: {
110
110
  type: StringConstructor;
111
111
  };
112
+ hidePreviewBtns: {
113
+ type: StringConstructor;
114
+ };
112
115
  }, {
113
116
  isDomestic: boolean;
114
117
  baseDownListSetting: {
@@ -227,6 +230,9 @@ declare const _default: import("vue").DefineComponent<{
227
230
  svrUpdateIp: {
228
231
  type: StringConstructor;
229
232
  };
233
+ hidePreviewBtns: {
234
+ type: StringConstructor;
235
+ };
230
236
  }>> & {}>>;
231
237
  emit: any;
232
238
  defaultFormatInfo: AnyObject;
@@ -602,6 +608,9 @@ declare const _default: import("vue").DefineComponent<{
602
608
  svrUpdateIp: {
603
609
  type: StringConstructor;
604
610
  };
611
+ hidePreviewBtns: {
612
+ type: StringConstructor;
613
+ };
605
614
  }>>, {
606
615
  params: AnyObject[];
607
616
  btnText: string;
@@ -1 +1 @@
1
- import{createElementVNode as e,defineComponent as t,inject as n,ref as a,reactive as i,computed as r,onMounted as l,onBeforeUnmount as o,watch as s,openBlock as u,createElementBlock as d,Fragment as c,createCommentVNode as p,createVNode as m,unref as v,withCtx as g,renderList as y,createBlock as f,mergeProps as w,createTextVNode as h,toDisplayString as k,normalizeStyle as b,isRef as P,renderSlot as C,withModifiers as S,normalizeClass as I}from"vue";import{isObject as L}from"@vue/shared";import{useMessage as O,NButtonGroup as x,NDropdown as T,NButton as j,NIcon as M,NPopover as E,NCheckbox as F,NDivider as B}from"naive-ui";import{PrintOutline as N,SettingsOutline as _,ChevronDownSharp as D,ArrowForwardOutline as R}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as J}from"../constants/index.js";import{Print as U}from"../utils/print.js";import{isIReport as z}from"../utils/browserPrint.js";import A from"./IdentityVerification.vue.js";import{format as K}from"date-fns";import"../api.js";import"../../../shortcut-provider/index.js";import{encapBrowserLog as V}from"../../../../shared/utils/index.js";import{useShortcuts as H}from"../../../shortcut-provider/src/hooks/useShortcuts.js";var $,G,Y,q,Q,W,X;const Z={class:"newprint-button-outer"},ee={key:0,class:"newprint-button-outer__shortcut"},te=e("span",{class:"label bold"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.473"))||"外显设置",-1),ne={class:"print-lite"},ae={class:"label bold"},ie={class:"print-li"},re={class:"print-lite"},le={key:0,class:"newprint-button-outer__shortcut"},oe=["onMouseenter","onClick"],se={class:"label bold"},ue={class:"print-lite",style:{background:"transparent"}},de={class:"label bold"},ce={class:"print-li"},pe={class:"print-lite",style:{background:"transparent"}},me=["onClick"],ve={key:0,class:"newprint-button-outer__shortcut"},ge={class:"newprint-button-poperOver"},ye=["onMouseenter"],fe={class:"print-lite",style:{background:"transparent"}},we=["onClick"];var he=t({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.483"))||"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},resolution:{type:Number},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,printAllType:1,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:"",shortcut:{},buttonProps:{},showMaxHeight:null})},svrUpdateIp:{type:String}},setup(t,{expose:$}){var G,Y,q;const Q=t;String(navigator.platform).toLowerCase().includes("linux");const W=[{label:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.476"))||"分割线",key:"divider"},{label:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.473"))||"外显设置",key:"outSetting"}],X=O();let he;const ke=n(J),be=a(""),Pe=i({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[],iReportExecuteMode:1}),Ce=a({});let Se=a([]),Ie=a([{label:Q.previewText,key:"previewText"},{label:Q.pdfLoadText,key:"downloadPdf"},{label:Q.formatEditText,key:"formatEditText"},{label:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.484"))||"重置打印机",key:"resetPrinter"}]);const Le=i({oneMouseType:"",oneClickType:"",twoMouseType:""}),Oe=i({oneShow:!1,isOperation:!1,isOutSetting:!1}),xe=a([]),Te=a([]),je=r((()=>{if(!Pe.currentFormatId)return{};let e=Pe.currentFormatId;return Pe.formatList.find((t=>t.id===e))}));r((()=>{var e,t;return(null==(e=je.value)?void 0:e.name)||(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.485"))||"格式选择"}));const Me=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.templateId})),Ee=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.number})),Fe=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowPrintAll})),Be=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowOutSetting})),Ne=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.customProps)||{}})),_e=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.defaultFormatId)||""})),De=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllType)||1})),Re=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.shortcut)||{}})),Je=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.buttonProps)||{}})),Ue=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.showMaxHeight)||{}})),ze=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllFormatIds)||[]})),Ae=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.positionElement})),Ke=r((()=>{var e,t;const n=Object.keys(Re.value);if(n.length>0){if(_e.value&&n.includes(_e.value))return(null==(e=Re.value[_e.value])?void 0:e.shortcutLabel)||"";if(n.includes("all"))return(null==(t=Re.value.all)?void 0:t.shortcutLabel)||""}return""})),Ve=r((()=>{const e=W.map((e=>e.key));return Se.value.filter((t=>!e.includes(t.key)))})),He=r({get:()=>Ve.value.every((e=>e.selected)),set(e){Ve.value.forEach((t=>{t.selected=e}))}}),$e=r((()=>{var e;return 2===(null==(e=xe.value)?void 0:e.length)?xe.value.filter((e=>"divider"!==e.key)):xe.value})),Ge=async()=>{var e,t;(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)||await bt(),Oe.oneShow=!0},Ye=async e=>{if(Q.directPrint){if(Pe.spinning)return;return"button"===e?void(Fe.value?await St():_e.value?async function(e){await bt(!1);const t=xe.value.find((t=>t.key==e));t&&st(t.templateCode,t.templateId,t.key,!1)}(_e.value):Ge()):Ge()}return Ge()},qe=(e,t)=>Pe.printParams[t.templateCode]?z(t.key)?e.filter((e=>"formatEditText"!=e.key)):e:[],Qe=(e,t)=>{Le[e]=t},We=()=>{xe.value=Se.value.filter((e=>!e.selected)),Te.value=Ve.value.filter((e=>e.selected)),Ze("oneShow"),Ze("isOutSetting"),ke("saveOuterPrint",Te.value)},Xe=e=>{Oe[e]=!0},Ze=e=>{Le.oneClickType="",Oe[e]=!1,"isOutSetting"==e&&(Oe.isOutSetting=!1)},et=(e,t)=>{lt(!1);let n={type:t,formatId:Pe.currentFormatId,templateId:(null==e?void 0:e.templateId)||Me.value,templateCode:(null==e?void 0:e.templateCode)||Ee.value};V({type:"进入成功的回调",info:n},"PRINT-SDK"),ke("success",e,n)},tt=e=>{lt(!1),V({type:"进入失败的回调",res:e},"PRINT-SDK"),ke("error",e),L(e)&&"notInstalledApp"===e.type&&X.error(e.message)},nt=e=>{lt(!1),ke("cancel",e)},at=e=>{var t;const n={message:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.486"))||"前置条件执行错误",type:e,preExecution:!0};ke("error",n)},it=()=>JSON.stringify({...Q.token?{token:Q.token}:{}}),rt=(e=[],t)=>{var n,a;let i={},r={};if((null==(n=Pe.templateParams[t].customizeDataset)?void 0:n.length)>0){const t=(null==(a=Object.keys(e[0].datasetData||{}))?void 0:a[0])||"",n=JSON.stringify(e.map((e=>JSON.parse(e.datasetData[t]))));r={datasetData:{}},r.datasetData[t]=n}else Object.keys(e[0]).forEach((t=>{r[t]=[],e.forEach((e=>{r[t].includes(e[t])||r[t].push(e[t])})),r[t]=r[t].join(",")}));return i=Object.assign({},JSON.parse(it()),r,Ne.value),JSON.stringify(i)},lt=(e,t)=>{if(Pe.isClickOuterPrint){if(e&&t){const n=Te.value.find((e=>e.key==t));return void(n&&(n.isLoading=e))}Te.value.forEach((e=>{e.isLoading=!1}))}else Pe.spinning=e},ot=()=>Pe.isClickOuterPrint?Te.value.some((e=>e.isLoading)):Pe.spinning,st=(e,t,n,a)=>{const i=Pe.printParams[e];if(!i)return;Pe.isClickOuterPrint=a,Pe.currentFormatId=n;const r=Pe.originParams[e]||[];ut(i,e,t,n,r)},ut=async(e=[],t,n,a,i=[],r)=>{let l=e.length;const o=async e=>{try{--l<=0&&et(e,"print")}catch(e){console.log("error",e)}};Q.showLoading&&ot()&&!r||(lt(!0,a),Q.prevFn("print",{formatId:a,templateId:n,params:e}).then((()=>{var r;Pe.curPrintParamList=e;const l=(null==(r=Ne.value)?void 0:r.printdlgshow)||Q.printdlgshow,s={formatId:a,iReportExecuteMode:Pe.iReportExecuteMode,templateId:n,authorizationKey:be.value,printdlgshow:l,signature:Q.signature,copies:Q.printCopies,svrUpdateIp:Q.svrUpdateIp};if("MULTI"===Q.strategy)for(let t=0;t<e.length;t++){t>0&&(s.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(it()),e[t],Ne.value));he.printDirect({...s,params:n},o,tt,nt)}else he.printDirect({...s,params:rt(e,t)},(e=>{e.params=i,e.templateCode=t,e.templateId=n,et(e,"print")}),tt,nt)})).catch((()=>{at("print"),lt(!1)})).finally((()=>{Pe.visible=!1})))},dt=async(e,{templateCode:t,templateId:n,key:a},i)=>{const r=Pe.printParams[t];if(r)switch(Pe.isClickOuterPrint=i,Pe.currentFormatId=a,e){case"previewText":(async(e=[],t,n,a)=>{Q.showLoading&&ot()||(lt(!0,a),Q.prevFn("preview",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const i=JSON.stringify(Object.assign({},JSON.parse(it()),e[0],Ne.value)),r="MULTI"===Q.strategy?i:rt(e,t),l={formatId:a,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,params:r,btnprint:Q.btnprint,signature:Q.signature};he.preview(l,(e=>{et(e,"preview")}),tt)})).catch((()=>{at("preview"),lt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,a);break;case"formatEditText":((e=[],t,n,a)=>{Q.showLoading&&ot()||(lt(!0,a),Q.prevFn("edit",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e,Pe.currentFormatId=a,Pe.identityVerification.visible=!0})).catch((()=>{at("edit")})).finally((()=>{lt(!1)})))})(r,0,n,a);break;case"downloadPdf":(async(e=[],t,n,a)=>{Q.showLoading&&ot()||(lt(!0,a),Q.prevFn("download",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const i=JSON.stringify(Object.assign({},JSON.parse(it()),e[0],Ne.value)),r="MULTI"===Q.strategy?i:rt(e,t),l={formatId:a,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,print:{print:"1",type:"1",resolution:null==Q?void 0:Q.resolution},params:r,signature:Q.signature};he.downloadPDF(l,(e=>et(e,"preview")),tt)})).catch((()=>{at("download"),lt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,a);break;case"resetPrinter":(async(e=[],t,n,a)=>{var i,r,l;if(!Q.showLoading||!ot()){lt(!0,a);try{const e=await he.resetPrinter(a,Pe.iReportExecuteMode);if(lt(!1),"success"==(null==e?void 0:e.result))return void X.success((null==e?void 0:e.message)||(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.487"))||"重置打印机成功");X.warning((null==e?void 0:e.message)||(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.488"))||"重置打印机失败")}catch(e){lt(!1),X.warning((null==e?void 0:e.message)||(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.488"))||"重置打印机失败")}}})(r,0,0,a)}},ct=()=>{},pt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},yt(n,t,e))})),n},mt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},ft(n,t,e))})),n},vt=(e,t,n)=>{const a={};return t.forEach((t=>{let i=((e,t)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let a=t;return Object.keys(n).includes(e.type)&&t&&t instanceof Date&&(a=K(t,n[e.type])),(null==e?void 0:e.defaultValue)||a})(t,e[t[n]]);e[t[n]]&&i&&(a[t[n]]=i)})),a},gt=({customizeDataset:e=[],param:t=[]},n={})=>{let a={};return e.forEach((e=>{const t=e.dataSetting[0].selectFieldList;a.datasetData||(a.datasetData={}),a.datasetData[e.name]=JSON.stringify(vt(n,t,"fieldName"))})),a=Object.assign({},a,vt(n,t,"key")),a},yt=(e,t,n)=>{if(t.templateNumbers){for(let a=0;a<t.templateNumbers.length;a++){const i=t.templateNumbers[a],r=n[i];if(!r)return e;e[i]||(e[i]=[]),e[i].push(gt(r,t))}return e}const a=Object.keys(n);for(let i=0;i<a.length;i++){const r=a[i],l=n[r];if(!l)return e;e[r]||(e[r]=[]),e[r].push(gt(l,t))}return e},ft=(e,t,n)=>{if(t.templateNumbers){for(let a=0;a<t.templateNumbers.length;a++){const i=t.templateNumbers[a];if(!n[i])return e;e[i]||(e[i]=[]),e[i].push(t)}return e}const a=Object.keys(n);for(let i=0;i<a.length;i++){const r=a[i];if(!n[r])return e;e[r]||(e[r]=[]),e[r].push(t)}return e},wt=async e=>{var t;Pe.formatList=e?(e=>{let t=[];return e&&e.forEach((e=>{if(!e.format)return!1;t.push(...e.format.map((t=>Object.assign({},t,{templateName:e.name}))))})),t})(e.obj):[],Pe.iReportExecuteMode=(null==(t=null==e?void 0:e.obj)?void 0:t.length)>0&&e.obj[0].iReportExecuteMode||1,(()=>{var e,t,n;const a=Object.keys(Re.value),i=Pe.formatList.map((e=>{const t={templateCode:e.number,templateId:e.templateId,label:e.name,key:e.id,selected:!1,isLoading:!1};if(a.includes(e.id)){const n=Re.value[e.id];n&&(t.shortcutLabel=n.shortcutLabel)}return t}));Se.value.unshift(...i),Be.value&&Se.value.push(...W),(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)>0&&(Se.value.forEach((e=>{var t;(null==(t=Q.newPrintSetting)?void 0:t.outerPrintKeys.includes(e.key))&&(e.selected=!0)})),Te.value=Se.value.filter((e=>e.selected))),xe.value=Se.value.filter((e=>!e.selected)),Q.hideButtons.length>0&&(Ie.value=Ie.value.filter((e=>!Q.hideButtons.includes(e.key))));const r=sessionStorage.getItem("portal");if(r){const e=JSON.parse(r),t=(null==(n=null==e?void 0:e.user)?void 0:n.currentRoleResourceObj)||{},a=Object.keys(t);a.includes("RY7.2.21.1.M2.G94181E")||(Ie.value=Ie.value.filter((e=>"downloadPdf"!=e.key))),a.includes("RY7.2.21.1.M2.G33633A")||(Ie.value=Ie.value.filter((e=>"formatEditText"!=e.key))),a.includes("RY7.2.21.1.M2.G99314S")||(Ie.value=Ie.value.filter((e=>"resetPrinter"!=e.key)))}})(),Pe.templateParams=(e=>{let t={};return e&&e.forEach((e=>{if(!e.templateConfig)return!1;t[e.number]=e.templateConfig})),t})(e.obj),Pe.printParams=pt(Pe.templateParams,Q.params),Pe.originParams=mt(Pe.templateParams,Q.params),kt()},ht=async()=>{var e;if(Pe.isInited)return!0;Pe.isInited=!0,Pe.spinning=!0,(()=>{if(he)return!1;he=new U})();const t=await Q.queryPrintFormatByNumber();return await wt(t),(null==(e=t.obj)?void 0:e.length)>0&&(be.value=t.obj[0].authorizationKey||""),Pe.spinning=!1,!0},kt=async()=>{const e=Object.keys(Re.value);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t],a=Re.value[n],{stop:i,signature:r}=H().register({label:a.code,shortcutSignature:a.shortcutKey,operation:["state","reset"],callback(){"all"==n&&Ye("button");const e=Ve.value.map((e=>e.key)),t=Pe.originParams;if(e.includes(n)){const e=Ve.value.find((e=>e.key==n));if(e){const n=Pe.printParams[null==e?void 0:e.templateCode],a=t[null==e?void 0:e.templateCode]||[];ut(n,e.templateCode,e.templateId,e.key,a)}}}});Ce.value[n]=i}},bt=async(e=!0)=>{if(await Q.clickPrevFn()){if(!Pe.visible){if(!await ht())return!1}e&&(Pe.visible=!Pe.visible)}},Pt=e=>{if(Pe.identityVerification.visible=!1,z(Pe.currentFormatId))return et({result:"success",message:""},"edit");const t=JSON.stringify(Object.assign({},JSON.parse(it()),Pe.curPrintParamList[0],Ne.value)),n="MULTI"===Q.strategy?t:rt(Pe.curPrintParamList,Ee.value),a={formatId:Pe.currentFormatId,templateId:Me.value,params:n,token:e};he.editPrintFormat(a,(e=>{et(e,"edit")}),tt)},Ct=(e,t)=>{const n=Te.value[t+1];return t<Te.value.length-1&&!Pe.printParams[e.templateCode]&&Pe.printParams[n.templateCode]};async function St(){await bt(!1),(()=>{var e;const t=Object.keys(Pe.printParams);Pe.isClickOuterPrint=!1;const n=Pe.originParams;if((null==(e=Object.keys(ze.value))?void 0:e.length)>0)Se.value.forEach((e=>{if(ze.value.includes(e.key)){const t=Pe.printParams[e.templateCode],a=n[e.templateCode]||[];Pe.currentFormatId=e.key,ut(t,e.templateCode,e.templateId,e.key,a,!0)}}));else{if(1==De.value)for(let e=0;e<t.length;e++){const a=t[e],i=Pe.printParams[a],r=n[a]||[],l=Pe.formatList.filter((e=>e.number==a));l&&l.length>0&&l.forEach((e=>{Pe.currentFormatId=e.id,ut(i,e.number,e.templateId,e.id,r,!0)}))}2==De.value&&Te.value.forEach((e=>{const t=Pe.printParams[e.templateCode],a=n[e.templateCode]||[];Pe.currentFormatId=e.key,ut(t,e.templateCode,e.templateId,e.key,a,!0)}))}})()}return l((()=>{Pe.isInited=!1})),o((()=>{const e=Object.keys(Ce.value);e.length>0&&e.forEach((e=>{Ce.value[e]&&Ce.value[e]()}))})),s((()=>Q.params),(e=>{Object.keys(Pe.templateParams).length>0&&(Pe.printParams=pt(Pe.templateParams,Q.params),Pe.originParams=mt(Pe.templateParams,Q.params))}),{deep:!0}),s((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys}),(async e=>{(null==e?void 0:e.length)>0&&await bt(!1)}),{deep:!0,immediate:!0}),$({directPrint:St}),(n,a)=>(u(),d(c,null,[e("div",Z,[p(" 外显按钮集合 "),m(v(x),{class:"outButtonGroup"},{default:g((()=>[(u(!0),d(c,null,y(Te.value,((e,n)=>(u(),f(v(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:ct,options:qe(v(Ie),e),onSelect:t=>dt(t,e,!0)},{default:g((()=>[m(v(j),w(v(Je),{disabled:!Pe.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>st(e.templateCode,e.templateId,e.key,!0),class:n==Te.value.length-1?"outerLastButton":Ct(e,n)?"isPrintDisabled":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>[h(" "+k(e.label)+" ",1),e.shortcutLabel?(u(),d("span",ee,k(e.shortcutLabel),1)):p("v-if",!0)])),_:2},1040,["disabled","loading","onClick","class"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(" 外显设置按钮 "),Te.value.length>0&&Te.value.length==v(Ve).length&&v(Be)&&2!=v(De)?(u(),f(v(E),{key:0,trigger:"click",to:v(Ae),"show-arrow":!1,show:Oe.isOutSetting,onClickoutside:a[2]||(a[2]=e=>Ze("isOutSetting"))},{trigger:g((()=>[m(v(j),w(v(Je),{class:Te.value.length>0?"printAllLeftCls":"",onClick:a[0]||(a[0]=e=>Xe("isOutSetting"))}),{default:g((()=>[te,m(v(M),{style:{"margin-left":"8px"},component:v(_),size:"18"},null,8,["component"])])),_:1},16,["class"])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ne,[e("span",ae,k(t.label),1),m(v(F),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ie,[m(v(B)),e("div",re,[m(v(j),{type:"primary",size:"small",onClick:We},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(F),{key:0,checked:v(He),"onUpdate:checked":a[1]||(a[1]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:1},8,["to","show"])):(u(),d(c,{key:1},[p(" 打印全部按钮 "),m(v(E),{trigger:"click","show-arrow":!1,to:v(Ae),show:Oe.oneShow,onClickoutside:a[10]||(a[10]=e=>Ze("oneShow"))},{trigger:g((()=>[C(n.$slots,"button",{handleClickPrintBtn:Ge,handlePrintBySetting:()=>Ye("button"),printSpinning:Pe.spinning,printbtnText:t.btnText,printVisible:Pe.visible},(()=>[m(v(x),{class:"newprint-button-component",onClick:a[4]||(a[4]=S((()=>Ye("icon")),["stop"]))},{default:g((()=>[m(v(j),w({loading:t.showLoading&&Pe.spinning},v(Je),{onClick:a[3]||(a[3]=S((()=>Ye("button")),["stop"])),class:Te.value.length>0?"printAllLeftCls":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>{var e;return[h(" "+k(v(Fe)?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.475"))||"打印全部":t.btnText)+" ",1),v(Ke)?(u(),d("span",le,k(v(Ke)),1)):p("v-if",!0)]})),_:1},16,["loading","class"]),m(v(j),w({class:"icon-select"},v(Je)),{icon:g((()=>[m(v(M),{component:v(D),size:"18"},null,8,["component"])])),_:1},16)])),_:1})]))])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v($e),(t=>(u(),d("div",{class:I(["print-li",Le.oneMouseType==t.key||Le.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>Qe("oneMouseType",t.key),onMouseleave:a[9]||(a[9]=e=>Qe("oneMouseType","")),onClick:e=>((e,t,n)=>{if(!Pe.printParams[n.templateCode])return[];Qe(e,t)})("oneClickType",t.key,t)},["divider"==t.key?(u(),f(v(B),{key:0})):"outSetting"==t.key?(u(),d(c,{key:1},[p(" 第二层外显设置 "),m(v(E),{trigger:"click","show-arrow":!1,to:!1,placement:"right-start",show:Oe.isOutSetting,onClickoutside:a[7]||(a[7]=e=>Ze("isOutSetting"))},{trigger:g((()=>[e("div",{class:"print-lite",onClick:a[5]||(a[5]=e=>Xe("isOutSetting"))},[e("span",se,k(t.label),1),m(v(M),{color:Te.value.length>0?"#2563F4":"",component:v(_),size:"18"},null,8,["color","component"])])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ue,[e("span",de,k(t.label),1),m(v(F),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ce,[m(v(B)),e("div",pe,[m(v(j),{type:"primary",size:"small",onClick:We},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(F),{key:0,checked:v(He),"onUpdate:checked":a[6]||(a[6]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:2},1032,["show"])],2112)):(u(),d(c,{key:2},[p(" 第二层功能操作 "),e("div",{class:I(["print-lite",Pe.printParams[t.templateCode]?"":"isDisabled"]),style:{background:"transparent"}},[e("span",{class:"label bold",onClick:e=>st(t.templateCode,t.templateId,t.key,!1)},[h(k(t.label)+" ",1),t.shortcutLabel?(u(),d("span",ve,k(t.shortcutLabel),1)):p("v-if",!0)],8,me),Pe.printParams[t.templateCode]?(u(),f(v(E),{key:0,trigger:"click","show-arrow":!1,to:!1,placement:"right-start",show:Oe[t.key],onClickoutside:e=>Ze(t.key)},{trigger:g((()=>[m(v(M),{component:v(R),size:"18",onClick:e=>Xe(t.key)},null,8,["component","onClick"])])),default:g((()=>[e("div",ge,[(u(!0),d(c,null,y(qe(v(Ie),t),(n=>(u(),d("div",{class:I(["print-li",Le.twoMouseType==n.key?"active":""]),key:n.key,onMouseenter:e=>Qe("twoMouseType",n.key),onMouseleave:a[8]||(a[8]=e=>Qe("twoMouseType",""))},[e("div",fe,[e("span",{class:"label",onClick:e=>dt(n.key,t,!1)},k(n.label),9,we)])],42,ye)))),128))])])),_:2},1032,["show","onClickoutside"])):p("v-if",!0)],2)],2112))],42,oe)))),128))],4)])),_:3},8,["to","show"])],2112))]),m(A,w(n.$attrs,{modelValue:Pe.identityVerification.visible,"onUpdate:modelValue":a[11]||(a[11]=e=>Pe.identityVerification.visible=e),formatId:Pe.currentFormatId,templateId:v(Me),onSuccess:Pt}),null,16,["modelValue","formatId","templateId"])],64))}});export{he as default};
1
+ import{createElementVNode as e,defineComponent as t,inject as n,ref as i,reactive as a,computed as r,onMounted as l,onBeforeUnmount as o,watch as s,openBlock as u,createElementBlock as d,Fragment as c,createCommentVNode as p,createVNode as m,unref as v,withCtx as g,renderList as y,createBlock as f,mergeProps as w,createTextVNode as h,toDisplayString as k,normalizeStyle as b,isRef as P,renderSlot as C,withModifiers as S,normalizeClass as I}from"vue";import{isObject as L}from"@vue/shared";import{useMessage as O,NButtonGroup as x,NDropdown as T,NButton as j,NIcon as M,NPopover as E,NCheckbox as B,NDivider as F}from"naive-ui";import{PrintOutline as N,SettingsOutline as _,ChevronDownSharp as D,ArrowForwardOutline as R}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as J}from"../constants/index.js";import{Print as U}from"../utils/print.js";import{isIReport as z}from"../utils/browserPrint.js";import A from"./IdentityVerification.vue.js";import{format as K}from"date-fns";import"../api.js";import"../../../shortcut-provider/index.js";import{encapBrowserLog as V}from"../../../../shared/utils/index.js";import{useShortcuts as H}from"../../../shortcut-provider/src/hooks/useShortcuts.js";var $,G,Y,q,Q,W,X;const Z={class:"newprint-button-outer"},ee={key:0,class:"newprint-button-outer__shortcut"},te=e("span",{class:"label bold"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.473"))||"外显设置",-1),ne={class:"print-lite"},ie={class:"label bold"},ae={class:"print-li"},re={class:"print-lite"},le={key:0,class:"newprint-button-outer__shortcut"},oe=["onMouseenter","onClick"],se={class:"label bold"},ue={class:"print-lite",style:{background:"transparent"}},de={class:"label bold"},ce={class:"print-li"},pe={class:"print-lite",style:{background:"transparent"}},me=["onClick"],ve={key:0,class:"newprint-button-outer__shortcut"},ge={class:"newprint-button-poperOver"},ye=["onMouseenter"],fe={class:"print-lite",style:{background:"transparent"}},we=["onClick"];var he=t({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.483"))||"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},resolution:{type:Number},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,printAllType:1,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:"",shortcut:{},buttonProps:{},showMaxHeight:null})},svrUpdateIp:{type:String},hidePreviewBtns:{type:String}},setup(t,{expose:$}){var G,Y,q;const Q=t;String(navigator.platform).toLowerCase().includes("linux");const W=[{label:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.476"))||"分割线",key:"divider"},{label:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.473"))||"外显设置",key:"outSetting"}],X=O();let he;const ke=n(J),be=i(""),Pe=a({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[],iReportExecuteMode:1}),Ce=i({});let Se=i([]),Ie=i([{label:Q.previewText,key:"previewText"},{label:Q.pdfLoadText,key:"downloadPdf"},{label:Q.formatEditText,key:"formatEditText"},{label:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.484"))||"重置打印机",key:"resetPrinter"}]);const Le=a({oneMouseType:"",oneClickType:"",twoMouseType:""}),Oe=a({oneShow:!1,isOperation:!1,isOutSetting:!1}),xe=i([]),Te=i([]),je=r((()=>{if(!Pe.currentFormatId)return{};let e=Pe.currentFormatId;return Pe.formatList.find((t=>t.id===e))}));r((()=>{var e,t;return(null==(e=je.value)?void 0:e.name)||(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.485"))||"格式选择"}));const Me=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.templateId})),Ee=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.number})),Be=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowPrintAll})),Fe=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowOutSetting})),Ne=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.customProps)||{}})),_e=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.defaultFormatId)||""})),De=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllType)||1})),Re=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.shortcut)||{}})),Je=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.buttonProps)||{}})),Ue=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.showMaxHeight)||{}})),ze=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllFormatIds)||[]})),Ae=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.positionElement})),Ke=r((()=>{var e,t;const n=Object.keys(Re.value);if(n.length>0){if(_e.value&&n.includes(_e.value))return(null==(e=Re.value[_e.value])?void 0:e.shortcutLabel)||"";if(n.includes("all"))return(null==(t=Re.value.all)?void 0:t.shortcutLabel)||""}return""})),Ve=r((()=>{const e=W.map((e=>e.key));return Se.value.filter((t=>!e.includes(t.key)))})),He=r({get:()=>Ve.value.every((e=>e.selected)),set(e){Ve.value.forEach((t=>{t.selected=e}))}}),$e=r((()=>{var e;return 2===(null==(e=xe.value)?void 0:e.length)?xe.value.filter((e=>"divider"!==e.key)):xe.value})),Ge=async()=>{var e,t;(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)||await bt(),Oe.oneShow=!0},Ye=async e=>{if(Q.directPrint){if(Pe.spinning)return;return"button"===e?void(Be.value?await St():_e.value?async function(e){await bt(!1);const t=xe.value.find((t=>t.key==e));t&&st(t.templateCode,t.templateId,t.key,!1)}(_e.value):Ge()):Ge()}return Ge()},qe=(e,t)=>Pe.printParams[t.templateCode]?z(t.key)?e.filter((e=>"formatEditText"!=e.key)):e:[],Qe=(e,t)=>{Le[e]=t},We=()=>{xe.value=Se.value.filter((e=>!e.selected)),Te.value=Ve.value.filter((e=>e.selected)),Ze("oneShow"),Ze("isOutSetting"),ke("saveOuterPrint",Te.value)},Xe=e=>{Oe[e]=!0},Ze=e=>{Le.oneClickType="",Oe[e]=!1,"isOutSetting"==e&&(Oe.isOutSetting=!1)},et=(e,t)=>{lt(!1);let n={type:t,formatId:Pe.currentFormatId,templateId:(null==e?void 0:e.templateId)||Me.value,templateCode:(null==e?void 0:e.templateCode)||Ee.value};V({type:"进入成功的回调",info:n},"PRINT-SDK"),ke("success",e,n)},tt=e=>{lt(!1),V({type:"进入失败的回调",res:e},"PRINT-SDK"),ke("error",e),L(e)&&"notInstalledApp"===e.type&&X.error(e.message)},nt=e=>{lt(!1),ke("cancel",e)},it=e=>{var t;const n={message:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.486"))||"前置条件执行错误",type:e,preExecution:!0};ke("error",n)},at=()=>JSON.stringify({...Q.token?{token:Q.token}:{}}),rt=(e=[],t)=>{var n,i;let a={},r={};if((null==(n=Pe.templateParams[t].customizeDataset)?void 0:n.length)>0){const t=(null==(i=Object.keys(e[0].datasetData||{}))?void 0:i[0])||"",n=JSON.stringify(e.map((e=>JSON.parse(e.datasetData[t]))));r={datasetData:{}},r.datasetData[t]=n}else Object.keys(e[0]).forEach((t=>{r[t]=[],e.forEach((e=>{r[t].includes(e[t])||r[t].push(e[t])})),r[t]=r[t].join(",")}));return a=Object.assign({},JSON.parse(at()),r,Ne.value),JSON.stringify(a)},lt=(e,t)=>{if(Pe.isClickOuterPrint){if(e&&t){const n=Te.value.find((e=>e.key==t));return void(n&&(n.isLoading=e))}Te.value.forEach((e=>{e.isLoading=!1}))}else Pe.spinning=e},ot=()=>Pe.isClickOuterPrint?Te.value.some((e=>e.isLoading)):Pe.spinning,st=(e,t,n,i)=>{const a=Pe.printParams[e];if(!a)return;Pe.isClickOuterPrint=i,Pe.currentFormatId=n;const r=Pe.originParams[e]||[];ut(a,e,t,n,r)},ut=async(e=[],t,n,i,a=[],r)=>{let l=e.length;const o=async e=>{try{--l<=0&&et(e,"print")}catch(e){console.log("error",e)}};Q.showLoading&&ot()&&!r||(lt(!0,i),Q.prevFn("print",{formatId:i,templateId:n,params:e}).then((()=>{var r;Pe.curPrintParamList=e;const l=(null==(r=Ne.value)?void 0:r.printdlgshow)||Q.printdlgshow,s={formatId:i,iReportExecuteMode:Pe.iReportExecuteMode,templateId:n,authorizationKey:be.value,printdlgshow:l,signature:Q.signature,copies:Q.printCopies,svrUpdateIp:Q.svrUpdateIp};if("MULTI"===Q.strategy)for(let t=0;t<e.length;t++){t>0&&(s.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(at()),e[t],Ne.value));he.printDirect({...s,params:n},o,tt,nt)}else he.printDirect({...s,params:rt(e,t)},(e=>{e.params=a,e.templateCode=t,e.templateId=n,et(e,"print")}),tt,nt)})).catch((()=>{it("print"),lt(!1)})).finally((()=>{Pe.visible=!1})))},dt=async(e,{templateCode:t,templateId:n,key:i},a)=>{const r=Pe.printParams[t];if(r)switch(Pe.isClickOuterPrint=a,Pe.currentFormatId=i,e){case"previewText":(async(e=[],t,n,i)=>{Q.showLoading&&ot()||(lt(!0,i),Q.prevFn("preview",{formatId:i,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const a=JSON.stringify(Object.assign({},JSON.parse(at()),e[0],Ne.value)),r="MULTI"===Q.strategy?a:rt(e,t),l={formatId:i,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,params:r,btnprint:Q.btnprint,signature:Q.signature,hideButtons:Q.hidePreviewBtns};he.preview(l,(e=>{et(e,"preview")}),tt)})).catch((()=>{it("preview"),lt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,i);break;case"formatEditText":((e=[],t,n,i)=>{Q.showLoading&&ot()||(lt(!0,i),Q.prevFn("edit",{formatId:i,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e,Pe.currentFormatId=i,Pe.identityVerification.visible=!0})).catch((()=>{it("edit")})).finally((()=>{lt(!1)})))})(r,0,n,i);break;case"downloadPdf":(async(e=[],t,n,i)=>{Q.showLoading&&ot()||(lt(!0,i),Q.prevFn("download",{formatId:i,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const a=JSON.stringify(Object.assign({},JSON.parse(at()),e[0],Ne.value)),r="MULTI"===Q.strategy?a:rt(e,t),l={formatId:i,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,print:{print:"1",type:"1",resolution:null==Q?void 0:Q.resolution},params:r,signature:Q.signature};he.downloadPDF(l,(e=>et(e,"preview")),tt)})).catch((()=>{it("download"),lt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,i);break;case"resetPrinter":(async(e=[],t,n,i)=>{var a,r,l;if(!Q.showLoading||!ot()){lt(!0,i);try{const e=await he.resetPrinter(i,Pe.iReportExecuteMode);if(lt(!1),"success"==(null==e?void 0:e.result))return void X.success((null==e?void 0:e.message)||(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.487"))||"重置打印机成功");X.warning((null==e?void 0:e.message)||(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.488"))||"重置打印机失败")}catch(e){lt(!1),X.warning((null==e?void 0:e.message)||(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.488"))||"重置打印机失败")}}})(r,0,0,i)}},ct=()=>{},pt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},yt(n,t,e))})),n},mt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},ft(n,t,e))})),n},vt=(e,t,n)=>{const i={};return t.forEach((t=>{let a=((e,t)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=t;return Object.keys(n).includes(e.type)&&t&&t instanceof Date&&(i=K(t,n[e.type])),(null==e?void 0:e.defaultValue)||i})(t,e[t[n]]);e[t[n]]&&a&&(i[t[n]]=a)})),i},gt=({customizeDataset:e=[],param:t=[]},n={})=>{let i={};return e.forEach((e=>{const t=e.dataSetting[0].selectFieldList;i.datasetData||(i.datasetData={}),i.datasetData[e.name]=JSON.stringify(vt(n,t,"fieldName"))})),i=Object.assign({},i,vt(n,t,"key")),i},yt=(e,t,n)=>{if(t.templateNumbers){for(let i=0;i<t.templateNumbers.length;i++){const a=t.templateNumbers[i],r=n[a];if(!r)return e;e[a]||(e[a]=[]),e[a].push(gt(r,t))}return e}const i=Object.keys(n);for(let a=0;a<i.length;a++){const r=i[a],l=n[r];if(!l)return e;e[r]||(e[r]=[]),e[r].push(gt(l,t))}return e},ft=(e,t,n)=>{if(t.templateNumbers){for(let i=0;i<t.templateNumbers.length;i++){const a=t.templateNumbers[i];if(!n[a])return e;e[a]||(e[a]=[]),e[a].push(t)}return e}const i=Object.keys(n);for(let a=0;a<i.length;a++){const r=i[a];if(!n[r])return e;e[r]||(e[r]=[]),e[r].push(t)}return e},wt=async e=>{var t;Pe.formatList=e?(e=>{let t=[];return e&&e.forEach((e=>{if(!e.format)return!1;t.push(...e.format.map((t=>Object.assign({},t,{templateName:e.name}))))})),t})(e.obj):[],Pe.iReportExecuteMode=(null==(t=null==e?void 0:e.obj)?void 0:t.length)>0&&e.obj[0].iReportExecuteMode||1,(()=>{var e,t,n;const i=Object.keys(Re.value),a=Pe.formatList.map((e=>{const t={templateCode:e.number,templateId:e.templateId,label:e.name,key:e.id,selected:!1,isLoading:!1};if(i.includes(e.id)){const n=Re.value[e.id];n&&(t.shortcutLabel=n.shortcutLabel)}return t}));Se.value.unshift(...a),Fe.value&&Se.value.push(...W),(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)>0&&(Se.value.forEach((e=>{var t;(null==(t=Q.newPrintSetting)?void 0:t.outerPrintKeys.includes(e.key))&&(e.selected=!0)})),Te.value=Se.value.filter((e=>e.selected))),xe.value=Se.value.filter((e=>!e.selected)),Q.hideButtons.length>0&&(Ie.value=Ie.value.filter((e=>!Q.hideButtons.includes(e.key))));const r=sessionStorage.getItem("portal");if(r){const e=JSON.parse(r),t=(null==(n=null==e?void 0:e.user)?void 0:n.currentRoleResourceObj)||{},i=Object.keys(t);i.includes("RY7.2.21.1.M2.G94181E")||(Ie.value=Ie.value.filter((e=>"downloadPdf"!=e.key))),i.includes("RY7.2.21.1.M2.G33633A")||(Ie.value=Ie.value.filter((e=>"formatEditText"!=e.key))),i.includes("RY7.2.21.1.M2.G99314S")||(Ie.value=Ie.value.filter((e=>"resetPrinter"!=e.key)))}})(),Pe.templateParams=(e=>{let t={};return e&&e.forEach((e=>{if(!e.templateConfig)return!1;t[e.number]=e.templateConfig})),t})(e.obj),Pe.printParams=pt(Pe.templateParams,Q.params),Pe.originParams=mt(Pe.templateParams,Q.params),kt()},ht=async()=>{var e;if(Pe.isInited)return!0;Pe.isInited=!0,Pe.spinning=!0,(()=>{if(he)return!1;he=new U})();const t=await Q.queryPrintFormatByNumber();return await wt(t),(null==(e=t.obj)?void 0:e.length)>0&&(be.value=t.obj[0].authorizationKey||""),Pe.spinning=!1,!0},kt=async()=>{const e=Object.keys(Re.value);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t],i=Re.value[n],{stop:a,signature:r}=H().register({label:i.code,shortcutSignature:i.shortcutKey,operation:["state","reset"],callback(){"all"==n&&Ye("button");const e=Ve.value.map((e=>e.key)),t=Pe.originParams;if(e.includes(n)){const e=Ve.value.find((e=>e.key==n));if(e){const n=Pe.printParams[null==e?void 0:e.templateCode],i=t[null==e?void 0:e.templateCode]||[];ut(n,e.templateCode,e.templateId,e.key,i)}}}});Ce.value[n]=a}},bt=async(e=!0)=>{if(await Q.clickPrevFn()){if(!Pe.visible){if(!await ht())return!1}e&&(Pe.visible=!Pe.visible)}},Pt=e=>{if(Pe.identityVerification.visible=!1,z(Pe.currentFormatId))return et({result:"success",message:""},"edit");const t=JSON.stringify(Object.assign({},JSON.parse(at()),Pe.curPrintParamList[0],Ne.value)),n="MULTI"===Q.strategy?t:rt(Pe.curPrintParamList,Ee.value),i={formatId:Pe.currentFormatId,templateId:Me.value,params:n,token:e};he.editPrintFormat(i,(e=>{et(e,"edit")}),tt)},Ct=(e,t)=>{const n=Te.value[t+1];return t<Te.value.length-1&&!Pe.printParams[e.templateCode]&&Pe.printParams[n.templateCode]};async function St(){await bt(!1),(()=>{var e;const t=Object.keys(Pe.printParams);Pe.isClickOuterPrint=!1;const n=Pe.originParams;if((null==(e=Object.keys(ze.value))?void 0:e.length)>0)Se.value.forEach((e=>{if(ze.value.includes(e.key)){const t=Pe.printParams[e.templateCode],i=n[e.templateCode]||[];Pe.currentFormatId=e.key,ut(t,e.templateCode,e.templateId,e.key,i,!0)}}));else{if(1==De.value)for(let e=0;e<t.length;e++){const i=t[e],a=Pe.printParams[i],r=n[i]||[],l=Pe.formatList.filter((e=>e.number==i));l&&l.length>0&&l.forEach((e=>{Pe.currentFormatId=e.id,ut(a,e.number,e.templateId,e.id,r,!0)}))}2==De.value&&Te.value.forEach((e=>{const t=Pe.printParams[e.templateCode],i=n[e.templateCode]||[];Pe.currentFormatId=e.key,ut(t,e.templateCode,e.templateId,e.key,i,!0)}))}})()}return l((()=>{Pe.isInited=!1})),o((()=>{const e=Object.keys(Ce.value);e.length>0&&e.forEach((e=>{Ce.value[e]&&Ce.value[e]()}))})),s((()=>Q.params),(e=>{Object.keys(Pe.templateParams).length>0&&(Pe.printParams=pt(Pe.templateParams,Q.params),Pe.originParams=mt(Pe.templateParams,Q.params))}),{deep:!0}),s((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys}),(async e=>{(null==e?void 0:e.length)>0&&await bt(!1)}),{deep:!0,immediate:!0}),$({directPrint:St}),(n,i)=>(u(),d(c,null,[e("div",Z,[p(" 外显按钮集合 "),m(v(x),{class:"outButtonGroup"},{default:g((()=>[(u(!0),d(c,null,y(Te.value,((e,n)=>(u(),f(v(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:ct,options:qe(v(Ie),e),onSelect:t=>dt(t,e,!0)},{default:g((()=>[m(v(j),w(v(Je),{disabled:!Pe.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>st(e.templateCode,e.templateId,e.key,!0),class:n==Te.value.length-1?"outerLastButton":Ct(e,n)?"isPrintDisabled":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>[h(" "+k(e.label)+" ",1),e.shortcutLabel?(u(),d("span",ee,k(e.shortcutLabel),1)):p("v-if",!0)])),_:2},1040,["disabled","loading","onClick","class"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(" 外显设置按钮 "),Te.value.length>0&&Te.value.length==v(Ve).length&&v(Fe)&&2!=v(De)?(u(),f(v(E),{key:0,trigger:"click",to:v(Ae),"show-arrow":!1,show:Oe.isOutSetting,onClickoutside:i[2]||(i[2]=e=>Ze("isOutSetting"))},{trigger:g((()=>[m(v(j),w(v(Je),{class:Te.value.length>0?"printAllLeftCls":"",onClick:i[0]||(i[0]=e=>Xe("isOutSetting"))}),{default:g((()=>[te,m(v(M),{style:{"margin-left":"8px"},component:v(_),size:"18"},null,8,["component"])])),_:1},16,["class"])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ne,[e("span",ie,k(t.label),1),m(v(B),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ae,[m(v(F)),e("div",re,[m(v(j),{type:"primary",size:"small",onClick:We},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(B),{key:0,checked:v(He),"onUpdate:checked":i[1]||(i[1]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:1},8,["to","show"])):(u(),d(c,{key:1},[p(" 打印全部按钮 "),m(v(E),{trigger:"click","show-arrow":!1,to:v(Ae),show:Oe.oneShow,onClickoutside:i[10]||(i[10]=e=>Ze("oneShow"))},{trigger:g((()=>[C(n.$slots,"button",{handleClickPrintBtn:Ge,handlePrintBySetting:()=>Ye("button"),printSpinning:Pe.spinning,printbtnText:t.btnText,printVisible:Pe.visible},(()=>[m(v(x),{class:"newprint-button-component",onClick:i[4]||(i[4]=S((()=>Ye("icon")),["stop"]))},{default:g((()=>[m(v(j),w({loading:t.showLoading&&Pe.spinning},v(Je),{onClick:i[3]||(i[3]=S((()=>Ye("button")),["stop"])),class:Te.value.length>0?"printAllLeftCls":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>{var e;return[h(" "+k(v(Be)?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.475"))||"打印全部":t.btnText)+" ",1),v(Ke)?(u(),d("span",le,k(v(Ke)),1)):p("v-if",!0)]})),_:1},16,["loading","class"]),m(v(j),w({class:"icon-select"},v(Je)),{icon:g((()=>[m(v(M),{component:v(D),size:"18"},null,8,["component"])])),_:1},16)])),_:1})]))])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v($e),(t=>(u(),d("div",{class:I(["print-li",Le.oneMouseType==t.key||Le.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>Qe("oneMouseType",t.key),onMouseleave:i[9]||(i[9]=e=>Qe("oneMouseType","")),onClick:e=>((e,t,n)=>{if(!Pe.printParams[n.templateCode])return[];Qe(e,t)})("oneClickType",t.key,t)},["divider"==t.key?(u(),f(v(F),{key:0})):"outSetting"==t.key?(u(),d(c,{key:1},[p(" 第二层外显设置 "),m(v(E),{trigger:"click","show-arrow":!1,to:!1,placement:"right-start",show:Oe.isOutSetting,onClickoutside:i[7]||(i[7]=e=>Ze("isOutSetting"))},{trigger:g((()=>[e("div",{class:"print-lite",onClick:i[5]||(i[5]=e=>Xe("isOutSetting"))},[e("span",se,k(t.label),1),m(v(M),{color:Te.value.length>0?"#2563F4":"",component:v(_),size:"18"},null,8,["color","component"])])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ue,[e("span",de,k(t.label),1),m(v(B),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ce,[m(v(F)),e("div",pe,[m(v(j),{type:"primary",size:"small",onClick:We},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(B),{key:0,checked:v(He),"onUpdate:checked":i[6]||(i[6]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:2},1032,["show"])],2112)):(u(),d(c,{key:2},[p(" 第二层功能操作 "),e("div",{class:I(["print-lite",Pe.printParams[t.templateCode]?"":"isDisabled"]),style:{background:"transparent"}},[e("span",{class:"label bold",onClick:e=>st(t.templateCode,t.templateId,t.key,!1)},[h(k(t.label)+" ",1),t.shortcutLabel?(u(),d("span",ve,k(t.shortcutLabel),1)):p("v-if",!0)],8,me),Pe.printParams[t.templateCode]?(u(),f(v(E),{key:0,trigger:"click","show-arrow":!1,to:!1,placement:"right-start",show:Oe[t.key],onClickoutside:e=>Ze(t.key)},{trigger:g((()=>[m(v(M),{component:v(R),size:"18",onClick:e=>Xe(t.key)},null,8,["component","onClick"])])),default:g((()=>[e("div",ge,[(u(!0),d(c,null,y(qe(v(Ie),t),(n=>(u(),d("div",{class:I(["print-li",Le.twoMouseType==n.key?"active":""]),key:n.key,onMouseenter:e=>Qe("twoMouseType",n.key),onMouseleave:i[8]||(i[8]=e=>Qe("twoMouseType",""))},[e("div",fe,[e("span",{class:"label",onClick:e=>dt(n.key,t,!1)},k(n.label),9,we)])],42,ye)))),128))])])),_:2},1032,["show","onClickoutside"])):p("v-if",!0)],2)],2112))],42,oe)))),128))],4)])),_:3},8,["to","show"])],2112))]),m(A,w(n.$attrs,{modelValue:Pe.identityVerification.visible,"onUpdate:modelValue":i[11]||(i[11]=e=>Pe.identityVerification.visible=e),formatId:Pe.currentFormatId,templateId:v(Me),onSuccess:Pt}),null,16,["modelValue","formatId","templateId"])],64))}});export{he as default};
@@ -110,6 +110,9 @@ declare const _default: import("vue").DefineComponent<{
110
110
  svrUpdateIp: {
111
111
  type: StringConstructor;
112
112
  };
113
+ hidePreviewBtns: {
114
+ type: StringConstructor;
115
+ };
113
116
  }, {
114
117
  $attrs: {
115
118
  [x: string]: unknown;
@@ -227,6 +230,9 @@ declare const _default: import("vue").DefineComponent<{
227
230
  svrUpdateIp: {
228
231
  type: StringConstructor;
229
232
  };
233
+ hidePreviewBtns: {
234
+ type: StringConstructor;
235
+ };
230
236
  }>> & {}>>;
231
237
  emit: any;
232
238
  defaultFormatInfo: AnyObject;
@@ -573,6 +579,9 @@ declare const _default: import("vue").DefineComponent<{
573
579
  svrUpdateIp: {
574
580
  type: StringConstructor;
575
581
  };
582
+ hidePreviewBtns: {
583
+ type: StringConstructor;
584
+ };
576
585
  }>>, {
577
586
  params: AnyObject[];
578
587
  btnText: string;
@@ -1 +1 @@
1
- import{defineComponent as t,useAttrs as e,inject as n,ref as a,reactive as i,computed as r,onMounted as o,watch as l,openBlock as s,createElementBlock as d,Fragment as u,createVNode as p,unref as m,withCtx as c,renderSlot as f,withModifiers as v,createTextVNode as g,toDisplayString as y,mergeProps as w}from"vue";import{isObject as b}from"@vue/shared";import{useMessage as I,NDropdown as h,NButton as P,NIcon as F}from"naive-ui";import{ChevronDown as k}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as x}from"../constants/index.js";import{Print as T}from"../utils/print.js";import{isIReport as S}from"../utils/browserPrint.js";import L from"./IdentityVerification.vue.js";import{format as E}from"date-fns";import{savePrivateFormatApi as j,getPrivateFormatApi as M}from"../api.js";import{cloneDeep as C}from"lodash-es";var O,D,R,B,N,V,U=t({__name:"OldPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(D=window.getLanguageByCode)?void 0:D.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(R=window.getLanguageByCode)?void 0:R.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.483"))||"请选中需要打印的数据",type:String},noDefaultFormatMsg:{default:"获取打印格式失败,请联系管理员!",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},resolution:{type:Number},printCustomProps:{type:Object,default:()=>({})},placement:{type:String},svrUpdateIp:{type:String}},setup(t,{expose:O}){var D;const R=t,B=e(),N=I();let V;String(navigator.platform).toLowerCase().includes("linux");const U=n(x),z={},A=a(""),J=i({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,iReportExecuteMode:1});let q=a([{label:R.printText,key:"printText"},{label:R.previewText,key:"previewText"},{label:R.pdfLoadText,key:"downloadPdf"},{label:R.formatEditText,key:"formatEditText"},...(null==(D=R.externalOptionConfig)?void 0:D.options)||[]]);const K=a([]),_=r((()=>{if(!J.currentFormatId)return{};let t=J.currentFormatId;return J.formatList.find((e=>e.id===t))})),G=r((()=>{var t,e;return(null==(t=_.value)?void 0:t.name)||(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.485"))||"格式选择"})),H=r((()=>{let t=J.formatList.find((t=>t.id===J.currentFormatId));return null==t?void 0:t.templateId})),Y=async t=>{if(R.directPrint){if(J.spinning)return;return"button"===t?void await ct():ut()}return ut()},$=t=>p("span",{class:{active:t.key===J.currentFormatId}},[t.label]),Q=(t,e)=>{J.spinning=!1;let n={type:e,formatId:J.currentFormatId,templateId:H.value};U("success",t,n)},W=t=>{J.spinning=!1,U("error",t),b(t)&&"notInstalledApp"===t.type&&N.error(t.message)},X=t=>{J.spinning=!1,U("cancel",t)},Z=t=>{var e;const n={message:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.486"))||"前置条件执行错误",type:t,preExecution:!0};U("error",n)},tt=(t=0)=>{var e;const n=(null==(e=R.printParams)?void 0:e.length)?R.printParams[t]:J.printParams[t];return JSON.stringify({...n||{},...R.token?{token:R.token}:{},...R.printCustomProps||{}})},et=()=>{var t,e;let n={},a={};if(null==(t=J.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(J.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(J.printParams.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=n}else Object.keys(J.printParams[0]).forEach((t=>{a[t]=[],J.printParams.forEach((e=>{a[t].includes(e[t])||a[t].push(e[t])})),a[t]=a[t].join(",")}));return n=Object.assign({},JSON.parse(tt(0)),a),JSON.stringify(n)},nt=((t,e,n=!0)=>{let a=null;return function(...i){a&&clearTimeout(a),n&&!a&&t.apply(null,i),a=setTimeout((()=>{a=null,!n&&t.apply(null,i)}),e)}})((()=>{let t=J.printParams.length;const e=async e=>{try{--t<=0&&Q(e,"print")}catch(t){console.log("error",t)}};R.showLoading&&J.spinning||(J.spinning=!0,R.prevFn("print",{formatId:J.currentFormatId,templateId:H.value}).then((()=>{const t={iReportExecuteMode:J.iReportExecuteMode,formatId:J.currentFormatId,templateId:H.value,authorizationKey:A.value,printdlgshow:R.printdlgshow,signature:R.signature,copies:R.printCopies,svrUpdateIp:R.svrUpdateIp};if("MULTI"===R.strategy)for(let n=0;n<J.printParams.length;n++)n>0&&(t.printdlgshow="0"),V.printDirect({...t,params:tt(n)},e,W,X);else V.printDirect({...t,params:et()},(t=>{Q(t,"print")}),W,X)})).catch((()=>{Z("print"),J.spinning=!1})).finally((()=>{J.visible=!1})))}),800,!0),at=async(t,e)=>{var n,a;switch(t){case"printText":nt();break;case"previewText":(async()=>{R.showLoading&&J.spinning||(J.spinning=!0,R.prevFn("preview",{formatId:J.currentFormatId,templateId:H.value}).then((()=>{const t="MULTI"===R.strategy?tt():et(),e={formatId:J.currentFormatId,iReportExecuteMode:J.iReportExecuteMode,templateId:H.value,authorizationKey:A.value,params:t,btnprint:R.btnprint,signature:R.signature};V.preview(e,(t=>{Q(t,"preview")}),W)})).catch((()=>{Z("preview"),J.spinning=!1})).finally((()=>{J.visible=!1})))})();break;case"formatEditText":R.showLoading&&J.spinning||(J.spinning=!0,R.prevFn("edit",{formatId:J.currentFormatId,templateId:H.value}).then((()=>{J.identityVerification.visible=!0})).catch((()=>{Z("edit")})).finally((()=>{J.visible=!1,J.spinning=!1})));break;case"downloadPdf":(async()=>{R.showLoading&&J.spinning||(J.spinning=!0,R.prevFn("download",{formatId:J.currentFormatId,templateId:H.value}).then((()=>{const t="MULTI"===R.strategy?tt():et(),e={formatId:J.currentFormatId,iReportExecuteMode:J.iReportExecuteMode,templateId:H.value,authorizationKey:A.value,print:{print:"1",type:"1",resolution:null==R?void 0:R.resolution},params:t,signature:R.signature};V.downloadPDF(e,(t=>Q(t,"preview")),W)})).catch((()=>{Z("download"),J.spinning=!1})).finally((()=>{J.visible=!1})))})();break;default:{J.visible=!1;const i=J.formatList.find((e=>e.id===t))||{};if(Object.keys(i).length>0){S(t)?q.value=K.value.filter((t=>"formatEditText"!=t.key)):q.value=K.value,J.currentFormatId=t;const[e]=q.value;e.label=(null==i?void 0:i.name)||e.label,await j({formatForms:[{...i}],name:z.name||i.templateName,number:z.number||i.number,templateId:z.templateId||i.templateId,...z.id?{id:z.id}:{}},{token:R.token})}else null==(a=null==(n=R.externalOptionConfig)?void 0:n.onSelect)||a.call(n,t,e,{formatId:J.currentFormatId});break}}},it=()=>{J.visible=!1,U("clickoutside")},rt=()=>(J.isInited=!1,J.spinning=!1,setTimeout((()=>{J.visible=!1}),0),!1),ot=(t,e,n)=>{const a={};return e.forEach((e=>{let i=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let a=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(a=E(e,n[t.type])),(null==t?void 0:t.defaultValue)||a})(e,t[e[n]]);t[e[n]]&&i&&(a[e[n]]=i)})),a},lt=({customizeDataset:t=[],param:e=[]},n=[])=>n.map((n=>{let a={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;a.datasetData={[t.name]:JSON.stringify(ot(n,e,"fieldName"))}})),a=Object.assign({},a,ot(n,e,"key")),a})),st=async t=>{var e,n;if(J.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],J.iReportExecuteMode=(null==(e=null==t?void 0:t.obj)?void 0:e.length)>0&&t.obj[0].iReportExecuteMode||1,J.currentFormatId=await(async(t,e)=>{var n;if(!(null==t?void 0:t.length))return"";if(!B.isDoc){const{data:e}=await M({templateId:t[0].templateId},{token:R.token});if("SUCCESS"===e.result){const{formatForms:a=[]}=e.map||{};Object.assign(z,e.map||{});const i=null==(n=null==a?void 0:a[0])?void 0:n.id;if(i&&t.map((t=>t.id)).includes(i))return i}}const a=t.find((t=>1==t[e]));return(null==a?void 0:a.id)||t[0].id})(J.formatList,"defaultFlag"),!J.currentFormatId)return q.value=[],N.error(R.noDefaultFormatMsg),rt();(()=>{var t;const e=J.formatList.map((t=>({label:t.name,key:t.id})));q.value.unshift({label:G.value,key:"format",children:e}),R.hideButtons.length>0&&(q.value=q.value.filter((t=>!R.hideButtons.includes(t.key))));const n=sessionStorage.getItem("portal");if(n){const e=JSON.parse(n),a=(null==(t=null==e?void 0:e.user)?void 0:t.currentRoleResourceObj)||{},i=Object.keys(a);i.includes("RY7.2.21.1.M2.G94181E")||(q.value=q.value.filter((t=>"downloadPdf"!=t.key))),i.includes("RY7.2.21.1.M2.G33633A")||(q.value=q.value.filter((t=>"formatEditText"!=t.key)))}K.value=C(q.value),S(J.currentFormatId)&&(q.value=K.value.filter((t=>"formatEditText"!=t.key)))})();let a=null==(n=await R.queryTemplateParams())?void 0:n.obj;if(!a||!H.value)return N.error("获取打印模板失败,请联系管理员!"),rt();J.templateParams=a,J.printParams=lt(J.templateParams,R.params)},dt=async()=>{var t;if(J.isInited)return!0;J.isInited=!0,J.spinning=!0,(()=>{if(V)return!1;V=new T})();const e=await R.queryPrintFormatByNumber();return await st(e),(null==(t=e.obj)?void 0:t.length)>0&&(A.value=e.obj[0].authorizationKey||""),J.spinning=!1,!0},ut=async(t=!0)=>{var e,n;if(await R.clickPrevFn())if((null==(e=R.params)?void 0:e.length)||(null==(n=R.printParams)?void 0:n.length)){if(!J.visible){if(!await dt())return!1}t&&(J.visible=!J.visible)}else N.warning(R.noDataMsg)},pt=()=>{J.watchPrintParamsReformatFn&&J.watchPrintParamsReformatFn(),J.isInited?J.printParams=lt(J.templateParams,R.params):J.watchPrintParamsReformatFn=()=>l((()=>J.isInited),(t=>{if(!t)return!1;pt()}))},mt=t=>{if(J.identityVerification.visible=!1,S(J.currentFormatId))return Q(null,"edit");const e={formatId:J.currentFormatId,templateId:H.value,params:tt(),token:t};V.editPrintFormat(e,(t=>{Q(t,"edit")}),W)};async function ct(){await ut(!1),nt()}return o((()=>{J.isInited=!1})),l((()=>R.params),(t=>{if(!(null==t?void 0:t.length))return!1;pt()}),{deep:!0}),O({directPrint:ct}),(e,n)=>(s(),d(u,null,[p(m(h),{class:"c-dropdown",placement:t.placement,trigger:"click",show:J.visible,onClickoutside:it,options:m(q),onSelect:at,"render-label":$},{default:c((()=>[f(e.$slots,"button",{handleClickPrintBtn:ut,printSpinning:J.spinning,printbtnText:t.btnText,printVisible:J.visible},(()=>[p(m(P),{class:"dropdown-button",loading:t.showLoading&&J.spinning,onClick:n[1]||(n[1]=v((()=>Y("button")),["stop"]))},{default:c((()=>[g(y(t.btnText)+" ",1),p(m(F),{component:m(k),size:"18",style:{"margin-left":"5px"},onClick:n[0]||(n[0]=v((()=>Y("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["placement","show","options"]),p(L,w(m(B),{modelValue:J.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>J.identityVerification.visible=t),formatId:J.currentFormatId,templateId:m(H),onSuccess:mt}),null,16,["modelValue","formatId","templateId"])],64))}});export{U as default};
1
+ import{defineComponent as t,useAttrs as e,inject as n,ref as i,reactive as a,computed as r,onMounted as o,watch as l,openBlock as s,createElementBlock as d,Fragment as u,createVNode as p,unref as m,withCtx as c,renderSlot as f,withModifiers as v,createTextVNode as g,toDisplayString as y,mergeProps as w}from"vue";import{isObject as b}from"@vue/shared";import{useMessage as I,NDropdown as h,NButton as P,NIcon as F}from"naive-ui";import{ChevronDown as k}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as x}from"../constants/index.js";import{Print as T}from"../utils/print.js";import{isIReport as S}from"../utils/browserPrint.js";import L from"./IdentityVerification.vue.js";import{format as E}from"date-fns";import{savePrivateFormatApi as j,getPrivateFormatApi as M}from"../api.js";import{cloneDeep as C}from"lodash-es";var O,B,D,R,N,V,U=t({__name:"OldPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(D=window.getLanguageByCode)?void 0:D.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(R=window.getLanguageByCode)?void 0:R.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(N=window.getLanguageByCode)?void 0:N.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(V=window.getLanguageByCode)?void 0:V.call(window,"10010.1.483"))||"请选中需要打印的数据",type:String},noDefaultFormatMsg:{default:"获取打印格式失败,请联系管理员!",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},resolution:{type:Number},printCustomProps:{type:Object,default:()=>({})},placement:{type:String},svrUpdateIp:{type:String},hidePreviewBtns:{type:String}},setup(t,{expose:O}){var B;const D=t,R=e(),N=I();let V;String(navigator.platform).toLowerCase().includes("linux");const U=n(x),z={},A=i(""),J=a({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,iReportExecuteMode:1});let q=i([{label:D.printText,key:"printText"},{label:D.previewText,key:"previewText"},{label:D.pdfLoadText,key:"downloadPdf"},{label:D.formatEditText,key:"formatEditText"},...(null==(B=D.externalOptionConfig)?void 0:B.options)||[]]);const K=i([]),_=r((()=>{if(!J.currentFormatId)return{};let t=J.currentFormatId;return J.formatList.find((e=>e.id===t))})),G=r((()=>{var t,e;return(null==(t=_.value)?void 0:t.name)||(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.485"))||"格式选择"})),H=r((()=>{let t=J.formatList.find((t=>t.id===J.currentFormatId));return null==t?void 0:t.templateId})),Y=async t=>{if(D.directPrint){if(J.spinning)return;return"button"===t?void await ct():ut()}return ut()},$=t=>p("span",{class:{active:t.key===J.currentFormatId}},[t.label]),Q=(t,e)=>{J.spinning=!1;let n={type:e,formatId:J.currentFormatId,templateId:H.value};U("success",t,n)},W=t=>{J.spinning=!1,U("error",t),b(t)&&"notInstalledApp"===t.type&&N.error(t.message)},X=t=>{J.spinning=!1,U("cancel",t)},Z=t=>{var e;const n={message:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.486"))||"前置条件执行错误",type:t,preExecution:!0};U("error",n)},tt=(t=0)=>{var e;const n=(null==(e=D.printParams)?void 0:e.length)?D.printParams[t]:J.printParams[t];return JSON.stringify({...n||{},...D.token?{token:D.token}:{},...D.printCustomProps||{}})},et=()=>{var t,e;let n={},i={};if(null==(t=J.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(J.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(J.printParams.map((e=>JSON.parse(e.datasetData[t]))));i={datasetData:{}},i.datasetData[t]=n}else Object.keys(J.printParams[0]).forEach((t=>{i[t]=[],J.printParams.forEach((e=>{i[t].includes(e[t])||i[t].push(e[t])})),i[t]=i[t].join(",")}));return n=Object.assign({},JSON.parse(tt(0)),i),JSON.stringify(n)},nt=((t,e,n=!0)=>{let i=null;return function(...a){i&&clearTimeout(i),n&&!i&&t.apply(null,a),i=setTimeout((()=>{i=null,!n&&t.apply(null,a)}),e)}})((()=>{let t=J.printParams.length;const e=async e=>{try{--t<=0&&Q(e,"print")}catch(t){console.log("error",t)}};D.showLoading&&J.spinning||(J.spinning=!0,D.prevFn("print",{formatId:J.currentFormatId,templateId:H.value}).then((()=>{const t={iReportExecuteMode:J.iReportExecuteMode,formatId:J.currentFormatId,templateId:H.value,authorizationKey:A.value,printdlgshow:D.printdlgshow,signature:D.signature,copies:D.printCopies,svrUpdateIp:D.svrUpdateIp};if("MULTI"===D.strategy)for(let n=0;n<J.printParams.length;n++)n>0&&(t.printdlgshow="0"),V.printDirect({...t,params:tt(n)},e,W,X);else V.printDirect({...t,params:et()},(t=>{Q(t,"print")}),W,X)})).catch((()=>{Z("print"),J.spinning=!1})).finally((()=>{J.visible=!1})))}),800,!0),it=async(t,e)=>{var n,i;switch(t){case"printText":nt();break;case"previewText":(async()=>{D.showLoading&&J.spinning||(J.spinning=!0,D.prevFn("preview",{formatId:J.currentFormatId,templateId:H.value}).then((()=>{const t="MULTI"===D.strategy?tt():et(),e={formatId:J.currentFormatId,iReportExecuteMode:J.iReportExecuteMode,templateId:H.value,authorizationKey:A.value,params:t,btnprint:D.btnprint,signature:D.signature,hideButtons:D.hidePreviewBtns};V.preview(e,(t=>{Q(t,"preview")}),W)})).catch((()=>{Z("preview"),J.spinning=!1})).finally((()=>{J.visible=!1})))})();break;case"formatEditText":D.showLoading&&J.spinning||(J.spinning=!0,D.prevFn("edit",{formatId:J.currentFormatId,templateId:H.value}).then((()=>{J.identityVerification.visible=!0})).catch((()=>{Z("edit")})).finally((()=>{J.visible=!1,J.spinning=!1})));break;case"downloadPdf":(async()=>{D.showLoading&&J.spinning||(J.spinning=!0,D.prevFn("download",{formatId:J.currentFormatId,templateId:H.value}).then((()=>{const t="MULTI"===D.strategy?tt():et(),e={formatId:J.currentFormatId,iReportExecuteMode:J.iReportExecuteMode,templateId:H.value,authorizationKey:A.value,print:{print:"1",type:"1",resolution:null==D?void 0:D.resolution},params:t,signature:D.signature};V.downloadPDF(e,(t=>Q(t,"preview")),W)})).catch((()=>{Z("download"),J.spinning=!1})).finally((()=>{J.visible=!1})))})();break;default:{J.visible=!1;const a=J.formatList.find((e=>e.id===t))||{};if(Object.keys(a).length>0){S(t)?q.value=K.value.filter((t=>"formatEditText"!=t.key)):q.value=K.value,J.currentFormatId=t;const[e]=q.value;e.label=(null==a?void 0:a.name)||e.label,await j({formatForms:[{...a}],name:z.name||a.templateName,number:z.number||a.number,templateId:z.templateId||a.templateId,...z.id?{id:z.id}:{}},{token:D.token})}else null==(i=null==(n=D.externalOptionConfig)?void 0:n.onSelect)||i.call(n,t,e,{formatId:J.currentFormatId});break}}},at=()=>{J.visible=!1,U("clickoutside")},rt=()=>(J.isInited=!1,J.spinning=!1,setTimeout((()=>{J.visible=!1}),0),!1),ot=(t,e,n)=>{const i={};return e.forEach((e=>{let a=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(i=E(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&a&&(i[e[n]]=a)})),i},lt=({customizeDataset:t=[],param:e=[]},n=[])=>n.map((n=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData={[t.name]:JSON.stringify(ot(n,e,"fieldName"))}})),i=Object.assign({},i,ot(n,e,"key")),i})),st=async t=>{var e,n;if(J.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],J.iReportExecuteMode=(null==(e=null==t?void 0:t.obj)?void 0:e.length)>0&&t.obj[0].iReportExecuteMode||1,J.currentFormatId=await(async(t,e)=>{var n;if(!(null==t?void 0:t.length))return"";if(!R.isDoc){const{data:e}=await M({templateId:t[0].templateId},{token:D.token});if("SUCCESS"===e.result){const{formatForms:i=[]}=e.map||{};Object.assign(z,e.map||{});const a=null==(n=null==i?void 0:i[0])?void 0:n.id;if(a&&t.map((t=>t.id)).includes(a))return a}}const i=t.find((t=>1==t[e]));return(null==i?void 0:i.id)||t[0].id})(J.formatList,"defaultFlag"),!J.currentFormatId)return q.value=[],N.error(D.noDefaultFormatMsg),rt();(()=>{var t;const e=J.formatList.map((t=>({label:t.name,key:t.id})));q.value.unshift({label:G.value,key:"format",children:e}),D.hideButtons.length>0&&(q.value=q.value.filter((t=>!D.hideButtons.includes(t.key))));const n=sessionStorage.getItem("portal");if(n){const e=JSON.parse(n),i=(null==(t=null==e?void 0:e.user)?void 0:t.currentRoleResourceObj)||{},a=Object.keys(i);a.includes("RY7.2.21.1.M2.G94181E")||(q.value=q.value.filter((t=>"downloadPdf"!=t.key))),a.includes("RY7.2.21.1.M2.G33633A")||(q.value=q.value.filter((t=>"formatEditText"!=t.key)))}K.value=C(q.value),S(J.currentFormatId)&&(q.value=K.value.filter((t=>"formatEditText"!=t.key)))})();let i=null==(n=await D.queryTemplateParams())?void 0:n.obj;if(!i||!H.value)return N.error("获取打印模板失败,请联系管理员!"),rt();J.templateParams=i,J.printParams=lt(J.templateParams,D.params)},dt=async()=>{var t;if(J.isInited)return!0;J.isInited=!0,J.spinning=!0,(()=>{if(V)return!1;V=new T})();const e=await D.queryPrintFormatByNumber();return await st(e),(null==(t=e.obj)?void 0:t.length)>0&&(A.value=e.obj[0].authorizationKey||""),J.spinning=!1,!0},ut=async(t=!0)=>{var e,n;if(await D.clickPrevFn())if((null==(e=D.params)?void 0:e.length)||(null==(n=D.printParams)?void 0:n.length)){if(!J.visible){if(!await dt())return!1}t&&(J.visible=!J.visible)}else N.warning(D.noDataMsg)},pt=()=>{J.watchPrintParamsReformatFn&&J.watchPrintParamsReformatFn(),J.isInited?J.printParams=lt(J.templateParams,D.params):J.watchPrintParamsReformatFn=()=>l((()=>J.isInited),(t=>{if(!t)return!1;pt()}))},mt=t=>{if(J.identityVerification.visible=!1,S(J.currentFormatId))return Q(null,"edit");const e={formatId:J.currentFormatId,templateId:H.value,params:tt(),token:t};V.editPrintFormat(e,(t=>{Q(t,"edit")}),W)};async function ct(){await ut(!1),nt()}return o((()=>{J.isInited=!1})),l((()=>D.params),(t=>{if(!(null==t?void 0:t.length))return!1;pt()}),{deep:!0}),O({directPrint:ct}),(e,n)=>(s(),d(u,null,[p(m(h),{class:"c-dropdown",placement:t.placement,trigger:"click",show:J.visible,onClickoutside:at,options:m(q),onSelect:it,"render-label":$},{default:c((()=>[f(e.$slots,"button",{handleClickPrintBtn:ut,printSpinning:J.spinning,printbtnText:t.btnText,printVisible:J.visible},(()=>[p(m(P),{class:"dropdown-button",loading:t.showLoading&&J.spinning,onClick:n[1]||(n[1]=v((()=>Y("button")),["stop"]))},{default:c((()=>[g(y(t.btnText)+" ",1),p(m(F),{component:m(k),size:"18",style:{"margin-left":"5px"},onClick:n[0]||(n[0]=v((()=>Y("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["placement","show","options"]),p(L,w(m(R),{modelValue:J.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>J.identityVerification.visible=t),formatId:J.currentFormatId,templateId:m(H),onSuccess:mt}),null,16,["modelValue","formatId","templateId"])],64))}});export{U as default};