cnhis-design-vue 3.1.34-beta.8 → 3.1.34
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/README.md +123 -123
- package/es/components/big-table/index.d.ts +1 -41
- package/es/components/big-table/src/BigTable.vue.d.ts +10 -44
- package/es/components/big-table/src/BigTable.vue2.js +12 -557
- package/es/components/big-table/src/components/edit-form/edit-select.js +26 -19
- package/es/components/big-table/src/components/edit-form/useCommon.d.ts +1 -1
- package/es/components/big-table/src/hooks/useEvent.js +20 -2
- package/es/components/big-table/src/hooks/useFormat.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useCenter.js +132 -58
- package/es/components/fabric-chart/src/hooks/useLeft.js +8 -5
- package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
- package/es/components/fabric-chart/src/utils/utils.d.ts +6 -6
- package/es/components/fabric-chart/src/utils/utils.js +4 -13
- package/es/components/form-config/index.d.ts +26 -8
- package/es/components/form-config/src/FormConfig.vue.d.ts +26 -8
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -4
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue.js +1 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +14 -4
- package/es/components/form-config/src/hooks/useConfigurationField.js +7 -1
- package/es/components/form-config/src/types/index.d.ts +1 -0
- package/es/components/form-render/index.d.ts +4 -4
- package/es/components/form-render/src/FormRender.vue.d.ts +4 -4
- package/es/components/form-render/src/FormRender.vue.js +15 -5
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -4
- package/es/components/form-render/src/components/renderer/formItem.js +2 -1
- package/es/components/form-render/src/components/renderer/jsonCombination/hooks/useDeepValidate.js +8 -8
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +5 -0
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.js +20 -4
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +5 -0
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +2 -2
- package/es/components/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/components/form-render/src/utils/dom.d.ts +8 -2
- package/es/components/form-render/src/utils/dom.js +13 -6
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/src/IhoTable.vue.js +4 -0
- package/es/components/iho-table/src/constants/index.d.ts +4 -0
- package/es/components/iho-table/src/constants/index.js +6 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +11 -9
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -3
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +33 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +19 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +5 -9
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +23 -23
- package/es/components/iho-table/src/types/index.d.ts +2 -0
- package/es/components/iho-table/src/utils/index.d.ts +3 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/keyboard/index.d.ts +5 -4
- package/es/components/keyboard/src/Keyboard.vue.d.ts +5 -4
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +1 -0
- package/es/components/keyboard/src/components/NumberPanel.vue.js +3 -2
- package/es/components/keyboard/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +6 -4
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -4
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
|
@@ -37,6 +37,7 @@ var EditSelect = defineComponent({
|
|
|
37
37
|
const state = reactive({
|
|
38
38
|
keyupValue: attrs.value,
|
|
39
39
|
options: [],
|
|
40
|
+
filterOptions: [],
|
|
40
41
|
loading: false,
|
|
41
42
|
keyword: "",
|
|
42
43
|
config: {
|
|
@@ -46,10 +47,8 @@ var EditSelect = defineComponent({
|
|
|
46
47
|
});
|
|
47
48
|
const setOptions = async () => {
|
|
48
49
|
if (props.col.options) {
|
|
49
|
-
state.options =
|
|
50
|
-
|
|
51
|
-
state.keyupValue = state.options[0].value;
|
|
52
|
-
}
|
|
50
|
+
state.options = XEUtils.clone(props.col.options);
|
|
51
|
+
state.filterOptions = XEUtils.clone(props.col.options);
|
|
53
52
|
} else {
|
|
54
53
|
`${props.col.columnName}_options`;
|
|
55
54
|
const obj = {
|
|
@@ -60,8 +59,8 @@ var EditSelect = defineComponent({
|
|
|
60
59
|
};
|
|
61
60
|
state.options = await props.col.queryOptions(obj);
|
|
62
61
|
state.loading = false;
|
|
63
|
-
emit("setOptions", state.options);
|
|
64
62
|
}
|
|
63
|
+
emit("setOptions", state.options);
|
|
65
64
|
};
|
|
66
65
|
let selectSearch = (value) => {
|
|
67
66
|
state.keyword = value;
|
|
@@ -70,6 +69,7 @@ var EditSelect = defineComponent({
|
|
|
70
69
|
};
|
|
71
70
|
selectSearch = XEUtils.debounce(selectSearch, 800);
|
|
72
71
|
const onUpdateValue = (value) => {
|
|
72
|
+
state.keyupValue = value;
|
|
73
73
|
emit("formChange", {
|
|
74
74
|
value,
|
|
75
75
|
row: props.row,
|
|
@@ -80,6 +80,13 @@ var EditSelect = defineComponent({
|
|
|
80
80
|
const init = () => {
|
|
81
81
|
if (props.col.options) {
|
|
82
82
|
setOptions();
|
|
83
|
+
state.config.onSearch = (value) => {
|
|
84
|
+
var _a, _b, _c;
|
|
85
|
+
const filterOptions = ((_c = (_b = (_a = formRef == null ? void 0 : formRef.value) == null ? void 0 : _a.treeMate) == null ? void 0 : _b.treeNodes) == null ? void 0 : _c.map((item) => item.rawNode)) || XEUtils.clone(props.col.options);
|
|
86
|
+
state.filterOptions = filterOptions;
|
|
87
|
+
props.row[`${props.col.columnName}_filter_options`] = state.filterOptions;
|
|
88
|
+
props.row[`${props.col.columnName}_is_key_arrow`] = false;
|
|
89
|
+
};
|
|
83
90
|
} else {
|
|
84
91
|
state.config.remote = true;
|
|
85
92
|
state.config.onSearch = selectSearch;
|
|
@@ -87,29 +94,30 @@ var EditSelect = defineComponent({
|
|
|
87
94
|
}
|
|
88
95
|
};
|
|
89
96
|
function onKeyup(event) {
|
|
97
|
+
var _a, _b, _c, _d;
|
|
90
98
|
const {
|
|
91
99
|
key
|
|
92
100
|
} = event;
|
|
93
101
|
if (state.config.multiple || !["ArrowUp", "ArrowDown"].includes(key))
|
|
94
102
|
return;
|
|
95
|
-
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
props.row[`${props.col.columnName}_is_key_arrow`] = true;
|
|
104
|
+
if (!state.keyupValue)
|
|
105
|
+
state.keyupValue = (_b = (_a = state.filterOptions) == null ? void 0 : _a[0]) == null ? void 0 : _b.value;
|
|
106
|
+
let index = state.filterOptions.findIndex((item) => item.value === state.keyupValue);
|
|
107
|
+
if (!~index) {
|
|
108
|
+
state.keyupValue = (_d = (_c = state.filterOptions) == null ? void 0 : _c[0]) == null ? void 0 : _d.value;
|
|
109
|
+
index = 0;
|
|
110
|
+
}
|
|
111
|
+
const length = state.filterOptions.length;
|
|
99
112
|
if (key === "ArrowUp") {
|
|
100
|
-
index = index ===
|
|
113
|
+
index = index - 1 === -1 ? length - 1 : index - 1;
|
|
101
114
|
}
|
|
102
115
|
if (key === "ArrowDown") {
|
|
103
|
-
index = index === length
|
|
116
|
+
index = index + 1 === length ? 0 : index + 1;
|
|
104
117
|
}
|
|
105
|
-
state.keyupValue = state.
|
|
118
|
+
state.keyupValue = state.filterOptions[index].value;
|
|
106
119
|
onUpdateValue(state.keyupValue);
|
|
107
120
|
}
|
|
108
|
-
function onBlur() {
|
|
109
|
-
var _a, _b;
|
|
110
|
-
if (!state.keyupValue)
|
|
111
|
-
onUpdateValue((_b = (_a = state.options) == null ? void 0 : _a[0]) == null ? void 0 : _b.value);
|
|
112
|
-
}
|
|
113
121
|
init();
|
|
114
122
|
return () => createVNode(NSelect, mergeProps({
|
|
115
123
|
"ref": formRef,
|
|
@@ -123,8 +131,7 @@ var EditSelect = defineComponent({
|
|
|
123
131
|
"placeholder": props.col.placeholder || "\u8BF7\u9009\u62E9",
|
|
124
132
|
"loading": state.loading,
|
|
125
133
|
"onUpdateValue": onUpdateValue,
|
|
126
|
-
"onKeyup": onKeyup
|
|
127
|
-
"onBlur": onBlur
|
|
134
|
+
"onKeyup": onKeyup
|
|
128
135
|
}), null);
|
|
129
136
|
}
|
|
130
137
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
2
|
export declare const useCommon: (props: AnyObject, attrs: AnyObject, isTriggerClick?: boolean) => {
|
|
3
|
-
formRef:
|
|
3
|
+
formRef: any;
|
|
4
4
|
isShow: import("vue").Ref<boolean>;
|
|
5
5
|
};
|
|
@@ -4,7 +4,7 @@ import { hideFilterWrap } from '../utils.js';
|
|
|
4
4
|
|
|
5
5
|
const useEvent = (props, state, emit, xGrid, anchorEvent) => {
|
|
6
6
|
function keyDown({ $event }) {
|
|
7
|
-
var _a, _b;
|
|
7
|
+
var _a, _b, _c, _d, _e;
|
|
8
8
|
const { isArrow, isEnter, isChecked, isTab, isEdit } = ((_a = props.columnConfig) == null ? void 0 : _a.keyboardConfig) || {};
|
|
9
9
|
let activeRow = null;
|
|
10
10
|
let index = 0;
|
|
@@ -18,6 +18,24 @@ const useEvent = (props, state, emit, xGrid, anchorEvent) => {
|
|
|
18
18
|
return;
|
|
19
19
|
if (isEdit) {
|
|
20
20
|
const data = xGridRef.getEditRecord() || xGridRef.getSelectedCell() || {};
|
|
21
|
+
const { row, column } = data;
|
|
22
|
+
const { fieldList = [] } = props.columnConfig;
|
|
23
|
+
if ($event.key === "Tab") {
|
|
24
|
+
const fieldItem = fieldList.find((item) => item.columnName === column.field);
|
|
25
|
+
const { formType = "", componentProps } = fieldItem;
|
|
26
|
+
const _index = (_b = row[`${column.field}_filter_options`]) == null ? void 0 : _b.findIndex((item) => item.value === row[column.field]);
|
|
27
|
+
if (formType === "select" && !(componentProps == null ? void 0 : componentProps.multiple) && ((_c = row[`${column.field}_filter_options`]) == null ? void 0 : _c.length) > 0 && (!row[column.field] || !row[`${column.field}_is_key_arrow`] && !~_index)) {
|
|
28
|
+
const oldValue = row[column.field];
|
|
29
|
+
row[column.field] = (_d = row[`${column.field}_filter_options`]) == null ? void 0 : _d[0].value;
|
|
30
|
+
emit("formChange", {
|
|
31
|
+
value: row[column.field],
|
|
32
|
+
row,
|
|
33
|
+
column,
|
|
34
|
+
index: data.rowIndex,
|
|
35
|
+
oldValue
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
21
39
|
emit("keyboard", {
|
|
22
40
|
key: $event.key,
|
|
23
41
|
...data,
|
|
@@ -29,7 +47,7 @@ const useEvent = (props, state, emit, xGrid, anchorEvent) => {
|
|
|
29
47
|
if ($event.key === "ArrowUp" && index > 0) {
|
|
30
48
|
activeIndex = index - 1;
|
|
31
49
|
}
|
|
32
|
-
if ($event.key === "ArrowDown" && index < ((
|
|
50
|
+
if ($event.key === "ArrowDown" && index < ((_e = props.data) == null ? void 0 : _e.length) - 1) {
|
|
33
51
|
activeIndex = index + 1;
|
|
34
52
|
}
|
|
35
53
|
const row = xGridRef.getData(activeIndex);
|
|
@@ -179,7 +179,7 @@ const useFormat = (state, attr) => {
|
|
|
179
179
|
item["foldBtnList"] = [];
|
|
180
180
|
const btnLinks = [];
|
|
181
181
|
if (!nobutton) {
|
|
182
|
-
btnList.forEach((btn) => {
|
|
182
|
+
btnList == null ? void 0 : btnList.forEach((btn) => {
|
|
183
183
|
const rowOperatorId = item.operatorColumn.find((v) => v.includes(btn.sid));
|
|
184
184
|
if (rowOperatorId) {
|
|
185
185
|
if (btn.isShow == "1") {
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/Viewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/features/modeling';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'diagram-js/lib/navigation/movecanvas';
|
|
@@ -4,11 +4,12 @@ import useGrid from './useGrid.js';
|
|
|
4
4
|
import { useShadow } from './useShadow.js';
|
|
5
5
|
import { TEMPERATURE_MENU, PAIN_MENU, OVERLAP } from './constant.js';
|
|
6
6
|
import { cloneDeep } from 'lodash-es';
|
|
7
|
-
import {
|
|
7
|
+
import { isOneLine, isEffectiveNode, getIndex, deleteProperty } from '../utils/utils.js';
|
|
8
8
|
|
|
9
9
|
function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, addRenderItem, pointTipProps, pointMenuProps, useCommon) {
|
|
10
10
|
useGrid(canvas, propItems);
|
|
11
11
|
const { getEqualXTypes, repeatTip, maxLimitTip, minLimitTip } = useCommon;
|
|
12
|
+
const { createShadowLines } = useShadow();
|
|
12
13
|
const {
|
|
13
14
|
left,
|
|
14
15
|
xScaleList,
|
|
@@ -26,22 +27,21 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
26
27
|
config
|
|
27
28
|
} = propItems;
|
|
28
29
|
const shadowLinesCache = /* @__PURE__ */ new Set();
|
|
29
|
-
|
|
30
|
+
const SHADOWKEYS = ["xinmai", "mai"];
|
|
31
|
+
const shadowPointCache = /* @__PURE__ */ new Map();
|
|
30
32
|
const maiboPoints = /* @__PURE__ */ new Set();
|
|
31
33
|
const otherPoints = /* @__PURE__ */ new Set();
|
|
32
|
-
const prevLines = /* @__PURE__ */ new Set();
|
|
33
34
|
const gridPoints = /* @__PURE__ */ new Set();
|
|
34
35
|
const yScaleValue = cloneDeep(left.yScaleValue);
|
|
35
36
|
init();
|
|
36
37
|
function init() {
|
|
37
|
-
shadowPointCache
|
|
38
|
+
shadowPointCache.clear();
|
|
38
39
|
maiboPoints.clear();
|
|
39
40
|
otherPoints.clear();
|
|
40
|
-
prevLines.clear();
|
|
41
41
|
yScaleValue.forEach((scaleValue) => {
|
|
42
42
|
drawPositionLine(scaleValue);
|
|
43
43
|
scaleValue.dataList.forEach((item, dataIndex) => {
|
|
44
|
-
if (scaleValue.type
|
|
44
|
+
if (!isOneLine(scaleValue.type) || item.enable) {
|
|
45
45
|
drawPolyLine(item, dataIndex, scaleValue);
|
|
46
46
|
}
|
|
47
47
|
});
|
|
@@ -65,35 +65,29 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
65
65
|
if (shadowLinesCache.size)
|
|
66
66
|
canvas.value.remove(...shadowLinesCache);
|
|
67
67
|
shadowLinesCache.clear();
|
|
68
|
-
if (shadowPointCache.
|
|
68
|
+
if (shadowPointCache.size > 1) {
|
|
69
69
|
if (target) {
|
|
70
|
-
const { type,
|
|
70
|
+
const { type, key } = target.origin || {};
|
|
71
71
|
if (type === "pulse") {
|
|
72
|
-
shadowPointCache
|
|
72
|
+
const list = shadowPointCache.get(key);
|
|
73
|
+
const index = list == null ? void 0 : list.findIndex((point) => point[0] === target.left);
|
|
74
|
+
list.splice(index, 1, [target.left, target.top]);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
|
-
const
|
|
76
|
-
if (!data1.length || !data2.length)
|
|
77
|
-
return;
|
|
78
|
-
const points1 = getPointArr(data1);
|
|
79
|
-
const points2 = getPointArr(data2);
|
|
80
|
-
const data = points1.reduce(
|
|
81
|
-
(pre, cur, index) => pre.concat([[...cur, ...points2[index].reverse()]]),
|
|
82
|
-
[]
|
|
83
|
-
);
|
|
84
|
-
const { createShadowLines } = useShadow();
|
|
77
|
+
const data = getShadowData();
|
|
85
78
|
data.forEach((item) => {
|
|
86
|
-
var _a2, _b, _c, _d;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
80
|
+
const points = item.map((v) => ({ x: v[0], y: v[1] }));
|
|
81
|
+
const polygon = new fabric.Polygon(points, {
|
|
82
|
+
...defaultStyle,
|
|
83
|
+
...((_a2 = pulseObj.shadow) == null ? void 0 : _a2.style) || {}
|
|
84
|
+
});
|
|
85
|
+
if (((_b = pulseObj.shadow) == null ? void 0 : _b.mode) == "slash") {
|
|
86
|
+
polygon.set({
|
|
87
|
+
fill: "transparent",
|
|
88
|
+
stroke: ((_d = (_c = pulseObj.shadow) == null ? void 0 : _c.style) == null ? void 0 : _d.stroke) || "#f00"
|
|
92
89
|
});
|
|
93
|
-
|
|
94
|
-
canvas.value.add(polygon);
|
|
95
|
-
} else {
|
|
96
|
-
const shadowLines = createShadowLines(item, (_c = pulseObj.shadow) == null ? void 0 : _c.style._angle, (_d = pulseObj.shadow) == null ? void 0 : _d.style.space);
|
|
90
|
+
const shadowLines = createShadowLines(item, (_e = pulseObj.shadow) == null ? void 0 : _e.style._angle, (_f = pulseObj.shadow) == null ? void 0 : _f.style.space);
|
|
97
91
|
shadowLines.forEach((l) => {
|
|
98
92
|
var _a3;
|
|
99
93
|
Object.assign(l, {
|
|
@@ -104,9 +98,78 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
104
98
|
});
|
|
105
99
|
canvas.value.add(...shadowLines);
|
|
106
100
|
}
|
|
101
|
+
shadowLinesCache.add(polygon);
|
|
102
|
+
canvas.value.add(polygon);
|
|
107
103
|
});
|
|
108
104
|
}
|
|
109
105
|
}
|
|
106
|
+
function getShadowData() {
|
|
107
|
+
const data = [];
|
|
108
|
+
const _shadowPointCache = [];
|
|
109
|
+
const somes = [];
|
|
110
|
+
for (const item of shadowPointCache) {
|
|
111
|
+
_shadowPointCache.push(item[1]);
|
|
112
|
+
if (item[0] === SHADOWKEYS[0]) {
|
|
113
|
+
item[1].forEach((_item) => {
|
|
114
|
+
const someIndex = (shadowPointCache.get(SHADOWKEYS[1]) || []).findIndex((v) => v[0] === _item[0]);
|
|
115
|
+
someIndex > -1 && somes.push(_item[0]);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const [points1, points2] = _shadowPointCache;
|
|
120
|
+
let _arr1 = [];
|
|
121
|
+
let _arr2 = [];
|
|
122
|
+
somes.forEach((left2) => {
|
|
123
|
+
const index1 = points1.findIndex((point) => point[0] === left2);
|
|
124
|
+
const index2 = points2.findIndex((point) => point[0] === left2);
|
|
125
|
+
const currentPoint1 = points1[index1];
|
|
126
|
+
const currentPoint2 = points2[index2];
|
|
127
|
+
const prevPoint1 = points1[index1 - 1];
|
|
128
|
+
const nextPoint1 = points1[index1 + 1];
|
|
129
|
+
const prevPoint2 = points2[index2 - 1];
|
|
130
|
+
const nextPoint2 = points2[index2 + 1];
|
|
131
|
+
if (prevPoint1 && prevPoint2) {
|
|
132
|
+
if (prevPoint1[0] !== prevPoint2[0]) {
|
|
133
|
+
const maxPoint = Math.max(prevPoint1[0], prevPoint2[0]);
|
|
134
|
+
_arr1.push([prevPoint1, prevPoint2].find((point) => point[0] === maxPoint));
|
|
135
|
+
}
|
|
136
|
+
} else if (prevPoint1) {
|
|
137
|
+
_arr1.push(prevPoint1);
|
|
138
|
+
} else if (prevPoint2) {
|
|
139
|
+
_arr2.push(prevPoint2);
|
|
140
|
+
}
|
|
141
|
+
const minYPoint = Math.min(currentPoint1[1], currentPoint2[1]);
|
|
142
|
+
_arr1.push([currentPoint1, currentPoint2].find((point) => point[1] === minYPoint));
|
|
143
|
+
const maxYPoint = Math.max(currentPoint1[1], currentPoint2[1]);
|
|
144
|
+
_arr2.push([currentPoint1, currentPoint2].find((point) => point[1] === maxYPoint));
|
|
145
|
+
const setData = () => {
|
|
146
|
+
const dataItem = [..._arr1, ..._arr2.reverse()];
|
|
147
|
+
const [firstPoint] = dataItem;
|
|
148
|
+
const lastPoint = dataItem.at(-1);
|
|
149
|
+
if (firstPoint[0] === lastPoint[0] && firstPoint[1] === lastPoint[1])
|
|
150
|
+
dataItem.splice(-1, 1);
|
|
151
|
+
data.push(dataItem);
|
|
152
|
+
_arr1 = [];
|
|
153
|
+
_arr2 = [];
|
|
154
|
+
};
|
|
155
|
+
if (nextPoint1 && nextPoint2) {
|
|
156
|
+
if (nextPoint1[0] !== nextPoint2[0]) {
|
|
157
|
+
const minPoint = Math.min(nextPoint1[0], nextPoint2[0]);
|
|
158
|
+
_arr1.push([nextPoint1, nextPoint2].find((point) => point[0] === minPoint));
|
|
159
|
+
setData();
|
|
160
|
+
}
|
|
161
|
+
} else if (nextPoint1) {
|
|
162
|
+
_arr1.push(nextPoint1);
|
|
163
|
+
setData();
|
|
164
|
+
} else if (nextPoint2) {
|
|
165
|
+
_arr2.push(nextPoint2);
|
|
166
|
+
setData();
|
|
167
|
+
} else {
|
|
168
|
+
setData();
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
return data;
|
|
172
|
+
}
|
|
110
173
|
function setCanvasEvent() {
|
|
111
174
|
if (!propItems.event.evented)
|
|
112
175
|
return;
|
|
@@ -130,7 +193,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
130
193
|
pointMenuProps.target = null;
|
|
131
194
|
pointMenuProps.list = ["\u65B0\u589E\u8282\u70B9"];
|
|
132
195
|
itemList.forEach((v) => {
|
|
133
|
-
if (!getEqualXTypes(x, "
|
|
196
|
+
if (!getEqualXTypes(x, "_type", xCellWidth).includes(v.bigType)) {
|
|
134
197
|
const newY = ["pain"].includes(v.bigType) ? painOriginY : vitalSignsOriginY;
|
|
135
198
|
if (y >= newY.originY && y <= newY.endY) {
|
|
136
199
|
pointMenuProps.list.push({
|
|
@@ -138,7 +201,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
138
201
|
origin: {
|
|
139
202
|
title: v.title,
|
|
140
203
|
unit: v.unit,
|
|
141
|
-
type: v.bigType,
|
|
204
|
+
type: v.bigType.includes("_other") ? v.bigType.split("_")[0] : v.bigType,
|
|
142
205
|
dataIndex: v.dataIndex,
|
|
143
206
|
key: v.key
|
|
144
207
|
},
|
|
@@ -220,7 +283,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
220
283
|
const lineList = [];
|
|
221
284
|
const otherList = [];
|
|
222
285
|
(_a = item.list) == null ? void 0 : _a.forEach((v, index) => {
|
|
223
|
-
const _item = type
|
|
286
|
+
const _item = !isOneLine(type) ? item : dataList.find((_v) => _v.key === v.key);
|
|
224
287
|
const points = getPointer(v, scaleValue);
|
|
225
288
|
const otherObj = {};
|
|
226
289
|
otherObj.value = drawValue(points, v, _item);
|
|
@@ -228,26 +291,46 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
228
291
|
drawPulseOther(points, v, _item, otherObj);
|
|
229
292
|
drawPointLine(points, v, index, _item, otherObj);
|
|
230
293
|
});
|
|
231
|
-
type === "pulse"
|
|
294
|
+
if (type === "pulse") {
|
|
295
|
+
SHADOWKEYS.forEach((key) => {
|
|
296
|
+
shadowPointCache.set(
|
|
297
|
+
key,
|
|
298
|
+
pointList.filter((point) => {
|
|
299
|
+
var _a2;
|
|
300
|
+
return ((_a2 = point.origin) == null ? void 0 : _a2.key) === key;
|
|
301
|
+
}).map((point) => [point.left, point.top])
|
|
302
|
+
);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
232
305
|
Promise.all(pointList).then((res) => {
|
|
233
306
|
const lineListFilter = lineList.filter((v) => v);
|
|
234
307
|
let prevPoint = null;
|
|
235
|
-
res = res.
|
|
236
|
-
if (
|
|
237
|
-
prevPoint.nextPoint =
|
|
238
|
-
|
|
308
|
+
res = res.map((point) => {
|
|
309
|
+
if (point && prevPoint) {
|
|
310
|
+
prevPoint.nextPoint = point;
|
|
311
|
+
point.prevPoint = prevPoint;
|
|
239
312
|
}
|
|
240
|
-
prevPoint =
|
|
241
|
-
|
|
242
|
-
|
|
313
|
+
prevPoint = point || prevPoint;
|
|
314
|
+
point == null ? void 0 : point.bringToFront();
|
|
315
|
+
doPulsePointLine(point, res);
|
|
316
|
+
return point;
|
|
243
317
|
});
|
|
244
318
|
Promise.all(otherList).then((r) => {
|
|
245
319
|
canvas.value.add(...lineListFilter, ...res, ...r);
|
|
246
|
-
res.forEach((
|
|
247
|
-
|
|
320
|
+
res.forEach((point) => {
|
|
321
|
+
point == null ? void 0 : point.bringToFront();
|
|
248
322
|
});
|
|
249
323
|
});
|
|
250
324
|
});
|
|
325
|
+
function doPulsePointLine(point, pointList2) {
|
|
326
|
+
if (point.origin.type === "pulse") {
|
|
327
|
+
const someLeftList = pointList2.filter((_point) => _point.left === point.left);
|
|
328
|
+
if (someLeftList.length > 1) {
|
|
329
|
+
point.leftLine && canvas.value.remove(point.leftLine);
|
|
330
|
+
point.rightLine && canvas.value.remove(point.rightLine);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
251
334
|
function drawValue(points, v, _item) {
|
|
252
335
|
if (!(points == null ? void 0 : points.length) || !config.showValue)
|
|
253
336
|
return;
|
|
@@ -396,19 +479,10 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
396
479
|
const nextPoint = getPointer(nextV, scaleValue);
|
|
397
480
|
const isNonePain = isNoneValuePain(type, item.list[index].value);
|
|
398
481
|
const isNextNonePain = nextPoint && isNoneValuePain(type, nextV.value);
|
|
399
|
-
if (points && nextPoint && !v.breakpoint && !isNonePain && !isNextNonePain) {
|
|
482
|
+
if (points && nextPoint && !v.breakpoint && !isNonePain && !isNextNonePain && points[0] !== nextPoint[0]) {
|
|
400
483
|
line = drawLine([...points, ...nextPoint], {
|
|
401
484
|
...lineAttr
|
|
402
485
|
});
|
|
403
|
-
} else if (points && !nextPoint && !v.breakpoint) {
|
|
404
|
-
const nextLinePoint = getPointer(nextV, scaleValue);
|
|
405
|
-
line = nextLinePoint ? drawLine([...points, ...nextLinePoint], {
|
|
406
|
-
...lineAttr
|
|
407
|
-
}) : null;
|
|
408
|
-
nextLinePoint && prevLines.add({
|
|
409
|
-
dataIndex,
|
|
410
|
-
line
|
|
411
|
-
});
|
|
412
486
|
}
|
|
413
487
|
const currentPointType = v.pacemakerShow && type == "pulse" ? pacemaker.value : isNonePain ? 0 : pointType;
|
|
414
488
|
const previousLine = lineList[index - 1];
|
|
@@ -419,6 +493,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
419
493
|
key: key || "",
|
|
420
494
|
unit: scaleValue.unit,
|
|
421
495
|
type,
|
|
496
|
+
_type: title.includes("\u5FC3\u7387") ? "pulse_other" : type,
|
|
422
497
|
dataIndex,
|
|
423
498
|
index
|
|
424
499
|
},
|
|
@@ -578,7 +653,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
578
653
|
data: {
|
|
579
654
|
time: getXValue(item.pointer.x),
|
|
580
655
|
value: getYValue(item.origin.type, item.pointer.y),
|
|
581
|
-
|
|
656
|
+
...!isOneLine(item.origin.type) ? {} : { key: item.origin.key }
|
|
582
657
|
},
|
|
583
658
|
...item.origin
|
|
584
659
|
};
|
|
@@ -589,7 +664,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
589
664
|
deleteProperty(data, TEMPERATURE_MENU);
|
|
590
665
|
deleteProperty(data, PAIN_MENU);
|
|
591
666
|
data[`${item.type}`] = item.value;
|
|
592
|
-
if (type
|
|
667
|
+
if (isOneLine(type)) {
|
|
593
668
|
data["key"] = target.origin.key;
|
|
594
669
|
}
|
|
595
670
|
const params = {
|
|
@@ -604,7 +679,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
604
679
|
const { type, dataIndex, index, data, key } = params;
|
|
605
680
|
const obj = yScaleValue.find((v) => v.type === type);
|
|
606
681
|
if (mode === "add") {
|
|
607
|
-
const dataList = type
|
|
682
|
+
const dataList = !isOneLine(type) ? obj.dataList[dataIndex] : obj.dataList.find((v) => v.enable);
|
|
608
683
|
const index2 = getIndex(data.time, dataList.list);
|
|
609
684
|
dataList.list.splice(index2, 0, data);
|
|
610
685
|
} else {
|
|
@@ -627,14 +702,13 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
627
702
|
function redrawPoints() {
|
|
628
703
|
var _a;
|
|
629
704
|
gridPoints.size && ((_a = canvas.value) == null ? void 0 : _a.remove(...getRemovePoints([...gridPoints])));
|
|
630
|
-
shadowPointCache
|
|
705
|
+
shadowPointCache.clear();
|
|
631
706
|
gridPoints.clear();
|
|
632
707
|
maiboPoints.clear();
|
|
633
708
|
otherPoints.clear();
|
|
634
|
-
prevLines.clear();
|
|
635
709
|
yScaleValue.forEach((scaleValue) => {
|
|
636
710
|
scaleValue.dataList.forEach((item, dataIndex) => {
|
|
637
|
-
if (scaleValue.type
|
|
711
|
+
if (!isOneLine(scaleValue.type) || item.enable) {
|
|
638
712
|
drawPolyLine(item, dataIndex, scaleValue);
|
|
639
713
|
}
|
|
640
714
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fabric } from '../utils/index.js';
|
|
2
2
|
import { defaultBorderStyle, defaultTextStyle, defaultStyle, defaultRectStyle, drawPoint, drawTextGroup } from './useDraw.js';
|
|
3
|
+
import { isOneLine } from '../utils/utils.js';
|
|
3
4
|
|
|
4
5
|
function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, cumputedY, getXValue, getYValue, isAddPoint, updateData, useCommon) {
|
|
5
6
|
var _a, _b;
|
|
@@ -114,6 +115,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
114
115
|
const residue = (end - start) % column;
|
|
115
116
|
const firstColWidth = colWidth + residue;
|
|
116
117
|
yScaleValueList2.forEach((item, index) => {
|
|
118
|
+
var _a3, _b2;
|
|
117
119
|
if (item.type === "pain") {
|
|
118
120
|
drwaPainScaleValue(item);
|
|
119
121
|
return;
|
|
@@ -138,8 +140,8 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
138
140
|
const spaceScale = spaceGridNumber * yCellHeight / 5;
|
|
139
141
|
const position = item.position || "center";
|
|
140
142
|
const { lineXMain, lineXSub, textLeft } = getScaleInfo(item.position, rectLeft, rectWidth);
|
|
141
|
-
const listLen = item.list.length;
|
|
142
|
-
item.list.forEach((v, i) => {
|
|
143
|
+
const listLen = (_a3 = item.list) == null ? void 0 : _a3.length;
|
|
144
|
+
(_b2 = item == null ? void 0 : item.list) == null ? void 0 : _b2.forEach((v, i) => {
|
|
143
145
|
const top = vitalSignsOriginY.endY - i * yCellHeight * spaceGridNumber;
|
|
144
146
|
const isMaxMinNumber = i === 0 || i === listLen - 1;
|
|
145
147
|
if (item.showNumber && (isMaxMinNumber ? item.showMaxMinNumber : true)) {
|
|
@@ -229,7 +231,8 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
229
231
|
origin: {
|
|
230
232
|
title: item.title,
|
|
231
233
|
unit: item.unit,
|
|
232
|
-
type: item.bigType,
|
|
234
|
+
type: item.bigType.includes("_other") ? item.bigType.split("_")[0] : item.bigType,
|
|
235
|
+
_type: item.bigType,
|
|
233
236
|
dataIndex: item.dataIndex,
|
|
234
237
|
key: item.key,
|
|
235
238
|
isMenu: true
|
|
@@ -272,7 +275,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
272
275
|
pointTipProps.show = false;
|
|
273
276
|
if (event.e.button === 0) {
|
|
274
277
|
if (isLimit(point)) {
|
|
275
|
-
const isRepeat = getEqualXTypes(point.left, "
|
|
278
|
+
const isRepeat = getEqualXTypes(point.left, "_type", xCellWidth).includes(point.origin.type);
|
|
276
279
|
const isLimitAdd = isAddPoint(point.left);
|
|
277
280
|
if (!isLimitAdd || isRepeat) {
|
|
278
281
|
isRepeat && isLimitAdd && repeatTip();
|
|
@@ -281,7 +284,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, cumputedX, c
|
|
|
281
284
|
data: {
|
|
282
285
|
time: getXValue(point.left),
|
|
283
286
|
value: getYValue(point.origin.type, point.top),
|
|
284
|
-
|
|
287
|
+
...!isOneLine(point.origin.type) ? {} : { key: point.origin.key }
|
|
285
288
|
},
|
|
286
289
|
...point.origin
|
|
287
290
|
};
|
|
@@ -156,7 +156,7 @@ function useTemperatureChart(canvas, props, emits, canvasRef) {
|
|
|
156
156
|
return item.dataList.map((v, dataIndex) => {
|
|
157
157
|
return {
|
|
158
158
|
...v,
|
|
159
|
-
bigType: item.type,
|
|
159
|
+
bigType: v.title.includes("\u5FC3\u7387") ? "pulse_other" : item.type,
|
|
160
160
|
unit: item.unit,
|
|
161
161
|
dataIndex
|
|
162
162
|
};
|