cnhis-design-vue 3.4.0-release.3 → 3.4.0-release.7

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 (214) hide show
  1. package/es/_virtual/_virtual_i18n-methods.js +5 -1
  2. package/es/components/audio-sdk/index.d.ts +4 -4
  3. package/es/components/audio-sdk/src/Index.vue.d.ts +4 -4
  4. package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +4 -4
  5. package/es/components/audio-sdk/src/components/recording.vue.d.ts +4 -4
  6. package/es/components/base-search/index.d.ts +34 -0
  7. package/es/components/base-search/src/index.vue.d.ts +34 -0
  8. package/es/components/base-search/src/index.vue2.js +9 -1
  9. package/es/components/button-print/index.d.ts +32 -0
  10. package/es/components/button-print/src/ButtonPrint.vue.d.ts +32 -0
  11. package/es/components/button-print/src/ButtonPrint.vue2.js +4 -0
  12. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  13. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +73 -48
  14. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +11 -0
  15. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +35 -0
  16. package/es/components/button-print/src/utils/print.d.ts +1 -1
  17. package/es/components/button-print/src/utils/print.js +4 -2
  18. package/es/components/callback/src/components/render/popupMaps.d.ts +38 -24
  19. package/es/components/classification/index.d.ts +84 -0
  20. package/es/components/classification/src/components/search-filter/index.vue.d.ts +84 -0
  21. package/es/components/classification/src/components/set-classification/index.vue.d.ts +84 -0
  22. package/es/components/classification/src/index.vue.d.ts +84 -0
  23. package/es/components/classification/src/index.vue2.js +7 -0
  24. package/es/components/date-picker/index.d.ts +28 -0
  25. package/es/components/date-picker/src/DatePicker.vue.d.ts +28 -0
  26. package/es/components/date-picker/src/DatePicker.vue2.js +26 -1
  27. package/es/components/expand-field/index.d.ts +31 -0
  28. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +31 -0
  29. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +31 -0
  30. package/es/components/expand-field/src/components/form.vue.d.ts +31 -0
  31. package/es/components/expand-field/src/index.vue.d.ts +31 -0
  32. package/es/components/fabric-chart/index.d.ts +3 -3
  33. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +3 -3
  34. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -0
  35. package/es/components/fabric-chart/src/components/PopupMenu.d.ts +4 -4
  36. package/es/components/fabric-chart/src/components/PopupMenu.js +57 -39
  37. package/es/components/fabric-chart/src/constants/index.d.ts +19 -5
  38. package/es/components/fabric-chart/src/constants/index.js +26 -11
  39. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.d.ts +4 -3
  40. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +119 -193
  41. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +69 -117
  42. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +15 -11
  43. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.d.ts +1 -1
  44. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +39 -27
  45. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +2 -2
  46. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +86 -122
  47. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -0
  48. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +65 -113
  49. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +4 -3
  50. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +63 -37
  51. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +31 -14
  52. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +4 -3
  53. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +6 -7
  54. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +152 -208
  55. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +4 -3
  56. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +8 -9
  57. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -0
  58. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +4 -3
  59. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +138 -229
  60. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +5 -2
  61. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +195 -273
  62. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -0
  63. package/es/components/fabric-chart/src/interface.d.ts +14 -1
  64. package/es/components/fabric-chart/src/utils/eventBus.d.ts +2 -0
  65. package/es/components/fabric-chart/src/utils/eventBus.js +5 -0
  66. package/es/components/fabric-chart/src/utils/index.d.ts +1 -1
  67. package/es/components/fabric-chart/src/utils/index.js +2 -10
  68. package/es/components/fabric-chart/style/index.css +1 -1
  69. package/es/components/field-editor/index.d.ts +1 -0
  70. package/es/components/field-editor/src/FieldEditor.vue.d.ts +1 -0
  71. package/es/components/field-set/src/FieldColor.vue.d.ts +57 -1
  72. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  73. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  74. package/es/components/field-set/src/FieldSet.vue2.js +3 -1
  75. package/es/components/field-set/src/components/condition.vue.d.ts +28 -0
  76. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +56 -0
  77. package/es/components/field-set/src/components/edit-filter.vue.d.ts +28 -0
  78. package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
  79. package/es/components/form-config/index.d.ts +24 -0
  80. package/es/components/form-config/src/FormConfig.vue.d.ts +24 -0
  81. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -0
  82. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +19 -0
  83. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +48 -24
  84. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +1 -0
  85. package/es/components/form-config/src/constants/index.d.ts +2 -0
  86. package/es/components/form-config/src/constants/index.js +2 -0
  87. package/es/components/form-config/src/hooks/useConfigurationField.js +20 -3
  88. package/es/components/form-render/index.d.ts +1 -0
  89. package/es/components/form-render/src/FormRender.vue.d.ts +1 -0
  90. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -0
  91. package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
  92. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -0
  93. package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -0
  94. package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -0
  95. package/es/components/form-render/src/components/renderer/radio_checkbox.js +3 -2
  96. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -0
  97. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  98. package/es/components/form-render/src/hooks/useNewLowCodeReactions.js +8 -0
  99. package/es/components/form-render/src/types/index.d.ts +1 -0
  100. package/es/components/form-render/src/utils/index.d.ts +1 -1
  101. package/es/components/form-render/src/utils/index.js +5 -2
  102. package/es/components/iho-chat/index.d.ts +2757 -300
  103. package/es/components/iho-chat/src/Index.vue.d.ts +2757 -300
  104. package/es/components/iho-chat/src/Index.vue2.js +5 -3
  105. package/es/components/iho-chat/src/api/index.d.ts +89 -16
  106. package/es/components/iho-chat/src/api/index.js +8 -1
  107. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +104 -22
  108. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +191 -29
  109. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +191 -29
  110. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +3 -0
  111. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +783 -101
  112. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +611 -51
  113. package/es/components/iho-chat/src/components/ChatMain.vue2.js +27 -28
  114. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +204 -14
  115. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +175 -10
  116. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +2 -1
  117. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +197 -29
  118. package/es/components/iho-chat/src/components/ChatSet.vue2.js +48 -11
  119. package/es/components/iho-chat/src/components/ContextMenu.js +7 -10
  120. package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +88 -7
  121. package/es/components/iho-chat/src/components/MessageMarkdown.vue.d.ts +158 -0
  122. package/es/components/iho-chat/src/components/MessageMarkdown.vue.js +6 -0
  123. package/es/components/iho-chat/src/components/MessageMarkdown.vue2.js +51 -0
  124. package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +176 -14
  125. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +192 -29
  126. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +2 -1
  127. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +91 -8
  128. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +121 -11
  129. package/es/components/iho-chat/src/components/Video.vue.d.ts +89 -8
  130. package/es/components/iho-chat/src/components/userItemRender.js +2 -1
  131. package/es/components/iho-chat/src/constants/index.d.ts +2 -1
  132. package/es/components/iho-chat/src/constants/index.js +1 -0
  133. package/es/components/iho-chat/src/hooks/useData.d.ts +374 -27
  134. package/es/components/iho-chat/src/hooks/useData.js +31 -10
  135. package/es/components/iho-chat/src/hooks/useStreamOutput.d.ts +6 -0
  136. package/es/components/iho-chat/src/hooks/useStreamOutput.js +100 -0
  137. package/es/components/iho-chat/src/hooks/useVideo.d.ts +89 -7
  138. package/es/components/iho-chat/src/hooks/useWebSocket.js +14 -4
  139. package/es/components/iho-chat/src/types/index.d.ts +39 -7
  140. package/es/components/iho-chat/src/utils/index.d.ts +2 -1
  141. package/es/components/iho-chat/src/utils/sseClient.d.ts +22 -0
  142. package/es/components/iho-chat/src/utils/sseClient.js +97 -0
  143. package/es/components/iho-chat/style/index.css +1 -1
  144. package/es/components/iho-table/index.d.ts +37 -24
  145. package/es/components/iho-table/src/IhoTable.vue.d.ts +37 -24
  146. package/es/components/iho-table/src/IhoTable.vue2.js +7 -2
  147. package/es/components/iho-table/src/constants/index.d.ts +2 -2
  148. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +3 -3
  149. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
  150. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  151. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +30 -4
  152. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue2.js +22 -8
  153. package/es/components/iho-table/src/plugins/highLightSetPlugin.js +7 -2
  154. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
  155. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +28 -0
  156. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +2 -2
  157. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +2 -2
  158. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.d.ts +1 -1
  159. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +8 -2
  160. package/es/components/iho-table/src/types/index.d.ts +3 -1
  161. package/es/components/index.css +1 -1
  162. package/es/components/info-header/index.d.ts +46 -2
  163. package/es/components/info-header/src/InfoHeader.vue.d.ts +46 -2
  164. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +41 -2
  165. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +2 -1
  166. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +41 -2
  167. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.d.ts +20 -1
  168. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.d.ts +20 -1
  169. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue2.js +9 -6
  170. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +42 -2
  171. package/es/components/info-header/src/components/infoDescription/index.vue2.js +1 -1
  172. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -0
  173. package/es/components/scale-view/index.d.ts +1 -1
  174. package/es/components/scale-view/src/ScaleView.vue.d.ts +1 -1
  175. package/es/components/scale-view/src/ScaleView.vue2.js +9 -3
  176. package/es/components/scale-view/src/hooks/use-event.js +56 -22
  177. package/es/components/select-person/index.d.ts +31 -0
  178. package/es/components/select-person/src/SelectPerson.vue.d.ts +14 -0
  179. package/es/components/select-person/src/SelectPerson.vue2.js +36 -8
  180. package/es/components/select-person/src/index.vue.d.ts +31 -0
  181. package/es/components/select-person/src/index.vue2.js +4 -0
  182. package/es/components/shortcut-setter/index.d.ts +1 -0
  183. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
  184. package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +2 -2
  185. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +28 -0
  186. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +28 -0
  187. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +28 -0
  188. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +28 -0
  189. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +56 -0
  190. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +28 -0
  191. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +28 -0
  192. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +56 -0
  193. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +56 -0
  194. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +28 -0
  195. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +30 -0
  196. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +10 -2
  197. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +28 -0
  198. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +30 -0
  199. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +10 -2
  200. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +116 -0
  201. package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +9 -9
  202. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +116 -0
  203. package/es/components/table-filter/src/constants/index.d.ts +1 -0
  204. package/es/components/table-filter/src/constants/index.js +4 -1
  205. package/es/shared/components/Ellipsis/Ellipsis.d.ts +12 -0
  206. package/es/shared/components/Ellipsis/Ellipsis.js +86 -0
  207. package/es/shared/components/Ellipsis/index.d.ts +2 -0
  208. package/es/shared/components/Ellipsis/index.js +2 -0
  209. package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +15 -0
  210. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +24 -10
  211. package/es/shared/package.json.js +1 -1
  212. package/es/shared/types/business.d.ts +3 -2
  213. package/es/shared/utils/business.js +16 -0
  214. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { reactive, computed, watch, toRefs } from 'vue';
1
+ import { reactive, watch, toRefs } from 'vue';
2
2
  import { defaultBorderStyle } from '../useDraw.js';
3
3
  import '../../../../../shared/utils/fabricjs/index.js';
4
4
  import 'date-fns';
@@ -22,101 +22,83 @@ function useBirthProcessChart(canvas, props, emits, canvasRef, pointTipProps, po
22
22
  redrawPoints: null,
23
23
  clickMenu: null
24
24
  });
25
- const leftScales = computed(
26
- () => props.data.scaleValues.map((item) => {
27
- var _a;
28
- return { ...item, width: (_a = item.width) != null ? _a : 60 };
29
- }).filter(({ layout = "left", show = true }) => layout === "left" && show)
30
- );
31
- const rightScales = computed(
32
- () => props.data.scaleValues.map((item) => {
33
- var _a;
34
- return { ...item, width: (_a = item.width) != null ? _a : 60 };
35
- }).filter(({ layout = "left", show = true }) => layout === "right" && show)
36
- );
37
25
  const leftAddAreaWidth = 30;
38
- const rightAddAreaWidth = computed(() => {
39
- var _a;
40
- return !((_a = rightScales.value) == null ? void 0 : _a.length) ? 0 : 30;
41
- });
42
- const originX = computed(() => {
43
- var _a;
44
- const leftScalesWidth = (_a = leftScales.value) == null ? void 0 : _a.reduce((width, item) => {
45
- width += item.width;
46
- return width;
47
- }, 0);
48
- return leftAddAreaWidth + leftScalesWidth;
49
- });
50
- const endX = computed(() => {
51
- var _a;
26
+ function buildDerived() {
27
+ var _a, _b;
28
+ const leftScales = props.data.scaleValues.map((item) => {
29
+ var _a2;
30
+ return { ...item, width: (_a2 = item.width) != null ? _a2 : 60 };
31
+ }).filter(({ layout = "left", show = true }) => layout === "left" && show);
32
+ const rightScales = props.data.scaleValues.map((item) => {
33
+ var _a2;
34
+ return { ...item, width: (_a2 = item.width) != null ? _a2 : 60 };
35
+ }).filter(({ layout = "left", show = true }) => layout === "right" && show);
36
+ const rightAddAreaWidth = !(rightScales == null ? void 0 : rightScales.length) ? 0 : 30;
37
+ const leftScalesWidth = leftScales == null ? void 0 : leftScales.reduce((width2, item) => width2 + item.width, 0);
38
+ const originX = leftAddAreaWidth + leftScalesWidth;
52
39
  const { width } = props.data;
53
- const rightScalesWidth = (_a = rightScales.value) == null ? void 0 : _a.reduce((width2, item) => {
54
- width2 += item.width;
55
- return width2;
56
- }, 0);
57
- return width - rightAddAreaWidth.value - rightScalesWidth;
58
- });
59
- const gridXNumber = computed(() => props.data.grid.mainXCell);
60
- const gridYNumber = computed(() => {
40
+ const rightScalesWidth = rightScales == null ? void 0 : rightScales.reduce((w, item) => w + item.width, 0);
41
+ const endX = width - rightAddAreaWidth - rightScalesWidth;
42
+ const gridXNumber = props.data.grid.mainXCell;
61
43
  const mainYCell = props.data.grid.mainYCell || 14;
62
- const fhrItem = props.data.scaleValues.find((item) => item.show && item.key === "FHR");
63
- return !fhrItem && mainYCell === 14 ? 10 : mainYCell;
64
- });
65
- const xCellWidth = computed(() => {
66
- return (endX.value - originX.value) / gridXNumber.value;
67
- });
68
- const padding = computed(() => {
69
- const p = props.data.padding || [5, 5];
44
+ const fhrItemShow = props.data.scaleValues.find((item) => item.show && item.key === "FHR");
45
+ const gridYNumber = !fhrItemShow && mainYCell === 14 ? 10 : mainYCell;
46
+ const xCellWidth = (endX - originX) / gridXNumber;
47
+ const defaultPadding = props.data.padding || [5, 5];
70
48
  const xAxisNumberTop = getxAxisNumber("top");
71
49
  const xAxisNumberBottom = getxAxisNumber("bottom");
72
- return [xAxisNumberTop ? 0 : p[0], xAxisNumberBottom ? 0 : p[1]];
73
- });
74
- const yCellHeight = computed(() => {
50
+ const padding = [xAxisNumberTop ? 0 : defaultPadding[0], xAxisNumberBottom ? 0 : defaultPadding[1]];
75
51
  const { height } = props.data;
76
- const xAxisNumber = getxAxisNumber();
77
- return (height - padding.value.reduce((p1, p2) => p1 + p2, 0)) / (gridYNumber.value + xAxisNumber);
78
- });
79
- const originY = computed(() => {
80
- const xAxisNumber = getxAxisNumber("top");
81
- return yCellHeight.value * xAxisNumber + padding.value[0];
82
- });
83
- const originYCervix = computed(() => {
84
- var _a;
85
- const { scaleValues } = props.data;
52
+ const xAxisNumberAll = getxAxisNumber();
53
+ const yCellHeight = (height - padding.reduce((p1, p2) => p1 + p2, 0)) / (gridYNumber + xAxisNumberAll);
54
+ const originY = yCellHeight * xAxisNumberTop + padding[0];
55
+ const endY = height - yCellHeight * xAxisNumberBottom - padding[1];
56
+ const scaleValues = props.data.scaleValues;
86
57
  const FHRisShow = (_a = scaleValues.find((item) => item.key === "FHR")) == null ? void 0 : _a.show;
87
- if (!FHRisShow && !originY.value)
88
- return originY.value;
89
58
  const cervixItem = scaleValues.find((item) => item.key === "cervix");
90
59
  const [, max] = (cervixItem == null ? void 0 : cervixItem.range) || [0, 10];
91
60
  const spaceValue = (cervixItem == null ? void 0 : cervixItem.spaceValue) || 1;
92
- return endY.value - padding.value[0] - max * spaceValue * yCellHeight.value;
93
- });
94
- const endY = computed(() => {
95
- const { height } = props.data;
96
- const xAxisNumber = getxAxisNumber("bottom");
97
- return height - yCellHeight.value * xAxisNumber - padding.value[1];
98
- });
99
- const startTime = computed(() => getTime(props.data.xAxis.time.startTime));
100
- const timeXCell = computed(() => 1 * 60 * 60 * 1e3 / xCellWidth.value);
101
- const cervixYCell = computed(() => {
102
- const { scaleValues } = props.data;
103
- const cervixItem = scaleValues.find((item) => item.key === "cervix");
104
- return yCellHeight.value / ((cervixItem == null ? void 0 : cervixItem.spaceValue) || 1);
105
- });
106
- const FHRYCell = computed(() => {
107
- const { scaleValues } = props.data;
108
- const cervixItem = scaleValues.find((item) => item.key === "FHR");
109
- return yCellHeight.value / ((cervixItem == null ? void 0 : cervixItem.spaceValue) || 10);
110
- });
111
- const fetalPresentationYCell = computed(() => {
112
- const { scaleValues } = props.data;
113
- const cervixItem = scaleValues.find((item) => item.key === "fetalPresentation");
114
- return yCellHeight.value / ((cervixItem == null ? void 0 : cervixItem.spaceValue) || 1);
115
- });
116
- const event = computed(() => {
117
- var _a;
118
- return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true, hovered: true };
119
- });
61
+ const originYCervix = !FHRisShow && !originY ? originY : endY - padding[0] - max * spaceValue * yCellHeight;
62
+ const startTime = getTime(props.data.xAxis.time.startTime);
63
+ const timeXCell = 1 * 60 * 60 * 1e3 / xCellWidth;
64
+ const cervixYCell = yCellHeight / ((cervixItem == null ? void 0 : cervixItem.spaceValue) || 1);
65
+ const FHRItem = scaleValues.find((item) => item.key === "FHR");
66
+ const FHRYCell = yCellHeight / ((FHRItem == null ? void 0 : FHRItem.spaceValue) || 10);
67
+ const fetalPresentationItem = scaleValues.find((item) => item.key === "fetalPresentation");
68
+ const fetalPresentationYCell = yCellHeight / ((fetalPresentationItem == null ? void 0 : fetalPresentationItem.spaceValue) || 1);
69
+ const event = ((_b = props.data.grid) == null ? void 0 : _b.event) || { selectable: true, evented: true, hovered: true };
70
+ return {
71
+ canvasWidth: props.data.width,
72
+ canvasHeight: props.data.height,
73
+ borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle },
74
+ selectionStyle: props.data.selectionStyle || {},
75
+ grid: props.data.grid,
76
+ other: props.data.other,
77
+ originX,
78
+ endX,
79
+ originY,
80
+ endY,
81
+ xCellWidth,
82
+ yCellHeight,
83
+ gridXNumber,
84
+ gridYNumber,
85
+ xAxis: props.data.xAxis,
86
+ leftScales,
87
+ rightScales,
88
+ leftAddAreaWidth,
89
+ rightAddAreaWidth,
90
+ startTime,
91
+ timeXCell,
92
+ cervixYCell,
93
+ FHRYCell,
94
+ fetalPresentationYCell,
95
+ scaleValues: props.data.scaleValues,
96
+ event,
97
+ originYCervix,
98
+ scalebarBorder: Reflect.has(props.data, "scalebarBorder") ? props.data.scalebarBorder : true,
99
+ padding
100
+ };
101
+ }
120
102
  function getxAxisNumber(position) {
121
103
  const { xAxis } = props.data;
122
104
  return Object.values(xAxis).reduce((num, item) => {
@@ -125,37 +107,7 @@ function useBirthProcessChart(canvas, props, emits, canvasRef, pointTipProps, po
125
107
  return num;
126
108
  }, 0);
127
109
  }
128
- const propItems = reactive({
129
- canvasWidth: props.data.width,
130
- canvasHeight: props.data.height,
131
- borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle || {} },
132
- selectionStyle: props.data.selectionStyle || {},
133
- grid: props.data.grid,
134
- other: props.data.other,
135
- originX: originX.value,
136
- endX: endX.value,
137
- originY: originY.value,
138
- endY: endY.value,
139
- xCellWidth: xCellWidth.value,
140
- yCellHeight: yCellHeight.value,
141
- gridXNumber: gridXNumber.value,
142
- gridYNumber: gridYNumber.value,
143
- xAxis: props.data.xAxis,
144
- leftScales: leftScales.value,
145
- rightScales: rightScales.value,
146
- leftAddAreaWidth,
147
- rightAddAreaWidth: rightAddAreaWidth.value,
148
- startTime: startTime.value,
149
- timeXCell: timeXCell.value,
150
- cervixYCell: cervixYCell.value,
151
- FHRYCell: FHRYCell.value,
152
- fetalPresentationYCell: fetalPresentationYCell.value,
153
- scaleValues: props.data.scaleValues,
154
- event: event.value,
155
- originYCervix: originYCervix.value,
156
- scalebarBorder: Reflect.has(props.data, "scalebarBorder") ? props.data.scalebarBorder : true,
157
- padding: padding.value
158
- });
110
+ const propItems = reactive(buildDerived());
159
111
  watch(
160
112
  () => canvas.value,
161
113
  (value) => {
@@ -6,6 +6,7 @@ import '../../useEvent.js';
6
6
  import '../../useShadow.js';
7
7
  import '../../useCommon.js';
8
8
  import 'vue';
9
+ import '../../../utils/eventBus.js';
9
10
  import 'date-fns';
10
11
  import '../../../constants/index.js';
11
12
  import '@vueuse/shared';
@@ -48,6 +49,7 @@ function useDetailEvent(polyline, options) {
48
49
  function calcPointData(y) {
49
50
  return getYValue(y / scale);
50
51
  }
52
+ const detailCellWidth = xCellWidth * scale;
51
53
  const detailCellHeight = yCellHeight * scale;
52
54
  function clearDetailGroup() {
53
55
  var _a;
@@ -62,6 +64,7 @@ function useDetailEvent(polyline, options) {
62
64
  const target = event.target;
63
65
  if (!target.points)
64
66
  return;
67
+ const mainXLineOffsetX = event.pointer.x % xCellWidth;
65
68
  const { x: pointerX, y: pointerY } = event.pointer;
66
69
  const currentIdx = Math.floor((pointerX - target.left) / target.width * target.points.length) + lineStartIndex;
67
70
  let startIdx = currentIdx - detailRadius;
@@ -127,10 +130,11 @@ function useDetailEvent(polyline, options) {
127
130
  }
128
131
  function createGrid(points2, targetIdx2) {
129
132
  const subLineOptions = (idx) => idx % GRID_SUBLINE_NUMBER ? gridOptions.subLineStyle : null;
130
- const subLineSpace = detailCellHeight / GRID_SUBLINE_NUMBER;
133
+ const subLineSpaceY = detailCellHeight / GRID_SUBLINE_NUMBER;
134
+ const subLineSpaceX = detailCellWidth / GRID_SUBLINE_NUMBER;
131
135
  const zeroPointY = EMPTY_TOP_SPACE + points2[maxIdx].y / Math.abs(points2[maxIdx].y - points2[minIdx].y) * polylineHeight;
132
- const yTopCellNumber = Math.ceil(zeroPointY / subLineSpace);
133
- const yBottomCellNumber = Math.ceil((renderHeight - zeroPointY) / subLineSpace);
136
+ const yTopCellNumber = Math.ceil(zeroPointY / subLineSpaceY);
137
+ const yBottomCellNumber = Math.ceil((renderHeight - zeroPointY) / subLineSpaceY);
134
138
  function createRowLine(y, idx) {
135
139
  return new fabric.Line([offset.x, offset.y + y, offset.x + renderWidth, offset.y + y], {
136
140
  ...gridOptions.mainLineStyle.x,
@@ -138,21 +142,21 @@ function useDetailEvent(polyline, options) {
138
142
  });
139
143
  }
140
144
  const rowLineGroup = new fabric.Group([
141
- ...range(yBottomCellNumber).map((idx) => createRowLine(idx * subLineSpace + zeroPointY, idx)),
142
- ...range(yTopCellNumber).map((idx) => createRowLine(-(idx * subLineSpace) + zeroPointY, idx))
145
+ ...range(yBottomCellNumber).map((idx) => createRowLine(idx * subLineSpaceY + zeroPointY, idx)),
146
+ ...range(yTopCellNumber).map((idx) => createRowLine(-(idx * subLineSpaceY) + zeroPointY, idx))
143
147
  ]);
144
- const currentPointX = targetIdx2 / points2.length * renderWidth;
145
- const xLeftCellNumber = Math.ceil(currentPointX / subLineSpace);
146
- const xRightCellNumber = Math.ceil((renderWidth - currentPointX) / subLineSpace);
148
+ const currentPointX = targetIdx2 / points2.length * renderWidth - mainXLineOffsetX * scale;
149
+ const xLeftCellNumber = Math.ceil(currentPointX / subLineSpaceX);
150
+ const xRightCellNumber = Math.ceil((renderWidth - currentPointX) / subLineSpaceX);
147
151
  function createColumnLine(x, idx) {
148
152
  return new fabric.Line([offset.x + x, offset.y, offset.x + x, offset.y + renderHeight], {
149
153
  ...gridOptions.mainLineStyle.y,
150
- ...idx === 0 ? gridOptions.subLineStyle : subLineOptions(idx)
154
+ ...subLineOptions(idx)
151
155
  });
152
156
  }
153
157
  const columnLineGroup = new fabric.Group([
154
- ...range(xRightCellNumber).map((idx) => createColumnLine(idx * subLineSpace + currentPointX, idx)),
155
- ...range(xLeftCellNumber).map((idx) => createColumnLine(-(idx * subLineSpace) + currentPointX, idx))
158
+ ...range(xRightCellNumber).map((idx) => createColumnLine(idx * subLineSpaceX + currentPointX, idx)),
159
+ ...range(xLeftCellNumber).map((idx) => createColumnLine(-(idx * subLineSpaceX) + currentPointX, idx))
156
160
  ]);
157
161
  return new fabric.Group([columnLineGroup, rowLineGroup]);
158
162
  }
@@ -2,5 +2,5 @@ import { AnyObject } from '../../../../../shared/types';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { type Ref } from 'vue';
4
4
  export declare function useElectrocardiogram(canvas: Ref<fabric.Canvas>, propItems: AnyObject, flag: Ref<boolean>): {
5
- updatePolyline: (value: number) => void;
5
+ updatePolyline: (percent: number) => void;
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import { fabric } from '../../../../../shared/utils/fabricjs/index.js';
2
- import { useThrottleFn } from '@vueuse/core';
2
+ import { useDebounceFn, useThrottleFn } from '@vueuse/core';
3
3
  import { range } from 'lodash-es';
4
4
  import { useDetailEvent } from './hooks/useDetailEvent.js';
5
5
  import { defaultStyle, drawLine } from '../useDraw.js';
@@ -9,6 +9,7 @@ import '../useEvent.js';
9
9
  import '../useShadow.js';
10
10
  import '../useCommon.js';
11
11
  import 'vue';
12
+ import '../../utils/eventBus.js';
12
13
  import 'date-fns';
13
14
  import { ECG } from '../../constants/index.js';
14
15
  import '@vueuse/shared';
@@ -36,7 +37,8 @@ function useElectrocardiogram(canvas, propItems, flag) {
36
37
  titleStyle,
37
38
  titleOffset,
38
39
  config,
39
- calibrationLineHeight
40
+ calibrationLineHeight,
41
+ maxLineNumber
40
42
  } = propItems;
41
43
  const gridPoints = /* @__PURE__ */ new Set();
42
44
  const fixedPointsCache = /* @__PURE__ */ new Set();
@@ -59,28 +61,33 @@ function useElectrocardiogram(canvas, propItems, flag) {
59
61
  drawPolyLine();
60
62
  }
61
63
  function getShowLength(list = []) {
62
- const showLength = ~~(list.length / columnNumber);
64
+ const overflowIsScroll = config.overflow === "scroll";
65
+ const showLength = ~~(list.length / columnNumber / (overflowIsScroll ? 2 : 1));
63
66
  return showLength * (config.mainXCellValue / ECG.DEFAULTMAINXCELLVALUE);
64
67
  }
65
68
  function drawPolyLine(startIdx = 0) {
69
+ const overflowIsScroll = config.overflow === "scroll";
66
70
  dataList.forEach((lineItem, idx) => {
67
- if (idx === dataList.length - 1 && arguments.length)
71
+ if (idx === maxLineNumber - 1 && arguments.length && !overflowIsScroll)
68
72
  return;
69
73
  const { x, y, rowIdx, limitX } = lineItem.origin;
70
- const showLength = getShowLength(lineItem.data);
71
- const points = lineItem.data.reduce((res, value, _idx) => {
72
- let _res = idx < ECG.MAXLINENUMBER - 1 && _idx >= startIdx && _idx <= startIdx + showLength || idx === ECG.MAXLINENUMBER - 1 ? [{ x: computedX(res.length + 1), y: computedY(-+value) + y }] : [];
73
- if (_res.length) {
74
- if (idx < ECG.MAXLINENUMBER - 1 && _res[0].x > limitX) {
75
- _res = [];
76
- }
74
+ const lineLength = lineItem.data.length;
75
+ const showLength = idx < maxLineNumber - 1 ? getShowLength(lineItem.data) : lineLength;
76
+ const points = [];
77
+ let pointIndex = 0;
78
+ for (let _idx = startIdx; _idx <= startIdx + showLength && _idx < lineLength; _idx++) {
79
+ const value = lineItem.data[_idx];
80
+ const point = { x: computedX(pointIndex + 1), y: computedY(-+value) + y };
81
+ if (idx < maxLineNumber - 1 && point.x > limitX) {
82
+ break;
77
83
  }
78
- return res.concat(_res);
79
- }, []);
84
+ points.push(point);
85
+ pointIndex++;
86
+ }
80
87
  const polyline = new fabric.Polyline(points, {
88
+ strokeWidth: 1,
81
89
  ...lineStyle,
82
90
  fill: "transparent",
83
- strokeWidth: 1,
84
91
  left: x,
85
92
  hasControls: false,
86
93
  hasBorders: false,
@@ -102,8 +109,7 @@ function useElectrocardiogram(canvas, propItems, flag) {
102
109
  detailRadius: 370,
103
110
  beforeEvent: () => flag.value && Promise.reject()
104
111
  });
105
- polyline.startIdx = startIdx;
106
- if (idx < dataList.length - 1) {
112
+ if (idx < maxLineNumber - 1 || overflowIsScroll) {
107
113
  gridPoints.add(polyline);
108
114
  } else {
109
115
  fixedPointsCache.add(polyline);
@@ -184,24 +190,30 @@ function useElectrocardiogram(canvas, propItems, flag) {
184
190
  });
185
191
  canvas.value.add(...lines);
186
192
  }
187
- const updatePolyline = useThrottleFn((value) => {
188
- const showLength = getShowLength(dataList[dataList.length - 1].data);
189
- if (showLength === dataList[0].data.length)
193
+ let currentStartIdx = -1;
194
+ let isUpdating = false;
195
+ const debouncedUpdate = useDebounceFn((startIdx) => {
196
+ if (isUpdating || currentStartIdx === startIdx)
190
197
  return;
191
- const totalLength = dataList[dataList.length - 1].data.length;
192
- const centerIdx = value / 100 * totalLength;
193
- const _startIdx = centerIdx - showLength / 2;
194
- const startIdx = _startIdx + showLength > totalLength ? totalLength - showLength : Math.max(0, _startIdx);
198
+ isUpdating = true;
199
+ currentStartIdx = startIdx;
195
200
  fabric.util.requestAnimFrame(() => {
196
201
  if (gridPoints.size) {
197
- const [firstPoint] = [...gridPoints];
198
- if (firstPoint.startIdx === startIdx)
199
- return;
200
- [...gridPoints].forEach((point) => canvas.value.remove(point));
202
+ const pointsArray = [...gridPoints];
203
+ canvas.value.remove(...pointsArray);
201
204
  gridPoints.clear();
202
205
  }
203
206
  drawPolyLine(startIdx);
207
+ isUpdating = false;
204
208
  });
209
+ }, 100);
210
+ const updatePolyline = useThrottleFn((percent) => {
211
+ const showLength = getShowLength(dataList[dataList.length - 1].data);
212
+ if (showLength === dataList[0].data.length)
213
+ return;
214
+ const totalLength = dataList[dataList.length - 1].data.length;
215
+ const startIdx = ~~(percent * totalLength);
216
+ debouncedUpdate(startIdx);
205
217
  }, 150);
206
218
  function drawBorder() {
207
219
  const { strokeWidth } = borderStyle;
@@ -5,8 +5,8 @@ import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabri
5
5
  import { ECG } from '../../../../../components/fabric-chart/src/constants';
6
6
  export declare function useElectrocardiogramChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
7
7
  getGridInfo: () => {
8
- cellWidth: number;
9
- cellHeight: number;
8
+ cellWidth: any;
9
+ cellHeight: any;
10
10
  smallCellNumber: ECG;
11
11
  };
12
12
  select?: Ref<import("../../../../../shared/types").AnyFn | null | undefined, import("../../../../../shared/types").AnyFn | null | undefined> | undefined;