cnhis-design-vue 3.1.16-beta.9 → 3.1.17-beta.1
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/packages/big-table/src/BigTable.vue.d.ts +6 -1
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/packages/big-table/src/components/edit-form/edit-date.js +13 -3
- package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -0
- package/es/packages/big-table/src/components/separate.js +1 -1
- package/es/packages/big-table/src/hooks/useSeparateRow.js +7 -4
- package/es/packages/button-print/index.d.ts +4 -1
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +4 -1
- package/es/packages/button-print/src/components/IdentityVerification.js +5 -7
- package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +4 -1
- package/es/packages/fabric-chart/index.d.ts +2 -0
- package/es/packages/fabric-chart/src/FabricChart.js +21 -6
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +2 -0
- package/es/packages/fabric-chart/src/components/PopupTip.js +2 -2
- package/es/packages/fabric-chart/src/hooks/constant.js +1 -1
- package/es/packages/fabric-chart/src/hooks/useCenter.js +30 -20
- package/es/packages/fabric-chart/src/hooks/useLeft.d.ts +3 -1
- package/es/packages/fabric-chart/src/hooks/useLeft.js +30 -12
- package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
- package/es/packages/fabric-chart/src/hooks/useRight.d.ts +1 -1
- package/es/packages/fabric-chart/src/hooks/useRight.js +11 -69
- package/es/packages/fabric-chart/src/interface.d.ts +3 -0
- package/es/packages/form-config/index.d.ts +14 -9
- package/es/packages/form-config/src/FormConfig.vue.d.ts +14 -9
- package/es/packages/form-config/src/components/FormConfigCreator.js +2 -0
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +6 -4
- package/es/packages/form-config/src/components/FormConfigEdit.js +1 -0
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +8 -5
- package/es/packages/form-config/src/constants/index.d.ts +2 -2
- package/es/packages/form-config/src/hooks/useConfigurationField.js +9 -9
- package/es/packages/form-config/src/types/index.d.ts +1 -0
- package/es/packages/form-config/style/index.css +1 -1
- package/es/packages/form-render/index.d.ts +6 -4
- package/es/packages/form-render/index.js +1 -2
- package/es/packages/form-render/src/FormRender.js +8 -9
- package/es/packages/form-render/src/FormRender.vue.d.ts +6 -4
- package/es/packages/form-render/src/components/renderer/{combination/index.d.ts → combination.d.ts} +3 -3
- package/es/packages/form-render/src/components/renderer/combination.js +92 -0
- package/es/packages/form-render/src/components/renderer/date.js +12 -4
- package/es/packages/form-render/src/components/renderer/formItem.js +12 -5
- package/es/packages/form-render/src/components/renderer/index.d.ts +1 -0
- package/es/packages/form-render/src/components/renderer/index.js +2 -1
- package/es/packages/form-render/src/components/renderer/inputGroup.js +1 -1
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/hooks/useDeepValidate.d.ts +0 -0
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/hooks/useDeepValidate.js +0 -0
- package/es/packages/form-render/src/components/renderer/jsonCombination/index.d.ts +44 -0
- package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/index.js +29 -14
- package/es/packages/form-render/src/components/renderer/select.js +11 -8
- package/es/packages/form-render/src/constants/index.d.ts +2 -2
- package/es/packages/form-render/src/hooks/index.d.ts +1 -2
- package/es/packages/form-render/src/hooks/index.js +1 -2
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +3 -3
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
- package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +5 -6
- package/es/packages/form-render/src/hooks/useBusinessBinding.js +22 -20
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +11 -7
- package/es/packages/form-render/src/hooks/useFieldNormalize.d.ts +5 -0
- package/es/packages/form-render/src/hooks/useFieldNormalize.js +58 -0
- package/es/packages/form-render/src/hooks/useFieldVisitor.js +2 -5
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +4 -4
- package/es/packages/form-render/src/hooks/useFormRequest.d.ts +2 -2
- package/es/packages/form-render/src/types/fieldItem.d.ts +4 -0
- package/es/packages/form-render/src/types/index.d.ts +4 -4
- package/es/packages/form-render/src/utils/dom.d.ts +2 -2
- package/es/packages/form-render/src/utils/index.js +3 -2
- package/es/packages/form-render/src/utils/schema.d.ts +62 -2
- package/es/packages/form-render/src/utils/schema.js +5 -2
- package/es/packages/form-render/style/index.css +11 -8
- package/es/packages/index.css +12 -9
- package/es/packages/index.js +1 -2
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +1 -0
- package/es/packages/shortcut-setter/index.d.ts +7 -4
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +7 -4
- package/es/src/types/index.d.ts +2 -2
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.js +11 -1
- package/es/src/utils/tapable/AsyncParallelBailHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncParallelBailHook.js +78 -0
- package/es/src/utils/tapable/AsyncParallelHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncParallelHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesBailHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesBailHook.js +33 -0
- package/es/src/utils/tapable/AsyncSeriesHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesLoopHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesLoopHook.js +27 -0
- package/es/src/utils/tapable/AsyncSeriesWaterfallHook.d.ts +3 -0
- package/es/src/utils/tapable/AsyncSeriesWaterfallHook.js +40 -0
- package/es/src/utils/tapable/Hook.d.ts +50 -0
- package/es/src/utils/tapable/Hook.js +140 -0
- package/es/src/utils/tapable/HookCodeFactory.d.ts +58 -0
- package/es/src/utils/tapable/HookCodeFactory.js +444 -0
- package/es/src/utils/tapable/HookMap.d.ts +11 -0
- package/es/src/utils/tapable/HookMap.js +32 -0
- package/es/src/utils/tapable/MultiHook.d.ts +12 -0
- package/es/src/utils/tapable/MultiHook.js +38 -0
- package/es/src/utils/tapable/SyncBailHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncBailHook.js +40 -0
- package/es/src/utils/tapable/SyncHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncHook.js +34 -0
- package/es/src/utils/tapable/SyncLoopHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncLoopHook.js +34 -0
- package/es/src/utils/tapable/SyncWaterfallHook.d.ts +3 -0
- package/es/src/utils/tapable/SyncWaterfallHook.js +48 -0
- package/es/src/utils/tapable/index.d.ts +139 -0
- package/es/src/utils/tapable/index.js +12 -0
- package/package.json +4 -4
- package/es/packages/form-render/src/hooks/useInitialData.d.ts +0 -5
- package/es/packages/form-render/src/hooks/useInitialData.js +0 -16
- package/es/packages/form-render/src/hooks/useTypeNormalize.d.ts +0 -4
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +0 -45
|
@@ -1126,7 +1126,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1126
1126
|
textColorGhostHoverWarning: string;
|
|
1127
1127
|
textColorGhostPressedWarning: string;
|
|
1128
1128
|
textColorGhostFocusWarning: string;
|
|
1129
|
-
textColorGhostDisabledWarning: string;
|
|
1129
|
+
textColorGhostDisabledWarning: string; /**
|
|
1130
|
+
* 判断是否渲染EditForm
|
|
1131
|
+
* @param {*} row
|
|
1132
|
+
* @param {*} column
|
|
1133
|
+
* @returns
|
|
1134
|
+
*/
|
|
1130
1135
|
borderWarning: string;
|
|
1131
1136
|
borderHoverWarning: string;
|
|
1132
1137
|
borderPressedWarning: string;
|
|
@@ -354,10 +354,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
354
354
|
showSeq = true
|
|
355
355
|
} = map;
|
|
356
356
|
if (isEdit) {
|
|
357
|
-
|
|
357
|
+
Object.assign(state.editConfig, editConfig);
|
|
358
358
|
state.rowConfig.height = 48;
|
|
359
359
|
}
|
|
360
|
-
|
|
360
|
+
Object.assign(state.rowConfig, rowConfig);
|
|
361
361
|
state.rowConfig.keyField = handleRowId.value;
|
|
362
362
|
if (selectType) {
|
|
363
363
|
isBatchSelect = 1;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, createVNode, mergeProps } from 'vue';
|
|
1
|
+
import { defineComponent, computed, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { generateTimeFormat } from '../../../../../src/utils';
|
|
2
3
|
import { isFunction } from 'lodash-es';
|
|
3
4
|
import { NDatePicker } from 'naive-ui';
|
|
4
5
|
|
|
@@ -25,7 +26,6 @@ var EditDate = defineComponent({
|
|
|
25
26
|
emits: ["formChange"],
|
|
26
27
|
setup(props, {
|
|
27
28
|
attrs,
|
|
28
|
-
slots,
|
|
29
29
|
emit
|
|
30
30
|
}) {
|
|
31
31
|
const onConfirm = (value) => {
|
|
@@ -102,11 +102,21 @@ var EditDate = defineComponent({
|
|
|
102
102
|
return customDateDisabled(ts, props.row);
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
const formatConfig = computed(() => {
|
|
106
|
+
const valueFormat = props.col.valueFormat || "yyyy-MM-dd HH:mm:ss";
|
|
107
|
+
return {
|
|
108
|
+
valueFormat,
|
|
109
|
+
format: valueFormat,
|
|
110
|
+
timePickerProps: {
|
|
111
|
+
format: generateTimeFormat(valueFormat)
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
});
|
|
105
115
|
const config = {
|
|
106
116
|
type: props.col.type || props.col.dateType || "datetime",
|
|
107
117
|
clearable: props.col.clearable || true,
|
|
108
118
|
disabled: props.col.disabled || false,
|
|
109
|
-
|
|
119
|
+
...formatConfig.value,
|
|
110
120
|
isDateDisabled: customDateDisabledDecorator(props.col.isDateDisabled) || isDateDisabled,
|
|
111
121
|
placeholder: props.col.placeholder || "\u8BF7\u9009\u62E9",
|
|
112
122
|
...props.col.componentProps || {}
|
|
@@ -41,6 +41,7 @@ var editTime = defineComponent({
|
|
|
41
41
|
const config = {
|
|
42
42
|
placeholder: props.col.placeholder || "\u8BF7\u9009\u62E9",
|
|
43
43
|
valueFormat: props.col.valueFormat || "HH:mm",
|
|
44
|
+
format: props.col.valueFormat || "yyyy-MM-dd HH:mm:ss",
|
|
44
45
|
...props.col.componentProps || {}
|
|
45
46
|
};
|
|
46
47
|
return () => createVNode(NTimePicker, mergeProps(attrs, config, {
|
|
@@ -3,7 +3,7 @@ import { useSeparateMap } from '../../../../packages/big-table/src/hooks/useSepa
|
|
|
3
3
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = { class: "big-table__separate" };
|
|
6
|
-
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "big-table__separatePlaceholder" },
|
|
6
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "big-table__separatePlaceholder" }, /* @__PURE__ */ toDisplayString(` `), -1);
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "separate",
|
|
9
9
|
props: {
|
|
@@ -84,22 +84,25 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
(await res).push(...Array.from({ length: getColumnInfoMaxLength(parsedRowData) }).map((_, index) => {
|
|
87
|
+
const separateData = getSeparateRowData(parsedRowData, index);
|
|
87
88
|
if (index === 0) {
|
|
88
89
|
separateDataMap.value.set(row, {
|
|
89
90
|
row,
|
|
90
91
|
rawRow: rawData[dataIndex],
|
|
91
|
-
index,
|
|
92
|
-
separateData
|
|
92
|
+
index: dataIndex,
|
|
93
|
+
separateData
|
|
93
94
|
});
|
|
95
|
+
row.$__SEPARATE_DATA = [separateData];
|
|
94
96
|
return row;
|
|
95
97
|
}
|
|
96
98
|
const data2 = { $__SEPARATE: true };
|
|
97
99
|
separateDataMap.value.set(data2, {
|
|
98
100
|
row: data2,
|
|
99
101
|
rawRow: rawData[dataIndex],
|
|
100
|
-
index,
|
|
101
|
-
separateData
|
|
102
|
+
index: dataIndex,
|
|
103
|
+
separateData
|
|
102
104
|
});
|
|
105
|
+
row.$__SEPARATE_DATA.push(separateData);
|
|
103
106
|
return data2;
|
|
104
107
|
}));
|
|
105
108
|
return res;
|
|
@@ -2537,7 +2537,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2537
2537
|
modelValue: boolean;
|
|
2538
2538
|
};
|
|
2539
2539
|
emit: (event: "success" | "update:modelValue", ...args: any[]) => void;
|
|
2540
|
-
form:
|
|
2540
|
+
form: {
|
|
2541
|
+
account: string;
|
|
2542
|
+
password: string;
|
|
2543
|
+
};
|
|
2541
2544
|
rules: import("naive-ui").FormRules;
|
|
2542
2545
|
style: {
|
|
2543
2546
|
width: string;
|
|
@@ -2541,7 +2541,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2541
2541
|
modelValue: boolean;
|
|
2542
2542
|
};
|
|
2543
2543
|
emit: (event: "success" | "update:modelValue", ...args: any[]) => void;
|
|
2544
|
-
form:
|
|
2544
|
+
form: {
|
|
2545
|
+
account: string;
|
|
2546
|
+
password: string;
|
|
2547
|
+
};
|
|
2545
2548
|
rules: import("naive-ui").FormRules;
|
|
2546
2549
|
style: {
|
|
2547
2550
|
width: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, reactive, ref,
|
|
1
|
+
import { defineComponent, reactive, ref, watch, openBlock, createBlock, unref, normalizeStyle, withCtx, createElementVNode, createVNode, createTextVNode } from 'vue';
|
|
2
2
|
import { useMessage, NModal, NForm, NFormItem, NInput, NButton } from 'naive-ui';
|
|
3
3
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
4
4
|
|
|
@@ -19,7 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
account: "",
|
|
20
20
|
password: ""
|
|
21
21
|
};
|
|
22
|
-
let form = reactive(
|
|
22
|
+
let form = reactive({ ...DEFAULT_FORM });
|
|
23
23
|
const rules = {
|
|
24
24
|
account: { required: true, message: "\u8BF7\u8F93\u5165\u8D26\u53F7" },
|
|
25
25
|
password: { required: true, message: "\u8BF7\u8F93\u5165\u5BC6\u7801" }
|
|
@@ -33,9 +33,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
33
33
|
};
|
|
34
34
|
const submit = async () => {
|
|
35
35
|
var _a;
|
|
36
|
-
const { data = {} } = await props.verifyUser(form);
|
|
36
|
+
const { data = {} } = await props.verifyUser(form) || {};
|
|
37
37
|
if (data.result !== "SUCCESS") {
|
|
38
|
-
$message.error(data.resultMsg);
|
|
38
|
+
$message.error(data.resultMsg || "\u8BF7\u6DFB\u52A0\u8EAB\u4EFD\u6821\u9A8C\u63A5\u53E3\u914D\u7F6E");
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
emit("success", (_a = data.map) == null ? void 0 : _a.token);
|
|
@@ -51,12 +51,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
|
-
onMounted(() => {
|
|
55
|
-
});
|
|
56
54
|
watch(() => props.modelValue, (val) => {
|
|
57
55
|
if (val)
|
|
58
56
|
return;
|
|
59
|
-
form
|
|
57
|
+
Object.assign(form, DEFAULT_FORM);
|
|
60
58
|
});
|
|
61
59
|
return (_ctx, _cache) => {
|
|
62
60
|
return openBlock(), createBlock(unref(NModal), {
|
|
@@ -26,7 +26,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
26
26
|
modelValue: boolean;
|
|
27
27
|
};
|
|
28
28
|
emit: (event: "success" | "update:modelValue", ...args: any[]) => void;
|
|
29
|
-
form:
|
|
29
|
+
form: {
|
|
30
|
+
account: string;
|
|
31
|
+
password: string;
|
|
32
|
+
};
|
|
30
33
|
rules: FormRules;
|
|
31
34
|
style: {
|
|
32
35
|
width: string;
|
|
@@ -52,6 +52,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
52
52
|
endY: number;
|
|
53
53
|
}>;
|
|
54
54
|
topList: import("vue").ComputedRef<import("./src/interface").IDate[]>;
|
|
55
|
+
getRightInfo: import("vue").ComputedRef<any>;
|
|
55
56
|
propItems: any;
|
|
56
57
|
computedYCell: (type: import("./src/interface").IPointType) => number;
|
|
57
58
|
cumputedX: (value: string | number) => any;
|
|
@@ -81,6 +82,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
81
82
|
}) => void;
|
|
82
83
|
setPopup: (point: any) => void;
|
|
83
84
|
getEqualXTypes: (pointX: number) => import("./src/interface").IPointType[];
|
|
85
|
+
drawScaleValue: (yScaleValueList: any[]) => void;
|
|
84
86
|
PopupTip: import("vue").DefineComponent<{
|
|
85
87
|
show: {
|
|
86
88
|
type: BooleanConstructor;
|
|
@@ -65,10 +65,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
return grid.mainYCell * grid.subYCell + grid.surplusYCell;
|
|
66
66
|
});
|
|
67
67
|
const endX = computed(() => {
|
|
68
|
+
var _a;
|
|
68
69
|
const { width, right = null, top } = props.data;
|
|
69
70
|
if (!right)
|
|
70
71
|
return width;
|
|
71
|
-
const endWidth = right.width
|
|
72
|
+
const endWidth = (_a = right.width) != null ? _a : 0;
|
|
72
73
|
return width - endWidth;
|
|
73
74
|
});
|
|
74
75
|
const endXLimit = computed(() => {
|
|
@@ -148,7 +149,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
149
|
});
|
|
149
150
|
const event = computed(() => {
|
|
150
151
|
var _a;
|
|
151
|
-
return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true };
|
|
152
|
+
return ((_a = props.data.grid) == null ? void 0 : _a.event) || { selectable: true, evented: true, hovered: true };
|
|
152
153
|
});
|
|
153
154
|
const itemList = computed(() => {
|
|
154
155
|
const { left } = props.data;
|
|
@@ -214,6 +215,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
214
215
|
}
|
|
215
216
|
return topList2.sort((a, b) => a.seq - b.seq);
|
|
216
217
|
});
|
|
218
|
+
const getRightInfo = computed(() => {
|
|
219
|
+
var _a;
|
|
220
|
+
const { left, right } = props.data;
|
|
221
|
+
const temperatureObj = left.yScaleValue.find((v) => v.type === "temperature");
|
|
222
|
+
const yScaleValue = (right == null ? void 0 : right.yScaleValue) || {};
|
|
223
|
+
if ((_a = temperatureObj == null ? void 0 : temperatureObj.list) == null ? void 0 : _a.length) {
|
|
224
|
+
Object.assign(yScaleValue, {
|
|
225
|
+
list: temperatureObj.list.map((v) => Math.floor((1.8 * v + 32) * 100) / 100),
|
|
226
|
+
spaceGridNumber: temperatureObj.spaceGridNumber
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return yScaleValue;
|
|
230
|
+
});
|
|
217
231
|
const propItems = reactive({
|
|
218
232
|
canvasWidth: props.data.width,
|
|
219
233
|
canvasHeight: props.data.height,
|
|
@@ -252,7 +266,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
252
266
|
temperatureYCell: temperatureYCell.value,
|
|
253
267
|
painYCell: painYCell.value,
|
|
254
268
|
event: event.value,
|
|
255
|
-
itemList: itemList.value
|
|
269
|
+
itemList: itemList.value,
|
|
270
|
+
getRightInfo: getRightInfo.value
|
|
256
271
|
});
|
|
257
272
|
function computedYCell(type) {
|
|
258
273
|
const { yScaleValue } = props.data.left;
|
|
@@ -260,13 +275,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
260
275
|
const list = (item == null ? void 0 : item.list) || [];
|
|
261
276
|
if (!list.length)
|
|
262
277
|
return 0;
|
|
263
|
-
return yCellHeight.value / ((
|
|
278
|
+
return yCellHeight.value / ((list[1] - list[0]) / item.spaceGridNumber);
|
|
264
279
|
}
|
|
265
280
|
const { cumputedX, cumputedY, getXValue, getYValue } = useCumputedPoint(propItems);
|
|
266
281
|
useTop(canvas, propItems);
|
|
267
282
|
const { pointTipProps, pointMenuProps, clickMenu, setPopup, getEqualXTypes } = useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, getYValue, props.addRenderItem);
|
|
268
|
-
useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, getYValue, getEqualXTypes);
|
|
269
|
-
useRight(canvas, propItems);
|
|
283
|
+
const { drawScaleValue } = useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, getYValue, getEqualXTypes);
|
|
284
|
+
useRight(canvas, propItems, drawScaleValue);
|
|
270
285
|
useBottom(canvas, propItems);
|
|
271
286
|
useOther(canvas, propItems, cumputedX);
|
|
272
287
|
onMounted(() => {
|
|
@@ -53,6 +53,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
53
|
endY: number;
|
|
54
54
|
}>;
|
|
55
55
|
topList: import("vue").ComputedRef<IDate[]>;
|
|
56
|
+
getRightInfo: import("vue").ComputedRef<any>;
|
|
56
57
|
propItems: any;
|
|
57
58
|
computedYCell: (type: IPointType) => number;
|
|
58
59
|
cumputedX: (value: string | number) => any;
|
|
@@ -82,6 +83,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
82
83
|
}) => void;
|
|
83
84
|
setPopup: (point: any) => void;
|
|
84
85
|
getEqualXTypes: (pointX: number) => IPointType[];
|
|
86
|
+
drawScaleValue: (yScaleValueList: any[]) => void;
|
|
85
87
|
PopupTip: import("vue").DefineComponent<{
|
|
86
88
|
show: {
|
|
87
89
|
type: BooleanConstructor;
|
|
@@ -20,8 +20,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
style: normalizeStyle(unref(pointStyle))
|
|
21
21
|
}, [
|
|
22
22
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.list, (item) => {
|
|
23
|
-
return openBlock(), createElementBlock("li",
|
|
24
|
-
}),
|
|
23
|
+
return openBlock(), createElementBlock("li", { key: item }, toDisplayString(item), 1);
|
|
24
|
+
}), 128))
|
|
25
25
|
], 4), [
|
|
26
26
|
[vShow, __props.show]
|
|
27
27
|
])
|
|
@@ -31,8 +31,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
31
31
|
originY,
|
|
32
32
|
endY,
|
|
33
33
|
itemList,
|
|
34
|
-
|
|
35
|
-
painHeight,
|
|
34
|
+
event,
|
|
36
35
|
vitalSignsOriginY,
|
|
37
36
|
painOriginY
|
|
38
37
|
} = propItems;
|
|
@@ -131,23 +130,23 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
131
130
|
function setCanvasEvent() {
|
|
132
131
|
if (!propItems.event.evented)
|
|
133
132
|
return;
|
|
134
|
-
canvas.value.on("mouse:up", (
|
|
133
|
+
canvas.value.on("mouse:up", (event2) => {
|
|
135
134
|
var _a;
|
|
136
|
-
if (
|
|
137
|
-
const { x = 0, y = 0 } =
|
|
135
|
+
if (event2.button === 3) {
|
|
136
|
+
const { x = 0, y = 0 } = event2.pointer || {};
|
|
138
137
|
if (x >= originX && x <= endX && y >= originY && y <= endY) {
|
|
139
138
|
pointTipProps.show = false;
|
|
140
139
|
pointMenuProps.point = { x, y };
|
|
141
140
|
pointMenuProps.show = true;
|
|
142
|
-
const { type } = ((_a =
|
|
143
|
-
if (
|
|
141
|
+
const { type } = ((_a = event2.target) == null ? void 0 : _a.origin) || {};
|
|
142
|
+
if (event2.target && (type === "temperature" || type === "pain")) {
|
|
144
143
|
if (type === "temperature") {
|
|
145
144
|
pointMenuProps.list = [...TEMPERATURE_MENU];
|
|
146
145
|
}
|
|
147
146
|
if (type === "pain") {
|
|
148
147
|
pointMenuProps.list = [...PAIN_MENU];
|
|
149
148
|
}
|
|
150
|
-
pointMenuProps.target =
|
|
149
|
+
pointMenuProps.target = event2.target;
|
|
151
150
|
} else {
|
|
152
151
|
pointMenuProps.target = null;
|
|
153
152
|
pointMenuProps.list = ["\u65B0\u589E\u8282\u70B9"];
|
|
@@ -162,7 +161,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
162
161
|
dataIndex: v.dataIndex,
|
|
163
162
|
key: v.key
|
|
164
163
|
},
|
|
165
|
-
pointer:
|
|
164
|
+
pointer: event2.pointer
|
|
166
165
|
});
|
|
167
166
|
}
|
|
168
167
|
});
|
|
@@ -397,21 +396,23 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
397
396
|
});
|
|
398
397
|
}
|
|
399
398
|
function setPointEvent(point) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
399
|
+
if (event.hovered) {
|
|
400
|
+
point.on("mouseover", () => {
|
|
401
|
+
setPopup(point);
|
|
402
|
+
});
|
|
403
|
+
point.on("mouseout", () => {
|
|
404
|
+
pointTipProps.show = false;
|
|
405
|
+
});
|
|
406
|
+
}
|
|
406
407
|
point.on("moving", () => {
|
|
407
408
|
moveLimit(point);
|
|
408
409
|
updateLine(point);
|
|
409
410
|
canvas.value.renderAll();
|
|
410
|
-
setPopup(point);
|
|
411
|
+
event.hovered && setPopup(point);
|
|
411
412
|
});
|
|
412
|
-
point.on("mouseup:before", (
|
|
413
|
+
point.on("mouseup:before", (event2) => {
|
|
413
414
|
pointTipProps.show = false;
|
|
414
|
-
if (
|
|
415
|
+
if (event2.e.button === 0) {
|
|
415
416
|
const { type } = point.origin;
|
|
416
417
|
const value = getYValue(type, point.top);
|
|
417
418
|
emits("change", {
|
|
@@ -430,9 +431,18 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
430
431
|
x: point.left,
|
|
431
432
|
y: point.top
|
|
432
433
|
};
|
|
433
|
-
|
|
434
|
-
pointTipProps.list = [`${title} ${yValue}${unit || ""}`, `\u65F6\u95F4 ${((data == null ? void 0 : data.time) || getXValue(point.left)).slice(-5)}`];
|
|
434
|
+
pointTipProps.list = [getListValue(), `\u65F6\u95F4 ${((data == null ? void 0 : data.time) || getXValue(point.left)).slice(-5)}`];
|
|
435
435
|
pointTipProps.show = true;
|
|
436
|
+
function getListValue() {
|
|
437
|
+
const { value, drugReduce, physicsReduce } = data;
|
|
438
|
+
if (drugReduce) {
|
|
439
|
+
return `\u836F\u7269\u964D${type == "pain" ? "\u75DB" : "\u6E29"} ${value}\u2014>${drugReduce}${unit || ""}`;
|
|
440
|
+
}
|
|
441
|
+
if (physicsReduce) {
|
|
442
|
+
return `\u7269\u7406\u964D${type == "pain" ? "\u75DB" : "\u6E29"} ${value}\u2014>${physicsReduce}${unit || ""}`;
|
|
443
|
+
}
|
|
444
|
+
return `${title} ${value}${unit || ""}`;
|
|
445
|
+
}
|
|
436
446
|
}
|
|
437
447
|
function moveLimit(point) {
|
|
438
448
|
point.setCoords();
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../utils';
|
|
3
3
|
import { IPropItems } from '../interface';
|
|
4
|
-
export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any, setPopup: Function, pointTipProps: any, getXValue: Function, getYValue: Function, getEqualXTypes: Function):
|
|
4
|
+
export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: any, setPopup: Function, pointTipProps: any, getXValue: Function, getYValue: Function, getEqualXTypes: Function): {
|
|
5
|
+
drawScaleValue: (yScaleValueList: any[]) => void;
|
|
6
|
+
};
|
|
@@ -16,8 +16,8 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
16
16
|
iconsWidth,
|
|
17
17
|
itemList,
|
|
18
18
|
painIndex,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
right,
|
|
20
|
+
getRightInfo
|
|
21
21
|
} = propItems;
|
|
22
22
|
const mainScaleWidth = 9;
|
|
23
23
|
const subScaleWidth = 5;
|
|
@@ -88,13 +88,23 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
88
88
|
canvas.value.add(title, ...list);
|
|
89
89
|
title.sendToBack();
|
|
90
90
|
}
|
|
91
|
-
function drawScaleValue() {
|
|
91
|
+
function drawScaleValue(yScaleValueList) {
|
|
92
|
+
var _a;
|
|
93
|
+
if (!(yScaleValueList == null ? void 0 : yScaleValueList.length))
|
|
94
|
+
return;
|
|
95
|
+
const { layout } = yScaleValueList[0];
|
|
96
|
+
let start = iconsWidth;
|
|
97
|
+
let end = originX;
|
|
98
|
+
if (layout === "right") {
|
|
99
|
+
start = endX;
|
|
100
|
+
end = endX + ((_a = right == null ? void 0 : right.width) != null ? _a : 0);
|
|
101
|
+
}
|
|
92
102
|
const groupList = [];
|
|
93
|
-
const column = !painHeight ?
|
|
94
|
-
const colWidth = (
|
|
95
|
-
const residue = (
|
|
103
|
+
const column = !painHeight || layout === "right" ? yScaleValueList.length : yScaleValueList.length - 1;
|
|
104
|
+
const colWidth = (end - start) / column;
|
|
105
|
+
const residue = (end - start) % column;
|
|
96
106
|
const firstColWidth = colWidth + residue;
|
|
97
|
-
|
|
107
|
+
yScaleValueList.forEach((item, index) => {
|
|
98
108
|
if (item.type === "pain") {
|
|
99
109
|
drwaPainScaleValue(item);
|
|
100
110
|
return;
|
|
@@ -108,7 +118,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
108
118
|
list.push(line2);
|
|
109
119
|
}
|
|
110
120
|
const rectWidth = index === 0 ? firstColWidth : colWidth;
|
|
111
|
-
const rectLeft = index === 0 ?
|
|
121
|
+
const rectLeft = index === 0 ? start : firstColWidth + start + (index - 1) * colWidth;
|
|
112
122
|
const line = index > 0 ? new fabric.Line([rectLeft, painIndex == 0 ? vitalSignsOriginY.originY : originY, rectLeft, vitalSignsOriginY.endY], {
|
|
113
123
|
...defaultBorderStyle
|
|
114
124
|
}) : null;
|
|
@@ -157,9 +167,9 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
157
167
|
});
|
|
158
168
|
groupList.push(new fabric.Rect({
|
|
159
169
|
...defaultRectStyle,
|
|
160
|
-
width:
|
|
161
|
-
height: endY - originY,
|
|
162
|
-
left:
|
|
170
|
+
width: layout === "right" ? end - start - 1 : end - start,
|
|
171
|
+
height: layout === "right" ? endY - originY - 1 : endY - originY,
|
|
172
|
+
left: start,
|
|
163
173
|
top: originY,
|
|
164
174
|
originX: "left",
|
|
165
175
|
originY: "top"
|
|
@@ -249,11 +259,19 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
249
259
|
}
|
|
250
260
|
onMounted(() => {
|
|
251
261
|
nextTick(() => {
|
|
262
|
+
var _a;
|
|
252
263
|
iconsWidth && drawIcons();
|
|
253
|
-
|
|
264
|
+
const yScaleValueList = left.yScaleValue.filter((v) => v.layout === "left" || v.type === "pain");
|
|
265
|
+
if ((right == null ? void 0 : right.width) && ((_a = right == null ? void 0 : right.yScaleValue) == null ? void 0 : _a.layout) === "left") {
|
|
266
|
+
yScaleValueList.push(getRightInfo);
|
|
267
|
+
}
|
|
268
|
+
drawScaleValue(yScaleValueList);
|
|
254
269
|
canvas.value.renderAll();
|
|
255
270
|
});
|
|
256
271
|
});
|
|
272
|
+
return {
|
|
273
|
+
drawScaleValue
|
|
274
|
+
};
|
|
257
275
|
}
|
|
258
276
|
|
|
259
277
|
export { useLeft };
|
|
@@ -3,25 +3,75 @@ import { fabric } from '../utils/index.js';
|
|
|
3
3
|
import { defaultStyle } from './useDraw.js';
|
|
4
4
|
|
|
5
5
|
function useOther(canvas, propItems, cumputedX) {
|
|
6
|
-
const {
|
|
6
|
+
const { other, vitalSignsOriginY } = propItems;
|
|
7
7
|
function drawOther() {
|
|
8
|
-
if (!other
|
|
8
|
+
if (!(other == null ? void 0 : other.list))
|
|
9
9
|
return false;
|
|
10
10
|
const list = [];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const otherList = [];
|
|
12
|
+
other.list.forEach((item) => {
|
|
13
|
+
const align = item.align || "vertical";
|
|
14
|
+
const left = cumputedX(item.time);
|
|
15
|
+
const obj = otherList.find((v) => v.left == left);
|
|
16
|
+
if (obj) {
|
|
17
|
+
obj[align].push(item);
|
|
18
|
+
} else {
|
|
19
|
+
const initObj = {
|
|
20
|
+
left,
|
|
21
|
+
vertical: [],
|
|
22
|
+
horizontal: []
|
|
23
|
+
};
|
|
24
|
+
initObj[align].push(item);
|
|
25
|
+
otherList.push(initObj);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
let textWidth = 0;
|
|
29
|
+
otherList.forEach((item) => {
|
|
30
|
+
let topY = vitalSignsOriginY.originY;
|
|
31
|
+
let leftX = item.left;
|
|
32
|
+
let textHeight = 0;
|
|
33
|
+
item.vertical.forEach((v) => {
|
|
34
|
+
const { commonOptions, value } = getTextData(v);
|
|
35
|
+
topY += (v.baseTop || 0) + textHeight;
|
|
36
|
+
const text = new fabric.Text(value, {
|
|
37
|
+
top: topY,
|
|
38
|
+
left: item.left,
|
|
39
|
+
...commonOptions
|
|
40
|
+
});
|
|
41
|
+
textHeight = text.height || 0;
|
|
42
|
+
setTextWidth(text);
|
|
43
|
+
});
|
|
44
|
+
item.horizontal.forEach((v, i) => {
|
|
45
|
+
if (i > 0 || item.vertical.length) {
|
|
46
|
+
leftX += textWidth;
|
|
47
|
+
}
|
|
48
|
+
const { commonOptions, value } = getTextData(v);
|
|
49
|
+
const text = new fabric.Text(value, {
|
|
50
|
+
top: vitalSignsOriginY.originY,
|
|
51
|
+
left: leftX,
|
|
52
|
+
...commonOptions
|
|
53
|
+
});
|
|
54
|
+
setTextWidth(text);
|
|
20
55
|
});
|
|
21
|
-
list.push(text);
|
|
22
56
|
});
|
|
57
|
+
function setTextWidth(text) {
|
|
58
|
+
if (!textWidth) {
|
|
59
|
+
textWidth = text.width || 0;
|
|
60
|
+
}
|
|
61
|
+
list.push(text);
|
|
62
|
+
}
|
|
63
|
+
function getTextData(v) {
|
|
64
|
+
return {
|
|
65
|
+
commonOptions: {
|
|
66
|
+
originX: "center",
|
|
67
|
+
textAlign: "center",
|
|
68
|
+
...defaultStyle,
|
|
69
|
+
...v.style || {}
|
|
70
|
+
},
|
|
71
|
+
value: String(v.value.toString().split("").join("\n"))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
23
74
|
const group = list.length > 0 ? new fabric.Group([...list], { ...defaultStyle }) : null;
|
|
24
|
-
group && group.sendToBack();
|
|
25
75
|
group && canvas.value.add(group);
|
|
26
76
|
}
|
|
27
77
|
onMounted(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../utils';
|
|
3
3
|
import { IPropItems } from '../interface';
|
|
4
|
-
export declare function useRight(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;
|
|
4
|
+
export declare function useRight(canvas: Ref<fabric.Canvas>, propItems: IPropItems, drawScaleValue: Function): void;
|