cnhis-design-vue 3.2.4 → 3.2.5-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. package/README.md +87 -87
  2. package/es/components/big-table/index.d.ts +1 -1
  3. package/es/components/big-table/src/BigTable.vue.d.ts +1 -1
  4. package/es/components/button-print/index.d.ts +13 -6
  5. package/es/components/button-print/src/ButtonPrint.vue.d.ts +13 -6
  6. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +13 -6
  7. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  8. package/es/components/button-print/src/utils/print.d.ts +1 -1
  9. package/es/components/button-print/src/utils/print.js +1 -1
  10. package/es/components/button-print/style/index.css +1 -1
  11. package/es/components/callback/src/components/render/popupMaps.d.ts +6 -6
  12. package/es/components/classification/src/index.vue.d.ts +0 -3
  13. package/es/components/field-set/src/FieldColor.vue.d.ts +15 -1
  14. package/es/components/field-set/src/FieldFilter.vue.d.ts +15 -1
  15. package/es/components/field-set/src/FieldSet.vue.d.ts +30 -1
  16. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  17. package/es/components/field-set/src/components/Row.vue.d.ts +15 -1
  18. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  19. package/es/components/form-config/index.d.ts +18 -18
  20. package/es/components/form-config/src/FormConfig.vue.d.ts +18 -18
  21. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +6 -6
  22. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +9 -9
  23. package/es/components/form-render/index.d.ts +6 -6
  24. package/es/components/form-render/src/FormRender.vue.d.ts +6 -6
  25. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +6 -6
  26. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -1
  27. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -1
  28. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
  29. package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +2 -2
  30. package/es/components/form-render/src/types/index.d.ts +1 -1
  31. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  32. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
  33. package/es/components/iho-table/src/utils/index.d.ts +1 -0
  34. package/es/components/iho-table/src/utils/index.js +1 -1
  35. package/es/components/index.css +1 -1
  36. package/es/components/info-header/index.d.ts +69 -17
  37. package/es/components/info-header/src/InfoHeader.vue.d.ts +69 -17
  38. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  39. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +23 -1
  40. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +1 -1
  41. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +31 -1
  42. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue2.js +1 -1
  43. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.d.ts +13 -0
  44. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue2.js +1 -1
  45. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +46 -7
  46. package/es/components/info-header/src/components/infoDescription/index.vue2.js +1 -1
  47. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +6 -6
  48. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  49. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  50. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  51. package/es/components/shortcut-setter/index.d.ts +6 -6
  52. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -6
  53. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  54. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  55. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  56. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  57. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  58. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  59. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  60. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  61. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  62. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  63. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  64. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  65. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  66. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  67. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  68. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  69. package/es/shared/assets/img/emoji/emotion_001.png.js +1 -1
  70. package/es/shared/assets/img/emoji/emotion_002.png.js +1 -1
  71. package/es/shared/assets/img/emoji/emotion_003.png.js +1 -1
  72. package/es/shared/assets/img/emoji/emotion_004.png.js +1 -1
  73. package/es/shared/assets/img/emoji/emotion_005.png.js +1 -1
  74. package/es/shared/assets/img/emoji/emotion_006.png.js +1 -1
  75. package/es/shared/assets/img/emoji/emotion_007.png.js +1 -1
  76. package/es/shared/assets/img/emoji/emotion_008.png.js +1 -1
  77. package/es/shared/assets/img/emoji/emotion_009.png.js +1 -1
  78. package/es/shared/assets/img/emoji/emotion_010.png.js +1 -1
  79. package/es/shared/assets/img/emoji/emotion_011.png.js +1 -1
  80. package/es/shared/assets/img/emoji/emotion_012.png.js +1 -1
  81. package/es/shared/assets/img/emoji/emotion_013.png.js +1 -1
  82. package/es/shared/assets/img/emoji/emotion_014.png.js +1 -1
  83. package/es/shared/assets/img/emoji/emotion_015.png.js +1 -1
  84. package/es/shared/assets/img/emoji/emotion_016.png.js +1 -1
  85. package/es/shared/assets/img/emoji/emotion_017.png.js +1 -1
  86. package/es/shared/assets/img/emoji/emotion_018.png.js +1 -1
  87. package/es/shared/assets/img/emoji/emotion_019.png.js +1 -1
  88. package/es/shared/assets/img/emoji/emotion_020.png.js +1 -1
  89. package/es/shared/assets/img/emoji/emotion_021.png.js +1 -1
  90. package/es/shared/assets/img/emoji/emotion_022.png.js +1 -1
  91. package/es/shared/assets/img/emoji/emotion_023.png.js +1 -1
  92. package/es/shared/assets/img/emoji/emotion_024.png.js +1 -1
  93. package/es/shared/assets/img/emoji/emotion_025.png.js +1 -1
  94. package/es/shared/assets/img/emoji/emotion_026.png.js +1 -1
  95. package/es/shared/assets/img/emoji/emotion_027.png.js +1 -1
  96. package/es/shared/assets/img/emoji/emotion_028.png.js +1 -1
  97. package/es/shared/assets/img/emoji/emotion_029.png.js +1 -1
  98. package/es/shared/assets/img/emoji/emotion_030.png.js +1 -1
  99. package/es/shared/assets/img/emoji/emotion_031.png.js +1 -1
  100. package/es/shared/assets/img/emoji/emotion_032.png.js +1 -1
  101. package/es/shared/assets/img/emoji/emotion_033.png.js +1 -1
  102. package/es/shared/assets/img/emoji/emotion_034.png.js +1 -1
  103. package/es/shared/assets/img/emoji/emotion_035.png.js +1 -1
  104. package/es/shared/assets/img/emoji/emotion_036.png.js +1 -1
  105. package/es/shared/assets/img/emoji/emotion_037.png.js +1 -1
  106. package/es/shared/assets/img/emoji/emotion_038.png.js +1 -1
  107. package/es/shared/assets/img/emoji/emotion_039.png.js +1 -1
  108. package/es/shared/assets/img/emoji/emotion_040.png.js +1 -1
  109. package/es/shared/assets/img/emoji/emotion_041.png.js +1 -1
  110. package/es/shared/assets/img/emoji/emotion_042.png.js +1 -1
  111. package/es/shared/assets/img/emoji/emotion_043.png.js +1 -1
  112. package/es/shared/assets/img/emoji/emotion_044.png.js +1 -1
  113. package/es/shared/assets/img/emoji/emotion_045.png.js +1 -1
  114. package/es/shared/assets/img/emoji/emotion_046.png.js +1 -1
  115. package/es/shared/assets/img/emoji/emotion_047.png.js +1 -1
  116. package/es/shared/assets/img/emoji/emotion_048.png.js +1 -1
  117. package/es/shared/assets/img/emoji/emotion_049.png.js +1 -1
  118. package/es/shared/assets/img/emoji/emotion_050.png.js +1 -1
  119. package/es/shared/assets/img/emoji/emotion_051.png.js +1 -1
  120. package/es/shared/assets/img/emoji/emotion_052.png.js +1 -1
  121. package/es/shared/assets/img/emoji/emotion_053.png.js +1 -1
  122. package/es/shared/assets/img/emoji/emotion_054.png.js +1 -1
  123. package/es/shared/assets/img/emoji/emotion_055.png.js +1 -1
  124. package/es/shared/assets/img/emoji/emotion_056.png.js +1 -1
  125. package/es/shared/assets/img/emoji/emotion_057.png.js +1 -1
  126. package/es/shared/assets/img/emoji/emotion_058.png.js +1 -1
  127. package/es/shared/assets/img/emoji/emotion_059.png.js +1 -1
  128. package/es/shared/assets/img/emoji/emotion_060.png.js +1 -1
  129. package/es/shared/assets/img/emoji/emotion_061.png.js +1 -1
  130. package/es/shared/assets/img/emoji/emotion_062.png.js +1 -1
  131. package/es/shared/assets/img/emoji/emotion_063.png.js +1 -1
  132. package/es/shared/assets/img/emoji/emotion_064.png.js +1 -1
  133. package/es/shared/assets/img/emoji/emotion_065.png.js +1 -1
  134. package/es/shared/assets/img/emoji/emotion_066.png.js +1 -1
  135. package/es/shared/assets/img/emoji/emotion_067.png.js +1 -1
  136. package/es/shared/assets/img/emoji/emotion_068.png.js +1 -1
  137. package/es/shared/assets/img/emoji/emotion_069.png.js +1 -1
  138. package/es/shared/assets/img/emoji/emotion_070.png.js +1 -1
  139. package/es/shared/assets/img/emoji/emotion_071.png.js +1 -1
  140. package/es/shared/assets/img/emoji/emotion_072.png.js +1 -1
  141. package/es/shared/assets/img/emoji/emotion_073.png.js +1 -1
  142. package/es/shared/assets/img/emoji/emotion_074.png.js +1 -1
  143. package/es/shared/assets/img/emoji/emotion_075.png.js +1 -1
  144. package/es/shared/assets/img/emoji/emotion_076.png.js +1 -1
  145. package/es/shared/assets/img/emoji/emotion_077.png.js +1 -1
  146. package/es/shared/assets/img/emoji/emotion_078.png.js +1 -1
  147. package/es/shared/assets/img/emoji/emotion_079.png.js +1 -1
  148. package/es/shared/assets/img/emoji/emotion_080.png.js +1 -1
  149. package/es/shared/assets/img/emoji/emotion_081.png.js +1 -1
  150. package/es/shared/assets/img/emoji/emotion_082.png.js +1 -1
  151. package/es/shared/assets/img/emoji/emotion_083.png.js +1 -1
  152. package/es/shared/assets/img/emoji/emotion_084.png.js +1 -1
  153. package/es/shared/assets/img/emoji/emotion_085.png.js +1 -1
  154. package/es/shared/assets/img/emoji/emotion_086.png.js +1 -1
  155. package/es/shared/assets/img/emoji/emotion_087.png.js +1 -1
  156. package/es/shared/assets/img/emoji/emotion_088.png.js +1 -1
  157. package/es/shared/assets/img/emoji/emotion_089.png.js +1 -1
  158. package/es/shared/assets/img/emoji/emotion_090.png.js +1 -1
  159. package/es/shared/assets/img/emoji/emotion_091.png.js +1 -1
  160. package/es/shared/assets/img/emoji/emotion_092.png.js +1 -1
  161. package/es/shared/assets/img/emoji/emotion_093.png.js +1 -1
  162. package/es/shared/assets/img/emoji/emotion_094.png.js +1 -1
  163. package/es/shared/assets/img/emoji/emotion_095.png.js +1 -1
  164. package/es/shared/assets/img/emoji/emotion_096.png.js +1 -1
  165. package/es/shared/assets/img/emoji/emotion_097.png.js +1 -1
  166. package/es/shared/assets/img/emoji/emotion_098.png.js +1 -1
  167. package/es/shared/assets/img/emoji/emotion_099.png.js +1 -1
  168. package/es/shared/assets/img/emoji/emotion_100.png.js +1 -1
  169. package/es/shared/assets/img/emoji/emotion_101.png.js +1 -1
  170. package/es/shared/assets/img/emoji/emotion_102.png.js +1 -1
  171. package/es/shared/assets/img/emoji/emotion_103.png.js +1 -1
  172. package/es/shared/assets/img/emoji/emotion_104.png.js +1 -1
  173. package/es/shared/assets/img/emoji/emotion_105.png.js +1 -1
  174. package/es/shared/assets/img/emoji/emotion_106.png.js +1 -1
  175. package/es/shared/assets/img/emoji/emotion_107.png.js +1 -1
  176. package/es/shared/assets/img/emoji/emotion_108.png.js +1 -1
  177. package/es/shared/assets/img/emoji/emotion_109.png.js +1 -1
  178. package/es/shared/assets/img/emoji/emotion_110.png.js +1 -1
  179. package/es/shared/assets/img/emoji/emotion_111.png.js +1 -1
  180. package/es/shared/assets/img/emoji/emotion_112.png.js +1 -1
  181. package/es/shared/assets/img/emoji/emotion_113.png.js +1 -1
  182. package/es/shared/assets/img/emoji/emotion_114.png.js +1 -1
  183. package/es/shared/assets/img/emoji/emotion_115.png.js +1 -1
  184. package/es/shared/assets/img/emoji/emotion_116.png.js +1 -1
  185. package/es/shared/assets/img/emoji/emotion_117.png.js +1 -1
  186. package/es/shared/assets/img/emoji/emotion_118.png.js +1 -1
  187. package/es/shared/assets/img/emoji/emotion_119.png.js +1 -1
  188. package/es/shared/assets/img/emoji/emotion_120.png.js +1 -1
  189. package/es/shared/assets/img/emoji/emotion_121.png.js +1 -1
  190. package/es/shared/assets/img/emoji/emotion_122.png.js +1 -1
  191. package/es/shared/assets/img/emoji/emotion_123.png.js +1 -1
  192. package/es/shared/assets/img/emoji/emotion_124.png.js +1 -1
  193. package/es/shared/assets/img/emoji/emotion_125.png.js +1 -1
  194. package/es/shared/assets/img/emoji/emotion_126.png.js +1 -1
  195. package/es/shared/assets/img/emoji/emotion_127.png.js +1 -1
  196. package/es/shared/assets/img/emoji/emotion_128.png.js +1 -1
  197. package/es/shared/assets/img/emoji/emotion_129.png.js +1 -1
  198. package/es/shared/assets/img/emoji/emotion_130.png.js +1 -1
  199. package/es/shared/assets/img/emoji/emotion_131.png.js +1 -1
  200. package/es/shared/assets/img/emoji/emotion_132.png.js +1 -1
  201. package/es/shared/assets/img/emoji/emotion_133.png.js +1 -1
  202. package/es/shared/assets/img/emoji/emotion_134.png.js +1 -1
  203. package/es/shared/assets/img/emoji/emotion_135.png.js +1 -1
  204. package/es/shared/assets/img/emoji/emotion_136.png.js +1 -1
  205. package/es/shared/assets/img/emoji/emotion_137.png.js +1 -1
  206. package/es/shared/assets/img/emoji/emotion_138.png.js +1 -1
  207. package/es/shared/assets/img/emoji/emotion_139.png.js +1 -1
  208. package/es/shared/assets/img/emoji/emotion_140.png.js +1 -1
  209. package/es/shared/assets/img/emoji/emotion_141.png.js +1 -1
  210. package/es/shared/assets/img/emoji/emotion_142.png.js +1 -1
  211. package/es/shared/assets/img/emoji/emotion_143.png.js +1 -1
  212. package/es/shared/assets/img/emoji/emotion_144.png.js +1 -1
  213. package/es/shared/assets/img/emoji/emotion_145.png.js +1 -1
  214. package/es/shared/assets/img/emoji/emotion_146.png.js +1 -1
  215. package/es/shared/assets/img/emoji/emotion_147.png.js +1 -1
  216. package/es/shared/assets/img/emoji/emotion_148.png.js +1 -1
  217. package/es/shared/assets/img/emoji/emotion_149.png.js +1 -1
  218. package/es/shared/assets/img/emoji/emotion_150.png.js +1 -1
  219. package/es/shared/assets/img/emoji/emotion_151.png.js +1 -1
  220. package/es/shared/assets/img/emoji/emotion_152.png.js +1 -1
  221. package/es/shared/assets/img/emoji/emotion_153.png.js +1 -1
  222. package/es/shared/assets/img/emoji/emotion_154.png.js +1 -1
  223. package/es/shared/assets/img/emoji/emotion_155.png.js +1 -1
  224. package/es/shared/assets/img/emoji/emotion_156.png.js +1 -1
  225. package/es/shared/assets/img/emoji/emotion_157.png.js +1 -1
  226. package/es/shared/assets/img/emoji/emotion_158.png.js +1 -1
  227. package/es/shared/assets/img/emoji/emotion_159.png.js +1 -1
  228. package/es/shared/assets/img/emoji/emotion_160.png.js +1 -1
  229. package/es/shared/assets/img/emoji/emotion_161.png.js +1 -1
  230. package/es/shared/assets/img/emoji/emotion_162.png.js +1 -1
  231. package/es/shared/assets/img/emoji/emotion_163.png.js +1 -1
  232. package/es/shared/assets/img/emoji/emotion_164.png.js +1 -1
  233. package/es/shared/assets/img/emoji/emotion_165.png.js +1 -1
  234. package/es/shared/assets/img/emoji/emotion_166.png.js +1 -1
  235. package/es/shared/assets/img/emoji/emotion_167.png.js +1 -1
  236. package/es/shared/assets/img/failure.png.js +1 -1
  237. package/es/shared/assets/img/no-permission.png.js +1 -1
  238. package/es/shared/assets/img/nodata.png.js +1 -1
  239. package/es/shared/assets/img/notfound.png.js +1 -1
  240. package/es/shared/assets/img/qr.png.js +1 -1
  241. package/es/shared/assets/img/success.png.js +1 -1
  242. package/es/shared/assets/img/table_style_2.png.js +1 -1
  243. package/es/shared/assets/img/tooth/l-b-1.png.js +1 -1
  244. package/es/shared/assets/img/tooth/l-b-2.png.js +1 -1
  245. package/es/shared/assets/img/tooth/l-b-3.png.js +1 -1
  246. package/es/shared/assets/img/tooth/l-b-4.png.js +1 -1
  247. package/es/shared/assets/img/tooth/l-b-5.png.js +1 -1
  248. package/es/shared/assets/img/tooth/l-b-6.png.js +1 -1
  249. package/es/shared/assets/img/tooth/l-b-7.png.js +1 -1
  250. package/es/shared/assets/img/tooth/l-b-8.png.js +1 -1
  251. package/es/shared/assets/img/tooth/l-t-1.png.js +1 -1
  252. package/es/shared/assets/img/tooth/l-t-2.png.js +1 -1
  253. package/es/shared/assets/img/tooth/l-t-3.png.js +1 -1
  254. package/es/shared/assets/img/tooth/l-t-4.png.js +1 -1
  255. package/es/shared/assets/img/tooth/l-t-5.png.js +1 -1
  256. package/es/shared/assets/img/tooth/l-t-6.png.js +1 -1
  257. package/es/shared/assets/img/tooth/l-t-7.png.js +1 -1
  258. package/es/shared/assets/img/tooth/l-t-8.png.js +1 -1
  259. package/es/shared/assets/img/tooth/r-b-1.png.js +1 -1
  260. package/es/shared/assets/img/tooth/r-b-2.png.js +1 -1
  261. package/es/shared/assets/img/tooth/r-b-3.png.js +1 -1
  262. package/es/shared/assets/img/tooth/r-b-4.png.js +1 -1
  263. package/es/shared/assets/img/tooth/r-b-5.png.js +1 -1
  264. package/es/shared/assets/img/tooth/r-b-6.png.js +1 -1
  265. package/es/shared/assets/img/tooth/r-b-7.png.js +1 -1
  266. package/es/shared/assets/img/tooth/r-b-8.png.js +1 -1
  267. package/es/shared/assets/img/tooth/r-t-1.png.js +1 -1
  268. package/es/shared/assets/img/tooth/r-t-2.png.js +1 -1
  269. package/es/shared/assets/img/tooth/r-t-3.png.js +1 -1
  270. package/es/shared/assets/img/tooth/r-t-4.png.js +1 -1
  271. package/es/shared/assets/img/tooth/r-t-5.png.js +1 -1
  272. package/es/shared/assets/img/tooth/r-t-6.png.js +1 -1
  273. package/es/shared/assets/img/tooth/r-t-7.png.js +1 -1
  274. package/es/shared/assets/img/tooth/r-t-8.png.js +1 -1
  275. package/es/shared/assets/img/video.png.js +1 -1
  276. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  277. package/es/shared/assets/img/xb_big.png.js +1 -1
  278. package/es/shared/assets/img/xb_small.png.js +1 -1
  279. package/es/shared/hooks/useAsyncQueue/types.d.ts +1 -1
  280. package/es/shared/hooks/useFormRequest/index.js +1 -1
  281. package/es/shared/package.json.js +1 -1
  282. package/package.json +2 -2
  283. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  284. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  285. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  286. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  287. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  288. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  289. package/es/shared/utils/tapable/index.d.ts +0 -139
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
+ ```
@@ -610,7 +610,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
610
610
  setGroupTreeExpand: () => void;
611
611
  resetTableInlineEditStatus: () => false | undefined;
612
612
  renderAnnotation: (columnConfig: import("../../shared/types").AnyObject) => JSX.Element | null;
613
- toolTipTitle: (item: any, type?: any) => (JSX.Element | null)[] | (() => any);
613
+ toolTipTitle: (item: any, type?: any) => (() => any) | (JSX.Element | null)[];
614
614
  triggerExpand: (e: any, isExpand: any) => void;
615
615
  getOtherConfigInit: () => any;
616
616
  refreshTable: () => void;
@@ -612,7 +612,7 @@ declare const _default: import("vue").DefineComponent<{
612
612
  setGroupTreeExpand: () => void;
613
613
  resetTableInlineEditStatus: () => false | undefined;
614
614
  renderAnnotation: (columnConfig: AnyObject) => JSX.Element | null;
615
- toolTipTitle: (item: any, type?: any) => (JSX.Element | null)[] | (() => any);
615
+ toolTipTitle: (item: any, type?: any) => (() => any) | (JSX.Element | null)[];
616
616
  triggerExpand: (e: any, isExpand: any) => void;
617
617
  getOtherConfigInit: () => any;
618
618
  refreshTable: () => void;
@@ -293,6 +293,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
293
293
  isShowOutSetting: boolean;
294
294
  customProps: {};
295
295
  outerPrintKeys: never[];
296
+ defaultFormatId: string;
296
297
  };
297
298
  };
298
299
  }, {
@@ -400,6 +401,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
400
401
  isShowOutSetting: boolean;
401
402
  customProps: {};
402
403
  outerPrintKeys: never[];
404
+ defaultFormatId: string;
403
405
  };
404
406
  };
405
407
  }>> & {}>>;
@@ -410,7 +412,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
410
412
  spinning: boolean;
411
413
  visible: boolean;
412
414
  formatList: never[];
413
- templateParams: {};
415
+ templateParams: never[];
414
416
  printParams: never[];
415
417
  currentFormatId: string;
416
418
  identityVerification: {
@@ -420,6 +422,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
420
422
  watchPrintParamsReformatFn: null;
421
423
  spinTimer: null;
422
424
  isClickOuterPrint: boolean;
425
+ curPrintParamList: never[];
423
426
  };
424
427
  options: import("vue").Ref<import("../../shared/types").AnyObject[]>;
425
428
  operations: import("vue").Ref<import("../../shared/types").AnyObject[]>;
@@ -433,21 +436,24 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
433
436
  isOperation: boolean;
434
437
  isOutSetting: boolean;
435
438
  };
436
- innerPrintItems: import("vue").Ref<never[]>;
437
- outerPrintItems: import("vue").Ref<never[]>;
439
+ innerPrintItems: import("vue").Ref<any[]>;
440
+ outerPrintItems: import("vue").Ref<any[]>;
438
441
  currentFormatItem: import("vue").ComputedRef<{} | undefined>;
439
442
  formatTitle: import("vue").ComputedRef<any>;
440
443
  getTemplateIdByFormatId: import("vue").ComputedRef<any>;
444
+ getTemplateCodeByFormatId: import("vue").ComputedRef<any>;
441
445
  isShowPrintAllBtn: import("vue").ComputedRef<any>;
442
446
  isShowOutSettingBtn: import("vue").ComputedRef<any>;
443
447
  printCustomProps: import("vue").ComputedRef<any>;
448
+ defaultPrintFormatId: import("vue").ComputedRef<any>;
444
449
  showSettingItems: import("vue").ComputedRef<import("../../shared/types").AnyObject[]>;
445
450
  isSelectedAll: import("vue").WritableComputedRef<boolean>;
446
451
  initShowDownList: () => Promise<void>;
447
452
  printAllButtonClick: (origin: string) => Promise<void>;
448
453
  renderLabel: (option: import("../../shared/types").AnyObject) => JSX.Element;
454
+ getDownList: (targetList: any[], curOuter: any) => any[];
449
455
  handleTypeChange: (name: string, key: string) => void;
450
- handleTypeClick: (name: string, key: string) => void;
456
+ handleTypeClick: (name: string, key: string, option: any) => never[] | undefined;
451
457
  savePrintOutSetting: () => void;
452
458
  handleTwoShow: (name: string) => void;
453
459
  handleClickOutHide: (shwoType: string) => void;
@@ -465,14 +471,13 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
465
471
  handleClickPreview: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
466
472
  handleClickPdf: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
467
473
  handleClickEdit: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => void;
468
- handleResetPrinter: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => void;
474
+ handleResetPrinter: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
469
475
  handleSelect: (type: string, { templateCode, templateId, key }: import("../../shared/types").AnyObject, isOuterClick: boolean) => Promise<void>;
470
476
  handleClickOutside: () => void;
471
477
  instantiatePrintSDK: () => false | undefined;
472
478
  getDefaultFormatId: (list: any[], key: string | number) => Promise<any>;
473
479
  setOptions: () => void;
474
480
  formatFormatList: (list: any[]) => any;
475
- requestError: () => boolean;
476
481
  formatDefaultVal: (i: any, tableVal?: any) => any;
477
482
  formatSomeTypeParams: (templateParams: any[], params?: any[]) => any;
478
483
  formatPrintParams: (paramObj: any, fieldList: any[], keyName: string) => any;
@@ -488,6 +493,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
488
493
  reformatPrintParams: () => void;
489
494
  verifiySuccess: (token: string) => void;
490
495
  directPrint: () => Promise<void>;
496
+ directDefaultFormatPrint: (defaultFormatId: string) => Promise<void>;
491
497
  NDropdown: any;
492
498
  NButton: any;
493
499
  NIcon: any;
@@ -2224,6 +2230,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
2224
2230
  isShowOutSetting: boolean;
2225
2231
  customProps: {};
2226
2232
  outerPrintKeys: never[];
2233
+ defaultFormatId: string;
2227
2234
  };
2228
2235
  };
2229
2236
  }>>, {
@@ -299,6 +299,7 @@ declare const _default: import("vue").DefineComponent<{
299
299
  isShowOutSetting: boolean;
300
300
  customProps: {};
301
301
  outerPrintKeys: never[];
302
+ defaultFormatId: string;
302
303
  };
303
304
  };
304
305
  }, {
@@ -406,6 +407,7 @@ declare const _default: import("vue").DefineComponent<{
406
407
  isShowOutSetting: boolean;
407
408
  customProps: {};
408
409
  outerPrintKeys: never[];
410
+ defaultFormatId: string;
409
411
  };
410
412
  };
411
413
  }>> & {}>>;
@@ -416,7 +418,7 @@ declare const _default: import("vue").DefineComponent<{
416
418
  spinning: boolean;
417
419
  visible: boolean;
418
420
  formatList: never[];
419
- templateParams: {};
421
+ templateParams: never[];
420
422
  printParams: never[];
421
423
  currentFormatId: string;
422
424
  identityVerification: {
@@ -426,6 +428,7 @@ declare const _default: import("vue").DefineComponent<{
426
428
  watchPrintParamsReformatFn: null;
427
429
  spinTimer: null;
428
430
  isClickOuterPrint: boolean;
431
+ curPrintParamList: never[];
429
432
  };
430
433
  options: import("vue").Ref<AnyObject[]>;
431
434
  operations: import("vue").Ref<AnyObject[]>;
@@ -439,21 +442,24 @@ declare const _default: import("vue").DefineComponent<{
439
442
  isOperation: boolean;
440
443
  isOutSetting: boolean;
441
444
  };
442
- innerPrintItems: import("vue").Ref<never[]>;
443
- outerPrintItems: import("vue").Ref<never[]>;
445
+ innerPrintItems: import("vue").Ref<any[]>;
446
+ outerPrintItems: import("vue").Ref<any[]>;
444
447
  currentFormatItem: import("vue").ComputedRef<{} | undefined>;
445
448
  formatTitle: import("vue").ComputedRef<any>;
446
449
  getTemplateIdByFormatId: import("vue").ComputedRef<any>;
450
+ getTemplateCodeByFormatId: import("vue").ComputedRef<any>;
447
451
  isShowPrintAllBtn: import("vue").ComputedRef<any>;
448
452
  isShowOutSettingBtn: import("vue").ComputedRef<any>;
449
453
  printCustomProps: import("vue").ComputedRef<any>;
454
+ defaultPrintFormatId: import("vue").ComputedRef<any>;
450
455
  showSettingItems: import("vue").ComputedRef<AnyObject[]>;
451
456
  isSelectedAll: import("vue").WritableComputedRef<boolean>;
452
457
  initShowDownList: () => Promise<void>;
453
458
  printAllButtonClick: (origin: string) => Promise<void>;
454
459
  renderLabel: (option: AnyObject) => JSX.Element;
460
+ getDownList: (targetList: any[], curOuter: any) => any[];
455
461
  handleTypeChange: (name: string, key: string) => void;
456
- handleTypeClick: (name: string, key: string) => void;
462
+ handleTypeClick: (name: string, key: string, option: any) => never[] | undefined;
457
463
  savePrintOutSetting: () => void;
458
464
  handleTwoShow: (name: string) => void;
459
465
  handleClickOutHide: (shwoType: string) => void;
@@ -471,14 +477,13 @@ declare const _default: import("vue").DefineComponent<{
471
477
  handleClickPreview: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
472
478
  handleClickPdf: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
473
479
  handleClickEdit: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => void;
474
- handleResetPrinter: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => void;
480
+ handleResetPrinter: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
475
481
  handleSelect: (type: string, { templateCode, templateId, key }: AnyObject, isOuterClick: boolean) => Promise<void>;
476
482
  handleClickOutside: () => void;
477
483
  instantiatePrintSDK: () => false | undefined;
478
484
  getDefaultFormatId: (list: any[], key: string | number) => Promise<any>;
479
485
  setOptions: () => void;
480
486
  formatFormatList: (list: any[]) => any;
481
- requestError: () => boolean;
482
487
  formatDefaultVal: (i: any, tableVal?: any) => any;
483
488
  formatSomeTypeParams: (templateParams: any[], params?: any[]) => any;
484
489
  formatPrintParams: (paramObj: any, fieldList: any[], keyName: string) => any;
@@ -494,6 +499,7 @@ declare const _default: import("vue").DefineComponent<{
494
499
  reformatPrintParams: () => void;
495
500
  verifiySuccess: (token: string) => void;
496
501
  directPrint: () => Promise<void>;
502
+ directDefaultFormatPrint: (defaultFormatId: string) => Promise<void>;
497
503
  NDropdown: any;
498
504
  NButton: any;
499
505
  NIcon: any;
@@ -2230,6 +2236,7 @@ declare const _default: import("vue").DefineComponent<{
2230
2236
  isShowOutSetting: boolean;
2231
2237
  customProps: {};
2232
2238
  outerPrintKeys: never[];
2239
+ defaultFormatId: string;
2233
2240
  };
2234
2241
  };
2235
2242
  }>>, {
@@ -101,6 +101,7 @@ declare const _default: import("vue").DefineComponent<{
101
101
  isShowOutSetting: boolean;
102
102
  customProps: {};
103
103
  outerPrintKeys: never[];
104
+ defaultFormatId: string;
104
105
  };
105
106
  };
106
107
  }, {
@@ -211,6 +212,7 @@ declare const _default: import("vue").DefineComponent<{
211
212
  isShowOutSetting: boolean;
212
213
  customProps: {};
213
214
  outerPrintKeys: never[];
215
+ defaultFormatId: string;
214
216
  };
215
217
  };
216
218
  }>> & {}>>;
@@ -221,7 +223,7 @@ declare const _default: import("vue").DefineComponent<{
221
223
  spinning: boolean;
222
224
  visible: boolean;
223
225
  formatList: never[];
224
- templateParams: {};
226
+ templateParams: never[];
225
227
  printParams: never[];
226
228
  currentFormatId: string;
227
229
  identityVerification: {
@@ -231,6 +233,7 @@ declare const _default: import("vue").DefineComponent<{
231
233
  watchPrintParamsReformatFn: null;
232
234
  spinTimer: null;
233
235
  isClickOuterPrint: boolean;
236
+ curPrintParamList: never[];
234
237
  };
235
238
  options: import("vue").Ref<AnyObject[]>;
236
239
  operations: import("vue").Ref<AnyObject[]>;
@@ -244,21 +247,24 @@ declare const _default: import("vue").DefineComponent<{
244
247
  isOperation: boolean;
245
248
  isOutSetting: boolean;
246
249
  };
247
- innerPrintItems: import("vue").Ref<never[]>;
248
- outerPrintItems: import("vue").Ref<never[]>;
250
+ innerPrintItems: import("vue").Ref<any[]>;
251
+ outerPrintItems: import("vue").Ref<any[]>;
249
252
  currentFormatItem: import("vue").ComputedRef<{} | undefined>;
250
253
  formatTitle: import("vue").ComputedRef<any>;
251
254
  getTemplateIdByFormatId: import("vue").ComputedRef<any>;
255
+ getTemplateCodeByFormatId: import("vue").ComputedRef<any>;
252
256
  isShowPrintAllBtn: import("vue").ComputedRef<any>;
253
257
  isShowOutSettingBtn: import("vue").ComputedRef<any>;
254
258
  printCustomProps: import("vue").ComputedRef<any>;
259
+ defaultPrintFormatId: import("vue").ComputedRef<any>;
255
260
  showSettingItems: import("vue").ComputedRef<AnyObject[]>;
256
261
  isSelectedAll: import("vue").WritableComputedRef<boolean>;
257
262
  initShowDownList: () => Promise<void>;
258
263
  printAllButtonClick: (origin: string) => Promise<void>;
259
264
  renderLabel: (option: AnyObject) => JSX.Element;
265
+ getDownList: (targetList: any[], curOuter: any) => any[];
260
266
  handleTypeChange: (name: string, key: string) => void;
261
- handleTypeClick: (name: string, key: string) => void;
267
+ handleTypeClick: (name: string, key: string, option: any) => never[] | undefined;
262
268
  savePrintOutSetting: () => void;
263
269
  handleTwoShow: (name: string) => void;
264
270
  handleClickOutHide: (shwoType: string) => void;
@@ -276,14 +282,13 @@ declare const _default: import("vue").DefineComponent<{
276
282
  handleClickPreview: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
277
283
  handleClickPdf: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
278
284
  handleClickEdit: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => void;
279
- handleResetPrinter: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => void;
285
+ handleResetPrinter: (curPrintParamList: any[] | undefined, templateCode: string, templateId: string, formatId: string) => Promise<void>;
280
286
  handleSelect: (type: string, { templateCode, templateId, key }: AnyObject, isOuterClick: boolean) => Promise<void>;
281
287
  handleClickOutside: () => void;
282
288
  instantiatePrintSDK: () => false | undefined;
283
289
  getDefaultFormatId: (list: any[], key: string | number) => Promise<any>;
284
290
  setOptions: () => void;
285
291
  formatFormatList: (list: any[]) => any;
286
- requestError: () => boolean;
287
292
  formatDefaultVal: (i: any, tableVal?: any) => any;
288
293
  formatSomeTypeParams: (templateParams: any[], params?: any[]) => any;
289
294
  formatPrintParams: (paramObj: any, fieldList: any[], keyName: string) => any;
@@ -299,6 +304,7 @@ declare const _default: import("vue").DefineComponent<{
299
304
  reformatPrintParams: () => void;
300
305
  verifiySuccess: (token: string) => void;
301
306
  directPrint: () => Promise<void>;
307
+ directDefaultFormatPrint: (defaultFormatId: string) => Promise<void>;
302
308
  NDropdown: any;
303
309
  NButton: any;
304
310
  NIcon: any;
@@ -2038,6 +2044,7 @@ declare const _default: import("vue").DefineComponent<{
2038
2044
  isShowOutSetting: boolean;
2039
2045
  customProps: {};
2040
2046
  outerPrintKeys: never[];
2047
+ defaultFormatId: string;
2041
2048
  };
2042
2049
  };
2043
2050
  }>>, {
@@ -1 +1 @@
1
- import{defineComponent as t,inject as e,ref as n,reactive as i,computed as r,onMounted as a,watch as l,openBlock as o,createElementBlock as s,Fragment as u,createElementVNode as c,createCommentVNode as d,createVNode as p,unref as m,withCtx as v,renderList as y,createBlock as f,createTextVNode as g,toDisplayString as k,isRef as h,renderSlot as b,withModifiers as w,normalizeClass as P,mergeProps as O}from"vue";import{isObject as S}from"@vue/shared";import{useMessage as C,NButtonGroup as I,NDropdown as T,NButton as L,NIcon as M,NPopover as F,NCheckbox as j,NDivider as x}from"naive-ui";import{PrintOutline as E,SettingsOutline as N,ChevronDownSharp as _,ArrowForwardOutline as D}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as z}from"../constants/index.js";import{Print as J}from"../utils/print.js";import{isIReport as U}from"../utils/browserPrint.js";import V from"./IdentityVerification.vue.js";import{format as A}from"date-fns";import"../api.js";const K={class:"newprint-button-outer"},B=c("span",{class:"label bold"},"外显设置",-1),R={class:"newprint-button-poperOver"},H={class:"print-lite"},q={class:"label bold"},G={class:"print-li"},Y={class:"print-lite"},$={class:"newprint-button-poperOver"},Q=["onMouseenter","onClick"],W={class:"label bold"},X={class:"newprint-button-poperOver"},Z={class:"print-lite"},tt={class:"label bold"},et={class:"print-li"},nt={class:"print-lite"},it={class:"print-lite"},rt=["onClick"],at={class:"newprint-button-poperOver"},lt=["onMouseenter"],ot={class:"print-lite"},st=["onClick"];var ut=t({__name:"NewPrintComponent",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:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number,default:1},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,isShowOutSetting:!0,customProps:{},outerPrintKeys:[]})}},setup(t,{expose:ut}){const ct=t,dt=[{label:"分割线",key:"divider"},{label:"外显设置",key:"outSetting"}],pt=C();let mt;const vt=e(z),yt=n(""),ft=i({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1});let gt=n([]),kt=n([{label:ct.pdfLoadText,key:"downloadPdf"},{label:ct.previewText,key:"previewText"},{label:ct.formatEditText,key:"formatEditText"},{label:"重置打印机",key:"resetPrinter"}]);const ht=i({oneMouseType:"",oneClickType:"",twoMouseType:""}),bt=i({oneShow:!1,isOperation:!1,isOutSetting:!1}),wt=n([]),Pt=n([]),Ot=r((()=>{if(!ft.currentFormatId)return{};let t=ft.currentFormatId;return ft.formatList.find((e=>e.id===t))}));r((()=>{var t;return(null==(t=Ot.value)?void 0:t.name)||"格式选择"}));const St=r((()=>{let t=ft.formatList.find((t=>t.id===ft.currentFormatId));return null==t?void 0:t.templateId})),Ct=r((()=>{var t;return null==(t=ct.newPrintSetting)?void 0:t.isShowPrintAll})),It=r((()=>{var t;return null==(t=ct.newPrintSetting)?void 0:t.isShowOutSetting})),Tt=r((()=>{var t;return(null==(t=ct.newPrintSetting)?void 0:t.customProps)||{}})),Lt=r((()=>{const t=dt.map((t=>t.key));return gt.value.filter((e=>!t.includes(e.key)))})),Mt=r({get:()=>Lt.value.every((t=>t.selected)),set(t){Lt.value.forEach((e=>{e.selected=t}))}}),Ft=async()=>{var t,e;(null==(e=null==(t=ct.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)||await te(),bt.oneShow=!0},jt=async t=>{if(ct.directPrint){if(ft.spinning)return;return"button"===t?void(Ct.value?await ie():Ft()):Ft()}return Ft()},xt=(t,e)=>{ht[t]=e},Et=()=>{wt.value=gt.value.filter((t=>!t.selected)),Pt.value=Lt.value.filter((t=>t.selected)),_t("oneShow"),_t("isOutSetting"),vt("saveOuterPrint",Pt.value)},Nt=t=>{bt[t]=!0},_t=t=>{ht.oneClickType="",bt[t]=!1,"isOutSetting"==t&&(bt.isOutSetting=!1)},Dt=(t,e)=>{Kt(!1);let n={type:e,formatId:ft.currentFormatId,templateId:St.value};vt("success",t,n)},zt=t=>{Kt(!1),vt("error",t),S(t)&&"notInstalledApp"===t.type&&pt.error(t.message)},Jt=t=>{Kt(!1),vt("cancel",t)},Ut=t=>{vt("error",{message:"前置条件执行错误",type:t,preExecution:!0})},Vt=()=>JSON.stringify({...ct.token?{token:ct.token}:{}}),At=(t=[],e)=>{var n,i;let r={},a={};if((null==(n=ft.templateParams[e].customizeDataset)?void 0:n.length)>0){const e=(null==(i=Object.keys(t[0].datasetData||{}))?void 0:i[0])||"",n=JSON.stringify(t.map((t=>JSON.parse(t.datasetData[e]))));a={datasetData:{}},a.datasetData[e]=n}else Object.keys(t[0]).forEach((e=>{a[e]=[],t.forEach((t=>{a[e].includes(t[e])||a[e].push(t[e])})),a[e]=a[e].join(",")}));return r=Object.assign({},JSON.parse(Vt()),Tt.value,a),JSON.stringify(r)},Kt=(t,e)=>{if(ft.isClickOuterPrint){if(t&&e){const n=Pt.value.find((t=>t.key==e));return void(n&&(n.isLoading=t))}Pt.value.forEach((t=>{t.isLoading=!1}))}else ft.spinning=t},Bt=()=>ft.isClickOuterPrint?Pt.value.some((t=>t.isLoading)):ft.spinning,Rt=(t,e,n,i)=>{const r=ft.printParams[t];ft.isClickOuterPrint=i,Ht(r,t,e,n)},Ht=async(t=[],e,n,i,r)=>{let a=t.length;const l=async t=>{try{--a<=0&&Dt(t,"print")}catch(t){console.log("error",t)}};ct.showLoading&&Bt()&&!r||(Kt(!0,i),ct.prevFn("print").then((()=>{ft.curPrintParamList=t;const r={formatId:i,templateId:n,authorizationKey:yt.value,printdlgshow:ct.printdlgshow,signature:ct.signature,copies:ct.printCopies};if("MULTI"===ct.strategy)for(let e=0;e<t.length;e++)e>0&&(r.printdlgshow="0"),mt.printDirect({...r,params:Object.assign({},JSON.parse(Vt()),Tt.value,t[e])},l,zt,Jt);else mt.printDirect({...r,params:At(t,e)},(t=>{Dt(t,"print")}),zt,Jt)})).catch((()=>{Ut("print"),Kt(!1)})).finally((()=>{ft.visible=!1})))},qt=async(t,{templateCode:e,templateId:n,key:i},r)=>{const a=ft.printParams[e];switch(ft.isClickOuterPrint=r,t){case"previewText":(async(t=[],e,n,i)=>{ct.showLoading&&Bt()||(Kt(!0,i),ct.prevFn("preview").then((()=>{ft.curPrintParamList=t;const r="MULTI"===ct.strategy?Object.assign({},JSON.parse(Vt()),Tt.value,t[0]):At(t,e),a={formatId:i,templateId:n,authorizationKey:yt.value,params:r,btnprint:ct.btnprint,signature:ct.signature};mt.preview(a,(t=>{Dt(t,"preview")}),zt)})).catch((()=>{Ut("preview"),Kt(!1)})).finally((()=>{ft.visible=!1})))})(a,e,n,i);break;case"formatEditText":((t=[],e,n,i)=>{ct.showLoading&&Bt()||(Kt(!0,i),ct.prevFn("edit").then((()=>{ft.curPrintParamList=t,ft.currentFormatId=i,ft.identityVerification.visible=!0})).catch((()=>{Ut("edit")})).finally((()=>{Kt(!1)})))})(a,0,0,i);break;case"downloadPdf":(async(t=[],e,n,i)=>{ct.showLoading&&Bt()||(Kt(!0,i),ct.prevFn("download").then((()=>{ft.curPrintParamList=t;const r="MULTI"===ct.strategy?Object.assign({},JSON.parse(Vt()),Tt.value,t[0]):At(t,e),a={formatId:i,templateId:n,authorizationKey:yt.value,print:{print:"1",type:"1"},params:r,signature:ct.signature};mt.downloadPDF(a,(t=>Dt(t,"preview")),zt)})).catch((()=>{Ut("download"),Kt(!1)})).finally((()=>{ft.visible=!1})))})(a,e,n,i);break;case"resetPrinter":l=i,ct.showLoading&&Bt()||(Kt(!0,l),mt.resetPrinter(l).then((t=>{Kt(!1),t?pt.success("重置打印机成功"):pt.warning("重置打印机失败")})))}var l},Gt=()=>{},Yt=(t,e=[])=>{let n={};return e.forEach((e=>{n=Object.assign({},Wt(n,e,t))})),n},$t=(t,e,n)=>{const i={};return e.forEach((e=>{let r=((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=A(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&r&&(i[e[n]]=r)})),i},Qt=({customizeDataset:t=[],param:e=[]},n={})=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData||(i.datasetData={}),i.datasetData[t.name]=JSON.stringify($t(n,e,"fieldName"))})),i=Object.assign({},i,$t(n,e,"key")),i},Wt=(t,e,n)=>{if(e.templateNumbers){for(let i=0;i<e.templateNumbers.length;i++){const r=e.templateNumbers[i],a=n[r];if(!a)return pt.error("当前勾选的数据没有匹配的模板"),t;t[r]||(t[r]=[]),t[r].push(Qt(a,e))}return t}const i=Object.keys(n);for(let r=0;r<i.length;r++){const a=i[r],l=n[a];if(!l)return pt.error("当前勾选的数据没有匹配的模板"),t;t[a]||(t[a]=[]),t[a].push(Qt(l,e))}return t},Xt=async t=>{ft.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):[],(()=>{var t,e,n;const i=ft.formatList.map((t=>({templateCode:t.number,templateId:t.templateId,label:t.name,key:t.id,selected:!1,isLoading:!1})));gt.value.unshift(...i),It.value&&gt.value.push(...dt),(null==(e=null==(t=ct.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)>0&&(gt.value.forEach((t=>{var e;(null==(e=ct.newPrintSetting)?void 0:e.outerPrintKeys.includes(t.key))&&(t.selected=!0)})),Pt.value=gt.value.filter((t=>t.selected))),wt.value=gt.value.filter((t=>!t.selected)),ct.hideButtons.length>0&&(kt.value=kt.value.filter((t=>!ct.hideButtons.includes(t.key))));const r=sessionStorage.getItem("portal");if(r){const t=JSON.parse(r),e=(null==(n=null==t?void 0:t.user)?void 0:n.currentRoleResourceObj)||{},i=Object.keys(e);i.includes("RY7.2.21.1.M2.G94181E")||(kt.value=kt.value.filter((t=>"downloadPdf"!=t.key))),i.includes("RY7.2.21.1.M2.G33633A")||(kt.value=kt.value.filter((t=>"formatEditText"!=t.key)))}})(),ft.templateParams=(t=>{let e={};return t&&t.forEach((t=>{if(!t.templateConfig)return!1;e[t.number]=t.templateConfig})),e})(t.obj),ft.printParams=Yt(ft.templateParams,ct.params)},Zt=async()=>{var t;if(ft.isInited)return!0;ft.isInited=!0,ft.spinning=!0,(()=>{if(mt)return!1;mt=new J})();const e=await ct.queryPrintFormatByNumber();return await Xt(e),(null==(t=e.obj)?void 0:t.length)>0&&(yt.value=e.obj[0].authorizationKey||""),ft.spinning=!1,!0},te=async(t=!0)=>{var e,n;if(await ct.clickPrevFn())if((null==(e=ct.params)?void 0:e.length)||(null==(n=ct.printParams)?void 0:n.length)){if(!ft.visible){if(!await Zt())return!1}t&&(ft.visible=!ft.visible)}else pt.warning(ct.noDataMsg)},ee=()=>{ft.watchPrintParamsReformatFn&&ft.watchPrintParamsReformatFn(),ft.isInited?ft.printParams=Yt(ft.templateParams,ct.params):ft.watchPrintParamsReformatFn=()=>l((()=>ft.isInited),(t=>{if(!t)return!1;ee()}))},ne=t=>{if(ft.identityVerification.visible=!1,U(ft.currentFormatId))return Dt(null,"edit");const e={formatId:ft.currentFormatId,templateId:St.value,params:Object.assign({},JSON.parse(Vt()),Tt.value,ft.curPrintParamList[0]),token:t};mt.editPrintFormat(e,(t=>{Dt(t,"edit")}),zt)};async function ie(){await te(!1),(()=>{const t=Object.keys(ft.printParams);ft.isClickOuterPrint=!1;for(let e=0;e<t.length;e++){const n=t[e],i=ft.printParams[n],r=ft.formatList.filter((t=>t.number==n));r&&r.length>0&&r.forEach((t=>{Ht(i,t.number,t.templateId,t.id,!0)}))}})()}return a((()=>{ft.isInited=!1})),l((()=>ct.params),(t=>{if(!(null==t?void 0:t.length))return!1;ee()}),{deep:!0}),l((()=>{var t;return null==(t=ct.newPrintSetting)?void 0:t.outerPrintKeys}),(async t=>{(null==t?void 0:t.length)>0&&await te(!1)}),{deep:!0,immediate:!0}),ut({directPrint:ie}),(e,n)=>(o(),s(u,null,[c("div",K,[d(" 外显按钮集合 "),p(m(I),null,{default:v((()=>[(o(!0),s(u,null,y(Pt.value,(e=>(o(),f(m(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:Gt,options:m(kt),onSelect:t=>qt(t,e,!0)},{default:v((()=>[p(m(L),{loading:t.showLoading&&e.isLoading,onClick:t=>Rt(e.templateCode,e.templateId,e.key,!0)},{icon:v((()=>[p(m(M),{component:m(E),size:"18"},null,8,["component"])])),default:v((()=>[g(" "+k(e.label),1)])),_:2},1032,["loading","onClick"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),d(' <n-button-group>\r\n\t\t\t<n-popover\r\n\t\t\t\tv-for="outer in outerPrintItems"\r\n :key="outer.key"\r\n\t\t\t\ttrigger="hover"\r\n\t\t\t\t:show-arrow="false"\r\n\t\t\t\t:show="downlistPopover.isOperation"\r\n\t\t\t\t@clickoutside="handleClickOutHide(\'isOperation\')"\r\n\t\t\t>\r\n\t\t\t\t<template #trigger>\r\n\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t@mouseenter="delayShowPopover(\'isOperation\')"\r\n\t\t\t\t\t\t@mouseleave="handleClickOutHide(\'isOperation\')"\r\n\t\t\t\t\t\t@click="console.log(33)"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t<n-icon :component="PrintOutline" size="18"></n-icon>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t<span class="label bold">{{ outer.label }}</span>\r\n\t\t\t\t\t</n-button>\r\n\t\t\t\t</template>\r\n\t\t\t\t<div class="newprint-button-poperOver">\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclass="print-li"\r\n\t\t\t\t\t\tv-for="operation in operations"\r\n\t\t\t\t\t\t:key="operation.key"\r\n\t\t\t\t\t\t:class="downlistOperation.twoMouseType==operation.key ? \'active\' : \'\' "\r\n\t\t\t\t\t\t@mouseenter="handleTypeChange(\'twoMouseType\', operation.key)"\r\n\t\t\t\t\t\t@mouseleave="handleTypeChange(\'twoMouseType\', \'\')"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<div class="print-lite">\r\n\t\t\t\t\t\t\t<span class="label"> {{ operation.label }} </span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</n-popover>\r\n\t\t</n-button-group> '),d(" 外显设置按钮 "),ft.isInited&&Pt.value.length>0&&Pt.value.length==m(Lt).length&&m(It)?(o(),f(m(F),{key:0,trigger:"click","show-arrow":!1,show:bt.isOutSetting,onClickoutside:n[2]||(n[2]=t=>_t("isOutSetting"))},{trigger:v((()=>[p(m(L),{onClick:n[0]||(n[0]=t=>Nt("isOutSetting"))},{default:v((()=>[B,p(m(M),{style:{"margin-left":"8px"},component:m(N),size:"18"},null,8,["component"])])),_:1})])),default:v((()=>[c("div",R,[(o(!0),s(u,null,y(m(Lt),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",H,[c("span",q,k(t.label),1),p(m(j),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:v((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",G,[p(m(x)),c("div",Y,[p(m(L),{type:"primary",size:"small",onClick:Et},{default:v((()=>[g("保存")])),_:1}),p(m(j),{checked:m(Mt),"onUpdate:checked":n[1]||(n[1]=t=>h(Mt)?Mt.value=t:null)},{default:v((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:1},8,["show"])):(o(),s(u,{key:1},[d(" 打印全部按钮 "),p(m(F),{trigger:"click","show-arrow":!1,show:bt.oneShow,onClickoutside:n[10]||(n[10]=t=>_t("oneShow"))},{trigger:v((()=>[b(e.$slots,"button",{handleClickPrintBtn:te,printSpinning:ft.spinning,printbtnText:t.btnText,printVisible:ft.visible},(()=>[p(m(I),{class:"newprint-button-component",onClick:n[4]||(n[4]=w((()=>jt("icon")),["stop"]))},{default:v((()=>[p(m(L),{loading:t.showLoading&&ft.spinning,onClick:n[3]||(n[3]=w((()=>jt("button")),["stop"]))},{icon:v((()=>[p(m(M),{component:m(E),size:"18"},null,8,["component"])])),default:v((()=>[g(" "+k(m(Ct)?"打印全部":t.btnText),1)])),_:1},8,["loading"]),p(m(L),{class:"icon-select"},{icon:v((()=>[p(m(M),{component:m(_),size:"18"},null,8,["component"])])),_:1})])),_:1})]))])),default:v((()=>[c("div",$,[(o(!0),s(u,null,y(wt.value,(t=>(o(),s("div",{class:P(["print-li",ht.oneMouseType==t.key||ht.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>xt("oneMouseType",t.key),onMouseleave:n[9]||(n[9]=t=>xt("oneMouseType","")),onClick:e=>{return n="oneClickType",i=t.key,void xt(n,i);var n,i}},["divider"==t.key?(o(),f(m(x),{key:0})):"outSetting"==t.key?(o(),s(u,{key:1},[d(" 第二层外显设置 "),p(m(F),{trigger:"click","show-arrow":!1,placement:"right-start",show:bt.isOutSetting,onClickoutside:n[7]||(n[7]=t=>_t("isOutSetting"))},{trigger:v((()=>[c("div",{class:"print-lite",onClick:n[5]||(n[5]=t=>Nt("isOutSetting"))},[c("span",W,k(t.label),1),p(m(M),{style:{background:"transparent"},component:m(N),size:"18"},null,8,["component"])])])),default:v((()=>[c("div",X,[(o(!0),s(u,null,y(m(Lt),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",Z,[c("span",tt,k(t.label),1),p(m(j),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:v((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",et,[p(m(x)),c("div",nt,[p(m(L),{type:"primary",size:"small",onClick:Et},{default:v((()=>[g("保存")])),_:1}),p(m(j),{checked:m(Mt),"onUpdate:checked":n[6]||(n[6]=t=>h(Mt)?Mt.value=t:null)},{default:v((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:2},1032,["show"])],2112)):(o(),s(u,{key:2},[d(" 第二层功能操作 "),c("div",it,[c("span",{class:"label bold",onClick:e=>Rt(t.templateCode,t.templateId,t.key,!1)},k(t.label),9,rt),p(m(F),{trigger:"click","show-arrow":!1,placement:"right-start",show:bt[t.key],onClickoutside:e=>_t(t.key)},{trigger:v((()=>[p(m(M),{component:m(D),size:"18",onClick:e=>Nt(t.key)},null,8,["component","onClick"])])),default:v((()=>[c("div",at,[(o(!0),s(u,null,y(m(kt),(e=>(o(),s("div",{class:P(["print-li",ht.twoMouseType==e.key?"active":""]),key:e.key,onMouseenter:t=>xt("twoMouseType",e.key),onMouseleave:n[8]||(n[8]=t=>xt("twoMouseType",""))},[c("div",ot,[c("span",{class:"label",onClick:n=>qt(e.key,t,!1)},k(e.label),9,st)])],42,lt)))),128))])])),_:2},1032,["show","onClickoutside"])])],2112))],42,Q)))),128))])])),_:3},8,["show"])],2112))]),p(V,O(e.$attrs,{modelValue:ft.identityVerification.visible,"onUpdate:modelValue":n[11]||(n[11]=t=>ft.identityVerification.visible=t),formatId:ft.currentFormatId,templateId:m(St),onSuccess:ne}),null,16,["modelValue","formatId","templateId"])],64))}});export{ut as default};
1
+ import{defineComponent as t,inject as e,ref as n,reactive as i,computed as r,onMounted as a,watch as l,openBlock as o,createElementBlock as s,Fragment as u,createElementVNode as c,createCommentVNode as d,createVNode as p,unref as m,withCtx as y,renderList as v,createBlock as f,createTextVNode as g,toDisplayString as k,isRef as h,renderSlot as b,withModifiers as w,normalizeClass as P,mergeProps as O}from"vue";import{isObject as S}from"@vue/shared";import{useMessage as C,NButtonGroup as I,NDropdown as T,NButton as L,NIcon as F,NPopover as M,NCheckbox as j,NDivider as N}from"naive-ui";import{PrintOutline as x,SettingsOutline as E,ChevronDownSharp as _,ArrowForwardOutline as D}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as z}from"../constants/index.js";import{Print as J}from"../utils/print.js";import{isIReport as U}from"../utils/browserPrint.js";import V from"./IdentityVerification.vue.js";import{format as A}from"date-fns";import"../api.js";const K={class:"newprint-button-outer"},B=c("span",{class:"label bold"},"外显设置",-1),R={class:"newprint-button-poperOver"},H={class:"print-lite"},q={class:"label bold"},G={class:"print-li"},Y={class:"print-lite"},$={class:"newprint-button-poperOver"},Q=["onMouseenter","onClick"],W={class:"label bold"},X={class:"newprint-button-poperOver"},Z={class:"print-lite"},tt={class:"label bold"},et={class:"print-li"},nt={class:"print-lite"},it=["onClick"],rt={class:"newprint-button-poperOver"},at=["onMouseenter"],lt={class:"print-lite"},ot=["onClick"];var st=t({__name:"NewPrintComponent",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:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number,default:1},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:""})}},setup(t,{expose:st}){const ut=t,ct=[{label:"分割线",key:"divider"},{label:"外显设置",key:"outSetting"}],dt=C();let pt;const mt=e(z),yt=n(""),vt=i({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[]});let ft=n([]),gt=n([{label:ut.pdfLoadText,key:"downloadPdf"},{label:ut.previewText,key:"previewText"},{label:ut.formatEditText,key:"formatEditText"},{label:"重置打印机",key:"resetPrinter"}]);const kt=i({oneMouseType:"",oneClickType:"",twoMouseType:""}),ht=i({oneShow:!1,isOperation:!1,isOutSetting:!1}),bt=n([]),wt=n([]),Pt=r((()=>{if(!vt.currentFormatId)return{};let t=vt.currentFormatId;return vt.formatList.find((e=>e.id===t))}));r((()=>{var t;return(null==(t=Pt.value)?void 0:t.name)||"格式选择"}));const Ot=r((()=>{let t=vt.formatList.find((t=>t.id===vt.currentFormatId));return null==t?void 0:t.templateId})),St=r((()=>{let t=vt.formatList.find((t=>t.id===vt.currentFormatId));return null==t?void 0:t.number})),Ct=r((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.isShowPrintAll})),It=r((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.isShowOutSetting})),Tt=r((()=>{var t;return(null==(t=ut.newPrintSetting)?void 0:t.customProps)||{}})),Lt=r((()=>{var t;return(null==(t=ut.newPrintSetting)?void 0:t.defaultFormatId)||""})),Ft=r((()=>{const t=ct.map((t=>t.key));return ft.value.filter((e=>!t.includes(e.key)))})),Mt=r({get:()=>Ft.value.every((t=>t.selected)),set(t){Ft.value.forEach((e=>{e.selected=t}))}}),jt=async()=>{var t,e;(null==(e=null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)||await ee(),ht.oneShow=!0},Nt=async t=>{if(ut.directPrint){if(vt.spinning)return;return"button"===t?void(Ct.value?await ie():Lt.value?async function(t){await ee(!1);const e=bt.value.find((e=>e.key==t));e&&Ht(e.templateCode,e.templateId,e.key,!1)}(Lt.value):jt()):jt()}return jt()},xt=(t,e)=>{kt[t]=e},Et=()=>{bt.value=ft.value.filter((t=>!t.selected)),wt.value=Ft.value.filter((t=>t.selected)),Dt("oneShow"),Dt("isOutSetting"),mt("saveOuterPrint",wt.value)},_t=t=>{ht[t]=!0},Dt=t=>{kt.oneClickType="",ht[t]=!1,"isOutSetting"==t&&(ht.isOutSetting=!1)},zt=(t,e)=>{Bt(!1);let n={type:e,formatId:vt.currentFormatId,templateId:Ot.value};mt("success",t,n)},Jt=t=>{Bt(!1),mt("error",t),S(t)&&"notInstalledApp"===t.type&&dt.error(t.message)},Ut=t=>{Bt(!1),mt("cancel",t)},Vt=t=>{mt("error",{message:"前置条件执行错误",type:t,preExecution:!0})},At=()=>JSON.stringify({...ut.token?{token:ut.token}:{}}),Kt=(t=[],e)=>{var n,i;let r={},a={};if((null==(n=vt.templateParams[e].customizeDataset)?void 0:n.length)>0){const e=(null==(i=Object.keys(t[0].datasetData||{}))?void 0:i[0])||"",n=JSON.stringify(t.map((t=>JSON.parse(t.datasetData[e]))));a={datasetData:{}},a.datasetData[e]=n}else Object.keys(t[0]).forEach((e=>{a[e]=[],t.forEach((t=>{a[e].includes(t[e])||a[e].push(t[e])})),a[e]=a[e].join(",")}));return r=Object.assign({},JSON.parse(At()),Tt.value,a),JSON.stringify(r)},Bt=(t,e)=>{if(vt.isClickOuterPrint){if(t&&e){const n=wt.value.find((t=>t.key==e));return void(n&&(n.isLoading=t))}wt.value.forEach((t=>{t.isLoading=!1}))}else vt.spinning=t},Rt=()=>vt.isClickOuterPrint?wt.value.some((t=>t.isLoading)):vt.spinning,Ht=(t,e,n,i)=>{const r=vt.printParams[t];r&&(vt.isClickOuterPrint=i,vt.currentFormatId=n,qt(r,t,e,n))},qt=async(t=[],e,n,i,r)=>{let a=t.length;const l=async t=>{try{--a<=0&&zt(t,"print")}catch(t){console.log("error",t)}};ut.showLoading&&Rt()&&!r||(Bt(!0,i),ut.prevFn("print").then((()=>{vt.curPrintParamList=t;const r={formatId:i,templateId:n,authorizationKey:yt.value,printdlgshow:ut.printdlgshow,signature:ut.signature,copies:ut.printCopies};if("MULTI"===ut.strategy)for(let e=0;e<t.length;e++){e>0&&(r.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[e]));pt.printDirect({...r,params:n},l,Jt,Ut)}else pt.printDirect({...r,params:Kt(t,e)},(n=>{n.params=Kt(t,e),zt(n,"print")}),Jt,Ut)})).catch((()=>{Vt("print"),Bt(!1)})).finally((()=>{vt.visible=!1})))},Gt=async(t,{templateCode:e,templateId:n,key:i},r)=>{const a=vt.printParams[e];if(a)switch(vt.isClickOuterPrint=r,vt.currentFormatId=i,t){case"previewText":(async(t=[],e,n,i)=>{ut.showLoading&&Rt()||(Bt(!0,i),ut.prevFn("preview").then((()=>{vt.curPrintParamList=t;const r=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[0])),a="MULTI"===ut.strategy?r:Kt(t,e),l={formatId:i,templateId:n,authorizationKey:yt.value,params:a,btnprint:ut.btnprint,signature:ut.signature};pt.preview(l,(t=>{zt(t,"preview")}),Jt)})).catch((()=>{Vt("preview"),Bt(!1)})).finally((()=>{vt.visible=!1})))})(a,e,n,i);break;case"formatEditText":((t=[],e,n,i)=>{ut.showLoading&&Rt()||(Bt(!0,i),ut.prevFn("edit").then((()=>{vt.curPrintParamList=t,vt.currentFormatId=i,vt.identityVerification.visible=!0})).catch((()=>{Vt("edit")})).finally((()=>{Bt(!1)})))})(a,0,0,i);break;case"downloadPdf":(async(t=[],e,n,i)=>{ut.showLoading&&Rt()||(Bt(!0,i),ut.prevFn("download").then((()=>{vt.curPrintParamList=t;const r=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,t[0])),a="MULTI"===ut.strategy?r:Kt(t,e),l={formatId:i,templateId:n,authorizationKey:yt.value,print:{print:"1",type:"1"},params:a,signature:ut.signature};pt.downloadPDF(l,(t=>zt(t,"preview")),Jt)})).catch((()=>{Vt("download"),Bt(!1)})).finally((()=>{vt.visible=!1})))})(a,e,n,i);break;case"resetPrinter":(async(t=[],e,n,i)=>{if(ut.showLoading&&Rt())return;Bt(!0,i);const r=await pt.resetPrinter(i);Bt(!1),"success"!=(null==r?void 0:r.result)?dt.warning("重置打印机失败"):dt.success(r.message||"重置打印机成功")})(a,0,0,i)}},Yt=()=>{},$t=(t,e=[])=>{let n={};return(e=e||[]).forEach((e=>{n=Object.assign({},Xt(n,e,t))})),n},Qt=(t,e,n)=>{const i={};return e.forEach((e=>{let r=((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=A(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&r&&(i[e[n]]=r)})),i},Wt=({customizeDataset:t=[],param:e=[]},n={})=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData||(i.datasetData={}),i.datasetData[t.name]=JSON.stringify(Qt(n,e,"fieldName"))})),i=Object.assign({},i,Qt(n,e,"key")),i},Xt=(t,e,n)=>{if(e.templateNumbers){for(let i=0;i<e.templateNumbers.length;i++){const r=e.templateNumbers[i],a=n[r];if(!a)return dt.error("当前勾选的数据没有匹配的模板"),t;t[r]||(t[r]=[]),t[r].push(Wt(a,e))}return t}const i=Object.keys(n);for(let r=0;r<i.length;r++){const a=i[r],l=n[a];if(!l)return dt.error("当前勾选的数据没有匹配的模板"),t;t[a]||(t[a]=[]),t[a].push(Wt(l,e))}return t},Zt=async t=>{vt.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):[],(()=>{var t,e,n;const i=vt.formatList.map((t=>({templateCode:t.number,templateId:t.templateId,label:t.name,key:t.id,selected:!1,isLoading:!1})));ft.value.unshift(...i),It.value&&ft.value.push(...ct),(null==(e=null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys)?void 0:e.length)>0&&(ft.value.forEach((t=>{var e;(null==(e=ut.newPrintSetting)?void 0:e.outerPrintKeys.includes(t.key))&&(t.selected=!0)})),wt.value=ft.value.filter((t=>t.selected))),bt.value=ft.value.filter((t=>!t.selected)),ut.hideButtons.length>0&&(gt.value=gt.value.filter((t=>!ut.hideButtons.includes(t.key))));const r=sessionStorage.getItem("portal");if(r){const t=JSON.parse(r),e=(null==(n=null==t?void 0:t.user)?void 0:n.currentRoleResourceObj)||{},i=Object.keys(e);i.includes("RY7.2.21.1.M2.G94181E")||(gt.value=gt.value.filter((t=>"downloadPdf"!=t.key))),i.includes("RY7.2.21.1.M2.G33633A")||(gt.value=gt.value.filter((t=>"formatEditText"!=t.key)))}})(),vt.templateParams=(t=>{let e={};return t&&t.forEach((t=>{if(!t.templateConfig)return!1;e[t.number]=t.templateConfig})),e})(t.obj),vt.printParams=$t(vt.templateParams,ut.params)},te=async()=>{var t;if(vt.isInited)return!0;vt.isInited=!0,vt.spinning=!0,(()=>{if(pt)return!1;pt=new J})();const e=await ut.queryPrintFormatByNumber();return await Zt(e),(null==(t=e.obj)?void 0:t.length)>0&&(yt.value=e.obj[0].authorizationKey||""),vt.spinning=!1,!0},ee=async(t=!0)=>{if(await ut.clickPrevFn()){if(!vt.visible){if(!await te())return!1}t&&(vt.visible=!vt.visible)}},ne=t=>{if(vt.identityVerification.visible=!1,U(vt.currentFormatId))return zt(null,"edit");const e=JSON.stringify(Object.assign({},JSON.parse(At()),Tt.value,vt.curPrintParamList[0])),n="MULTI"===ut.strategy?e:Kt(vt.curPrintParamList,St.value),i={formatId:vt.currentFormatId,templateId:Ot.value,params:n,token:t};pt.editPrintFormat(i,(t=>{zt(t,"edit")}),Jt)};async function ie(){await ee(!1),(()=>{const t=Object.keys(vt.printParams);vt.isClickOuterPrint=!1;for(let e=0;e<t.length;e++){const n=t[e],i=vt.printParams[n],r=vt.formatList.filter((t=>t.number==n));r&&r.length>0&&r.forEach((t=>{vt.currentFormatId=t.id,qt(i,t.number,t.templateId,t.id,!0)}))}})()}return a((()=>{vt.isInited=!1})),l((()=>ut.params),(t=>{Object.keys(vt.templateParams).length>0&&(vt.printParams=$t(vt.templateParams,ut.params))}),{deep:!0}),l((()=>{var t;return null==(t=ut.newPrintSetting)?void 0:t.outerPrintKeys}),(async t=>{(null==t?void 0:t.length)>0&&await ee(!1)}),{deep:!0,immediate:!0}),st({directPrint:ie}),(e,n)=>(o(),s(u,null,[c("div",K,[d(" 外显按钮集合 "),p(m(I),null,{default:y((()=>[(o(!0),s(u,null,v(wt.value,(e=>{return o(),f(m(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:Yt,options:(n=m(gt),i=e,vt.printParams[i.templateCode]?n:[]),onSelect:t=>Gt(t,e,!0)},{default:y((()=>[p(m(L),{disabled:!vt.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>Ht(e.templateCode,e.templateId,e.key,!0)},{icon:y((()=>[p(m(F),{component:m(x),size:"18"},null,8,["component"])])),default:y((()=>[g(" "+k(e.label),1)])),_:2},1032,["disabled","loading","onClick"])])),_:2},1032,["options","onSelect"]);var n,i})),128))])),_:1}),d(' <n-button-group>\r\n\t\t\t<n-popover\r\n\t\t\t\tv-for="outer in outerPrintItems"\r\n :key="outer.key"\r\n\t\t\t\ttrigger="hover"\r\n\t\t\t\t:show-arrow="false"\r\n\t\t\t\t:show="downlistPopover.isOperation"\r\n\t\t\t\t@clickoutside="handleClickOutHide(\'isOperation\')"\r\n\t\t\t>\r\n\t\t\t\t<template #trigger>\r\n\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t@mouseenter="delayShowPopover(\'isOperation\')"\r\n\t\t\t\t\t\t@mouseleave="handleClickOutHide(\'isOperation\')"\r\n\t\t\t\t\t\t@click="console.log(33)"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t<n-icon :component="PrintOutline" size="18"></n-icon>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t<span class="label bold">{{ outer.label }}</span>\r\n\t\t\t\t\t</n-button>\r\n\t\t\t\t</template>\r\n\t\t\t\t<div class="newprint-button-poperOver">\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclass="print-li"\r\n\t\t\t\t\t\tv-for="operation in operations"\r\n\t\t\t\t\t\t:key="operation.key"\r\n\t\t\t\t\t\t:class="downlistOperation.twoMouseType==operation.key ? \'active\' : \'\' "\r\n\t\t\t\t\t\t@mouseenter="handleTypeChange(\'twoMouseType\', operation.key)"\r\n\t\t\t\t\t\t@mouseleave="handleTypeChange(\'twoMouseType\', \'\')"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<div class="print-lite">\r\n\t\t\t\t\t\t\t<span class="label"> {{ operation.label }} </span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</n-popover>\r\n\t\t</n-button-group> '),d(" 外显设置按钮 "),wt.value.length>0&&wt.value.length==m(Ft).length&&m(It)?(o(),f(m(M),{key:0,trigger:"click","show-arrow":!1,show:ht.isOutSetting,onClickoutside:n[2]||(n[2]=t=>Dt("isOutSetting"))},{trigger:y((()=>[p(m(L),{onClick:n[0]||(n[0]=t=>_t("isOutSetting"))},{default:y((()=>[B,p(m(F),{style:{"margin-left":"8px"},component:m(E),size:"18"},null,8,["component"])])),_:1})])),default:y((()=>[c("div",R,[(o(!0),s(u,null,v(m(Ft),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",H,[c("span",q,k(t.label),1),p(m(j),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:y((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",G,[p(m(N)),c("div",Y,[p(m(L),{type:"primary",size:"small",onClick:Et},{default:y((()=>[g("保存")])),_:1}),p(m(j),{checked:m(Mt),"onUpdate:checked":n[1]||(n[1]=t=>h(Mt)?Mt.value=t:null)},{default:y((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:1},8,["show"])):(o(),s(u,{key:1},[d(" 打印全部按钮 "),p(m(M),{trigger:"click","show-arrow":!1,show:ht.oneShow,onClickoutside:n[10]||(n[10]=t=>Dt("oneShow"))},{trigger:y((()=>[b(e.$slots,"button",{handleClickPrintBtn:ee,printSpinning:vt.spinning,printbtnText:t.btnText,printVisible:vt.visible},(()=>[p(m(I),{class:"newprint-button-component",onClick:n[4]||(n[4]=w((()=>Nt("icon")),["stop"]))},{default:y((()=>[p(m(L),{loading:t.showLoading&&vt.spinning,onClick:n[3]||(n[3]=w((()=>Nt("button")),["stop"]))},{icon:y((()=>[p(m(F),{component:m(x),size:"18"},null,8,["component"])])),default:y((()=>[g(" "+k(m(Ct)?"打印全部":t.btnText),1)])),_:1},8,["loading"]),p(m(L),{class:"icon-select"},{icon:y((()=>[p(m(F),{component:m(_),size:"18"},null,8,["component"])])),_:1})])),_:1})]))])),default:y((()=>[c("div",$,[(o(!0),s(u,null,v(bt.value,(t=>(o(),s("div",{class:P(["print-li",kt.oneMouseType==t.key||kt.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>xt("oneMouseType",t.key),onMouseleave:n[9]||(n[9]=t=>xt("oneMouseType","")),onClick:e=>((t,e,n)=>{if(!vt.printParams[n.templateCode])return[];xt(t,e)})("oneClickType",t.key,t)},["divider"==t.key?(o(),f(m(N),{key:0})):"outSetting"==t.key?(o(),s(u,{key:1},[d(" 第二层外显设置 "),p(m(M),{trigger:"click","show-arrow":!1,placement:"right-start",show:ht.isOutSetting,onClickoutside:n[7]||(n[7]=t=>Dt("isOutSetting"))},{trigger:y((()=>[c("div",{class:"print-lite",onClick:n[5]||(n[5]=t=>_t("isOutSetting"))},[c("span",W,k(t.label),1),p(m(F),{style:{background:"transparent"},component:m(E),size:"18"},null,8,["component"])])])),default:y((()=>[c("div",X,[(o(!0),s(u,null,v(m(Ft),(t=>(o(),s("div",{class:"print-li",key:t.key},[c("div",Z,[c("span",tt,k(t.label),1),p(m(j),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:y((()=>[g("外显")])),_:2},1032,["checked","onUpdate:checked"])])])))),128)),c("div",et,[p(m(N)),c("div",nt,[p(m(L),{type:"primary",size:"small",onClick:Et},{default:y((()=>[g("保存")])),_:1}),p(m(j),{checked:m(Mt),"onUpdate:checked":n[6]||(n[6]=t=>h(Mt)?Mt.value=t:null)},{default:y((()=>[g("全选")])),_:1},8,["checked"])])])])])),_:2},1032,["show"])],2112)):(o(),s(u,{key:2},[d(" 第二层功能操作 "),c("div",{class:P(["print-lite",vt.printParams[t.templateCode]?"":"isDisabled"])},[c("span",{class:"label bold",onClick:e=>Ht(t.templateCode,t.templateId,t.key,!1)},k(t.label),9,it),vt.printParams[t.templateCode]?(o(),f(m(M),{key:0,trigger:"click","show-arrow":!1,placement:"right-start",show:ht[t.key],onClickoutside:e=>Dt(t.key)},{trigger:y((()=>[p(m(F),{component:m(D),size:"18",onClick:e=>_t(t.key)},null,8,["component","onClick"])])),default:y((()=>[c("div",rt,[(o(!0),s(u,null,v(m(gt),(e=>(o(),s("div",{class:P(["print-li",kt.twoMouseType==e.key?"active":""]),key:e.key,onMouseenter:t=>xt("twoMouseType",e.key),onMouseleave:n[8]||(n[8]=t=>xt("twoMouseType",""))},[c("div",lt,[c("span",{class:"label",onClick:n=>Gt(e.key,t,!1)},k(e.label),9,ot)])],42,at)))),128))])])),_:2},1032,["show","onClickoutside"])):d("v-if",!0)],2)],2112))],42,Q)))),128))])])),_:3},8,["show"])],2112))]),p(V,O(e.$attrs,{modelValue:vt.identityVerification.visible,"onUpdate:modelValue":n[11]||(n[11]=t=>vt.identityVerification.visible=t),formatId:vt.currentFormatId,templateId:m(Ot),onSuccess:ne}),null,16,["modelValue","formatId","templateId"])],64))}});export{st as default};
@@ -34,7 +34,7 @@ export declare class Print {
34
34
  show(...args: Parameters<IdentityVerificationDialog['show']>): Promise<string>;
35
35
  showPreview(...args: Parameters<PreviewDialog['show']>): Promise<string>;
36
36
  _testConnection(): Promise<unknown>;
37
- resetPrinter(formatId: string): Promise<unknown>;
37
+ resetPrinter(formatId: string): Promise<any>;
38
38
  _queryServicesPrint(params: AnyObject): Promise<any>;
39
39
  _queryBase64ServicesPrint(params: AnyObject): Promise<any>;
40
40
  _callPrintWithFile(queryParams: AnyObject): Promise<any>;