cnhis-design-vue 3.1.44-release.5 → 3.1.45-3.1.45-release.0.0

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 (235) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/index.d.ts +0 -6
  3. package/es/components/base-search/src/index.vue.d.ts +0 -6
  4. package/es/components/base-search/src/index.vue2.js +1 -1
  5. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  6. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  7. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  8. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  9. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  10. package/es/components/classification/index.d.ts +553 -75
  11. package/es/components/classification/src/components/search-filter/index.vue.d.ts +551 -61
  12. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  13. package/es/components/classification/src/components/set-classification/index.vue.d.ts +553 -75
  14. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  15. package/es/components/classification/src/components/table-modal/index.vue.d.ts +1 -1
  16. package/es/components/classification/src/const/index.d.ts +2 -2
  17. package/es/components/classification/src/index.vue.d.ts +553 -75
  18. package/es/components/classification/src/index.vue2.js +1 -1
  19. package/es/components/classification/style/index.css +1 -1
  20. package/es/components/fabric-chart/index.d.ts +5 -41
  21. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +5 -41
  22. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/{useBirthProcess.d.ts → birthProcess/useBirthProcess.d.ts} +2 -2
  24. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -0
  25. package/es/components/fabric-chart/src/hooks/{useBirthProcessChart.d.ts → birthProcess/useBirthProcessChart.d.ts} +3 -3
  26. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -0
  27. package/es/components/fabric-chart/src/hooks/index.d.ts +5 -7
  28. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +6 -0
  30. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -0
  31. package/es/components/fabric-chart/src/hooks/temperature/index.d.ts +6 -0
  32. package/es/components/fabric-chart/src/hooks/temperature/index.js +1 -0
  33. package/es/components/fabric-chart/src/hooks/temperature/useBottom.d.ts +4 -0
  34. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -0
  35. package/es/components/fabric-chart/src/hooks/{useCenter.d.ts → temperature/useCenter.d.ts} +3 -3
  36. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -0
  37. package/es/components/fabric-chart/src/hooks/{useLeft.d.ts → temperature/useLeft.d.ts} +3 -3
  38. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -0
  39. package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +4 -0
  40. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -0
  41. package/es/components/fabric-chart/src/hooks/temperature/useRight.d.ts +4 -0
  42. package/es/components/fabric-chart/src/hooks/temperature/useRight.js +1 -0
  43. package/es/components/fabric-chart/src/hooks/{useShadow.d.ts → temperature/useShadow.d.ts} +1 -1
  44. package/es/components/fabric-chart/src/hooks/temperature/useShadow.js +1 -0
  45. package/es/components/fabric-chart/src/hooks/{useTemperatureChart.d.ts → temperature/useTemperatureChart.d.ts} +3 -3
  46. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -0
  47. package/es/components/fabric-chart/src/hooks/temperature/useTop.d.ts +4 -0
  48. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -0
  49. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -1
  50. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  51. package/es/components/fabric-chart/src/hooks/useDraw.d.ts +1 -1
  52. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  53. package/es/components/fabric-chart/src/hooks/useEvent.d.ts +1 -1
  54. package/es/components/fabric-chart/src/hooks/useEvent.js +1 -1
  55. package/es/components/fabric-chart/src/hooks/useGrid.d.ts +2 -2
  56. package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
  57. package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
  58. package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
  59. package/es/components/fabric-chart/src/interface.d.ts +3 -3
  60. package/es/components/fabric-chart/src/utils/index.js +1 -1
  61. package/es/components/form-config/index.d.ts +0 -2
  62. package/es/components/form-config/src/FormConfig.vue.d.ts +0 -2
  63. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +0 -1
  64. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +0 -1
  65. package/es/components/form-render/index.d.ts +0 -1
  66. package/es/components/form-render/src/FormRender.vue.d.ts +0 -1
  67. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  68. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +0 -1
  69. package/es/components/form-render/src/components/renderer/input.d.ts +4 -4
  70. package/es/components/form-render/src/components/renderer/input.js +1 -1
  71. package/es/components/form-render/src/components/renderer/inputNumber.d.ts +4 -4
  72. package/es/components/form-render/src/components/renderer/inputNumber.js +1 -1
  73. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  74. package/es/components/form-render/src/types/index.d.ts +2 -0
  75. package/es/components/iho-table/index.d.ts +2 -0
  76. package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -0
  77. package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +1 -0
  78. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  79. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
  80. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.d.ts +3 -4
  81. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
  82. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  83. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  84. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue2.js +1 -1
  85. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  86. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  87. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
  88. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/checkRendererPlugin.js +1 -1
  89. package/es/components/iho-table/src/types/index.d.ts +1 -0
  90. package/es/components/iho-table/style/index.css +1 -1
  91. package/es/components/index.css +1 -1
  92. package/es/components/index.d.ts +2 -1
  93. package/es/components/index.js +1 -1
  94. package/es/components/info-header/index.d.ts +8 -2
  95. package/es/components/info-header/src/InfoHeader.vue.d.ts +8 -2
  96. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +0 -1
  97. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +0 -1
  98. package/es/components/picture-clipper/index.d.ts +59 -0
  99. package/es/components/picture-clipper/index.js +1 -0
  100. package/es/components/picture-clipper/src/PictureClipper.vue.d.ts +59 -0
  101. package/es/components/picture-clipper/src/PictureClipper.vue.js +1 -0
  102. package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -0
  103. package/es/components/picture-clipper/style/index.css +1 -0
  104. package/es/components/quick-search/index.d.ts +0 -6
  105. package/es/components/quick-search/src/index.vue.d.ts +0 -6
  106. package/es/components/quick-search/src/index.vue2.js +1 -1
  107. package/es/components/quick-search/style/index.css +1 -1
  108. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  109. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  110. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  111. package/es/components/shortcut-setter/index.d.ts +0 -1
  112. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +0 -1
  113. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  114. package/es/components/steps-wheel/style/index.css +1 -1
  115. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +551 -48
  116. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
  117. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +134 -0
  118. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.js +1 -0
  119. package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -0
  120. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +140 -0
  121. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.js +1 -0
  122. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -0
  123. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue.d.ts +28 -0
  124. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue.js +1 -0
  125. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -0
  126. package/es/components/table-filter/src/components/classify-filter/components/InputNumber.vue.d.ts +28 -0
  127. package/es/components/table-filter/src/components/classify-filter/components/InputNumber.vue.js +1 -0
  128. package/es/components/table-filter/src/components/classify-filter/components/InputNumber.vue2.js +1 -0
  129. package/es/components/table-filter/src/components/classify-filter/components/InputNumberGroup.vue.d.ts +54 -0
  130. package/es/components/table-filter/src/components/classify-filter/components/InputNumberGroup.vue.js +1 -0
  131. package/es/components/table-filter/src/components/classify-filter/components/InputNumberGroup.vue2.js +1 -0
  132. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +61 -0
  133. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.js +1 -0
  134. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue2.js +1 -0
  135. package/es/components/table-filter/src/components/classify-filter/components/SelectFilter.vue.d.ts +68 -0
  136. package/es/components/table-filter/src/components/classify-filter/components/SelectFilter.vue.js +1 -0
  137. package/es/components/table-filter/src/components/classify-filter/components/SelectFilter.vue2.js +1 -0
  138. package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue.d.ts +47 -0
  139. package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue2.js +1 -0
  140. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +551 -0
  141. package/es/components/table-filter/src/components/classify-filter/components/index.js +1 -0
  142. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +551 -48
  143. package/es/components/table-filter/src/components/render-widget/components/Date.vue2.js +1 -1
  144. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  145. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -1
  146. package/es/components/table-filter/src/components/render-widget/components/{Label.vue.d.ts → LabelInner.vue.d.ts} +1 -9
  147. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue.js +1 -0
  148. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -0
  149. package/es/components/table-filter/src/components/render-widget/components/{SelectLabel.vue.d.ts → LabelOut.vue.d.ts} +1 -9
  150. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue.js +1 -0
  151. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue2.js +1 -0
  152. package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +1 -9
  153. package/es/components/table-filter/src/components/render-widget/components/Select.vue2.js +1 -1
  154. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +713 -8
  155. package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
  156. package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +0 -6
  157. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  158. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +3 -27
  159. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  160. package/es/components/table-filter/src/constants/index.d.ts +3 -0
  161. package/es/components/table-filter/src/constants/index.js +1 -0
  162. package/es/components/table-filter/src/directive/resize.js +1 -1
  163. package/es/components/table-filter/src/tool/baseOptions.d.ts +4 -0
  164. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  165. package/es/components/table-filter/src/tool/transformData.d.ts +1 -0
  166. package/es/components/table-filter/src/tool/transformData.js +1 -1
  167. package/es/components/table-filter/src/types/enums.d.ts +1 -0
  168. package/es/components/table-filter/src/types/enums.js +1 -1
  169. package/es/env.d.ts +25 -25
  170. package/es/shared/assets/img/failure.png.js +1 -1
  171. package/es/shared/assets/img/no-permission.png.js +1 -1
  172. package/es/shared/assets/img/nodata.png.js +1 -1
  173. package/es/shared/assets/img/notfound.png.js +1 -1
  174. package/es/shared/assets/img/qr.png.js +1 -1
  175. package/es/shared/assets/img/success.png.js +1 -1
  176. package/es/shared/assets/img/video.png.js +1 -1
  177. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  178. package/es/shared/assets/img/xb_big.png.js +1 -1
  179. package/es/shared/assets/img/xb_small.png.js +1 -1
  180. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  181. package/es/shared/package.json.js +1 -1
  182. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  183. package/es/shared/utils/fabricjs/index.js +1 -0
  184. package/es/shared/utils/tapable/index.d.ts +139 -0
  185. package/package.json +2 -2
  186. package/es/components/fabric-chart/src/hooks/useBirthProcess.js +0 -1
  187. package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +0 -1
  188. package/es/components/fabric-chart/src/hooks/useBottom.d.ts +0 -4
  189. package/es/components/fabric-chart/src/hooks/useBottom.js +0 -1
  190. package/es/components/fabric-chart/src/hooks/useCenter.js +0 -1
  191. package/es/components/fabric-chart/src/hooks/useLeft.js +0 -1
  192. package/es/components/fabric-chart/src/hooks/useOther.d.ts +0 -4
  193. package/es/components/fabric-chart/src/hooks/useOther.js +0 -1
  194. package/es/components/fabric-chart/src/hooks/useRight.d.ts +0 -4
  195. package/es/components/fabric-chart/src/hooks/useRight.js +0 -1
  196. package/es/components/fabric-chart/src/hooks/useShadow.js +0 -1
  197. package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +0 -1
  198. package/es/components/fabric-chart/src/hooks/useTop.d.ts +0 -4
  199. package/es/components/fabric-chart/src/hooks/useTop.js +0 -1
  200. package/es/components/fabric-chart/src/utils/utils.js +0 -1
  201. package/es/components/table-filter/src/components/render-widget/components/Label.vue.js +0 -1
  202. package/es/components/table-filter/src/components/render-widget/components/Label.vue2.js +0 -1
  203. package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue2.js +0 -1
  204. package/es/shared/assets/img/failure.d.ts +0 -2
  205. package/es/shared/assets/img/failure.js +0 -1
  206. package/es/shared/assets/img/icon-asc.d.ts +0 -2
  207. package/es/shared/assets/img/icon-asc.js +0 -1
  208. package/es/shared/assets/img/icon-desc.d.ts +0 -2
  209. package/es/shared/assets/img/icon-desc.js +0 -1
  210. package/es/shared/assets/img/no-permission.d.ts +0 -2
  211. package/es/shared/assets/img/no-permission.js +0 -1
  212. package/es/shared/assets/img/nodata.d.ts +0 -2
  213. package/es/shared/assets/img/nodata.js +0 -1
  214. package/es/shared/assets/img/notfound.d.ts +0 -2
  215. package/es/shared/assets/img/notfound.js +0 -1
  216. package/es/shared/assets/img/qr.d.ts +0 -2
  217. package/es/shared/assets/img/qr.js +0 -1
  218. package/es/shared/assets/img/success.d.ts +0 -2
  219. package/es/shared/assets/img/success.js +0 -1
  220. package/es/shared/assets/img/video.d.ts +0 -2
  221. package/es/shared/assets/img/video.js +0 -1
  222. package/es/shared/assets/img/video_default_cover.d.ts +0 -2
  223. package/es/shared/assets/img/video_default_cover.js +0 -1
  224. package/es/shared/assets/img/video_hover.d.ts +0 -2
  225. package/es/shared/assets/img/video_hover.js +0 -1
  226. package/es/shared/assets/img/video_play_hover.d.ts +0 -2
  227. package/es/shared/assets/img/video_play_hover.js +0 -1
  228. package/es/shared/assets/img/xb_big.d.ts +0 -2
  229. package/es/shared/assets/img/xb_big.js +0 -1
  230. package/es/shared/assets/img/xb_small.d.ts +0 -2
  231. package/es/shared/assets/img/xb_small.js +0 -1
  232. /package/es/components/fabric-chart/src/{hooks/constant.d.ts → constants/index.d.ts} +0 -0
  233. /package/es/components/fabric-chart/src/{hooks/constant.js → constants/index.js} +0 -0
  234. /package/es/components/fabric-chart/src/utils/{utils.d.ts → index.d.ts} +0 -0
  235. /package/es/components/table-filter/src/components/{render-widget → classify-filter}/components/SelectLabel.vue.js +0 -0
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -140,9 +140,6 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
140
140
  modelValue: {
141
141
  type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
142
142
  };
143
- filterApiConfig: {
144
- type: ObjectConstructor;
145
- };
146
143
  }, any, {
147
144
  initialProps: {};
148
145
  }, {
@@ -166,9 +163,6 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
166
163
  modelValue: {
167
164
  type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
168
165
  };
169
- filterApiConfig: {
170
- type: ObjectConstructor;
171
- };
172
166
  }>> & {
173
167
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
174
168
  onOutFilterChange?: ((...args: any[]) => any) | undefined;
@@ -141,9 +141,6 @@ declare const _default: import("vue").DefineComponent<{
141
141
  modelValue: {
142
142
  type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
143
143
  };
144
- filterApiConfig: {
145
- type: ObjectConstructor;
146
- };
147
144
  }, any, {
148
145
  initialProps: {};
149
146
  }, {
@@ -167,9 +164,6 @@ declare const _default: import("vue").DefineComponent<{
167
164
  modelValue: {
168
165
  type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
169
166
  };
170
- filterApiConfig: {
171
- type: ObjectConstructor;
172
- };
173
167
  }>> & {
174
168
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
175
169
  onOutFilterChange?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as i,watch as l,openBlock as a,createElementBlock as n,createElementVNode as r,createCommentVNode as o,renderSlot as s,unref as u,createVNode as c,withCtx as f,createTextVNode as d,toDisplayString as h,Fragment as m,renderList as p}from"vue";import v from"../../table-filter/src/components/render-widget/index.vue.js";import g from"../../table-filter/src/hooks/useMixins.js";import b from"../../table-filter/src/hooks/useAdvanced.js";import C from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as y,NIcon as k}from"naive-ui";import{Search as S}from"@vicons/ionicons5";import{cloneDeep as j}from"lodash-es";const q={class:"base-search-block"},x={class:"base-container"},R={class:"bease-left"},A={class:"base-ul"},O={key:0,class:"baseli showQuickBtn"},F=r("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),I={key:0,class:"qqConObjCount"},Q={key:1,class:"baseli"},V={key:2,class:"baseli"},_=r("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var w=e({__name:"index",props:{showSettings:{type:Object,default:()=>({hideQuickSearch:0,hideResetBtn:0})},searchFieldList:{type:Array,default:()=>[]},qqConObjCount:{type:Number,default:0},filterApiConfig:{type:Object}},emits:["foldQuickSearch","onFilterSearch","handleReset","getFilterParam"],setup(e,{expose:w,emit:B}){const E=e,{outQuickSearchFn:D}=g(),{isRender:L,getRenderSearchConObj:N,isExistDefValByRenderWidget:P,resetRenderWidgetValue:W}=C(),{transformData:U,transformParams:$}=b(),z=t([]),M=t(!1),T=t([]),G=i((()=>J("hideQuickSearch"))),H=i((()=>J("hideResetBtn")));function J(e){return 0==E.showSettings[e]}function K(){B("foldQuickSearch",!0)}function X(e={}){const t=Z()||[];!function(e,t,i=!1,l={}){let a=[];T.value.length>0&&(a=j(T.value));B("onFilterSearch",e,t,i,a,l)}(t,$(t),!0,e)}function Y(e,t){T.value.forEach((i=>{i._frontId===e&&(i.widgetCfg.isInit=t)}))}function Z(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let i=0;i<e.length;i++){let l=e[i];const a=N(l);a&&t.push(a)}return t.filter((e=>e.value))}(T.value)}function ee(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{W(e)})),D.handlerInitSearchItem(e)}(T.value),B("handleReset",{targetType:"outQuickSearchReset"})}return l((()=>E.searchFieldList),(e=>{e&&e.length>0&&function(){T.value=[];let e=j(U(E.searchFieldList)).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));T.value=e,D.handlerInitSearchItem(T.value),T.value.some((e=>L(e)?P(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),l((()=>E.qqConObjCount),(e=>{const t=z.value.length||0;M.value=t+Number(e)>0&&H.value}),{immediate:!0}),l((()=>T),(()=>{z.value=Z()||[];const e=$(z.value);M.value=z.value.length+Number(E.qqConObjCount)>0&&H.value,B("getFilterParam",z.value,e)}),{immediate:!0,deep:!0}),w({handleReset:ee}),(t,i)=>(a(),n("div",q,[r("div",x,[r("div",R,[r("ul",A,[o(" 筛选分类插槽 "),s(t.$slots,"classification"),u(G)?(a(),n("li",O,[c(u(y),{class:"search-default",type:"default",onClick:K},{default:f((()=>[F,d(" 筛选"),e.qqConObjCount?(a(),n("span",I,"("+h(e.qqConObjCount)+")",1)):o("v-if",!0)])),_:1})])):o("v-if",!0),o(" start--筛选外显--start "),(a(!0),n(m,null,p(T.value,(t=>(a(),n(m,null,[t.isRender?(a(),n("li",{class:"baseli outQuickSearch-li",key:t._frontId},[c(v,{cfg:t,modelValue:t.value,"onUpdate:modelValue":e=>t.value=e,filterApiConfig:e.filterApiConfig,onOutFilterChange:X,onChangeInit:Y},null,8,["cfg","modelValue","onUpdate:modelValue","filterApiConfig"])])):o("v-if",!0)],64)))),256)),o(" end--筛选外显--end "),o(" 查询按钮 "),T.value&&T.value.length>0?(a(),n("li",Q,[c(u(y),{type:"primary",onClick:X},{default:f((()=>[c(u(k),{component:u(S),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),d(" 查询 ")])),_:1})])):o("v-if",!0),o(" 重置按钮 "),M.value?(a(),n("li",V,[c(u(y),{onClick:ee},{default:f((()=>[_,d(" 重置 ")])),_:1})])):o("v-if",!0),o(" 业务按钮插槽 "),s(t.$slots,"buttons")])])])]))}});export{w as default};
1
+ import{defineComponent as e,ref as t,provide as l,computed as i,watch as a,openBlock as n,createElementBlock as r,createElementVNode as s,createCommentVNode as o,renderSlot as u,unref as c,createVNode as f,withCtx as d,createTextVNode as h,toDisplayString as m,Fragment as v,renderList as p}from"vue";import b from"../../table-filter/src/components/render-widget/index.vue.js";import g from"../../table-filter/src/hooks/useMixins.js";import y from"../../table-filter/src/hooks/useAdvanced.js";import C from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as k,NIcon as S}from"naive-ui";import{Search as j}from"@vicons/ionicons5";import{cloneDeep as x}from"lodash-es";import{InjectionFilterApiConfig as q}from"../../table-filter/src/constants/index.js";const R={class:"base-search-block"},O={class:"base-container"},F={class:"bease-left"},A={class:"base-ul"},I={key:0,class:"baseli showQuickBtn"},Q=s("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),V={key:0,class:"qqConObjCount"},_={key:1,class:"baseli"},w={key:2,class:"baseli"},B=s("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var E=e({__name:"index",props:{showSettings:{type:Object,default:()=>({hideQuickSearch:0,hideResetBtn:0})},searchFieldList:{type:Array,default:()=>[]},qqConObjCount:{type:Number,default:0},filterApiConfig:{type:Object}},emits:["foldQuickSearch","onFilterSearch","handleReset","getFilterParam"],setup(e,{expose:E,emit:D}){const L=e,{outQuickSearchFn:N}=g(),{isRender:P,getRenderSearchConObj:W,isExistDefValByRenderWidget:U,resetRenderWidgetValue:$}=C(),{transformData:z,transformParams:M}=y(),T=t([]),G=t(!1),H=t([]);l(q,L.filterApiConfig);const J=i((()=>X("hideQuickSearch"))),K=i((()=>X("hideResetBtn")));function X(e){return 0==L.showSettings[e]}function Y(){D("foldQuickSearch",!0)}function Z(e={}){const t=te()||[];!function(e,t,l=!1,i={}){let a=[];H.value.length>0&&(a=x(H.value));D("onFilterSearch",e,t,l,a,i)}(t,M(t),!0,e)}function ee(e,t){H.value.forEach((l=>{l._frontId===e&&(l.widgetCfg.isInit=t)}))}function te(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let l=0;l<e.length;l++){let i=e[l];const a=W(i);a&&t.push(a)}return t.filter((e=>e.value))}(H.value)}function le(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{$(e)})),N.handlerInitSearchItem(e)}(H.value),D("handleReset",{targetType:"outQuickSearchReset"})}return a((()=>L.searchFieldList),(e=>{e&&e.length>0&&function(){H.value=[];let e=x(z(L.searchFieldList)).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));H.value=e,N.handlerInitSearchItem(H.value),H.value.some((e=>P(e)?U(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),a((()=>L.qqConObjCount),(e=>{const t=T.value.length||0;G.value=t+Number(e)>0&&K.value}),{immediate:!0}),a((()=>H),(()=>{T.value=te()||[];const e=M(T.value);G.value=T.value.length+Number(L.qqConObjCount)>0&&K.value,D("getFilterParam",T.value,e)}),{immediate:!0,deep:!0}),E({handleReset:le}),(t,l)=>(n(),r("div",R,[s("div",O,[s("div",F,[s("ul",A,[o(" 筛选分类插槽 "),u(t.$slots,"classification"),c(J)?(n(),r("li",I,[f(c(k),{class:"search-default",type:"default",onClick:Y},{default:d((()=>[Q,h(" 筛选"),e.qqConObjCount?(n(),r("span",V,"("+m(e.qqConObjCount)+")",1)):o("v-if",!0)])),_:1})])):o("v-if",!0),o(" start--筛选外显--start "),(n(!0),r(v,null,p(H.value,(e=>(n(),r(v,null,[e.isRender?(n(),r("li",{class:"baseli outQuickSearch-li",key:e._frontId},[f(b,{cfg:e,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,onOutFilterChange:Z,onChangeInit:ee},null,8,["cfg","modelValue","onUpdate:modelValue"])])):o("v-if",!0)],64)))),256)),o(" end--筛选外显--end "),o(" 查询按钮 "),H.value&&H.value.length>0?(n(),r("li",_,[f(c(k),{type:"primary",onClick:Z},{default:d((()=>[f(c(S),{component:c(j),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),h(" 查询 ")])),_:1})])):o("v-if",!0),o(" 重置按钮 "),G.value?(n(),r("li",w,[f(c(k),{onClick:le},{default:d((()=>[B,h(" 重置 ")])),_:1})])):o("v-if",!0),o(" 业务按钮插槽 "),u(t.$slots,"buttons")])])])]))}});export{E as default};
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/Viewer';
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/features/modeling';
@@ -0,0 +1 @@
1
+ declare module 'diagram-js/lib/navigation/movecanvas';
@@ -1 +1 @@
1
- import{defineComponent as t,reactive as e,computed as r,onMounted as a,onUnmounted as n,watch as i,openBlock as o,createElementBlock as s,Fragment as l,createVNode as m,unref as p,withCtx as d,renderSlot as u,withModifiers as c,createTextVNode as f,toDisplayString as v,mergeProps as y}from"vue";import{isObject as b}from"@vue/shared";import{useMessage as g,NDropdown as P,NButton as I,NIcon as h}from"naive-ui";import{ChevronDown as F}from"@vicons/ionicons5";import{Print as w}from"./utils/print.js";import{isIReport as k}from"./utils/browserPrint.js";import T from"./components/IdentityVerification.vue.js";import{format as x}from"date-fns";import{savePrivateFormatApi as S,getPrivateFormatApi as j}from"./api.js";var D=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",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:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})}},emits:["success","error","clickoutside"],setup(t,{expose:D,emit:O}){var E;const L=t,N=g();let M;const V={},C=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),Y=e([{label:L.printText,key:"printText"},{label:L.previewText,key:"previewText"},{label:L.pdfLoadText,key:"downloadPdf"},{label:L.formatEditText,key:"formatEditText"},...(null==(E=L.externalOptionConfig)?void 0:E.options)||[]]),U=r((()=>{if(!C.currentFormatId)return{};let t=C.currentFormatId;return C.formatList.find((e=>e.id===t))})),B=r((()=>{var t;return(null==(t=U.value)?void 0:t.name)||"格式选择"})),J=r((()=>{let t=C.formatList.find((t=>t.id===C.currentFormatId));return null==t?void 0:t.templateId})),A=async t=>{if(L.directPrint){if(C.spinning)return;return"button"===t?void await it():rt()}return rt()},R=t=>m("span",{class:{active:t.key===C.currentFormatId}},[t.label]),q=(t,e)=>{let r={type:e,formatId:C.currentFormatId,templateId:J.value};O("success",t,r)},_=t=>{O("error",t),b(t)&&"notInstalledApp"===t.type&&N.error(t.message)},z=()=>{O("error",{message:"前置条件执行错误"})},H=(t=0)=>{var e;const r=(null==(e=L.printParams)?void 0:e.length)?L.printParams[t]:C.printParams[t];return JSON.stringify({...r||{},...L.token?{token:L.token}:{}})},$=()=>{var t,e;let r={},a={};if(null==(t=C.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(C.printParams[0].datasetData||{}))?void 0:e[0])||"",r=JSON.stringify(C.printParams.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=r}else Object.keys(C.printParams[0]).forEach((t=>{a[t]=[],C.printParams.forEach((e=>{a[t].push(e[t])})),a[t]=a[t].join(",")}));return r=Object.assign({},JSON.parse(H(0)),a),JSON.stringify(r)},G=()=>{let t=C.printParams.length;const e=async e=>{try{--t<=0&&q(e,"print")}catch(t){console.log("error",t)}};L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t={formatId:C.currentFormatId,templateId:J.value,printdlgshow:L.printdlgshow};if("MULTI"===L.strategy)for(let r=0;r<C.printParams.length;r++)r>0&&(t.printdlgshow="0"),M.printDirect({...t,params:H(r)},e,_);else M.printDirect({...t,params:$()},(t=>{q(t,"print")}),_)})).finally((()=>{C.visible=!1}))},K=async(t,e)=>{var r,a;switch(t){case"printText":G();break;case"previewText":(async()=>{L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===L.strategy?H():$(),e={formatId:C.currentFormatId,templateId:J.value,params:t,btnprint:L.btnprint};M.preview(e,(t=>{q(t,"preview")}),_)})).finally((()=>{C.visible=!1}))})();break;case"formatEditText":L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{C.identityVerification.visible=!0})).finally((()=>{C.visible=!1}));break;case"downloadPdf":(async()=>{L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===L.strategy?H():$(),e={formatId:C.currentFormatId,templateId:J.value,print:{print:"1",type:"1"},params:t};M.downloadPDF(e,(t=>q(t,"preview")),_)})).finally((()=>{C.visible=!1}))})();break;default:{C.visible=!1;const n=C.formatList.find((e=>e.id===t))||{};if(Object.keys(n).length>0){C.currentFormatId=t;const[e]=Y;e.label=(null==n?void 0:n.name)||e.label,await S({formatForms:[{...n}],name:V.name||n.templateName,number:V.number||n.number,templateId:V.templateId||n.templateId,...V.id?{id:V.id}:{}},{token:L.token})}else null==(a=null==(r=L.externalOptionConfig)?void 0:r.onSelect)||a.call(r,t,e);break}}},Q=()=>{C.visible=!1,O("clickoutside")},W=()=>(C.isInited=!1,C.spinning=!1,setTimeout((()=>{C.visible=!1}),0),!1),X=(t,e,r)=>{const a={};return e.forEach((e=>{let n=((t,e)=>{let r=t.defaultValue||"",a=e;return"NUMBER"===t.type&&(a=Number(e)||0),"DATE"===t.type&&(a=e?x(e,"YYYY-MM-DD"):""),"DATETIME"===t.type&&(a=e?x(e,"YYYY-MM-DD HH:mm:ss"):""),r||a})(e,t[e[r]]);t[e[r]]&&n&&(a[e[r]]=n)})),a},Z=({customizeDataset:t=[],param:e=[]},r=[])=>r.map((r=>{let a={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;a.datasetData={[t.name]:JSON.stringify(X(r,e,"fieldName"))}})),a=Object.assign({},a,X(r,e,"key")),a})),tt=async t=>{var e;if(C.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):[],C.currentFormatId=await(async(t,e)=>{var r;if(!(null==t?void 0:t.length))return"";const{data:a}=await j({templateId:t[0].templateId},{token:L.token});if("SUCCESS"===a.result){const{formatForms:e=[]}=a.map||{};Object.assign(V,a.map||{});const n=null==(r=null==e?void 0:e[0])?void 0:r.id;if(n&&t.map((t=>t.id)).includes(n))return n}const n=t.find((t=>1==t[e]));return(null==n?void 0:n.id)||t[0].id})(C.formatList,"defaultFlag"),!C.currentFormatId)return N.error("获取打印格式失败,请联系管理员!"),W();(()=>{const t=C.formatList.map((t=>({label:t.name,key:t.id})));Y.unshift({label:B.value,key:"format",children:t})})();let r=null==(e=await L.queryTemplateParams())?void 0:e.obj;if(!r||!J.value)return N.error("获取打印模板失败,请联系管理员!"),W();C.templateParams=r,C.printParams=Z(C.templateParams,L.params)},et=async()=>{if(C.isInited)return!0;C.isInited=!0,C.spinning=!0,(()=>{if(M)return!1;M=new w})();const t=await L.queryPrintFormatByNumber();return await tt(t),C.spinning=!1,!0},rt=async(t=!0)=>{var e;if(await L.clickPrevFn())if(null==(e=L.params)?void 0:e.length){if(!C.visible){if(!await et())return!1}t&&(C.visible=!C.visible)}else N.warning(L.noDataMsg)},at=()=>{C.watchPrintParamsReformatFn&&C.watchPrintParamsReformatFn(),C.isInited?C.printParams=Z(C.templateParams,L.params):C.watchPrintParamsReformatFn=()=>i((()=>C.isInited),(t=>{if(!t)return!1;at()}))},nt=t=>{if(C.identityVerification.visible=!1,k(C.currentFormatId))return q(null,"edit");const e={formatId:C.currentFormatId,templateId:J.value,params:H(),token:t};M.editPrintFormat(e,(t=>{q(t,"edit")}),_)};async function it(){await rt(!1),G()}return a((()=>{C.isInited=!1})),n((()=>{null==M||M.destroy()})),i((()=>L.params),(t=>{if(!(null==t?void 0:t.length))return!1;at()}),{deep:!0}),D({directPrint:it}),(e,r)=>(o(),s(l,null,[m(p(P),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:C.visible,onClickoutside:Q,options:Y,onSelect:K,"render-label":R},{default:d((()=>[u(e.$slots,"button",{handleClickPrintBtn:rt,printSpinning:C.spinning,printbtnText:t.btnText,printVisible:C.visible},(()=>[m(p(I),{class:"dropdown-button",onClick:r[1]||(r[1]=c((()=>A("button")),["stop"]))},{default:d((()=>[f(v(t.btnText)+" ",1),m(p(h),{component:p(F),style:{"margin-left":"5px"},onClick:r[0]||(r[0]=c((()=>A("icon")),["stop"]))},null,8,["component"])])),_:1})]))])),_:3},8,["show","options"]),m(T,y(e.$attrs,{modelValue:C.identityVerification.visible,"onUpdate:modelValue":r[2]||(r[2]=t=>C.identityVerification.visible=t),formatId:C.currentFormatId,templateId:p(J),onSuccess:nt}),null,16,["modelValue","formatId","templateId"])],64))}});export{D as default};
1
+ import{defineComponent as t,reactive as e,computed as r,onMounted as a,onUnmounted as n,watch as i,openBlock as o,createElementBlock as s,Fragment as l,createVNode as m,unref as d,withCtx as p,renderSlot as u,withModifiers as c,createTextVNode as f,toDisplayString as v,mergeProps as y}from"vue";import{isObject as b}from"@vue/shared";import{useMessage as g,NDropdown as P,NButton as I,NIcon as h}from"naive-ui";import{ChevronDown as F}from"@vicons/ionicons5";import{Print as w}from"./utils/print.js";import{isIReport as k}from"./utils/browserPrint.js";import T from"./components/IdentityVerification.vue.js";import{format as x}from"date-fns";import{savePrivateFormatApi as S,getPrivateFormatApi as j}from"./api.js";var D=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",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:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})}},emits:["success","error","clickoutside"],setup(t,{expose:D,emit:O}){var L;const E=t,M=g();let N;const V={},C=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),Y=e([{label:E.printText,key:"printText"},{label:E.previewText,key:"previewText"},{label:E.pdfLoadText,key:"downloadPdf"},{label:E.formatEditText,key:"formatEditText"},...(null==(L=E.externalOptionConfig)?void 0:L.options)||[]]),J=r((()=>{if(!C.currentFormatId)return{};let t=C.currentFormatId;return C.formatList.find((e=>e.id===t))})),U=r((()=>{var t;return(null==(t=J.value)?void 0:t.name)||"格式选择"})),A=r((()=>{let t=C.formatList.find((t=>t.id===C.currentFormatId));return null==t?void 0:t.templateId})),B=async t=>{if(E.directPrint){if(C.spinning)return;return"button"===t?void await it():rt()}return rt()},q=t=>m("span",{class:{active:t.key===C.currentFormatId}},[t.label]),R=(t,e)=>{let r={type:e,formatId:C.currentFormatId,templateId:A.value};O("success",t,r)},_=t=>{O("error",t),b(t)&&"notInstalledApp"===t.type&&M.error(t.message)},z=()=>{O("error",{message:"前置条件执行错误"})},H=(t=0)=>{var e;const r=(null==(e=E.printParams)?void 0:e.length)?E.printParams[t]:C.printParams[t];return JSON.stringify({...r||{},...E.token?{token:E.token}:{}})},$=()=>{var t,e;let r={},a={};if(null==(t=C.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(C.printParams[0].datasetData||{}))?void 0:e[0])||"",r=JSON.stringify(C.printParams.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=r}else Object.keys(C.printParams[0]).forEach((t=>{a[t]=[],C.printParams.forEach((e=>{a[t].push(e[t])})),a[t]=a[t].join(",")}));return r=Object.assign({},JSON.parse(H(0)),a),JSON.stringify(r)},G=()=>{let t=C.printParams.length;const e=async e=>{try{--t<=0&&R(e,"print")}catch(t){console.log("error",t)}};E.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t={formatId:C.currentFormatId,templateId:A.value,printdlgshow:E.printdlgshow};if("MULTI"===E.strategy)for(let r=0;r<C.printParams.length;r++)r>0&&(t.printdlgshow="0"),N.printDirect({...t,params:H(r)},e,_);else N.printDirect({...t,params:$()},(t=>{R(t,"print")}),_)})).finally((()=>{C.visible=!1}))},K=async(t,e)=>{var r,a;switch(t){case"printText":G();break;case"previewText":(async()=>{E.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===E.strategy?H():$(),e={formatId:C.currentFormatId,templateId:A.value,params:t,btnprint:E.btnprint};N.preview(e,(t=>{R(t,"preview")}),_)})).finally((()=>{C.visible=!1}))})();break;case"formatEditText":E.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{C.identityVerification.visible=!0})).finally((()=>{C.visible=!1}));break;case"downloadPdf":(async()=>{E.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===E.strategy?H():$(),e={formatId:C.currentFormatId,templateId:A.value,print:{print:"1",type:"1"},params:t};N.downloadPDF(e,(t=>R(t,"preview")),_)})).finally((()=>{C.visible=!1}))})();break;default:{C.visible=!1;const n=C.formatList.find((e=>e.id===t))||{};if(Object.keys(n).length>0){C.currentFormatId=t;const[e]=Y;e.label=(null==n?void 0:n.name)||e.label,await S({formatForms:[{...n}],name:V.name||n.templateName,number:V.number||n.number,templateId:V.templateId||n.templateId,...V.id?{id:V.id}:{}},{token:E.token})}else null==(a=null==(r=E.externalOptionConfig)?void 0:r.onSelect)||a.call(r,t,e);break}}},Q=()=>{C.visible=!1,O("clickoutside")},W=()=>(C.isInited=!1,C.spinning=!1,setTimeout((()=>{C.visible=!1}),0),!1),X=(t,e,r)=>{const a={};return e.forEach((e=>{let n=((t,e)=>{const r={DATE:"YYYY-MM-DD",DATETIME:"YYYY-MM-DD HH:mm:ss"};let a=e;return Object.keys(r).includes(t.type)&&e&&(a=x(e,r[t.type])),(null==t?void 0:t.defaultValue)||a})(e,t[e[r]]);t[e[r]]&&n&&(a[e[r]]=n)})),a},Z=({customizeDataset:t=[],param:e=[]},r=[])=>r.map((r=>{let a={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;a.datasetData={[t.name]:JSON.stringify(X(r,e,"fieldName"))}})),a=Object.assign({},a,X(r,e,"key")),a})),tt=async t=>{var e;if(C.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):[],C.currentFormatId=await(async(t,e)=>{var r;if(!(null==t?void 0:t.length))return"";const{data:a}=await j({templateId:t[0].templateId},{token:E.token});if("SUCCESS"===a.result){const{formatForms:e=[]}=a.map||{};Object.assign(V,a.map||{});const n=null==(r=null==e?void 0:e[0])?void 0:r.id;if(n&&t.map((t=>t.id)).includes(n))return n}const n=t.find((t=>1==t[e]));return(null==n?void 0:n.id)||t[0].id})(C.formatList,"defaultFlag"),!C.currentFormatId)return M.error("获取打印格式失败,请联系管理员!"),W();(()=>{const t=C.formatList.map((t=>({label:t.name,key:t.id})));Y.unshift({label:U.value,key:"format",children:t})})();let r=null==(e=await E.queryTemplateParams())?void 0:e.obj;if(!r||!A.value)return M.error("获取打印模板失败,请联系管理员!"),W();C.templateParams=r,C.printParams=Z(C.templateParams,E.params)},et=async()=>{if(C.isInited)return!0;C.isInited=!0,C.spinning=!0,(()=>{if(N)return!1;N=new w})();const t=await E.queryPrintFormatByNumber();return await tt(t),C.spinning=!1,!0},rt=async(t=!0)=>{var e;if(await E.clickPrevFn())if(null==(e=E.params)?void 0:e.length){if(!C.visible){if(!await et())return!1}t&&(C.visible=!C.visible)}else M.warning(E.noDataMsg)},at=()=>{C.watchPrintParamsReformatFn&&C.watchPrintParamsReformatFn(),C.isInited?C.printParams=Z(C.templateParams,E.params):C.watchPrintParamsReformatFn=()=>i((()=>C.isInited),(t=>{if(!t)return!1;at()}))},nt=t=>{if(C.identityVerification.visible=!1,k(C.currentFormatId))return R(null,"edit");const e={formatId:C.currentFormatId,templateId:A.value,params:H(),token:t};N.editPrintFormat(e,(t=>{R(t,"edit")}),_)};async function it(){await rt(!1),G()}return a((()=>{C.isInited=!1})),n((()=>{null==N||N.destroy()})),i((()=>E.params),(t=>{if(!(null==t?void 0:t.length))return!1;at()}),{deep:!0}),D({directPrint:it}),(e,r)=>(o(),s(l,null,[m(d(P),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:C.visible,onClickoutside:Q,options:Y,onSelect:K,"render-label":q},{default:p((()=>[u(e.$slots,"button",{handleClickPrintBtn:rt,printSpinning:C.spinning,printbtnText:t.btnText,printVisible:C.visible},(()=>[m(d(I),{class:"dropdown-button",onClick:r[1]||(r[1]=c((()=>B("button")),["stop"]))},{default:p((()=>[f(v(t.btnText)+" ",1),m(d(h),{component:d(F),style:{"margin-left":"5px"},onClick:r[0]||(r[0]=c((()=>B("icon")),["stop"]))},null,8,["component"])])),_:1})]))])),_:3},8,["show","options"]),m(T,y(e.$attrs,{modelValue:C.identityVerification.visible,"onUpdate:modelValue":r[2]||(r[2]=t=>C.identityVerification.visible=t),formatId:C.currentFormatId,templateId:d(A),onSuccess:nt}),null,16,["modelValue","formatId","templateId"])],64))}});export{D as default};