cnhis-design-vue 3.3.1-beta.53 → 3.3.1-beta.54
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.
@@ -11,13 +11,19 @@ import { getIndex, isEffectiveNode, getTime, getScaleNumberList } from '../../ut
|
|
11
11
|
import { cloneDeep, isString, last, range } from 'lodash-es';
|
12
12
|
import '../../constants/index.js';
|
13
13
|
import '@vueuse/shared';
|
14
|
-
import { format } from 'date-fns';
|
14
|
+
import { format, getHours, getMinutes } from 'date-fns';
|
15
15
|
import 'naive-ui';
|
16
16
|
import '../surgicalAnesthesia/useTop.js';
|
17
17
|
import '@vueuse/core';
|
18
18
|
import '../surgicalAnesthesia/useOther.js';
|
19
19
|
import '../../../../../shared/utils/index.js';
|
20
20
|
|
21
|
+
function getCurrentTime(lastTime, range2) {
|
22
|
+
return lastTime + 1 > range2[1] ? range2[0] : lastTime + 1;
|
23
|
+
}
|
24
|
+
function isStartTimeHalfOrLater(startTime) {
|
25
|
+
return getMinutes(startTime) >= 30;
|
26
|
+
}
|
21
27
|
function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps) {
|
22
28
|
const {
|
23
29
|
computedX,
|
@@ -764,6 +770,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
|
|
764
770
|
const processTimeList = range(processTimeRange[0], processTimeRange[1] + 1);
|
765
771
|
const timeTextList = [];
|
766
772
|
const processTimeTextList = [];
|
773
|
+
const firstTime = getHours(new Date(startTime2));
|
767
774
|
const halfYCellHeight = yCellHeight / 2;
|
768
775
|
for (let i = 0; i < grid.mainXCell; i++) {
|
769
776
|
if (show) {
|
@@ -772,7 +779,7 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
|
|
772
779
|
} = style;
|
773
780
|
const baseLeft = originX + (textAlign === "center" ? xCellWidth / 2 : 0);
|
774
781
|
const left = i === 0 && textAlign !== "center" ? baseLeft + 5 : baseLeft;
|
775
|
-
const currentTime = i === 0 ?
|
782
|
+
const currentTime = i === 0 ? isStartTimeHalfOrLater(startTime2) && textAlign === "center" ? firstTime + 1 : firstTime : getCurrentTime(last(timeList), timeRange);
|
776
783
|
timeList.push(currentTime);
|
777
784
|
const top = position === "top" ? originY - halfYCellHeight : endY + halfYCellHeight;
|
778
785
|
timeTextList.push(drawText([left + i * xCellWidth, top], {
|
@@ -819,9 +826,6 @@ function useBirthProcess(canvas, propItems, emits, pointTipProps, pointMenuProps
|
|
819
826
|
canvas.value.sendToBack(group);
|
820
827
|
}
|
821
828
|
}
|
822
|
-
function getCurrentTime(lastTime, range2) {
|
823
|
-
return lastTime + 1 > range2[1] ? range2[0] : lastTime + 1;
|
824
|
-
}
|
825
829
|
function drawYScale() {
|
826
830
|
drawColumn(leftScales);
|
827
831
|
drawColumn(rightScales, "right");
|