cnhis-design-vue 3.2.14-beta.2 → 3.2.14-beta.24

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 (233) hide show
  1. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  2. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  3. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  4. package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
  5. package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -1
  6. package/es/components/audio-sdk/src/components/recording.vue2.js +1 -1
  7. package/es/components/big-table/src/BigTable.vue2.js +1 -1
  8. package/es/components/big-table/src/components/edit-form/edit-date.js +1 -1
  9. package/es/components/big-table/src/components/edit-form/edit-select.js +1 -1
  10. package/es/components/big-table/src/components/edit-form/edit-time.js +1 -1
  11. package/es/components/big-table/src/components/input-button.vue2.js +1 -1
  12. package/es/components/big-table/src/hooks/useTableParse.js +1 -1
  13. package/es/components/button-print/index.d.ts +4 -0
  14. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
  15. package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
  16. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  17. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  18. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  19. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  20. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  21. package/es/components/classification/src/index.vue2.js +1 -1
  22. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
  23. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
  24. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  25. package/es/components/expand-field/src/index.vue2.js +1 -1
  26. package/es/components/expand-field/src/utils/constant.js +1 -1
  27. package/es/components/fabric-chart/index.d.ts +19 -2
  28. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +19 -2
  29. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  30. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  31. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +13 -0
  32. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  33. package/es/components/fabric-chart/src/components/useStyle.js +1 -1
  34. package/es/components/fabric-chart/src/constants/index.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +1 -0
  37. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  38. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  39. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +1 -0
  41. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  45. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  46. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  47. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  48. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -0
  49. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  50. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +7 -1
  51. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  52. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  53. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  54. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  55. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  56. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +1 -0
  57. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  58. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  59. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  60. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  61. package/es/components/fabric-chart/src/interface.d.ts +2 -0
  62. package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
  63. package/es/components/fabric-chart/src/utils/index.js +1 -1
  64. package/es/components/field-set/src/FieldColor.vue.d.ts +3 -3
  65. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  66. package/es/components/field-set/src/FieldFilter.vue.d.ts +5 -4
  67. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  68. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
  69. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  70. package/es/components/field-set/src/Index.vue2.js +1 -1
  71. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  72. package/es/components/field-set/src/components/condition.vue2.js +1 -1
  73. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
  74. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
  75. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
  76. package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
  77. package/es/components/field-set/src/components/table-row.vue2.js +1 -1
  78. package/es/components/field-set/src/constants/filter.d.ts +21 -12
  79. package/es/components/field-set/src/constants/filter.js +1 -1
  80. package/es/components/field-set/src/constants/index.js +1 -1
  81. package/es/components/field-set/src/types/index.d.ts +1 -1
  82. package/es/components/form-config/index.d.ts +7 -5
  83. package/es/components/form-config/index.js +1 -1
  84. package/es/components/form-config/src/FormConfig.vue.d.ts +7 -5
  85. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  86. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +2 -0
  87. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  88. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +2 -2
  89. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  90. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  91. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  92. package/es/components/form-config/src/constants/index.d.ts +1 -11
  93. package/es/components/form-config/src/constants/index.js +1 -1
  94. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  95. package/es/components/form-config/src/hooks/useLocale.d.ts +52 -0
  96. package/es/components/form-config/src/hooks/useLocale.js +1 -0
  97. package/es/components/form-render/index.js +1 -1
  98. package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
  99. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
  100. package/es/components/form-render/src/components/renderer/combination/tableCombination.js +1 -1
  101. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  102. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  103. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  104. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  105. package/es/components/form-render/src/hooks/usePresetScope.d.ts +1 -1
  106. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  107. package/es/components/form-render/src/utils/index.d.ts +1 -0
  108. package/es/components/form-render/src/utils/index.js +1 -1
  109. package/es/components/iho-chat/index.d.ts +612 -52
  110. package/es/components/iho-chat/src/Index.vue.d.ts +615 -59
  111. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  112. package/es/components/iho-chat/src/api/index.d.ts +1 -0
  113. package/es/components/iho-chat/src/api/index.js +1 -1
  114. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +32 -1
  115. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  116. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +52 -3
  117. package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
  118. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +52 -2
  119. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  120. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +221 -11
  121. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  122. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +82 -6
  123. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  124. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +19 -1
  125. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  126. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +20 -2
  127. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  128. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +71 -4
  129. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  130. package/es/components/iho-chat/src/components/ContextMenu.d.ts +11 -2
  131. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  132. package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
  133. package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
  134. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +51 -2
  135. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  136. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +19 -1
  137. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  138. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +66 -1
  139. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  140. package/es/components/iho-chat/src/components/Video.vue.d.ts +19 -1
  141. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  142. package/es/components/iho-chat/src/constants/index.d.ts +13 -3
  143. package/es/components/iho-chat/src/constants/index.js +1 -1
  144. package/es/components/iho-chat/src/hooks/index.d.ts +2 -2
  145. package/es/components/iho-chat/src/hooks/index.js +1 -1
  146. package/es/components/iho-chat/src/hooks/useData.d.ts +94 -0
  147. package/es/components/iho-chat/src/hooks/useData.js +1 -0
  148. package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
  149. package/es/components/iho-chat/src/hooks/useVideo.d.ts +19 -1
  150. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  151. package/es/components/iho-chat/src/hooks/useWebSocket.d.ts +3 -0
  152. package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -0
  153. package/es/components/iho-chat/src/types/index.d.ts +0 -6
  154. package/es/components/iho-chat/src/types/index.js +1 -1
  155. package/es/components/iho-chat/src/utils/index.d.ts +1 -0
  156. package/es/components/iho-chat/src/utils/index.js +1 -1
  157. package/es/components/iho-chat/style/index.css +1 -1
  158. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  159. package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
  160. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  161. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  162. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
  163. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  164. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  165. package/es/components/iho-table/src/utils/index.js +1 -1
  166. package/es/components/index.css +1 -1
  167. package/es/components/index.js +1 -1
  168. package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
  169. package/es/components/keyboard/src/Keyboard.vue2.js +1 -1
  170. package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
  171. package/es/components/map/src/Map.vue2.js +1 -1
  172. package/es/components/picture-clipper/src/PictureClipper.vue2.js +1 -1
  173. package/es/components/quick-search/src/index.vue2.js +1 -1
  174. package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -1
  175. package/es/components/scale-view/index.d.ts +31 -0
  176. package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
  177. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  178. package/es/components/scale-view/src/components/composables/choose-common.js +1 -1
  179. package/es/components/scale-view/src/components/formitem/r-cascader.js +1 -1
  180. package/es/components/scale-view/src/components/formitem/r-checkbox.d.ts +9 -0
  181. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  182. package/es/components/scale-view/src/components/formitem/r-input.d.ts +9 -0
  183. package/es/components/scale-view/src/components/formitem/r-input.js +1 -1
  184. package/es/components/scale-view/src/components/formitem/r-map.js +1 -1
  185. package/es/components/scale-view/src/components/formitem/r-radio.d.ts +9 -0
  186. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  187. package/es/components/scale-view/src/components/formitem/r-select.js +1 -1
  188. package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
  189. package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
  190. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  191. package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
  192. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  193. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  194. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  195. package/es/components/scale-view/src/hooks/scaleview-validate.js +1 -1
  196. package/es/components/scale-view/src/hooks/use-component.d.ts +72 -0
  197. package/es/components/scale-view/style/index.css +1 -1
  198. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  199. package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
  200. package/es/components/select-label/src/components/label-classify.vue2.js +1 -1
  201. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
  202. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  203. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  204. package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
  205. package/es/components/select-person/src/index.vue2.js +1 -1
  206. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  207. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
  208. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
  209. package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -1
  210. package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
  211. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
  212. package/es/components/table-filter/src/components/classify-filter/helpers/options.js +1 -1
  213. package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -1
  214. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +4 -7
  215. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  216. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +4 -7
  217. package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
  218. package/es/components/table-filter/src/components/render-widget/helpers/selectExtraMap.js +1 -1
  219. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -7
  220. package/es/components/table-filter/src/tool/baseOptions.js +1 -1
  221. package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
  222. package/es/components/vod-chunk-upload/src/hooks/upload-computed.js +1 -1
  223. package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
  224. package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
  225. package/es/shared/package.json.js +1 -1
  226. package/es/shared/types/index.d.ts +3 -0
  227. package/es/shared/utils/index.d.ts +1 -0
  228. package/es/shared/utils/index.js +1 -1
  229. package/package.json +2 -2
  230. package/es/components/iho-chat/src/hooks/useSession.d.ts +0 -12
  231. package/es/components/iho-chat/src/hooks/useSession.js +0 -1
  232. package/es/components/iho-chat/src/hooks/useState.d.ts +0 -18
  233. package/es/components/iho-chat/src/hooks/useState.js +0 -1
@@ -1 +1 @@
1
- const l={INPUT:"INPUT",TEXTAREA:"TEXTAREA",DIGITAL:"DIGITAL",DATE:"DATE",RADIO:"RADIO",RADIO_BLOCK:"RADIO_BLOCK",CHECKBOX:"CHECKBOX",CHECKBOX_BLOCK:"CHECKBOX_BLOCK",SELECT:"SELECT",MULTI_SELECT:"MULTI_SELECT",CANDIDATE_COMPONENTS:"CANDIDATE_COMPONENTS"},E=[{value:l.INPUT,label:"文本框"},{value:l.TEXTAREA,label:"文本域"},{value:l.DIGITAL,label:"数字框"},{value:l.DATE,label:"日期"},{value:l.RADIO,label:"横向单选"},{value:l.RADIO_BLOCK,label:"纵向单选"},{value:l.CHECKBOX,label:"横向多选"},{value:l.CHECKBOX_BLOCK,label:"纵向多选"},{value:l.SELECT,label:"下拉框"},{value:l.MULTI_SELECT,label:"下拉多选框"},{value:l.CANDIDATE_COMPONENTS,label:"选人组件"}];export{l as HtmlType,E as HtmlTypeList};
1
+ var l,a,e,C;const E={INPUT:"INPUT",TEXTAREA:"TEXTAREA",DIGITAL:"DIGITAL",DATE:"DATE",RADIO:"RADIO",RADIO_BLOCK:"RADIO_BLOCK",CHECKBOX:"CHECKBOX",CHECKBOX_BLOCK:"CHECKBOX_BLOCK",SELECT:"SELECT",MULTI_SELECT:"MULTI_SELECT",CANDIDATE_COMPONENTS:"CANDIDATE_COMPONENTS"},T=[{value:E.INPUT,label:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.293"))||"文本框"},{value:E.TEXTAREA,label:"文本域"},{value:E.DIGITAL,label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.292"))||"数字框"},{value:E.DATE,label:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.74"))||"日期"},{value:E.RADIO,label:"横向单选"},{value:E.RADIO_BLOCK,label:"纵向单选"},{value:E.CHECKBOX,label:"横向多选"},{value:E.CHECKBOX_BLOCK,label:"纵向多选"},{value:E.SELECT,label:(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.294"))||"下拉框"},{value:E.MULTI_SELECT,label:"下拉多选框"},{value:E.CANDIDATE_COMPONENTS,label:"选人组件"}];export{E as HtmlType,T as HtmlTypeList};
@@ -50,12 +50,13 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
50
50
  onSelect?: ((...args: any[]) => any) | undefined;
51
51
  onChange?: ((...args: any[]) => any) | undefined;
52
52
  onRemove?: ((...args: any[]) => any) | undefined;
53
+ onEdit?: ((...args: any[]) => any) | undefined;
53
54
  onAdd?: ((...args: any[]) => any) | undefined;
54
55
  "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
55
56
  "onClick:grid"?: ((...args: any[]) => any) | undefined;
56
57
  onEventClick?: ((...args: any[]) => any) | undefined;
57
58
  }>>;
58
- emits: (event: "remove" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick", ...args: any[]) => void;
59
+ emits: (event: "remove" | "edit" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick", ...args: any[]) => void;
59
60
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
60
61
  canvas: import("vue").Ref<any>;
61
62
  pointTipProps: {
@@ -68,6 +69,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
68
69
  movable: boolean;
69
70
  sourceData: import("../../shared/types").AnyObject[];
70
71
  isTarget: boolean;
72
+ marginTop?: number | undefined;
71
73
  };
72
74
  pointMenuProps: {
73
75
  show: boolean;
@@ -93,6 +95,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
93
95
  useRectRuler: any;
94
96
  updatePolyline: any;
95
97
  getGridInfo: any;
98
+ redrawLinePoints: any;
96
99
  init: () => import("../../shared/types").AnyObject;
97
100
  PopupTip: import("vue").DefineComponent<{
98
101
  show: {
@@ -128,6 +131,10 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
128
131
  isTarget: {
129
132
  type: BooleanConstructor;
130
133
  };
134
+ marginTop: {
135
+ type: NumberConstructor;
136
+ default: number;
137
+ };
131
138
  }, {
132
139
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
133
140
  show: {
@@ -163,6 +170,10 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
163
170
  isTarget: {
164
171
  type: BooleanConstructor;
165
172
  };
173
+ marginTop: {
174
+ type: NumberConstructor;
175
+ default: number;
176
+ };
166
177
  }>> & {}>>;
167
178
  pointStyle: import("vue").ComputedRef<{
168
179
  top: string;
@@ -208,8 +219,13 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
208
219
  isTarget: {
209
220
  type: BooleanConstructor;
210
221
  };
222
+ marginTop: {
223
+ type: NumberConstructor;
224
+ default: number;
225
+ };
211
226
  }>>, {
212
227
  list: string[];
228
+ marginTop: number;
213
229
  show: boolean;
214
230
  movable: boolean;
215
231
  isTarget: boolean;
@@ -257,7 +273,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
257
273
  list: unknown[];
258
274
  show: boolean;
259
275
  }>;
260
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick")[], "remove" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
276
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "edit" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick")[], "remove" | "edit" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
261
277
  type: {
262
278
  type: import("vue").PropType<import("./src/interface").IType>;
263
279
  default: string;
@@ -284,6 +300,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
284
300
  onSelect?: ((...args: any[]) => any) | undefined;
285
301
  onChange?: ((...args: any[]) => any) | undefined;
286
302
  onRemove?: ((...args: any[]) => any) | undefined;
303
+ onEdit?: ((...args: any[]) => any) | undefined;
287
304
  onAdd?: ((...args: any[]) => any) | undefined;
288
305
  "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
289
306
  "onClick:grid"?: ((...args: any[]) => any) | undefined;
@@ -44,12 +44,13 @@ declare const _default: import("vue").DefineComponent<{
44
44
  onSelect?: ((...args: any[]) => any) | undefined;
45
45
  onChange?: ((...args: any[]) => any) | undefined;
46
46
  onRemove?: ((...args: any[]) => any) | undefined;
47
+ onEdit?: ((...args: any[]) => any) | undefined;
47
48
  onAdd?: ((...args: any[]) => any) | undefined;
48
49
  "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
49
50
  "onClick:grid"?: ((...args: any[]) => any) | undefined;
50
51
  onEventClick?: ((...args: any[]) => any) | undefined;
51
52
  }>>;
52
- emits: (event: "remove" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick", ...args: any[]) => void;
53
+ emits: (event: "remove" | "edit" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick", ...args: any[]) => void;
53
54
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
54
55
  canvas: import("vue").Ref<any>;
55
56
  pointTipProps: {
@@ -62,6 +63,7 @@ declare const _default: import("vue").DefineComponent<{
62
63
  movable: boolean;
63
64
  sourceData: AnyObject[];
64
65
  isTarget: boolean;
66
+ marginTop?: number | undefined;
65
67
  };
66
68
  pointMenuProps: {
67
69
  show: boolean;
@@ -87,6 +89,7 @@ declare const _default: import("vue").DefineComponent<{
87
89
  useRectRuler: any;
88
90
  updatePolyline: any;
89
91
  getGridInfo: any;
92
+ redrawLinePoints: any;
90
93
  init: () => AnyObject;
91
94
  PopupTip: import("vue").DefineComponent<{
92
95
  show: {
@@ -122,6 +125,10 @@ declare const _default: import("vue").DefineComponent<{
122
125
  isTarget: {
123
126
  type: BooleanConstructor;
124
127
  };
128
+ marginTop: {
129
+ type: NumberConstructor;
130
+ default: number;
131
+ };
125
132
  }, {
126
133
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
127
134
  show: {
@@ -157,6 +164,10 @@ declare const _default: import("vue").DefineComponent<{
157
164
  isTarget: {
158
165
  type: BooleanConstructor;
159
166
  };
167
+ marginTop: {
168
+ type: NumberConstructor;
169
+ default: number;
170
+ };
160
171
  }>> & {}>>;
161
172
  pointStyle: import("vue").ComputedRef<{
162
173
  top: string;
@@ -202,8 +213,13 @@ declare const _default: import("vue").DefineComponent<{
202
213
  isTarget: {
203
214
  type: BooleanConstructor;
204
215
  };
216
+ marginTop: {
217
+ type: NumberConstructor;
218
+ default: number;
219
+ };
205
220
  }>>, {
206
221
  list: string[];
222
+ marginTop: number;
207
223
  show: boolean;
208
224
  movable: boolean;
209
225
  isTarget: boolean;
@@ -251,7 +267,7 @@ declare const _default: import("vue").DefineComponent<{
251
267
  list: unknown[];
252
268
  show: boolean;
253
269
  }>;
254
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick")[], "remove" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
270
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "edit" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick")[], "remove" | "edit" | "change" | "add" | "select" | "add:prevent" | "click:grid" | "eventClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
255
271
  type: {
256
272
  type: PropType<IType>;
257
273
  default: string;
@@ -274,6 +290,7 @@ declare const _default: import("vue").DefineComponent<{
274
290
  onSelect?: ((...args: any[]) => any) | undefined;
275
291
  onChange?: ((...args: any[]) => any) | undefined;
276
292
  onRemove?: ((...args: any[]) => any) | undefined;
293
+ onEdit?: ((...args: any[]) => any) | undefined;
277
294
  onAdd?: ((...args: any[]) => any) | undefined;
278
295
  "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
279
296
  "onClick:grid"?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as u,normalizeStyle as l,unref as p,createElementVNode as n,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import g from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as w}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as R}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";import{useNewBirthProcessChart as y}from"./hooks/newBirthProcess/useNewBirthProcessChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},popupTipRender:{type:Function},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid","eventClick"],setup(e,{expose:j,emit:P}){const b=e,x=r(null),I=r(),T=t({show:!1,point:{x:0,y:0},list:[],movable:!1,sourceData:[],isTarget:!1}),M=t({show:!1,point:{x:0,y:0},list:[],target:null}),B=o((()=>{var e;return null==(e=I.value)?void 0:e.wrapperEl})),A=o((()=>({width:`${b.data.width||800}px`,height:`${b.data.height||500}px`}))),{propItems:E,redrawPoints:F,select:S,clickMenu:_,useMeasureRuler:D,useCaliper:G,useCaliperRuler:$,useRectRuler:q,updatePolyline:H,getGridInfo:N}=function(){const e=[I,b,P,x,T,M];switch(b.type){case"birthProcess":return w(...e);case"surgicalAnesthesia":return k(...e,!!b.popupTipRender);case"electrocardiogram":return R(...e);case"newBirthProcess":return y(...e);default:return C(...e)}}();return s((()=>{I.value=new f.Canvas(x.value,{width:E.canvasWidth,height:E.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=I.value)?void 0:e.off)||r.call(e),null==(o=null==(t=I.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:F,select:S,canvas:I,useMeasureRuler:D,useCaliper:G,useCaliperRuler:$,useRectRuler:q,updatePolyline:H,getGridInfo:N}),(r,t)=>(i(),u("div",{class:"c-fabric-chart",style:l(p(A))},[n("canvas",{ref_key:"canvasRef",ref:x},null,512),p(B)?(i(),u(c,{key:0},[h(v,d({popupTipRender:e.popupTipRender,...T},{propItems:p(E)}),null,16,["propItems"]),h(p(g),d({propItems:p(E)},M,{show:M.show,"onUpdate:show":t[0]||(t[0]=e=>M.show=e),onClickMenu:p(_)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{j as default};
1
+ import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as n,normalizeStyle as u,unref as l,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import w from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import"./hooks/useCommon.js";import{useBirthProcessChart as g}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as R}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";import{useNewBirthProcessChart as P}from"./hooks/newBirthProcess/useNewBirthProcessChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},popupTipRender:{type:Function},addRenderItem:{type:Function}},emits:["change","add","remove","edit","select","add:prevent","click:grid","eventClick"],setup(e,{expose:j,emit:y}){const b=e,x=r(null),I=r(),T=t({show:!1,point:{x:0,y:0},list:[],movable:!1,sourceData:[],isTarget:!1}),M=t({show:!1,point:{x:0,y:0},list:[],target:null}),B=o((()=>{var e;return null==(e=I.value)?void 0:e.wrapperEl})),A=o((()=>({width:`${b.data.width||800}px`,height:`${b.data.height||500}px`}))),{propItems:E,redrawPoints:F,select:S,clickMenu:_,useMeasureRuler:D,useCaliper:G,useCaliperRuler:L,useRectRuler:$,updatePolyline:q,getGridInfo:H,redrawLinePoints:N}=function(){const e=[I,b,y,x,T,M];switch(b.type){case"birthProcess":return g(...e);case"surgicalAnesthesia":return k(...e,!!b.popupTipRender);case"electrocardiogram":return R(...e);case"newBirthProcess":return P(...e);default:return C(...e)}}();return s((()=>{I.value=new f.Canvas(x.value,{width:E.canvasWidth,height:E.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=I.value)?void 0:e.off)||r.call(e),null==(o=null==(t=I.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:F,redrawLinePoints:N,select:S,canvas:I,useMeasureRuler:D,useCaliper:G,useCaliperRuler:L,useRectRuler:$,updatePolyline:q,getGridInfo:H}),(r,t)=>(i(),n("div",{class:"c-fabric-chart",style:u(l(A))},[p("canvas",{ref_key:"canvasRef",ref:x},null,512),l(B)?(i(),n(c,{key:0},[h(v,d({popupTipRender:e.popupTipRender,...T},{propItems:l(E)}),null,16,["propItems"]),h(l(w),d({propItems:l(E)},M,{show:M.show,"onUpdate:show":t[0]||(t[0]=e=>M.show=e),onClickMenu:l(_)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{j as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as l,withDirectives as o,createVNode as a,vShow as r}from"vue";import{NSpace as s,NInputNumber as u}from"naive-ui";import n from"./useStyle.js";import{useEventListener as p,onClickOutside as i}from"@vueuse/core";var c=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:c,slots:f,emit:m}){const h=t(null);p(h,"contextmenu",(e=>(e.preventDefault(),!1))),i(h,(e=>{m("update:show",!1)})),e.propItems;const v=n(e);function d(e){if("string"==typeof e&&(e.startsWith("新增")||e.startsWith("删除")))return!0}function y(e){return"string"==typeof e?e:"boolean"==typeof e.value?e.label:e.renderItem?e.renderItem():a(s,{inline:!0,align:"center"},{default:()=>[a("span",null,[e.label]),a(u,{style:"width: 110px",size:"small",value:e.value,"onUpdate:value":t=>e.value=t,clearable:!0,placeholder:"请输入数值",showButton:!1,onFocus:()=>m("update:show",!0)},null)]})}return l((()=>e.show),(t=>{t&&e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)}))})),()=>o(a("ul",{ref:h,class:"c-fabric-chart-popup c-fabric-chart-popup__menu",style:v.value},[e.list.map((t=>e.show?a("li",{class:{"no-click":d(t)},onClick:l=>function(t,l){d(l)||""===(null==t?void 0:t.target.className)&&(m("update:show",!1),m("clickMenu",{item:l,target:e.target}))}(l,t)},[y(t)]):null))]),[[r,e.show]])}});export{c as default};
1
+ import{defineComponent as e,ref as t,watch as l,withDirectives as o,createVNode as a,vShow as n}from"vue";import{NSpace as u,NInputNumber as r}from"naive-ui";import i from"./useStyle.js";import{useEventListener as s,onClickOutside as p}from"@vueuse/core";var c=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:c,slots:d,emit:f}){const w=t(null);s(w,"contextmenu",(e=>(e.preventDefault(),!1))),p(w,(e=>{f("update:show",!1)})),e.propItems;const m=i(e);function v(e){var t,l;if("string"==typeof e&&(e.startsWith((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.279"))||"新增")||e.startsWith((null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.215"))||"删除")))return!0}function y(e){return"string"==typeof e?e:"boolean"==typeof e.value?e.label:e.renderItem?e.renderItem():a(u,{inline:!0,align:"center"},{default:()=>{var t;return[a("span",null,[e.label]),a(r,{style:"width: 110px",size:"small",value:e.value,"onUpdate:value":t=>e.value=t,clearable:!0,placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.207"))||"请输入数值",showButton:!1,onFocus:()=>f("update:show",!0)},null)]}})}return l((()=>e.show),(t=>{t&&e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)}))})),()=>o(a("ul",{ref:w,class:"c-fabric-chart-popup c-fabric-chart-popup__menu",style:m.value},[e.list.map((t=>e.show?a("li",{class:{"no-click":v(t)},onClick:l=>function(t,l){v(l)||""===(null==t?void 0:t.target.className)&&(f("update:show",!1),f("clickMenu",{item:l,target:e.target}))}(l,t),key:t.type||t},[y(t)]):null))]),[[n,e.show]])}});export{c as default};
@@ -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};
@@ -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,r;const n=[{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"}],t=[{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"}],w=[{label:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.214"))||"修改",type:"edit"},{label:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.215"))||"删除",type:"remove"}],g="#2563F4",s="#FF1818",L={yemai:{stroke:s,strokeX:g,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:s,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:g},gangmai:{radius:6,radiusCircle:3,stroke:g,fillCircle:s},xinmai:{radius:6,radiusCircle:3,stroke:s,fillCircle:s},humai:{radius:6,radiusCircle:3,stroke:s,fillCircle:g},ermai:{stroke:s,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:g}};var c=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e[e.DEFAULTMAINXCELLVALUE=.2]="DEFAULTMAINXCELLVALUE",e))(c||{});export{c as ECG,w as OTHER_MENU,L as OVERLAP,t as PAIN_MENU,n 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 n,drawPoint as o,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 w,range as k}from"lodash-es";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import{format as j}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,S,C,P,E){const{computedX:X,computedY:L,getXValue:O,getYValue:A}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:H,setPrevAndNextPoint:T,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:ne,scalebarBorder:oe,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 w(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]-N>=z?r[1]-z:r[1],m=o(c,{left:p,top:v,...u,...i}),y=v+m.height/2,b="dystocia"===s?n([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 k,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 n=fe(E,e);S=n?t([...a,...n],{...h}):null}const L={};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=n([a[0],a[1],t],c)}else e=o(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(L,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(L,{childbirthText:{obj:t,left:W/2,top:z/2}}))}}"fetalPresentation"===g&&(w(a,y,"surgicalDelivery",L),w(a,y,"dystocia",L));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:L,...f,...I()};a&&(M||(Y.leftLine=null),k=o(v,{left:a[0],top:a[1],...Y}));u.push(S),k&&(!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,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}),Object.values(e.otherObj).forEach((t=>{const{obj:n,top:o=0,left:i=0,type:r="",moveHide:l}=t||{};n&&("line"===r?n.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):n.setCoords().set({left:e.left+i,top:e.top+o}),l&&(x.value.remove(n),delete e.otherObj.obj))}))}(e),_.hovered&&de(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,n={...e.origin,data:{...e.origin.data,time:O(e.left),value:A(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var o;(null==(o=e.otherObj[t])?void 0:o.obj)&&(n.data[t]=j(new Date(O(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",n),ae(n,"change")}}))}(k),c.push(k),le.add(k))}(fe(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));T(e),Promise.all(d).then((n=>{x.value.add(...t,...e,...n),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:n,data:o,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]=o;break;default:{const e=g(o.time,l.data);l.data.splice(e,0,o);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,n=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>n&&e.set("left",n)}function de(e,t="moving"){const{title:n,key:o,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${n} ${"hover"===t?i.value:A(o,e.top)}`,`时间 ${O(e.left).slice(-5)}`],P.show=!0}function fe(e,t){if(v(e)&&function(e){const t=F+864e5,n=m(e);return n>=F&&n<=t}(e.time)){const n=X(e.time),o=L(t.key,t.range,e.value);return[n,o<N?N:o>V?V:o]}}function he(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=oe?{width:Q-R-Z-1,left:R}:{width:J-G-(q.length?0:1),left:G},n=new e.Rect({...U,height:V-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(n)}(),function(){function t(t,n="left"){let o="left"===n?R:J;t.forEach(((t,n)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:w=!0,showMaxMinNumber:k=!0,showName:j=!0}=t,S=[],C=[],P=o+u/2,E=y(s,c),X=E.length,{lineXMain:L,lineXSub:O,textLeft:A}=d(m,o,u);E.forEach(((e,n)=>{const o=V-n*z*b,i=0===n?V-8:n!==E.length-1||!ie[0]||ee&&"FHR"!==v?o:N+8;!w||(0===n||n===X-1)&&!k||S.push(f(String(e),t,A,i)),C.push(...h(t,n,L,O,o,z,N,X,1))}));const M=[],Y=oe?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),j){const e=r([P,N-ie[0]>0?N-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(),o+=u}))}t($),t(q,"right")}(),function(){const{show:t,startTime:n,range:o=[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=k(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?+n.slice(11,13):he(w(h),o);h.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(he(w(h),o)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=f,n=G+("center"===t?W/2:0),o=0===e&&"center"!==t?n+5:n,i="top"===d?m:ne-m;v.push(r([o+e*W,i],{value:String(p[e]),...l,...f})),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 n=Object.values(te),o=[],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:n,range:o}=r||{},i=L(n,o,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 f([n,o]){return Math.abs(o-e*n-t)<=1}function h([e,t]){const[n,o]=[...p([e,t])];return n>=G&&n<=J&&o>=i&&o<=V}function p([e,t]){return[G+e,V-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]}n.forEach((e=>{if(!e.show)return;const{key:n}=e;switch(n){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===n));if(r){const r=L(n,i,0);o.push(t([G,r,J,r],{...e}))}break}case"alert":if(l){const{key:n,range:a}=r||{},c=216e5,u={time:j(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[X(l.time)-G,V-L(n,a,l.value)],[h,p]=[X(u.time)-G,V-L(n,a,u.value)],g=(p-f)/(h-d),v=f-d*g,y=s(g,v);y.length>0&&(o.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:n,b:r}=i,a=144e5,c=s(n,r-(X(j(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-X(l.time))*n);c.length>0&&o.push(t(c,{...e}))}}})),x.value.add(...o)}(),se(),function(){function e(e,t){const n=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:n,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{var n,o;if(3===t.button){const{x:i=0,y:r=0}=t.pointer||{};i>=G&&i<=J&&r>=N&&r<=V&&(E.point={x:i,y:r},E.show=!0,t.target?(E.target=t.target,E.list=[(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.220"))||"删除节点"],[...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=[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.219"))||"新增节点"],re.filter((e=>e.show)).forEach((n=>{if(!M([...le],i,"key").includes(n.key)){if(["cervix","fetalPresentation"].includes(n.key)&&r<ee)return;E.list.push(e(n,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 o=N;const i=[];e.forEach((e=>{const n=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,o],{value:n,...l,originY:"top",...e.titleStyle});n&&(o+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(n,e,{text:{originX:"center",originY:"top",left:t,top:o},icon:{left:t,topY:o,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");o+=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:O(c.left),value:A(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})),n(i),x.value.add(...i)}function n(e){const t=w(e),n=(V-N)/2,o=(t.height+t.top-N)/2;e.forEach((e=>{const t=e.top+n-o;e.set({top:t,originTop:t})}))}t($,R/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(C("remove",n),ae(n,"remove")):(Object.assign(n,{data:{time:O(e.pointer.x),value:A(e.origin.key,e.pointer.y)}}),C("add",n),ae(n))},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"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function n(n,s,d,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>s.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((()=>s.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}=s.data,t=null==(e=p.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-f.value-t})),x=a((()=>s.data.grid.mainXCell)),y=a((()=>{const e=s.data.grid.mainYCell||14;return s.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=s.data.padding||[5,5],a=B("top"),t=B("bottom");return[a?0:e[0],t?0:e[1]]})),j=a((()=>{const{height:e}=s.data,a=B();return(e-b.value.reduce(((e,a)=>e+a),0))/(y.value+a)})),C=a((()=>{const e=B("top");return j.value*e+b.value[0]})),k=a((()=>{var e;const{scaleValues:a}=s.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*j.value})),A=a((()=>{const{height:e}=s.data,a=B("bottom");return e-j.value*a-b.value[1]})),Y=a((()=>u(s.data.xAxis.time.startTime))),S=a((()=>36e5/V.value)),H=a((()=>{const{scaleValues:e}=s.data,a=e.find((e=>"cervix"===e.key));return j.value/((null==a?void 0:a.spaceValue)||1)})),P=a((()=>{const{scaleValues:e}=s.data,a=e.find((e=>"FHR"===e.key));return j.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=s.data,a=e.find((e=>"fetalPresentation"===e.key));return j.value/((null==a?void 0:a.spaceValue)||1)})),X=a((()=>{var e;return(null==(e=s.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}}));function B(e){const{xAxis:a}=s.data;return Object.values(a).reduce(((a,t)=>(t.show&&(!e||e&&t.position===e)&&a++,a)),0)}const F=e({canvasWidth:s.data.width,canvasHeight:s.data.height,borderStyle:{...r,...s.data.borderStyle||{}},selectionStyle:s.data.selectionStyle||{},grid:s.data.grid,other:s.data.other,originX:g.value,endX:w.value,originY:C.value,endY:A.value,xCellWidth:V.value,yCellHeight:j.value,gridXNumber:x.value,gridYNumber:y.value,xAxis:s.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:s.data.scaleValues,event:X.value,originYCervix:k.value,scalebarBorder:!Reflect.has(s.data,"scalebarBorder")||s.data.scalebarBorder,padding:b.value});return t((()=>n.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=i(n,F,d,v,c);h.redrawPoints=a,h.clickMenu=e}()}),{immediate:!0}),{propItems:F,...l(h)}}export{n 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"@vueuse/core";function r(r,i){const{scale:l,beforeEvent:s,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 S(e){return g(e)*l}function L(e){return v(e)*l}function k(e){return b(e/l)}const j=d*l;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==s?void 0:s()),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 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:a-v<=z?v-z:v};M(),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=j/5,l=30+n[Y].y/Math.abs(n[Y].y-n[$].y)*X,s=Math.ceil(l/i),a=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 p=new e.Group([...t(a).map((e=>u(e*i+l,e))),...t(s).map((e=>u(-e*i+l,e)))]),c=o/n.length*E,y=Math.ceil(c/i),f=Math.ceil((E-c)/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 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,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(a(t[Y]),{...n,...r,left:A.x+Y/t.length*E,stroke:"red"}),l=new e.Line(a(t[$]),{...n,...r,stroke:"blue",left:A.x+$/t.length*E}),s=new e.Line(a(t[o]),{...n,...r,stroke:"green",left:A.x+o/t.length*E});return new e.Group([i,l,s]);function a(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;p&&D.push(new e.Text(`x${l}`,{...n,fill:"black",fontSize:20,left:A.x+10,top:A.y+z-30})),c&&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}),s=new e.Text(`当前: ${k(t[o].y)} mv`,{...n,...r,fill:"green",top:A.y+z-60});return new e.Group([i,l,s])}(C,W)),w.add(...D).addWithUpdate(),null==(i=r.canvas)||i.add(w),null==(m=r.canvas)||m.discardActiveObject()})),r.on("mouseup",(async e=>{await(null==s?void 0:s()),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 u(u,d,c){const{computedX:m,computedY:h}=l(d),{borderStyle:f,originX:L,originY:g,xCellWidth:p,yCellHeight:E,canvasWidth:x,canvasHeight:M,dataList:v,columnNumber:C,gridYNumber:N,gridXNumber:y,rowNumber:b,lineStyle:S,titleStyle:w,config:A,calibrationLineHeight:j}=d,R=new Set,U=new Set;function X(e=[]){return~~(e.length/C)*(A.mainXCellValue/s.DEFAULTMAINXCELLVALUE)}function B(t=0){v.forEach(((r,n)=>{if(n===v.length-1&&arguments.length)return;const{x:o,y:i,rowIdx:a}=r.origin,l=X(r.data),u=r.data.reduce(((e,r,o)=>{const a=n<s.MAXLINENUMBER-1&&o>=t&&o<=t+l||n===s.MAXLINENUMBER-1?[{x:m(e.length+1),y:h(-+r)+i}]:[];return e.concat(a)}),[]),f=new e.Polyline(u,{...S,fill:"transparent",strokeWidth:1,left:o,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(k(f,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>c.value&&Promise.reject()}),f.startIdx=t,n<v.length-1?R.add(f):U.add(f),arguments.length)return;I({x:o,y:i},S);const L=new e.Text(String(r.title),{...w,left:o+(4===C?p:p/2),top:i,originX:"left",originY:"bottom"});U.add(L)}));const r=arguments.length?[...R]:[...R,...U];u.value.add(...r)}function k(e,t){n(e,t)}function I({x:t,y:r},n){if(4===C)return;const i=t-p,a=p/s.SMALLCELLNUMBER,l=new e.Polyline([{x:i,y:r},{x:i+a,y:r},{x:i+a,y:r-j},{x:i+3*a,y:r-j},{x:i+3*a,y:r},{x:i+4*a,y:r}],{...n,fill:"transparent",strokeWidth:1,left:i,...o});U.add(l)}a(u,{...d,gridXNumber:y*s.SMALLCELLNUMBER,gridYNumber:N*s.SMALLCELLNUMBER,xCellWidth:p/s.SMALLCELLNUMBER,yCellHeight:E/s.SMALLCELLNUMBER,grid:{...d.grid,subXCell:s.SMALLCELLNUMBER,subYCell:s.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=f,r=new e.Rect({...f,width:x-t,height:M-t,left:L,top:g,fill:"transparent"});u.value.add(r)}(),function(){const e=x/C,t=[];r(C).forEach((r=>{if(r+1>=C)return;const n=(r+1)*e,o=i([n,0,n,M],{stroke:"#000"});t.push(o)})),u.value.add(...t)}(),B();return{updatePolyline:t((t=>{const r=X(v[v.length-1].data);if(r===v[0].data.length)return;const n=v[v.length-1].data.length,o=t/100*n-r/2,i=o+r>n?n-r:Math.max(0,o);e.util.requestAnimFrame((()=>{if(R.size){const[e]=[...R];if(e.startIdx===i)return;[...R].forEach((e=>u.value.remove(e))),R.clear()}B(i)}))}),150)}}export{u as useElectrocardiogram};
1
+ 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 n,drawLine as i}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import"../useCommon.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as s}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";function u(u,d,c){const{computedX:m,computedY:h}=l(d),{borderStyle:f,originX:L,originY:g,xCellWidth:p,yCellHeight:E,canvasWidth:x,canvasHeight:M,dataList:C,columnNumber:v,gridYNumber:N,gridXNumber:y,rowNumber:b,lineStyle:S,titleStyle:w,config:A,calibrationLineHeight:j}=d,R=new Set,U=new Set;function X(e=[]){return~~(e.length/v)*(A.mainXCellValue/s.DEFAULTMAINXCELLVALUE)}function B(t=0){C.forEach(((r,o)=>{if(o===C.length-1&&arguments.length)return;const{x:n,y:i,rowIdx:a}=r.origin,l=X(r.data),u=r.data.reduce(((e,r,n)=>{const a=o<s.MAXLINENUMBER-1&&n>=t&&n<=t+l||o===s.MAXLINENUMBER-1?[{x:m(e.length+1),y:h(-+r)+i}]:[];return e.concat(a)}),[]),f=new e.Polyline(u,{...S,fill:"transparent",strokeWidth:1,left:n,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(k(f,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>c.value&&Promise.reject()}),f.startIdx=t,o<C.length-1?R.add(f):U.add(f),arguments.length)return;I({x:n,y:i},S);const L=new e.Text(String(r.title),{...w,left:n+(4===v?p:p/2),top:i,originX:"left",originY:"bottom"});U.add(L)}));const r=arguments.length?[...R]:[...R,...U];u.value.add(...r)}function k(e,t){o(e,t)}function I({x:t,y:r},o){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}],{...o,fill:"transparent",strokeWidth:1,left:i,...n});U.add(l)}a(u,{...d,gridXNumber:y*s.SMALLCELLNUMBER,gridYNumber:N*s.SMALLCELLNUMBER,xCellWidth:p/s.SMALLCELLNUMBER,yCellHeight:E/s.SMALLCELLNUMBER,grid:{...d.grid,subXCell:s.SMALLCELLNUMBER,subYCell:s.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=f,r=new e.Rect({...f,width:x-t,height:M-t,left:L,top:g,fill:"transparent"});u.value.add(r)}(),function(){const e=x/v,t=[];r(v).forEach((r=>{if(r+1>=v)return;const o=(r+1)*e,n=i([o,0,o,M],{stroke:"#000"});t.push(n)})),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,n=t/100*o-r/2,i=n+r>o?o-r:Math.max(0,n);e.util.requestAnimFrame((()=>{if(R.size){const[e]=[...R];if(e.startIdx===i)return;[...R].forEach((e=>u.value.remove(e))),R.clear()}B(i)}))}),150)}}export{u as useElectrocardiogram};
@@ -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=4===u?0: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 d,last as s}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"@vueuse/core";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})),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})),j=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(w.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*x.value}}(),d=x.value*n,s=1===u||d<o?x.value*Math.ceil(o/x.value):d,v=L.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*(x.value*Y.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:j.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:L.value,cellHeight:x.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 r}from"../useDraw.js";import{useElectrocardiogramCumputedPoint as i}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"@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 j=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});j=`测量幅度:${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 w=r([c,("rectRuler"===e?u.top:y.top)+10],{value:j,...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:w}),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,w].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 +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 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 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"@vueuse/core";function v(v,g,w,x,y){const{computedX:b,computedY:L,getXValue:S,getYValue:j}=l(g),{getEqualXTypes:E,handleAddPrevent:k,isGridLimit:X,setPrevAndNextPoint:P,getPointEventProps:C}=c(v,w,g),{xAxis:A,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: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=[],a=[],u=[];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:w="",key:y,type:L="circle",childbirthStyle:E={}}=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]:b(c.time),n=l?l[1]:m(s).top,o=n+$/2,r=Z([t,n,t,o],g);u.push(r);const a=e([t,o],{value:String(c.childbirth),...i,...E,backgroundColor:"#fff"});u.push(a)}const P=a[d-1],A={origin:{data:c,title:w,key:y||"",dataIndex:r,index:d},leftLine:P,rightLine:f,...v,...C(),...n};l&&(P||(A.leftLine=null),h=o(L,{left:l[0],top:l[1],...A}));f&&a.push(f),h&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{!function(t,e="moving"){const{title:i,key:n,data:o}=t.origin;x.point={x:t.left,y:t.top},x.list=[`${i} ${"hover"===e?o.value:j(n,t.top)}`,`时间 ${S(t.left).slice(-5)}`],x.show=!0}(t,"hover")})),t.on("mouseout",(()=>{x.show=!1})))}(h),s.push(h),Q.add(h))}(_(l,t),l,c)})),Promise.all(s).then((t=>{P(t),Promise.all(u).then((e=>{v.value.add(...a,...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=b(t.time),n=L(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==A?void 0:A.time)?void 0:e.range)?void 0:i[1])||20,o=B+60*n*60*1e3,r=h(t);return r>=B&&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:w,key:x,position:y="center",spaceGridNumber:b=1,showNumber:L,showMaxMinNumber:S}=o,j=[],E=[],k=f(d,h),X=k.length,{lineXMain:P,lineXSub:C,textLeft:A}=s(y,c,p);k.forEach(((t,e)=>{const i=V-e*$*b;!L||(0===e||e===X-1)&&!S||j.push(a(String(t),o,A,i)),E.push(...u(o,e,P,C,i,$,Y,X,1))}));const T=e([c+l,Y+(V-Y)/2],{value:String(m+"("+w+")"),...i,originX:"center",angle:-90,...g}),G=new t.Group([...E,...j,...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}=A.time;if(o){const o=[],c=$/2;f(r,u).forEach(((t,n)=>{const r="top"===l?Y-c:V+R+c;o.push(e([G+n*N*a,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=b(n),r=V+R;t.push(e([o,r],{value:String(n.slice(11,16)),...i,originY:"bottom"}))})),v.value.add(...t)}}()}(),function(){var t;const{alertLineList:n=[],alertLineTitle:o=(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.227"))||"入院时宫颈扩张不同情况"}=I;if(n.length<1)return;const r=e([W,0],{value:o,...i,originX:"right",originY:"top"});v.value.add(r),n.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:B+60*t.time*60*1e3}))).forEach(((t,n,l)=>{const s=_(t,r),a=_(l[n+1],r);s&&!a&&o.push(e([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 t;Q.size&&(null==(t=v.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...Q]))),Q.clear(),U()}}}export{v as useNewBirthProcess};
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as r}from"date-fns";import{getTime as u}from"../../utils/index.js";import{range as s,last as n}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@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"@vueuse/core";import{useNewBirthProcess as n}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)})),j=a((()=>v.data.grid.mainXCell||20)),y=a((()=>v.data.grid.mainYCell||8)),A=a((()=>(b.value-w.value)/j.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,j.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}})),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:C.value,endY:S.value,xCellWidth:A.value,yCellHeight:M.value,gridXNumber:j.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,I,c,h);p.value=e}()}),{immediate:!0}),{propItems:I,redrawPoints:p}}export{d as useNewBirthProcessChart};
@@ -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 s}from"../useCommon.js";import"vue";import{getPointRange as a,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:V,scaleValues:Y,xAxis:M,startTime:S,timeXCell:D,itemList:F,dialog:O,topGridOriginY:$,topGridEndY:_}=h,z=new Map,G=new Set,N=p(Y);let J=[],q=null;const R=new Set;o(y,h);const{getEqualXTypes:W,handleAddPrevent:B,setPrevAndNextPoint:H,getPointEventProps:Q}=s(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 s({show:e=!1,value:i,name:o,lineStyle:l}){if(!e||!i)return;const r=b(t.type,t.range,i),s=n([E,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});V.hovered&&o&&(s.on("mousemove",(({pointer:e})=>{x.point={...e||{x:s.left,y:s.top}},x.list=[`${o} ${i}${t.unit||""}`],x.show=!0})),s.on("mouseout",(()=>{x.show=!1}))),y.value.add(s)}s(i),s(o),s(l),s(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:s,dataList:a=[]}=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=a.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:s,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){V.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),V.hovered&&ue(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:s,top:a,origin:f}=e,u=~~((s-l)/C);if(s>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,a);J.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:c,top:a}),re(e,[...e.prevPointer,c,a])}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 s=JSON.parse(JSON.stringify(r)),a=J[l-1]||{left:n,top:i},f=~~((r.left-(t-C))/C),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:A(t),value:I(o.type,s.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},J.splice(l,0,s),re(e,[a.left,a.top,s.left,s.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<s?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 s=J.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void ae({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1?s[o].value=n.value:s.push({...d(s),time:n.time,value:n.value})}const a=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:a,key:n,data:s}),se({...o,data:s,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),se(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 se(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:s}=e;let{dataIndex:a}=e;const u=N.find((e=>e.type===r)),c=u.dataList.find(((e,t)=>(a=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,s>-1?s-t+1:0,...n);break}}ae({dataIndex:a,scaleValue:u})}function ae(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 s=A(e.left),a=`${"hover"===t?o.value:I(i,e.top)}`;x.list=[`${n} ${a}${l||""}`,`时间 ${s.slice(-5)}`],x.sourceData=[{type:i,title:n,unit:l,key:r,time:s,value:a}],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(M.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(!V.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}=a(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 se(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:s,y:a}=o.pointer;q&&y.value.remove(q),q=new e.Rect({...t,fill:"#CAF982",opacity:.4,...K,left:l,top:r,width:s-l,height:a-r,objectCaching:!0}),q.areaPos={startPos:i,endPos:o.pointer},y.value.add(q)}))}(),{redrawPoints:ae,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),se(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),se({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ce,setPopup:ue,updateData:se,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{getPointRange as s,getIndex as u,isEffectiveNode as c,getTime as f}from"../../utils/index.js";import{cloneDeep as d,last as p,omit as m,flatten as g}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import{useIntervalFn as v}from"@vueuse/core";function y(y,h,k,x,w,L){const{computedX:P,computedY:b,getXValue:C,getYValue:A}=l(h),{xCellWidth:I,pointSelectionStyle:K,originX:j,endX:E,originY:T,endY:X,event:M,scaleValues:V,xAxis:Y,startTime:S,timeXCell:D,itemList:F,dialog:O,topGridOriginY:$,topGridEndY:_}=h,B=new Map,z=new Set,G=d(V);let N=[],J=null;const q=new Set;o(y,h);const{getEqualXTypes:R,handleAddPrevent:W,setPrevAndNextPoint:H,getPointEventProps:Q}=r(y,k,h),{pause:U,resume:Z}=v((()=>{!function(){if(!q.size)return;for(const e of q)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function ee(){G.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=b(t.type,t.range,i),r=n([j,a,E,a],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(r.on("mousemove",(({pointer:e})=>{x.point={...e||{x:r.left,y:r.top}},x.list=[`${o} ${i}${t.unit||""}`],x.show=!0})),r.on("mouseout",(()=>{x.show=!1}))),y.value.add(r)}r(i),r(o),r(l),r(a)}(t,e),oe(t,i,e))}))}))}function te(e=[]){if(!(null==J?void 0:J.areaPos))return[];const{startPos:t,endPos:n}=J.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:pe()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=a))}function ne(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:"确认删除当前选中的节点?",positiveText:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.27"))||"确定",negativeText:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.28"))||"取消",onPositiveClick:()=>{e(),ie()},onNegativeClick:()=>ie(),onClose:()=>ie()})}function ie(){J&&y.value.remove(J),J=null}function oe(e,t,o){var l;const{type:a,unit:r,dataList:s=[]}=o,u=[];B.set(e.key,[]),function(e,t){q.size&&[...q].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&q.delete(n)}))}(a,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,f){var d;let g,v,h=f;l.key&&(h=s.find((e=>e.key===l.key)));const{pointAttr:w={},lineAttr:L={},title:P="",key:b,type:K="circle"}=h,j=de(f.list[c+1],o);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=n([...e,...j],L));const E=u[c-1],T={origin:{data:l,title:P,key:f.key,selfKey:b,unit:r,type:a,dataIndex:t,index:c,lineAttr:L},__type:"main",leftLine:E,rightLine:v,...w,...Q()};e&&(E||(T.leftLine=null),g=i(K,{left:e[0],top:e[1],...T}));u.push(v),g&&(g.originLeft=g.left,g.originTop=g.top,function(e){M.hovered&&(e.on("mouseover",(()=>{ce(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{fe(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&&ce(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===N.length){ae(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(N.every((e=>e.left!==f))){const t=C(f),n=A(u.type,s);N.push({data:{time:t,value:n,...u.selfKey!==u.key?{key:u.selfKey}:{}},left:f,top:s}),ae(e,[...e.prevPointer,f,s])}if(N.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=N.some((e=>Math.abs(e.left-t)<=1));if(!a){let l=0;const a=N.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(a){const r=JSON.parse(JSON.stringify(a)),s=N[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:C(t),value:A(o.type,r.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},N.splice(l,0,r),ae(e,[s.left,s.top,r.left,r.top])}}l++}}(e,c),e.nextPoint){const t=B.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?le(e,"#999"):le(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(N.length>0&&i<N[N.length-1].left){for(const e of z)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(N=N.filter((e=>e.left<=i)),0===N.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of z)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(N.length>0){const t=p(N);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:C(e.left),value:A(t,e.top)}};if(y.value.discardActiveObject(),N.length>0){const l=G.find((e=>e.type===t));let a=-1;const r=N.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;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}),re({...o,data:r,coincideIndex:a})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),re(o,"change")}}))}(g),null==(d=B.get(f.key))||d.push(g))}(de(l,o),l,c,e)})),Promise.all(B.get(e.key)).then((t=>{const n=u.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 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||q.add(e)}))}a(n,"max"),a(i,"min"),a(o,"max"),a(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 ae(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,z.add(l),y.value.add(a,l)}))}function re(e,t="add",n=1){const{data:i,index:o,key:l,type:a,coincideIndex:r}=e;let{dataIndex:s}=e;const c=G.find((e=>e.type===a)),f=c.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":f.list.splice(o,n),f.list[o-1]&&(f.list[o-1].breakpoint=!0);break;case"change":f.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=u(e,f.list),n=Array.isArray(i)?i:[i];f.list.splice(t,r>-1?r-t+1:0,...n);break}}se({dataIndex:s,scaleValue:c})}function se(e){var t,n,i;if(z.size&&(null==(t=y.value)||t.remove(...ue([...z]))),z.clear(),N=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...ue(B.get(o.key))),B.delete(o.key),oe(o,t,i)}else B.size&&(null==(i=y.value)||i.remove(...ue(pe()))),B.clear(),ee()}function ue(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 ce(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:a}=e.origin;x.point={x:e.left,y:e.top};const r=C(e.left),s=`${"hover"===t?o.value:A(i,e.top)}`;x.list=[`${n} ${s}${l||""}`,`时间 ${r.slice(-5)}`],x.sourceData=[{type:i,title:n,unit:l,key:a,time:r,value:s}],x.isTarget=!0,x.show=!0}function fe(e){e.setCoords();const t=6e4/D,n=e.prevPoint?e.prevPoint.left+t:j,i=E;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 de(e,t){if(c(e)&&function(e){const t=Date.parse(p(Y.list)),n=f(e);return n>=S&&n<=t}(e.time)){const n=P(e.time),i=b(t.type,t.range,e.value);return[n,i<T?T:i>X?X:i]}}function pe(){return g(Array.from(B.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){var t,n;x.show=!1;const{x:i=0,y:o=0}=e.pointer||{};if(i>=j&&i<=E&&o>=T&&o<=X)if(e.target){if("main"!==e.target.__type)return;l(e.pointer,e.target,[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.220"))||"删除节点"]);const{minLeft:t,maxLeft:i,minTop:o,maxTop:a}=s(e.target);pe().forEach((n=>{"main"===n.__type&&n.left>t&&n.left<i&&n.top>o&&n.top<a&&w.list.push({renderItem:()=>n.origin.title,origin:{...n.origin},mode:"remove",pointer:e.pointer})})),1===w.list.length&&(w.show=!1,console.log("当前时间段内无可删除节点"))}else l(e.pointer,null,[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"]),F.forEach((t=>{R(pe(),i,"key",2*I).includes(t.linkKey||t.key)||w.list.push({renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,type:t.bigType,dataIndex:t.dataIndex,key:t.key,linkKey:t.linkKey},pointer:e.pointer})})),1===w.list.length&&(w.show=!1,W("repeat"),console.log("当前时间段内无可新增节点"));function l(e,t,n){Object.assign(w,{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 re(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(e);k("remove",t)})):a.emit(J)}})),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(!L||w.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;x.movable=!1,(i<j||i>E)&&(x.show=!1);if(!t&&i>=j&&i<=E){const e=o>=T&&o<=X,l=o>=$&&o<=_;if(e||l){const l=C(i);x.sourceData=e?G.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:A(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:a}=i,{x:r,y:s}=o.pointer;J&&y.value.remove(J),J=new e.Rect({...t,fill:"#CAF982",opacity:.4,...K,left:l>r?r:l,top:a>s?s:a,width:Math.abs(r-l),height:Math.abs(s-a),objectCaching:!0}),J.areaPos={startPos:i,endPos:o.pointer},y.value.add(J)}))}(),{redrawPoints:se,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),re(n,"remove")):(Object.assign(n,{data:{time:C(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),re({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:fe,setPopup:ce,updateData:re,getGridPoints:pe,getContainPoints:te,showDialog:ne,removeCurrentSelection:ie,pauseFlickerPoint:U}}export{y as useCenter};