cnhis-design-vue 3.4.0-beta.62 → 3.4.0-beta.65

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 (27) hide show
  1. package/es/_virtual/_virtual_i18n-methods.js +5 -1
  2. package/es/components/fabric-chart/index.d.ts +3 -3
  3. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +3 -3
  4. package/es/components/fabric-chart/src/components/PopupMenu.d.ts +4 -4
  5. package/es/components/fabric-chart/src/components/PopupMenu.js +57 -39
  6. package/es/components/fabric-chart/src/constants/index.d.ts +19 -4
  7. package/es/components/fabric-chart/src/constants/index.js +26 -10
  8. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.d.ts +4 -3
  9. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +119 -193
  10. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +4 -3
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +15 -26
  12. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +4 -3
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +6 -7
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +4 -3
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +8 -9
  16. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +4 -3
  17. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +81 -218
  18. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  19. package/es/components/fabric-chart/src/interface.d.ts +14 -1
  20. package/es/components/fabric-chart/src/utils/index.d.ts +0 -1
  21. package/es/components/fabric-chart/src/utils/index.js +1 -10
  22. package/es/components/fabric-chart/style/index.css +1 -1
  23. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -0
  24. package/es/components/index.css +1 -1
  25. package/es/components/select-person/src/SelectPerson.vue2.js +4 -3
  26. package/es/shared/package.json.js +1 -1
  27. package/package.json +2 -2
@@ -1,5 +1,9 @@
1
1
  function i18n(code, defaultValue) {
2
- return window.getLanguageByCode?.(code) || window.top?.getLanguageByCode?.(code) || defaultValue;
2
+ try {
3
+ return window.getLanguageByCode?.(code) || window.top?.getLanguageByCode?.(code) || defaultValue;
4
+ } catch (error) {
5
+ return defaultValue;
6
+ }
3
7
  }
4
8
 
5
9
  function i18nAbbr(code, defaultValue) {
@@ -239,7 +239,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<import("
239
239
  default: boolean;
240
240
  };
241
241
  list: {
242
- type: ArrayConstructor;
242
+ type: import("vue").PropType<import("./src/interface").PopupMenuItem[]>;
243
243
  default: () => never[];
244
244
  };
245
245
  point: {
@@ -257,7 +257,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<import("
257
257
  default: boolean;
258
258
  };
259
259
  list: {
260
- type: ArrayConstructor;
260
+ type: import("vue").PropType<import("./src/interface").PopupMenuItem[]>;
261
261
  default: () => never[];
262
262
  };
263
263
  point: {
@@ -273,7 +273,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<import("
273
273
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
274
274
  onClickMenu?: ((...args: any[]) => any) | undefined;
275
275
  }>, {
276
- list: unknown[];
276
+ list: import("./src/interface").PopupMenuItem[];
277
277
  show: boolean;
278
278
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
279
279
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "edit" | "error" | "add" | "change" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click")[], "remove" | "edit" | "error" | "add" | "change" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -233,7 +233,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
233
233
  default: boolean;
234
234
  };
235
235
  list: {
236
- type: ArrayConstructor;
236
+ type: PropType<import("./interface").PopupMenuItem[]>;
237
237
  default: () => never[];
238
238
  };
239
239
  point: {
@@ -251,7 +251,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
251
251
  default: boolean;
252
252
  };
253
253
  list: {
254
- type: ArrayConstructor;
254
+ type: PropType<import("./interface").PopupMenuItem[]>;
255
255
  default: () => never[];
256
256
  };
257
257
  point: {
@@ -267,7 +267,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
267
267
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
268
268
  onClickMenu?: ((...args: any[]) => any) | undefined;
269
269
  }>, {
270
- list: unknown[];
270
+ list: import("./interface").PopupMenuItem[];
271
271
  show: boolean;
272
272
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
273
273
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("remove" | "edit" | "error" | "add" | "change" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click")[], "remove" | "edit" | "error" | "add" | "change" | "ready" | "right-click" | "select" | "add:prevent" | "click:grid" | "event-click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -1,12 +1,12 @@
1
1
  import { PropType } from 'vue';
2
- import { IPropItems, ICoordinateValue } from '../interface';
2
+ import { IPropItems, ICoordinateValue, PopupMenuItem } from '../interface';
3
3
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
4
  show: {
5
5
  type: BooleanConstructor;
6
6
  default: boolean;
7
7
  };
8
8
  list: {
9
- type: ArrayConstructor;
9
+ type: PropType<PopupMenuItem[]>;
10
10
  default: () => never[];
11
11
  };
12
12
  point: {
@@ -24,7 +24,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
24
24
  default: boolean;
25
25
  };
26
26
  list: {
27
- type: ArrayConstructor;
27
+ type: PropType<PopupMenuItem[]>;
28
28
  default: () => never[];
29
29
  };
30
30
  point: {
@@ -40,7 +40,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
40
40
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
41
41
  onClickMenu?: ((...args: any[]) => any) | undefined;
42
42
  }>, {
43
- list: unknown[];
43
+ list: PopupMenuItem[];
44
44
  show: boolean;
45
45
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
46
46
  export default _default;
@@ -1,6 +1,7 @@
1
1
  import { i18n } from '../../../../_virtual/_virtual_i18n-methods.js';
2
2
  import { defineComponent, ref, watch, withDirectives, createVNode, vShow } from 'vue';
3
- import { NSpace, NInputNumber } from 'naive-ui';
3
+ import { NIcon, NSpace, NInputNumber } from 'naive-ui';
4
+ import { ChevronForwardOutline } from '@vicons/ionicons5';
4
5
  import useStyle from './useStyle.js';
5
6
  import { useEventListener, onClickOutside } from '@vueuse/core';
6
7
 
@@ -40,51 +41,49 @@ var PopupMenu = /* @__PURE__ */ defineComponent({
40
41
  onClickOutside(menuRef, (event) => {
41
42
  emit("update:show", false);
42
43
  });
43
- props.propItems;
44
44
  const pointStyle = useStyle(props);
45
- function setNoClick(item) {
46
- if (typeof item === "string" && (item.startsWith(i18n("10010.1.279", "\u65B0\u589E")) || item.startsWith(i18n("10010.1.215", "\u5220\u9664")))) {
47
- return true;
48
- }
49
- }
50
45
  function getItemContent(item) {
51
- if (typeof item === "string")
52
- return item;
53
- if (typeof item.value === "boolean")
54
- return item.label;
55
46
  if (item.renderItem)
56
47
  return item.renderItem();
57
- return createVNode(NSpace, {
58
- "inline": true,
59
- "align": "center"
60
- }, {
61
- default: () => [createVNode("span", null, [item.label]), createVNode(NInputNumber, {
62
- "style": "width: 110px",
63
- "size": "small",
64
- "value": item.value,
65
- "onUpdate:value": ($event) => item.value = $event,
66
- "clearable": true,
67
- "placeholder": i18n("10010.1.207", "\u8BF7\u8F93\u5165\u6570\u503C"),
68
- "showButton": false,
69
- "onFocus": () => emit("update:show", true)
70
- }, null)]
71
- });
48
+ if (item.hasInput)
49
+ return createVNode(NSpace, {
50
+ "inline": true,
51
+ "align": "center"
52
+ }, {
53
+ default: () => [createVNode("span", null, [item.label]), createVNode(NInputNumber, {
54
+ "style": "width: 110px",
55
+ "size": "small",
56
+ "value": item.value,
57
+ "onUpdate:value": ($event) => item.value = $event,
58
+ "clearable": true,
59
+ "placeholder": i18n("10010.1.207", "\u8BF7\u8F93\u5165\u6570\u503C"),
60
+ "showButton": false
61
+ }, null)]
62
+ });
63
+ return item.label;
64
+ }
65
+ function hasChildren(item) {
66
+ return Array.isArray(item.children) && item.children.length > 0;
72
67
  }
73
68
  function clickItem(event, item) {
74
- if (setNoClick(item))
75
- return void 0;
76
- if ((event == null ? void 0 : event.target.className) === "") {
77
- emit("update:show", false);
78
- emit("clickMenu", {
79
- item,
80
- target: props.target
81
- });
69
+ const target = event.target;
70
+ if (target && target.closest(".n-input-number")) {
71
+ event.stopPropagation();
72
+ return;
82
73
  }
74
+ if (item.isTitle)
75
+ return;
76
+ emit("update:show", false);
77
+ emit("clickMenu", {
78
+ item,
79
+ target: props.target,
80
+ pointer: props.point
81
+ });
83
82
  }
84
83
  watch(() => props.show, (value) => {
85
84
  if (value) {
86
85
  props.list.forEach((item) => {
87
- if (typeof item === "object" && Reflect.has(item, "value") && typeof item.value !== "boolean") {
86
+ if (Reflect.has(item, "value") && typeof item.value !== "boolean") {
88
87
  item.value = void 0;
89
88
  }
90
89
  });
@@ -94,14 +93,33 @@ var PopupMenu = /* @__PURE__ */ defineComponent({
94
93
  "ref": menuRef,
95
94
  "class": "c-fabric-chart-popup c-fabric-chart-popup__menu",
96
95
  "style": pointStyle.value
97
- }, [props.list.map((item) => {
96
+ }, [props.list.map((item, index) => {
97
+ var _a;
98
98
  return props.show ? createVNode("li", {
99
99
  "class": {
100
- "no-click": setNoClick(item)
100
+ "no-click": item.isTitle,
101
+ "has-children": hasChildren(item)
101
102
  },
102
103
  "onClick": (event) => clickItem(event, item),
103
- "key": item.type || item
104
- }, [getItemContent(item)]) : null;
104
+ "key": item.key
105
+ }, [createVNode("div", {
106
+ "class": "menu-item__content"
107
+ }, [getItemContent(item), hasChildren(item) ? createVNode(NIcon, {
108
+ "class": "submenu-arrow",
109
+ "size": 14,
110
+ "component": ChevronForwardOutline
111
+ }, null) : null]), hasChildren(item) ? createVNode("ul", {
112
+ "class": "c-fabric-chart-popup__submenu"
113
+ }, [(_a = item.children) == null ? void 0 : _a.map((child) => createVNode("li", {
114
+ "class": {
115
+ "no-click": child.isTitle,
116
+ "has-children": hasChildren(child)
117
+ },
118
+ "onClick": (event) => clickItem(event, child),
119
+ "key": child.key
120
+ }, [createVNode("div", {
121
+ "class": "menu-item__content"
122
+ }, [getItemContent(child)])]))]) : null]) : null;
105
123
  })]), [[vShow, props.show]]);
106
124
  }
107
125
  });
@@ -1,20 +1,35 @@
1
1
  export declare const TEMPERATURE_MENU: ({
2
2
  label: string;
3
3
  value: boolean;
4
- type: string;
4
+ key: string;
5
+ hasInput?: undefined;
5
6
  } | {
6
7
  label: string;
7
8
  value: undefined;
8
- type: string;
9
+ key: string;
10
+ hasInput: boolean;
9
11
  })[];
12
+ export declare const TITLE_MENU_MAP: {
13
+ add: {
14
+ label: string;
15
+ key: string;
16
+ isTitle: boolean;
17
+ };
18
+ remove: {
19
+ label: string;
20
+ key: string;
21
+ isTitle: boolean;
22
+ };
23
+ };
10
24
  export declare const PAIN_MENU: {
11
25
  label: string;
12
26
  value: undefined;
13
- type: string;
27
+ key: string;
28
+ hasInput: boolean;
14
29
  }[];
15
30
  export declare const OTHER_MENU: readonly {
16
31
  label: string;
17
- type: string;
32
+ key: string;
18
33
  }[];
19
34
  export declare const OVERLAP: {
20
35
  yemai: {
@@ -3,38 +3,54 @@ import { i18n } from '../../../../_virtual/_virtual_i18n-methods.js';
3
3
  const TEMPERATURE_MENU = [{
4
4
  label: i18n("10010.1.208", "\u5347\u6E29"),
5
5
  value: true,
6
- type: "rise"
6
+ key: "rise"
7
7
  }, {
8
8
  label: i18n("10010.1.209", "\u836F\u7269\u964D\u6E29"),
9
9
  value: void 0,
10
- type: "drugReduce"
10
+ key: "drugReduce",
11
+ hasInput: true
11
12
  }, {
12
13
  label: i18n("10010.1.210", "\u7269\u7406\u964D\u6E29"),
13
14
  value: void 0,
14
- type: "physicsReduce"
15
+ key: "physicsReduce",
16
+ hasInput: true
15
17
  }, {
16
18
  label: i18n("10010.1.211", "\u4E0D\u5347"),
17
19
  value: true,
18
- type: "noRise"
20
+ key: "noRise"
19
21
  }];
22
+ const TITLE_MENU_MAP = {
23
+ add: {
24
+ label: i18n("10010.1.219", "\u65B0\u589E\u8282\u70B9"),
25
+ key: "add",
26
+ isTitle: true
27
+ },
28
+ remove: {
29
+ label: i18n("10010.1.220", "\u5220\u9664\u8282\u70B9"),
30
+ key: "remove",
31
+ isTitle: true
32
+ }
33
+ };
20
34
  const PAIN_MENU = [{
21
35
  label: i18n("10010.1.212", "\u836F\u7269\u964D\u75DB"),
22
36
  value: void 0,
23
- type: "drugReduce"
37
+ key: "drugReduce",
38
+ hasInput: true
24
39
  }, {
25
40
  label: i18n("10010.1.213", "\u7269\u7406\u964D\u75DB"),
26
41
  value: void 0,
27
- type: "physicsReduce"
42
+ key: "physicsReduce",
43
+ hasInput: true
28
44
  }];
29
45
  const OTHER_MENU = Object.freeze([{
30
46
  label: i18n("10010.1.279", "\u65B0\u589E"),
31
- type: "add"
47
+ key: "add"
32
48
  }, {
33
49
  label: i18n("10010.1.214", "\u4FEE\u6539"),
34
- type: "edit"
50
+ key: "edit"
35
51
  }, {
36
52
  label: i18n("10010.1.215", "\u5220\u9664"),
37
- type: "remove"
53
+ key: "remove"
38
54
  }]);
39
55
  const BLUE = "#2563F4";
40
56
  const RED = "#FF1818";
@@ -86,4 +102,4 @@ var ECG = /* @__PURE__ */ ((ECG2) => {
86
102
  return ECG2;
87
103
  })(ECG || {});
88
104
 
89
- export { ECG, OTHER_MENU, OVERLAP, PAIN_MENU, TEMPERATURE_MENU };
105
+ export { ECG, OTHER_MENU, OVERLAP, PAIN_MENU, TEMPERATURE_MENU, TITLE_MENU_MAP };
@@ -1,10 +1,11 @@
1
1
  import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
- import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
4
+ import { ICoordinateValue, IPointTipProps, IPointMenuProps, PopupMenuItem } from '../../../../../components/fabric-chart/src/interface';
5
5
  export declare function useBirthProcess(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
- clickMenu: ({ item, target }: {
7
- item: any;
6
+ clickMenu: ({ item, pointer, target }: {
7
+ item: PopupMenuItem;
8
+ pointer: ICoordinateValue;
8
9
  target: any;
9
10
  }) => void;
10
11
  redrawPoints: () => void;