cnhis-design-vue 3.2.3 → 3.2.4-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (309) hide show
  1. package/README.md +87 -87
  2. package/es/components/biunique-chat/index.d.ts +102 -63
  3. package/es/components/biunique-chat/src/Index.vue.d.ts +102 -63
  4. package/es/components/biunique-chat/src/Index.vue2.js +1 -1
  5. package/es/components/biunique-chat/src/api/index.d.ts +1 -0
  6. package/es/components/biunique-chat/src/api/index.js +1 -1
  7. package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
  8. package/es/components/biunique-chat/src/components/ChatHeader.vue.d.ts +60 -39
  9. package/es/components/biunique-chat/src/components/ChatHeader.vue2.js +1 -1
  10. package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +33 -19
  11. package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
  12. package/es/components/biunique-chat/src/components/ChatSearch.vue.d.ts +3 -3
  13. package/es/components/biunique-chat/src/components/ChatSearch.vue2.js +1 -1
  14. package/es/components/biunique-chat/src/components/ChatSet.vue.d.ts +42 -30
  15. package/es/components/biunique-chat/src/components/ChatSet.vue2.js +1 -1
  16. package/es/components/biunique-chat/src/components/MessageTemplate.vue.d.ts +3 -0
  17. package/es/components/biunique-chat/src/components/MessageTemplate.vue2.js +1 -1
  18. package/es/components/biunique-chat/src/components/PersonProfile.vue.d.ts +28 -20
  19. package/es/components/biunique-chat/src/components/PersonProfile.vue2.js +1 -1
  20. package/es/components/biunique-chat/src/components/SiderList.vue.d.ts +2 -2
  21. package/es/components/biunique-chat/src/components/SiderList.vue2.js +1 -1
  22. package/es/components/biunique-chat/src/hooks/useSession.d.ts +4 -1
  23. package/es/components/biunique-chat/src/hooks/useSession.js +1 -1
  24. package/es/components/biunique-chat/src/utils/emoji.js +1 -1
  25. package/es/components/biunique-chat/style/index.css +1 -1
  26. package/es/components/button-print/index.d.ts +13 -0
  27. package/es/components/button-print/src/ButtonPrint.vue.d.ts +13 -0
  28. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  29. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  30. package/es/components/button-print/src/utils/print.d.ts +2 -2
  31. package/es/components/button-print/src/utils/print.js +1 -1
  32. package/es/components/classification/src/index.vue.d.ts +0 -3
  33. package/es/components/default-page/index.d.ts +3 -24
  34. package/es/components/default-page/src/constants/index.d.ts +7 -5
  35. package/es/components/default-page/src/constants/index.js +1 -1
  36. package/es/components/default-page/src/index.vue.d.ts +3 -24
  37. package/es/components/default-page/src/index.vue2.js +1 -1
  38. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  39. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  41. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  45. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  46. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  47. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  48. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  49. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  50. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  51. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  52. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  53. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  54. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  55. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  56. package/es/components/fabric-chart/src/utils/index.js +1 -1
  57. package/es/components/form-render/index.js +1 -1
  58. package/es/components/form-render/src/components/renderer/index.js +1 -1
  59. package/es/components/form-render/src/components/renderer/simpleComponent.d.ts +0 -8
  60. package/es/components/form-render/src/components/renderer/simpleComponent.js +1 -1
  61. package/es/components/form-render/src/components/renderer/text.d.ts +17 -0
  62. package/es/components/form-render/src/components/renderer/text.js +1 -0
  63. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  64. package/es/components/form-render/src/types/index.d.ts +4 -0
  65. package/es/components/form-render/src/utils/index.d.ts +8 -1
  66. package/es/components/form-render/src/utils/index.js +1 -1
  67. package/es/components/index.css +1 -1
  68. package/es/components/index.js +1 -1
  69. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  70. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  71. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  72. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -0
  73. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -0
  74. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -0
  75. package/es/shared/assets/img/defaultCover/1location.png.js +1 -0
  76. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -0
  77. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -0
  78. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -0
  79. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -0
  80. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -0
  81. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -0
  82. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -0
  83. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -0
  84. package/es/shared/assets/img/emoji/emotion_001.png.js +1 -1
  85. package/es/shared/assets/img/emoji/emotion_002.png.js +1 -1
  86. package/es/shared/assets/img/emoji/emotion_003.png.js +1 -1
  87. package/es/shared/assets/img/emoji/emotion_004.png.js +1 -1
  88. package/es/shared/assets/img/emoji/emotion_005.png.js +1 -1
  89. package/es/shared/assets/img/emoji/emotion_006.png.js +1 -1
  90. package/es/shared/assets/img/emoji/emotion_007.png.js +1 -1
  91. package/es/shared/assets/img/emoji/emotion_008.png.js +1 -1
  92. package/es/shared/assets/img/emoji/emotion_009.png.js +1 -1
  93. package/es/shared/assets/img/emoji/emotion_010.png.js +1 -1
  94. package/es/shared/assets/img/emoji/emotion_011.png.js +1 -1
  95. package/es/shared/assets/img/emoji/emotion_012.png.js +1 -1
  96. package/es/shared/assets/img/emoji/emotion_013.png.js +1 -1
  97. package/es/shared/assets/img/emoji/emotion_014.png.js +1 -1
  98. package/es/shared/assets/img/emoji/emotion_015.png.js +1 -1
  99. package/es/shared/assets/img/emoji/emotion_016.png.js +1 -1
  100. package/es/shared/assets/img/emoji/emotion_017.png.js +1 -1
  101. package/es/shared/assets/img/emoji/emotion_018.png.js +1 -1
  102. package/es/shared/assets/img/emoji/emotion_019.png.js +1 -1
  103. package/es/shared/assets/img/emoji/emotion_020.png.js +1 -1
  104. package/es/shared/assets/img/emoji/emotion_021.png.js +1 -1
  105. package/es/shared/assets/img/emoji/emotion_022.png.js +1 -1
  106. package/es/shared/assets/img/emoji/emotion_023.png.js +1 -1
  107. package/es/shared/assets/img/emoji/emotion_024.png.js +1 -1
  108. package/es/shared/assets/img/emoji/emotion_025.png.js +1 -1
  109. package/es/shared/assets/img/emoji/emotion_026.png.js +1 -1
  110. package/es/shared/assets/img/emoji/emotion_027.png.js +1 -1
  111. package/es/shared/assets/img/emoji/emotion_028.png.js +1 -1
  112. package/es/shared/assets/img/emoji/emotion_029.png.js +1 -1
  113. package/es/shared/assets/img/emoji/emotion_030.png.js +1 -1
  114. package/es/shared/assets/img/emoji/emotion_031.png.js +1 -1
  115. package/es/shared/assets/img/emoji/emotion_032.png.js +1 -1
  116. package/es/shared/assets/img/emoji/emotion_033.png.js +1 -1
  117. package/es/shared/assets/img/emoji/emotion_034.png.js +1 -1
  118. package/es/shared/assets/img/emoji/emotion_035.png.js +1 -1
  119. package/es/shared/assets/img/emoji/emotion_036.png.js +1 -1
  120. package/es/shared/assets/img/emoji/emotion_037.png.js +1 -1
  121. package/es/shared/assets/img/emoji/emotion_038.png.js +1 -1
  122. package/es/shared/assets/img/emoji/emotion_039.png.js +1 -1
  123. package/es/shared/assets/img/emoji/emotion_040.png.js +1 -1
  124. package/es/shared/assets/img/emoji/emotion_041.png.js +1 -1
  125. package/es/shared/assets/img/emoji/emotion_042.png.js +1 -1
  126. package/es/shared/assets/img/emoji/emotion_043.png.js +1 -1
  127. package/es/shared/assets/img/emoji/emotion_044.png.js +1 -1
  128. package/es/shared/assets/img/emoji/emotion_045.png.js +1 -1
  129. package/es/shared/assets/img/emoji/emotion_046.png.js +1 -1
  130. package/es/shared/assets/img/emoji/emotion_047.png.js +1 -1
  131. package/es/shared/assets/img/emoji/emotion_048.png.js +1 -1
  132. package/es/shared/assets/img/emoji/emotion_049.png.js +1 -1
  133. package/es/shared/assets/img/emoji/emotion_050.png.js +1 -1
  134. package/es/shared/assets/img/emoji/emotion_051.png.js +1 -1
  135. package/es/shared/assets/img/emoji/emotion_052.png.js +1 -1
  136. package/es/shared/assets/img/emoji/emotion_053.png.js +1 -1
  137. package/es/shared/assets/img/emoji/emotion_054.png.js +1 -1
  138. package/es/shared/assets/img/emoji/emotion_055.png.js +1 -1
  139. package/es/shared/assets/img/emoji/emotion_056.png.js +1 -1
  140. package/es/shared/assets/img/emoji/emotion_057.png.js +1 -1
  141. package/es/shared/assets/img/emoji/emotion_058.png.js +1 -1
  142. package/es/shared/assets/img/emoji/emotion_059.png.js +1 -1
  143. package/es/shared/assets/img/emoji/emotion_060.png.js +1 -1
  144. package/es/shared/assets/img/emoji/emotion_061.png.js +1 -1
  145. package/es/shared/assets/img/emoji/emotion_062.png.js +1 -1
  146. package/es/shared/assets/img/emoji/emotion_063.png.js +1 -1
  147. package/es/shared/assets/img/emoji/emotion_064.png.js +1 -1
  148. package/es/shared/assets/img/emoji/emotion_065.png.js +1 -1
  149. package/es/shared/assets/img/emoji/emotion_066.png.js +1 -1
  150. package/es/shared/assets/img/emoji/emotion_067.png.js +1 -1
  151. package/es/shared/assets/img/emoji/emotion_068.png.js +1 -1
  152. package/es/shared/assets/img/emoji/emotion_069.png.js +1 -1
  153. package/es/shared/assets/img/emoji/emotion_070.png.js +1 -1
  154. package/es/shared/assets/img/emoji/emotion_071.png.js +1 -1
  155. package/es/shared/assets/img/emoji/emotion_072.png.js +1 -1
  156. package/es/shared/assets/img/emoji/emotion_073.png.js +1 -1
  157. package/es/shared/assets/img/emoji/emotion_074.png.js +1 -1
  158. package/es/shared/assets/img/emoji/emotion_075.png.js +1 -1
  159. package/es/shared/assets/img/emoji/emotion_076.png.js +1 -1
  160. package/es/shared/assets/img/emoji/emotion_077.png.js +1 -1
  161. package/es/shared/assets/img/emoji/emotion_078.png.js +1 -1
  162. package/es/shared/assets/img/emoji/emotion_079.png.js +1 -1
  163. package/es/shared/assets/img/emoji/emotion_080.png.js +1 -1
  164. package/es/shared/assets/img/emoji/emotion_081.png.js +1 -1
  165. package/es/shared/assets/img/emoji/emotion_082.png.js +1 -1
  166. package/es/shared/assets/img/emoji/emotion_083.png.js +1 -1
  167. package/es/shared/assets/img/emoji/emotion_084.png.js +1 -1
  168. package/es/shared/assets/img/emoji/emotion_085.png.js +1 -1
  169. package/es/shared/assets/img/emoji/emotion_086.png.js +1 -1
  170. package/es/shared/assets/img/emoji/emotion_087.png.js +1 -1
  171. package/es/shared/assets/img/emoji/emotion_088.png.js +1 -1
  172. package/es/shared/assets/img/emoji/emotion_089.png.js +1 -1
  173. package/es/shared/assets/img/emoji/emotion_090.png.js +1 -1
  174. package/es/shared/assets/img/emoji/emotion_091.png.js +1 -1
  175. package/es/shared/assets/img/emoji/emotion_092.png.js +1 -1
  176. package/es/shared/assets/img/emoji/emotion_093.png.js +1 -1
  177. package/es/shared/assets/img/emoji/emotion_094.png.js +1 -1
  178. package/es/shared/assets/img/emoji/emotion_095.png.js +1 -1
  179. package/es/shared/assets/img/emoji/emotion_096.png.js +1 -1
  180. package/es/shared/assets/img/emoji/emotion_097.png.js +1 -1
  181. package/es/shared/assets/img/emoji/emotion_098.png.js +1 -1
  182. package/es/shared/assets/img/emoji/emotion_099.png.js +1 -1
  183. package/es/shared/assets/img/emoji/emotion_100.png.js +1 -1
  184. package/es/shared/assets/img/emoji/emotion_101.png.js +1 -1
  185. package/es/shared/assets/img/emoji/emotion_102.png.js +1 -1
  186. package/es/shared/assets/img/emoji/emotion_103.png.js +1 -1
  187. package/es/shared/assets/img/emoji/emotion_104.png.js +1 -1
  188. package/es/shared/assets/img/emoji/emotion_105.png.js +1 -1
  189. package/es/shared/assets/img/emoji/emotion_106.png.js +1 -1
  190. package/es/shared/assets/img/emoji/emotion_107.png.js +1 -1
  191. package/es/shared/assets/img/emoji/emotion_108.png.js +1 -1
  192. package/es/shared/assets/img/emoji/emotion_109.png.js +1 -1
  193. package/es/shared/assets/img/emoji/emotion_110.png.js +1 -1
  194. package/es/shared/assets/img/emoji/emotion_111.png.js +1 -1
  195. package/es/shared/assets/img/emoji/emotion_112.png.js +1 -1
  196. package/es/shared/assets/img/emoji/emotion_113.png.js +1 -1
  197. package/es/shared/assets/img/emoji/emotion_114.png.js +1 -1
  198. package/es/shared/assets/img/emoji/emotion_115.png.js +1 -1
  199. package/es/shared/assets/img/emoji/emotion_116.png.js +1 -1
  200. package/es/shared/assets/img/emoji/emotion_117.png.js +1 -1
  201. package/es/shared/assets/img/emoji/emotion_118.png.js +1 -1
  202. package/es/shared/assets/img/emoji/emotion_119.png.js +1 -1
  203. package/es/shared/assets/img/emoji/emotion_120.png.js +1 -1
  204. package/es/shared/assets/img/emoji/emotion_121.png.js +1 -1
  205. package/es/shared/assets/img/emoji/emotion_122.png.js +1 -1
  206. package/es/shared/assets/img/emoji/emotion_123.png.js +1 -1
  207. package/es/shared/assets/img/emoji/emotion_124.png.js +1 -1
  208. package/es/shared/assets/img/emoji/emotion_125.png.js +1 -1
  209. package/es/shared/assets/img/emoji/emotion_126.png.js +1 -1
  210. package/es/shared/assets/img/emoji/emotion_127.png.js +1 -1
  211. package/es/shared/assets/img/emoji/emotion_128.png.js +1 -1
  212. package/es/shared/assets/img/emoji/emotion_129.png.js +1 -1
  213. package/es/shared/assets/img/emoji/emotion_130.png.js +1 -1
  214. package/es/shared/assets/img/emoji/emotion_131.png.js +1 -1
  215. package/es/shared/assets/img/emoji/emotion_132.png.js +1 -1
  216. package/es/shared/assets/img/emoji/emotion_133.png.js +1 -1
  217. package/es/shared/assets/img/emoji/emotion_134.png.js +1 -1
  218. package/es/shared/assets/img/emoji/emotion_135.png.js +1 -1
  219. package/es/shared/assets/img/emoji/emotion_136.png.js +1 -1
  220. package/es/shared/assets/img/emoji/emotion_137.png.js +1 -1
  221. package/es/shared/assets/img/emoji/emotion_138.png.js +1 -1
  222. package/es/shared/assets/img/emoji/emotion_139.png.js +1 -1
  223. package/es/shared/assets/img/emoji/emotion_140.png.js +1 -1
  224. package/es/shared/assets/img/emoji/emotion_141.png.js +1 -1
  225. package/es/shared/assets/img/emoji/emotion_142.png.js +1 -1
  226. package/es/shared/assets/img/emoji/emotion_143.png.js +1 -1
  227. package/es/shared/assets/img/emoji/emotion_144.png.js +1 -1
  228. package/es/shared/assets/img/emoji/emotion_145.png.js +1 -1
  229. package/es/shared/assets/img/emoji/emotion_146.png.js +1 -1
  230. package/es/shared/assets/img/emoji/emotion_147.png.js +1 -1
  231. package/es/shared/assets/img/emoji/emotion_148.png.js +1 -1
  232. package/es/shared/assets/img/emoji/emotion_149.png.js +1 -1
  233. package/es/shared/assets/img/emoji/emotion_150.png.js +1 -1
  234. package/es/shared/assets/img/emoji/emotion_151.png.js +1 -1
  235. package/es/shared/assets/img/emoji/emotion_152.png.js +1 -1
  236. package/es/shared/assets/img/emoji/emotion_153.png.js +1 -1
  237. package/es/shared/assets/img/emoji/emotion_154.png.js +1 -1
  238. package/es/shared/assets/img/emoji/emotion_155.png.js +1 -1
  239. package/es/shared/assets/img/emoji/emotion_156.png.js +1 -1
  240. package/es/shared/assets/img/emoji/emotion_157.png.js +1 -1
  241. package/es/shared/assets/img/emoji/emotion_158.png.js +1 -1
  242. package/es/shared/assets/img/emoji/emotion_159.png.js +1 -1
  243. package/es/shared/assets/img/emoji/emotion_160.png.js +1 -1
  244. package/es/shared/assets/img/emoji/emotion_161.png.js +1 -1
  245. package/es/shared/assets/img/emoji/emotion_162.png.js +1 -1
  246. package/es/shared/assets/img/emoji/emotion_163.png.js +1 -1
  247. package/es/shared/assets/img/emoji/emotion_164.png.js +1 -1
  248. package/es/shared/assets/img/emoji/emotion_165.png.js +1 -1
  249. package/es/shared/assets/img/emoji/emotion_166.png.js +1 -1
  250. package/es/shared/assets/img/emoji/emotion_167.png.js +1 -1
  251. package/es/shared/assets/img/failure.png.js +1 -1
  252. package/es/shared/assets/img/no-permission.png.js +1 -1
  253. package/es/shared/assets/img/nodata.png.js +1 -1
  254. package/es/shared/assets/img/notfound.png.js +1 -1
  255. package/es/shared/assets/img/qr.png.js +1 -1
  256. package/es/shared/assets/img/success.png.js +1 -1
  257. package/es/shared/assets/img/table_style_2.png.js +1 -1
  258. package/es/shared/assets/img/video.png.js +1 -1
  259. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  260. package/es/shared/assets/img/xb_big.png.js +1 -1
  261. package/es/shared/assets/img/xb_small.png.js +1 -1
  262. package/es/shared/package.json.js +1 -1
  263. package/package.json +2 -2
  264. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  265. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  266. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  267. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  268. package/es/shared/assets/img/defaultCover/10reload.jpg.js +0 -1
  269. package/es/shared/assets/img/defaultCover/1tab.jpg.js +0 -1
  270. package/es/shared/assets/img/defaultCover/2menu.jpg.js +0 -1
  271. package/es/shared/assets/img/defaultCover/3view.jpg.js +0 -1
  272. package/es/shared/assets/img/defaultCover/4system.jpg.js +0 -1
  273. package/es/shared/assets/img/defaultCover/5location.jpg.js +0 -1
  274. package/es/shared/assets/img/defaultCover/6notfound.jpg.js +0 -1
  275. package/es/shared/assets/img/defaultCover/7loading.jpg.js +0 -1
  276. package/es/shared/assets/img/defaultCover/8nopermission.jpg.js +0 -1
  277. package/es/shared/assets/img/defaultCover/9nodata.jpg.js +0 -1
  278. package/es/shared/assets/img/emoji/emotion_168.png.js +0 -1
  279. package/es/shared/assets/img/emoji/emotion_169.png.js +0 -1
  280. package/es/shared/assets/img/emoji/emotion_170.png.js +0 -1
  281. package/es/shared/assets/img/emoji/emotion_171.png.js +0 -1
  282. package/es/shared/assets/img/emoji/emotion_172.png.js +0 -1
  283. package/es/shared/assets/img/emoji/emotion_173.png.js +0 -1
  284. package/es/shared/assets/img/emoji/emotion_174.png.js +0 -1
  285. package/es/shared/assets/img/emoji/emotion_175.png.js +0 -1
  286. package/es/shared/assets/img/emoji/emotion_176.png.js +0 -1
  287. package/es/shared/assets/img/emoji/emotion_177.png.js +0 -1
  288. package/es/shared/assets/img/emoji/emotion_178.png.js +0 -1
  289. package/es/shared/assets/img/emoji/emotion_179.png.js +0 -1
  290. package/es/shared/assets/img/emoji/emotion_180.png.js +0 -1
  291. package/es/shared/assets/img/emoji/emotion_181.png.js +0 -1
  292. package/es/shared/assets/img/emoji/emotion_182.png.js +0 -1
  293. package/es/shared/assets/img/emoji/emotion_183.png.js +0 -1
  294. package/es/shared/assets/img/emoji/emotion_184.png.js +0 -1
  295. package/es/shared/assets/img/emoji/emotion_185.png.js +0 -1
  296. package/es/shared/assets/img/emoji/emotion_186.png.js +0 -1
  297. package/es/shared/assets/img/emoji/emotion_187.png.js +0 -1
  298. package/es/shared/assets/img/emoji/emotion_188.png.js +0 -1
  299. package/es/shared/assets/img/emoji/emotion_189.png.js +0 -1
  300. package/es/shared/assets/img/emoji/emotion_190.png.js +0 -1
  301. package/es/shared/assets/img/emoji/emotion_191.png.js +0 -1
  302. package/es/shared/assets/img/emoji/emotion_192.png.js +0 -1
  303. package/es/shared/assets/img/emoji/emotion_193.png.js +0 -1
  304. package/es/shared/assets/img/emoji/emotion_194.png.js +0 -1
  305. package/es/shared/assets/img/emoji/emotion_195.png.js +0 -1
  306. package/es/shared/assets/img/emoji/emotion_196.png.js +0 -1
  307. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  308. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  309. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -90,6 +90,10 @@ declare const _default: import("vue").DefineComponent<{
90
90
  type: ArrayConstructor;
91
91
  default: () => never[];
92
92
  };
93
+ printCopies: {
94
+ type: NumberConstructor;
95
+ default: number;
96
+ };
93
97
  }, {
94
98
  $message: import("naive-ui").MessageApi;
95
99
  printInstance: Print | null;
@@ -183,6 +187,10 @@ declare const _default: import("vue").DefineComponent<{
183
187
  type: ArrayConstructor;
184
188
  default: () => never[];
185
189
  };
190
+ printCopies: {
191
+ type: NumberConstructor;
192
+ default: number;
193
+ };
186
194
  }>> & {
187
195
  onError?: ((...args: any[]) => any) | undefined;
188
196
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -1962,6 +1970,10 @@ declare const _default: import("vue").DefineComponent<{
1962
1970
  type: ArrayConstructor;
1963
1971
  default: () => never[];
1964
1972
  };
1973
+ printCopies: {
1974
+ type: NumberConstructor;
1975
+ default: number;
1976
+ };
1965
1977
  }>> & {
1966
1978
  onError?: ((...args: any[]) => any) | undefined;
1967
1979
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -1989,5 +2001,6 @@ declare const _default: import("vue").DefineComponent<{
1989
2001
  }>;
1990
2002
  showLoading: boolean;
1991
2003
  hideButtons: unknown[];
2004
+ printCopies: number;
1992
2005
  }>;
1993
2006
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,reactive as n,computed as i,onMounted as a,watch as r,openBlock as o,createElementBlock as s,Fragment as l,createVNode as d,unref as p,withCtx as u,renderSlot as m,withModifiers as c,createTextVNode as f,toDisplayString as v,mergeProps as y}from"vue";import{isObject as g}from"@vue/shared";import{useMessage as b,NDropdown as h,NButton as I,NIcon as P}from"naive-ui";import{ChevronDown as w}from"@vicons/ionicons5";import{Print as k}from"./utils/print.js";import{isIReport as F}from"./utils/browserPrint.js";import T from"./components/IdentityVerification.vue.js";import{format as S}from"date-fns";import{savePrivateFormatApi as x,getPrivateFormatApi as O}from"./api.js";var j=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:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]}},emits:["success","error","cancel","clickoutside"],setup(t,{expose:j,emit:L}){var E;const D=t,M=b();let N;const V={},B=e(""),C=n({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null});let R=e([{label:D.printText,key:"printText"},{label:D.previewText,key:"previewText"},{label:D.pdfLoadText,key:"downloadPdf"},{label:D.formatEditText,key:"formatEditText"},...(null==(E=D.externalOptionConfig)?void 0:E.options)||[]]);const z=i((()=>{if(!C.currentFormatId)return{};let t=C.currentFormatId;return C.formatList.find((e=>e.id===t))})),A=i((()=>{var t;return(null==(t=z.value)?void 0:t.name)||"格式选择"})),J=i((()=>{let t=C.formatList.find((t=>t.id===C.currentFormatId));return null==t?void 0:t.templateId})),U=async t=>{if(D.directPrint){if(C.spinning)return;return"button"===t?void await st():at()}return at()},q=t=>d("span",{class:{active:t.key===C.currentFormatId}},[t.label]),K=(t,e)=>{C.spinning=!1;let n={type:e,formatId:C.currentFormatId,templateId:J.value};L("success",t,n)},_=t=>{C.spinning=!1,L("error",t),g(t)&&"notInstalledApp"===t.type&&M.error(t.message)},G=t=>{C.spinning=!1,L("cancel",t)},H=t=>{L("error",{message:"前置条件执行错误",type:t,preExecution:!0})},Y=(t=0)=>{var e;const n=(null==(e=D.printParams)?void 0:e.length)?D.printParams[t]:C.printParams[t];return JSON.stringify({...n||{},...D.token?{token:D.token}:{}})},$=()=>{var t,e;let n={},i={};if(null==(t=C.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(C.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(C.printParams.map((e=>JSON.parse(e.datasetData[t]))));i={datasetData:{}},i.datasetData[t]=n}else Object.keys(C.printParams[0]).forEach((t=>{i[t]=[],C.printParams.forEach((e=>{i[t].includes(e[t])||i[t].push(e[t])})),i[t]=i[t].join(",")}));return n=Object.assign({},JSON.parse(Y(0)),i),JSON.stringify(n)},Q=()=>{let t=C.printParams.length;const e=async e=>{try{--t<=0&&K(e,"print")}catch(t){console.log("error",t)}};D.showLoading&&C.spinning||(C.spinning=!0,D.prevFn("print").then((()=>{const t={formatId:C.currentFormatId,templateId:J.value,authorizationKey:B.value,printdlgshow:D.printdlgshow,signature:D.signature};if("MULTI"===D.strategy)for(let n=0;n<C.printParams.length;n++)n>0&&(t.printdlgshow="0"),N.printDirect({...t,params:Y(n)},e,_,G);else N.printDirect({...t,params:$()},(t=>{K(t,"print")}),_,G)})).catch((()=>{H("print"),C.spinning=!1})).finally((()=>{C.visible=!1})))},W=async(t,e)=>{var n,i;switch(t){case"printText":Q();break;case"previewText":(async()=>{D.showLoading&&C.spinning||(C.spinning=!0,D.prevFn("preview").then((()=>{const t="MULTI"===D.strategy?Y():$(),e={formatId:C.currentFormatId,templateId:J.value,authorizationKey:B.value,params:t,btnprint:D.btnprint,signature:D.signature};N.preview(e,(t=>{K(t,"preview")}),_)})).catch((()=>{H("preview"),C.spinning=!1})).finally((()=>{C.visible=!1})))})();break;case"formatEditText":D.showLoading&&C.spinning||(C.spinning=!0,D.prevFn("edit").then((()=>{C.identityVerification.visible=!0})).catch((()=>{H("edit")})).finally((()=>{C.visible=!1,C.spinning=!1})));break;case"downloadPdf":(async()=>{D.showLoading&&C.spinning||(C.spinning=!0,D.prevFn("download").then((()=>{const t="MULTI"===D.strategy?Y():$(),e={formatId:C.currentFormatId,templateId:J.value,authorizationKey:B.value,print:{print:"1",type:"1"},params:t,signature:D.signature};N.downloadPDF(e,(t=>K(t,"preview")),_)})).catch((()=>{H("download"),C.spinning=!1})).finally((()=>{C.visible=!1})))})();break;default:{C.visible=!1;const a=C.formatList.find((e=>e.id===t))||{};if(Object.keys(a).length>0){C.currentFormatId=t;const[e]=R.value;e.label=(null==a?void 0:a.name)||e.label,await x({formatForms:[{...a}],name:V.name||a.templateName,number:V.number||a.number,templateId:V.templateId||a.templateId,...V.id?{id:V.id}:{}},{token:D.token})}else null==(i=null==(n=D.externalOptionConfig)?void 0:n.onSelect)||i.call(n,t,e);break}}},X=()=>{C.visible=!1,L("clickoutside")},Z=()=>(C.isInited=!1,C.spinning=!1,setTimeout((()=>{C.visible=!1}),0),!1),tt=(t,e,n)=>{const i={};return e.forEach((e=>{let a=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(i=S(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&a&&(i[e[n]]=a)})),i},et=({customizeDataset:t=[],param:e=[]},n=[])=>n.map((n=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData={[t.name]:JSON.stringify(tt(n,e,"fieldName"))}})),i=Object.assign({},i,tt(n,e,"key")),i})),nt=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 n;if(!(null==t?void 0:t.length))return"";const{data:i}=await O({templateId:t[0].templateId},{token:D.token});if("SUCCESS"===i.result){const{formatForms:e=[]}=i.map||{};Object.assign(V,i.map||{});const a=null==(n=null==e?void 0:e[0])?void 0:n.id;if(a&&t.map((t=>t.id)).includes(a))return a}const a=t.find((t=>1==t[e]));return(null==a?void 0:a.id)||t[0].id})(C.formatList,"defaultFlag"),!C.currentFormatId)return M.error("获取打印格式失败,请联系管理员!"),Z();(()=>{var t;const e=C.formatList.map((t=>({label:t.name,key:t.id})));R.value.unshift({label:A.value,key:"format",children:e}),D.hideButtons.length>0&&(R.value=R.value.filter((t=>!D.hideButtons.includes(t.key))));const n=sessionStorage.getItem("portal");if(n){const e=JSON.parse(n),i=(null==(t=null==e?void 0:e.user)?void 0:t.currentRoleResourceObj)||{},a=Object.keys(i);a.includes("RY7.2.21.1.M2.G94181E")||(R.value=R.value.filter((t=>"downloadPdf"!=t.key))),a.includes("RY7.2.21.1.M2.G33633A")||(R.value=R.value.filter((t=>"formatEditText"!=t.key)))}})();let n=null==(e=await D.queryTemplateParams())?void 0:e.obj;if(!n||!J.value)return M.error("获取打印模板失败,请联系管理员!"),Z();C.templateParams=n,C.printParams=et(C.templateParams,D.params)},it=async()=>{var t;if(C.isInited)return!0;C.isInited=!0,C.spinning=!0,(()=>{if(N)return!1;N=new k})();const e=await D.queryPrintFormatByNumber();return await nt(e),(null==(t=e.obj)?void 0:t.length)>0&&(B.value=e.obj[0].authorizationKey||""),C.spinning=!1,!0},at=async(t=!0)=>{var e,n;if(await D.clickPrevFn())if((null==(e=D.params)?void 0:e.length)||(null==(n=D.printParams)?void 0:n.length)){if(!C.visible){if(!await it())return!1}t&&(C.visible=!C.visible)}else M.warning(D.noDataMsg)},rt=()=>{C.watchPrintParamsReformatFn&&C.watchPrintParamsReformatFn(),C.isInited?C.printParams=et(C.templateParams,D.params):C.watchPrintParamsReformatFn=()=>r((()=>C.isInited),(t=>{if(!t)return!1;rt()}))},ot=t=>{if(C.identityVerification.visible=!1,F(C.currentFormatId))return K(null,"edit");const e={formatId:C.currentFormatId,templateId:J.value,params:Y(),token:t};N.editPrintFormat(e,(t=>{K(t,"edit")}),_)};async function st(){await at(!1),Q()}return a((()=>{C.isInited=!1})),r((()=>D.params),(t=>{if(!(null==t?void 0:t.length))return!1;rt()}),{deep:!0}),j({directPrint:st}),(e,n)=>(o(),s(l,null,[d(p(h),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:C.visible,onClickoutside:X,options:p(R),onSelect:W,"render-label":q},{default:u((()=>[m(e.$slots,"button",{handleClickPrintBtn:at,printSpinning:C.spinning,printbtnText:t.btnText,printVisible:C.visible},(()=>[d(p(I),{class:"dropdown-button",loading:t.showLoading&&C.spinning,onClick:n[1]||(n[1]=c((()=>U("button")),["stop"]))},{default:u((()=>[f(v(t.btnText)+" ",1),d(p(P),{component:p(w),size:"18",style:{"margin-left":"5px"},onClick:n[0]||(n[0]=c((()=>U("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["show","options"]),d(T,y(e.$attrs,{modelValue:C.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>C.identityVerification.visible=t),formatId:C.currentFormatId,templateId:p(J),onSuccess:ot}),null,16,["modelValue","formatId","templateId"])],64))}});export{j as default};
1
+ import{defineComponent as t,ref as e,reactive as n,computed as i,onMounted as a,watch as r,openBlock as o,createElementBlock as s,Fragment as l,createVNode as d,unref as p,withCtx as u,renderSlot as m,withModifiers as c,createTextVNode as f,toDisplayString as v,mergeProps as y}from"vue";import{isObject as g}from"@vue/shared";import{useMessage as b,NDropdown as h,NButton as I,NIcon as P}from"naive-ui";import{ChevronDown as w}from"@vicons/ionicons5";import{Print as k}from"./utils/print.js";import{isIReport as F}from"./utils/browserPrint.js";import T from"./components/IdentityVerification.vue.js";import{format as S}from"date-fns";import{savePrivateFormatApi as x,getPrivateFormatApi as O}from"./api.js";var j=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:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number,default:1}},emits:["success","error","cancel","clickoutside"],setup(t,{expose:j,emit:L}){var E;const D=t,M=b();let N;const C={},V=e(""),B=n({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null});let R=e([{label:D.printText,key:"printText"},{label:D.previewText,key:"previewText"},{label:D.pdfLoadText,key:"downloadPdf"},{label:D.formatEditText,key:"formatEditText"},...(null==(E=D.externalOptionConfig)?void 0:E.options)||[]]);const z=i((()=>{if(!B.currentFormatId)return{};let t=B.currentFormatId;return B.formatList.find((e=>e.id===t))})),A=i((()=>{var t;return(null==(t=z.value)?void 0:t.name)||"格式选择"})),J=i((()=>{let t=B.formatList.find((t=>t.id===B.currentFormatId));return null==t?void 0:t.templateId})),U=async t=>{if(D.directPrint){if(B.spinning)return;return"button"===t?void await st():at()}return at()},q=t=>d("span",{class:{active:t.key===B.currentFormatId}},[t.label]),K=(t,e)=>{B.spinning=!1;let n={type:e,formatId:B.currentFormatId,templateId:J.value};L("success",t,n)},_=t=>{B.spinning=!1,L("error",t),g(t)&&"notInstalledApp"===t.type&&M.error(t.message)},G=t=>{B.spinning=!1,L("cancel",t)},H=t=>{L("error",{message:"前置条件执行错误",type:t,preExecution:!0})},Y=(t=0)=>{var e;const n=(null==(e=D.printParams)?void 0:e.length)?D.printParams[t]:B.printParams[t];return JSON.stringify({...n||{},...D.token?{token:D.token}:{}})},$=()=>{var t,e;let n={},i={};if(null==(t=B.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(B.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(B.printParams.map((e=>JSON.parse(e.datasetData[t]))));i={datasetData:{}},i.datasetData[t]=n}else Object.keys(B.printParams[0]).forEach((t=>{i[t]=[],B.printParams.forEach((e=>{i[t].includes(e[t])||i[t].push(e[t])})),i[t]=i[t].join(",")}));return n=Object.assign({},JSON.parse(Y(0)),i),JSON.stringify(n)},Q=()=>{let t=B.printParams.length;const e=async e=>{try{--t<=0&&K(e,"print")}catch(t){console.log("error",t)}};D.showLoading&&B.spinning||(B.spinning=!0,D.prevFn("print").then((()=>{const t={formatId:B.currentFormatId,templateId:J.value,authorizationKey:V.value,printdlgshow:D.printdlgshow,signature:D.signature,copies:D.printCopies};if("MULTI"===D.strategy)for(let n=0;n<B.printParams.length;n++)n>0&&(t.printdlgshow="0"),N.printDirect({...t,params:Y(n)},e,_,G);else N.printDirect({...t,params:$()},(t=>{K(t,"print")}),_,G)})).catch((()=>{H("print"),B.spinning=!1})).finally((()=>{B.visible=!1})))},W=async(t,e)=>{var n,i;switch(t){case"printText":Q();break;case"previewText":(async()=>{D.showLoading&&B.spinning||(B.spinning=!0,D.prevFn("preview").then((()=>{const t="MULTI"===D.strategy?Y():$(),e={formatId:B.currentFormatId,templateId:J.value,authorizationKey:V.value,params:t,btnprint:D.btnprint,signature:D.signature};N.preview(e,(t=>{K(t,"preview")}),_)})).catch((()=>{H("preview"),B.spinning=!1})).finally((()=>{B.visible=!1})))})();break;case"formatEditText":D.showLoading&&B.spinning||(B.spinning=!0,D.prevFn("edit").then((()=>{B.identityVerification.visible=!0})).catch((()=>{H("edit")})).finally((()=>{B.visible=!1,B.spinning=!1})));break;case"downloadPdf":(async()=>{D.showLoading&&B.spinning||(B.spinning=!0,D.prevFn("download").then((()=>{const t="MULTI"===D.strategy?Y():$(),e={formatId:B.currentFormatId,templateId:J.value,authorizationKey:V.value,print:{print:"1",type:"1"},params:t,signature:D.signature};N.downloadPDF(e,(t=>K(t,"preview")),_)})).catch((()=>{H("download"),B.spinning=!1})).finally((()=>{B.visible=!1})))})();break;default:{B.visible=!1;const a=B.formatList.find((e=>e.id===t))||{};if(Object.keys(a).length>0){B.currentFormatId=t;const[e]=R.value;e.label=(null==a?void 0:a.name)||e.label,await x({formatForms:[{...a}],name:C.name||a.templateName,number:C.number||a.number,templateId:C.templateId||a.templateId,...C.id?{id:C.id}:{}},{token:D.token})}else null==(i=null==(n=D.externalOptionConfig)?void 0:n.onSelect)||i.call(n,t,e);break}}},X=()=>{B.visible=!1,L("clickoutside")},Z=()=>(B.isInited=!1,B.spinning=!1,setTimeout((()=>{B.visible=!1}),0),!1),tt=(t,e,n)=>{const i={};return e.forEach((e=>{let a=((t,e)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let i=e;return Object.keys(n).includes(t.type)&&e&&e instanceof Date&&(i=S(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&a&&(i[e[n]]=a)})),i},et=({customizeDataset:t=[],param:e=[]},n=[])=>n.map((n=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData={[t.name]:JSON.stringify(tt(n,e,"fieldName"))}})),i=Object.assign({},i,tt(n,e,"key")),i})),nt=async t=>{var e;if(B.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):[],B.currentFormatId=await(async(t,e)=>{var n;if(!(null==t?void 0:t.length))return"";const{data:i}=await O({templateId:t[0].templateId},{token:D.token});if("SUCCESS"===i.result){const{formatForms:e=[]}=i.map||{};Object.assign(C,i.map||{});const a=null==(n=null==e?void 0:e[0])?void 0:n.id;if(a&&t.map((t=>t.id)).includes(a))return a}const a=t.find((t=>1==t[e]));return(null==a?void 0:a.id)||t[0].id})(B.formatList,"defaultFlag"),!B.currentFormatId)return M.error("获取打印格式失败,请联系管理员!"),Z();(()=>{var t;const e=B.formatList.map((t=>({label:t.name,key:t.id})));R.value.unshift({label:A.value,key:"format",children:e}),D.hideButtons.length>0&&(R.value=R.value.filter((t=>!D.hideButtons.includes(t.key))));const n=sessionStorage.getItem("portal");if(n){const e=JSON.parse(n),i=(null==(t=null==e?void 0:e.user)?void 0:t.currentRoleResourceObj)||{},a=Object.keys(i);a.includes("RY7.2.21.1.M2.G94181E")||(R.value=R.value.filter((t=>"downloadPdf"!=t.key))),a.includes("RY7.2.21.1.M2.G33633A")||(R.value=R.value.filter((t=>"formatEditText"!=t.key)))}})();let n=null==(e=await D.queryTemplateParams())?void 0:e.obj;if(!n||!J.value)return M.error("获取打印模板失败,请联系管理员!"),Z();B.templateParams=n,B.printParams=et(B.templateParams,D.params)},it=async()=>{var t;if(B.isInited)return!0;B.isInited=!0,B.spinning=!0,(()=>{if(N)return!1;N=new k})();const e=await D.queryPrintFormatByNumber();return await nt(e),(null==(t=e.obj)?void 0:t.length)>0&&(V.value=e.obj[0].authorizationKey||""),B.spinning=!1,!0},at=async(t=!0)=>{var e,n;if(await D.clickPrevFn())if((null==(e=D.params)?void 0:e.length)||(null==(n=D.printParams)?void 0:n.length)){if(!B.visible){if(!await it())return!1}t&&(B.visible=!B.visible)}else M.warning(D.noDataMsg)},rt=()=>{B.watchPrintParamsReformatFn&&B.watchPrintParamsReformatFn(),B.isInited?B.printParams=et(B.templateParams,D.params):B.watchPrintParamsReformatFn=()=>r((()=>B.isInited),(t=>{if(!t)return!1;rt()}))},ot=t=>{if(B.identityVerification.visible=!1,F(B.currentFormatId))return K(null,"edit");const e={formatId:B.currentFormatId,templateId:J.value,params:Y(),token:t};N.editPrintFormat(e,(t=>{K(t,"edit")}),_)};async function st(){await at(!1),Q()}return a((()=>{B.isInited=!1})),r((()=>D.params),(t=>{if(!(null==t?void 0:t.length))return!1;rt()}),{deep:!0}),j({directPrint:st}),(e,n)=>(o(),s(l,null,[d(p(h),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:B.visible,onClickoutside:X,options:p(R),onSelect:W,"render-label":q},{default:u((()=>[m(e.$slots,"button",{handleClickPrintBtn:at,printSpinning:B.spinning,printbtnText:t.btnText,printVisible:B.visible},(()=>[d(p(I),{class:"dropdown-button",loading:t.showLoading&&B.spinning,onClick:n[1]||(n[1]=c((()=>U("button")),["stop"]))},{default:u((()=>[f(v(t.btnText)+" ",1),d(p(P),{component:p(w),size:"18",style:{"margin-left":"5px"},onClick:n[0]||(n[0]=c((()=>U("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["show","options"]),d(T,y(e.$attrs,{modelValue:B.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>B.identityVerification.visible=t),formatId:B.currentFormatId,templateId:p(J),onSuccess:ot}),null,16,["modelValue","formatId","templateId"])],64))}});export{j as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,reactive as a,watch as l,openBlock as o,createBlock as u,unref as r,normalizeStyle as i,withCtx as s,createElementVNode as n,mergeProps as d,createVNode as c,createTextVNode as m}from"vue";import{useMessage as p,NModal as v,NForm as f,NFormItem as y,NInput as w,NButton as g}from"naive-ui";import h from"./EditFormat.vue.js";import"../utils/print.js";import{isIReport as k}from"../utils/browserPrint.js";const I={class:"content"};var _=e({__name:"IdentityVerification",props:{verifyUser:{type:Function,default:()=>Promise.resolve()},identityVerificationTitle:{default:"打印服务身份校验"},modelValue:{type:Boolean},formatId:null,templateId:null},emits:["update:modelValue","success","close"],setup(e,{emit:_}){const V=e,b=p(),x={account:"",password:""},C=t(null),U=t(!1),j=t("");let S=a({...x});const F={account:{required:!0,message:"请输入账号"},password:{required:!0,message:"请输入密码"}},P="416px",q=t(null),E=()=>{_("update:modelValue",!1),_("close")},N=t(!1),R=()=>{var e;null==(e=q.value)||e.validate((e=>{if(e)return console.log(e),!1;(async()=>{var e,t;try{N.value=!0;const{data:a={}}=await V.verifyUser(S)||{};if("SUCCESS"!==a.result)return b.error(a.resultMsg||"身份校验失败,请重试!"),!1;k(V.formatId||"")?(U.value=!0,j.value=null==(e=a.map)?void 0:e.token):_("success",null==(t=a.map)?void 0:t.token)}finally{N.value=!1}})()}))},T=async()=>{var e,t;try{N.value=!0;if(!await(null==(t=C.value)?void 0:t.submit({authorizationKey:j.value,id:null==(e=V.formatId)?void 0:e.split("_")[1],templateId:V.templateId,datasourceName:null,dataSourceId:null})))return!1;_("success",j.value)}finally{N.value=!1}};return l((()=>V.modelValue),(e=>{e||Object.assign(S,x)})),(t,a)=>(o(),u(r(v),{preset:"dialog",title:U.value?"编辑":e.identityVerificationTitle,class:"standard-modal standard-modal-white authentication-modal c-button-print-modal",show:e.modelValue,"close-on-esc":!1,"show-icon":!1,style:i({width:P,overflowY:"auto"}),"positive-text":U.value?"确认":"","negative-text":U.value?"取消":"",onClose:E,onNegativeClick:E,onPositiveClick:T},{default:s((()=>[n("div",I,[U.value?(o(),u(h,d({key:0,ref_key:"editFormRef",ref:C},t.$attrs,{formatId:e.formatId,token:j.value}),null,16,["formatId","token"])):(o(),u(r(f),{key:1,class:"login-form-button-print",ref_key:"formRef",ref:q,model:r(S),rules:F},{default:s((()=>[c(r(y),{path:"account"},{default:s((()=>[c(r(w),{value:r(S).account,"onUpdate:value":a[0]||(a[0]=e=>r(S).account=e),placeholder:"请输入账号"},null,8,["value"])])),_:1}),c(r(y),{path:"password"},{default:s((()=>[c(r(w),{type:"password","input-props":{autocomplete:"on",name:"password"},value:r(S).password,"onUpdate:value":a[1]||(a[1]=e=>r(S).password=e),placeholder:"请输入密码"},null,8,["value"])])),_:1}),c(r(y),null,{default:s((()=>[c(r(g),{loading:N.value,type:"primary",class:"login-form-button",onClick:R},{default:s((()=>[m("登录")])),_:1},8,["loading"])])),_:1})])),_:1},8,["model"]))])])),_:1},8,["title","show","style","positive-text","negative-text"]))}});export{_ as default};
1
+ import{defineComponent as e,ref as t,reactive as a,watch as l,openBlock as o,createBlock as u,unref as r,normalizeStyle as n,withCtx as i,createElementVNode as s,mergeProps as d,createVNode as p,withKeys as c,createTextVNode as m}from"vue";import{useMessage as v,NModal as f,NForm as y,NFormItem as w,NInput as g,NButton as h}from"naive-ui";import k from"./EditFormat.vue.js";import"../utils/print.js";import{isIReport as I}from"../utils/browserPrint.js";const _={class:"content"};var V=e({__name:"IdentityVerification",props:{verifyUser:{type:Function,default:()=>Promise.resolve()},identityVerificationTitle:{default:"打印服务身份校验"},modelValue:{type:Boolean},formatId:null,templateId:null},emits:["update:modelValue","success","close"],setup(e,{emit:V}){const b=e,x=v(),C={account:"",password:""},K=t(null),U=t(!1),j=t("");let S=a({...C});const F={account:{required:!0,message:"请输入账号"},password:{required:!0,message:"请输入密码"}},P="416px",q=t(null),E=()=>{V("update:modelValue",!1),V("close")},N=t(!1),R=()=>{var e;null==(e=q.value)||e.validate((e=>{if(e)return console.log(e),!1;(async()=>{var e,t;try{N.value=!0;const{data:a={}}=await b.verifyUser(S)||{};if("SUCCESS"!==a.result)return x.error(a.resultMsg||"身份校验失败,请重试!"),!1;I(b.formatId||"")?(U.value=!0,j.value=null==(e=a.map)?void 0:e.token):V("success",null==(t=a.map)?void 0:t.token)}finally{N.value=!1}})()}))},T=async()=>{var e,t;try{N.value=!0;if(!await(null==(t=K.value)?void 0:t.submit({authorizationKey:j.value,id:null==(e=b.formatId)?void 0:e.split("_")[1],templateId:b.templateId,datasourceName:null,dataSourceId:null})))return!1;V("success",j.value)}finally{N.value=!1}};return l((()=>b.modelValue),(e=>{e||Object.assign(S,C)})),(t,a)=>(o(),u(r(f),{preset:"dialog",title:U.value?"编辑":e.identityVerificationTitle,class:"standard-modal standard-modal-white authentication-modal c-button-print-modal",show:e.modelValue,"close-on-esc":!1,"show-icon":!1,style:n({width:P,overflowY:"auto"}),"positive-text":U.value?"确认":"","negative-text":U.value?"取消":"",onClose:E,onNegativeClick:E,onPositiveClick:T},{default:i((()=>[s("div",_,[U.value?(o(),u(k,d({key:0,ref_key:"editFormRef",ref:K},t.$attrs,{formatId:e.formatId,token:j.value}),null,16,["formatId","token"])):(o(),u(r(y),{key:1,class:"login-form-button-print",ref_key:"formRef",ref:q,model:r(S),rules:F},{default:i((()=>[p(r(w),{path:"account"},{default:i((()=>[p(r(g),{value:r(S).account,"onUpdate:value":a[0]||(a[0]=e=>r(S).account=e),placeholder:"请输入账号",onKeyup:c(R,["enter"])},null,8,["value","onKeyup"])])),_:1}),p(r(w),{path:"password"},{default:i((()=>[p(r(g),{type:"password","input-props":{autocomplete:"on",name:"password"},value:r(S).password,"onUpdate:value":a[1]||(a[1]=e=>r(S).password=e),placeholder:"请输入密码",onKeyup:c(R,["enter"])},null,8,["value","onKeyup"])])),_:1}),p(r(w),null,{default:i((()=>[p(r(h),{loading:N.value,type:"primary",class:"login-form-button",onClick:R},{default:i((()=>[m("登录")])),_:1},8,["loading"])])),_:1})])),_:1},8,["model"]))])])),_:1},8,["title","show","style","positive-text","negative-text"]))}});export{V as default};
@@ -52,7 +52,7 @@ export declare class Print {
52
52
  pageCount: any;
53
53
  formatId: string;
54
54
  };
55
- _handleEventDirect({ templateId, formatId, params, paramsArr, cmdid, print, signature, printdlgshow, nobillnode, btnprint, messageTimeout }: AnyObject): Promise<any>;
55
+ _handleEventDirect({ templateId, formatId, params, paramsArr, cmdid, print, signature, copies, printdlgshow, nobillnode, btnprint, messageTimeout }: AnyObject): Promise<any>;
56
56
  _handleEventEditFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject): Promise<any>;
57
57
  _queryProxyOrigin(): Promise<void>;
58
58
  _queryPrintFile(formatId: string, params?: string): Promise<any>;
@@ -64,7 +64,7 @@ export declare class Print {
64
64
  _base64ToBlob(fileBase64: string, fileType: string): Blob;
65
65
  preview({ templateId, formatId, params, paramsArr, authorizationKey, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: AnyFn, errorCallbackFn?: AnyFn): Promise<any>;
66
66
  printSync(data: AnyObject[], successCallbackFn: AnyFn, errorCallbackFn: AnyFn): Promise<void>;
67
- printDirect({ templateId, formatId, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, mode?: string): Promise<any>;
67
+ printDirect({ templateId, formatId, params, paramsArr, authorizationKey, print, signature, printdlgshow, nobillnode, copies, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: AnyFn, errorCallbackFn: AnyFn, cancelCallbackFn?: AnyFn, mode?: string): Promise<any>;
68
68
  private _downloadPDF;
69
69
  /**
70
70
  * 下载pdf
@@ -1 +1 @@
1
- import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as r,useBrowserPrint as n,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as c}from"date-fns";import{io as h}from"socket.io-client";const m=String(navigator.platform).toLowerCase().includes("linux"),d=t.create({timeout:6e4,withCredentials:!1}),p=`${window.location.protocol}//${window.location.host}`,u=`${p}/fdp-api/print/assembly/printIReport`,f=`${p}/bi-api/reprot/print/open/client/printIReportForBase64`,g=`${p}/bi-api/reprot/print/open/client/previewIReport`,w=`${p}/bi-api/reprot/print/open/client/getRemote`,y=`${p}/printService/file`;let P=null;class v{constructor(){var t,e,r;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.queryServicesParams=null,this.isConnectHiPrint=!1,this.clientInfo=null,this.printerList=[],this.hiPrintSocket=null,this.base64Fragment="",this._successCallbackFn=null,this._errorCallbackFn=null,this._isHiprint=!1,this.messageHandlerQueue=[],this.getIReportFormatId=(t,e)=>t?e.split("_")[1]:e,P)return P;P=this,m&&this._isHiprint&&this._initDomesticSystem();const n=window;this.CMonitor=n.$CMonitor;try{this.webview=n.top?null==(t=n.top.chrome)?void 0:t.webview:null==(e=n.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(r=n.chrome)?void 0:r.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:r}=e;try{s(i.res||"")}catch(t){r(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}_initDomesticSystem(){try{this.hiPrintSocket=h("http://127.0.0.1:17521",{reconnectionAttempts:3,transports:["websocket"],auth:{token:"no-use-vue-plugin-hiprint"}}),this.hiPrintSocket&&(this.hiPrintSocket.on("connect",(()=>{this.isConnectHiPrint=!0})),this.hiPrintSocket.on("disconnect",(()=>{this.isConnectHiPrint=!1,this.hiPrintSocket=null})),this.hiPrintSocket.on("clientInfo",(t=>{console.log("获取到客户端信息>>>>>",t),t.clientUrl&&(this.clientInfo=t)})),this.hiPrintSocket.on("printerList",(t=>{this.printerList=t,console.log("获取到打印机列表信息>>>>>",t)})),this.hiPrintSocket.on("success",(t=>{console.log("打印成功>>>>>",t),this.base64Fragment="",this._successCallbackFn&&this._successCallbackFn(t)})),this.hiPrintSocket.on("replayPrinterTemplate",(t=>{console.log("获取到数据的回复>>>>>",t),t&&this.hiPrintSocket.emit("news",t)})),this.hiPrintSocket.on("error",(t=>{console.log("打印失败>>>>>",t),this.base64Fragment="",this._errorCallbackFn&&this._errorCallbackFn(t)})))}catch(t){console.log("hiprint系统连接失败",t)}}async getPicAndUpload(t){try{const e=t=>"[object Object]"===Object.prototype.toString.call(t);if("success"===(null==t?void 0:t.result)&&"Y"==(null==t?void 0:t.uploadTemplateFlag)&&!(null==t?void 0:t.filebase64)&&this.queryServicesParams){const t=e(this.queryServicesParams.params)?this.queryServicesParams.params:JSON.parse(this.queryServicesParams.params);t.uploadTemplateFlag="Y",this.queryServicesParams.params=JSON.stringify(t),this.queryServicesParams.cmdid="7",this.queryServicesParams.print={print:1,type:6,zip:0},this.queryServicesParams.paramsArr=[{params:JSON.stringify(t)}];await this._queryBase64ServicesPrint(this.queryServicesParams)}}catch(t){console.log(t)}finally{this.queryServicesParams=null}}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{d({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_queryBase64ServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):d({url:"/services/Printqueue",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):d({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e,i){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const s=t.message||t.Message;this._handleMonitorNotify(s);const r={type:"printError",message:s,result:t.result,errinfo:t.errinfo};return"cancel"==t.result?(i&&i({type:"printCancel",message:s,result:t.result,errinfo:t.errinfo}),!1):(null==e||e(r),!1)}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,r){const n={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(n);return this._handleQueryPrintDataResult(a,e,r)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,paramsArr:s,cmdid:r,print:n,signature:a,printdlgshow:o="0",nobillnode:l="1",btnprint:h="1",messageTimeout:m=0}){const d={templateId:t,formatId:e,params:i,cmdid:r,nobillnode:l,printdlgshow:o,btnprint:h,messageTimeout:m,...a?{signature:a}:{}};if(s&&(d.paramsArr=s),n){try{n=JSON.parse(n)}catch(t){}d.print=n}else if(this.isRemote){const t=c(new Date,"yyyyMMddHHmmss");d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return this.queryServicesParams=d,await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:r=0}){const n={};let a={};try{a=Object.assign({},n,JSON.parse(i))}catch(t){a=n}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:r};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await d({method:"get",url:w})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=p+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await d({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}paramsSerializer(t){return Object.keys(t).forEach((e=>{const i=t[e];t[e]=i,"biParams"==e&&(t[e]=encodeURIComponent(i))})),t}async _queryPrintForBase64(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await d({method:"post",url:f,params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _queryPrintForPdf(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await d({method:"post",url:g,responseType:"blob",params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await r(`${y}/${a}/${o}`),c=n(null,e,l);if("preview"===e)return c}}_base64ToBlob(t,e){const i=window.atob(t);let s=i.length;const r=new Uint8Array(s);for(;s--;)r[s]=i.charCodeAt(s);return new Blob([r],{type:e})}async preview({templateId:t,formatId:e,params:i="",paramsArr:s,authorizationKey:r,signature:l,btnprint:c,messageTimeout:h=0},d,p){const u=a(e);if(e=this.getIReportFormatId(u,e),u&&m&&this._isHiprint){const s=await this._queryPrintForPdf(t,e,i,r);if(!s)return null==p?void 0:p("获取文件失败!");const a=n(s,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,a),null==d?void 0:d({file:s})}await this._queryProxyOrigin();const f=await this._testConnection();if(!this._handleResultTest(f,p))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,paramsArr:s,cmdid:this.isRemote?"7":"8",signature:l,btnprint:c,messageTimeout:h}),n=this._handleResult(r,p);if(!n)return!1;if(this.isRemote){const t=await this._browserPrint(n,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}await this.getPicAndUpload(n),null==d||d(n)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==p||p(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){const s=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=l(),r=await this.messageCollect(t,{exec:"printA",data:s});if(r&&Array.isArray(r)){r.some((t=>"success"===t.res.result))?null==e||e(r):(null==i||i(r),this._handleMonitorNotify(r))}else{const t="打印命令返回无效数据";this._handleMonitorNotify(r||""),null==i||i({type:"printError",message:t,result:!1,errinfo:t})}}catch(t){const e={error:t,message:"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({templateId:t,formatId:e,params:i="",paramsArr:s,authorizationKey:r,print:n,signature:o,printdlgshow:l,nobillnode:c,isDownloadFile:h=!0,messageTimeout:d=0},p,u,f,g="printDirect"){const w=a(e);if(e=this.getIReportFormatId(w,e),w&&m&&this._isHiprint){if(!this.isConnectHiPrint)return void u({message:"请连接hiPrint客户端"});const s=await this._queryPrintForBase64(t,e,i,r);if(!s.success)return u({message:s.resultMsg});const{base64:n,formatId:a}=s.map;return this.base64Fragment=n,this._successCallbackFn=p,this._errorCallbackFn=u,void this.hiPrintSocket.emit("news",{printerList:this.printerList,type:"askPrinterTemplate",markTemplateId:a,pdf_stream:this.base64Fragment})}await this._queryProxyOrigin();const y=await this._testConnection();if(!this._handleResultTest(y,u))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,paramsArr:s,cmdid:"7",print:n,signature:o,printdlgshow:l,nobillnode:c,messageTimeout:d}),a=this._handleResult(r,u,f);if(!a)return!1;h&&["downloadPDF"].includes(g)&&await this._browserPrint(a,g),null==p||p(a)}catch(t){const e="printDirect"===g?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==u||u(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):d.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}async downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=c(new Date,"yyyy-MM-dd"),i=l(),s=c(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}const r=a(t.formatId);if(t.formatId=this.getIReportFormatId(r,t.formatId),r&&m&&this._isHiprint){const e=await this._queryPrintForPdf(t.templateId||"",t.formatId,t.params||"",t.authorizationKey);return e?(n(e,"downloadPDF"),i({file:e})):null==s?void 0:s("获取文件失败!")}this.printDirect(t,(async t=>{t||s(null);const r=this,n=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(t.filedir);i(n,t)}),(t=>s(t)),(t=>{console.log(t)}),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},r,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,n);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,n);if(!l)return!1;r&&r(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},r,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,n);return!!o&&(r&&r(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,r){const n=await this._testConnection();if(!this._handleResultTest(n,r))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,r);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:r=0},n,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:r}),c=this._handleResult(l,a);if(!c)return!1;n&&n(c)}async addPrintFormat({templateId:t,params:e,token:i},s,r){const n=await this._testConnection();if(!this._handleResultTest(n,r))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,r);if(!o)return!1;s&&s(o)}}export{v as Print};
1
+ import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as r,useBrowserPrint as n,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as c}from"date-fns";import{io as h}from"socket.io-client";const m=String(navigator.platform).toLowerCase().includes("linux"),p=t.create({timeout:6e4,withCredentials:!1}),d=`${window.location.protocol}//${window.location.host}`,u=`${d}/fdp-api/print/assembly/printIReport`,f=`${d}/bi-api/reprot/print/open/client/printIReportForBase64`,g=`${d}/bi-api/reprot/print/open/client/previewIReport`,w=`${d}/bi-api/reprot/print/open/client/getRemote`,y=`${d}/printService/file`;let P=null;class v{constructor(){var t,e,r;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.queryServicesParams=null,this.isConnectHiPrint=!1,this.clientInfo=null,this.printerList=[],this.hiPrintSocket=null,this.base64Fragment="",this._successCallbackFn=null,this._errorCallbackFn=null,this._isHiprint=!1,this.messageHandlerQueue=[],this.getIReportFormatId=(t,e)=>t?e.split("_")[1]:e,P)return P;P=this,m&&this._isHiprint&&this._initDomesticSystem();const n=window;this.CMonitor=n.$CMonitor;try{this.webview=n.top?null==(t=n.top.chrome)?void 0:t.webview:null==(e=n.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(r=n.chrome)?void 0:r.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:r}=e;try{s(i.res||"")}catch(t){r(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}_initDomesticSystem(){try{this.hiPrintSocket=h("http://127.0.0.1:17521",{reconnectionAttempts:3,transports:["websocket"],auth:{token:"no-use-vue-plugin-hiprint"}}),this.hiPrintSocket&&(this.hiPrintSocket.on("connect",(()=>{this.isConnectHiPrint=!0})),this.hiPrintSocket.on("disconnect",(()=>{this.isConnectHiPrint=!1,this.hiPrintSocket=null})),this.hiPrintSocket.on("clientInfo",(t=>{console.log("获取到客户端信息>>>>>",t),t.clientUrl&&(this.clientInfo=t)})),this.hiPrintSocket.on("printerList",(t=>{this.printerList=t,console.log("获取到打印机列表信息>>>>>",t)})),this.hiPrintSocket.on("success",(t=>{console.log("打印成功>>>>>",t),this.base64Fragment="",this._successCallbackFn&&this._successCallbackFn(t)})),this.hiPrintSocket.on("replayPrinterTemplate",(t=>{console.log("获取到数据的回复>>>>>",t),t&&this.hiPrintSocket.emit("news",t)})),this.hiPrintSocket.on("error",(t=>{console.log("打印失败>>>>>",t),this.base64Fragment="",this._errorCallbackFn&&this._errorCallbackFn(t)})))}catch(t){console.log("hiprint系统连接失败",t)}}async getPicAndUpload(t){try{const e=t=>"[object Object]"===Object.prototype.toString.call(t);if("success"===(null==t?void 0:t.result)&&"Y"==(null==t?void 0:t.uploadTemplateFlag)&&!(null==t?void 0:t.filebase64)&&this.queryServicesParams){const t=e(this.queryServicesParams.params)?this.queryServicesParams.params:JSON.parse(this.queryServicesParams.params);t.uploadTemplateFlag="Y",this.queryServicesParams.params=JSON.stringify(t),this.queryServicesParams.cmdid="7",this.queryServicesParams.print={print:1,type:6,zip:0},this.queryServicesParams.paramsArr=[{params:JSON.stringify(t)}];await this._queryBase64ServicesPrint(this.queryServicesParams)}}catch(t){console.log(t)}finally{this.queryServicesParams=null}}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{p({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_queryBase64ServicesPrint(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):p({url:"/services/Printqueue",method:"get",params:{inputData:JSON.stringify(t)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):p({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e,i){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const s=t.message||t.Message;this._handleMonitorNotify(s);const r={type:"printError",message:s,result:t.result,errinfo:t.errinfo};return"cancel"==t.result?(i&&i({type:"printCancel",message:s,result:t.result,errinfo:t.errinfo}),!1):(null==e||e(r),!1)}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,r){const n={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(n);return this._handleQueryPrintDataResult(a,e,r)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,paramsArr:s,cmdid:r,print:n,signature:a,copies:o=1,printdlgshow:l="0",nobillnode:h="1",btnprint:m="1",messageTimeout:p=0}){const d={templateId:t,formatId:e,params:i,cmdid:r,nobillnode:h,printdlgshow:l,btnprint:m,copies:o,messageTimeout:p,...a?{signature:a}:{}};if(s&&(d.paramsArr=s),n){try{n=JSON.parse(n)}catch(t){}d.print=n}else if(this.isRemote){const t=c(new Date,"yyyyMMddHHmmss");d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return this.queryServicesParams=d,await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:r=0}){const n={};let a={};try{a=Object.assign({},n,JSON.parse(i))}catch(t){a=n}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:r};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await p({method:"get",url:w})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=d+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await p({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}paramsSerializer(t){return Object.keys(t).forEach((e=>{const i=t[e];t[e]=i,"biParams"==e&&(t[e]=encodeURIComponent(i))})),t}async _queryPrintForBase64(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await p({method:"post",url:f,params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _queryPrintForPdf(t,e,i="",s){const r="object"==typeof i?i:JSON.parse(i),{data:n}=await p({method:"post",url:g,responseType:"blob",params:{id:t,formatId:e,params:this.paramsSerializer(r),authorizationKey:s}})||{};return n}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await r(`${y}/${a}/${o}`),c=n(null,e,l);if("preview"===e)return c}}_base64ToBlob(t,e){const i=window.atob(t);let s=i.length;const r=new Uint8Array(s);for(;s--;)r[s]=i.charCodeAt(s);return new Blob([r],{type:e})}async preview({templateId:t,formatId:e,params:i="",paramsArr:s,authorizationKey:r,signature:l,btnprint:c,messageTimeout:h=0},p,d){const u=a(e);if(e=this.getIReportFormatId(u,e),u&&m&&this._isHiprint){const s=await this._queryPrintForPdf(t,e,i,r);if(!s)return null==d?void 0:d("获取文件失败!");const a=n(s,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,a),null==p?void 0:p({file:s})}await this._queryProxyOrigin();const f=await this._testConnection();if(!this._handleResultTest(f,d))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,paramsArr:s,cmdid:this.isRemote?"7":"8",signature:l,btnprint:c,messageTimeout:h}),n=this._handleResult(r,d);if(!n)return!1;if(this.isRemote){const t=await this._browserPrint(n,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}await this.getPicAndUpload(n),null==p||p(n)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==d||d(i),this._handleMonitorNotify(i)}}async printSync(t,e,i){const s=t.map((t=>{const e={params:"",printdlgshow:"0",nobillnode:"1",btnprint:"1",...t,cmdid:"7",...t.signature?{signature:t.signature}:{}};if(e.print)try{e.print=JSON.parse(e.print)}catch(t){}return{inputData:e}}));try{const t=l(),r=await this.messageCollect(t,{exec:"printA",data:s});if(r&&Array.isArray(r)){r.some((t=>"success"===t.res.result))?null==e||e(r):(null==i||i(r),this._handleMonitorNotify(r))}else{const t="打印命令返回无效数据";this._handleMonitorNotify(r||""),null==i||i({type:"printError",message:t,result:!1,errinfo:t})}}catch(t){const e={error:t,message:"打印失败"};null==i||i(e),this._handleMonitorNotify(e)}}async printDirect({templateId:t,formatId:e,params:i="",paramsArr:s,authorizationKey:r,print:n,signature:o,printdlgshow:l,nobillnode:c,copies:h=1,isDownloadFile:p=!0,messageTimeout:d=0},u,f,g,w="printDirect"){const y=a(e);if(e=this.getIReportFormatId(y,e),y&&m&&this._isHiprint){if(!this.isConnectHiPrint)return void f({message:"请连接hiPrint客户端"});const s=await this._queryPrintForBase64(t,e,i,r);if(!s.success)return f({message:s.resultMsg});const{base64:n,formatId:a}=s.map;return this.base64Fragment=n,this._successCallbackFn=u,this._errorCallbackFn=f,void this.hiPrintSocket.emit("news",{printerList:this.printerList,type:"askPrinterTemplate",markTemplateId:a,pdf_stream:this.base64Fragment})}await this._queryProxyOrigin();const P=await this._testConnection();if(!this._handleResultTest(P,f))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,paramsArr:s,cmdid:"7",print:n,signature:o,printdlgshow:l,nobillnode:c,copies:h,messageTimeout:d}),a=this._handleResult(r,f,g);if(!a)return!1;p&&["downloadPDF"].includes(w)&&await this._browserPrint(a,w),null==u||u(a)}catch(t){const e="printDirect"===w?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==f||f(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):p.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}async downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=c(new Date,"yyyy-MM-dd"),i=l(),s=c(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}const r=a(t.formatId);if(t.formatId=this.getIReportFormatId(r,t.formatId),r&&m&&this._isHiprint){const e=await this._queryPrintForPdf(t.templateId||"",t.formatId,t.params||"",t.authorizationKey);return e?(n(e,"downloadPDF"),i({file:e})):null==s?void 0:s("获取文件失败!")}this.printDirect(t,(async t=>{t||s(null);const r=this,n=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(t.filedir);i(n,t)}),(t=>s(t)),(t=>{console.log(t)}),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},r,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,n);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,n);if(!l)return!1;r&&r(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},r,n){const a=await this._testConnection();if(!this._handleResultTest(a,n))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,n);return!!o&&(r&&r(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,r){const n=await this._testConnection();if(!this._handleResultTest(n,r))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,r);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:r=0},n,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:r}),c=this._handleResult(l,a);if(!c)return!1;n&&n(c)}async addPrintFormat({templateId:t,params:e,token:i},s,r){const n=await this._testConnection();if(!this._handleResultTest(n,r))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,r);if(!o)return!1;s&&s(o)}}export{v as Print};
@@ -1449,9 +1449,6 @@ declare const _default: import("vue").DefineComponent<{
1449
1449
  isSecondDisabled(second: number, minute: number | null, hour: number | null): boolean | 0;
1450
1450
  };
1451
1451
  NSelect: any;
1452
- /**
1453
- * 改变展示方式
1454
- */
1455
1452
  NPopover: any;
1456
1453
  CDatePicker: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
1457
1454
  updateUnchangedValue: {
@@ -24,33 +24,14 @@ declare const DefaultPage: SFCWithInstall<import("vue").DefineComponent<{
24
24
  content: string;
25
25
  };
26
26
  };
27
- }>> & {
28
- onReload?: ((...args: any[]) => any) | undefined;
29
- }>>;
27
+ }>> & {}>>;
30
28
  configResult: import("vue").ComputedRef<{
31
29
  title: string;
32
30
  content: string;
33
31
  img: string;
34
32
  }>;
35
- emit: (event: "reload", ...args: any[]) => void;
36
- reloadPage: () => void;
37
33
  NEmpty: any;
38
- NButton: any;
39
- NIcon: any;
40
- Reload: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
41
- defaultPageTypeConfig: {
42
- TAB: string;
43
- MENU: string;
44
- VIEW: string;
45
- SYSTEM: string;
46
- LOCATION: string;
47
- NOTFOUND: string;
48
- LOADING: string;
49
- NOPERMISSION: string;
50
- NODATA: string;
51
- RELOAD: string;
52
- };
53
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reload"[], "reload", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
34
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
54
35
  type: {
55
36
  type: StringConstructor;
56
37
  default: string;
@@ -62,9 +43,7 @@ declare const DefaultPage: SFCWithInstall<import("vue").DefineComponent<{
62
43
  content: string;
63
44
  };
64
45
  };
65
- }>> & {
66
- onReload?: ((...args: any[]) => any) | undefined;
67
- }, {
46
+ }>>, {
68
47
  type: string;
69
48
  config: import("../../shared/types").AnyObject;
70
49
  }>>;
@@ -1,14 +1,16 @@
1
1
  export declare const defaultPageTypeConfig: {
2
- TAB: string;
3
- MENU: string;
4
- VIEW: string;
5
- SYSTEM: string;
6
2
  LOCATION: string;
7
3
  NOTFOUND: string;
8
4
  LOADING: string;
9
5
  NOPERMISSION: string;
10
6
  NODATA: string;
11
- RELOAD: string;
7
+ NONETWORK: string;
8
+ NODOCTOR: string;
9
+ SYSTEMERROR: string;
10
+ SYSTEMUPGRADE: string;
11
+ REVIEWSUCCESSFUL: string;
12
+ REVIEWFAIL: string;
13
+ NOSETTING: string;
12
14
  };
13
15
  export declare const descriptionConfig: {
14
16
  [x: string]: {
@@ -1 +1 @@
1
- import t from"../../../../shared/assets/img/defaultCover/1tab.jpg.js";import e from"../../../../shared/assets/img/defaultCover/2menu.jpg.js";import s from"../../../../shared/assets/img/defaultCover/3view.jpg.js";import o from"../../../../shared/assets/img/defaultCover/4system.jpg.js";import i from"../../../../shared/assets/img/defaultCover/5location.jpg.js";import m from"../../../../shared/assets/img/defaultCover/6notfound.jpg.js";import r from"../../../../shared/assets/img/defaultCover/7loading.jpg.js";import a from"../../../../shared/assets/img/defaultCover/8nopermission.jpg.js";import g from"../../../../shared/assets/img/defaultCover/9nodata.jpg.js";import n from"../../../../shared/assets/img/defaultCover/10reload.jpg.js";const d={TAB:"1",MENU:"2",VIEW:"3",SYSTEM:"4",LOCATION:"5",NOTFOUND:"6",LOADING:"7",NOPERMISSION:"8",NODATA:"9",RELOAD:"10"},l={[d.TAB]:{title:"无可选标签",content:"请联系管理员进行标签管理",img:t},[d.MENU]:{title:"你还没有进行菜单设置哟",content:"设置后可自定义调整菜单的顺序/结构,不设置使用系统默认菜单",img:e},[d.VIEW]:{title:"视图未配置",content:"请联系开发人员",img:s},[d.SYSTEM]:{title:"系统错误",content:"请联系管理员",img:o},[d.LOCATION]:{title:"位置访问失败 ",content:"",img:i},[d.NOTFOUND]:{title:"找不到页面",content:"",img:m},[d.LOADING]:{title:"正在拼命加载中...",content:"请稍后",img:r},[d.NOPERMISSION]:{title:"你没有访问权限",content:"请联系管理员",img:a},[d.NODATA]:{title:"暂无数据",content:"",img:g},[d.RELOAD]:{title:"更新提示",content:"系统有新的内容更新,请点击下面的按钮重载页面,以确保系统功能正常",img:n}};export{d as defaultPageTypeConfig,l as descriptionConfig};
1
+ import t from"../../../../shared/assets/img/defaultCover/1location.png.js";import e from"../../../../shared/assets/img/defaultCover/2notfound.png.js";import s from"../../../../shared/assets/img/defaultCover/3loading.png.js";import o from"../../../../shared/assets/img/defaultCover/4no_permission.png.js";import r from"../../../../shared/assets/img/defaultCover/5no_data.png.js";import i from"../../../../shared/assets/img/defaultCover/6no_network.png.js";import m from"../../../../shared/assets/img/defaultCover/7no_doctor.png.js";import n from"../../../../shared/assets/img/defaultCover/8system_error.png.js";import a from"../../../../shared/assets/img/defaultCover/9system_upgrade.png.js";import g from"../../../../shared/assets/img/defaultCover/10review_successful.png.js";import O from"../../../../shared/assets/img/defaultCover/11review_fail.png.js";import d from"../../../../shared/assets/img/defaultCover/12no_setting.png.js";const l={LOCATION:"1",NOTFOUND:"2",LOADING:"3",NOPERMISSION:"4",NODATA:"5",NONETWORK:"6",NODOCTOR:"7",SYSTEMERROR:"8",SYSTEMUPGRADE:"9",REVIEWSUCCESSFUL:"10",REVIEWFAIL:"11",NOSETTING:"12"},f={[l.LOCATION]:{title:"位置访问失败 ",content:"",img:t},[l.NOTFOUND]:{title:"找不到页面",content:"",img:e},[l.LOADING]:{title:"正在拼命加载中...",content:"请稍后",img:s},[l.NOPERMISSION]:{title:"你没有访问权限",content:"",img:o},[l.NODATA]:{title:"暂无数据",content:"",img:r},[l.NONETWORK]:{title:"请检查网络连接情况",content:"",img:i},[l.NODOCTOR]:{title:"暂无医生排班",content:"",img:m},[l.SYSTEMERROR]:{title:"系统错误",content:"请稍后再试",img:n},[l.SYSTEMUPGRADE]:{title:"系统正在升级中...",content:"",img:a},[l.REVIEWSUCCESSFUL]:{title:"审核成功",content:"",img:g},[l.REVIEWFAIL]:{title:"审核失败",content:"",img:O},[l.NOSETTING]:{title:"视图未配置",content:"",img:d}};export{l as defaultPageTypeConfig,f as descriptionConfig};
@@ -25,33 +25,14 @@ declare const _default: import("vue").DefineComponent<{
25
25
  content: string;
26
26
  };
27
27
  };
28
- }>> & {
29
- onReload?: ((...args: any[]) => any) | undefined;
30
- }>>;
28
+ }>> & {}>>;
31
29
  configResult: import("vue").ComputedRef<{
32
30
  title: string;
33
31
  content: string;
34
32
  img: string;
35
33
  }>;
36
- emit: (event: "reload", ...args: any[]) => void;
37
- reloadPage: () => void;
38
34
  NEmpty: any;
39
- NButton: any;
40
- NIcon: any;
41
- Reload: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
42
- defaultPageTypeConfig: {
43
- TAB: string;
44
- MENU: string;
45
- VIEW: string;
46
- SYSTEM: string;
47
- LOCATION: string;
48
- NOTFOUND: string;
49
- LOADING: string;
50
- NOPERMISSION: string;
51
- NODATA: string;
52
- RELOAD: string;
53
- };
54
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reload"[], "reload", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
35
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
55
36
  type: {
56
37
  type: StringConstructor;
57
38
  default: string;
@@ -63,9 +44,7 @@ declare const _default: import("vue").DefineComponent<{
63
44
  content: string;
64
45
  };
65
46
  };
66
- }>> & {
67
- onReload?: ((...args: any[]) => any) | undefined;
68
- }, {
47
+ }>>, {
69
48
  type: string;
70
49
  config: AnyObject;
71
50
  }>;
@@ -1 +1 @@
1
- import{defineComponent as t,computed as e,openBlock as n,createBlock as o,unref as i,withCtx as c,createElementVNode as s,toDisplayString as r,createVNode as a,createTextVNode as l,createCommentVNode as p}from"vue";import{NEmpty as f,NButton as m,NIcon as u}from"naive-ui";import{Reload as d}from"@vicons/ionicons5";import{descriptionConfig as g,defaultPageTypeConfig as y}from"./constants/index.js";const v=["src","alt"],k={class:"page-description"},b={class:"title"},j={class:"content"};var x=t({__name:"index",props:{type:{type:String,default:"1"},config:{type:Object,default:()=>({title:"",content:""})}},emits:["reload"],setup(t,{emit:x}){const O=t,_=e((()=>{let t=g[O.type];return O.config&&Object.keys(O.config).length>0&&Object.keys(O.config).forEach((e=>{const n=O.config[e];n&&(t[e]=n)})),t}));function h(){x("reload")}return(e,g)=>(n(),o(i(f),{class:"default-page-getter-block"},{icon:c((()=>[s("img",{src:i(_).img,alt:i(_).title},null,8,v)])),default:c((()=>[s("div",k,[s("span",b,r(i(_).title),1),s("span",j,r(i(_).content),1)])])),extra:c((()=>[t.type==i(y).RELOAD?(n(),o(i(m),{key:0,type:"primary",round:"",onClick:h},{icon:c((()=>[a(i(u),{component:i(d),size:"16"},null,8,["component"])])),default:c((()=>[l(" 点击重载页面 ")])),_:1})):p("v-if",!0)])),_:1}))}});export{x as default};
1
+ import{defineComponent as t,computed as e,openBlock as n,createBlock as c,unref as o,withCtx as s,createElementVNode as i,toDisplayString as a}from"vue";import{NEmpty as l}from"naive-ui";import{descriptionConfig as r}from"./constants/index.js";const p=["src","alt"],f={class:"page-description"},g={class:"title"},u={class:"content"};var d=t({__name:"index",props:{type:{type:String,default:"1"},config:{type:Object,default:()=>({title:"",content:""})}},setup(t){const d=t,m=e((()=>{let t=r[d.type];return d.config&&Object.keys(d.config).length>0&&Object.keys(d.config).forEach((e=>{const n=d.config[e];n&&(t[e]=n)})),t}));return(t,e)=>(n(),c(o(l),{class:"default-page-getter-block"},{icon:s((()=>[i("img",{src:o(m).img,alt:o(m).title},null,8,p)])),default:s((()=>[i("div",f,[i("span",g,a(o(m).title),1),i("span",u,a(o(m).content),1)])])),_:1}))}});export{d as default};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w}from"lodash-es";import"../temperature/useShadow.js";import{format as x}from"date-fns";import"naive-ui";import"@vueuse/core";function b(b,j,P,C,E){const{computedX:S,computedY:G,getXValue:T,getYValue:L}=c(j),{getEqualXTypes:Y,handleAddPrevent:M,isGridLimit:A,setPrevAndNextPoint:X,getPointEventProps:I}=h(b,P,j),{xAxis:H,grid:W,originX:N,originY:O,xCellWidth:V,endY:D,startTime:R,leftAddAreaWidth:$,leftScales:B,rightScales:F,yCellHeight:q,endX:z,scaleValues:J,canvasWidth:K,borderStyle:Q,rightAddAreaWidth:U,event:Z,originYCervix:_,other:tt,canvasHeight:et}=j,ot=k(J),nt=new Set;function it(){ot.filter((t=>t.show)).forEach(((t,s)=>{var l;const a=[],u=[],c=[];null==(l=t.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=t,x=t.data[f+1],j=ut(x,t);if(l&&j&&!d.breakpoint)h=e([...l,...j],{...m});else if(l&&!j&&!d.breakpoint){const o=ut(x,t);h=o?e([...l,...o],{...m}):null}let E,S;if(d.childbirth){const t=l[1]+q;E=o([l[0],l[1],t],w),c.push(E),S=n([l[0]+V/2,t-q/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(S)}const G=u[f-1],Y={origin:{data:d,title:v,key:y||"",dataIndex:s,index:f},leftLine:G,rightLine:h,arrowGroup:E,arrowGroupText:S,...g,...I()};l&&(G||(Y.leftLine=null),p=r(k,{left:l[0],top:l[1],...Y}));u.push(h),p&&(!function(t){Z.hovered&&(t.on("mouseover",(()=>{at(t,"hover")})),t.on("mouseout",(()=>{C.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{lt(t),function(t){var e,o,n,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top}),null==(n=t.arrowGroup)||n.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+V/2,top:t.top+q/2})}(t),Z.hovered&&at(t)})),t.on("mouseup",(e=>{if(C.show=!1,1===e.button){const{key:e}=t.origin,o={...t.origin,data:{...t.origin.data,time:T(t.left),value:L(e,t.top)}};b.value.discardActiveObject(),P("change",o),rt(o,"change")}}))}(p),a.push(p),nt.add(p))}(ut(l,t),l,d)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));X(t),Promise.all(c).then((o=>{b.value.add(...e,...t,...o),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function rt(t,e="add"){const{dataIndex:o,data:n,index:i,key:r}=t,s=ot.find((t=>t.key===r));switch(e){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const t=g(n.time,s.data);s.data.splice(t,0,n);break}}st()}function st(){var t;nt.size&&(null==(t=b.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...nt]))),nt.clear(),it()}function lt(t){const e=t.prevPoint?t.prevPoint.left:N,o=t.nextPoint?t.nextPoint.left:z;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<_&&t.set("top",_),t.top<O&&t.set("top",O),t.top>D&&t.set("top",D),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}function at(t,e="moving"){const{title:o,key:n,data:i}=t.origin;C.point={x:t.left,y:t.top},C.list=[`${o} ${"hover"===e?i.value:L(n,t.top)}`,`时间 ${T(t.left).slice(-5)}`],C.show=!0}function ut(t,e){if(m(t)&&function(t){const e=R+864e5,o=v(t);return o>=R&&o<=e}(t.time)){const o=S(t.time),n=G(e.key,e.range,t.value);return[o,n<O?O:n>D?D:n]}}function ct(t,e){return t+1>e[1]?e[0]:t+1}return u(b,j),function(){const e=new t.Rect({...Q,width:K-$-U-1,height:D-1,left:$,top:0,fill:"transparent"});b.value.add(e)}(),function(){function e(e,o="left"){let r="left"===o?$:z;e.forEach(((e,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=e,j=[],P=[],C=r+c/2,E=y(s,u),S=E.length,{lineXMain:G,lineXSub:T,textLeft:L}=d(v,r,c);E.forEach(((t,o)=>{const n=D-o*q*k,i=0===o?D-8:o!==E.length-1||O||_&&"FHR"!==m?n:O+8;!w||(0===o||o===S-1)&&!x||j.push(f(String(t),e,L,i)),P.push(...p(e,o,G,T,n,q,O,S))}));const Y=new t.Rect({...a,strokeWidth:.5,width:c,height:D,left:C,top:D/2}),M=n([C,O>0?O-q/2:q/2],{value:String(h),...i,...g}),A=new t.Group([...P,...j,Y,...M?[M]:[]],{objectCaching:!1,...l});b.value.add(A),A.sendToBack(),r+=c}))}e(B),e(F,"right")}(),function(){const{show:e,startTime:o,range:r=[0,23],position:s="top",style:a}=H.time,{show:u,range:c=[0,23],position:d,style:f}=H.processTime;if(e||u){const p=[],h=[],g=[],m=[],v=N+V/2,y=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const e=0===t?+o.slice(11,13):ct(w(p),r);p.push(e);const l="top"===s?O-y:D+y;g.push(n([v+t*V,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:w(h)+1;h.push(e);const o="top"===d?y:et-y;m.push(n([v+t*V,o],{value:String(e),...i,...f||{}}))}}const k=new t.Group([...g,...m],{objectCaching:!1,...l});b.value.add(k),b.value.sendToBack(k)}}(),function(){var t;const o=Object.values(tt),n=[],i={},r=ot.find((t=>"cervix"===t.key&&t.show)),s=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function l(t,e){const{key:o,range:n}=r||{},i=G(o,n,10),s=[0,e],l=[-e/t,0],a=[(D-i-e)/t,D-i],u=[z-N,t*(z-N)+e];let c=[],d=[];function f([o,n]){return Math.abs(n-t*o-e)<=1}function p([t,e]){const[o,n]=[...h([t,e])];return o>=N&&o<=z&&n>=i&&n<=D}function h([t,e]){return[N+t,D-e]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((t=>{if(!t.show)return;const{key:o}=t;switch(o){case"fetalPresentation":{const{range:i,show:r}=ot.find((t=>t.key===o));if(r){const r=G(o,i,0);n.push(e([N,r,z,r],{...t}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:x(new Date(v(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-N,D-G(o,a,s.value)],[p,h]=[S(c.time)-N,D-G(o,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=l(g,m);y.length>0&&(n.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(x(new Date(v(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(e(u,{...t}))}}})),b.value.add(...n)}(),it(),function(){function t(t,e){const o=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:o,key:t.key},pointer:e}}j.event.evented&&b.value.on("mouse:up",(e=>{if(3===e.button){const{x:o=0,y:n=0}=e.pointer||{};o>=N&&o<=z&&n>=O&&n<=D&&(E.point={x:o,y:n},E.show=!0,e.target?(E.target=e.target,E.list=["删除节点"],[...nt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&E.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(E.target=null,E.list=["新增节点"],ot.filter((t=>t.show)).forEach((i=>{if(!Y([...nt],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<_)return;E.list.push(t(i,e.pointer))}})),1===E.list.length&&(E.show=!1,M("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=K-U/2;function e(t,e){if(!t.length)return;let n=O;const i=[];t.forEach((t=>{const o=t.title.split("").join("\n"),r=J.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(o,t,{text:{originY:"top",left:e,top:n},icon:{left:e,topY:n,originY:"top",origin:{type:t.type,dataIndex:r},...j.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),A(u)?(lt(u),at(u)):C.show=!1})),u.on("mouseup:before",(t=>{if(C.show=!1,0===t.e.button&&A(u))if(Y([...nt],u.left,"key").includes(u.origin.key))M("repeat");else{const t={data:{time:T(u.left),value:L(u.origin.key,u.top)},...u.origin};P("add",t),rt(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(u)})),i.push(l,a)})),o(i),b.value.add(...i)}function o(t){const e=w(t),o=(D-O)/2,n=(e.height+e.top-O)/2;t.forEach((t=>{const e=t.top+o-n;t.set({top:e,originTop:e})}))}e(B,$/2),e(F,t)}(),{clickMenu:function({item:t,target:e}){const o={...t.origin};"remove"===t.mode?(P("remove",o),rt(o,"remove")):(Object.assign(o,{data:{time:T(t.pointer.x),value:L(t.origin.key,t.pointer.y)}}),P("add",o),rt(o))},redrawPoints:st}}export{b as useBirthProcess};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as x}from"date-fns";import"naive-ui";import"@vueuse/core";function b(b,j,P,C,E){const{computedX:S,computedY:G,getXValue:T,getYValue:L}=c(j),{getEqualXTypes:Y,handleAddPrevent:M,isGridLimit:A,setPrevAndNextPoint:X,getPointEventProps:I}=h(b,P,j),{xAxis:H,grid:W,originX:N,originY:O,xCellWidth:V,endY:D,startTime:R,leftAddAreaWidth:$,leftScales:B,rightScales:F,yCellHeight:q,endX:z,scaleValues:J,canvasWidth:K,borderStyle:Q,rightAddAreaWidth:U,event:Z,originYCervix:_,other:tt,canvasHeight:et}=j,ot=k(J),nt=new Set;function it(){ot.filter((t=>t.show)).forEach(((t,s)=>{var l;const a=[],u=[],c=[];null==(l=t.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=t,x=t.data[f+1],j=ut(x,t);if(l&&j&&!d.breakpoint)h=e([...l,...j],{...m});else if(l&&!j&&!d.breakpoint){const o=ut(x,t);h=o?e([...l,...o],{...m}):null}let E,S;if(d.childbirth){const t=l[1]+q;E=o([l[0],l[1],t],w),c.push(E),S=n([l[0]+V/2,t-q/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(S)}const G=u[f-1],Y={origin:{data:d,title:v,key:y||"",dataIndex:s,index:f},leftLine:G,rightLine:h,arrowGroup:E,arrowGroupText:S,...g,...I()};l&&(G||(Y.leftLine=null),p=r(k,{left:l[0],top:l[1],...Y}));u.push(h),p&&(!function(t){Z.hovered&&(t.on("mouseover",(()=>{at(t,"hover")})),t.on("mouseout",(()=>{C.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{lt(t),function(t){var e,o,n,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top}),null==(n=t.arrowGroup)||n.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+V/2,top:t.top+q/2})}(t),Z.hovered&&at(t)})),t.on("mouseup",(e=>{if(C.show=!1,1===e.button){const{key:e}=t.origin,o={...t.origin,data:{...t.origin.data,time:T(t.left),value:L(e,t.top)}};b.value.discardActiveObject(),P("change",o),rt(o,"change")}}))}(p),a.push(p),nt.add(p))}(ut(l,t),l,d)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));X(t),Promise.all(c).then((o=>{b.value.add(...e,...t,...o),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function rt(t,e="add"){const{dataIndex:o,data:n,index:i,key:r}=t,s=ot.find((t=>t.key===r));switch(e){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const t=g(n.time,s.data);s.data.splice(t,0,n);break}}st()}function st(){var t;nt.size&&(null==(t=b.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...nt]))),nt.clear(),it()}function lt(t){const e=t.prevPoint?t.prevPoint.left:N,o=t.nextPoint?t.nextPoint.left:z;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<_&&t.set("top",_),t.top<O&&t.set("top",O),t.top>D&&t.set("top",D),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}function at(t,e="moving"){const{title:o,key:n,data:i}=t.origin;C.point={x:t.left,y:t.top},C.list=[`${o} ${"hover"===e?i.value:L(n,t.top)}`,`时间 ${T(t.left).slice(-5)}`],C.show=!0}function ut(t,e){if(m(t)&&function(t){const e=R+864e5,o=v(t);return o>=R&&o<=e}(t.time)){const o=S(t.time),n=G(e.key,e.range,t.value);return[o,n<O?O:n>D?D:n]}}function ct(t,e){return t+1>e[1]?e[0]:t+1}return u(b,j),function(){const e=new t.Rect({...Q,width:K-$-U-1,height:D-1,left:$,top:0,fill:"transparent"});b.value.add(e)}(),function(){function e(e,o="left"){let r="left"===o?$:z;e.forEach(((e,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=e,j=[],P=[],C=r+c/2,E=y(s,u),S=E.length,{lineXMain:G,lineXSub:T,textLeft:L}=d(v,r,c);E.forEach(((t,o)=>{const n=D-o*q*k,i=0===o?D-8:o!==E.length-1||O||_&&"FHR"!==m?n:O+8;!w||(0===o||o===S-1)&&!x||j.push(f(String(t),e,L,i)),P.push(...p(e,o,G,T,n,q,O,S))}));const Y=new t.Rect({...a,strokeWidth:.5,width:c,height:D,left:C,top:D/2}),M=n([C,O>0?O-q/2:q/2],{value:String(h),...i,...g}),A=new t.Group([...P,...j,Y,...M?[M]:[]],{objectCaching:!1,...l});b.value.add(A),A.sendToBack(),r+=c}))}e(B),e(F,"right")}(),function(){const{show:e,startTime:o,range:r=[0,23],position:s="top",style:a}=H.time,{show:u,range:c=[0,23],position:d,style:f}=H.processTime;if(e||u){const p=[],h=[],g=[],m=[],v=N+V/2,y=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const e=0===t?+o.slice(11,13):ct(w(p),r);p.push(e);const l="top"===s?O-y:D+y;g.push(n([v+t*V,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:w(h)+1;h.push(e);const o="top"===d?y:et-y;m.push(n([v+t*V,o],{value:String(e),...i,...f||{}}))}}const k=new t.Group([...g,...m],{objectCaching:!1,...l});b.value.add(k),b.value.sendToBack(k)}}(),function(){var t;const o=Object.values(tt),n=[],i={},r=ot.find((t=>"cervix"===t.key&&t.show)),s=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function l(t,e){const{key:o,range:n}=r||{},i=G(o,n,10),s=[0,e],l=[-e/t,0],a=[(D-i-e)/t,D-i],u=[z-N,t*(z-N)+e];let c=[],d=[];function f([o,n]){return Math.abs(n-t*o-e)<=1}function p([t,e]){const[o,n]=[...h([t,e])];return o>=N&&o<=z&&n>=i&&n<=D}function h([t,e]){return[N+t,D-e]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((t=>{if(!t.show)return;const{key:o}=t;switch(o){case"fetalPresentation":{const{range:i,show:r}=ot.find((t=>t.key===o));if(r){const r=G(o,i,0);n.push(e([N,r,z,r],{...t}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:x(new Date(v(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-N,D-G(o,a,s.value)],[p,h]=[S(c.time)-N,D-G(o,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=l(g,m);y.length>0&&(n.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(x(new Date(v(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(e(u,{...t}))}}})),b.value.add(...n)}(),it(),function(){function t(t,e){const o=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:o,key:t.key},pointer:e}}j.event.evented&&b.value.on("mouse:up",(e=>{if(3===e.button){const{x:o=0,y:n=0}=e.pointer||{};o>=N&&o<=z&&n>=O&&n<=D&&(E.point={x:o,y:n},E.show=!0,e.target?(E.target=e.target,E.list=["删除节点"],[...nt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&E.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(E.target=null,E.list=["新增节点"],ot.filter((t=>t.show)).forEach((i=>{if(!Y([...nt],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<_)return;E.list.push(t(i,e.pointer))}})),1===E.list.length&&(E.show=!1,M("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=K-U/2;function e(t,e){if(!t.length)return;let n=O;const i=[];t.forEach((t=>{const o=t.title.split("").join("\n"),r=J.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(o,t,{text:{originY:"top",left:e,top:n},icon:{left:e,topY:n,originY:"top",origin:{type:t.type,dataIndex:r},...j.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),A(u)?(lt(u),at(u)):C.show=!1})),u.on("mouseup:before",(t=>{if(C.show=!1,0===t.e.button&&A(u))if(Y([...nt],u.left,"key").includes(u.origin.key))M("repeat");else{const t={data:{time:T(u.left),value:L(u.origin.key,u.top)},...u.origin};P("add",t),rt(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(u)})),i.push(l,a)})),o(i),b.value.add(...i)}function o(t){const e=w(t),o=(D-O)/2,n=(e.height+e.top-O)/2;t.forEach((t=>{const e=t.top+o-n;t.set({top:e,originTop:e})}))}e(B,$/2),e(F,t)}(),{clickMenu:function({item:t,target:e}){const o={...t.origin};"remove"===t.mode?(P("remove",o),rt(o,"remove")):(Object.assign(o,{data:{time:T(t.pointer.x),value:L(t.origin.key,t.pointer.y)}}),P("add",o),rt(o))},redrawPoints:st}}export{b as useBirthProcess};
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as r}from"../../utils/index.js";import"lodash-es";import{useCanvasEvent as i}from"../useEvent.js";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{useBirthProcess as s}from"./useBirthProcess.js";function d(d,n,o,v,c,h){const m=e(),f=e(),p=e(),g=a((()=>n.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),x=a((()=>n.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=a((()=>{var e;return(null==(e=x.value)?void 0:e.length)?30:0})),y=a((()=>{var e;return 30+(null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),V=a((()=>{var e;const{width:a}=n.data,t=null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-w.value-t})),b=a((()=>n.data.grid.mainXCell)),j=a((()=>{const e=n.data.grid.mainYCell||14;return n.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),A=a((()=>(V.value-y.value)/b.value)),C=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),k=a((()=>{const{xAxis:e}=n.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return C.value*a})),Y=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!k.value)return k.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return S.value-l*u*C.value})),S=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-C.value*t})),H=a((()=>r(n.data.xAxis.time.startTime))),P=a((()=>36e5/A.value)),X=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),F=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return C.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=t({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...u,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:y.value,endX:V.value,originY:k.value,endY:S.value,xCellWidth:A.value,yCellHeight:C.value,gridXNumber:b.value,gridYNumber:j.value,xAxis:n.data.xAxis,leftScales:g.value,rightScales:x.value,leftAddAreaWidth:30,rightAddAreaWidth:w.value,startTime:H.value,timeXCell:P.value,cervixYCell:X.value,FHRYCell:F.value,fetalPresentationYCell:R.value,scaleValues:n.data.scaleValues,event:W.value,originYCervix:Y.value});return l((()=>d.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=s(d,O,o,c,h);f.value=a,p.value=e;const{select:t}=i(d,O,o);m.value=t}()}),{immediate:!0}),{propItems:O,redrawPoints:f,select:m,clickMenu:p}}export{d as useBirthProcessChart};
1
+ import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as r}from"../../utils/index.js";import"lodash-es";import{useCanvasEvent as i}from"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as s}from"./useBirthProcess.js";function d(d,n,o,v,c,h){const m=e(),f=e(),p=e(),g=a((()=>n.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),x=a((()=>n.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=a((()=>{var e;return(null==(e=x.value)?void 0:e.length)?30:0})),y=a((()=>{var e;return 30+(null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),V=a((()=>{var e;const{width:a}=n.data,t=null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-w.value-t})),b=a((()=>n.data.grid.mainXCell)),j=a((()=>{const e=n.data.grid.mainYCell||14;return n.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),A=a((()=>(V.value-y.value)/b.value)),C=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),k=a((()=>{const{xAxis:e}=n.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return C.value*a})),Y=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!k.value)return k.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return S.value-l*u*C.value})),S=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-C.value*t})),H=a((()=>r(n.data.xAxis.time.startTime))),P=a((()=>36e5/A.value)),X=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),F=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return C.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=t({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...u,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:y.value,endX:V.value,originY:k.value,endY:S.value,xCellWidth:A.value,yCellHeight:C.value,gridXNumber:b.value,gridYNumber:j.value,xAxis:n.data.xAxis,leftScales:g.value,rightScales:x.value,leftAddAreaWidth:30,rightAddAreaWidth:w.value,startTime:H.value,timeXCell:P.value,cervixYCell:X.value,FHRYCell:F.value,fetalPresentationYCell:R.value,scaleValues:n.data.scaleValues,event:W.value,originYCervix:Y.value});return l((()=>d.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=s(d,O,o,c,h);f.value=a,p.value=e;const{select:t}=i(d,O,o);m.value=t}()}),{immediate:!0}),{propItems:O,redrawPoints:f,select:m,clickMenu:p}}export{d as useBirthProcessChart};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../../shared/utils/fabricjs/index.js";import{range as t}from"lodash-es";import{defaultStyle as n}from"../../useDraw.js";import{useElectrocardiogramCumputedPoint as o}from"../../useCumputedPoint.js";import"../../useEvent.js";import"vue";import"date-fns";import"../../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function r(r,i){const{scale:l,beforeEvent:a,endY:s,endX:u,showScaleText:c,showNumberText:y,detailRadius:f,points:p,lineStartIndex:h,xCellWidth:d,yCellHeight:m,grid:x={subLineStyle:{},mainLineStyle:{x:{},y:{}}}}=i;let w=null;const{computedX:g,computedY:v,getYValue:b}=o(i);function S(e){return g(e)*l}function L(e){return v(e)*l}function k(e){return b(e/l)}const M=m*l;function j(){var e;w&&(null==(e=r.canvas)||e.remove(w)),w=null}r.on("mousedown",(async o=>{var i,d;if(await(null==a?void 0:a()),1!==o.button||!o.target||!o.pointer)return;const m=o.target;if(!m.points)return;const{x:g,y:v}=o.pointer,b=Math.floor((g-m.left)/m.width*m.points.length)+h;let G=b-f,T=b+f;G<=0?(G=0,T=Math.min(2*f,p.length-1)):T>=p.length-1&&(T=p.length-1,G=Math.max(p.length-2*f,0));const C=p.slice(G,T).map(((e,t)=>({x:G+S(t),y:L(e)}))),W=b-G;let Y=0,$=0;C.forEach(((e,t)=>{e.y>C[Y].y&&(Y=t),e.y<C[$].y&&($=t)}));const E=S(2*f-1),X=C[Y].y-C[$].y-1,z=X+30+70,A={x:u-g<=E?g-E:g,y:s-v<=z?v-z:v};j(),w=new e.Group;const D=[new e.Rect({...n,left:A.x,top:A.y,width:E,height:z,stroke:"transparent",fill:"#fff",shadow:new e.Shadow({color:"rgba(0, 0, 0, 0.3)",blur:15,offsetX:8,offsetY:8})}),function(n,o){const r=e=>e%5?x.subLineStyle:null,i=M/5,l=30+n[Y].y/Math.abs(n[Y].y-n[$].y)*X,a=Math.ceil(l/i),s=Math.ceil((z-l)/i);function u(t,n){return new e.Line([A.x,A.y+t,A.x+E,A.y+t],{...x.mainLineStyle.x,...r(n)})}const c=new e.Group([...t(s).map((e=>u(e*i+l,e))),...t(a).map((e=>u(-e*i+l,e)))]),y=o/n.length*E,f=Math.ceil(y/i),p=Math.ceil((E-y)/i);function h(t,n){return new e.Line([A.x+t,A.y,A.x+t,A.y+z],{...x.mainLineStyle.y,...0===n?x.subLineStyle:r(n)})}const d=new e.Group([...t(p).map((e=>h(e*i+y,e))),...t(f).map((e=>h(-e*i+y,e)))]);return new e.Group([d,c])}(C,W),(H=C.map((({x:e,y:t})=>({x:e,y:-t}))),new e.Polyline(H,{...n,fill:"transparent",stroke:"red",strokeWidth:1,left:A.x,top:A.y+30})),function(t,o){const r={strokeDashArray:[3,4],width:3,top:A.y},i=new e.Line(s(t[Y]),{...n,...r,left:A.x+Y/t.length*E,stroke:"red"}),l=new e.Line(s(t[$]),{...n,...r,stroke:"blue",left:A.x+$/t.length*E}),a=new e.Line(s(t[o]),{...n,...r,stroke:"green",left:A.x+o/t.length*E});return new e.Group([i,l,a]);function s(e){return[e.x,e.y,e.x,e.y-z]}}(C,W),(P=C,R=W,new e.Circle({...n,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:A.x+R/P.length*E-5,top:A.y+30+(P[Y].y-P[R].y)/Math.abs(P[Y].y-P[$].y)*X-5}))];var P,R,H;c&&D.push(new e.Text(`x${l}`,{...n,fill:"black",fontSize:20,left:A.x+10,top:A.y+z-30})),y&&D.push(function(t,o){const r={fontSize:16,left:A.x+E/2+10},i=new e.Text(`最大: ${k(t[Y].y)} mv`,{...n,...r,fill:"red",top:A.y+z-20}),l=new e.Text(`最小: ${k(t[$].y)} mv`,{...n,...r,fill:"blue",top:A.y+z-40}),a=new e.Text(`当前: ${k(t[o].y)} mv`,{...n,...r,fill:"green",top:A.y+z-60});return new e.Group([i,l,a])}(C,W)),w.add(...D).addWithUpdate(),null==(i=r.canvas)||i.add(w),null==(d=r.canvas)||d.discardActiveObject()})),r.on("mouseup",(async e=>{await(null==a?void 0:a()),1===e.button&&j()}))}export{r as useDetailEvent};
1
+ import{fabric as e}from"../../../../../../shared/utils/fabricjs/index.js";import{range as t}from"lodash-es";import{defaultStyle as n}from"../../useDraw.js";import{useElectrocardiogramCumputedPoint as o}from"../../useCumputedPoint.js";import"../../useEvent.js";import"vue";import"date-fns";import"../../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function r(r,i){const{scale:l,beforeEvent:a,endY:s,endX:u,showScaleText:c,showNumberText:p,detailRadius:y,points:f,lineStartIndex:h,xCellWidth:d,yCellHeight:m,grid:x={subLineStyle:{},mainLineStyle:{x:{},y:{}}}}=i;let w=null;const{computedX:g,computedY:v,getYValue:b}=o(i);function S(e){return g(e)*l}function L(e){return v(e)*l}function k(e){return b(e/l)}const M=m*l;function j(){var e;w&&(null==(e=r.canvas)||e.remove(w)),w=null}r.on("mousedown",(async o=>{var i,d;if(await(null==a?void 0:a()),1!==o.button||!o.target||!o.pointer)return;const m=o.target;if(!m.points)return;const{x:g,y:v}=o.pointer,b=Math.floor((g-m.left)/m.width*m.points.length)+h;let G=b-y,T=b+y;G<=0?(G=0,T=Math.min(2*y,f.length-1)):T>=f.length-1&&(T=f.length-1,G=Math.max(f.length-2*y,0));const C=f.slice(G,T).map(((e,t)=>({x:G+S(t),y:L(e)}))),W=b-G;let Y=0,$=0;C.forEach(((e,t)=>{e.y>C[Y].y&&(Y=t),e.y<C[$].y&&($=t)}));const E=S(2*y-1),X=C[Y].y-C[$].y-1,z=X+30+70,A={x:u-g<=E?g-E:g,y:s-v<=z?v-z:v};j(),w=new e.Group;const D=[new e.Rect({...n,left:A.x,top:A.y,width:E,height:z,stroke:"transparent",fill:"#fff",shadow:new e.Shadow({color:"rgba(0, 0, 0, 0.3)",blur:15,offsetX:8,offsetY:8})}),function(n,o){const r=e=>e%5?x.subLineStyle:null,i=M/5,l=30+n[Y].y/Math.abs(n[Y].y-n[$].y)*X,a=Math.ceil(l/i),s=Math.ceil((z-l)/i);function u(t,n){return new e.Line([A.x,A.y+t,A.x+E,A.y+t],{...x.mainLineStyle.x,...r(n)})}const c=new e.Group([...t(s).map((e=>u(e*i+l,e))),...t(a).map((e=>u(-e*i+l,e)))]),p=o/n.length*E,y=Math.ceil(p/i),f=Math.ceil((E-p)/i);function h(t,n){return new e.Line([A.x+t,A.y,A.x+t,A.y+z],{...x.mainLineStyle.y,...0===n?x.subLineStyle:r(n)})}const d=new e.Group([...t(f).map((e=>h(e*i+p,e))),...t(y).map((e=>h(-e*i+p,e)))]);return new e.Group([d,c])}(C,W),(H=C.map((({x:e,y:t})=>({x:e,y:-t}))),new e.Polyline(H,{...n,fill:"transparent",stroke:"red",strokeWidth:1,left:A.x,top:A.y+30})),function(t,o){const r={strokeDashArray:[3,4],width:3,top:A.y},i=new e.Line(s(t[Y]),{...n,...r,left:A.x+Y/t.length*E,stroke:"red"}),l=new e.Line(s(t[$]),{...n,...r,stroke:"blue",left:A.x+$/t.length*E}),a=new e.Line(s(t[o]),{...n,...r,stroke:"green",left:A.x+o/t.length*E});return new e.Group([i,l,a]);function s(e){return[e.x,e.y,e.x,e.y-z]}}(C,W),(P=C,R=W,new e.Circle({...n,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:A.x+R/P.length*E-5,top:A.y+30+(P[Y].y-P[R].y)/Math.abs(P[Y].y-P[$].y)*X-5}))];var P,R,H;c&&D.push(new e.Text(`x${l}`,{...n,fill:"black",fontSize:20,left:A.x+10,top:A.y+z-30})),p&&D.push(function(t,o){const r={fontSize:16,left:A.x+E/2+10},i=new e.Text(`最大: ${k(t[Y].y)} mv`,{...n,...r,fill:"red",top:A.y+z-20}),l=new e.Text(`最小: ${k(t[$].y)} mv`,{...n,...r,fill:"blue",top:A.y+z-40}),a=new e.Text(`当前: ${k(t[o].y)} mv`,{...n,...r,fill:"green",top:A.y+z-60});return new e.Group([i,l,a])}(C,W)),w.add(...D).addWithUpdate(),null==(i=r.canvas)||i.add(w),null==(d=r.canvas)||d.discardActiveObject()})),r.on("mouseup",(async e=>{await(null==a?void 0:a()),1===e.button&&j()}))}export{r as useDetailEvent};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as e}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as n}from"./hooks/useDetailEvent.js";import{defaultStyle as o,drawLine as i}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as s}from"../../constants/index.js";import"naive-ui";function d(d,u,c){const{computedX:m,computedY:f}=l(u),{borderStyle:h,originX:L,originY:g,xCellWidth:E,yCellHeight:p,canvasWidth:x,canvasHeight:M,dataList:C,columnNumber:N,gridYNumber:v,gridXNumber:y,rowNumber:b,lineStyle:S,titleStyle:w,config:A,calibrationLineHeight:j}=u,R=new Set,U=new Set;function X(t=[]){return~~(t.length/N)*(A.mainXCellValue/s.DEFAULTMAINXCELLVALUE)}function B(e=0){C.forEach(((r,n)=>{if(n===C.length-1&&arguments.length)return;const{x:o,y:i,rowIdx:a}=r.origin,l=X(r.data),d=r.data.reduce(((t,r,o)=>{const a=n<s.MAXLINENUMBER-1&&o>=e&&o<=e+l||n===s.MAXLINENUMBER-1?[{x:m(t.length+1),y:f(-+r)+i}]:[];return t.concat(a)}),[]),h=new t.Polyline(d,{...S,fill:"transparent",strokeWidth:1,left:o,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(k(h,{...u.config,...u,lineStartIndex:e,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>c.value&&Promise.reject()}),h.startIdx=e,n<C.length-1?R.add(h):U.add(h),arguments.length)return;I({x:o,y:i},S);const L=new t.Text(String(r.title),{...w,left:o+(4===N?E:E/2),top:i,originX:"left",originY:"bottom"});U.add(L)}));const r=arguments.length?[...R]:[...R,...U];d.value.add(...r)}function k(t,e){n(t,e)}function I({x:e,y:r},n){if(4===N)return;const i=e-E,a=E/s.SMALLCELLNUMBER,l=new t.Polyline([{x:i,y:r},{x:i+a,y:r},{x:i+a,y:r-j},{x:i+3*a,y:r-j},{x:i+3*a,y:r},{x:i+4*a,y:r}],{...n,fill:"transparent",strokeWidth:1,left:i,...o});U.add(l)}a(d,{...u,gridXNumber:y*s.SMALLCELLNUMBER,gridYNumber:v*s.SMALLCELLNUMBER,xCellWidth:E/s.SMALLCELLNUMBER,yCellHeight:p/s.SMALLCELLNUMBER,grid:{...u.grid,subXCell:s.SMALLCELLNUMBER,subYCell:s.SMALLCELLNUMBER}}),function(){const{strokeWidth:e}=h,r=new t.Rect({...h,width:x-e,height:M-e,left:L,top:g,fill:"transparent"});d.value.add(r)}(),function(){const t=x/N,e=[];r(N).forEach((r=>{if(r+1>=N)return;const n=(r+1)*t,o=i([n,0,n,M],{stroke:"#000"});e.push(o)})),d.value.add(...e)}(),B();return{updatePolyline:e((e=>{const r=X(C[C.length-1].data);if(r===C[0].data.length)return;const n=C[C.length-1].data.length,o=e/100*n-r/2,i=o+r>n?n-r:Math.max(0,o);t.util.requestAnimFrame((()=>{if(R.size){const[t]=[...R];if(t.startIdx===i)return;[...R].forEach((t=>d.value.remove(t))),R.clear()}B(i)}))}),150)}}export{d as useElectrocardiogram};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as n}from"./hooks/useDetailEvent.js";import{defaultStyle as o,drawLine as i}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as s}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";function u(u,d,c){const{computedX:m,computedY:h}=l(d),{borderStyle:f,originX:L,originY:g,xCellWidth:p,yCellHeight:E,canvasWidth:x,canvasHeight:M,dataList:v,columnNumber:C,gridYNumber:N,gridXNumber:y,rowNumber:b,lineStyle:S,titleStyle:w,config:A,calibrationLineHeight:j}=d,R=new Set,U=new Set;function X(e=[]){return~~(e.length/C)*(A.mainXCellValue/s.DEFAULTMAINXCELLVALUE)}function B(t=0){v.forEach(((r,n)=>{if(n===v.length-1&&arguments.length)return;const{x:o,y:i,rowIdx:a}=r.origin,l=X(r.data),u=r.data.reduce(((e,r,o)=>{const a=n<s.MAXLINENUMBER-1&&o>=t&&o<=t+l||n===s.MAXLINENUMBER-1?[{x:m(e.length+1),y:h(-+r)+i}]:[];return e.concat(a)}),[]),f=new e.Polyline(u,{...S,fill:"transparent",strokeWidth:1,left:o,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(k(f,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>c.value&&Promise.reject()}),f.startIdx=t,n<v.length-1?R.add(f):U.add(f),arguments.length)return;I({x:o,y:i},S);const L=new e.Text(String(r.title),{...w,left:o+(4===C?p:p/2),top:i,originX:"left",originY:"bottom"});U.add(L)}));const r=arguments.length?[...R]:[...R,...U];u.value.add(...r)}function k(e,t){n(e,t)}function I({x:t,y:r},n){if(4===C)return;const i=t-p,a=p/s.SMALLCELLNUMBER,l=new e.Polyline([{x:i,y:r},{x:i+a,y:r},{x:i+a,y:r-j},{x:i+3*a,y:r-j},{x:i+3*a,y:r},{x:i+4*a,y:r}],{...n,fill:"transparent",strokeWidth:1,left:i,...o});U.add(l)}a(u,{...d,gridXNumber:y*s.SMALLCELLNUMBER,gridYNumber:N*s.SMALLCELLNUMBER,xCellWidth:p/s.SMALLCELLNUMBER,yCellHeight:E/s.SMALLCELLNUMBER,grid:{...d.grid,subXCell:s.SMALLCELLNUMBER,subYCell:s.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=f,r=new e.Rect({...f,width:x-t,height:M-t,left:L,top:g,fill:"transparent"});u.value.add(r)}(),function(){const e=x/C,t=[];r(C).forEach((r=>{if(r+1>=C)return;const n=(r+1)*e,o=i([n,0,n,M],{stroke:"#000"});t.push(o)})),u.value.add(...t)}(),B();return{updatePolyline:t((t=>{const r=X(v[v.length-1].data);if(r===v[0].data.length)return;const n=v[v.length-1].data.length,o=t/100*n-r/2,i=o+r>n?n-r:Math.max(0,o);e.util.requestAnimFrame((()=>{if(R.size){const[e]=[...R];if(e.startIdx===i)return;[...R].forEach((e=>u.value.remove(e))),R.clear()}B(i)}))}),150)}}export{u as useElectrocardiogram};
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{isNumber as o}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as d}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function v(v,c,g,h,f,p){const N=e(),b=e(),M=e(),L=e(),y=a((()=>c.data.width)),x=a((()=>c.data.height)),C=a((()=>(y.value-0)/w.value)),S=a((()=>(x.value-0)/E.value)),w=a((()=>{const{dataList:e,config:a,grid:t}=c.data;if(o(t.gridXNumber))return t.gridXNumber;const r=e[e.length-1].data.length/a.hz;return Math.ceil(r/a.mainXCellValue)})),E=a((()=>{const{config:e,grid:a,dataList:t}=c.data;if(o(a.gridYNumber))return a.gridYNumber;const r=t.length;return Math.ceil(X.value*r*2/e.mainYCellValue)})),X=a((()=>{const{dataList:e,config:a}=c.data,t=e[e.length-1].data,r=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*r:"v"===a.valueUnit?1e3*r:r})),Y=a((()=>{var e;return(null==(e=c.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),j=a((()=>{const{mode:e="2-6"}=c.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),R=a((()=>{const{rowNumber:e}=j.value,{dataList:a}=c.data,t=a.length;return Math.round(E.value/(e+(t===d.MAXLINENUMBER?1:0)))})),I=a((()=>{const{dataList:e,width:a,config:t,grid:r}=c.data,{columnNumber:u,rowNumber:l}=j.value,i=a/u,n=e.length,o=Math.ceil(R.value/2),m=function(){const{valueUnit:a,mainYCellValue:r}=t,l=e[0].data,i=d(Math.max(...l));if(2!==u)return i;const n=e[6].data,o=d(Math.max(...n));return Math.max(i,o);function d(e){return("uv"===a?.001*e:"v"===a?1e3*e:e)/r*S.value}}(),s=S.value*o,v=1===u||s<m?S.value*Math.ceil(m/S.value):s,g=4===u?0:C.value;return e.map(((e,a)=>{const t=d.MAXLINENUMBER===n&&a===n-1?l:a%l;return{...e,origin:{x:(d.MAXLINENUMBER===n&&a===n-1?0:Math.floor(a/l))*i+g,y:t*(S.value*R.value)+v,rowIdx:t}}}))})),U=a((()=>{var e;const{calibrationLineGridYNumber:a,mainYCellValue:t}=(null==(e=c.data)?void 0:e.config)||{};return a?S.value*a:t?S.value/t:S.value})),A=t({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...l,...c.data.borderStyle},lineStyle:{...i,...c.data.lineStyle},titleStyle:{...n,...c.data.titleStyle},measureLineStyle:{...i,...c.data.measureLineStyle},measureTextStyle:{...n,...c.data.measureTextStyle},grid:c.data.grid,originX:0,endX:y.value,originY:0,endY:x.value,xCellWidth:C.value,yCellHeight:S.value,gridXNumber:w.value,gridYNumber:E.value,event:Y.value,dataList:I.value,columnNumber:r(j).columnNumber,rowNumber:r(j).rowNumber,config:c.data.config,calibrationLineHeight:r(U)});return u((()=>v.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:r}=s(v,A),{updatePolyline:u}=m(v,A,a);b.value=e,M.value=t,L.value=r,N.value=u}()}),{immediate:!0}),{propItems:A,updatePolyline:N,useMeasureRuler:b,useCaliper:M,useCaliperRuler:L,getGridInfo:function(){return{cellWidth:C.value,cellHeight:S.value,smallCellNumber:d.SMALLCELLNUMBER}}}}export{v as useElectrocardiogramChart};
1
+ import{ref as e,computed as a,reactive as t,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{isNumber as o}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as d}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function v(v,c,g,h,f,p){const N=e(),b=e(),M=e(),L=e(),y=a((()=>c.data.width)),x=a((()=>c.data.height)),C=a((()=>(y.value-0)/w.value)),S=a((()=>(x.value-0)/E.value)),w=a((()=>{const{dataList:e,config:a,grid:t}=c.data;if(o(t.gridXNumber))return t.gridXNumber;const r=e[e.length-1].data.length/a.hz;return Math.ceil(r/a.mainXCellValue)})),E=a((()=>{const{config:e,grid:a,dataList:t}=c.data;if(o(a.gridYNumber))return a.gridYNumber;const r=t.length;return Math.ceil(X.value*r*2/e.mainYCellValue)})),X=a((()=>{const{dataList:e,config:a}=c.data,t=e[e.length-1].data,r=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*r:"v"===a.valueUnit?1e3*r:r})),Y=a((()=>{var e;return(null==(e=c.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),j=a((()=>{const{mode:e="2-6"}=c.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),R=a((()=>{const{rowNumber:e}=j.value,{dataList:a}=c.data,t=a.length;return Math.round(E.value/(e+(t===d.MAXLINENUMBER?1:0)))})),I=a((()=>{const{dataList:e,width:a,config:t,grid:r}=c.data,{columnNumber:u,rowNumber:l}=j.value,i=a/u,n=e.length,o=Math.ceil(R.value/2),m=function(){const{valueUnit:a,mainYCellValue:r}=t,l=e[0].data,i=d(Math.max(...l));if(2!==u)return i;const n=e[6].data,o=d(Math.max(...n));return Math.max(i,o);function d(e){return("uv"===a?.001*e:"v"===a?1e3*e:e)/r*S.value}}(),s=S.value*o,v=1===u||s<m?S.value*Math.ceil(m/S.value):s,g=4===u?0:C.value;return e.map(((e,a)=>{const t=d.MAXLINENUMBER===n&&a===n-1?l:a%l;return{...e,origin:{x:(d.MAXLINENUMBER===n&&a===n-1?0:Math.floor(a/l))*i+g,y:t*(S.value*R.value)+v,rowIdx:t}}}))})),U=a((()=>{var e;const{calibrationLineGridYNumber:a,mainYCellValue:t}=(null==(e=c.data)?void 0:e.config)||{};return a?S.value*a:t?S.value/t:S.value})),A=t({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...l,...c.data.borderStyle},lineStyle:{...i,...c.data.lineStyle},titleStyle:{...n,...c.data.titleStyle},measureLineStyle:{...i,...c.data.measureLineStyle},measureTextStyle:{...n,...c.data.measureTextStyle},grid:c.data.grid,originX:0,endX:y.value,originY:0,endY:x.value,xCellWidth:C.value,yCellHeight:S.value,gridXNumber:w.value,gridYNumber:E.value,event:Y.value,dataList:I.value,columnNumber:r(j).columnNumber,rowNumber:r(j).rowNumber,config:c.data.config,calibrationLineHeight:r(U)});return u((()=>v.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:r}=s(v,A),{updatePolyline:u}=m(v,A,a);b.value=e,M.value=t,L.value=r,N.value=u}()}),{immediate:!0}),{propItems:A,updatePolyline:N,useMeasureRuler:b,useCaliper:M,useCaliperRuler:L,getGridInfo:function(){return{cellWidth:C.value,cellHeight:S.value,smallCellNumber:d.SMALLCELLNUMBER}}}}export{v as useElectrocardiogramChart};
@@ -1 +1 @@
1
- import{ref as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as o,drawText as r}from"../useDraw.js";import{useElectrocardiogramCumputedPoint as i}from"../useCumputedPoint.js";import"../useEvent.js";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function n(n,l){const{getXValue:s,getYValue:u}=i(l),{yCellHeight:a,xCellWidth:c,measureLineStyle:f,measureTextStyle:h}=l,d=e(!1),v={origin:{x:0,y:0},line:null,rendering:!1},p={origin:{x:300,y:0},caliper:{width:4*c,height:60,rect:null},caliperRuler:{width:6*c,height:120,rect:null}};function m(e){C();const{width:o,height:i,rect:l}=p[e];if(l)return;const{x:s,y:u}=p.origin,a=p.caliper.height;p[e].rect=new t.Rect({left:s,top:u,width:o,height:i,strokeWidth:0,fill:"transparent",hasControls:!1,hasBorders:!1,hoverCursor:"move"});const c={...f,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",strokeWidth:2,__type:e,evented:!0,selectable:!0},d=new t.Line([s,u,s,i],{...c,lockMovementY:!0,originX:"center"}),v=new t.Line([s+o,u,s+o,i],{...c,lockMovementY:!0,originX:"center"}),m=new t.Line([s,a,s+o,a],{...c,lockMovementX:!0,evented:"caliper"===e,hoverCursor:"caliper"===e?"n-resize":"default",originY:"center"}),y=r([s,m.top+10],{value:x(m.x1,m.x2),...h,originX:"left",originY:"top"});d.rect=p[e].rect,v.rect=p[e].rect,m.rect=p[e].rect,Object.assign(p[e].rect,{leftLine:d,rightLine:v,horizontalLine:m,text:y}),function(e,t){e.on("moving",(()=>{const{leftLine:o,rightLine:r,horizontalLine:i,text:n}=e;null==o||o.setCoords().set({x1:e.left,y1:e.top,x2:e.left,y2:e.top+e.height}),null==r||r.setCoords().set({x1:e.left+e.width,y1:e.top,x2:e.left+e.width,y2:e.top+e.height});const l="caliper"===t?e.top+e.height:e.top+e.height/2;null==i||i.setCoords().set({x1:e.left,y1:l,x2:e.left+e.width,y2:l}),n.setCoords().set({left:e.left,top:l+10})})),e.on("mouseup",(t=>{1===t.button&&(n.value.discardActiveObject(),e.leftLine.bringToFront(),e.rightLine.bringToFront(),e.horizontalLine.bringToFront())}))}(p[e].rect,e),g(d,"left"),g(v,"right"),"caliper"===e&&g(m,"horizontal"),n.value.add(p[e].rect,d,v,m,y)}function x(e,t){return`${1e3*s(t-e)}ms`}function g(e,t){e.on("moving",(()=>{const{rect:o}=e;if(!o)return;const{leftLine:r,rightLine:i,horizontalLine:n,text:l}=o;if("horizontal"===t)return e.top<=o.top?e.setCoords().set({y1:o.top,y2:o.top}):e.setCoords().set({y1:e.top,y2:e.top}),o.setCoords().set({height:e.top-o.top}),null==r||r.setCoords().set({y2:e.top}),null==i||i.setCoords().set({y2:e.top}),void l.setCoords().set({top:e.top+10});"left"===t&&(e.left>=i.left?e.setCoords().set({x1:i.left,x2:i.left}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({left:e.left,width:i.left-e.left}),n.setCoords().set({x1:e.left}),l.setCoords().set({left:e.left})),"right"===t&&(e.left<=r.left?e.setCoords().set({x1:r.left,x2:r.left}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({width:e.left-r.left}),n.setCoords().set({x2:e.left})),l.set("text",x(n.x1,n.x2))}))}function C(){Object.values(p).forEach((e=>{const{rect:t}=e;t&&(n.value.remove(t),n.value.remove(t.leftLine),n.value.remove(t.rightLine),n.value.remove(t.horizontalLine),n.value.remove(t.text),e.rect=null)})),v.line&&(n.value.remove(v.line),v.line.text&&n.value.remove(v.line.text),v.line=null)}return n.value.on("mouse:down",(e=>{if(1===e.button&&d.value){const{x:t=0,y:o=0}=e.pointer||{};v.origin={x:t,y:o},v.rendering=!0}})),n.value.on("mouse:up",(e=>{const{button:t}=e;1===t&&d.value&&setTimeout((()=>{d.value=!1,v.rendering=!1})),3===t&&C()})),n.value.on("mouse:move",(e=>{var t;if(1===e.button&&d.value&&v.rendering){const{x:i=0,y:l=0}=e.pointer||{};v.line&&n.value.remove(v.line),(null==(t=v.line)?void 0:t.text)&&n.value.remove(v.line.text);const{x:c,y:d}=v.origin;v.line=o([c,d,i,l],f);const p=-u(l-d).toFixed(2),m=1e3*s(i-c),x=r([i,l+2*a],{value:`${p}mv\n${m}ms`,...h});v.line.text=x,n.value.add(v.line,x)}})),{flag:d,useMeasureRuler:function(){d.value||(d.value=!0)},useCaliper:function(){m("caliper")},useCaliperRuler:function(){m("caliperRuler")}}}export{n as useMeasureInstrument};
1
+ import{ref as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as o,drawText as r}from"../useDraw.js";import{useElectrocardiogramCumputedPoint as i}from"../useCumputedPoint.js";import"../useEvent.js";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function n(n,l){const{getXValue:s,getYValue:u}=i(l),{yCellHeight:a,xCellWidth:c,measureLineStyle:f,measureTextStyle:h}=l,d=e(!1),v={origin:{x:0,y:0},line:null,rendering:!1},p={origin:{x:300,y:0},caliper:{width:4*c,height:60,rect:null},caliperRuler:{width:6*c,height:120,rect:null}};function m(e){C();const{width:o,height:i,rect:l}=p[e];if(l)return;const{x:s,y:u}=p.origin,a=p.caliper.height;p[e].rect=new t.Rect({left:s,top:u,width:o,height:i,strokeWidth:0,fill:"transparent",hasControls:!1,hasBorders:!1,hoverCursor:"move"});const c={...f,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",strokeWidth:2,__type:e,evented:!0,selectable:!0},d=new t.Line([s,u,s,i],{...c,lockMovementY:!0,originX:"center"}),v=new t.Line([s+o,u,s+o,i],{...c,lockMovementY:!0,originX:"center"}),m=new t.Line([s,a,s+o,a],{...c,lockMovementX:!0,evented:"caliper"===e,hoverCursor:"caliper"===e?"n-resize":"default",originY:"center"}),y=r([s,m.top+10],{value:x(m.x1,m.x2),...h,originX:"left",originY:"top"});d.rect=p[e].rect,v.rect=p[e].rect,m.rect=p[e].rect,Object.assign(p[e].rect,{leftLine:d,rightLine:v,horizontalLine:m,text:y}),function(e,t){e.on("moving",(()=>{const{leftLine:o,rightLine:r,horizontalLine:i,text:n}=e;null==o||o.setCoords().set({x1:e.left,y1:e.top,x2:e.left,y2:e.top+e.height}),null==r||r.setCoords().set({x1:e.left+e.width,y1:e.top,x2:e.left+e.width,y2:e.top+e.height});const l="caliper"===t?e.top+e.height:e.top+e.height/2;null==i||i.setCoords().set({x1:e.left,y1:l,x2:e.left+e.width,y2:l}),n.setCoords().set({left:e.left,top:l+10})})),e.on("mouseup",(t=>{1===t.button&&(n.value.discardActiveObject(),e.leftLine.bringToFront(),e.rightLine.bringToFront(),e.horizontalLine.bringToFront())}))}(p[e].rect,e),g(d,"left"),g(v,"right"),"caliper"===e&&g(m,"horizontal"),n.value.add(p[e].rect,d,v,m,y)}function x(e,t){return`${1e3*s(t-e)}ms`}function g(e,t){e.on("moving",(()=>{const{rect:o}=e;if(!o)return;const{leftLine:r,rightLine:i,horizontalLine:n,text:l}=o;if("horizontal"===t)return e.top<=o.top?e.setCoords().set({y1:o.top,y2:o.top}):e.setCoords().set({y1:e.top,y2:e.top}),o.setCoords().set({height:e.top-o.top}),null==r||r.setCoords().set({y2:e.top}),null==i||i.setCoords().set({y2:e.top}),void l.setCoords().set({top:e.top+10});"left"===t&&(e.left>=i.left?e.setCoords().set({x1:i.left,x2:i.left}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({left:e.left,width:i.left-e.left}),n.setCoords().set({x1:e.left}),l.setCoords().set({left:e.left})),"right"===t&&(e.left<=r.left?e.setCoords().set({x1:r.left,x2:r.left}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({width:e.left-r.left}),n.setCoords().set({x2:e.left})),l.set("text",x(n.x1,n.x2))}))}function C(){Object.values(p).forEach((e=>{const{rect:t}=e;t&&(n.value.remove(t),n.value.remove(t.leftLine),n.value.remove(t.rightLine),n.value.remove(t.horizontalLine),n.value.remove(t.text),e.rect=null)})),v.line&&(n.value.remove(v.line),v.line.text&&n.value.remove(v.line.text),v.line=null)}return n.value.on("mouse:down",(e=>{if(1===e.button&&d.value){const{x:t=0,y:o=0}=e.pointer||{};v.origin={x:t,y:o},v.rendering=!0}})),n.value.on("mouse:up",(e=>{const{button:t}=e;1===t&&d.value&&setTimeout((()=>{d.value=!1,v.rendering=!1})),3===t&&C()})),n.value.on("mouse:move",(e=>{var t;if(1===e.button&&d.value&&v.rendering){const{x:i=0,y:l=0}=e.pointer||{};v.line&&n.value.remove(v.line),(null==(t=v.line)?void 0:t.text)&&n.value.remove(v.line.text);const{x:c,y:d}=v.origin;v.line=o([c,d,i,l],f);const p=-u(l-d).toFixed(2),m=1e3*s(i-c),x=r([i,l+2*a],{value:`${p}mv\n${m}ms`,...h});v.line.text=x,n.value.add(v.line,x)}})),{flag:d,useMeasureRuler:function(){d.value||(d.value=!0)},useCaliper:function(){m("caliper")},useCaliperRuler:function(){m("caliperRuler")}}}export{n as useMeasureInstrument};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as s,drawScaleNumber as u,drawScaleLine as a}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import{isEffectiveNode as d,getTime as h,getScaleNumberList as f}from"../../utils/index.js";import{cloneDeep as p,last as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function v(v,g,x,y,b){const{computedX:w,computedY:S,getXValue:E,getYValue:L}=l(g),{getEqualXTypes:j,handleAddPrevent:k,isGridLimit:X,setPrevAndNextPoint:P,getPointEventProps:A}=c(v,x,g),{xAxis:C,grid:T,originX:G,originY:Y,xCellWidth:N,endY:V,startTime:H,leftScales:M,rightScales:$,yCellHeight:B,endX:W,scaleValues:q,canvasWidth:z,borderStyle:D,event:F,other:I,timeXAxisHeight:R,canvasHeight:J,extraTimeXAxisList:K}=g,O=p(q),Q=new Set;function U(){O.filter((t=>t.show)).forEach(((t,r)=>{var l;const s=[],u=[],a=[];null==(l=t.data)||l.forEach(((l,c)=>{!function(l,c,d){if(!l&&!c.childbirth||!(null==c?void 0:c.time)||!tt(c.time))return;let h,f;const{pointAttr:v={},lineAttr:g={},title:x="",key:b,type:S="circle",childbirthStyle:j={}}=t,k=p(t.data[d+1]);k&&!k.value&&k.childbirth&&(k.value=c.value);const X=_(k,t);l&&X&&!c.breakpoint&&(f=Z([...l,...X],g));if(c.childbirth){const t=l?l[0]:w(c.time),n=l?l[1]:m(s).top,o=n+B/2,r=Z([t,n,t,o],g);a.push(r);const u=e([t,o],{value:String(c.childbirth),...i,...j,backgroundColor:"#fff"});a.push(u)}const P=u[d-1],C={origin:{data:c,title:x,key:b||"",dataIndex:r,index:d},leftLine:P,rightLine:f,...v,...A(),...n};l&&(P||(C.leftLine=null),h=o(S,{left:l[0],top:l[1],...C}));f&&u.push(f),h&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{!function(t,e="moving"){const{title:i,key:n,data:o}=t.origin;y.point={x:t.left,y:t.top},y.list=[`${i} ${"hover"===e?o.value:L(n,t.top)}`,`时间 ${E(t.left).slice(-5)}`],y.show=!0}(t,"hover")})),t.on("mouseout",(()=>{y.show=!1})))}(h),s.push(h),Q.add(h))}(_(l,t),l,c)})),Promise.all(s).then((t=>{P(t),Promise.all(a).then((e=>{v.value.add(...u,...t,...e),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Z([e,i,o,r],l){return new t.Polyline([{x:e,y:i},{x:o,y:i},{x:o,y:r}],{...l,fill:"transparent",...n})}function _(t,e){if(d(t)&&tt(t.time)){const i=w(t.time),n=S(e.key,e.range,t.value);return[i,n<Y?Y:n>V?V:n]}}function tt(t){var e,i;const n=(null==(i=null==(e=null==C?void 0:C.time)?void 0:e.range)?void 0:i[1])||20,o=H+60*n*60*1e3,r=h(t);return r>=H&&r<=o}return r(v,g),function(){const e=new t.Rect({...D,width:W-G,height:V-Y,left:G,top:Y,fill:"transparent"});v.value.add(e)}(),function(){function o(o,r="left"){const l=10;let c="left"===r?0:W;o.forEach(((o,r)=>{const{range:d,spaceValue:h,width:p,title:m,titleStyle:g,unit:x,key:y,position:b="center",spaceGridNumber:w=1,showNumber:S,showMaxMinNumber:E}=o,L=[],j=[],k=f(d,h),X=k.length,{lineXMain:P,lineXSub:A,textLeft:C}=s(b,c,p);k.forEach(((t,e)=>{const i=V-e*B*w;!S||(0===e||e===X-1)&&!E||L.push(u(String(t),o,C,i)),j.push(...a(o,e,P,A,i,B,Y,X))}));const T=e([c+l,Y+(V-Y)/2],{value:String(m+"("+x+")"),...i,originX:"center",angle:-90,...g}),G=new t.Group([...j,...L,...T?[T]:[]],{objectCaching:!1,...n});v.value.add(G),G.sendToBack(),c+=p}))}o(M),o($,"right")}(),function(){const{show:o,range:r=[0,20],position:l="top",style:s,spaceGridNumber:u=2,spaceValue:a=2}=C.time;if(o){const o=[],c=B/2;f(r,a).forEach(((t,n)=>{const r="top"===l?Y-c:V+R+c;o.push(e([G+n*N*u,r],{value:0===n?"Admission":String(t),...i,...s}))}));const d=new t.Group(o,{objectCaching:!1,...n});v.value.add(d),v.value.sendToBack(d)}!function(){if((null==K?void 0:K.length)>0){const t=[];K.forEach((n=>{const o=w(n),r=V+R;t.push(e([o,r],{value:String(n.slice(11,16)),...i,originY:"bottom"}))})),v.value.add(...t)}}()}(),function(){const{alertLineList:t=[],alertLineTitle:n="入院时宫颈扩张不同情况"}=I;if(t.length<1)return;const o=e([W,0],{value:n,...i,originX:"right",originY:"top"});v.value.add(o),t.forEach((t=>{const{style:i,data:n=[]}=t;if(n.length<1)return;const o=[],r=O.find((t=>"cervix"===t.key));n.map((t=>({...t,time:H+60*t.time*60*1e3}))).forEach(((t,n,l)=>{const s=_(t,r),u=_(l[n+1],r);s&&!u&&o.push(e([s[0],Y-10],{value:l[0].value+(r.unit||"cm"),fill:i.stroke||"#000"})),s&&u&&o.push(Z([...s,...u],i))})),v.value.add(...o)}))}(),U(),{redrawPoints:function(){var t;Q.size&&(null==(t=v.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...Q]))),Q.clear(),U()}}}export{v as useNewBirthProcess};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as s,drawScaleNumber as u,drawScaleLine as a}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import{isEffectiveNode as d,getTime as h,getScaleNumberList as f}from"../../utils/index.js";import{cloneDeep as p,last as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function v(v,g,x,y,b){const{computedX:w,computedY:S,getXValue:E,getYValue:L}=l(g),{getEqualXTypes:j,handleAddPrevent:k,isGridLimit:X,setPrevAndNextPoint:P,getPointEventProps:A}=c(v,x,g),{xAxis:C,grid:T,originX:G,originY:Y,xCellWidth:N,endY:V,startTime:H,leftScales:M,rightScales:$,yCellHeight:B,endX:W,scaleValues:q,canvasWidth:z,borderStyle:D,event:F,other:I,timeXAxisHeight:R,canvasHeight:J,extraTimeXAxisList:K}=g,O=p(q),Q=new Set;function U(){O.filter((t=>t.show)).forEach(((t,r)=>{var l;const s=[],u=[],a=[];null==(l=t.data)||l.forEach(((l,c)=>{!function(l,c,d){if(!l&&!c.childbirth||!(null==c?void 0:c.time)||!tt(c.time))return;let h,f;const{pointAttr:v={},lineAttr:g={},title:x="",key:b,type:S="circle",childbirthStyle:j={}}=t,k=p(t.data[d+1]);k&&!k.value&&k.childbirth&&(k.value=c.value);const X=_(k,t);l&&X&&!c.breakpoint&&(f=Z([...l,...X],g));if(c.childbirth){const t=l?l[0]:w(c.time),n=l?l[1]:m(s).top,o=n+B/2,r=Z([t,n,t,o],g);a.push(r);const u=e([t,o],{value:String(c.childbirth),...i,...j,backgroundColor:"#fff"});a.push(u)}const P=u[d-1],C={origin:{data:c,title:x,key:b||"",dataIndex:r,index:d},leftLine:P,rightLine:f,...v,...A(),...n};l&&(P||(C.leftLine=null),h=o(S,{left:l[0],top:l[1],...C}));f&&u.push(f),h&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{!function(t,e="moving"){const{title:i,key:n,data:o}=t.origin;y.point={x:t.left,y:t.top},y.list=[`${i} ${"hover"===e?o.value:L(n,t.top)}`,`时间 ${E(t.left).slice(-5)}`],y.show=!0}(t,"hover")})),t.on("mouseout",(()=>{y.show=!1})))}(h),s.push(h),Q.add(h))}(_(l,t),l,c)})),Promise.all(s).then((t=>{P(t),Promise.all(a).then((e=>{v.value.add(...u,...t,...e),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Z([e,i,o,r],l){return new t.Polyline([{x:e,y:i},{x:o,y:i},{x:o,y:r}],{...l,fill:"transparent",...n})}function _(t,e){if(d(t)&&tt(t.time)){const i=w(t.time),n=S(e.key,e.range,t.value);return[i,n<Y?Y:n>V?V:n]}}function tt(t){var e,i;const n=(null==(i=null==(e=null==C?void 0:C.time)?void 0:e.range)?void 0:i[1])||20,o=H+60*n*60*1e3,r=h(t);return r>=H&&r<=o}return r(v,g),function(){const e=new t.Rect({...D,width:W-G,height:V-Y,left:G,top:Y,fill:"transparent"});v.value.add(e)}(),function(){function o(o,r="left"){const l=10;let c="left"===r?0:W;o.forEach(((o,r)=>{const{range:d,spaceValue:h,width:p,title:m,titleStyle:g,unit:x,key:y,position:b="center",spaceGridNumber:w=1,showNumber:S,showMaxMinNumber:E}=o,L=[],j=[],k=f(d,h),X=k.length,{lineXMain:P,lineXSub:A,textLeft:C}=s(b,c,p);k.forEach(((t,e)=>{const i=V-e*B*w;!S||(0===e||e===X-1)&&!E||L.push(u(String(t),o,C,i)),j.push(...a(o,e,P,A,i,B,Y,X))}));const T=e([c+l,Y+(V-Y)/2],{value:String(m+"("+x+")"),...i,originX:"center",angle:-90,...g}),G=new t.Group([...j,...L,...T?[T]:[]],{objectCaching:!1,...n});v.value.add(G),G.sendToBack(),c+=p}))}o(M),o($,"right")}(),function(){const{show:o,range:r=[0,20],position:l="top",style:s,spaceGridNumber:u=2,spaceValue:a=2}=C.time;if(o){const o=[],c=B/2;f(r,a).forEach(((t,n)=>{const r="top"===l?Y-c:V+R+c;o.push(e([G+n*N*u,r],{value:0===n?"Admission":String(t),...i,...s}))}));const d=new t.Group(o,{objectCaching:!1,...n});v.value.add(d),v.value.sendToBack(d)}!function(){if((null==K?void 0:K.length)>0){const t=[];K.forEach((n=>{const o=w(n),r=V+R;t.push(e([o,r],{value:String(n.slice(11,16)),...i,originY:"bottom"}))})),v.value.add(...t)}}()}(),function(){const{alertLineList:t=[],alertLineTitle:n="入院时宫颈扩张不同情况"}=I;if(t.length<1)return;const o=e([W,0],{value:n,...i,originX:"right",originY:"top"});v.value.add(o),t.forEach((t=>{const{style:i,data:n=[]}=t;if(n.length<1)return;const o=[],r=O.find((t=>"cervix"===t.key));n.map((t=>({...t,time:H+60*t.time*60*1e3}))).forEach(((t,n,l)=>{const s=_(t,r),u=_(l[n+1],r);s&&!u&&o.push(e([s[0],Y-10],{value:l[0].value+(r.unit||"cm"),fill:i.stroke||"#000"})),s&&u&&o.push(Z([...s,...u],i))})),v.value.add(...o)}))}(),U(),{redrawPoints:function(){var t;Q.size&&(null==(t=v.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...Q]))),Q.clear(),U()}}}export{v as useNewBirthProcess};
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as r}from"date-fns";import{getTime as u}from"../../utils/index.js";import{range as s,last as n}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{useNewBirthProcess as o}from"./useNewBirthProcess.js";function d(d,v,c,m,h,x){const p=e(),g=e(),f=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),b=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=a((()=>{var e;return null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0)})),j=a((()=>{var e;const{width:a}=v.data;return a-((null==(e=b.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))||15)})),A=a((()=>v.data.grid.mainXCell||20)),M=a((()=>v.data.grid.mainYCell||8)),S=a((()=>(j.value-y.value)/A.value)),V=a((()=>{var e;const{xAxis:a,height:t,other:l}=v.data,i=Object.values(a).reduce(((e,a)=>(a.show&&e++,e)),0),r=(null!=(e=null==l?void 0:l.alertLineList.length)?e:0)>0;return(t-H.value)/(M.value+i+(r?1:0))})),X=a((()=>{var e;const{xAxis:a,other:t}=v.data,l=Object.values(a).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0),i=(null!=(e=null==t?void 0:t.alertLineList.length)?e:0)>0;return V.value*(l||i?1:0)})),C=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-V.value*t-H.value})),H=a((()=>{const e=w.value.concat(b.value);return(null==e?void 0:e.length)>0?20:0})),L=a((()=>u(v.data.xAxis.time.startTime))),Y=a((()=>{const{spaceValue:e,spaceGridNumber:a}=v.data.xAxis.time||{};return 60*e*60*1e3/(S.value*a)})),N=a((()=>{var e,a,t;const l=null==(t=null==(a=null==(e=w.value.concat(b.value))?void 0:e[0])?void 0:a.data)?void 0:t.map((e=>u(e.time))),i=Math.min(...l);let o=Math.min(Math.max(...l));const d=Y.value*S.value,v=s(1,A.value+1).reduce(((e,a,t)=>e.concat(L.value+a*d)),[L.value]);o=Math.min(o,n(v));const c=v.findIndex((e=>Math.abs(e-i)<d)),m=v.findIndex((e=>Math.abs(e-o)<d))+1;return v.filter(((e,a)=>a>=c&&a<=m)).map((e=>r(new Date(e),"yyyy-MM-dd HH:mm:ss")))})),I=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return V.value/((null==a?void 0:a.spaceValue)||1)})),O=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),P=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...i,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:y.value,endX:j.value,originY:X.value,endY:C.value,xCellWidth:S.value,yCellHeight:V.value,gridXNumber:A.value,gridYNumber:M.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:b.value,startTime:L.value,timeXCell:Y.value,cervixYCell:I.value,scaleValues:v.data.scaleValues,timeXAxisHeight:H.value,extraTimeXAxisList:N.value,event:O.value});return l((()=>d.value),(e=>{e&&function(){const{redrawPoints:e}=o(d,P,c,h);g.value=e}()}),{immediate:!0}),{propItems:P,redrawPoints:g,select:p,clickMenu:f}}export{d as useNewBirthProcessChart};
1
+ import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as r}from"date-fns";import{getTime as u}from"../../utils/index.js";import{range as s,last as n}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useNewBirthProcess as o}from"./useNewBirthProcess.js";function d(d,v,c,m,h,x){const p=e(),g=e(),f=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),b=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=a((()=>{var e;return null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0)})),j=a((()=>{var e;const{width:a}=v.data;return a-((null==(e=b.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))||15)})),A=a((()=>v.data.grid.mainXCell||20)),M=a((()=>v.data.grid.mainYCell||8)),S=a((()=>(j.value-y.value)/A.value)),V=a((()=>{var e;const{xAxis:a,height:t,other:l}=v.data,i=Object.values(a).reduce(((e,a)=>(a.show&&e++,e)),0),r=(null!=(e=null==l?void 0:l.alertLineList.length)?e:0)>0;return(t-H.value)/(M.value+i+(r?1:0))})),X=a((()=>{var e;const{xAxis:a,other:t}=v.data,l=Object.values(a).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0),i=(null!=(e=null==t?void 0:t.alertLineList.length)?e:0)>0;return V.value*(l||i?1:0)})),C=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-V.value*t-H.value})),H=a((()=>{const e=w.value.concat(b.value);return(null==e?void 0:e.length)>0?20:0})),L=a((()=>u(v.data.xAxis.time.startTime))),Y=a((()=>{const{spaceValue:e,spaceGridNumber:a}=v.data.xAxis.time||{};return 60*e*60*1e3/(S.value*a)})),N=a((()=>{var e,a,t;const l=null==(t=null==(a=null==(e=w.value.concat(b.value))?void 0:e[0])?void 0:a.data)?void 0:t.map((e=>u(e.time))),i=Math.min(...l);let o=Math.min(Math.max(...l));const d=Y.value*S.value,v=s(1,A.value+1).reduce(((e,a,t)=>e.concat(L.value+a*d)),[L.value]);o=Math.min(o,n(v));const c=v.findIndex((e=>Math.abs(e-i)<d)),m=v.findIndex((e=>Math.abs(e-o)<d))+1;return v.filter(((e,a)=>a>=c&&a<=m)).map((e=>r(new Date(e),"yyyy-MM-dd HH:mm:ss")))})),I=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return V.value/((null==a?void 0:a.spaceValue)||1)})),O=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),P=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...i,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:y.value,endX:j.value,originY:X.value,endY:C.value,xCellWidth:S.value,yCellHeight:V.value,gridXNumber:A.value,gridYNumber:M.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:b.value,startTime:L.value,timeXCell:Y.value,cervixYCell:I.value,scaleValues:v.data.scaleValues,timeXAxisHeight:H.value,extraTimeXAxisList:N.value,event:O.value});return l((()=>d.value),(e=>{e&&function(){const{redrawPoints:e}=o(d,P,c,h);g.value=e}()}),{immediate:!0}),{propItems:P,redrawPoints:g,select:p,clickMenu:f}}export{d as useNewBirthProcessChart};