cnhis-design-vue 3.1.16-beta.7 → 3.1.16
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/index.d.ts +1 -1
- package/es/packages/big-table/src/BigTable.vue.d.ts +3 -19
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +6 -4
- 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/hooks/useAnchor.d.ts +1 -1
- package/es/packages/big-table/src/hooks/useAnchor.js +20 -12
- package/es/packages/big-table/src/hooks/useSeparateRow.js +5 -2
- 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/ButtonPrint.vue_vue_type_script_setup_true_lang.js +2 -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/src/FabricChart.js +1 -1
- package/es/packages/fabric-chart/src/components/PopupTip.js +2 -2
- package/es/packages/fabric-chart/src/hooks/constant.js +5 -5
- package/es/packages/fabric-chart/src/hooks/useCenter.js +31 -25
- package/es/packages/fabric-chart/src/hooks/useDraw.js +11 -4
- package/es/packages/fabric-chart/src/hooks/useEvent.js +11 -3
- package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
- package/es/packages/fabric-chart/src/hooks/useTop.js +5 -8
- package/es/packages/form-config/index.d.ts +89 -3337
- package/es/packages/form-config/src/FormConfig.js +42 -34
- package/es/packages/form-config/src/FormConfig.vue.d.ts +132 -3380
- package/es/packages/form-config/src/components/FormConfigCreator.js +13 -11
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +13 -8
- package/es/packages/form-config/src/components/FormConfigEdit.js +1 -1
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +64 -33
- package/es/packages/form-config/src/constants/index.d.ts +20 -20
- package/es/packages/form-config/src/constants/index.js +27 -36
- package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +2 -1
- package/es/packages/form-config/src/hooks/useConfigurationField.js +28 -42
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -3
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +16 -19
- package/es/packages/form-config/src/hooks/useSortable.js +1 -1
- package/es/packages/form-config/src/types/index.d.ts +22 -4
- package/es/packages/form-config/src/utils/index.d.ts +2 -0
- package/es/packages/form-config/src/utils/index.js +15 -0
- package/es/packages/form-config/style/index.css +27 -3
- package/es/packages/form-render/index.d.ts +3 -1
- package/es/packages/form-render/index.js +0 -1
- package/es/packages/form-render/src/FormRender.js +7 -8
- package/es/packages/form-render/src/FormRender.vue.d.ts +3 -1
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +2 -14
- 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 +11 -3
- 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/{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.d.ts +1 -10
- package/es/packages/form-render/src/components/renderer/select.js +7 -4
- package/es/packages/form-render/src/hooks/index.d.ts +0 -1
- package/es/packages/form-render/src/hooks/index.js +0 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +12 -5
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +2 -1
- package/es/packages/form-render/src/types/fieldItem.d.ts +15 -12
- package/es/packages/form-render/src/types/index.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 +60 -0
- 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 +38 -11
- package/es/packages/index.js +0 -1
- package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +1 -0
- package/es/packages/shortcut-setter/index.d.ts +9 -6
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +9 -6
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.js +11 -1
- 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
|
@@ -2868,7 +2868,7 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2868
2868
|
loadExpandMethod: ({ row, rowIndex }: any) => Promise<void>;
|
|
2869
2869
|
nestHandleClickRow: (table: any, data: any) => void;
|
|
2870
2870
|
initAnchor: () => void;
|
|
2871
|
-
updateAnchor: (field: string) => void
|
|
2871
|
+
updateAnchor: (field: string) => Promise<void>;
|
|
2872
2872
|
anchorEvent: ({ scrollLeft }: {
|
|
2873
2873
|
scrollLeft: number;
|
|
2874
2874
|
}) => void;
|
|
@@ -1126,8 +1126,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1126
1126
|
textColorGhostHoverWarning: string;
|
|
1127
1127
|
textColorGhostPressedWarning: string;
|
|
1128
1128
|
textColorGhostFocusWarning: string;
|
|
1129
|
-
textColorGhostDisabledWarning: string;
|
|
1130
|
-
/**
|
|
1129
|
+
textColorGhostDisabledWarning: string; /**
|
|
1131
1130
|
* 判断是否渲染EditForm
|
|
1132
1131
|
* @param {*} row
|
|
1133
1132
|
* @param {*} column
|
|
@@ -1684,22 +1683,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1684
1683
|
onClick: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
|
|
1685
1684
|
onChange: import("vue").PropType<import("naive-ui/es/input/src/interface").OnUpdateValue>;
|
|
1686
1685
|
onClear: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(e: MouseEvent) => void>>;
|
|
1687
|
-
status: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
1688
|
-
* 针对 bigTable 的设置列
|
|
1689
|
-
* type: 列的类型
|
|
1690
|
-
* field: 列字段名(注:属性层级越深,渲染性能将直线下降)
|
|
1691
|
-
* title: 列标题(支持开启国际化)
|
|
1692
|
-
* width: 列宽度(如果为空则均匀分配剩余宽度,如果全部列固定了,可能会存在宽屏下不会铺满,可以配合 "%" 或者 "min-width" 布局)
|
|
1693
|
-
* minWidth: 最小列宽度;会自动将剩余空间按比例分配
|
|
1694
|
-
* resizable: 列是否允许拖动列宽调整大小
|
|
1695
|
-
* visible: 列是否显示
|
|
1696
|
-
* fixed: 将列固定在左侧或者右侧(注意:固定列应该放在左右两侧的位置)
|
|
1697
|
-
* align: 列对齐方式
|
|
1698
|
-
* headerAlign: 表头列的对齐方式
|
|
1699
|
-
* footerAlign: 表尾列的对齐方式
|
|
1700
|
-
* formatter: 格式化显示内容 Function({cellValue, row, column})
|
|
1701
|
-
* sortable: 是否允许列排序
|
|
1702
|
-
*/
|
|
1686
|
+
status: import("vue").PropType<import("naive-ui/es/form/src/interface").FormValidationStatus>;
|
|
1703
1687
|
'onUpdate:value': import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<import("naive-ui/es/input/src/interface").OnUpdateValue>>;
|
|
1704
1688
|
onUpdateValue: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<import("naive-ui/es/input/src/interface").OnUpdateValue>>;
|
|
1705
1689
|
textDecoration: import("vue").PropType<string | [string, string]>;
|
|
@@ -2888,7 +2872,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2888
2872
|
loadExpandMethod: ({ row, rowIndex }: any) => Promise<void>;
|
|
2889
2873
|
nestHandleClickRow: (table: any, data: any) => void;
|
|
2890
2874
|
initAnchor: () => void;
|
|
2891
|
-
updateAnchor: (field: string) => void
|
|
2875
|
+
updateAnchor: (field: string) => Promise<void>;
|
|
2892
2876
|
anchorEvent: ({ scrollLeft }: {
|
|
2893
2877
|
scrollLeft: number;
|
|
2894
2878
|
}) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, reactive, useAttrs, computed, onMounted, onUnmounted, onActivated, createVNode, h, resolveComponent, Teleport, createTextVNode,
|
|
1
|
+
import { defineComponent, ref, reactive, useAttrs, computed, onMounted, onUnmounted, onActivated, nextTick, createVNode, h, resolveComponent, Teleport, createTextVNode, watch, openBlock, createElementBlock, Fragment, createBlock, unref, withCtx, renderList, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, mergeProps, renderSlot, toDisplayString, withDirectives, vShow, isVNode } from 'vue';
|
|
2
2
|
import { isArray, isFunction } from 'lodash-es';
|
|
3
3
|
import bigTableState from './bigTableState.js';
|
|
4
4
|
import bigTableProps from './bigTableProps.js';
|
|
@@ -243,7 +243,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
243
243
|
let columns = formatColumns(config);
|
|
244
244
|
columns = handleGroupColums(columns, props);
|
|
245
245
|
xGrid.value && xGrid.value.reloadColumn(columns);
|
|
246
|
-
|
|
246
|
+
nextTick(() => {
|
|
247
|
+
initAnchor();
|
|
248
|
+
});
|
|
247
249
|
setGroupTreeExpand();
|
|
248
250
|
resetTableInlineEditStatus();
|
|
249
251
|
};
|
|
@@ -352,10 +354,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
352
354
|
showSeq = true
|
|
353
355
|
} = map;
|
|
354
356
|
if (isEdit) {
|
|
355
|
-
|
|
357
|
+
Object.assign(state.editConfig, editConfig);
|
|
356
358
|
state.rowConfig.height = 48;
|
|
357
359
|
}
|
|
358
|
-
|
|
360
|
+
Object.assign(state.rowConfig, rowConfig);
|
|
359
361
|
state.rowConfig.keyField = handleRowId.value;
|
|
360
362
|
if (selectType) {
|
|
361
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, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const useAnchor: (props: any, state: any, emit: any, xGrid: any) => {
|
|
2
2
|
initAnchor: () => void;
|
|
3
|
-
updateAnchor: (field: string) => void
|
|
3
|
+
updateAnchor: (field: string) => Promise<void>;
|
|
4
4
|
anchorEvent: ({ scrollLeft }: {
|
|
5
5
|
scrollLeft: number;
|
|
6
6
|
}) => void;
|
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
import { useThrottleFn } from '@vueuse/core';
|
|
2
2
|
|
|
3
3
|
const useAnchor = (props, state, emit, xGrid) => {
|
|
4
|
+
let setAnchorStatus = true;
|
|
4
5
|
function initAnchor() {
|
|
5
|
-
var _a;
|
|
6
|
+
var _a, _b, _c;
|
|
6
7
|
if ((_a = props.anchor) == null ? void 0 : _a.length) {
|
|
7
8
|
const columns = xGrid.value.getColumns();
|
|
8
9
|
let left = 0;
|
|
9
10
|
columns.forEach((column) => {
|
|
10
|
-
const { field, minWidth, width } = column;
|
|
11
|
+
const { field, minWidth, width, fixed } = column;
|
|
11
12
|
const colWidth = +(minWidth || width);
|
|
12
|
-
left
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
if (fixed == "left") ; else {
|
|
14
|
+
left += colWidth;
|
|
15
|
+
const anchorObj = props.anchor.find((v) => v.field === field);
|
|
16
|
+
anchorObj && state.anchorList.push({
|
|
17
|
+
...anchorObj,
|
|
18
|
+
left: left - colWidth
|
|
19
|
+
});
|
|
20
|
+
}
|
|
18
21
|
});
|
|
19
|
-
state.anchorValue = state.anchorList[0].field;
|
|
22
|
+
state.anchorValue = ((_c = (_b = state.anchorList) == null ? void 0 : _b[0]) == null ? void 0 : _c.field) || "";
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
|
-
function updateAnchor(field) {
|
|
23
|
-
|
|
25
|
+
async function updateAnchor(field) {
|
|
26
|
+
setAnchorStatus = false;
|
|
27
|
+
const anchorObj = state.anchorList.find((v) => v.field === field);
|
|
28
|
+
await xGrid.value.scrollTo(anchorObj.left);
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
setAnchorStatus = true;
|
|
31
|
+
});
|
|
24
32
|
}
|
|
25
33
|
function setAnchorValue({ scrollLeft }) {
|
|
26
|
-
if (state.anchorList.length) {
|
|
34
|
+
if (state.anchorList.length && setAnchorStatus) {
|
|
27
35
|
const anchorObj = state.anchorList.find((v) => scrollLeft < v.left);
|
|
28
36
|
if (anchorObj) {
|
|
29
37
|
state.anchorValue = anchorObj.field;
|
|
@@ -84,13 +84,15 @@ 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
92
|
index,
|
|
92
|
-
separateData
|
|
93
|
+
separateData
|
|
93
94
|
});
|
|
95
|
+
row.$__SEPARATE_DATA = [separateData];
|
|
94
96
|
return row;
|
|
95
97
|
}
|
|
96
98
|
const data2 = { $__SEPARATE: true };
|
|
@@ -98,8 +100,9 @@ function useSeparateRow(getColumnConfig, getFieldItem, $VXETable) {
|
|
|
98
100
|
row: data2,
|
|
99
101
|
rawRow: rawData[dataIndex],
|
|
100
102
|
index,
|
|
101
|
-
separateData
|
|
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;
|
|
@@ -260,7 +260,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
260
260
|
const list = (item == null ? void 0 : item.list) || [];
|
|
261
261
|
if (!list.length)
|
|
262
262
|
return 0;
|
|
263
|
-
return yCellHeight.value / ((
|
|
263
|
+
return yCellHeight.value / ((list[1] - list[0]) / item.spaceGridNumber);
|
|
264
264
|
}
|
|
265
265
|
const { cumputedX, cumputedY, getXValue, getYValue } = useCumputedPoint(propItems);
|
|
266
266
|
useTop(canvas, propItems);
|
|
@@ -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
|
])
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const TEMPERATURE_MENU = [
|
|
2
2
|
{
|
|
3
3
|
label: "\u5347\u6E29",
|
|
4
|
-
value:
|
|
4
|
+
value: true,
|
|
5
5
|
type: "rise"
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
label: "\u836F\u7269\u964D\u6E29",
|
|
9
9
|
value: void 0,
|
|
10
|
-
type: "
|
|
10
|
+
type: "drugReduce"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
label: "\u7269\u7406\u964D\u6E29",
|
|
14
14
|
value: void 0,
|
|
15
|
-
type: "
|
|
15
|
+
type: "physicsReduce"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
label: "\u4E0D\u5347",
|
|
@@ -24,12 +24,12 @@ const PAIN_MENU = [
|
|
|
24
24
|
{
|
|
25
25
|
label: "\u836F\u7269\u964D\u75DB",
|
|
26
26
|
value: void 0,
|
|
27
|
-
type: "
|
|
27
|
+
type: "drugReduce"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
label: "\u7269\u7406\u964D\u75DB",
|
|
31
31
|
value: void 0,
|
|
32
|
-
type: "
|
|
32
|
+
type: "physicsReduce"
|
|
33
33
|
}
|
|
34
34
|
];
|
|
35
35
|
|
|
@@ -234,19 +234,19 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
234
234
|
lineAttr = {},
|
|
235
235
|
noRiseStyle = {},
|
|
236
236
|
verifiedStyle = {},
|
|
237
|
-
|
|
237
|
+
reduceStyle = {},
|
|
238
238
|
type = "circle"
|
|
239
239
|
} = item;
|
|
240
240
|
const pointList = [];
|
|
241
241
|
const lineList = [];
|
|
242
242
|
const otherList = [];
|
|
243
243
|
item.list.forEach((v, index) => {
|
|
244
|
-
var _a;
|
|
244
|
+
var _a, _b;
|
|
245
245
|
const points = getPointer(v, scaleValue);
|
|
246
246
|
const nextV = item.list[index + 1];
|
|
247
247
|
const nextPoint = getPointer(nextV, scaleValue);
|
|
248
|
-
let
|
|
249
|
-
if (points && scaleValue.type === "temperature") {
|
|
248
|
+
let reduceLine, reducePoint, noRiseText, arrowGroup, verifiedText;
|
|
249
|
+
if ((points == null ? void 0 : points.length) && (scaleValue.type === "temperature" || scaleValue.type === "pain")) {
|
|
250
250
|
if (v.noRise) {
|
|
251
251
|
if (typeof v.noRise === "string") {
|
|
252
252
|
noRiseText = drawText([points[0], points[1] + 5], {
|
|
@@ -285,24 +285,21 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
285
285
|
});
|
|
286
286
|
otherList.push(verifiedText);
|
|
287
287
|
}
|
|
288
|
-
if (v.
|
|
289
|
-
const
|
|
288
|
+
if (v.physicsReduce || v.drugReduce) {
|
|
289
|
+
const reduceY = cumputedY(scaleValue.type, scaleValue.list, v.physicsReduce || v.drugReduce);
|
|
290
|
+
reduceLine = drawLine([...points, points[0], reduceY], {
|
|
290
291
|
...lineAttr,
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
};
|
|
294
|
-
const coolY = cumputedY(scaleValue.type, scaleValue.list, v.physicalCooling || v.drugCooling);
|
|
295
|
-
coolLine = drawLine([...points, points[0], coolY], {
|
|
296
|
-
...coolingLineStyle
|
|
292
|
+
...reduceStyle.line,
|
|
293
|
+
...defaultStyle
|
|
297
294
|
});
|
|
298
|
-
|
|
295
|
+
reducePoint = drawPoint(((_a = reduceStyle == null ? void 0 : reduceStyle.point) == null ? void 0 : _a.type) || "circle", {
|
|
299
296
|
left: points[0],
|
|
300
|
-
top:
|
|
301
|
-
...
|
|
297
|
+
top: reduceY,
|
|
298
|
+
...reduceStyle.point,
|
|
302
299
|
...defaultStyle
|
|
303
300
|
});
|
|
304
|
-
|
|
305
|
-
|
|
301
|
+
reduceLine && otherList.push(reduceLine);
|
|
302
|
+
reducePoint && otherList.push(reducePoint);
|
|
306
303
|
}
|
|
307
304
|
}
|
|
308
305
|
let point;
|
|
@@ -312,7 +309,7 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
312
309
|
...lineAttr
|
|
313
310
|
});
|
|
314
311
|
} else if (points && !nextPoint && !v.breakpoint && scaleValue.type === "temperature" && dataIndex < scaleValue.dataList.length - 1 && index === item.list.length - 1) {
|
|
315
|
-
const nextV2 = (
|
|
312
|
+
const nextV2 = (_b = scaleValue.dataList[dataIndex + 1].list) == null ? void 0 : _b[0];
|
|
316
313
|
const nextLinePoint = getPointer(nextV2, scaleValue);
|
|
317
314
|
line = nextLinePoint ? drawLine([...points, ...nextLinePoint], {
|
|
318
315
|
...lineAttr
|
|
@@ -338,8 +335,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
338
335
|
verifiedText,
|
|
339
336
|
leftLine: previousLine,
|
|
340
337
|
rightLine: line,
|
|
341
|
-
|
|
342
|
-
|
|
338
|
+
reduceLine,
|
|
339
|
+
reducePoint,
|
|
343
340
|
lockMovementX: true,
|
|
344
341
|
...pointAttr,
|
|
345
342
|
...propItems.event
|
|
@@ -433,9 +430,18 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
433
430
|
x: point.left,
|
|
434
431
|
y: point.top
|
|
435
432
|
};
|
|
436
|
-
|
|
437
|
-
pointTipProps.list = [`${title} ${yValue}${unit || ""}`, `\u65F6\u95F4 ${((data == null ? void 0 : data.time) || getXValue(point.left)).slice(-5)}`];
|
|
433
|
+
pointTipProps.list = [getListValue(), `\u65F6\u95F4 ${((data == null ? void 0 : data.time) || getXValue(point.left)).slice(-5)}`];
|
|
438
434
|
pointTipProps.show = true;
|
|
435
|
+
function getListValue() {
|
|
436
|
+
const { value, drugReduce, physicsReduce } = data;
|
|
437
|
+
if (drugReduce) {
|
|
438
|
+
return `\u836F\u7269\u964D${type == "pain" ? "\u75DB" : "\u6E29"} ${value}\u2014>${drugReduce}${unit || ""}`;
|
|
439
|
+
}
|
|
440
|
+
if (physicsReduce) {
|
|
441
|
+
return `\u7269\u7406\u964D${type == "pain" ? "\u75DB" : "\u6E29"} ${value}\u2014>${physicsReduce}${unit || ""}`;
|
|
442
|
+
}
|
|
443
|
+
return `${title} ${value}${unit || ""}`;
|
|
444
|
+
}
|
|
439
445
|
}
|
|
440
446
|
function moveLimit(point) {
|
|
441
447
|
point.setCoords();
|
|
@@ -456,9 +462,9 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
456
462
|
point.rightLine.setCoords();
|
|
457
463
|
point.rightLine.set({ x1: point.left, y1: point.top });
|
|
458
464
|
}
|
|
459
|
-
if (point.
|
|
460
|
-
point.
|
|
461
|
-
point.
|
|
465
|
+
if (point.reduceLine) {
|
|
466
|
+
point.reduceLine.setCoords();
|
|
467
|
+
point.reduceLine.set({ x1: point.left, y1: point.top });
|
|
462
468
|
}
|
|
463
469
|
if (point.noRiseText) {
|
|
464
470
|
point.noRiseText.setCoords();
|
|
@@ -44,12 +44,19 @@ function drawTextGroup(rectStyle, fontStyle, groupStyle) {
|
|
|
44
44
|
...defaultRectStyle,
|
|
45
45
|
...rectStyle
|
|
46
46
|
});
|
|
47
|
-
const
|
|
47
|
+
const { value = "\u6807\u9898", textAlign = "center", verticalAlign = "center" } = fontStyle;
|
|
48
|
+
const textLeft = rectStyle.width / 2;
|
|
49
|
+
const textTop = rectStyle.height / 2;
|
|
50
|
+
const texts = new fabric.Text(String(value), {
|
|
48
51
|
...defaultTextStyle,
|
|
49
52
|
...fontStyle,
|
|
50
|
-
...
|
|
51
|
-
originX:
|
|
52
|
-
left: -
|
|
53
|
+
...textAlign == "left" || textAlign == "right" ? {
|
|
54
|
+
originX: textAlign,
|
|
55
|
+
left: textAlign == "left" ? -textLeft : textLeft
|
|
56
|
+
} : {},
|
|
57
|
+
...verticalAlign == "top" || verticalAlign == "bottom" ? {
|
|
58
|
+
originY: verticalAlign,
|
|
59
|
+
top: verticalAlign == "top" ? -textTop : textTop
|
|
53
60
|
} : {}
|
|
54
61
|
});
|
|
55
62
|
return new fabric.Group([rect, texts], {
|
|
@@ -47,12 +47,20 @@ function useCanvasEvent(canvas, propItems, emits) {
|
|
|
47
47
|
if (index > 0) {
|
|
48
48
|
topY += propItems[`${topList[index - 1].key}Height`];
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
left: iconsWidth,
|
|
50
|
+
const commonOptions = {
|
|
52
51
|
top: topY + 1,
|
|
53
|
-
width: endX - iconsWidth,
|
|
54
52
|
height: propItems[`${item.key}Height`] - 1
|
|
53
|
+
};
|
|
54
|
+
selections2.push(drawRect({
|
|
55
|
+
left: iconsWidth,
|
|
56
|
+
width: originX - iconsWidth,
|
|
57
|
+
...commonOptions
|
|
55
58
|
}, item.key));
|
|
59
|
+
selections2.push(drawRect({
|
|
60
|
+
left: originX,
|
|
61
|
+
width: endX - originX,
|
|
62
|
+
...commonOptions
|
|
63
|
+
}, item.key + "Title"));
|
|
56
64
|
});
|
|
57
65
|
selections2.push(drawRect({
|
|
58
66
|
left: originX,
|
|
@@ -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(() => {
|