cnhis-design-vue 3.2.14-release.1 → 3.2.15-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/es/components/ai-chat/index.d.ts +1 -0
  2. package/es/components/ai-chat/src/Index.vue.d.ts +1 -0
  3. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  4. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +1 -0
  5. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  6. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  8. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
  9. package/es/components/ai-chat/style/index.css +1 -1
  10. package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
  11. package/es/components/base-search/index.d.ts +8 -3
  12. package/es/components/base-search/src/index.vue.d.ts +8 -3
  13. package/es/components/base-search/src/index.vue2.js +1 -1
  14. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  15. package/es/components/big-table/src/components/NoData.vue2.js +1 -1
  16. package/es/components/big-table/src/components/edit-form/edit-date.js +1 -1
  17. package/es/components/big-table/src/components/edit-form/edit-input.js +1 -1
  18. package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
  19. package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
  20. package/es/components/big-table/src/components/input-button.vue2.js +1 -1
  21. package/es/components/big-table/src/hooks/useNestTable.js +1 -1
  22. package/es/components/big-table/src/hooks/useTableParse.js +1 -1
  23. package/es/components/body-select/src/index.vue2.js +1 -1
  24. package/es/components/branch-notice/index.d.ts +63 -0
  25. package/es/components/branch-notice/index.js +1 -0
  26. package/es/components/branch-notice/src/BranchNotice.vue.d.ts +64 -0
  27. package/es/components/branch-notice/src/BranchNotice.vue.js +1 -0
  28. package/es/components/branch-notice/src/BranchNotice.vue2.js +1 -0
  29. package/es/components/branch-notice/src/canstants.d.ts +7 -0
  30. package/es/components/branch-notice/src/canstants.js +1 -0
  31. package/es/components/branch-notice/src/components/NoticeItem.vue.d.ts +151 -0
  32. package/es/components/branch-notice/src/components/NoticeItemAside.vue.d.ts +35 -0
  33. package/es/components/branch-notice/src/components/NoticeOperationList.vue.d.ts +49 -0
  34. package/es/components/branch-notice/src/drawLine.d.ts +2 -0
  35. package/es/components/branch-notice/src/drawLine.js +1 -0
  36. package/es/components/branch-notice/src/types.d.ts +14 -0
  37. package/es/components/branch-notice/src/types.js +1 -0
  38. package/es/components/branch-notice/style/index.css +1 -0
  39. package/es/components/button-print/index.d.ts +4 -0
  40. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
  41. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  42. package/es/components/button-print/src/components/EditFormat.vue2.js +1 -1
  43. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  44. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  45. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  46. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  47. package/es/components/button-print/src/components/Preview.vue2.js +1 -1
  48. package/es/components/button-print/src/utils/dialog.js +1 -1
  49. package/es/components/button-print/src/utils/print.js +1 -1
  50. package/es/components/calendar/index.d.ts +4 -4
  51. package/es/components/calendar/src/Calendar.vue.d.ts +4 -4
  52. package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
  53. package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -1
  54. package/es/components/classification/index.d.ts +1 -0
  55. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  56. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  57. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  58. package/es/components/classification/src/index.vue.d.ts +1 -0
  59. package/es/components/classification/src/index.vue2.js +1 -1
  60. package/es/components/classification/style/index.css +1 -1
  61. package/es/components/default-page/src/constants/index.js +1 -1
  62. package/es/components/default-page/src/index.vue2.js +1 -1
  63. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
  64. package/es/components/expand-field/src/components/FormItemPerson.vue2.js +1 -1
  65. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
  66. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  67. package/es/components/expand-field/src/index.vue2.js +1 -1
  68. package/es/components/expand-field/src/utils/constant.js +1 -1
  69. package/es/components/fabric-chart/index.d.ts +23 -4
  70. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +23 -4
  71. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  72. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  73. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +13 -0
  74. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  75. package/es/components/fabric-chart/src/components/useStyle.js +1 -1
  76. package/es/components/fabric-chart/src/constants/index.d.ts +1 -1
  77. package/es/components/fabric-chart/src/constants/index.js +1 -1
  78. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  79. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +1 -0
  80. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  81. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  82. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  83. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +1 -0
  84. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  85. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  86. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  87. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  88. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +1 -1
  89. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  90. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  91. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  92. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -0
  93. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  94. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +7 -1
  95. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  96. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  97. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  98. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  99. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  100. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +1 -0
  101. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  102. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  103. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  104. package/es/components/fabric-chart/src/interface.d.ts +3 -0
  105. package/es/components/fabric-chart/src/utils/index.d.ts +1 -1
  106. package/es/components/fabric-chart/src/utils/index.js +1 -1
  107. package/es/components/field-set/src/FieldColor.vue.d.ts +3 -3
  108. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  109. package/es/components/field-set/src/FieldFilter.vue.d.ts +5 -4
  110. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  111. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
  112. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  113. package/es/components/field-set/src/Index.vue2.js +1 -1
  114. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  115. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  116. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
  117. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  118. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
  119. package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
  120. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  121. package/es/components/field-set/src/constants/filter.d.ts +21 -12
  122. package/es/components/field-set/src/constants/filter.js +1 -1
  123. package/es/components/field-set/src/constants/index.js +1 -1
  124. package/es/components/field-set/src/types/index.d.ts +1 -1
  125. package/es/components/form-config/index.d.ts +108 -3
  126. package/es/components/form-config/src/FormConfig.vue.d.ts +108 -3
  127. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  128. package/es/components/form-config/src/components/FormConfigEventSetting.vue.js +1 -0
  129. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -0
  130. package/es/components/form-config/src/constants/index.js +1 -1
  131. package/es/components/form-config/src/hooks/useLocale.js +1 -1
  132. package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
  133. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
  134. package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
  135. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  136. package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
  137. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  138. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  139. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  140. package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -1
  141. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  142. package/es/components/iho-chat/index.d.ts +635 -54
  143. package/es/components/iho-chat/src/Index.vue.d.ts +638 -61
  144. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  145. package/es/components/iho-chat/src/api/index.d.ts +1 -0
  146. package/es/components/iho-chat/src/api/index.js +1 -1
  147. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +32 -1
  148. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  149. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +52 -3
  150. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  151. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +52 -2
  152. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  153. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +221 -11
  154. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  155. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +82 -6
  156. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  157. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +19 -1
  158. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  159. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +49 -10
  160. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  161. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +71 -4
  162. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  163. package/es/components/iho-chat/src/components/ContextMenu.d.ts +11 -2
  164. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  165. package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
  166. package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
  167. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +51 -2
  168. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  169. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +19 -1
  170. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  171. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +69 -1
  172. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  173. package/es/components/iho-chat/src/components/Video.vue.d.ts +19 -1
  174. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  175. package/es/components/iho-chat/src/constants/index.d.ts +12 -3
  176. package/es/components/iho-chat/src/constants/index.js +1 -1
  177. package/es/components/iho-chat/src/hooks/index.d.ts +2 -2
  178. package/es/components/iho-chat/src/hooks/index.js +1 -1
  179. package/es/components/iho-chat/src/hooks/useData.d.ts +94 -0
  180. package/es/components/iho-chat/src/hooks/useData.js +1 -0
  181. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  182. package/es/components/iho-chat/src/hooks/useVideo.d.ts +19 -1
  183. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  184. package/es/components/iho-chat/src/hooks/useWebSocket.d.ts +3 -0
  185. package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -0
  186. package/es/components/iho-chat/src/types/index.d.ts +0 -6
  187. package/es/components/iho-chat/src/types/index.js +1 -1
  188. package/es/components/iho-chat/src/utils/chatSock.js +1 -1
  189. package/es/components/iho-chat/src/utils/index.d.ts +2 -0
  190. package/es/components/iho-chat/src/utils/index.js +1 -1
  191. package/es/components/iho-chat/style/index.css +1 -1
  192. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  193. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
  194. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  195. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  196. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
  197. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  198. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  199. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  200. package/es/components/iho-table/src/utils/index.js +1 -1
  201. package/es/components/index.css +1 -1
  202. package/es/components/index.d.ts +2 -1
  203. package/es/components/index.js +1 -1
  204. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
  205. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  206. package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
  207. package/es/components/map/src/Map.vue2.js +1 -1
  208. package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
  209. package/es/components/quick-search/index.d.ts +3 -1
  210. package/es/components/quick-search/src/index.vue.d.ts +3 -1
  211. package/es/components/quick-search/src/index.vue2.js +1 -1
  212. package/es/components/quick-search/style/index.css +1 -1
  213. package/es/components/recommend-search/src/components/BaseSearch.js +1 -1
  214. package/es/components/recommend-search/src/components/RecommendInput.vue2.js +1 -1
  215. package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
  216. package/es/components/scale-view/index.d.ts +31 -0
  217. package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
  218. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  219. package/es/components/scale-view/src/components/NoData.vue2.js +1 -1
  220. package/es/components/scale-view/src/components/composables/choose-common.js +1 -1
  221. package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
  222. package/es/components/scale-view/src/components/formitem/r-checkbox.d.ts +9 -0
  223. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  224. package/es/components/scale-view/src/components/formitem/r-input.d.ts +9 -0
  225. package/es/components/scale-view/src/components/formitem/r-input.js +1 -1
  226. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  227. package/es/components/scale-view/src/components/formitem/r-radio.d.ts +9 -0
  228. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  229. package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
  230. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  231. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  232. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  233. package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
  234. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  235. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  236. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  237. package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
  238. package/es/components/scale-view/src/hooks/use-component.d.ts +72 -0
  239. package/es/components/scale-view/style/index.css +1 -1
  240. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  241. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  242. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  243. package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
  244. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
  245. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  246. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
  247. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  248. package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
  249. package/es/components/select-person/src/components/SearchOrgAndStaff.vue2.js +1 -1
  250. package/es/components/select-person/src/index.vue2.js +1 -1
  251. package/es/components/slider-tree/src/index.vue2.js +1 -1
  252. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  253. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
  254. package/es/components/table-export-field/src/index.vue2.js +1 -1
  255. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +1 -1
  256. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
  257. package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
  258. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -1
  259. package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
  260. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
  261. package/es/components/table-filter/src/components/classify-filter/components/InputFilter.vue2.js +1 -1
  262. package/es/components/table-filter/src/components/classify-filter/components/InputNumberGroup.vue2.js +1 -1
  263. package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
  264. package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +1 -1
  265. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  266. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
  267. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +1 -1
  268. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  269. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -1
  270. package/es/components/table-filter/src/components/render-widget/components/InputCustom.vue2.js +1 -1
  271. package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue2.js +1 -1
  272. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
  273. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  274. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
  275. package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -1
  276. package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +3 -1
  277. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  278. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  279. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  280. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  281. package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -1
  282. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
  283. package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
  284. package/es/shared/package.json.js +1 -1
  285. package/package.json +2 -2
  286. package/es/components/iho-chat/src/hooks/useSession.d.ts +0 -12
  287. package/es/components/iho-chat/src/hooks/useSession.js +0 -1
  288. package/es/components/iho-chat/src/hooks/useState.d.ts +0 -18
  289. package/es/components/iho-chat/src/hooks/useState.js +0 -1
@@ -33,6 +33,10 @@ declare const _default: import("vue").DefineComponent<{
33
33
  isTarget: {
34
34
  type: BooleanConstructor;
35
35
  };
36
+ marginTop: {
37
+ type: NumberConstructor;
38
+ default: number;
39
+ };
36
40
  }, {
37
41
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
38
42
  show: {
@@ -66,6 +70,10 @@ declare const _default: import("vue").DefineComponent<{
66
70
  isTarget: {
67
71
  type: BooleanConstructor;
68
72
  };
73
+ marginTop: {
74
+ type: NumberConstructor;
75
+ default: number;
76
+ };
69
77
  }>> & {}>>;
70
78
  pointStyle: import("vue").ComputedRef<{
71
79
  top: string;
@@ -109,8 +117,13 @@ declare const _default: import("vue").DefineComponent<{
109
117
  isTarget: {
110
118
  type: BooleanConstructor;
111
119
  };
120
+ marginTop: {
121
+ type: NumberConstructor;
122
+ default: number;
123
+ };
112
124
  }>>, {
113
125
  list: string[];
126
+ marginTop: number;
114
127
  show: boolean;
115
128
  movable: boolean;
116
129
  isTarget: boolean;
@@ -1 +1 @@
1
- import{defineComponent as e,withDirectives as p,openBlock as t,createElementBlock as o,normalizeStyle as r,unref as a,Fragment as i,renderList as l,toDisplayString as s,createBlock as u,resolveDynamicComponent as n,vShow as c}from"vue";import y from"./useStyle.js";const d={key:0,class:"default-box"};var f=e({__name:"PopupTip",props:{show:{type:Boolean,default:!1},point:{type:Object,required:!0},list:{type:Array,default:()=>[]},propItems:{type:Object},popupTipRender:{type:Function},movable:{type:Boolean},sourceData:{type:Array},isTarget:{type:Boolean}},setup(e){const f=e,m=y(f);return(y,T)=>{return p((t(),o("div",{class:"c-fabric-chart-popup c-fabric-chart-popup__tip",style:r(a(m))},[e.popupTipRender?(t(),u(n(null==(b=f.popupTipRender)?void 0:b.call(f,{isTarget:f.isTarget,pointer:f.point,data:f.sourceData})),{key:1})):(t(),o("ul",d,[(t(!0),o(i,null,l(e.list,(e=>(t(),o("li",{key:e},s(e),1)))),128))]))],4)),[[c,e.show]]);var b}}});export{f as default};
1
+ import{defineComponent as e,withDirectives as p,openBlock as t,createElementBlock as r,normalizeStyle as o,unref as a,Fragment as u,renderList as i,toDisplayString as l,createBlock as s,resolveDynamicComponent as n,vShow as c}from"vue";import y from"./useStyle.js";const d={key:0,class:"default-box"};var f=e({__name:"PopupTip",props:{show:{type:Boolean,default:!1},point:{type:Object,required:!0},list:{type:Array,default:()=>[]},propItems:{type:Object},popupTipRender:{type:Function},movable:{type:Boolean},sourceData:{type:Array},isTarget:{type:Boolean},marginTop:{type:Number,default:-15}},setup(e){const f=e,m=y(f);return(y,T)=>{return p((t(),r("div",{class:"c-fabric-chart-popup c-fabric-chart-popup__tip",style:o(a(m))},[e.popupTipRender?(t(),s(n(null==(b=f.popupTipRender)?void 0:b.call(f,{isTarget:f.isTarget,pointer:f.point,data:f.sourceData})),{key:1})):(t(),r("ul",d,[(t(!0),r(u,null,i(e.list,(e=>(t(),r("li",{key:e},l(e),1)))),128))]))],4)),[[c,e.show]]);var b}}});export{f as default};
@@ -1 +1 @@
1
- import{computed as t}from"vue";function o(o){const{canvasWidth:r,canvasHeight:n}=o.propItems;return t((()=>{const{x:t,y:i}=o.point,p={top:"",bottom:"",left:"",right:"","transform-origin":""};return r-(t+15)<200?(p.right=r-t+15+"px",p["transform-origin"]="right"):(p.left=t+15+"px",p["transform-origin"]="left"),n-(i+-15)<200?(p.bottom=n-i-15+"px",p["transform-origin"]+=" bottom"):(p.top=i+-15+"px",p["transform-origin"]+=" top"),p}))}export{o as default};
1
+ import{computed as t}from"vue";function o(o){const{canvasWidth:r,canvasHeight:n}=o.propItems;return t((()=>{var t;const{x:i,y:a}=o.point,p=null!=(t=o.marginTop)?t:-15,m={top:"",bottom:"",left:"",right:"","transform-origin":""};return r-(i+15)<200?(m.right=r-i+15+"px",m["transform-origin"]="right"):(m.left=i+15+"px",m["transform-origin"]="left"),n-(a+p)<200?(m.bottom=n-a+p+"px",m["transform-origin"]+=" bottom"):(m.top=a+p+"px",m["transform-origin"]+=" top"),m}))}export{o as default};
@@ -12,7 +12,7 @@ export declare const PAIN_MENU: {
12
12
  value: undefined;
13
13
  type: string;
14
14
  }[];
15
- export declare const OTHER_MENU: {
15
+ export declare const OTHER_MENU: readonly {
16
16
  label: string;
17
17
  type: string;
18
18
  }[];
@@ -1 +1 @@
1
- const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,radiusCircle:3,stroke:a,fillCircle:r},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}};var d=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e[e.DEFAULTMAINXCELLVALUE=.2]="DEFAULTMAINXCELLVALUE",e))(d||{});export{d as ECG,l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
1
+ var e,l,i,a,d,o,u,n,r;const t=[{label:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.208"))||"升温",value:!0,type:"rise"},{label:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.209"))||"药物降温",value:void 0,type:"drugReduce"},{label:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.210"))||"物理降温",value:void 0,type:"physicsReduce"},{label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.211"))||"不升",value:!0,type:"noRise"}],w=[{label:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.212"))||"药物降痛",value:void 0,type:"drugReduce"},{label:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.213"))||"物理降痛",value:void 0,type:"physicsReduce"}],g=Object.freeze([{label:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.279"))||"新增",type:"add"},{label:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.214"))||"修改",type:"edit"},{label:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.215"))||"删除",type:"remove"}]),s="#2563F4",c="#FF1818",L={yemai:{stroke:c,strokeX:s,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:c,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:s},gangmai:{radius:6,radiusCircle:3,stroke:s,fillCircle:c},xinmai:{radius:6,radiusCircle:3,stroke:c,fillCircle:c},humai:{radius:6,radiusCircle:3,stroke:c,fillCircle:s},ermai:{stroke:c,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:s}};var C=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e[e.DEFAULTMAINXCELLVALUE=.2]="DEFAULTMAINXCELLVALUE",e))(C||{});export{C as ECG,g as OTHER_MENU,L as OVERLAP,w as PAIN_MENU,t as TEMPERATURE_MENU};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as k,range as j}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,S,C,P,E){const{computedX:X,computedY:O,getXValue:A,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:H,setPrevAndNextPoint:T,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:G,originX:N,originY:W,xCellWidth:V,endY:B,startTime:F,leftAddAreaWidth:R,leftScales:$,rightScales:q,yCellHeight:z,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],d=[],{pointAttr:f={},lineAttr:h={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function k(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:f={}}=e[s+"Style"],p=X(l[s]),g=t([...r,p,r[1]],{...h,strokeDashArray:[4,2],...i}),v="dystocia"===s&&r[1]-W>=z?r[1]-z:r[1],m=n(c,{left:p,top:v,...u,...i}),y=v+m.height/2,b="dystocia"===s?o([p,y+z,y],h,"up"):null;g&&(d.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),m&&(d.push(m),a[s]={obj:m,left:p-r[0]}),b&&(d.push(b),a[s+"Arrow"]={obj:b,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const E=e.data[b+1],X=fe(E,e);if(a&&X&&!y.breakpoint)S=t([...a,...X],{...h});else if(a&&!X&&!y.breakpoint){const o=fe(E,e);S=o?t([...a,...o],{...h}):null}const O={};if(["fetalPresentation","cervix"].includes(g)){let e,t;if(y.childbirth){const{type:s="arrow",style:c={},textStyle:u={}}=m;if("arrow"===s){const t=a[1]+z;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+V/2,a[1]+z/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",...u}),e&&(d.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(O,{childbirthText:{obj:t,left:V/2,top:z/2}}))}}"fetalPresentation"===g&&(k(a,y,"surgicalDelivery",O),k(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...f,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{de(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&de(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=w(new Date(A(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(fe(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));T(e),Promise.all(d).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ce()}function ce(){var e;le.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:N,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<W&&e.set("top",W),e.top>B&&e.set("top",B),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function de(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${A(e.left).slice(-5)}`],P.show=!0}function fe(e,t){if(v(e)&&function(e){const t=F+864e5,o=m(e);return o>=F&&o<=t}(e.time)){const o=X(e.time),n=O(t.key,t.range,e.value);return[o,n<W?W:n>B?B:n]}}function he(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-R-Z-1,left:R}:{width:J-N-(q.length?0:1),left:N},o=new e.Rect({...U,height:B-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?R:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:k=!0,showMaxMinNumber:j=!0,showName:w=!0}=t,S=[],C=[],P=n+u/2,E=y(s,c),X=E.length,{lineXMain:O,lineXSub:A,textLeft:L}=d(m,n,u);E.forEach(((e,o)=>{const n=B-o*z*b,i=0===o?B-8:o!==E.length-1||!ie[0]||ee&&"FHR"!==v?n:W+8;!k||(0===o||o===X-1)&&!j||S.push(f(String(e),t,L,i)),C.push(...h(t,o,O,A,n,z,W,X,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:B-ie[0],left:P,top:ie[0]+(B-ie[0])/2}):null;if(Y&&M.push(Y),w){const e=r([P,W-ie[0]>0?W-z/2:z/2],{value:String(p),...l,...g});e&&M.push(e)}const H=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(H),H.sendToBack(),n+=u}))}t($),t(q,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:d,style:f={}}=D.processTime;if(t||c){const h=[],p=j(u[0],u[1]+1),g=[],v=[],m=z/2;for(let e=0;e<G.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=N+("center"===t?V/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):he(k(h),n);h.push(u);const d="top"===s?W-m:B+m;g.push(r([c+e*V,d],{value:String(u),...l,...a})),e===G.mainXCell-1&&"center"!==t&&g.push(r([J-1,d],{value:String(he(k(h),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=f,o=N+("center"===t?V/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===d?m:oe-m;v.push(r([n+e*V,i],{value:String(p[e]),...l,...f})),e===G.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(k(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(B-i-t)/e,B-i],c=[J-N,e*(J-N)+t];let u=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function h([e,t]){const[o,n]=[...p([e,t])];return o>=N&&o<=J&&n>=i&&n<=B}function p([e,t]){return[N+e,B-t]}return f(l)&&h(l)&&(u=p(l)),f(s)&&h(s)&&(u=p(s)),f(a)&&h(a)&&(d=p(a)),f(c)&&h(c)&&(d=p(c)),[...u,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([N,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:w(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[X(l.time)-N,B-O(o,a,l.value)],[h,p]=[X(u.time)-N,B-O(o,a,u.value)],g=(p-f)/(h-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,c=s(o,r-(X(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-X(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=N&&o<=J&&n>=W&&n<=B&&(E.point={x:o,y:n},E.show=!0,t.target?(E.target=t.target,E.list=["删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&E.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(E.target=null,E.list=["新增节点"],re.filter((e=>e.show)).forEach((i=>{if(!M([...le],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<ee)return;E.list.push(e(i,t.pointer))}})),1===E.list.length&&(E.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),H(c)?(ue(c),de(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&H(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:A(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=k(e),o=(B-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t($,R/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:A(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as h,drawScaleLine as f}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as w,range as j}from"lodash-es";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import{format as k}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function x(x,S,C,P,A){const{computedX:E,computedY:O,getXValue:X,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:T,setPrevAndNextPoint:H,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:B,originX:G,originY:N,xCellWidth:W,endY:V,startTime:F,leftAddAreaWidth:R,leftScales:$,rightScales:q,yCellHeight:z,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],d=[],{pointAttr:h={},lineAttr:f={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function w(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:h={}}=e[s+"Style"],p=E(l[s]),g=t([...r,p,r[1]],{...f,strokeDashArray:[4,2],...i}),v="dystocia"===s&&r[1]-N>=z?r[1]-z:r[1],m=n(c,{left:p,top:v,...u,...i}),y=v+m.height/2,b="dystocia"===s?o([p,y+z,y],f,"up"):null;g&&(d.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),m&&(d.push(m),a[s]={obj:m,left:p-r[0]}),b&&(d.push(b),a[s+"Arrow"]={obj:b,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const A=e.data[b+1],E=he(A,e);if(a&&E&&!y.breakpoint)S=t([...a,...E],{...f});else if(a&&!E&&!y.breakpoint){const o=he(A,e);S=o?t([...a,...o],{...f}):null}const O={};if(["fetalPresentation","cervix"].includes(g)){let e,t;if(y.childbirth){const{type:s="arrow",style:c={},textStyle:u={}}=m;if("arrow"===s){const t=a[1]+z;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+W/2,a[1]+z/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",...u}),e&&(d.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(O,{childbirthText:{obj:t,left:W/2,top:z/2}}))}}"fetalPresentation"===g&&(w(a,y,"surgicalDelivery",O),w(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...h,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{de(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&de(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:X(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=k(new Date(X(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(he(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));H(e),Promise.all(d).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ce()}function ce(){var e;le.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:G,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<N&&e.set("top",N),e.top>V&&e.set("top",V),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function de(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${X(e.left).slice(-5)}`],P.show=!0}function he(e,t){if(v(e)&&function(e){const t=F+864e5,o=m(e);return o>=F&&o<=t}(e.time)){const o=E(e.time),n=O(t.key,t.range,e.value);return[o,n<N?N:n>V?V:n]}}function fe(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-R-Z-1,left:R}:{width:J-G-(q.length?0:1),left:G},o=new e.Rect({...U,height:V-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?R:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:w=!0,showMaxMinNumber:j=!0,showName:k=!0}=t,S=[],C=[],P=n+u/2,A=y(s,c),E=A.length,{lineXMain:O,lineXSub:X,textLeft:L}=d(m,n,u);A.forEach(((e,o)=>{const n=V-o*z*b,i=0===o?V-8:o!==A.length-1||!ie[0]||ee&&"FHR"!==v?n:N+8;!w||(0===o||o===E-1)&&!j||S.push(h(String(e),t,L,i)),C.push(...f(t,o,O,X,n,z,N,E,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:V-ie[0],left:P,top:ie[0]+(V-ie[0])/2}):null;if(Y&&M.push(Y),k){const e=r([P,N-ie[0]>0?N-z/2:z/2],{value:String(p),...l,...g});e&&M.push(e)}const T=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(T),T.sendToBack(),n+=u}))}t($),t(q,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:d,style:h={}}=D.processTime;if(t||c){const f=[],p=j(u[0],u[1]+1),g=[],v=[],m=z/2;for(let e=0;e<B.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=G+("center"===t?W/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):fe(w(f),n);f.push(u);const d="top"===s?N-m:V+m;g.push(r([c+e*W,d],{value:String(u),...l,...a})),e===B.mainXCell-1&&"center"!==t&&g.push(r([J-1,d],{value:String(fe(w(f),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=h,o=G+("center"===t?W/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===d?m:oe-m;v.push(r([n+e*W,i],{value:String(p[e]),...l,...h})),e===B.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(w(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(V-i-t)/e,V-i],c=[J-G,e*(J-G)+t];let u=[],d=[];function h([o,n]){return Math.abs(n-e*o-t)<=1}function f([e,t]){const[o,n]=[...p([e,t])];return o>=G&&o<=J&&n>=i&&n<=V}function p([e,t]){return[G+e,V-t]}return h(l)&&f(l)&&(u=p(l)),h(s)&&f(s)&&(u=p(s)),h(a)&&f(a)&&(d=p(a)),h(c)&&f(c)&&(d=p(c)),[...u,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([G,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:k(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,h]=[E(l.time)-G,V-O(o,a,l.value)],[f,p]=[E(u.time)-G,V-O(o,a,u.value)],g=(p-h)/(f-d),v=h-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,c=s(o,r-(E(k(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-E(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{var o,n;if(3===t.button){const{x:i=0,y:r=0}=t.pointer||{};i>=G&&i<=J&&r>=N&&r<=V&&(A.point={x:i,y:r},A.show=!0,t.target?(A.target=t.target,A.list=[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.220"))||"删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&A.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(A.target=null,A.list=[(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.219"))||"新增节点"],re.filter((e=>e.show)).forEach((o=>{if(!M([...le],i,"key").includes(o.key)){if(["cervix","fetalPresentation"].includes(o.key)&&r<ee)return;A.list.push(e(o,t.pointer))}})),1===A.list.length&&(A.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=N;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),T(c)?(ue(c),de(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&T(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:X(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=w(e),o=(V-N)/2,n=(t.height+t.top-N)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t($,R/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:X(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
@@ -11,5 +11,6 @@ export declare function useBirthProcessChart(canvas: Ref<fabric.Canvas>, props:
11
11
  useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
12
12
  useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
13
  useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
+ redrawLinePoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
15
  propItems: any;
15
16
  };
@@ -1 +1 @@
1
- import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as u}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function n(n,d,s,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"left"===e&&a)))),p=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"right"===e&&a)))),f=a((()=>{var e;return(null==(e=p.value)?void 0:e.length)?30:0})),g=a((()=>{var e;return 30+(null==(e=m.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),w=a((()=>{var e;const{width:a}=d.data,t=null==(e=p.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-f.value-t})),x=a((()=>d.data.grid.mainXCell)),y=a((()=>{const e=d.data.grid.mainYCell||14;return d.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),V=a((()=>(w.value-g.value)/x.value)),b=a((()=>{const e=d.data.padding||[5,5],a=B("top"),t=B("bottom");return[a?0:e[0],t?0:e[1]]})),k=a((()=>{const{height:e}=d.data,a=B();return(e-b.value.reduce(((e,a)=>e+a),0))/(y.value+a)})),C=a((()=>{const e=B("top");return k.value*e+b.value[0]})),j=a((()=>{var e;const{scaleValues:a}=d.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!C.value)return C.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return A.value-b.value[0]-l*r*k.value})),A=a((()=>{const{height:e}=d.data,a=B("bottom");return e-k.value*a-b.value[1]})),Y=a((()=>u(d.data.xAxis.time.startTime))),S=a((()=>36e5/V.value)),H=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"cervix"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),P=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"FHR"===e.key));return k.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"fetalPresentation"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),X=a((()=>{var e;return(null==(e=d.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}}));function B(e){const{xAxis:a}=d.data;return Object.values(a).reduce(((a,t)=>(t.show&&(!e||e&&t.position===e)&&a++,a)),0)}const F=e({canvasWidth:d.data.width,canvasHeight:d.data.height,borderStyle:{...r,...d.data.borderStyle||{}},selectionStyle:d.data.selectionStyle||{},grid:d.data.grid,other:d.data.other,originX:g.value,endX:w.value,originY:C.value,endY:A.value,xCellWidth:V.value,yCellHeight:k.value,gridXNumber:x.value,gridYNumber:y.value,xAxis:d.data.xAxis,leftScales:m.value,rightScales:p.value,leftAddAreaWidth:30,rightAddAreaWidth:f.value,startTime:Y.value,timeXCell:S.value,cervixYCell:H.value,FHRYCell:P.value,fetalPresentationYCell:R.value,scaleValues:d.data.scaleValues,event:X.value,originYCervix:j.value,scalebarBorder:!Reflect.has(d.data,"scalebarBorder")||d.data.scalebarBorder,padding:b.value});return t((()=>n.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=i(n,F,s,v,c);h.redrawPoints=a,h.clickMenu=e}()}),{immediate:!0}),{propItems:F,...l(h)}}export{n as useBirthProcessChart};
1
+ import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as u}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../useCommon.js";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useBirthProcess as i}from"./useBirthProcess.js";function s(s,n,d,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>n.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"left"===e&&a)))),p=a((()=>n.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"right"===e&&a)))),f=a((()=>{var e;return(null==(e=p.value)?void 0:e.length)?30:0})),g=a((()=>{var e;return 30+(null==(e=m.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),w=a((()=>{var e;const{width:a}=n.data,t=null==(e=p.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-f.value-t})),x=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})),y=a((()=>(w.value-g.value)/x.value)),V=a((()=>{const e=n.data.padding||[5,5],a=B("top"),t=B("bottom");return[a?0:e[0],t?0:e[1]]})),b=a((()=>{const{height:e}=n.data,a=B();return(e-V.value.reduce(((e,a)=>e+a),0))/(j.value+a)})),A=a((()=>{const e=B("top");return b.value*e+V.value[0]})),C=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!A.value)return A.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return k.value-V.value[0]-l*r*b.value})),k=a((()=>{const{height:e}=n.data,a=B("bottom");return e-b.value*a-V.value[1]})),Y=a((()=>u(n.data.xAxis.time.startTime))),S=a((()=>36e5/y.value)),H=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return b.value/((null==a?void 0:a.spaceValue)||1)})),P=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return b.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return b.value/((null==a?void 0:a.spaceValue)||1)})),X=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}}));function B(e){const{xAxis:a}=n.data;return Object.values(a).reduce(((a,t)=>(t.show&&(!e||e&&t.position===e)&&a++,a)),0)}const F=e({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...r,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:g.value,endX:w.value,originY:A.value,endY:k.value,xCellWidth:y.value,yCellHeight:b.value,gridXNumber:x.value,gridYNumber:j.value,xAxis:n.data.xAxis,leftScales:m.value,rightScales:p.value,leftAddAreaWidth:30,rightAddAreaWidth:f.value,startTime:Y.value,timeXCell:S.value,cervixYCell:H.value,FHRYCell:P.value,fetalPresentationYCell:R.value,scaleValues:n.data.scaleValues,event:X.value,originYCervix:C.value,scalebarBorder:!Reflect.has(n.data,"scalebarBorder")||n.data.scalebarBorder,padding:V.value});return t((()=>s.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=i(s,F,d,v,c);h.redrawPoints=a,h.clickMenu=e}()}),{immediate:!0}),{propItems:F,...l(h)}}export{s 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"@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
+ 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"../../useCommon.js";import"vue";import"date-fns";import"../../temperature/useShadow.js";import"../../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../surgicalAnesthesia/useOther.js";import"../../../../../../shared/utils/index.js";function r(r,i){const{scale:s,beforeEvent:l,endY:a,endX:u,showScaleText:p,showNumberText:c,detailRadius:y,points:f,lineStartIndex:h,xCellWidth:m,yCellHeight:d,grid:x={subLineStyle:{},mainLineStyle:{x:{},y:{}}}}=i;let w=null;const{computedX:g,computedY:v,getYValue:b}=o(i);function j(e){return g(e)*s}function S(e){return v(e)*s}function L(e){return b(e/s)}const k=d*s;function M(){var e;w&&(null==(e=r.canvas)||e.remove(w)),w=null}r.on("mousedown",(async o=>{var i,m;if(await(null==l?void 0:l()),1!==o.button||!o.target||!o.pointer)return;const d=o.target;if(!d.points)return;const{x:g,y:v}=o.pointer,b=Math.floor((g-d.left)/d.width*d.points.length)+h;let T=b-y,G=b+y;T<=0?(T=0,G=Math.min(2*y,f.length-1)):G>=f.length-1&&(G=f.length-1,T=Math.max(f.length-2*y,0));const C=f.slice(T,G).map(((e,t)=>({x:T+j(t),y:S(e)}))),A=b-T;let W=0,Y=0;C.forEach(((e,t)=>{e.y>C[W].y&&(W=t),e.y<C[Y].y&&(Y=t)}));const $=j(2*y-1),E=C[W].y-C[Y].y-1,X=E+30+70,z={x:u-g<=$?g-$:g,y:a-v<=X?v-X:v};M(),w=new e.Group;const D=[new e.Rect({...n,left:z.x,top:z.y,width:$,height:X,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=k/5,s=30+n[W].y/Math.abs(n[W].y-n[Y].y)*E,l=Math.ceil(s/i),a=Math.ceil((X-s)/i);function u(t,n){return new e.Line([z.x,z.y+t,z.x+$,z.y+t],{...x.mainLineStyle.x,...r(n)})}const p=new e.Group([...t(a).map((e=>u(e*i+s,e))),...t(l).map((e=>u(-e*i+s,e)))]),c=o/n.length*$,y=Math.ceil(c/i),f=Math.ceil(($-c)/i);function h(t,n){return new e.Line([z.x+t,z.y,z.x+t,z.y+X],{...x.mainLineStyle.y,...0===n?x.subLineStyle:r(n)})}const m=new e.Group([...t(f).map((e=>h(e*i+c,e))),...t(y).map((e=>h(-e*i+c,e)))]);return new e.Group([m,p])}(C,A),(R=C.map((({x:e,y:t})=>({x:e,y:-t}))),new e.Polyline(R,{...n,fill:"transparent",stroke:"red",strokeWidth:1,left:z.x,top:z.y+30})),function(t,o){const r={strokeDashArray:[3,4],width:3,top:z.y},i=new e.Line(a(t[W]),{...n,...r,left:z.x+W/t.length*$,stroke:"red"}),s=new e.Line(a(t[Y]),{...n,...r,stroke:"blue",left:z.x+Y/t.length*$}),l=new e.Line(a(t[o]),{...n,...r,stroke:"green",left:z.x+o/t.length*$});return new e.Group([i,s,l]);function a(e){return[e.x,e.y,e.x,e.y-X]}}(C,A),(O=C,P=A,new e.Circle({...n,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:z.x+P/O.length*$-5,top:z.y+30+(O[W].y-O[P].y)/Math.abs(O[W].y-O[Y].y)*E-5}))];var O,P,R;p&&D.push(new e.Text(`x${s}`,{...n,fill:"black",fontSize:20,left:z.x+10,top:z.y+X-30})),c&&D.push(function(t,o){const r={fontSize:16,left:z.x+$/2+10},i=new e.Text(`最大: ${L(t[W].y)} mv`,{...n,...r,fill:"red",top:z.y+X-20}),s=new e.Text(`最小: ${L(t[Y].y)} mv`,{...n,...r,fill:"blue",top:z.y+X-40}),l=new e.Text(`当前: ${L(t[o].y)} mv`,{...n,...r,fill:"green",top:z.y+X-60});return new e.Group([i,s,l])}(C,A)),w.add(...D).addWithUpdate(),null==(i=r.canvas)||i.add(w),null==(m=r.canvas)||m.discardActiveObject()})),r.on("mouseup",(async e=>{await(null==l?void 0:l()),1===e.button&&M()}))}export{r as useDetailEvent};
@@ -1 +1 @@
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 d(d,u,c){const{computedX:m,computedY:h}=l(u),{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}=u,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),d=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(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(f,{...u.config,...u,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];d.value.add(...r)}function k(e,t){n(e,t)}function I({x:t,y:r},n){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(d,{...u,gridXNumber:y*s.SMALLCELLNUMBER,gridYNumber:N*s.SMALLCELLNUMBER,xCellWidth:p/s.SMALLCELLNUMBER,yCellHeight:E/s.SMALLCELLNUMBER,grid:{...u.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"});d.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)})),d.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=>d.value.remove(e))),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 o}from"./hooks/useDetailEvent.js";import{defaultStyle as i,drawLine as n}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"../useCommon.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as l}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function u(u,d,m){const{computedX:c,computedY:h}=a(d),{borderStyle:f,originX:L,originY:g,xCellWidth:p,yCellHeight:E,canvasWidth:x,canvasHeight:M,dataList:C,columnNumber:v,gridYNumber:N,gridXNumber:y,rowNumber:b,lineStyle:S,titleStyle:j,config:A,calibrationLineHeight:w}=d,R=new Set,U=new Set;function X(e=[]){return~~(e.length/v)*(A.mainXCellValue/l.DEFAULTMAINXCELLVALUE)}function B(t=0){C.forEach(((r,o)=>{if(o===C.length-1&&arguments.length)return;const{x:i,y:n,rowIdx:s}=r.origin,a=X(r.data),u=r.data.reduce(((e,r,i)=>{const s=o<l.MAXLINENUMBER-1&&i>=t&&i<=t+a||o===l.MAXLINENUMBER-1?[{x:c(e.length+1),y:h(-+r)+n}]:[];return e.concat(s)}),[]),f=new e.Polyline(u,{...S,fill:"transparent",strokeWidth:1,left:i,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:()=>m.value&&Promise.reject()}),f.startIdx=t,o<C.length-1?R.add(f):U.add(f),arguments.length)return;I({x:i,y:n},S);const L=new e.Text(String(r.title),{...j,left:i+(4===v?p:p/2),top:n,originX:"left",originY:"bottom"});U.add(L)}));const r=arguments.length?[...R]:[...R,...U];u.value.add(...r)}function k(e,t){o(e,t)}function I({x:t,y:r},o){const n=t-p,s=p/l.SMALLCELLNUMBER,a=new e.Polyline([{x:n,y:r},{x:n+s,y:r},{x:n+s,y:r-w},{x:n+3*s,y:r-w},{x:n+3*s,y:r},{x:n+4*s,y:r}],{...o,fill:"transparent",strokeWidth:1,left:n,...i});U.add(a)}s(u,{...d,gridXNumber:y*l.SMALLCELLNUMBER,gridYNumber:N*l.SMALLCELLNUMBER,xCellWidth:p/l.SMALLCELLNUMBER,yCellHeight:E/l.SMALLCELLNUMBER,grid:{...d.grid,subXCell:l.SMALLCELLNUMBER,subYCell:l.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/v,t=[];r(v).forEach((r=>{if(r+1>=v)return;const o=(r+1)*e,i=n([o,0,o,M],{stroke:"#000"});t.push(i)})),u.value.add(...t)}(),B();return{updatePolyline:t((t=>{const r=X(C[C.length-1].data);if(r===C[0].data.length)return;const o=C[C.length-1].data.length,i=t/100*o-r/2,n=i+r>o?o-r:Math.max(0,i);e.util.requestAnimFrame((()=>{if(R.size){const[e]=[...R];if(e.startIdx===n)return;[...R].forEach((e=>u.value.remove(e))),R.clear()}B(n)}))}),150)}}export{u as useElectrocardiogram};
@@ -17,5 +17,6 @@ export declare function useElectrocardiogramChart(canvas: Ref<fabric.Canvas>, pr
17
17
  useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
18
18
  useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
19
19
  useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
20
+ redrawLinePoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
20
21
  propItems: any;
21
22
  };
@@ -1 +1 @@
1
- import{reactive as e,computed as a,unref as t,watch as u,toRefs as l}from"vue";import{defaultBorderStyle as r,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{cloneDeep as o,isNumber as d,last as s}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as c}from"./useMeasureInstrument.js";function g(g,h,p,f,N,b){const M=e({updatePolyline:null,useMeasureRuler:null,useCaliper:null,useCaliperRuler:null,useRectRuler:null}),y=a((()=>h.data.width)),R=a((()=>h.data.height)),C=a((()=>{const{dataList:e=[],config:a={}}=h.data,t=o(e),u=t.find((e=>a.lastDataKey&&e.key===a.lastDataKey));return u?[...t,u]:t})),L=a((()=>(y.value-0)/S.value)),x=a((()=>(R.value-0)/w.value)),S=a((()=>{var e,a,t;const{config:u,grid:l}=h.data;if(d(l.gridXNumber))return l.gridXNumber;const r=(null!=(t=null==(a=null==(e=s(C.value))?void 0:e.data)?void 0:a.length)?t:0)/u.hz;return Math.ceil(r/u.mainXCellValue)})),w=a((()=>{const{config:e,grid:a}=h.data;if(d(a.gridYNumber))return a.gridYNumber;const t=C.value.length;return Math.ceil(E.value*t*2/e.mainYCellValue)})),E=a((()=>{var e;const{config:a}=h.data,t=null==(e=s(C.value))?void 0:e.data,u=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*u:"v"===a.valueUnit?1e3*u:u})),X=a((()=>{var e;return(null==(e=h.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),Y=a((()=>{const{mode:e="2-6"}=h.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),j=a((()=>{const{rowNumber:e}=Y.value,a=C.value.length;return Math.round(w.value/(e+(a===v.MAXLINENUMBER?1:0)))})),I=a((()=>{const{width:e,config:a,grid:t}=h.data,{columnNumber:u,rowNumber:l}=Y.value,r=e/u,i=C.value.length,n=Math.ceil(j.value/2),o=function(){const{valueUnit:e,mainYCellValue:t}=a,l=C.value[0].data,r=o(Math.max(...l));if(2!==u)return r;const i=C.value[6].data,n=o(Math.max(...i));return Math.max(r,n);function o(a){return("uv"===e?.001*a:"v"===e?1e3*a:a)/t*x.value}}(),d=x.value*n,s=1===u||d<o?x.value*Math.ceil(o/x.value):d,m=L.value;return C.value.map(((e,a)=>{const t=v.MAXLINENUMBER===i&&a===i-1?l:a%l;return{...e,origin:{x:(v.MAXLINENUMBER===i&&a===i-1?0:Math.floor(a/l))*r+m,y:t*(x.value*j.value)+s,rowIdx:t}}}))})),U=a((()=>{var e;const{calibrationLineGridYNumber:a,mainYCellValue:t}=(null==(e=h.data)?void 0:e.config)||{};return a?x.value*a:t?x.value/t:x.value})),A=e({canvasWidth:h.data.width,canvasHeight:h.data.height,borderStyle:{...r,...h.data.borderStyle},lineStyle:{...i,...h.data.lineStyle},titleStyle:{...n,...h.data.titleStyle},measureLineStyle:{...i,...h.data.measureLineStyle},measureTextStyle:{...n,...h.data.measureTextStyle},grid:h.data.grid,originX:0,endX:y.value,originY:0,endY:R.value,xCellWidth:L.value,yCellHeight:x.value,gridXNumber:S.value,gridYNumber:w.value,event:X.value,dataList:I.value,columnNumber:t(Y).columnNumber,rowNumber:t(Y).rowNumber,config:h.data.config,calibrationLineHeight:t(U)});return u((()=>g.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:u,useRectRuler:l}=c(g,A),{updatePolyline:r}=m(g,A,a);M.useMeasureRuler=e,M.useCaliper=t,M.useCaliperRuler=u,M.updatePolyline=r,M.useRectRuler=l}()}),{immediate:!0}),{propItems:A,...l(M),getGridInfo:function(){return{cellWidth:L.value,cellHeight:x.value,smallCellNumber:v.SMALLCELLNUMBER}}}}export{g as useElectrocardiogramChart};
1
+ import{reactive as e,computed as a,unref as t,watch as u,toRefs as l}from"vue";import{defaultBorderStyle as r,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{cloneDeep as o,isNumber as s,last as d}from"lodash-es";import"../useEvent.js";import"../useCommon.js";import"../temperature/useShadow.js";import{ECG as m}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useElectrocardiogram as v}from"./useElectrocardiogram.js";import{useMeasureInstrument as c}from"./useMeasureInstrument.js";function g(g,h,p,f,N,b){const M=e({updatePolyline:null,useMeasureRuler:null,useCaliper:null,useCaliperRuler:null,useRectRuler:null}),y=a((()=>h.data.width)),R=a((()=>h.data.height)),C=a((()=>{const{dataList:e=[],config:a={}}=h.data,t=o(e),u=t.find((e=>a.lastDataKey&&e.key===a.lastDataKey));return u?[...t,u]:t})),x=a((()=>(y.value-0)/j.value)),L=a((()=>(R.value-0)/S.value)),j=a((()=>{var e,a,t;const{config:u,grid:l}=h.data;if(s(l.gridXNumber))return l.gridXNumber;const r=(null!=(t=null==(a=null==(e=d(C.value))?void 0:e.data)?void 0:a.length)?t:0)/u.hz;return Math.ceil(r/u.mainXCellValue)})),S=a((()=>{const{config:e,grid:a}=h.data;if(s(a.gridYNumber))return a.gridYNumber;const t=C.value.length;return Math.ceil(w.value*t*2/e.mainYCellValue)})),w=a((()=>{var e;const{config:a}=h.data,t=null==(e=d(C.value))?void 0:e.data,u=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*u:"v"===a.valueUnit?1e3*u:u})),E=a((()=>{var e;return(null==(e=h.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),X=a((()=>{const{mode:e="2-6"}=h.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),Y=a((()=>{const{rowNumber:e}=X.value,a=C.value.length;return Math.round(S.value/(e+(a===m.MAXLINENUMBER?1:0)))})),I=a((()=>{const{width:e,config:a,grid:t}=h.data,{columnNumber:u,rowNumber:l}=X.value,r=e/u,i=C.value.length,n=Math.ceil(Y.value/2),o=function(){const{valueUnit:e,mainYCellValue:t}=a,l=C.value[0].data,r=o(Math.max(...l));if(2!==u)return r;const i=C.value[6].data,n=o(Math.max(...i));return Math.max(r,n);function o(a){return("uv"===e?.001*a:"v"===e?1e3*a:a)/t*L.value}}(),s=L.value*n,d=1===u||s<o?L.value*Math.ceil(o/L.value):s,v=x.value;return C.value.map(((e,a)=>{const t=m.MAXLINENUMBER===i&&a===i-1?l:a%l;return{...e,origin:{x:(m.MAXLINENUMBER===i&&a===i-1?0:Math.floor(a/l))*r+v,y:t*(L.value*Y.value)+d,rowIdx:t}}}))})),U=a((()=>{var e;const{calibrationLineGridYNumber:a,mainYCellValue:t}=(null==(e=h.data)?void 0:e.config)||{};return a?L.value*a:t?L.value/t:L.value})),A=e({canvasWidth:h.data.width,canvasHeight:h.data.height,borderStyle:{...r,...h.data.borderStyle},lineStyle:{...i,...h.data.lineStyle},titleStyle:{...n,...h.data.titleStyle},measureLineStyle:{...i,...h.data.measureLineStyle},measureTextStyle:{...n,...h.data.measureTextStyle},grid:h.data.grid,originX:0,endX:y.value,originY:0,endY:R.value,xCellWidth:x.value,yCellHeight:L.value,gridXNumber:j.value,gridYNumber:S.value,event:E.value,dataList:I.value,columnNumber:t(X).columnNumber,rowNumber:t(X).rowNumber,config:h.data.config,calibrationLineHeight:t(U)});return u((()=>g.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:u,useRectRuler:l}=c(g,A),{updatePolyline:r}=v(g,A,a);M.useMeasureRuler=e,M.useCaliper=t,M.useCaliperRuler=u,M.updatePolyline=r,M.useRectRuler=l}()}),{immediate:!0}),{propItems:A,...l(M),getGridInfo:function(){return{cellWidth:x.value,cellHeight:L.value,smallCellNumber:m.SMALLCELLNUMBER}}}}export{g 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{isNumber as n}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function l(l,s){const{getXValue:u,getYValue:c}=i(s),{yCellHeight:a,xCellWidth:h,measureLineStyle:d,measureTextStyle:f}=s,p=e(!1),x={origin:{x:0,y:0},obj:null,rendering:!1,type:"line"},m={origin:{x:300,y:10},caliper:{width:4*h,height:60,rect:null},caliperRuler:{width:6*h,height:120,rect:null},rectRuler:{width:12*h,height:120,rect:null}};function v(){x.obj&&(l.value.remove(x.obj),x.obj.text&&l.value.remove(x.obj.text),x.obj=null)}function g(){p.value||(p.value=!0)}function y(e,o){L();const{width:i,height:n,rect:s}=m[e];if(s)return;let u;const{x:c,y:a}=o||m.origin,h=a+m.caliper.height,p=["caliper","rectRuler"].includes(e);m[e].rect=new t.Rect({left:c,top:a,width:i,height:n,strokeWidth:0,fill:"transparent",hasControls:!1,hasBorders:!1,hoverCursor:"move"});const x={...d,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",strokeWidth:2,__type:e,evented:!0,selectable:!0},v=new t.Line([c,a,c,a+n],{...x,lockMovementY:!0,originX:"center"}),g=new t.Line([c+i,a,c+i,a+n],{...x,lockMovementY:!0,originX:"center"}),y=new t.Line([c,h,c+i,h],{...x,lockMovementX:!0,evented:p,hoverCursor:p?"n-resize":"default",originY:"center"});let w=C({x1:y.x1,x2:y.x2}).millisecond;if("rectRuler"===e){const{millivolt:e,millisecond:o,bpm:r}=C({x1:c+i,x2:c,y1:a+n,y2:a});w=`测量幅度:${e}\n测试时间:${o}\n瞬时心率:${r}`,y.set({y1:a,y2:a}),u=new t.Line([c,a+n,c+i,a+n],{...x,lockMovementX:!0,evented:!0,hoverCursor:"n-resize",originY:"center"})}const j=r([c,("rectRuler"===e?u.top:y.top)+10],{value:w,...f,originX:"left",originY:"top",backgroundColor:"#fff"});v.rect=m[e].rect,g.rect=m[e].rect,y.rect=m[e].rect,u&&(u.rect=m[e].rect),Object.assign(m[e].rect,{leftLine:v,rightLine:g,horizontalLine:y,horizontalLine2:u,text:j}),function(e,t){e.on("moving",(()=>{const{leftLine:o,rightLine:r,horizontalLine:i,horizontalLine2:n,text:l}=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 s=["caliper","rectRuler"].includes(t)?e.top+e.height:e.top+e.height/2;l.setCoords().set({left:e.left,top:s+10}),"rectRuler"===t?(null==i||i.setCoords().set({x1:e.left,x2:e.left+e.width,y1:e.top,y2:e.top}),null==n||n.setCoords().set({x1:e.left,y1:s,x2:e.left+e.width,y2:s})):null==i||i.setCoords().set({x1:e.left,y1:s,x2:e.left+e.width,y2:s})})),e.on("mouseup",(t=>{var o;1===t.button&&(l.value.discardActiveObject(),e.leftLine.bringToFront(),e.rightLine.bringToFront(),e.horizontalLine.bringToFront(),null==(o=e.horizontalLine2)||o.bringToFront())}))}(m[e].rect,e),b(v,"left"),b(g,"right"),p&&b(y,"horizontal"),u&&b(u,"horizontal2");const z=[m[e].rect,v,g,y,u,j].filter((e=>!!e));l.value.add(...z)}function C({x1:e,x2:t,y1:o,y2:r}){const i=(1e3*u(Math.abs(t-e))).toFixed(3);return{millisecond:`${i}ms`,millivolt:`${n(o)&&n(r)?c(Math.abs(r-o)).toFixed(3):0}mv`,bpm:`${(6e4/+i).toFixed(3)}bpm`}}function b(e,t){e.on("moving",(()=>{const{rect:o}=e;if(!o)return;const{leftLine:r,rightLine:i,horizontalLine:n,horizontalLine2:l,text:s}=o;if(("horizontal"===t&&!l||"horizontal2"===t)&&(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}),s.setCoords().set({top:e.top+10}),!l))return;"horizontal"===t&&l&&(e.top>=l.top?e.setCoords().set({y1:l.top,y2:l.top}):e.setCoords().set({y1:e.top,y2:e.top}),o.setCoords().set({top:e.top,height:l.top-e.top}),null==r||r.setCoords().set({y1:e.top}),null==i||i.setCoords().set({y1:e.top}),s.setCoords().set({top:l.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}),null==l||l.setCoords().set({x1:e.left}),s.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}),null==l||l.setCoords().set({x2:e.left}));const{millivolt:u,millisecond:c,bpm:a}=C({x1:n.x1,x2:n.x2,y1:r.y1,y2:r.y2}),h=l?`测量幅度:${u}\n测试时间:${c}\n瞬时心率:${a}`:c;s.set("text",h)}))}function L(){Object.values(m).forEach((e=>{const{rect:t}=e;t&&(l.value.remove(t),t.leftLine&&l.value.remove(t.leftLine),t.rightLine&&l.value.remove(t.rightLine),t.horizontalLine&&l.value.remove(t.horizontalLine),t.horizontalLine2&&l.value.remove(t.horizontalLine2),t.text&&l.value.remove(t.text),e.rect=null)})),v()}return l.value.on("mouse:down",(e=>{if(1===e.button&&p.value){const{x:t=0,y:o=0}=e.pointer||{};L(),x.rendering=!0,x.origin={x:t,y:o}}})),l.value.on("mouse:up",(e=>{const{button:t}=e;1===t&&p.value&&setTimeout((()=>{if(p.value=!1,x.rendering&&(x.rendering=!1),"rect"===x.type){const{width:e,height:t}=x.obj,o={x:Math.min(x.origin.x,x.origin.x+e),y:Math.min(x.origin.y,x.origin.y+t)+2};m.rectRuler.width=Math.abs(e),m.rectRuler.height=Math.abs(t),v(),y("rectRuler",o)}})),3===t&&L()})),l.value.on("mouse:move",(e=>{if(1===e.button&&p.value&&x.rendering){const{x:i=0,y:n=0}=e.pointer||{};if(v(),"line"===x.type){const{x:e,y:t}=x.origin;x.obj=o([e,t,i,n],d);const{millivolt:s,millisecond:u}=C({x1:e,x2:i,y1:t,y2:n}),c=r([i,n+2*a],{value:`${s}\n${u}`,...f});x.obj.text=c,l.value.add(x.obj,c)}else!function({x:e,y:o}){const{x:i,y:n}=x.origin;x.obj=new t.Rect({...d,objectCaching:!1,fill:"transparent",left:i,top:n,width:e-i,height:o-n,strokeWidth:2});const{millivolt:s,millisecond:u,bpm:c}=C({x1:i,x2:e,y1:n,y2:o}),a=r([i,o+10],{value:`测量幅度:${s}\n测试时间:${u}\n瞬时心率:${c}`,...f,originX:"left",originY:"top",backgroundColor:"#fff"});x.obj.text=a,l.value.add(x.obj,a)}({x:i,y:n})}})),{flag:p,useMeasureRuler:function(){g(),x.type="line"},useCaliper:function(){y("caliper")},useCaliperRuler:function(){y("caliperRuler")},useRectRuler:function(){g(),x.type="rect"}}}export{l 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 i}from"../useDraw.js";import{useElectrocardiogramCumputedPoint as r}from"../useCumputedPoint.js";import"../useEvent.js";import"../useCommon.js";import{isNumber as n}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function l(l,s){const{getXValue:u,getYValue:c}=r(s),{yCellHeight:a,xCellWidth:h,measureLineStyle:d,measureTextStyle:f}=s,p=e(!1),x={origin:{x:0,y:0},obj:null,rendering:!1,type:"line"},m={origin:{x:300,y:10},caliper:{width:4*h,height:60,rect:null},caliperRuler:{width:6*h,height:120,rect:null},rectRuler:{width:12*h,height:120,rect:null}};function g(){x.obj&&(l.value.remove(x.obj),x.obj.text&&l.value.remove(x.obj.text),x.obj=null)}function v(){p.value||(p.value=!0)}function y(e,o){L();const{width:r,height:n,rect:s}=m[e];if(s)return;let u;const{x:c,y:a}=o||m.origin,h=a+m.caliper.height,p=["caliper","rectRuler"].includes(e);m[e].rect=new t.Rect({left:c,top:a,width:r,height:n,strokeWidth:0,fill:"transparent",hasControls:!1,hasBorders:!1,hoverCursor:"move"});const x={...d,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",strokeWidth:2,__type:e,evented:!0,selectable:!0},g=new t.Line([c,a,c,a+n],{...x,lockMovementY:!0,originX:"center"}),v=new t.Line([c+r,a,c+r,a+n],{...x,lockMovementY:!0,originX:"center"}),y=new t.Line([c,h,c+r,h],{...x,lockMovementX:!0,evented:p,hoverCursor:p?"n-resize":"default",originY:"center"});let j=C({x1:y.x1,x2:y.x2}).millisecond;if("rectRuler"===e){const{millivolt:e,millisecond:o,bpm:i}=C({x1:c+r,x2:c,y1:a+n,y2:a});j=`测量幅度:${e}\n测试时间:${o}\n瞬时心率:${i}`,y.set({y1:a,y2:a}),u=new t.Line([c,a+n,c+r,a+n],{...x,lockMovementX:!0,evented:!0,hoverCursor:"n-resize",originY:"center"})}const w=i([c,("rectRuler"===e?u.top:y.top)+10],{value:j,...f,originX:"left",originY:"top",backgroundColor:"#fff"});g.rect=m[e].rect,v.rect=m[e].rect,y.rect=m[e].rect,u&&(u.rect=m[e].rect),Object.assign(m[e].rect,{leftLine:g,rightLine:v,horizontalLine:y,horizontalLine2:u,text:w}),function(e,t){e.on("moving",(()=>{const{leftLine:o,rightLine:i,horizontalLine:r,horizontalLine2:n,text:l}=e;null==o||o.setCoords().set({x1:e.left,y1:e.top,x2:e.left,y2:e.top+e.height}),null==i||i.setCoords().set({x1:e.left+e.width,y1:e.top,x2:e.left+e.width,y2:e.top+e.height});const s=["caliper","rectRuler"].includes(t)?e.top+e.height:e.top+e.height/2;l.setCoords().set({left:e.left,top:s+10}),"rectRuler"===t?(null==r||r.setCoords().set({x1:e.left,x2:e.left+e.width,y1:e.top,y2:e.top}),null==n||n.setCoords().set({x1:e.left,y1:s,x2:e.left+e.width,y2:s})):null==r||r.setCoords().set({x1:e.left,y1:s,x2:e.left+e.width,y2:s})})),e.on("mouseup",(t=>{var o;1===t.button&&(l.value.discardActiveObject(),e.leftLine.bringToFront(),e.rightLine.bringToFront(),e.horizontalLine.bringToFront(),null==(o=e.horizontalLine2)||o.bringToFront())}))}(m[e].rect,e),b(g,"left"),b(v,"right"),p&&b(y,"horizontal"),u&&b(u,"horizontal2");const z=[m[e].rect,g,v,y,u,w].filter((e=>!!e));l.value.add(...z)}function C({x1:e,x2:t,y1:o,y2:i}){const r=(1e3*u(Math.abs(t-e))).toFixed(3);return{millisecond:`${r}ms`,millivolt:`${n(o)&&n(i)?c(Math.abs(i-o)).toFixed(3):0}mv`,bpm:`${(6e4/+r).toFixed(3)}bpm`}}function b(e,t){e.on("moving",(()=>{const{rect:o}=e;if(!o)return;const{leftLine:i,rightLine:r,horizontalLine:n,horizontalLine2:l,text:s}=o;if(("horizontal"===t&&!l||"horizontal2"===t)&&(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==i||i.setCoords().set({y2:e.top}),null==r||r.setCoords().set({y2:e.top}),s.setCoords().set({top:e.top+10}),!l))return;"horizontal"===t&&l&&(e.top>=l.top?e.setCoords().set({y1:l.top,y2:l.top}):e.setCoords().set({y1:e.top,y2:e.top}),o.setCoords().set({top:e.top,height:l.top-e.top}),null==i||i.setCoords().set({y1:e.top}),null==r||r.setCoords().set({y1:e.top}),s.setCoords().set({top:l.top+10})),"left"===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({left:e.left,width:r.left-e.left}),n.setCoords().set({x1:e.left}),null==l||l.setCoords().set({x1:e.left}),s.setCoords().set({left:e.left})),"right"===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({width:e.left-i.left}),n.setCoords().set({x2:e.left}),null==l||l.setCoords().set({x2:e.left}));const{millivolt:u,millisecond:c,bpm:a}=C({x1:n.x1,x2:n.x2,y1:i.y1,y2:i.y2}),h=l?`测量幅度:${u}\n测试时间:${c}\n瞬时心率:${a}`:c;s.set("text",h)}))}function L(){Object.values(m).forEach((e=>{const{rect:t}=e;t&&(l.value.remove(t),t.leftLine&&l.value.remove(t.leftLine),t.rightLine&&l.value.remove(t.rightLine),t.horizontalLine&&l.value.remove(t.horizontalLine),t.horizontalLine2&&l.value.remove(t.horizontalLine2),t.text&&l.value.remove(t.text),e.rect=null)})),g()}return l.value.on("mouse:down",(e=>{if(1===e.button&&p.value){const{x:t=0,y:o=0}=e.pointer||{};L(),x.rendering=!0,x.origin={x:t,y:o}}})),l.value.on("mouse:up",(e=>{const{button:t}=e;1===t&&p.value&&setTimeout((()=>{if(p.value=!1,x.rendering&&(x.rendering=!1),"rect"===x.type){const{width:e,height:t}=x.obj,o={x:Math.min(x.origin.x,x.origin.x+e),y:Math.min(x.origin.y,x.origin.y+t)+2};m.rectRuler.width=Math.abs(e),m.rectRuler.height=Math.abs(t),g(),y("rectRuler",o)}})),3===t&&L()})),l.value.on("mouse:move",(e=>{if(1===e.button&&p.value&&x.rendering){const{x:r=0,y:n=0}=e.pointer||{};if(g(),"line"===x.type){const{x:e,y:t}=x.origin;x.obj=o([e,t,r,n],d);const{millivolt:s,millisecond:u}=C({x1:e,x2:r,y1:t,y2:n}),c=i([r,n+2*a],{value:`${s}\n${u}`,...f});x.obj.text=c,l.value.add(x.obj,c)}else!function({x:e,y:o}){const{x:r,y:n}=x.origin;x.obj=new t.Rect({...d,objectCaching:!1,fill:"transparent",left:r,top:n,width:e-r,height:o-n,strokeWidth:2});const{millivolt:s,millisecond:u,bpm:c}=C({x1:r,x2:e,y1:n,y2:o}),a=i([r,o+10],{value:`测量幅度:${s}\n测试时间:${u}\n瞬时心率:${c}`,...f,originX:"left",originY:"top",backgroundColor:"#fff"});x.obj.text=a,l.value.add(x.obj,a)}({x:r,y:n})}})),{flag:p,useMeasureRuler:function(){v(),x.type="line"},useCaliper:function(){y("caliper")},useCaliperRuler:function(){y("caliperRuler")},useRectRuler:function(){v(),x.type="rect"}}}export{l 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"@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,1))}));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 e}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as t,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 a,drawScaleLine as u}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"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function v(v,g,x,w,y){const{computedX:b,computedY:j,getXValue:L,getYValue:S}=l(g),{getEqualXTypes:E,handleAddPrevent:k,isGridLimit:X,setPrevAndNextPoint:A,getPointEventProps:P}=c(v,x,g),{xAxis:C,grid:T,originX:G,originY:Y,xCellWidth:N,endY:V,startTime:B,leftScales:H,rightScales:M,yCellHeight:$,endX:W,scaleValues:q,canvasWidth:z,borderStyle:D,event:F,other:I,timeXAxisHeight:O,canvasHeight:R,extraTimeXAxisList:J}=g,K=p(q),Q=new Set;function U(){K.filter((e=>e.show)).forEach(((e,r)=>{var l;const s=[],a=[],u=[];null==(l=e.data)||l.forEach(((l,c)=>{!function(l,c,d){if(!l&&!c.childbirth||!(null==c?void 0:c.time)||!ee(c.time))return;let h,f;const{pointAttr:v={},lineAttr:g={},title:x="",key:y,type:j="circle",childbirthStyle:E={}}=e,k=p(e.data[d+1]);k&&!k.value&&k.childbirth&&(k.value=c.value);const X=_(k,e);l&&X&&!c.breakpoint&&(f=Z([...l,...X],g));if(c.childbirth){const e=l?l[0]:b(c.time),n=l?l[1]:m(s).top,o=n+$/2,r=Z([e,n,e,o],g);u.push(r);const a=t([e,o],{value:String(c.childbirth),...i,...E,backgroundColor:"#fff"});u.push(a)}const A=a[d-1],C={origin:{data:c,title:x,key:y||"",dataIndex:r,index:d},leftLine:A,rightLine:f,...v,...P(),...n};l&&(A||(C.leftLine=null),h=o(j,{left:l[0],top:l[1],...C}));f&&a.push(f),h&&(!function(e){F.hovered&&(e.on("mouseover",(()=>{!function(e,t="moving"){const{title:i,key:n,data:o}=e.origin;w.point={x:e.left,y:e.top},w.list=[`${i} ${"hover"===t?o.value:S(n,e.top)}`,`时间 ${L(e.left).slice(-5)}`],w.show=!0}(e,"hover")})),e.on("mouseout",(()=>{w.show=!1})))}(h),s.push(h),Q.add(h))}(_(l,e),l,c)})),Promise.all(s).then((e=>{A(e),Promise.all(u).then((t=>{v.value.add(...a,...e,...t),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function Z([t,i,o,r],l){return new e.Polyline([{x:t,y:i},{x:o,y:i},{x:o,y:r}],{...l,fill:"transparent",...n})}function _(e,t){if(d(e)&&ee(e.time)){const i=b(e.time),n=j(t.key,t.range,e.value);return[i,n<Y?Y:n>V?V:n]}}function ee(e){var t,i;const n=(null==(i=null==(t=null==C?void 0:C.time)?void 0:t.range)?void 0:i[1])||20,o=B+60*n*60*1e3,r=h(e);return r>=B&&r<=o}return r(v,g),function(){const t=new e.Rect({...D,width:W-G,height:V-Y,left:G,top:Y,fill:"transparent"});v.value.add(t)}(),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:w,position:y="center",spaceGridNumber:b=1,showNumber:j,showMaxMinNumber:L}=o,S=[],E=[],k=f(d,h),X=k.length,{lineXMain:A,lineXSub:P,textLeft:C}=s(y,c,p);k.forEach(((e,t)=>{const i=V-t*$*b;!j||(0===t||t===X-1)&&!L||S.push(a(String(e),o,C,i)),E.push(...u(o,t,A,P,i,$,Y,X,1))}));const T=t([c+l,Y+(V-Y)/2],{value:String(m+"("+x+")"),...i,originX:"center",angle:-90,...g}),G=new e.Group([...E,...S,...T?[T]:[]],{objectCaching:!1,...n});v.value.add(G),G.sendToBack(),c+=p}))}o(H),o(M,"right")}(),function(){const{show:o,range:r=[0,20],position:l="top",style:s,spaceGridNumber:a=2,spaceValue:u=2}=C.time;if(o){const o=[],c=$/2;f(r,u).forEach(((e,n)=>{const r="top"===l?Y-c:V+O+c;o.push(t([G+n*N*a,r],{value:0===n?"Admission":String(e),...i,...s}))}));const d=new e.Group(o,{objectCaching:!1,...n});v.value.add(d),v.value.sendToBack(d)}!function(){if((null==J?void 0:J.length)>0){const e=[];J.forEach((n=>{const o=b(n),r=V+O;e.push(t([o,r],{value:String(n.slice(11,16)),...i,originY:"bottom"}))})),v.value.add(...e)}}()}(),function(){var e;const{alertLineList:n=[],alertLineTitle:o=(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.227"))||"入院时宫颈扩张不同情况"}=I;if(n.length<1)return;const r=t([W,0],{value:o,...i,originX:"right",originY:"top"});v.value.add(r),n.forEach((e=>{const{style:i,data:n=[]}=e;if(n.length<1)return;const o=[],r=K.find((e=>"cervix"===e.key));n.map((e=>({...e,time:B+60*e.time*60*1e3}))).forEach(((e,n,l)=>{const s=_(e,r),a=_(l[n+1],r);s&&!a&&o.push(t([s[0],Y-10],{value:l[0].value+(r.unit||"cm"),fill:i.stroke||"#000"})),s&&a&&o.push(Z([...s,...a],i))})),v.value.add(...o)}))}(),U(),{redrawPoints:function(){var e;Q.size&&(null==(e=v.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}([...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"@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=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),f=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=a((()=>{var e;return null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0)})),b=a((()=>{var e;const{width:a}=v.data;return a-((null==(e=f.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))||15)})),y=a((()=>v.data.grid.mainXCell||20)),j=a((()=>v.data.grid.mainYCell||8)),A=a((()=>(b.value-w.value)/y.value)),M=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-X.value)/(j.value+i+(r?1:0))})),S=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 M.value*(l||i?1:0)})),V=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-M.value*t-X.value})),X=a((()=>{const e=g.value.concat(f.value);return(null==e?void 0:e.length)>0?20:0})),C=a((()=>u(v.data.xAxis.time.startTime))),H=a((()=>{const{spaceValue:e,spaceGridNumber:a}=v.data.xAxis.time||{};return 60*e*60*1e3/(A.value*a)})),L=a((()=>{var e,a,t;const l=null==(t=null==(a=null==(e=g.value.concat(f.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=H.value*A.value,v=s(1,y.value+1).reduce(((e,a,t)=>e.concat(C.value+a*d)),[C.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")))})),Y=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return M.value/((null==a?void 0:a.spaceValue)||1)})),N=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),I=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:w.value,endX:b.value,originY:S.value,endY:V.value,xCellWidth:A.value,yCellHeight:M.value,gridXNumber:y.value,gridYNumber:j.value,xAxis:v.data.xAxis,leftScales:g.value,rightScales:f.value,startTime:C.value,timeXCell:H.value,cervixYCell:Y.value,scaleValues:v.data.scaleValues,timeXAxisHeight:X.value,extraTimeXAxisList:L.value,event:N.value});return l((()=>d.value),(e=>{e&&function(){const{redrawPoints:e}=o(d,I,c,h);p.value=e}()}),{immediate:!0}),{propItems:I,redrawPoints:p}}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 o}from"lodash-es";import"../useEvent.js";import"../useCommon.js";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useNewBirthProcess as n}from"./useNewBirthProcess.js";function d(d,v,c,m,h,p){const x=e(),g=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),f=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),j=a((()=>{var e;return null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0)})),w=a((()=>{var e;const{width:a}=v.data;return a-((null==(e=f.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))||15)})),b=a((()=>v.data.grid.mainXCell||20)),y=a((()=>v.data.grid.mainYCell||8)),A=a((()=>(w.value-j.value)/b.value)),M=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-V.value)/(y.value+i+(r?1:0))})),C=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 M.value*(l||i?1:0)})),S=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-M.value*t-V.value})),V=a((()=>{const e=g.value.concat(f.value);return(null==e?void 0:e.length)>0?20:0})),X=a((()=>u(v.data.xAxis.time.startTime))),H=a((()=>{const{spaceValue:e,spaceGridNumber:a}=v.data.xAxis.time||{};return 60*e*60*1e3/(A.value*a)})),L=a((()=>{var e,a,t;const l=null==(t=null==(a=null==(e=g.value.concat(f.value))?void 0:e[0])?void 0:a.data)?void 0:t.map((e=>u(e.time))),i=Math.min(...l);let n=Math.min(Math.max(...l));const d=H.value*A.value,v=s(1,b.value+1).reduce(((e,a,t)=>e.concat(X.value+a*d)),[X.value]);n=Math.min(n,o(v));const c=v.findIndex((e=>Math.abs(e-i)<d)),m=v.findIndex((e=>Math.abs(e-n)<d))+1;return v.filter(((e,a)=>a>=c&&a<=m)).map((e=>r(new Date(e),"yyyy-MM-dd HH:mm:ss")))})),Y=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return M.value/((null==a?void 0:a.spaceValue)||1)})),N=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=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:j.value,endX:w.value,originY:C.value,endY:S.value,xCellWidth:A.value,yCellHeight:M.value,gridXNumber:b.value,gridYNumber:y.value,xAxis:v.data.xAxis,leftScales:g.value,rightScales:f.value,startTime:X.value,timeXCell:H.value,cervixYCell:Y.value,scaleValues:v.data.scaleValues,timeXAxisHeight:V.value,extraTimeXAxisList:L.value,event:N.value});return l((()=>d.value),(e=>{e&&function(){const{redrawPoints:e}=n(d,O,c,h);x.value=e}()}),{immediate:!0}),{propItems:O,redrawPoints:x}}export{d as useNewBirthProcessChart};
@@ -8,7 +8,7 @@ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObje
8
8
  item: any;
9
9
  target: any;
10
10
  }) => void;
11
- moveLimit: (point: IObject) => void;
11
+ moveLimit: (point: IObject, limitRight?: any) => void;
12
12
  setPopup: (point: any, status?: string) => void;
13
13
  updateData: (params: AnyObject, mode?: string, n?: number) => void;
14
14
  getGridPoints: () => IObject[];
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t,drawLine as n,drawPoint as i}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import{bus as r}from"../useEvent.js";import{useCommon as a}from"../useCommon.js";import"vue";import{getPointRange as s,getIndex as f,isEffectiveNode as u,getTime as c}from"../../utils/index.js";import{cloneDeep as p,last as d,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L,P){const{computedX:w,computedY:b,getXValue:A,getYValue:I}=l(h),{xCellWidth:C,pointSelectionStyle:K,originX:E,endX:j,originY:T,endY:X,event:M,scaleValues:V,xAxis:Y,startTime:S,timeXCell:D,itemList:F,dialog:O,topGridOriginY:$,topGridEndY:_}=h,z=new Map,G=new Set,N=p(V);let J=[],q=null;const R=new Set;o(y,h);const{getEqualXTypes:W,handleAddPrevent:B,setPrevAndNextPoint:H,getPointEventProps:Q}=a(y,k,h),{pause:U,resume:Z}=g((()=>{!function(){if(!R.size)return;for(const e of R)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function ee(){N.forEach((e=>{const{range:t=[],spaceValue:i}=e;i&&(t[0]||t[1])&&e.dataList.forEach(((t,i)=>{t.show&&(!function(e,t){const{max:i={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:i,name:o,lineStyle:l}){if(!e||!i)return;const r=b(t.type,t.range,i),a=n([E,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{x.point={...e||{x:a.left,y:a.top}},x.list=[`${o} ${i}${t.unit||""}`],x.show=!0})),a.on("mouseout",(()=>{x.show=!1}))),y.value.add(a)}a(i),a(o),a(l),a(r)}(t,e),oe(t,i,e))}))}))}function te(e=[]){if(!(null==q?void 0:q.areaPos))return[];const{startPos:t,endPos:n}=q.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:de()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ne(e){O.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),ie()},onNegativeClick:()=>ie(),onClose:()=>ie()})}function ie(){q&&y.value.remove(q),q=null}function oe(e,t,o){var l;const{type:r,unit:a,dataList:s=[]}=o,f=[];z.set(e.key,[]),function(e,t){R.size&&[...R].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&R.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let v,g,h=c;l.key&&(h=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:w="",key:b,type:K="circle"}=h,E=pe(c.list[u+1],o);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(g=n([...e,...E],P));const j=f[u-1],T={origin:{data:l,title:w,key:c.key,selfKey:b,unit:a,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:j,rightLine:g,...L,...Q()};e&&(j||(T.leftLine=null),v=i(K,{left:e[0],top:e[1],...T}));f.push(g),v&&(v.originLeft=v.left,v.originTop=v.top,function(e){M.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ce(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),M.hovered&&ue(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,u=~~((a-l)/C);if(a>l+C){if(0===J.length){re(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const c=l+C*u;if(J.every((e=>e.left!==c))){const t=A(c),n=I(f.type,s);J.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:c,top:s}),re(e,[...e.prevPointer,c,s])}if(J.length<u&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+C*l,r=J.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=J.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=J[l-1]||{left:n,top:i},f=~~((r.left-(t-C))/C),u=(r.top-s.top)/f;a.top=s.top+u,a.left=t,a.data={time:A(t),value:I(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},J.splice(l,0,a),re(e,[s.left,s.top,a.left,a.top])}}l++}}(e,u),e.nextPoint){const t=z.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=C/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?le(e,"#999"):le(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(J.length>0&&i<J[J.length-1].left){for(const e of G)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(J=J.filter((e=>e.left<=i)),0===J.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of G)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(J.length>0){const t=d(J);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:I(t,e.top)}};if(y.value.discardActiveObject(),J.length>0){const l=N.find((e=>e.type===t));let r=-1;const a=J.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void se({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...d(a),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ae({...o,data:a,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ae(o,"change")}}))}(v),null==(p=z.get(c.key))||p.push(v))}(pe(l,o),l,u,e)})),Promise.all(z.get(e.key)).then((t=>{const n=f.filter((e=>e));H(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||R.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function le(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function re(e,t){const[,,i,o]=t;e.clone((l=>{l.set({left:i,top:o,scaleX:1,scaleY:1}),e.prevPointer=[i,o];const r=n(t,e.origin.lineAttr);l.leftLine=r,G.add(l),y.value.add(r,l)}))}function ae(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const u=N.find((e=>e.type===r)),c=u.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":c.list.splice(o,n),c.list[o-1]&&(c.list[o-1].breakpoint=!0);break;case"change":c.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=f(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,a>-1?a-t+1:0,...n);break}}se({dataIndex:s,scaleValue:u})}function se(e){var t,n,i;if(G.size&&(null==(t=y.value)||t.remove(...fe([...G]))),G.clear(),J=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...fe(z.get(o.key))),z.delete(o.key),oe(o,t,i)}else z.size&&(null==(i=y.value)||i.remove(...fe(de()))),z.clear(),ee()}function fe(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function ue(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;x.point={x:e.left,y:e.top};const a=A(e.left),s=`${"hover"===t?o.value:I(i,e.top)}`;x.list=[`${n} ${s}${l||""}`,`时间 ${a.slice(-5)}`],x.sourceData=[{type:i,title:n,unit:l,key:r,time:a,value:s}],x.isTarget=!0,x.show=!0}function ce(e){e.setCoords();const t=6e4/D,n=e.prevPoint?e.prevPoint.left+t:E,i=j;e.top<T&&e.set("top",T),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function pe(e,t){if(u(e)&&function(e){const t=Date.parse(d(Y.list)),n=c(e);return n>=S&&n<=t}(e.time)){const n=w(e.time),i=b(t.type,t.range,e.value);return[n,i<T?T:i>X?X:i]}}function de(){return v(Array.from(z.values()))}return ee(),function(){if(!M.evented)return;let n=!1,i={x:0,y:0};y.value.on("mouse:up",(e=>{if(3===e.button&&function(e){x.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=E&&t<=j&&n>=T&&n<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=s(e.target);de().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),F.forEach((n=>{W(de(),t,"key",2*C).includes(n.linkKey||n.key)||L.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===L.list.length&&(L.show=!1,B("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(e),1===e.button&&n){n=!1;const e=te();e.length>0?ne((()=>{const t=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ae(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(e);k("remove",t)})):r.emit(q)}})),y.value.on("mouse:down",(e=>{1!==e.button||e.target||(n=!0,i=e.pointer)})),y.value.on("mouse:move",(o=>{if(function(e){if(!P||L.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;x.movable=!1,(i<E||i>j)&&(x.show=!1);if(!t&&i>=E&&i<=j){const e=o>=T&&o<=X,l=o>=$&&o<=_;if(e||l){const l=A(i);x.sourceData=e?N.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:I(t,o)}})):[{type:"tree",time:l}],x.isTarget=!!t,x.point=n,x.movable=!0}else x.show=!1}}(o),!n)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;q&&y.value.remove(q),q=new e.Rect({...t,fill:"#CAF982",opacity:.4,...K,left:l>a?a:l,top:r>s?s:r,width:Math.abs(a-l),height:Math.abs(s-r),objectCaching:!0}),q.areaPos={startPos:i,endPos:o.pointer},y.value.add(q)}))}(),{redrawPoints:se,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),ae(n,"remove")):(Object.assign(n,{data:{time:A(e.pointer.x),value:I(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),ae({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ce,setPopup:ue,updateData:ae,getGridPoints:de,getContainPoints:te,showDialog:ne,removeCurrentSelection:ie,pauseFlickerPoint:U}}export{y as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t,drawLine as n,drawPoint as i}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as s,isEffectiveNode as u,getTime as c}from"../../utils/index.js";import{cloneDeep as f,filter as d,last as p,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as g}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"./useOther.js";import"../../../../../shared/utils/index.js";import{useIntervalFn as y}from"@vueuse/core";function h(h,x,k,w,L,P){const{computedX:b,computedY:C,getXValue:A,getYValue:j}=l(x),{xCellWidth:I,pointSelectionStyle:E,originX:K,endX:M,originY:X,endY:V,event:Y,scaleValues:T,xAxis:O,startTime:S,timeXCell:D,itemList:F,dialog:$,topGridOriginY:z,topGridEndY:B,extraMenuConfig:G}=x,N=new Map,_=new Set;let J=f(T),q=[],R=null;const W=new Set;o(h,x);const{getEqualXTypes:H,handleAddPrevent:Q,setPrevAndNextPoint:U,getPointEventProps:Z}=r(h,k,x),{pause:ee,resume:te}=y((()=>{!function(){if(!W.size)return;for(const e of W)e.set("opacity",1===e.opacity?.5:1);h.value.renderAll()}()}),800);function ne(){J.forEach((e=>{const{range:t=[],spaceValue:i}=e;i&&(t[0]||t[1])&&e.dataList.forEach(((t,i)=>{t.show&&(!function(e,t){const{max:i={},min:o={}}=e.panicValue||{},{max:l={},min:a={}}=e.diffValue||{};function r({show:e=!1,value:i,name:o,lineStyle:l}){if(!e||!i)return;const a=C(t.type,t.range,i),r=n([K,a,M,a],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});Y.hovered&&o&&(r.on("mousemove",(({pointer:e})=>{w.point={...e||{x:r.left,y:r.top}},w.list=[`${o} ${i}${t.unit||""}`],w.show=!0})),r.on("mouseout",(()=>{w.show=!1}))),h.value.add(r)}r(i),r(o),r(l),r(a)}(t,e),ae(t,i,e))}))}))}function ie(e=[]){if(!(null==R?void 0:R.areaPos))return[];const{startPos:t,endPos:n}=R.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,a]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:ve()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=a))}function oe(e){var t,n,i,o;$.warning({maskClosable:!1,closeOnEsc:!1,title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.228"))||"警告",content:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.229"))||"确认删除当前选中的节点?",positiveText:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.33"))||"确定",negativeText:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.32"))||"取消",onPositiveClick:()=>{e(),le()},onNegativeClick:()=>le(),onClose:()=>le()})}function le(){R&&h.value.remove(R),R=null}function ae(e,t,o){var l;const{type:a,unit:r,dataList:s=[]}=o,u=[];N.set(e.key,[]),function(e,t){W.size&&[...W].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&W.delete(n)}))}(a,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,f){var d;let v,g,y=f;l.key&&(y=s.find((e=>e.key===l.key)));const{pointAttr:x={},lineAttr:L={},title:P="",key:b,type:C="circle"}=y,E=me(f.list[c+1],o);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(g=n([...e,...E],L));const K=u[c-1],M={origin:{data:l,title:P,key:f.key,selfKey:b,unit:r,type:a,dataIndex:t,index:c,lineAttr:L},__type:"main",leftLine:K,rightLine:g,...x,...Z()};e&&(K||(M.leftLine=null),v=i(C,{left:e[0],top:e[1],...M}));u.push(g),v&&(v.originLeft=v.left,v.originTop=v.top,function(e){Y.hovered&&(e.on("mouseover",(()=>{de(e,"hover")})),e.on("mouseout",(()=>{w.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{pe(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),Y.hovered&&de(e),function(e){var t,n,i,o;const{originLeft:l,originTop:a,left:r,top:s,origin:u}=e,c=~~((r-l)/I);if(r>l+I){if(0===q.length){se(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,a],l,a]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const f=l+I*c;if(q.every((e=>e.left!==f))){const t=A(f),n=j(u.type,s);q.push({data:{time:t,value:n,...u.selfKey!==u.key?{key:u.selfKey}:{}},left:f,top:s}),se(e,[...e.prevPointer,f,s])}if(q.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+I*l,a=q.some((e=>Math.abs(e.left-t)<=1));if(!a){let l=0;const a=q.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(a){const r=JSON.parse(JSON.stringify(a)),s=q[l-1]||{left:n,top:i},u=~~((a.left-(t-I))/I),c=(a.top-s.top)/u;r.top=s.top+c,r.left=t,r.data={time:A(t),value:j(o.type,r.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},q.splice(l,0,r),se(e,[s.left,s.top,r.left,r.top])}}l++}}(e,c),e.nextPoint){const t=N.get(u.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=I/2,a=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));a>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[a]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||u.index===e.origin.index||(e.left<r?re(e,"#999"):re(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(q.length>0&&i<q[q.length-1].left){for(const e of _)e.left>i&&(e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e));if(q=q.filter((e=>e.left<=i)),0===q.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of _)e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e)}if(q.length>0){const t=p(q);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(w.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:j(t,e.top)}};if(h.value.discardActiveObject(),q.length>0){const l=J.find((e=>e.type===t));let a=-1;const r=q.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void ce({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;a=t.index;const o=r.findIndex((e=>e.time===n.time));o>-1?r[o].value=n.value:r.push({...p(r),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:r}),ue({...o,data:r,coincideIndex:a})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ue(o,"change")}}))}(v),null==(d=N.get(f.key))||d.push(v))}(me(l,o),l,c,e)})),Promise.all(N.get(e.key)).then((t=>{const n=u.filter((e=>e));U(t),h.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function a({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||W.add(e)}))}a(n,"max"),a(i,"min"),a(o,"max"),a(l,"min")}(t,e)}))}function re(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function se(e,t){const[,,i,o]=t;e.clone((l=>{l.set({left:i,top:o,scaleX:1,scaleY:1}),e.prevPointer=[i,o];const a=n(t,e.origin.lineAttr);l.leftLine=a,_.add(l),h.value.add(a,l)}))}function ue(e,t="add",n=1){const{data:i,index:o,key:l,type:a,coincideIndex:r,linkKey:u}=e;let{dataIndex:c}=e;const f=J.find((e=>e.type===a)),d=f.dataList.find(((e,t)=>{c=t;const n=u||l;return e.key===n}));switch(t){case"remove":d.list.splice(o,n),d.list[o-1]&&(d.list[o-1].breakpoint=!0);break;case"change":d.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=s(e,d.list,!0),n=Array.isArray(i)?i:[i];d.list.splice(t,r>-1?r-t+1:0,...n);break}}ce({dataIndex:c,scaleValue:f})}function ce(e){var t,n,i;if(_.size&&(null==(t=h.value)||t.remove(...fe([..._]))),_.clear(),q=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=h.value)||n.remove(...fe(N.get(o.key))),N.delete(o.key),ae(o,t,i)}else J=f(T),N.size&&(null==(i=h.value)||i.remove(...fe(ve()))),N.clear(),ne()}function fe(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function de(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:a}=e.origin;w.point={x:e.left,y:e.top};const r=A(e.left),s=`${"hover"===t?o.value:j(i,e.top)}`;w.list=[`${n} ${s}${l||""}`,`时间 ${r.slice(-5)}`],w.sourceData=[{type:i,title:n,unit:l,key:a,time:r,value:s}],w.isTarget=!0,w.show=!0}function pe(e,t=M){e.setCoords();const n=6e4/D,i=e.prevPoint?e.prevPoint.left+n:K;e.top<X&&e.set("top",X),e.top>V&&e.set("top",V),e.left<i&&e.set("left",i),e.left>t&&e.set("left",t)}function me(e,t){if(u(e)&&function(e){const t=Date.parse(p(O.list)),n=c(e);return n>=S&&n<=t}(e.time)){const n=b(e.time),i=C(t.type,t.range,e.value);return[n,i<X?X:i>V?V:i]}}function ve(){return v(Array.from(N.values()))}return ne(),function(){if(!Y.evented)return;let n=!1,i={x:0,y:0};h.value.on("mouse:up",(e=>{if(3===e.button&&function(e){w.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=M&&n>=X&&n<=V)if(e.target){if("main"!==e.target.__type)return;const t=e.target;i({x:t.left,y:t.top},e.target,[]),L.list=d(g,(e=>"edit"!==e.type)).map((e=>({...e,renderItem:()=>e.label,type:e.key||e.type,pointer:{x:t.left,y:t.top},..."add"===e.type?{}:{origin:{...t.origin}}})))}else{i(e.pointer,null,[]);const{menuList:t=[]}=G;L.list=d(g,(e=>"add"===e.type)).concat(t).map((t=>({...t,renderItem:()=>t.label,type:t.key||t.type,pointer:e.pointer})))}function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(e),1===e.button&&n){n=!1;const e=ie();e.length>0?oe((()=>{const t=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ue(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(e);k("remove",t)})):a.emit(R)}})),h.value.on("mouse:down",(e=>{1!==e.button||e.target||(n=!0,i=e.pointer)})),h.value.on("mouse:move",(o=>{if(function(e){if(!P||L.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;w.movable=!1,(i<K||i>M)&&(w.show=!1);if(!t&&i>=K&&i<=M){const e=o>=X&&o<=V,l=o>=z&&o<=B;if(e||l){const l=A(i);w.sourceData=e?J.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:j(t,o)}})):[{type:"tree",time:l}],w.isTarget=!!t,w.point=n,w.movable=!0}else w.show=!1}}(o),!n)return;const{x:l,y:a}=i,{x:r,y:s}=o.pointer;R&&h.value.remove(R),R=new e.Rect({...t,fill:"#CAF982",opacity:.4,...E,left:l>r?r:l,top:a>s?s:a,width:Math.abs(r-l),height:Math.abs(s-a),objectCaching:!0}),R.areaPos={startPos:i,endPos:o.pointer},h.value.add(R)}))}(),{redrawPoints:ce,clickMenu:function({item:e,target:t}){var n;const{type:i,origin:o,pointer:l}=e,a={...o};o||Object.assign(a,{data:{time:A(l.x)},type:null}),d(g,(e=>"edit"!==e.type)).map((e=>e.type)).includes(i)?("remove"===i&&ue(a,"remove"),k(i,a)):null==(n=G.click)||n.call(G,i,a)},moveLimit:pe,setPopup:de,updateData:ue,getGridPoints:ve,getContainPoints:ie,showDialog:oe,removeCurrentSelection:le,pauseFlickerPoint:ee}}export{h as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as c,last as p}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function f(f,h,m,g,v,y,k,w){const{getYValue:j,getXValue:x}=s(h),{getEqualXTypes:b,handleAddPrevent:X,isGridLimit:W}=u(f,m,h),{originY:C,endY:E,borderStyle:S,left:Y,itemList:K,scaleValues:L,originX:M,endX:N,yCellHeight:V,markHeight:G,canvasWidth:H,canvasHeight:T,xCellWidth:A}=h;!function(){if(!Y)return;const{title:t,titleWidth:i,titleStyle:o}=Y,n=e({width:i,height:E-C+G,...S},{value:t.split("").join("\n"),...o||{}},{left:0,top:C},!0);f.value.add(n)}(),L.forEach(((e,i)=>{var o,s;const{range:u,spaceValue:c,title:h,unit:m,titleStyle:g,spaceGridNumber:v=1,showNumber:y,showMaxMinNumber:k,titleMargin:w=[5,30],margin:j=5}=e,x="left"===e.layout?M-j:N+j,b=[],X=d(u,c),W=X.length;X.forEach(((t,i)=>{const o=0===i?E-5:E-i*V*v;!y||(0===i||i===W-1)&&!k||b.push(a(String(t),{...e,position:e.layout},x,o))}));const C="left"===e.layout?"right":"left",S=(h||m)&&n(["left"===e.layout?M-w[0]:N+w[0],(null!=(s=null==(o=p(b))?void 0:o.top)?s:330)-V-w[1]],{value:`${h}${m?"\n"+m:""}`,...r,...g,textAlign:C,originX:C,originY:"bottom"}),Y=new t.Group([...b,...S?[S]:[]],{objectCaching:!1,...l});f.value.add(Y),Y.sendToBack()})),function(){const e=new t.Rect({width:M-Y.titleWidth,height:E-C+G,left:Y.titleWidth,top:C,...i,originX:"left",originY:"top",...S});f.value.add(e);const n=c(K),r=c(Y.externalIconList||[]).map((t=>({...t,isExternal:!0}))),{projectNameMargin:l=[5,30],titleWidth:s=20}=Y;let a=E+G-l[0];const u=s+l[1];r.concat(n.reverse()).forEach((t=>{a-=10;const e=t.title,{text:i,icon:n}=o(e,t,{text:{left:u,top:a},icon:{leftX:u,topY:a,originX:"center",...t.isExternal?{evented:!1,selectable:!1}:{},origin:{linkKey:t.linkKey}}});var r;a-=i.height||30,n.set("left",n.left+n.width/2),(r=n).on("moving",(()=>{r.set("originX","center"),W(r)?(v(r),y(r)):g.show=!1})),r.on("mouseup:before",(t=>{if(g.show=!1,0===t.e.button&&W(r)){const t=r.origin.linkKey||r.origin.key;if(b(w(),r.left,"key",2*A).includes(t))X("repeat");else{const e={data:{time:x(r.left),value:j(r.origin.type,r.top),...r.origin.linkKey?{key:r.origin.key}:{}},...r.origin};m("add",e),k({...e,key:t})}}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(r)})),f.value.add(i,n)}))}(),f.value.add(new t.Rect({left:0,top:0,width:H-S.strokeWidth,height:T-S.strokeWidth,fill:"transparent",...S}))}export{f as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as i,defaultRectStyle as e,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{isEffectiveNode as d,getScaleNumberList as g}from"../../utils/index.js";import{cloneDeep as h,omit as m,last as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"./useOther.js";import"../../../../../shared/utils/index.js";function f(f,p,y,k,v,j,x,w){const{getYValue:E,getXValue:X,computedX:b}=s(p),{getEqualXTypes:K,handleAddPrevent:R,isGridLimit:W}=u(f,y,p),{originY:C,endY:S,borderStyle:Y,left:L,itemList:M,scaleValues:N,originX:P,endX:T,yCellHeight:V,markHeight:G,canvasWidth:H,canvasHeight:A,xCellWidth:$}=p;!function(){if(!L)return;const{title:t,titleWidth:e,titleStyle:o}=L,n=i({width:e,height:S-C+G,...Y},{value:t.split("").join("\n"),...o||{}},{left:0,top:C},!0);f.value.add(n)}(),N.forEach(((i,e)=>{var o,s;const{range:u,spaceValue:d,title:h,unit:m,titleStyle:p,spaceGridNumber:y=1,showNumber:k,showMaxMinNumber:v,titleMargin:j=[5,30],margin:x=5}=i,w="left"===i.layout?P-x:T+x,E=[],X=g(u,d),b=X.length;X.forEach(((t,e)=>{const o=0===e?S-5:S-e*V*y;!k||(0===e||e===b-1)&&!v||E.push(a(String(t),{...i,position:i.layout},w,o))}));const K="left"===i.layout?"right":"left",R=(h||m)&&n(["left"===i.layout?P-j[0]:T+j[0],(null!=(s=null==(o=c(E))?void 0:o.top)?s:330)-V-j[1]],{value:`${h}${m?"\n"+m:""}`,...r,...p,textAlign:K,originX:K,originY:"bottom"}),W=new t.Group([...E,...R?[R]:[]],{objectCaching:!1,...l});f.value.add(W),W.sendToBack()})),function(){const i=new t.Rect({width:P-L.titleWidth,height:S-C+G,left:L.titleWidth,top:C,...e,originX:"left",originY:"top",...Y});f.value.add(i);const n=h(M);n.forEach((t=>{var i;const e=t.linkKey?null==(i=n.find((i=>i.key===t.linkKey)))?void 0:i.list:t.list;let o=P;e.find((t=>{let i=!1;if(d(t)){const e=b(t.time);i=e>=P&&e<=T,i&&(o=e)}return i})),t.limitRight=o-$}));const r=h(L.externalIconList||[]).map((t=>({...t,isExternal:!0}))),{projectNameMargin:l=[5,30],titleWidth:s=20}=L;let a=S+G-l[0];const u=s+l[1],g=[];r.concat(n.reverse()).forEach((t=>{a-=10;const i=t.title,{text:e,icon:n}=o(i,t,{text:{left:u,top:a},icon:{leftX:u,topY:a,originX:"center",...t.isExternal?{evented:!1,selectable:!1}:{},origin:{linkKey:t.linkKey,limitRight:t.limitRight}}});var r;a-=e.height||30,n.set("left",n.left+n.width/2),(r=n).on("moving",(()=>{r.set("originX","center"),W(r)?(v(r,r.origin.limitRight),j(r)):k.show=!1})),r.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&W(r)){v(r,r.origin.limitRight);const t=r.origin.linkKey||r.origin.key;if(K(w(),r.left,"key",$).includes(t))R("repeat");else{const i={data:{time:X(r.left),value:E(r.origin.type,r.top),...r.origin.linkKey?{key:r.origin.key}:{}},...r.origin},e=r.left-$;r.linkPoints.forEach((t=>{t.origin.limitRight=e})),y("add",m(i,["limitRight"])),x({...i,key:t})}}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(r)})),!t.isExternal&&g.push(n),f.value.add(e,n)})),g.forEach((t=>{const{linkKey:i,key:e}=t.origin,o=g.filter((t=>i?t.origin.key===i||t.origin.linkKey===i:t.origin.key===e||t.origin.linkKey===e));t.linkPoints=o}))}(),f.value.add(new t.Rect({left:0,top:0,width:H-Y.strokeWidth,height:A-Y.strokeWidth,fill:"transparent",...Y}))}export{f as useLeft};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as d}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function c(c,u,f,h,m,g,p,v,x){const{computedX:k,getXValue:y}=o(u),{getEqualXTypes:X,handleAddPrevent:P,isGridLimit:b,getPointEventProps:w}=r(c,f,u),{other:E,yCellHeight:j,xCellWidth:z,endX:A,originX:C,originY:L,endY:M,markHeight:S,event:T,topGridYCellHeight:I}=u,H=new Map,Y=l(E);function W(){var o;if(!(null==(o=null==Y?void 0:Y.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=Y;let a=L+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:d={},textStyle:c={},data:u}=o;let f=null;u.forEach(((o,u)=>{const{time:h,value:m}=o,g=k(h);if(!$(g))return;const p=e(s,{...d,left:g,top:a}),v=g+p.width/2+2,x=i([v,a],{value:m,...c,originX:"left"}),y=new t.Group([p,x],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...w()});Object.assign(y,{originLeft:g,iconHalfWidth:p.width/2,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:C,x2:A-y.width}}),f&&(y.limitX.x1=f.left,f.limitX.x2=y.left,y.prevPoint=f,f.nextPoint=y),f=y,q(y),H.get(n).push(y)})),a+=j})),c.value.add(...H.get(n))}function V(){var t;if(!(null==(t=null==Y?void 0:Y.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=Y;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,d=k(s);if(!n||!$(d))return;const{lineHeight:c=j}=a;let u=L+r+c/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:d,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...w()});u+=c,q(r),H.get(i).push(r)}));const f=H.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),m=d>A-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),c.value.add(...H.get(i))}function G(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=Y[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}O(t)}function O(t){var e;const{key:i}=t;switch(null==(e=c.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":W();break;case"vertical":V();break;case"mark":D()}}function D(){if(!(null==E?void 0:E.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=E.mark,a=i([C-5,M+S/2],{value:t,...o,originX:"right"});c.value.add(a);const l=M+S,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=k(i);if(!$(r))return;let a=M;o.forEach((t=>{const{style:i}=t;let o=!1;const d=e((null==i?void 0:i.type)||"circleAndText",{...(null==i?void 0:i.pointAttr)||n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),u=d.height;a+u<=l&&a>=M?(d.set("top",a+u/2),a+=u):(o||(a=M,o=!0),d.set("top",a-u/2),a-=u),s.push(d),q(d),c.value.add(d)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:A};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function q(t){if(T.hovered&&(t.on("mouseover",(()=>{B(t)})),t.on("mouseout",(()=>{h.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<L&&t.set("top",L);const e=M+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(g(t),function(t){const e=t.left+t.maxTextWidth>A?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),T.hovered&&B(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=y(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};c.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(m.point={x:t.left,y:t.top},m.show=!0,m.target=t,m.list=d.map((t=>({...t,renderItem:()=>t.label}))))}))}function B(t){const{key:e,data:i={}}=t.origin||{};let o=i.value;h.point={x:t.left,y:"mark"===e?t.top:t.top+I/2};const n=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,r=y(n);h.list=[`时间 ${r.slice(-5)}`],"mark"===e&&(o=i.name,h.list.unshift(o+" ")),h.sourceData=[{type:"other",key:e,time:r,value:o}],h.isTarget=!0,h.show=!0}function $(t){return t>=C&&t<=A}return function(){var t;if(!(null==(t=null==Y?void 0:Y.horizontal)?void 0:t.length))return;const{horizontal:i}=Y,o=C-5;let n=L+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var d;(d=s).on("moving",(()=>{d.set("originX","center"),b(d)?B(d):h.show=!1})),d.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&b(d))if(X(H.get("horizontal"),d.left,"key",z).includes(d.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:y(d.left),value:d.origin.defaultAddValue},...d.origin};f("add",t),G(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(d)})),c.value.add(s),n+=j}))}(),W(),V(),D(),n.on((()=>{const t="horizontal",e=p(H.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return Y.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);O({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&G(o,i)}}}export{c as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o}from"../useDraw.js";import{useBirthProcessCumputedPoint as n}from"../useCumputedPoint.js";import{bus as r}from"../useEvent.js";import{useCommon as l}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{filter as s,cloneDeep as d,omit as c,flatten as u}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as f}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const h=s(f,(t=>"add"!==t.type));function m(s,f,m,g,p,v,x,y,k){const{computedX:X,getXValue:P}=n(f),{getEqualXTypes:w,handleAddPrevent:b,isGridLimit:j,getPointEventProps:E}=l(s,m,f),{other:z,yCellHeight:A,xCellWidth:L,endX:C,originX:M,originY:T,endY:I,markHeight:S,event:H,topGridYCellHeight:Y}=f,W=new Map,V=d(z);function G(){var o;if(!(null==(o=null==V?void 0:V.horizontal)?void 0:o.length))return;const n="horizontal";W.set(n,[]);const{horizontal:r}=V;let l=T+A/2;r.forEach(((o,r)=>{const{title:a,type:s,pointAttr:d={},textStyle:c={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:m,value:g}=o,p=X(m);if(!F(p))return;const v=[],x=f&&e(s,{...d,left:p,top:l});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,l],{value:g,...c,originX:"left"});v.push(k);const P=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...E()});Object.assign(P,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:a},limitX:{x1:M,x2:C-P.width}}),h&&(P.limitX.x1=h.left,h.limitX.x2=P.left,P.prevPoint=h,h.nextPoint=P),h=P,B(P),W.get(n).push(P)})),l+=A})),s.value.add(...W.get(n))}function O(){var t;if(!(null==(t=null==V?void 0:V.vertical)?void 0:t.length))return;const i="vertical";W.set(i,[]);const{vertical:o}=V;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:l={},data:a,time:s}=t,d=X(s);if(!n||!F(d))return;const{lineHeight:c=A}=l;let u=T+r+c/2;a.forEach(((t,n)=>{const r=e(String(t),{...l,lockMovementY:!0,left:d,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...E()});u+=c,B(r),W.get(i).push(r)}));const f=W.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),m=d>C-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),s.value.add(...W.get(i))}function D(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=V[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}_(t)}function _(t){var e;const{key:i}=t;switch(null==(e=s.value)||e.remove(...W.get(i)),W.delete(i),i){case"horizontal":G();break;case"vertical":O();break;case"mark":q()}}function q(){if(!(null==z?void 0:z.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=z.mark,l=i([M-5,I+S/2],{value:t,...o,originX:"right"});s.value.add(l);const a=I+S,d=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=X(i);if(!F(r))return;let l=I;o.forEach((t=>{const{style:i}=t;let o=!1;const c=e((null==i?void 0:i.type)||"circleAndText",{...(null==i?void 0:i.pointAttr)||n,text:t.text,left:r,top:l,origin:{data:t,key:"mark",type:"other"}}),u=c.height;l+u<=a&&l>=I?(c.set("top",l+u/2),l+=u):(o||(l=I,o=!0),c.set("top",l-u/2),l-=u),d.push(c),B(c),s.value.add(c)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:M,x2:C};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(d)}function B(t){if(H.hovered&&(t.on("mouseover",(()=>{$(t)})),t.on("mouseout",(()=>{g.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<T&&t.set("top",T);const e=I+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(v(t),function(t){const e=t.left+t.maxTextWidth>C?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),H.hovered&&$(t)})),t.on("mouseup",(n=>{var r;if(g.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=P(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};s.value.discardActiveObject(),m("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(p.point={x:t.left,y:t.top},p.show=!0,p.target=t,p.list=h.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function $(t){g.isTarget=!0,g.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;g.point={x:t.left,y:"mark"===e?t.top:t.top+Y/2};const n=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,r=P(n);g.list=[`时间 ${r.slice(-5)}`],"mark"===e&&(o=i.name,g.list.unshift(o+" ")),g.sourceData=[{type:"other",key:e,time:r,value:o}]}function F(t){return t>=M&&t<=C}return function(){if(!(null==z?void 0:z.longLine)||!z.longLine.time)return;const{time:t,style:e}=z.longLine,i=X(t),n=o([i,0,i,I],e);s.value.add(n)}(),function(){var t;if(!(null==(t=null==V?void 0:V.horizontal)?void 0:t.length))return;const{horizontal:i}=V,o=M-5;let n=T+A/2;i.forEach(((t,i)=>{const{title:r,titleStyle:l={},defaultAddValue:a}=t,d=r&&e(r,{...l,originX:"right",left:o,top:n,origin:{defaultAddValue:a,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;(u=d).on("moving",(()=>{u.set("originX","center"),j(u)?$(u):g.show=!1})),u.on("mouseup:before",(t=>{if(g.show=!1,0===t.e.button&&j(u))if(w(W.get("horizontal"),u.left,"key",L).includes(u.origin.key))b("repeat"),console.log("重复节点");else{const t={data:{time:P(u.left),value:u.origin.defaultAddValue},...u.origin};m("add",c(t,["isMenu"])),D(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),s.value.add(d),n+=A}))}(),G(),O(),q(),r.on((()=>{const t="horizontal",e=x(W.get(t));e.length>0?y((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return u(Object.keys(e).map((t=>{const i=e[t];return V.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);_({key:t}),m("remove",i)})):k()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};m(i,n),"remove"===i&&D(n,i)}}}export{m as useOther};
@@ -11,5 +11,6 @@ export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, p
11
11
  useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
12
12
  useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
13
  useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
+ redrawLinePoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
15
  propItems: any;
15
16
  };
@@ -1 +1 @@
1
- import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as l,watch as n,toRefs as u}from"vue";import{useDialog as s}from"naive-ui";import{defaultBorderStyle as d}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as c}from"date-fns";import{getChildrenSize as p}from"../../utils/index.js";import{cloneDeep as m,range as v,flatten as h}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as f}from"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as g}from"./useTop.js";import{useLeft as w}from"./useLeft.js";import{useCenter as y}from"./useCenter.js";import{useOther as b}from"./useOther.js";function x(x,j,C,Y,H,S,T){var D;const M=s(),k=e({redrawPoints:null,clickMenu:null}),A=t();let P=null;const X=p((null==(D=j.data.top)?void 0:D.treeData)||[]),G=a((()=>j.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),N=a((()=>{var e;return null!=(e=j.data.left.width)?e:0})),V=a((()=>{const{grid:e}=j.data;return e.mainXCell*e.subXCell})),L=a((()=>{const{grid:e}=j.data;return e.mainYCell*e.subYCell})),O=a((()=>{const{show:e=!0,tree:t={}}=j.data.top;if(!e)return 0;const{rowNumber:a=X}=t;return X<a?a:X})),E=a((()=>j.data.top.tree.cellHeight)),W=a((()=>E.value*O.value)),I=a((()=>ne(oe("drug")||"top"))),F=a((()=>I.value+W.value)),q=a((()=>{var e;return Date.parse((null==(e=j.data.xAxis)?void 0:e.startTime)||c(new Date,"yyyy-MM-dd HH:mm:ss"))})),z=a((()=>{const e=m(j.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=v(V.value/t+1).map((r=>0===r?e.startTime:c(new Date(q.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:N.value}})),B=function(){const{show:e=!0,tree:t={}}=j.data.top;if(!e)return[];const a=m(j.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=j.data.top.tree,{rowNumber:l=X}=t;X<l&&a.push(...v(l-X).map((()=>({}))));return function e(t,a=0){t.forEach((t=>{var l;const n={top:r*o+I.value,left:a*i,width:i,height:o};if(r++,null==(l=t.children)?void 0:l.length){r--;const i=p(t.children);n.height=i*o,e(t.children,a+1)}else n.width=N.value-n.left;Object.assign(t,n)}))}(a),a}(),J=a((()=>ne(oe("xAxis")||"center"))),K=a((()=>{var e;const{width:t,right:a}=j.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),Q=a((()=>ne(oe("intraoperatively")||"bottom"))),R=a((()=>{var e;const{show:t,height:a}=(null==(e=j.data.other)?void 0:e.mark)||{};return t&&a?a:0})),U=a((()=>Q.value+(j.data.height-W.value-z.value.height-R.value))),Z=a((()=>(K.value-N.value)/V.value)),$=a((()=>(U.value-Q.value)/L.value)),_=a((()=>z.value.spaceTimeStamp/Z.value)),ee=a((()=>{const{scaleValues:e}=j.data;return h(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),te=a((()=>ue("pulse"))),ae=a((()=>ue("temperature"))),re=a((()=>{var e;return(null==(e=j.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),ie=e({canvasWidth:j.data.width,canvasHeight:j.data.height,borderStyle:{...d,...j.data.borderStyle},pointSelectionStyle:j.data.pointSelectionStyle||{},grid:j.data.grid,top:j.data.top,left:j.data.left,other:j.data.other,topGridYNumber:r(O),topGridYCellHeight:r(E),topGridOriginY:r(I),topGridEndY:r(F),treeData:B,xAxis:r(z),originYXAxis:r(J),startTime:r(q),timeXCell:r(_),gridXNumber:r(V),gridYNumber:r(L),xCellWidth:r(Z),yCellHeight:r($),originX:r(N),endX:r(K),originY:r(Q),endY:r(U),markHeight:r(R),itemList:r(ee),scaleValues:j.data.scaleValues,pulseYCell:r(te),temperatureYCell:r(ae),event:r(re),dialog:M});function oe(e){let t="";return Object.entries(G.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function le(e){const t=G.value[e],a=z.value.height;switch(t){case"drug":return W.value;case"xAxis":return a;default:return j.data.height-W.value-a}}function ne(e){switch(e){case"top":return 0;case"center":return le("top");default:return le("top")+le("center")}}function ue(e){const{scaleValues:t}=j.data,a=t.find((t=>t.type===e));return $.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o(),g(x,ie,C,H);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:n,showDialog:u,removeCurrentSelection:s,pauseFlickerPoint:d}=y(x,ie,C,H,S,T);A.value=d,w(x,ie,C,H,a,r,i,l);const{clickMenu:c}=b(x,ie,C,H,S,a,n,u,s);k.redrawPoints=e,k.clickMenu=e=>{const{item:a}=e;a.type&&f.map((e=>e.type)).includes(a.type)?c(e):t(e)}})),l((()=>{A.value()})),T&&n((()=>null==H?void 0:H.point),(()=>{H.movable?(H.show=!0,P&&clearTimeout(P),P=setTimeout((()=>{H.show=!1,H.movable=!1}),3e3)):P&&clearTimeout(P)}),{deep:!0}),{propItems:ie,...u(k)}}export{x as useSurgicalAnesthesiaChart};
1
+ import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as n,watch as l,toRefs as u}from"vue";import{useDialog as s}from"naive-ui";import{defaultBorderStyle as d}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as c}from"date-fns";import{getChildrenSize as m}from"../../utils/index.js";import{cloneDeep as p,range as h,flatten as v}from"lodash-es";import"../useEvent.js";import"../useCommon.js";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as f}from"./useTop.js";import{useLeft as g}from"./useLeft.js";import{useCenter as w}from"./useCenter.js";import{useOther as x}from"./useOther.js";import{uuidGenerator as b}from"../../../../../shared/utils/index.js";function y(y,C,j,Y,M,T,k){var D;const H=s(),P=e({redrawPoints:null,clickMenu:null,redrawLinePoints:null}),S=t();let A=null;const L=m((null==(D=C.data.top)?void 0:D.treeData)||[]),X=a((()=>C.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),G=a((()=>{var e;return null!=(e=C.data.left.width)?e:0})),N=a((()=>{const{grid:e}=C.data;return e.mainXCell*e.subXCell})),V=a((()=>{const{grid:e}=C.data;return e.mainYCell*e.subYCell})),O=a((()=>{const{show:e=!0,tree:t={}}=C.data.top;if(!e)return 0;const{rowNumber:a=L}=t;return L<a?a:L})),E=a((()=>C.data.top.tree.cellHeight)),W=a((()=>E.value*O.value)),I=a((()=>le(oe("drug")||"top"))),F=a((()=>I.value+W.value)),_=a((()=>{var e;return Date.parse((null==(e=C.data.xAxis)?void 0:e.startTime)||c(new Date,"yyyy-MM-dd HH:mm:ss"))})),q=a((()=>{const e=p(C.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=h(N.value/t+1).map((r=>0===r?e.startTime:c(new Date(_.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:G.value}})),z=ue(),B=a((()=>le(oe("xAxis")||"center"))),J=a((()=>{var e;const{width:t,right:a}=C.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),K=a((()=>le(oe("intraoperatively")||"bottom"))),Q=a((()=>{var e;const{show:t,height:a}=(null==(e=C.data.other)?void 0:e.mark)||{};return t&&a?a:0})),R=a((()=>K.value+(C.data.height-W.value-q.value.height-Q.value))),U=a((()=>(J.value-G.value)/N.value)),Z=a((()=>(R.value-K.value)/V.value)),$=a((()=>q.value.spaceTimeStamp/U.value)),ee=a((()=>{const{scaleValues:e}=C.data;return v(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),te=a((()=>se("pulse"))),ae=a((()=>se("temperature"))),re=a((()=>{var e;return(null==(e=C.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),ie=e({canvasWidth:C.data.width,canvasHeight:C.data.height,borderStyle:{...d,...C.data.borderStyle},pointSelectionStyle:C.data.pointSelectionStyle||{},grid:C.data.grid,top:C.data.top,left:C.data.left,other:C.data.other,topGridYNumber:r(O),topGridYCellHeight:r(E),topGridOriginY:r(I),topGridEndY:r(F),treeData:z,getTreeData:ue,xAxis:r(q),originYXAxis:r(B),startTime:r(_),timeXCell:r($),gridXNumber:r(N),gridYNumber:r(V),xCellWidth:r(U),yCellHeight:r(Z),originX:r(G),endX:r(J),originY:r(K),endY:r(R),markHeight:r(Q),itemList:r(ee),scaleValues:C.data.scaleValues,pulseYCell:r(te),temperatureYCell:r(ae),event:r(re),dialog:H,extraMenuConfig:C.data.extraMenuConfig||{}});function oe(e){let t="";return Object.entries(X.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ne(e){const t=X.value[e],a=q.value.height;switch(t){case"drug":return W.value;case"xAxis":return a;default:return C.data.height-W.value-a}}function le(e){switch(e){case"top":return 0;case"center":return ne("top");default:return ne("top")+ne("center")}}function ue(){const{show:e=!0,tree:t={}}=C.data.top;if(!e)return[];const a=p(C.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=C.data.top.tree,{rowNumber:n=L}=t;return L<n&&a.push(...h(n-L).map((()=>({})))),function e(t,a=0){t.forEach((t=>{var n;const l={top:r*o+I.value,left:a*i,width:i,height:o,uuid:b()};if(r++,null==(n=t.children)?void 0:n.length){r--;const i=m(t.children);l.height=i*o,e(t.children,a+1)}else l.width=G.value-l.left;Object.assign(t,l)}))}(a),a}function se(e){const{scaleValues:t}=C.data,a=t.find((t=>t.type===e));return Z.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o();const{redrawLinePoints:e,clickMenu:t}=f(y,ie,j,M,T),{redrawPoints:a,clickMenu:r,moveLimit:i,setPopup:n,updateData:l,getGridPoints:u,getContainPoints:s,showDialog:d,removeCurrentSelection:c,pauseFlickerPoint:m}=w(y,ie,j,M,T,k);S.value=m,g(y,ie,j,M,i,n,l,u);const{clickMenu:p}=x(y,ie,j,M,T,i,s,d,c);P.redrawPoints=a,P.redrawLinePoints=e,P.clickMenu=e=>{const{item:a}=e;switch(a._type){case"tree":t(e);break;case"other":p(e);break;default:r(e)}}})),n((()=>{S.value()})),k&&l((()=>null==M?void 0:M.point),(()=>{M.movable?(M.show=!0,A&&clearTimeout(A),A=setTimeout((()=>{M.show=!1,M.movable=!1}),3e3)):A&&clearTimeout(A)}),{deep:!0}),{propItems:ie,...u(P)}}export{y as useSurgicalAnesthesiaChart};
@@ -2,4 +2,10 @@ import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
4
  import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
- export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): void;
5
+ export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ redrawLinePoints: () => void;
7
+ clickMenu: ({ item, target }: {
8
+ item: AnyObject;
9
+ target: any;
10
+ }) => void;
11
+ };