cnhis-design-vue 3.1.16-beta.0 → 3.1.16-beta.11

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 (109) hide show
  1. package/es/packages/big-table/index.d.ts +652 -430
  2. package/es/packages/big-table/src/BigTable.vue.d.ts +655 -457
  3. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +106 -112
  4. package/es/packages/big-table/src/bigTableProps.d.ts +4 -0
  5. package/es/packages/big-table/src/bigTableProps.js +2 -1
  6. package/es/packages/big-table/src/bigTableState.d.ts +2 -0
  7. package/es/packages/big-table/src/bigTableState.js +3 -1
  8. package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -1
  9. package/es/packages/big-table/src/hooks/index.d.ts +9 -0
  10. package/es/packages/big-table/src/hooks/index.js +9 -0
  11. package/es/packages/big-table/src/hooks/useAnchor.d.ts +7 -0
  12. package/es/packages/big-table/src/hooks/useAnchor.js +49 -0
  13. package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +24 -8
  14. package/es/packages/big-table/src/hooks/useEdit.js +1 -1
  15. package/es/packages/big-table/src/hooks/useEvent.d.ts +1 -1
  16. package/es/packages/big-table/src/hooks/useEvent.js +3 -2
  17. package/es/packages/big-table/style/index.css +1 -2
  18. package/es/packages/button-print/index.d.ts +6 -3
  19. package/es/packages/button-print/src/ButtonPrint.vue.d.ts +6 -3
  20. package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +2 -1
  21. package/es/packages/button-print/src/components/IdentityVerification.js +5 -7
  22. package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +6 -3
  23. package/es/packages/drag-layout/index.d.ts +2 -2
  24. package/es/packages/drag-layout/src/DragLayout.vue.d.ts +2 -2
  25. package/es/packages/fabric-chart/src/FabricChart.js +2 -1
  26. package/es/packages/fabric-chart/src/hooks/constant.js +5 -5
  27. package/es/packages/fabric-chart/src/hooks/useCenter.js +20 -23
  28. package/es/packages/fabric-chart/src/hooks/useDraw.js +11 -4
  29. package/es/packages/fabric-chart/src/hooks/useEvent.js +11 -3
  30. package/es/packages/fabric-chart/src/hooks/useLeft.js +8 -4
  31. package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
  32. package/es/packages/fabric-chart/src/hooks/useTop.js +5 -8
  33. package/es/packages/field-set/index.d.ts +1 -1
  34. package/es/packages/field-set/src/FieldSet.vue.d.ts +1 -1
  35. package/es/packages/form-config/index.d.ts +110 -3367
  36. package/es/packages/form-config/src/FormConfig.js +42 -34
  37. package/es/packages/form-config/src/FormConfig.vue.d.ts +147 -3404
  38. package/es/packages/form-config/src/components/FormConfigCreator.js +13 -11
  39. package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +23 -22
  40. package/es/packages/form-config/src/components/FormConfigEdit.js +2 -2
  41. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +75 -49
  42. package/es/packages/form-config/src/constants/index.d.ts +58 -24
  43. package/es/packages/form-config/src/constants/index.js +52 -23
  44. package/es/packages/form-config/src/hooks/index.d.ts +1 -0
  45. package/es/packages/form-config/src/hooks/index.js +1 -0
  46. package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +2 -1
  47. package/es/packages/form-config/src/hooks/useConfigurationField.js +29 -80
  48. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -3
  49. package/es/packages/form-config/src/hooks/usePresetRenderer.js +16 -19
  50. package/es/packages/form-config/src/hooks/useSortable.js +1 -1
  51. package/es/packages/form-config/src/types/index.d.ts +22 -4
  52. package/es/packages/form-config/src/utils/index.d.ts +2 -0
  53. package/es/packages/form-config/src/utils/index.js +15 -0
  54. package/es/packages/form-config/style/index.css +27 -3
  55. package/es/packages/form-render/index.d.ts +13 -15
  56. package/es/packages/form-render/src/FormRender.js +10 -7
  57. package/es/packages/form-render/src/FormRender.vue.d.ts +14 -16
  58. package/es/packages/form-render/src/components/renderer/cascader.d.ts +2 -14
  59. package/es/packages/form-render/src/components/renderer/cascader.js +3 -3
  60. package/es/packages/form-render/src/components/renderer/checkbox.js +1 -1
  61. package/es/packages/form-render/src/components/renderer/combination/index.js +2 -1
  62. package/es/packages/form-render/src/components/renderer/complex.js +1 -1
  63. package/es/packages/form-render/src/components/renderer/date.d.ts +20 -4
  64. package/es/packages/form-render/src/components/renderer/date.js +36 -20
  65. package/es/packages/form-render/src/components/renderer/input.js +2 -1
  66. package/es/packages/form-render/src/components/renderer/inputNumber.js +2 -1
  67. package/es/packages/form-render/src/components/renderer/linebar.js +1 -4
  68. package/es/packages/form-render/src/components/renderer/radio.js +1 -1
  69. package/es/packages/form-render/src/components/renderer/select.d.ts +1 -10
  70. package/es/packages/form-render/src/components/renderer/select.js +26 -17
  71. package/es/packages/form-render/src/components/renderer/slider.d.ts +8 -344
  72. package/es/packages/form-render/src/components/renderer/slider.js +24 -2
  73. package/es/packages/form-render/src/components/renderer/switch.js +1 -1
  74. package/es/packages/form-render/src/components/renderer/textarea.js +1 -1
  75. package/es/packages/form-render/src/hooks/useAnchor.js +7 -4
  76. package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +15 -9
  77. package/es/packages/form-render/src/hooks/useBusinessBinding.js +62 -58
  78. package/es/packages/form-render/src/hooks/useChangeContext.d.ts +4 -2
  79. package/es/packages/form-render/src/hooks/useChangeContext.js +4 -7
  80. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +17 -7
  81. package/es/packages/form-render/src/hooks/useFormContext.d.ts +2 -1
  82. package/es/packages/form-render/src/hooks/useFormContext.js +2 -2
  83. package/es/packages/form-render/src/hooks/useFormValidator.js +13 -3
  84. package/es/packages/form-render/src/hooks/useInitialData.d.ts +1 -1
  85. package/es/packages/form-render/src/hooks/useInitialData.js +9 -4
  86. package/es/packages/form-render/src/hooks/useTypeNormalize.js +1 -1
  87. package/es/packages/form-render/src/types/fieldItem.d.ts +11 -12
  88. package/es/packages/form-render/src/types/index.d.ts +7 -8
  89. package/es/packages/form-render/src/utils/business.d.ts +12 -0
  90. package/es/packages/form-render/src/utils/business.js +78 -0
  91. package/es/packages/form-render/src/utils/dom.d.ts +6 -0
  92. package/es/packages/form-render/src/utils/dom.js +14 -0
  93. package/es/packages/form-render/src/utils/index.d.ts +6 -26
  94. package/es/packages/form-render/src/utils/index.js +9 -138
  95. package/es/packages/form-render/src/utils/schema.d.ts +16 -0
  96. package/es/packages/form-render/src/utils/schema.js +94 -0
  97. package/es/packages/index.css +28 -5
  98. package/es/packages/scale-view/src/hooks/scaleview-init.js +35 -35
  99. package/es/packages/scale-view/src/hooks/use-component.d.ts +7 -7
  100. package/es/packages/select-label/index.d.ts +10 -10
  101. package/es/packages/select-label/src/LabelFormContent.vue.d.ts +3 -3
  102. package/es/packages/select-label/src/SelectLabel.vue.d.ts +7 -7
  103. package/es/packages/shortcut-setter/index.d.ts +3452 -1
  104. package/es/packages/shortcut-setter/src/ShortcutSetter.js +5 -2
  105. package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +3456 -1
  106. package/es/packages/time-line/index.d.ts +2 -2
  107. package/es/packages/time-line/src/TimeLine.vue.d.ts +2 -2
  108. package/global.d.ts +8 -8
  109. package/package.json +1 -1
@@ -28,6 +28,7 @@ function useColumnConfigAdaptor() {
28
28
  type,
29
29
  "select"
30
30
  ]),
31
+ ...["DATE"].map((type) => [type, "date"]),
31
32
  ...["INPUT"].map((type) => [type, "input"]),
32
33
  ...["DIGITAL"].map((type) => [type, "number"])
33
34
  ]);
@@ -40,13 +41,17 @@ function useColumnConfigAdaptor() {
40
41
  const validateHandler = (value, result) => {
41
42
  if (!isObject(value))
42
43
  return;
43
- result.componentProps = Object.assign({}, result.comonentProps, {
44
- maxlength: value.max_length,
45
- minlength: value.min_length,
46
- max: value.max_value,
47
- min: value.min_value,
48
- precision: value.decimal_length
49
- });
44
+ const keyMap = {
45
+ maxlength: "max_length",
46
+ minlength: "min_length",
47
+ max: "max_value",
48
+ min: "min_value",
49
+ precision: "decimal_length"
50
+ };
51
+ result.componentProps = Object.assign({}, result.comonentProps, Object.entries(keyMap).reduce((res, [k, v]) => {
52
+ res[k] = value[v];
53
+ return res;
54
+ }, {}));
50
55
  };
51
56
  const dateRangeValidate = (value, result) => {
52
57
  if (!isObject(value))
@@ -71,14 +76,25 @@ function useColumnConfigAdaptor() {
71
76
  const option = { label: value.describe, ...value };
72
77
  result.options = isArray(result.options) ? [...result.options, option] : [option];
73
78
  };
79
+ const htmlTypeHandler = (value, result, fieldItem) => {
80
+ var _a;
81
+ if (!isString(value))
82
+ return;
83
+ if (value === "DATE") {
84
+ result.formType = isString(fieldItem.date_format) && fieldItem.date_format.startsWith("HH:mm") ? "time" : "date";
85
+ return;
86
+ }
87
+ result.formType = (_a = htmlTypeValueMap.get(value)) != null ? _a : value;
88
+ };
74
89
  const settingMap = new Map([
75
90
  ["multi_select_value", { property: "multiple", valueMap: multipleValueMap }],
76
91
  ["is_null", isNullHandler],
77
92
  ["validate", validateHandler],
78
93
  ["dateValidate", dateRangeValidate],
94
+ ["date_format", "valueFormat"],
79
95
  ...["open", "close"].map((key) => [key, switchOptionHandler]),
80
96
  ["is_edit", { property: "isEdit", valueMap: isEditValueMap }],
81
- ["html_type", { property: "formType", valueMap: htmlTypeValueMap }],
97
+ ["html_type", htmlTypeHandler],
82
98
  ["option", { property: "options", fieldMap: /* @__PURE__ */ new Map([["text", "label"]]) }],
83
99
  [
84
100
  "alias",
@@ -100,7 +100,7 @@ const useEdit = (props, state, emit, xGrid) => {
100
100
  } else {
101
101
  row[column.columnName] = value;
102
102
  }
103
- if ((column == null ? void 0 : column.formType) === "date" && !value) {
103
+ if (((column == null ? void 0 : column.formType) === "date" || (column == null ? void 0 : column.formType) === "time") && !value) {
104
104
  row[column.columnName] = void 0;
105
105
  }
106
106
  emit("formChange", { value, row, column, index, oldValue });
@@ -1,4 +1,4 @@
1
- export declare const useEvent: (props: any, state: any, emit: any, xGrid: any) => {
1
+ export declare const useEvent: (props: any, state: any, emit: any, xGrid: any, anchorEvent: Function) => {
2
2
  keyDown: ({ $event }: {
3
3
  $event: KeyboardEvent;
4
4
  }) => void;
@@ -1,7 +1,7 @@
1
1
  import vexutils from '../../../../src/utils/vexutils';
2
2
  import { hideFilterWrap } from '../utils.js';
3
3
 
4
- const useEvent = (props, state, emit, xGrid) => {
4
+ const useEvent = (props, state, emit, xGrid, anchorEvent) => {
5
5
  function keyDown({ $event }) {
6
6
  var _a, _b;
7
7
  let activeRow = null;
@@ -29,7 +29,7 @@ const useEvent = (props, state, emit, xGrid) => {
29
29
  if ($event.key === "ArrowDown" && index < ((_b = props.data) == null ? void 0 : _b.length) - 1) {
30
30
  activeIndex = index + 1;
31
31
  }
32
- let row = xGridRef.getData(activeIndex);
32
+ const row = xGridRef.getData(activeIndex);
33
33
  xGridRef.setCurrentRow(row);
34
34
  xGridRef.scrollToRow(row);
35
35
  emitKeyBoard();
@@ -60,6 +60,7 @@ const useEvent = (props, state, emit, xGrid) => {
60
60
  hideFilterWrap(state, props);
61
61
  }
62
62
  scrollEvent(params);
63
+ anchorEvent(params);
63
64
  };
64
65
  return {
65
66
  keyDown,
@@ -282,7 +282,7 @@ body > .vxe-table--tooltip-wrapper {
282
282
  height: 30px;
283
283
  line-height: 30px;
284
284
  }
285
- .custom-big-table .vxe-table .vxe-cell--checkbox.is--disabled .vxe-checkbox--icon {
285
+ .custom-big-table .vxe-table .vxe-cell--checkbox .vxe-checkbox--label {
286
286
  display: none;
287
287
  }
288
288
  .custom-big-table .filter-box {
@@ -307,7 +307,6 @@ body > .vxe-table--tooltip-wrapper {
307
307
  }
308
308
  .custom-big-table .disabled-checked-tips {
309
309
  position: absolute;
310
- left: 6px;
311
310
  top: 50%;
312
311
  bottom: 0;
313
312
  right: 0;
@@ -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;
@@ -4016,7 +4019,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
4016
4019
  type: BooleanConstructor;
4017
4020
  default: boolean;
4018
4021
  };
4019
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
4022
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
4020
4023
  to: import("vue").PropType<string | HTMLElement>;
4021
4024
  displayDirective: {
4022
4025
  type: import("vue").PropType<"show" | "if">;
@@ -4978,7 +4981,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
4978
4981
  type: BooleanConstructor;
4979
4982
  default: boolean;
4980
4983
  };
4981
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
4984
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
4982
4985
  to: import("vue").PropType<string | HTMLElement>;
4983
4986
  displayDirective: {
4984
4987
  type: import("vue").PropType<"show" | "if">;
@@ -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;
@@ -4020,7 +4023,7 @@ declare const _default: import("vue").DefineComponent<{
4020
4023
  type: BooleanConstructor;
4021
4024
  default: boolean;
4022
4025
  };
4023
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
4026
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
4024
4027
  to: import("vue").PropType<string | HTMLElement>;
4025
4028
  displayDirective: {
4026
4029
  type: import("vue").PropType<"show" | "if">;
@@ -4982,7 +4985,7 @@ declare const _default: import("vue").DefineComponent<{
4982
4985
  type: BooleanConstructor;
4983
4986
  default: boolean;
4984
4987
  };
4985
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
4988
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
4986
4989
  to: import("vue").PropType<string | HTMLElement>;
4987
4990
  displayDirective: {
4988
4991
  type: import("vue").PropType<"show" | "if">;
@@ -228,7 +228,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
228
228
  templateId: getTemplateIdByFormatId(state.currentFormatId),
229
229
  print: {
230
230
  print: "1",
231
- type: "1"
231
+ type: "1",
232
+ callback: "1"
232
233
  },
233
234
  params
234
235
  };
@@ -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;
@@ -1505,7 +1508,7 @@ declare const _default: import("vue").DefineComponent<{
1505
1508
  type: BooleanConstructor;
1506
1509
  default: boolean;
1507
1510
  };
1508
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
1511
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
1509
1512
  to: import("vue").PropType<string | HTMLElement>;
1510
1513
  displayDirective: {
1511
1514
  type: import("vue").PropType<"show" | "if">;
@@ -2467,7 +2470,7 @@ declare const _default: import("vue").DefineComponent<{
2467
2470
  type: BooleanConstructor;
2468
2471
  default: boolean;
2469
2472
  };
2470
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
2473
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
2471
2474
  to: import("vue").PropType<string | HTMLElement>;
2472
2475
  displayDirective: {
2473
2476
  type: import("vue").PropType<"show" | "if">;
@@ -1888,7 +1888,7 @@ declare const DragLayout: SFCWithInstall<import("vue").DefineComponent<{
1888
1888
  type: BooleanConstructor;
1889
1889
  default: boolean;
1890
1890
  };
1891
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
1891
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
1892
1892
  to: import("vue").PropType<string | HTMLElement>;
1893
1893
  displayDirective: {
1894
1894
  type: import("vue").PropType<"show" | "if">;
@@ -2850,7 +2850,7 @@ declare const DragLayout: SFCWithInstall<import("vue").DefineComponent<{
2850
2850
  type: BooleanConstructor;
2851
2851
  default: boolean;
2852
2852
  };
2853
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
2853
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
2854
2854
  to: import("vue").PropType<string | HTMLElement>;
2855
2855
  displayDirective: {
2856
2856
  type: import("vue").PropType<"show" | "if">;
@@ -1888,7 +1888,7 @@ declare const _default: import("vue").DefineComponent<{
1888
1888
  type: BooleanConstructor;
1889
1889
  default: boolean;
1890
1890
  };
1891
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
1891
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
1892
1892
  to: import("vue").PropType<string | HTMLElement>;
1893
1893
  displayDirective: {
1894
1894
  type: import("vue").PropType<"show" | "if">;
@@ -2850,7 +2850,7 @@ declare const _default: import("vue").DefineComponent<{
2850
2850
  type: BooleanConstructor;
2851
2851
  default: boolean;
2852
2852
  };
2853
- preset: import("vue").PropType<"dialog" | "confirm" | "card">;
2853
+ preset: import("vue").PropType<"dialog" | "card" | "confirm">;
2854
2854
  to: import("vue").PropType<string | HTMLElement>;
2855
2855
  displayDirective: {
2856
2856
  type: import("vue").PropType<"show" | "if">;
@@ -115,7 +115,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
115
115
  const times = top.xScalevalue.times;
116
116
  let left = originX.value - xCellWidth.value;
117
117
  function getDate(date) {
118
- return String(date).length < 9 ? `20${date}` : date;
118
+ const [year = "2022", month = "01", day = "01"] = String(date).match(/\d+/g) || [];
119
+ return `20${year}`.slice(-4) + "-" + `00${month}`.slice(-2) + "-" + `00${day}`.slice(-2);
119
120
  }
120
121
  const timeList = dateList.map((item) => {
121
122
  return times.map((v) => {
@@ -1,18 +1,18 @@
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
  {
8
8
  label: "\u836F\u7269\u964D\u6E29",
9
9
  value: void 0,
10
- type: "drugCooling"
10
+ type: "drugReduce"
11
11
  },
12
12
  {
13
13
  label: "\u7269\u7406\u964D\u6E29",
14
14
  value: void 0,
15
- type: "physicalCooling"
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: "drugReducePain"
27
+ type: "drugReduce"
28
28
  },
29
29
  {
30
30
  label: "\u7269\u7406\u964D\u75DB",
31
31
  value: void 0,
32
- type: "physicalReducePain"
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
- coolingStyle = {},
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 coolLine, coolPoint, noRiseText, arrowGroup, verifiedText;
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.physicalCooling || v.drugCooling) {
289
- const coolingLineStyle = {
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
- stroke: coolingStyle.stroke,
292
- strokeDashArray: [3, 3]
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
- coolPoint = drawPoint("circle", {
295
+ reducePoint = drawPoint(((_a = reduceStyle == null ? void 0 : reduceStyle.point) == null ? void 0 : _a.type) || "circle", {
299
296
  left: points[0],
300
- top: coolY,
301
- ...coolingStyle,
297
+ top: reduceY,
298
+ ...reduceStyle.point,
302
299
  ...defaultStyle
303
300
  });
304
- coolLine && otherList.push(coolLine);
305
- coolPoint && otherList.push(coolPoint);
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 = (_a = scaleValue.dataList[dataIndex + 1].list) == null ? void 0 : _a[0];
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
- coolLine,
342
- coolPoint,
338
+ reduceLine,
339
+ reducePoint,
343
340
  lockMovementX: true,
344
341
  ...pointAttr,
345
342
  ...propItems.event
@@ -456,9 +453,9 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
456
453
  point.rightLine.setCoords();
457
454
  point.rightLine.set({ x1: point.left, y1: point.top });
458
455
  }
459
- if (point.coolLine) {
460
- point.coolLine.setCoords();
461
- point.coolLine.set({ x1: point.left, y1: point.top });
456
+ if (point.reduceLine) {
457
+ point.reduceLine.setCoords();
458
+ point.reduceLine.set({ x1: point.left, y1: point.top });
462
459
  }
463
460
  if (point.noRiseText) {
464
461
  point.noRiseText.setCoords();
@@ -44,12 +44,19 @@ function drawTextGroup(rectStyle, fontStyle, groupStyle) {
44
44
  ...defaultRectStyle,
45
45
  ...rectStyle
46
46
  });
47
- const texts = new fabric.Text(String(fontStyle.value), {
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
- ...fontStyle.textAlign == "left" ? {
51
- originX: "left",
52
- left: -(rectStyle.width / 2)
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
- selections2.push(drawRect({
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,
@@ -65,12 +65,14 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
65
65
  const list = [];
66
66
  if (item.showScale || item.showNumber) {
67
67
  const { lineXMain, textLeft } = getScaleInfo(item.position, iconsWidth, originX - iconsWidth);
68
+ const listLen = item.list.length;
68
69
  item.list.forEach((v, i) => {
69
70
  let top = painOriginY.endY - i * yCellHeight * item.spaceGridNumber;
70
71
  if (i === 0) {
71
72
  top = endY - 5;
72
73
  }
73
- if (item.showNumber) {
74
+ const isMaxMinNumber = i === 0 || i === listLen - 1;
75
+ if (item.showNumber && (isMaxMinNumber ? item.showMaxMinNumber : true)) {
74
76
  list.push(drawScaleNumber(v, item, textLeft, top));
75
77
  }
76
78
  if (item.showScale && i !== 0) {
@@ -117,20 +119,22 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
117
119
  const spaceScale = spaceGridNumber * yCellHeight / 5;
118
120
  const position = item.position || "center";
119
121
  const { lineXMain, lineXSub, textLeft } = getScaleInfo(item.position, rectLeft, rectWidth);
122
+ const listLen = item.list.length;
120
123
  item.list.forEach((v, i) => {
121
124
  const top = vitalSignsOriginY.endY - i * yCellHeight * spaceGridNumber;
122
- if (item.showNumber) {
125
+ const isMaxMinNumber = i === 0 || i === listLen - 1;
126
+ if (item.showNumber && (isMaxMinNumber ? item.showMaxMinNumber : true)) {
123
127
  const text = drawScaleNumber(v, item, textLeft, i === 0 ? top - 5 : top);
124
128
  list.push(text);
125
129
  }
126
- if (item.showScale && i !== item.list.length - 1) {
130
+ if (item.showScale && i !== listLen - 1) {
127
131
  for (let j = 0; j < 5; j++) {
128
132
  if (j > 0 || !item.showNumber || position !== "center") {
129
133
  const x1 = j == 0 ? lineXMain[0] : lineXSub[0];
130
134
  const x2 = j == 0 ? lineXMain[1] : lineXSub[1];
131
135
  const y = top - j * spaceScale;
132
136
  createLine([x1, y, x2, y]);
133
- if (i == item.list.length - 2 && j == 4) {
137
+ if (i == listLen - 2 && j == 4) {
134
138
  createLine([lineXMain[0], y - spaceScale, lineXMain[1], y - spaceScale]);
135
139
  }
136
140
  }
@@ -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(() => {