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.
- package/es/_virtual/_virtual_i18n-methods.js +5 -1
- package/es/components/audio-sdk/index.d.ts +4 -4
- package/es/components/audio-sdk/src/Index.vue.d.ts +4 -4
- package/es/components/audio-sdk/src/components/recording-modal.vue.d.ts +4 -4
- package/es/components/audio-sdk/src/components/recording.vue.d.ts +4 -4
- package/es/components/base-search/index.d.ts +34 -0
- package/es/components/base-search/src/index.vue.d.ts +34 -0
- package/es/components/base-search/src/index.vue2.js +9 -1
- package/es/components/button-print/index.d.ts +32 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +32 -0
- package/es/components/button-print/src/ButtonPrint.vue2.js +4 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +73 -48
- package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +11 -0
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +35 -0
- package/es/components/button-print/src/utils/print.d.ts +1 -1
- package/es/components/button-print/src/utils/print.js +4 -2
- package/es/components/callback/src/components/render/popupMaps.d.ts +38 -24
- package/es/components/classification/index.d.ts +84 -0
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +84 -0
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +84 -0
- package/es/components/classification/src/index.vue.d.ts +84 -0
- package/es/components/classification/src/index.vue2.js +7 -0
- package/es/components/date-picker/index.d.ts +28 -0
- package/es/components/date-picker/src/DatePicker.vue.d.ts +28 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +26 -1
- package/es/components/expand-field/index.d.ts +31 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +31 -0
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +31 -0
- package/es/components/expand-field/src/components/form.vue.d.ts +31 -0
- package/es/components/expand-field/src/index.vue.d.ts +31 -0
- package/es/components/fabric-chart/index.d.ts +3 -3
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +3 -3
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -0
- package/es/components/fabric-chart/src/components/PopupMenu.d.ts +4 -4
- package/es/components/fabric-chart/src/components/PopupMenu.js +57 -39
- package/es/components/fabric-chart/src/constants/index.d.ts +19 -5
- package/es/components/fabric-chart/src/constants/index.js +26 -11
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.d.ts +4 -3
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +119 -193
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +69 -117
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +15 -11
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +39 -27
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +2 -2
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +86 -122
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -0
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +65 -113
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +4 -3
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +63 -37
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +31 -14
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +4 -3
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +6 -7
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +152 -208
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +4 -3
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +8 -9
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -0
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +4 -3
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +138 -229
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +5 -2
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +195 -273
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -0
- package/es/components/fabric-chart/src/interface.d.ts +14 -1
- package/es/components/fabric-chart/src/utils/eventBus.d.ts +2 -0
- package/es/components/fabric-chart/src/utils/eventBus.js +5 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +1 -1
- package/es/components/fabric-chart/src/utils/index.js +2 -10
- package/es/components/fabric-chart/style/index.css +1 -1
- package/es/components/field-editor/index.d.ts +1 -0
- package/es/components/field-editor/src/FieldEditor.vue.d.ts +1 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +57 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +3 -1
- package/es/components/field-set/src/components/condition.vue.d.ts +28 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +56 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +28 -0
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +24 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +24 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +19 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +48 -24
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +1 -0
- package/es/components/form-config/src/constants/index.d.ts +2 -0
- package/es/components/form-config/src/constants/index.js +2 -0
- package/es/components/form-config/src/hooks/useConfigurationField.js +20 -3
- package/es/components/form-render/index.d.ts +1 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +1 -0
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -0
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -0
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -0
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -0
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +3 -2
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -0
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useNewLowCodeReactions.js +8 -0
- package/es/components/form-render/src/types/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.d.ts +1 -1
- package/es/components/form-render/src/utils/index.js +5 -2
- package/es/components/iho-chat/index.d.ts +2757 -300
- package/es/components/iho-chat/src/Index.vue.d.ts +2757 -300
- package/es/components/iho-chat/src/Index.vue2.js +5 -3
- package/es/components/iho-chat/src/api/index.d.ts +89 -16
- package/es/components/iho-chat/src/api/index.js +8 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +104 -22
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +191 -29
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +191 -29
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +3 -0
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +783 -101
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +611 -51
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +27 -28
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +204 -14
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +175 -10
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +2 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +197 -29
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +48 -11
- package/es/components/iho-chat/src/components/ContextMenu.js +7 -10
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +88 -7
- package/es/components/iho-chat/src/components/MessageMarkdown.vue.d.ts +158 -0
- package/es/components/iho-chat/src/components/MessageMarkdown.vue.js +6 -0
- package/es/components/iho-chat/src/components/MessageMarkdown.vue2.js +51 -0
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +176 -14
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +192 -29
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +2 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +91 -8
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +121 -11
- package/es/components/iho-chat/src/components/Video.vue.d.ts +89 -8
- package/es/components/iho-chat/src/components/userItemRender.js +2 -1
- package/es/components/iho-chat/src/constants/index.d.ts +2 -1
- package/es/components/iho-chat/src/constants/index.js +1 -0
- package/es/components/iho-chat/src/hooks/useData.d.ts +374 -27
- package/es/components/iho-chat/src/hooks/useData.js +31 -10
- package/es/components/iho-chat/src/hooks/useStreamOutput.d.ts +6 -0
- package/es/components/iho-chat/src/hooks/useStreamOutput.js +100 -0
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +89 -7
- package/es/components/iho-chat/src/hooks/useWebSocket.js +14 -4
- package/es/components/iho-chat/src/types/index.d.ts +39 -7
- package/es/components/iho-chat/src/utils/index.d.ts +2 -1
- package/es/components/iho-chat/src/utils/sseClient.d.ts +22 -0
- package/es/components/iho-chat/src/utils/sseClient.js +97 -0
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/index.d.ts +37 -24
- package/es/components/iho-table/src/IhoTable.vue.d.ts +37 -24
- package/es/components/iho-table/src/IhoTable.vue2.js +7 -2
- package/es/components/iho-table/src/constants/index.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +3 -3
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
- package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +30 -4
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue2.js +22 -8
- package/es/components/iho-table/src/plugins/highLightSetPlugin.js +7 -2
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +28 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.d.ts +2 -2
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.d.ts +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +8 -2
- package/es/components/iho-table/src/types/index.d.ts +3 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +46 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +46 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +41 -2
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +2 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +41 -2
- package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.d.ts +20 -1
- package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.d.ts +20 -1
- package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue2.js +9 -6
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +42 -2
- package/es/components/info-header/src/components/infoDescription/index.vue2.js +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -0
- package/es/components/scale-view/index.d.ts +1 -1
- package/es/components/scale-view/src/ScaleView.vue.d.ts +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +9 -3
- package/es/components/scale-view/src/hooks/use-event.js +56 -22
- package/es/components/select-person/index.d.ts +31 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +14 -0
- package/es/components/select-person/src/SelectPerson.vue2.js +36 -8
- package/es/components/select-person/src/index.vue.d.ts +31 -0
- package/es/components/select-person/src/index.vue2.js +4 -0
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +2 -2
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +28 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +56 -0
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +56 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +56 -0
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +30 -0
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue2.js +10 -2
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +28 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +30 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +10 -2
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +116 -0
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +9 -9
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +116 -0
- package/es/components/table-filter/src/constants/index.d.ts +1 -0
- package/es/components/table-filter/src/constants/index.js +4 -1
- package/es/shared/components/Ellipsis/Ellipsis.d.ts +12 -0
- package/es/shared/components/Ellipsis/Ellipsis.js +86 -0
- package/es/shared/components/Ellipsis/index.d.ts +2 -0
- package/es/shared/components/Ellipsis/index.js +2 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +15 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +24 -10
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +3 -2
- package/es/shared/utils/business.js +16 -0
- package/package.json +3 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { reactive,
|
|
1
|
+
import { reactive, watch, toRefs } from 'vue';
|
|
2
2
|
import { defaultBorderStyle, defaultLineStyle, defaultTextStyle } from '../useDraw.js';
|
|
3
3
|
import '../../../../../shared/utils/fabricjs/index.js';
|
|
4
4
|
import 'date-fns';
|
|
5
|
-
import {
|
|
5
|
+
import { getRoundNumber } from '../../utils/index.js';
|
|
6
|
+
import { cloneDeep, last, isNumber } from 'lodash-es';
|
|
6
7
|
import '../useEvent.js';
|
|
7
8
|
import '../useShadow.js';
|
|
8
9
|
import '../useCommon.js';
|
|
@@ -25,142 +26,105 @@ function useElectrocardiogramChart(canvas, props, emits, canvasRef, pointTipProp
|
|
|
25
26
|
useRectRuler: null
|
|
26
27
|
});
|
|
27
28
|
const originX = 0, originY = 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const xCellWidth = computed(() => {
|
|
40
|
-
return (endX.value - originX) / gridXNumber.value;
|
|
41
|
-
});
|
|
42
|
-
const yCellHeight = computed(() => {
|
|
43
|
-
return (endY.value - originY) / gridYNumber.value;
|
|
44
|
-
});
|
|
45
|
-
const gridXNumber = computed(() => {
|
|
46
|
-
var _a, _b, _c;
|
|
47
|
-
const { config, grid } = props.data;
|
|
48
|
-
if (isNumber(grid.gridXNumber))
|
|
49
|
-
return grid.gridXNumber;
|
|
50
|
-
const totalLength = (_c = (_b = (_a = last(__dataList.value)) == null ? void 0 : _a.data) == null ? void 0 : _b.length) != null ? _c : 0;
|
|
29
|
+
function buildDerived() {
|
|
30
|
+
var _a, _b, _c, _d, _e, _f;
|
|
31
|
+
const endX = props.data.width;
|
|
32
|
+
const endY = props.data.height;
|
|
33
|
+
const { dataList = [], config = {} } = props.data;
|
|
34
|
+
const list = cloneDeep(dataList);
|
|
35
|
+
const matchItem = list.find((item) => config.lastDataKey && item.key === config.lastDataKey);
|
|
36
|
+
const __dataList = matchItem ? [...list, matchItem] : list;
|
|
37
|
+
const maxLineNumber = list.length + 1;
|
|
38
|
+
const { grid } = props.data;
|
|
39
|
+
const totalLength = (_c = (_b = (_a = last(__dataList)) == null ? void 0 : _a.data) == null ? void 0 : _b.length) != null ? _c : 0;
|
|
51
40
|
const totalSeconds = totalLength / config.hz;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const gridYNumber = computed(() => {
|
|
55
|
-
const { config, grid } = props.data;
|
|
56
|
-
if (isNumber(grid.gridYNumber))
|
|
57
|
-
return grid.gridYNumber;
|
|
58
|
-
const totalLineLength = __dataList.value.length;
|
|
59
|
-
return Math.ceil(totalValueMV.value * totalLineLength * 2 / config.mainYCellValue);
|
|
60
|
-
});
|
|
61
|
-
const totalValueMV = computed(() => {
|
|
62
|
-
var _a;
|
|
63
|
-
const { config } = props.data;
|
|
64
|
-
const totalData = (_a = last(__dataList.value)) == null ? void 0 : _a.data;
|
|
41
|
+
const gridXNumber = isNumber(grid.gridXNumber) ? grid.gridXNumber : Math.ceil(totalSeconds / config.mainXCellValue);
|
|
42
|
+
const totalData = ((_d = last(__dataList)) == null ? void 0 : _d.data) || [];
|
|
65
43
|
const maxValue = Math.max(...totalData);
|
|
66
44
|
const minValue = Math.min(...totalData);
|
|
67
45
|
const totalValue = maxValue - minValue;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
const rowSpace = computed(() => {
|
|
83
|
-
const { rowNumber } = layoutInfo.value;
|
|
84
|
-
const totalLineLength = __dataList.value.length;
|
|
85
|
-
return Math.round(gridYNumber.value / (rowNumber + (totalLineLength === ECG.MAXLINENUMBER ? 1 : 0)));
|
|
86
|
-
});
|
|
87
|
-
const dataList = computed(() => {
|
|
88
|
-
const { width, config, grid } = props.data;
|
|
89
|
-
const { columnNumber, rowNumber } = layoutInfo.value;
|
|
90
|
-
const columnWidth = width / columnNumber;
|
|
91
|
-
const dataListLen = __dataList.value.length;
|
|
92
|
-
const baseYCellNumber = Math.ceil(rowSpace.value / 2);
|
|
93
|
-
const firstRowLineMaxHeight = getFirstRowLineMaxHeight();
|
|
94
|
-
const _baseY = yCellHeight.value * baseYCellNumber;
|
|
95
|
-
const baseY = columnNumber === 1 || _baseY < firstRowLineMaxHeight ? yCellHeight.value * Math.ceil(firstRowLineMaxHeight / yCellHeight.value) : _baseY;
|
|
96
|
-
const baseX = xCellWidth.value;
|
|
97
|
-
return __dataList.value.map((item, idx) => {
|
|
98
|
-
const itemRowIdx = ECG.MAXLINENUMBER === dataListLen && idx === dataListLen - 1 ? rowNumber : idx % rowNumber;
|
|
99
|
-
const itemColumnIdx = ECG.MAXLINENUMBER === dataListLen && idx === dataListLen - 1 ? 0 : Math.floor(idx / rowNumber);
|
|
100
|
-
return {
|
|
101
|
-
...item,
|
|
102
|
-
origin: {
|
|
103
|
-
x: itemColumnIdx * columnWidth + baseX,
|
|
104
|
-
y: itemRowIdx * (yCellHeight.value * rowSpace.value) + baseY,
|
|
105
|
-
rowIdx: itemRowIdx,
|
|
106
|
-
limitX: columnWidth - baseX
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
});
|
|
46
|
+
const totalValueMV = config.valueUnit === "uv" ? totalValue * 1e-3 : config.valueUnit === "v" ? totalValue * 1e3 : totalValue;
|
|
47
|
+
const totalLineLength = __dataList.length;
|
|
48
|
+
const gridYNumber = isNumber(grid.gridYNumber) ? grid.gridYNumber : Math.ceil(totalValueMV * totalLineLength * 2 / config.mainYCellValue);
|
|
49
|
+
const xCellWidth = (endX - originX) / gridXNumber;
|
|
50
|
+
const yCellHeight = (endY - originY) / gridYNumber;
|
|
51
|
+
const event = ((_e = props.data.grid) == null ? void 0 : _e.event) || { selectable: true, evented: true };
|
|
52
|
+
const columnNumber = +(props.data.columnNumber || 2);
|
|
53
|
+
const rowNumber = Math.ceil(list.length / columnNumber);
|
|
54
|
+
const dataRowNumber = rowNumber + (totalLineLength === maxLineNumber ? 1 : 0);
|
|
55
|
+
const rowSpace = props.data.isFullyCovered ? getRoundNumber((gridYNumber - 2) / dataRowNumber, 100) : ~~(gridYNumber / dataRowNumber);
|
|
56
|
+
const columnWidth = props.data.width / columnNumber;
|
|
57
|
+
const baseYCellNumber = Math.ceil(rowSpace / 2);
|
|
110
58
|
function getFirstRowLineMaxHeight() {
|
|
111
|
-
const { valueUnit, mainYCellValue } = config;
|
|
112
|
-
const data1 = __dataList
|
|
59
|
+
const { valueUnit, mainYCellValue: mainYCellValue2 } = config;
|
|
60
|
+
const data1 = __dataList[0].data;
|
|
113
61
|
const data1Max = Math.max(...data1);
|
|
114
62
|
const data1MaxHeight = computedY(data1Max);
|
|
115
63
|
if (columnNumber !== 2) {
|
|
116
64
|
return data1MaxHeight;
|
|
117
65
|
}
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
const
|
|
121
|
-
return Math.max(data1MaxHeight,
|
|
66
|
+
const halfIndexData = __dataList[rowNumber].data;
|
|
67
|
+
const halfIndexDataMax = Math.max(...halfIndexData);
|
|
68
|
+
const halfIndexDataMaxHeight = computedY(halfIndexDataMax);
|
|
69
|
+
return Math.max(data1MaxHeight, halfIndexDataMaxHeight);
|
|
122
70
|
function computedY(value) {
|
|
123
71
|
const currentMV = valueUnit === "uv" ? value * 1e-3 : valueUnit === "v" ? value * 1e3 : value;
|
|
124
|
-
return currentMV /
|
|
72
|
+
return currentMV / mainYCellValue2 * yCellHeight;
|
|
125
73
|
}
|
|
126
74
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
75
|
+
const firstRowLineMaxHeight = getFirstRowLineMaxHeight();
|
|
76
|
+
const _baseY = yCellHeight * baseYCellNumber;
|
|
77
|
+
const baseYNumber = props.data.isFullyCovered ? getRoundNumber(firstRowLineMaxHeight / yCellHeight, 100) : Math.ceil(firstRowLineMaxHeight / yCellHeight);
|
|
78
|
+
const baseY = columnNumber === 1 || _baseY < firstRowLineMaxHeight ? yCellHeight * baseYNumber : _baseY;
|
|
79
|
+
const baseX = xCellWidth;
|
|
80
|
+
const derivedDataList = __dataList.map((item, idx) => {
|
|
81
|
+
const isLastLine = maxLineNumber === totalLineLength && idx === totalLineLength - 1;
|
|
82
|
+
const itemRowIdx = isLastLine ? rowNumber : idx % rowNumber;
|
|
83
|
+
const itemColumnIdx = isLastLine ? 0 : ~~(idx / rowNumber);
|
|
84
|
+
return {
|
|
85
|
+
...item,
|
|
86
|
+
origin: {
|
|
87
|
+
x: itemColumnIdx * columnWidth + baseX,
|
|
88
|
+
y: itemRowIdx * (yCellHeight * rowSpace) + baseY,
|
|
89
|
+
rowIdx: itemRowIdx,
|
|
90
|
+
limitX: columnWidth - baseX
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
const { calibrationLineGridYNumber, mainYCellValue } = ((_f = props.data) == null ? void 0 : _f.config) || {};
|
|
95
|
+
const calibrationLineHeight = calibrationLineGridYNumber ? yCellHeight * calibrationLineGridYNumber : mainYCellValue ? yCellHeight / mainYCellValue : yCellHeight;
|
|
96
|
+
return {
|
|
97
|
+
canvasWidth: props.data.width,
|
|
98
|
+
canvasHeight: props.data.height,
|
|
99
|
+
borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle },
|
|
100
|
+
lineStyle: { ...defaultLineStyle, ...props.data.lineStyle },
|
|
101
|
+
titleStyle: { ...defaultTextStyle, ...props.data.titleStyle },
|
|
102
|
+
titleOffset: props.data.titleOffset,
|
|
103
|
+
measureLineStyle: { ...defaultLineStyle, ...props.data.measureLineStyle },
|
|
104
|
+
measureTextStyle: { ...defaultTextStyle, ...props.data.measureTextStyle },
|
|
105
|
+
grid: props.data.grid,
|
|
106
|
+
originX,
|
|
107
|
+
endX,
|
|
108
|
+
originY,
|
|
109
|
+
endY,
|
|
110
|
+
xCellWidth,
|
|
111
|
+
yCellHeight,
|
|
112
|
+
gridXNumber,
|
|
113
|
+
gridYNumber,
|
|
114
|
+
event,
|
|
115
|
+
dataList: derivedDataList,
|
|
116
|
+
columnNumber,
|
|
117
|
+
rowNumber,
|
|
118
|
+
config: props.data.config,
|
|
119
|
+
calibrationLineHeight,
|
|
120
|
+
maxLineNumber
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const propItems = reactive(buildDerived());
|
|
160
124
|
function getGridInfo() {
|
|
161
125
|
return {
|
|
162
|
-
cellWidth: xCellWidth
|
|
163
|
-
cellHeight: yCellHeight
|
|
126
|
+
cellWidth: propItems.xCellWidth,
|
|
127
|
+
cellHeight: propItems.yCellHeight,
|
|
164
128
|
smallCellNumber: ECG.SMALLCELLNUMBER
|
|
165
129
|
};
|
|
166
130
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref,
|
|
1
|
+
import { ref, reactive, watch } from 'vue';
|
|
2
2
|
import { defaultBorderStyle } from '../useDraw.js';
|
|
3
3
|
import '../../../../../shared/utils/fabricjs/index.js';
|
|
4
4
|
import { format } from 'date-fns';
|
|
@@ -18,125 +18,77 @@ import { useNewBirthProcess } from './useNewBirthProcess.js';
|
|
|
18
18
|
|
|
19
19
|
function useNewBirthProcessChart(canvas, props, emits, canvasRef, pointTipProps, pointMenuProps) {
|
|
20
20
|
const redrawPoints = ref();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
width += item.width;
|
|
32
|
-
return width;
|
|
33
|
-
}, 0);
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
const endX = computed(() => {
|
|
37
|
-
var _a;
|
|
38
|
-
const { width } = props.data;
|
|
39
|
-
const rightScalesWidth = (_a = rightScales.value) == null ? void 0 : _a.reduce((width2, item) => {
|
|
40
|
-
width2 += item.width;
|
|
41
|
-
return width2;
|
|
42
|
-
}, 0);
|
|
43
|
-
return width - (rightScalesWidth || 15);
|
|
44
|
-
});
|
|
45
|
-
const gridXNumber = computed(() => props.data.grid.mainXCell || 20);
|
|
46
|
-
const gridYNumber = computed(() => props.data.grid.mainYCell || 8);
|
|
47
|
-
const xCellWidth = computed(() => {
|
|
48
|
-
return (endX.value - originX.value) / gridXNumber.value;
|
|
49
|
-
});
|
|
50
|
-
const yCellHeight = computed(() => {
|
|
51
|
-
var _a;
|
|
21
|
+
function buildDerived() {
|
|
22
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
23
|
+
const leftScales = props.data.scaleValues.filter((item) => item.layout === "left" && item.show);
|
|
24
|
+
const rightScales = props.data.scaleValues.filter((item) => item.layout === "right" && item.show);
|
|
25
|
+
const originX = leftScales == null ? void 0 : leftScales.reduce((width, item) => width + item.width, 0);
|
|
26
|
+
const rightScalesWidth = rightScales == null ? void 0 : rightScales.reduce((width, item) => width + item.width, 0);
|
|
27
|
+
const endX = props.data.width - (rightScalesWidth || 15);
|
|
28
|
+
const gridXNumber = props.data.grid.mainXCell || 20;
|
|
29
|
+
const gridYNumber = props.data.grid.mainYCell || 8;
|
|
30
|
+
const timeXAxisHeight = ((_b = (_a = leftScales.concat(rightScales)) == null ? void 0 : _a.length) != null ? _b : 0) > 0 ? 20 : 0;
|
|
52
31
|
const { xAxis, height, other } = props.data;
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, 0);
|
|
69
|
-
const hasAlertLine = ((_a = other == null ? void 0 : other.alertLineList.length) != null ? _a : 0) > 0;
|
|
70
|
-
return yCellHeight.value * (xAxisNumber || hasAlertLine ? 1 : 0);
|
|
71
|
-
});
|
|
72
|
-
const endY = computed(() => {
|
|
73
|
-
const { xAxis, height } = props.data;
|
|
74
|
-
const xAxisNumber = Object.values(xAxis).reduce((num, item) => {
|
|
75
|
-
if (item.show && item.position === "bottom")
|
|
76
|
-
num++;
|
|
77
|
-
return num;
|
|
78
|
-
}, 0);
|
|
79
|
-
return height - yCellHeight.value * xAxisNumber - timeXAxisHeight.value;
|
|
80
|
-
});
|
|
81
|
-
const timeXAxisHeight = computed(() => {
|
|
82
|
-
const scalesList = leftScales.value.concat(rightScales.value);
|
|
83
|
-
return (scalesList == null ? void 0 : scalesList.length) > 0 ? 20 : 0;
|
|
84
|
-
});
|
|
85
|
-
const startTime = computed(() => getTime(props.data.xAxis.time.startTime));
|
|
86
|
-
const timeXCell = computed(() => {
|
|
32
|
+
const xAxisNumberAll = Object.values(xAxis).reduce((num, item) => item.show ? num + 1 : num, 0);
|
|
33
|
+
const hasAlertLine = ((_c = other == null ? void 0 : other.alertLineList.length) != null ? _c : 0) > 0;
|
|
34
|
+
const yCellHeight = (height - timeXAxisHeight) / (gridYNumber + xAxisNumberAll + (hasAlertLine ? 1 : 0));
|
|
35
|
+
const xAxisNumberTop = Object.values(xAxis).reduce(
|
|
36
|
+
(num, item) => item.show && item.position === "top" ? num + 1 : num,
|
|
37
|
+
0
|
|
38
|
+
);
|
|
39
|
+
const originY = yCellHeight * (xAxisNumberTop || hasAlertLine ? 1 : 0);
|
|
40
|
+
const xAxisNumberBottom = Object.values(xAxis).reduce(
|
|
41
|
+
(num, item) => item.show && item.position === "bottom" ? num + 1 : num,
|
|
42
|
+
0
|
|
43
|
+
);
|
|
44
|
+
const endY = height - yCellHeight * xAxisNumberBottom - timeXAxisHeight;
|
|
45
|
+
const xCellWidth = (endX - originX) / gridXNumber;
|
|
46
|
+
const startTime = getTime(props.data.xAxis.time.startTime);
|
|
87
47
|
const { spaceValue, spaceGridNumber } = props.data.xAxis.time || {};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const extraTimeXAxisList = computed(() => {
|
|
91
|
-
var _a, _b, _c;
|
|
92
|
-
const scalesTimeList = (_c = (_b = (_a = leftScales.value.concat(rightScales.value)) == null ? void 0 : _a[0]) == null ? void 0 : _b.data) == null ? void 0 : _c.map((item) => getTime(item.time));
|
|
48
|
+
const timeXCell = spaceValue * 60 * 60 * 1e3 / (xCellWidth * spaceGridNumber);
|
|
49
|
+
const scalesTimeList = ((_f = (_e = (_d = leftScales.concat(rightScales)) == null ? void 0 : _d[0]) == null ? void 0 : _e.data) == null ? void 0 : _f.map((item) => getTime(item.time))) || [];
|
|
93
50
|
const min = Math.min(...scalesTimeList);
|
|
94
51
|
let max = Math.min(Math.max(...scalesTimeList));
|
|
95
|
-
const timesXCell = timeXCell
|
|
96
|
-
const xCellTimeList = range(1, gridXNumber
|
|
97
|
-
(timeList, cur
|
|
98
|
-
[startTime
|
|
52
|
+
const timesXCell = timeXCell * xCellWidth;
|
|
53
|
+
const xCellTimeList = range(1, gridXNumber + 1).reduce(
|
|
54
|
+
(timeList, cur) => timeList.concat(startTime + cur * timesXCell),
|
|
55
|
+
[startTime]
|
|
99
56
|
);
|
|
100
|
-
max = Math.min(max, last(xCellTimeList));
|
|
57
|
+
max = Math.min(max, (_g = last(xCellTimeList)) != null ? _g : max);
|
|
101
58
|
const startIndx = xCellTimeList.findIndex((time) => Math.abs(time - min) < timesXCell);
|
|
102
59
|
const endIndx = xCellTimeList.findIndex((time) => Math.abs(time - max) < timesXCell) + 1;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
scaleValues: props.data.scaleValues,
|
|
136
|
-
timeXAxisHeight: timeXAxisHeight.value,
|
|
137
|
-
extraTimeXAxisList: extraTimeXAxisList.value,
|
|
138
|
-
event: event.value
|
|
139
|
-
});
|
|
60
|
+
const extraTimeXAxisList = xCellTimeList.filter((time, idx) => idx >= startIndx && idx <= endIndx).map((time) => format(new Date(time), "yyyy-MM-dd HH:mm:ss"));
|
|
61
|
+
const cervixItem = props.data.scaleValues.find((item) => item.key === "cervix");
|
|
62
|
+
const cervixYCell = yCellHeight / ((cervixItem == null ? void 0 : cervixItem.spaceValue) || 1);
|
|
63
|
+
const event = ((_h = props.data.grid) == null ? void 0 : _h.event) || { selectable: true, evented: true, hovered: true };
|
|
64
|
+
return {
|
|
65
|
+
canvasWidth: props.data.width,
|
|
66
|
+
canvasHeight: props.data.height,
|
|
67
|
+
borderStyle: { ...defaultBorderStyle, ...props.data.borderStyle },
|
|
68
|
+
selectionStyle: props.data.selectionStyle || {},
|
|
69
|
+
grid: props.data.grid,
|
|
70
|
+
other: props.data.other,
|
|
71
|
+
originX,
|
|
72
|
+
endX,
|
|
73
|
+
originY,
|
|
74
|
+
endY,
|
|
75
|
+
xCellWidth,
|
|
76
|
+
yCellHeight,
|
|
77
|
+
gridXNumber,
|
|
78
|
+
gridYNumber,
|
|
79
|
+
xAxis: props.data.xAxis,
|
|
80
|
+
leftScales,
|
|
81
|
+
rightScales,
|
|
82
|
+
startTime,
|
|
83
|
+
timeXCell,
|
|
84
|
+
cervixYCell,
|
|
85
|
+
scaleValues: props.data.scaleValues,
|
|
86
|
+
timeXAxisHeight,
|
|
87
|
+
extraTimeXAxisList,
|
|
88
|
+
event
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const propItems = reactive(buildDerived());
|
|
140
92
|
watch(
|
|
141
93
|
() => canvas.value,
|
|
142
94
|
(value) => {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../../../../../shared/utils/fabricjs';
|
|
3
3
|
import { AnyObject } from '../../../../../shared/types';
|
|
4
|
-
import { IObject, IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
|
|
4
|
+
import { IObject, ICoordinateValue, IPointTipProps, IPointMenuProps, PopupMenuItem } from '../../../../../components/fabric-chart/src/interface';
|
|
5
5
|
export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps, isPopupTipRender: boolean): {
|
|
6
6
|
redrawPoints: (ItemObj?: AnyObject) => void;
|
|
7
|
-
clickMenu: ({ item, target }: {
|
|
8
|
-
item:
|
|
7
|
+
clickMenu: ({ item, target, pointer }: {
|
|
8
|
+
item: PopupMenuItem;
|
|
9
9
|
target: any;
|
|
10
|
+
pointer: ICoordinateValue;
|
|
10
11
|
}) => void;
|
|
11
12
|
moveLimit: (point: IObject, limitRight?: any) => void;
|
|
12
13
|
setPopup: (point: any, status?: string) => void;
|
|
@@ -17,6 +17,7 @@ import './useTop.js';
|
|
|
17
17
|
import './useOther.js';
|
|
18
18
|
import '../../../../../shared/utils/index.js';
|
|
19
19
|
import { useIntervalFn } from '@vueuse/core';
|
|
20
|
+
import { singlePointAddEventBus } from '../../utils/eventBus.js';
|
|
20
21
|
|
|
21
22
|
function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPopupTipRender) {
|
|
22
23
|
const {
|
|
@@ -248,6 +249,21 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
|
|
|
248
249
|
currentSelection && canvas.value.remove(currentSelection);
|
|
249
250
|
currentSelection = null;
|
|
250
251
|
}
|
|
252
|
+
function createChildrenMenuList(itemList2) {
|
|
253
|
+
return itemList2.map((item) => ({
|
|
254
|
+
key: item.key,
|
|
255
|
+
label: item.title,
|
|
256
|
+
mode: "add",
|
|
257
|
+
origin: {
|
|
258
|
+
title: item.title,
|
|
259
|
+
unit: item.unit,
|
|
260
|
+
type: item.bigType,
|
|
261
|
+
dataIndex: item.dataIndex,
|
|
262
|
+
key: item.key,
|
|
263
|
+
linkKey: item.linkKey
|
|
264
|
+
}
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
251
267
|
function handleRightClick(event2) {
|
|
252
268
|
pointTipProps.show = false;
|
|
253
269
|
const {
|
|
@@ -260,14 +276,8 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
|
|
|
260
276
|
const {
|
|
261
277
|
menuList = []
|
|
262
278
|
} = extraMenuConfig;
|
|
263
|
-
pointMenuProps.list = filter(OTHER_MENU, (o) => o.
|
|
264
|
-
|
|
265
|
-
...item,
|
|
266
|
-
renderItem: () => item.label,
|
|
267
|
-
type: item.key || item.type,
|
|
268
|
-
pointer: event2.pointer
|
|
269
|
-
};
|
|
270
|
-
});
|
|
279
|
+
pointMenuProps.list = filter(OTHER_MENU, (o) => o.key === "add").concat(menuList);
|
|
280
|
+
pointMenuProps.list[0].children = createChildrenMenuList(itemList);
|
|
271
281
|
} else {
|
|
272
282
|
if (event2.target.__type !== "main")
|
|
273
283
|
return;
|
|
@@ -276,22 +286,21 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
|
|
|
276
286
|
x: point.left,
|
|
277
287
|
y: point.top
|
|
278
288
|
}, event2.target, []);
|
|
279
|
-
pointMenuProps.list = filter(OTHER_MENU, (o) => o.
|
|
289
|
+
pointMenuProps.list = filter(OTHER_MENU, (o) => o.key !== "edit").map((item) => {
|
|
280
290
|
return {
|
|
281
291
|
...item,
|
|
282
|
-
|
|
283
|
-
type: item.key || item.type,
|
|
284
|
-
pointer: {
|
|
285
|
-
x: point.left,
|
|
286
|
-
y: point.top
|
|
287
|
-
},
|
|
288
|
-
...item.type === "add" ? {} : {
|
|
292
|
+
...item.key !== "add" && {
|
|
289
293
|
origin: {
|
|
290
294
|
...point.origin
|
|
291
295
|
}
|
|
292
296
|
}
|
|
293
297
|
};
|
|
294
298
|
});
|
|
299
|
+
const newChildren = itemList.filter((item) => {
|
|
300
|
+
const key = item.linkKey || item.key;
|
|
301
|
+
return !getEqualXTypes(getGridPoints(), point.left, "key", xCellWidth).includes(key);
|
|
302
|
+
});
|
|
303
|
+
pointMenuProps.list[0].children = createChildrenMenuList(newChildren);
|
|
295
304
|
}
|
|
296
305
|
}
|
|
297
306
|
function setPointMenuProps(point, target, list) {
|
|
@@ -305,32 +314,46 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
|
|
|
305
314
|
}
|
|
306
315
|
function clickMenu({
|
|
307
316
|
item,
|
|
308
|
-
target
|
|
317
|
+
target,
|
|
318
|
+
pointer
|
|
309
319
|
}) {
|
|
310
|
-
var _a;
|
|
320
|
+
var _a, _b, _c;
|
|
311
321
|
const {
|
|
312
|
-
|
|
322
|
+
key,
|
|
313
323
|
origin,
|
|
314
|
-
|
|
324
|
+
mode
|
|
315
325
|
} = item;
|
|
316
326
|
const params = {
|
|
317
327
|
...origin
|
|
318
328
|
};
|
|
319
|
-
if (
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
time: getXValue(pointer.x)
|
|
323
|
-
},
|
|
324
|
-
type: null
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
if (filter(OTHER_MENU, (o) => o.type !== "edit").map((item2) => item2.type).includes(type)) {
|
|
328
|
-
if (type === "remove") {
|
|
329
|
+
if (key === "remove" || mode === "add") {
|
|
330
|
+
const eventName = key === "remove" ? "remove" : "add";
|
|
331
|
+
if (key === "remove") {
|
|
329
332
|
updateData(params, "remove");
|
|
333
|
+
} else {
|
|
334
|
+
const pointKey = origin.linkKey || origin.key;
|
|
335
|
+
params.data = [{
|
|
336
|
+
time: getXValue(pointer.x),
|
|
337
|
+
value: getYValue(origin.type, pointer.y),
|
|
338
|
+
...origin.linkKey && {
|
|
339
|
+
key: origin.key
|
|
340
|
+
}
|
|
341
|
+
}];
|
|
342
|
+
updateData({
|
|
343
|
+
...params,
|
|
344
|
+
key: pointKey
|
|
345
|
+
}, "add");
|
|
346
|
+
const firstLeft = pointKey ? (_b = (_a = gridPointsMap.get(pointKey)) == null ? void 0 : _a[0]) == null ? void 0 : _b.left : void 0;
|
|
347
|
+
const minLeft = firstLeft != null ? firstLeft : pointer.x;
|
|
348
|
+
const limitRight = minLeft - xCellWidth;
|
|
349
|
+
singlePointAddEventBus.emit({
|
|
350
|
+
...origin,
|
|
351
|
+
limitRight
|
|
352
|
+
});
|
|
330
353
|
}
|
|
331
|
-
emits(
|
|
354
|
+
emits(eventName, params);
|
|
332
355
|
} else {
|
|
333
|
-
(
|
|
356
|
+
(_c = extraMenuConfig.click) == null ? void 0 : _c.call(extraMenuConfig, key, params);
|
|
334
357
|
}
|
|
335
358
|
}
|
|
336
359
|
function drawCordonLine(item, scaleValue) {
|
|
@@ -524,7 +547,8 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
|
|
|
524
547
|
const {
|
|
525
548
|
type,
|
|
526
549
|
selfKey,
|
|
527
|
-
dataIndex
|
|
550
|
+
dataIndex,
|
|
551
|
+
data: oldData
|
|
528
552
|
} = point.origin;
|
|
529
553
|
const params = {
|
|
530
554
|
...point.origin,
|
|
@@ -575,7 +599,8 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
|
|
|
575
599
|
} else {
|
|
576
600
|
emits("change", {
|
|
577
601
|
...omit(params, ["selfKey", "lineAttr"]),
|
|
578
|
-
key: selfKey
|
|
602
|
+
key: selfKey,
|
|
603
|
+
oldData
|
|
579
604
|
});
|
|
580
605
|
updateData(params, "change");
|
|
581
606
|
}
|
|
@@ -813,7 +838,7 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
|
|
|
813
838
|
});
|
|
814
839
|
}
|
|
815
840
|
function redrawPoints(ItemObj) {
|
|
816
|
-
var _a, _b, _c;
|
|
841
|
+
var _a, _b, _c, _d;
|
|
817
842
|
batchAddPoints.size && ((_a = canvas.value) == null ? void 0 : _a.remove(...doRemovePoints([...batchAddPoints])));
|
|
818
843
|
batchAddPoints.clear();
|
|
819
844
|
batchAddDatas = [];
|
|
@@ -823,12 +848,13 @@ function useCenter(canvas, propItems, emits, pointTipProps, pointMenuProps, isPo
|
|
|
823
848
|
scaleValue
|
|
824
849
|
} = ItemObj;
|
|
825
850
|
const item = scaleValue.dataList[dataIndex];
|
|
826
|
-
(_b =
|
|
851
|
+
const points = (_b = gridPointsMap.get(item.key)) != null ? _b : [];
|
|
852
|
+
(_c = canvas.value) == null ? void 0 : _c.remove(...doRemovePoints(points));
|
|
827
853
|
gridPointsMap.delete(item.key);
|
|
828
854
|
drawPolyLine(item, dataIndex, scaleValue);
|
|
829
855
|
} else {
|
|
830
856
|
yScaleValue = cloneDeep(scaleValues);
|
|
831
|
-
gridPointsMap.size && ((
|
|
857
|
+
gridPointsMap.size && ((_d = canvas.value) == null ? void 0 : _d.remove(...doRemovePoints(getGridPoints())));
|
|
832
858
|
gridPointsMap.clear();
|
|
833
859
|
init();
|
|
834
860
|
}
|