cnhis-design-vue 3.1.16-beta.8 → 3.1.17-beta.0

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.
Files changed (81) hide show
  1. package/es/packages/big-table/index.d.ts +1 -1
  2. package/es/packages/big-table/src/BigTable.vue.d.ts +3 -19
  3. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +6 -4
  4. package/es/packages/big-table/src/components/edit-form/edit-date.js +13 -3
  5. package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -0
  6. package/es/packages/big-table/src/hooks/useAnchor.d.ts +1 -1
  7. package/es/packages/big-table/src/hooks/useAnchor.js +20 -12
  8. package/es/packages/big-table/src/hooks/useSeparateRow.js +5 -2
  9. package/es/packages/button-print/index.d.ts +4 -1
  10. package/es/packages/button-print/src/ButtonPrint.vue.d.ts +4 -1
  11. package/es/packages/button-print/src/components/IdentityVerification.js +5 -7
  12. package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +4 -1
  13. package/es/packages/fabric-chart/src/FabricChart.js +1 -1
  14. package/es/packages/fabric-chart/src/components/PopupTip.js +2 -2
  15. package/es/packages/fabric-chart/src/hooks/constant.js +1 -1
  16. package/es/packages/fabric-chart/src/hooks/useCenter.js +11 -2
  17. package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
  18. package/es/packages/form-config/index.d.ts +90 -3338
  19. package/es/packages/form-config/src/FormConfig.js +42 -34
  20. package/es/packages/form-config/src/FormConfig.vue.d.ts +134 -3382
  21. package/es/packages/form-config/src/components/FormConfigCreator.js +13 -11
  22. package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +16 -11
  23. package/es/packages/form-config/src/components/FormConfigEdit.js +1 -1
  24. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +60 -29
  25. package/es/packages/form-config/src/constants/index.d.ts +21 -21
  26. package/es/packages/form-config/src/constants/index.js +27 -36
  27. package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +2 -1
  28. package/es/packages/form-config/src/hooks/useConfigurationField.js +28 -42
  29. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -3
  30. package/es/packages/form-config/src/hooks/usePresetRenderer.js +16 -19
  31. package/es/packages/form-config/src/hooks/useSortable.js +1 -1
  32. package/es/packages/form-config/src/types/index.d.ts +22 -4
  33. package/es/packages/form-config/src/utils/index.d.ts +2 -0
  34. package/es/packages/form-config/src/utils/index.js +15 -0
  35. package/es/packages/form-config/style/index.css +27 -3
  36. package/es/packages/form-render/index.d.ts +6 -4
  37. package/es/packages/form-render/index.js +0 -1
  38. package/es/packages/form-render/src/FormRender.js +8 -9
  39. package/es/packages/form-render/src/FormRender.vue.d.ts +6 -4
  40. package/es/packages/form-render/src/components/renderer/{combination/index.d.ts → combination.d.ts} +3 -3
  41. package/es/packages/form-render/src/components/renderer/combination.js +92 -0
  42. package/es/packages/form-render/src/components/renderer/date.js +12 -4
  43. package/es/packages/form-render/src/components/renderer/formItem.js +12 -5
  44. package/es/packages/form-render/src/components/renderer/index.d.ts +1 -0
  45. package/es/packages/form-render/src/components/renderer/index.js +2 -1
  46. package/es/packages/form-render/src/components/renderer/inputGroup.js +1 -1
  47. package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/hooks/useDeepValidate.d.ts +0 -0
  48. package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/hooks/useDeepValidate.js +0 -0
  49. package/es/packages/form-render/src/components/renderer/jsonCombination/index.d.ts +44 -0
  50. package/es/packages/form-render/src/components/renderer/{combination → jsonCombination}/index.js +29 -14
  51. package/es/packages/form-render/src/components/renderer/select.js +11 -8
  52. package/es/packages/form-render/src/constants/index.d.ts +2 -2
  53. package/es/packages/form-render/src/hooks/index.d.ts +0 -1
  54. package/es/packages/form-render/src/hooks/index.js +0 -1
  55. package/es/packages/form-render/src/hooks/useAnchor.d.ts +3 -3
  56. package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
  57. package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
  58. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +12 -5
  59. package/es/packages/form-render/src/hooks/useFieldVisitor.js +6 -5
  60. package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +4 -4
  61. package/es/packages/form-render/src/hooks/useFormRequest.d.ts +2 -2
  62. package/es/packages/form-render/src/hooks/useTypeNormalize.js +2 -1
  63. package/es/packages/form-render/src/types/fieldItem.d.ts +4 -0
  64. package/es/packages/form-render/src/types/index.d.ts +4 -4
  65. package/es/packages/form-render/src/utils/dom.d.ts +2 -2
  66. package/es/packages/form-render/src/utils/index.js +3 -2
  67. package/es/packages/form-render/src/utils/schema.d.ts +62 -2
  68. package/es/packages/form-render/src/utils/schema.js +5 -2
  69. package/es/packages/form-render/style/index.css +11 -8
  70. package/es/packages/index.css +38 -11
  71. package/es/packages/index.js +0 -1
  72. package/es/packages/shortcut-provider/src/hooks/useShortcuts.js +1 -0
  73. package/es/packages/shortcut-setter/index.d.ts +7 -4
  74. package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +7 -4
  75. package/es/src/types/index.d.ts +2 -2
  76. package/es/src/utils/index.d.ts +1 -0
  77. package/es/src/utils/index.js +11 -1
  78. package/global.d.ts +8 -8
  79. package/package.json +4 -4
  80. package/es/packages/form-render/src/hooks/useInitialData.d.ts +0 -5
  81. 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, nextTick, watch, openBlock, createElementBlock, Fragment, createBlock, unref, withCtx, renderList, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, mergeProps, renderSlot, toDisplayString, withDirectives, vShow, isVNode } from 'vue';
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
- initAnchor();
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
- state.editConfig = Object.assign(state.editConfig, editConfig);
357
+ Object.assign(state.editConfig, editConfig);
356
358
  state.rowConfig.height = 48;
357
359
  }
358
- state.rowConfig = Object.assign(state.rowConfig, rowConfig);
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
- valueFormat: props.col.valueFormat || "yyyy-MM-dd HH:mm:ss",
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 += colWidth;
13
- const anchorObj = props.anchor.find((v) => v.field === field);
14
- anchorObj && state.anchorList.push({
15
- ...anchorObj,
16
- left: left - colWidth
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
- xGrid.value.scrollToColumn(field);
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: getSeparateRowData(parsedRowData, index)
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: getSeparateRowData(parsedRowData, index)
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: any;
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: any;
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, onMounted, watch, openBlock, createBlock, unref, normalizeStyle, withCtx, createElementVNode, createVNode, createTextVNode } from 'vue';
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(JSON.parse(JSON.stringify(DEFAULT_FORM)));
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 = JSON.parse(JSON.stringify(DEFAULT_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: any;
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 / ((parseInt(list[1]) - parseInt(list[0])) / item.spaceGridNumber);
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", null, toDisplayString(item), 1);
24
- }), 256))
23
+ return openBlock(), createElementBlock("li", { key: item }, toDisplayString(item), 1);
24
+ }), 128))
25
25
  ], 4), [
26
26
  [vShow, __props.show]
27
27
  ])
@@ -1,7 +1,7 @@
1
1
  const TEMPERATURE_MENU = [
2
2
  {
3
3
  label: "\u5347\u6E29",
4
- value: false,
4
+ value: true,
5
5
  type: "rise"
6
6
  },
7
7
  {
@@ -430,9 +430,18 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
430
430
  x: point.left,
431
431
  y: point.top
432
432
  };
433
- const yValue = getYValue(type, point.top);
434
- 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)}`];
435
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
+ }
436
445
  }
437
446
  function moveLimit(point) {
438
447
  point.setCoords();
@@ -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 { originY, other, vitalSignsOriginY } = propItems;
6
+ const { other, vitalSignsOriginY } = propItems;
7
7
  function drawOther() {
8
- if (!other || !other.list)
8
+ if (!(other == null ? void 0 : other.list))
9
9
  return false;
10
10
  const list = [];
11
- other.list.forEach((v, i) => {
12
- var _a;
13
- const text = new fabric.Text(String(v.value.toString().split("").join("\n")), {
14
- originX: "center",
15
- top: (((_a = v.style) == null ? void 0 : _a.baseTop) || 0) + vitalSignsOriginY.originY,
16
- left: cumputedX(v.time),
17
- textAlign: "center",
18
- ...defaultStyle,
19
- ...v.style || {}
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(() => {