cnhis-design-vue 3.1.57-beta.1 → 3.1.57-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 (122) hide show
  1. package/es/components/button-print/index.d.ts +8 -8
  2. package/es/components/button-print/src/ButtonPrint.vue.d.ts +8 -8
  3. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  4. package/es/components/button-print/src/components/EditFormat.vue.d.ts +3 -3
  5. package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +7 -7
  6. package/es/components/button-print/style/index.css +1 -1
  7. package/es/components/callback/src/components/render/popupMaps.d.ts +17 -8
  8. package/es/components/expand-field/index.d.ts +98 -26
  9. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +95 -23
  10. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +95 -23
  11. package/es/components/expand-field/src/components/form.vue.d.ts +98 -26
  12. package/es/components/expand-field/src/index.vue.d.ts +98 -26
  13. package/es/components/fabric-chart/index.d.ts +2 -2
  14. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -2
  15. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  19. package/es/components/fabric-chart/src/interface.d.ts +2 -3
  20. package/es/components/field-set/index.d.ts +107 -616
  21. package/es/components/field-set/index.js +1 -1
  22. package/es/components/field-set/src/FieldColor.vue.d.ts +1680 -0
  23. package/es/components/field-set/src/FieldColor.vue.js +1 -0
  24. package/es/components/field-set/src/FieldColor.vue2.js +1 -0
  25. package/es/components/field-set/src/FieldSet.vue.d.ts +58 -16
  26. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  27. package/es/components/field-set/src/Index.vue.d.ts +141 -0
  28. package/es/components/field-set/src/Index.vue.js +1 -0
  29. package/es/components/field-set/src/Index.vue2.js +1 -0
  30. package/es/components/field-set/src/components/Row.vue.d.ts +50 -9
  31. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  32. package/es/components/field-set/src/components/condition.vue.d.ts +172 -0
  33. package/es/components/field-set/src/components/condition.vue.js +1 -0
  34. package/es/components/field-set/src/components/condition.vue2.js +1 -0
  35. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1194 -0
  36. package/es/components/field-set/src/components/edit-dialog.vue.js +1 -0
  37. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -0
  38. package/es/components/field-set/src/components/edit-filter.vue.d.ts +286 -0
  39. package/es/components/field-set/src/components/edit-filter.vue.js +1 -0
  40. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -0
  41. package/es/components/field-set/src/constants/index.d.ts +55 -0
  42. package/es/components/field-set/src/constants/index.js +1 -0
  43. package/es/components/field-set/src/types/index.d.ts +31 -1
  44. package/es/components/field-set/src/utils/index.d.ts +2 -1
  45. package/es/components/field-set/src/utils/index.js +1 -1
  46. package/es/components/field-set/style/index.css +1 -1
  47. package/es/components/form-config/index.d.ts +72 -42
  48. package/es/components/form-config/src/FormConfig.vue.d.ts +72 -42
  49. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  50. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +17 -8
  51. package/es/components/form-config/src/components/FormConfigDragDisplay.vue.d.ts +5 -2
  52. package/es/components/form-config/src/components/FormConfigDragDisplay.vue2.js +1 -1
  53. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +20 -11
  54. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +8 -8
  55. package/es/components/form-config/src/components/renderer/ComplexNode.vue.d.ts +5 -2
  56. package/es/components/form-config/src/components/renderer/ComplexNode.vue2.js +1 -1
  57. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  58. package/es/components/form-config/src/constants/index.d.ts +3 -2
  59. package/es/components/form-config/src/constants/index.js +1 -1
  60. package/es/components/form-config/src/hooks/useSortalbeConfig.d.ts +16 -12
  61. package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
  62. package/es/components/form-config/src/types/index.d.ts +14 -2
  63. package/es/components/form-render/index.d.ts +17 -8
  64. package/es/components/form-render/index.js +1 -1
  65. package/es/components/form-render/src/FormRender.vue.d.ts +17 -8
  66. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  67. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +17 -8
  68. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  69. package/es/components/form-render/src/hooks/index.d.ts +1 -0
  70. package/es/components/form-render/src/hooks/index.js +1 -1
  71. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
  72. package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
  73. package/es/components/form-render/src/hooks/useNewLowCodeReactions.d.ts +6 -0
  74. package/es/components/form-render/src/hooks/useNewLowCodeReactions.js +1 -0
  75. package/es/components/form-render/src/types/index.d.ts +1 -1
  76. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -1
  77. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  78. package/es/components/index.css +1 -1
  79. package/es/components/index.js +1 -1
  80. package/es/components/info-header/index.d.ts +41 -23
  81. package/es/components/info-header/src/InfoHeader.vue.d.ts +41 -23
  82. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -1
  83. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -1
  84. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +18 -9
  85. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +17 -8
  86. package/es/components/keyboard/index.d.ts +1 -1
  87. package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
  88. package/es/components/quick-search/index.d.ts +3 -3
  89. package/es/components/quick-search/src/index.vue.d.ts +3 -3
  90. package/es/components/recommend-search/index.d.ts +6 -6
  91. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +6 -6
  92. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  93. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
  94. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +1 -1
  95. package/es/components/scale-view/index.d.ts +3 -3
  96. package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -3
  97. package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
  98. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -1
  99. package/es/components/select-label/index.d.ts +2 -2
  100. package/es/components/select-label/src/LabelFormContent.vue.d.ts +1 -1
  101. package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -1
  102. package/es/components/select-label/src/index.vue.d.ts +1 -1
  103. package/es/components/select-person/index.d.ts +95 -23
  104. package/es/components/select-person/src/SelectPerson.vue.d.ts +84 -17
  105. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  106. package/es/components/select-person/src/types/enums.d.ts +9 -0
  107. package/es/components/select-person/src/types/enums.js +1 -1
  108. package/es/components/select-person/style/index.css +1 -1
  109. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  110. package/es/components/shortcut-setter/index.d.ts +17 -8
  111. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +17 -8
  112. package/es/components/table-export-field/index.d.ts +3 -3
  113. package/es/components/table-export-field/src/components/SaveProjectModal.vue.d.ts +3 -3
  114. package/es/components/table-export-field/src/index.vue.d.ts +3 -3
  115. package/es/components/time-line/index.d.ts +7 -7
  116. package/es/components/time-line/src/TimeLine.vue.d.ts +3 -3
  117. package/es/shared/package.json.js +1 -1
  118. package/es/shared/types/business.d.ts +23 -3
  119. package/es/shared/utils/business.d.ts +2 -1
  120. package/es/shared/utils/business.js +1 -1
  121. package/es/shared/utils/index.js +1 -1
  122. package/package.json +2 -2
@@ -324,7 +324,7 @@ declare const _default: import("vue").DefineComponent<{
324
324
  readonly rule: PropType<import("naive-ui").FormItemRule | import("naive-ui").FormItemRule[]>;
325
325
  readonly size: PropType<"small" | "medium" | "large">;
326
326
  readonly ignorePathChange: BooleanConstructor;
327
- readonly validationStatus: PropType<"error" | "success" | "warning">;
327
+ readonly validationStatus: PropType<"success" | "error" | "warning">;
328
328
  readonly feedback: StringConstructor;
329
329
  readonly showLabel: {
330
330
  readonly type: PropType<boolean | undefined>;
@@ -455,7 +455,7 @@ declare const _default: import("vue").DefineComponent<{
455
455
  mergedLabelAlign: import("vue").ComputedRef<import("naive-ui/es/form/src/interface").LabelAlign | undefined>;
456
456
  mergedShowRequireMark: import("vue").ComputedRef<boolean | undefined>;
457
457
  mergedRequireMarkPlacement: import("vue").ComputedRef<"left" | "right" | "right-hanging">;
458
- mergedValidationStatus: import("vue").ComputedRef<"error" | "success" | "warning" | undefined>;
458
+ mergedValidationStatus: import("vue").ComputedRef<"success" | "error" | "warning" | undefined>;
459
459
  mergedShowFeedback: import("vue").ComputedRef<boolean>;
460
460
  mergedShowLabel: import("vue").ComputedRef<boolean>;
461
461
  isAutoLabelWidth: import("vue").ComputedRef<boolean>;
@@ -489,7 +489,7 @@ declare const _default: import("vue").DefineComponent<{
489
489
  readonly rule: PropType<import("naive-ui").FormItemRule | import("naive-ui").FormItemRule[]>;
490
490
  readonly size: PropType<"small" | "medium" | "large">;
491
491
  readonly ignorePathChange: BooleanConstructor;
492
- readonly validationStatus: PropType<"error" | "success" | "warning">;
492
+ readonly validationStatus: PropType<"success" | "error" | "warning">;
493
493
  readonly feedback: StringConstructor;
494
494
  readonly showLabel: {
495
495
  readonly type: PropType<boolean | undefined>;
@@ -829,7 +829,6 @@ declare const _default: import("vue").DefineComponent<{
829
829
  type: PropType<((string | number) | {
830
830
  [key: string]: any;
831
831
  key: string | number;
832
- name: string;
833
832
  })[]>;
834
833
  default: () => never[];
835
834
  };
@@ -849,6 +848,7 @@ declare const _default: import("vue").DefineComponent<{
849
848
  };
850
849
  wordbook: {
851
850
  type: PropType<{
851
+ [key: string]: any;
852
852
  parent_id_obj: string | number;
853
853
  parent_name_obj: string | number;
854
854
  user_count_obj?: string | number | undefined;
@@ -898,6 +898,24 @@ declare const _default: import("vue").DefineComponent<{
898
898
  type: PropType<(keyWork: string) => Promise<AnyObject[]>>;
899
899
  default: () => Promise<never[]>;
900
900
  };
901
+ showSelectType: {
902
+ type: BooleanConstructor;
903
+ default: boolean;
904
+ };
905
+ roleData: {
906
+ type: PropType<(import("naive-ui/es/tree/src/interface").TreeOptionBase & {
907
+ [k: string]: unknown;
908
+ } & AnyObject)[]>;
909
+ default: () => never[];
910
+ };
911
+ roleFields: {
912
+ type: ObjectConstructor;
913
+ default: () => {
914
+ label: string;
915
+ key: string;
916
+ children: string;
917
+ };
918
+ };
901
919
  }, {
902
920
  searchFilterBase: {
903
921
  isOpen: boolean;
@@ -905,12 +923,19 @@ declare const _default: import("vue").DefineComponent<{
905
923
  customTitles: string[];
906
924
  itemHeight: number;
907
925
  };
926
+ labelList: {
927
+ key: string;
928
+ label: string;
929
+ }[];
930
+ labelListName: {
931
+ dept: string;
932
+ role: string;
933
+ };
908
934
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
909
935
  defaultList: {
910
936
  type: PropType<((string | number) | {
911
937
  [key: string]: any;
912
938
  key: string | number;
913
- name: string;
914
939
  })[]>;
915
940
  default: () => never[];
916
941
  };
@@ -930,6 +955,7 @@ declare const _default: import("vue").DefineComponent<{
930
955
  };
931
956
  wordbook: {
932
957
  type: PropType<{
958
+ [key: string]: any;
933
959
  parent_id_obj: string | number;
934
960
  parent_name_obj: string | number;
935
961
  user_count_obj?: string | number | undefined;
@@ -979,6 +1005,24 @@ declare const _default: import("vue").DefineComponent<{
979
1005
  type: PropType<(keyWork: string) => Promise<AnyObject[]>>;
980
1006
  default: () => Promise<never[]>;
981
1007
  };
1008
+ showSelectType: {
1009
+ type: BooleanConstructor;
1010
+ default: boolean;
1011
+ };
1012
+ roleData: {
1013
+ type: PropType<(import("naive-ui/es/tree/src/interface").TreeOptionBase & {
1014
+ [k: string]: unknown;
1015
+ } & AnyObject)[]>;
1016
+ default: () => never[];
1017
+ };
1018
+ roleFields: {
1019
+ type: ObjectConstructor;
1020
+ default: () => {
1021
+ label: string;
1022
+ key: string;
1023
+ children: string;
1024
+ };
1025
+ };
982
1026
  }>> & {
983
1027
  onCheck?: ((...args: any[]) => any) | undefined;
984
1028
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1002,19 +1046,18 @@ declare const _default: import("vue").DefineComponent<{
1002
1046
  tagData: import("vue").Ref<{
1003
1047
  [x: string]: any;
1004
1048
  key: string | number;
1005
- name: string;
1006
1049
  }[]>;
1007
1050
  initTagData: import("vue").Ref<{
1008
1051
  [x: string]: any;
1009
1052
  key: string | number;
1010
- name: string;
1011
1053
  }[]>;
1012
1054
  isSearch: import("vue").Ref<boolean>;
1013
- temp: import("naive-ui").TreeOption[];
1014
- allCheckedKeys: (string | number)[];
1055
+ tempData: import("naive-ui").TreeOption[];
1056
+ allCheckedTreeKeys: import("vue").Ref<(string | number)[]>;
1015
1057
  isRemote: import("vue").ComputedRef<boolean>;
1016
1058
  checkStrategyResult: import("vue").ComputedRef<any>;
1017
1059
  isSearchFilter: import("vue").ComputedRef<boolean>;
1060
+ curSelectKey: import("vue").Ref<string>;
1018
1061
  mergeSearchFilter: import("vue").ComputedRef<{
1019
1062
  isOpen: boolean;
1020
1063
  multiple: boolean;
@@ -1022,10 +1065,24 @@ declare const _default: import("vue").DefineComponent<{
1022
1065
  itemHeight: number;
1023
1066
  }>;
1024
1067
  wordbookChildExpandkeys: import("vue").ComputedRef<string[]>;
1025
- caculateTagData: import("vue").ComputedRef<any[]>;
1068
+ caculateTagData: import("vue").ComputedRef<any>;
1069
+ treeDataMiddle: any;
1070
+ checkedKeysMiddle: any;
1071
+ checkedTagsMiddle: any;
1072
+ allCheckedKeysMiddle: any;
1073
+ attrType: import("vue").ComputedRef<any>;
1074
+ keyStr: import("vue").ComputedRef<string>;
1075
+ getTreeDataMiddleData: () => void;
1076
+ getDeptData: (list: any[], cb?: any) => any[];
1077
+ getRoleData: (list: any[], cb?: any) => any[];
1078
+ onHandleLabelChange: (item: any) => void;
1079
+ setSelectTagData: (tree: import("naive-ui").TreeOption[], operatorType: string) => void;
1080
+ uniqArrObj: (arr: any[], name: string) => any;
1026
1081
  init: () => void;
1027
- getallCheckedKeysWithChild: (item: import("naive-ui").TreeOption) => void;
1028
- getallCheckedKeysWithParent: (item: import("naive-ui").TreeOption) => void;
1082
+ getMainData: (tree: import("naive-ui").TreeOption[], parentNode: import("naive-ui").TreeOption | null, cb?: any) => void;
1083
+ setAllCheckedKeys: (tree: import("naive-ui").TreeOption, cb?: any) => void;
1084
+ setAllCheckedKeysWithChild: (item: import("naive-ui").TreeOption, cb?: any) => void;
1085
+ setAllCheckedKeysWithParent: (item: import("naive-ui").TreeOption, cb?: any) => void;
1029
1086
  queryLoadChildNode: (node: import("naive-ui").TreeOption) => Promise<AnyObject>;
1030
1087
  setDisabled: (data: import("naive-ui").TreeOption) => void;
1031
1088
  renderLabel: ({ option }: {
@@ -1034,10 +1091,7 @@ declare const _default: import("vue").DefineComponent<{
1034
1091
  getLabelName: (option: import("naive-ui").TreeOption) => unknown;
1035
1092
  transformData: (trees: import("naive-ui").TreeOption[]) => import("naive-ui").TreeOption[];
1036
1093
  calculateRootItems: (trees: import("naive-ui").TreeOption[], items: import("naive-ui").TreeOption[]) => import("naive-ui").TreeOption[];
1037
- transformParentNodeName: (trees: import("naive-ui").TreeOption[], temp: any) => import("naive-ui").TreeOption[];
1038
- setAllCheckedKeys: (tree: import("naive-ui").TreeOption[]) => void;
1039
- setAllCheckedKeysWithChild: (tree: import("naive-ui").TreeOption[]) => void;
1040
- setAllCheckedKeysWithParent: (tree: import("naive-ui").TreeOption[]) => void;
1094
+ transformParentNodeName: (trees: import("naive-ui").TreeOption[], tempContent: any) => import("naive-ui").TreeOption[];
1041
1095
  searchSetting: () => string;
1042
1096
  onSearch: () => Promise<void>;
1043
1097
  setTreeCheckd: (tree: import("naive-ui").TreeOption[], checked: boolean) => void;
@@ -1047,11 +1101,9 @@ declare const _default: import("vue").DefineComponent<{
1047
1101
  uniq: (arr: {
1048
1102
  [key: string]: any;
1049
1103
  key: string | number;
1050
- name: string;
1051
1104
  }[]) => {
1052
1105
  [key: string]: any;
1053
1106
  key: string | number;
1054
- name: string;
1055
1107
  }[];
1056
1108
  setTagData: (tree: import("naive-ui").TreeOption[]) => void;
1057
1109
  updateTreeChecked: (keys: (string | number)[]) => void;
@@ -1060,15 +1112,10 @@ declare const _default: import("vue").DefineComponent<{
1060
1112
  closeTag: (tag: {
1061
1113
  [key: string]: any;
1062
1114
  key: string | number;
1063
- name: string;
1064
1115
  }) => void;
1065
1116
  notifyCheck: (keys: (string | number)[]) => void;
1066
1117
  notifySearchClear: () => void;
1067
- getCheckWithLevel: () => {
1068
- [x: string]: any;
1069
- key: string | number;
1070
- name: string;
1071
- }[];
1118
+ getCheckWithLevel: () => any;
1072
1119
  NButton: any;
1073
1120
  NInput: any;
1074
1121
  NInputGroup: import("vue").DefineComponent<{
@@ -1084,6 +1131,7 @@ declare const _default: import("vue").DefineComponent<{
1084
1131
  }>>, {}>;
1085
1132
  NCheckbox: any;
1086
1133
  NTree: any;
1134
+ NTag: any;
1087
1135
  NIcon: any;
1088
1136
  NSpace: any;
1089
1137
  NGrid: any;
@@ -1137,6 +1185,7 @@ declare const _default: import("vue").DefineComponent<{
1137
1185
  readonly suffix: boolean;
1138
1186
  readonly privateShow: boolean;
1139
1187
  }>;
1188
+ NEmpty: any;
1140
1189
  CloseCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1141
1190
  SearchMultiple: import("vue").DefineComponent<{
1142
1191
  treeData: {
@@ -1406,7 +1455,6 @@ declare const _default: import("vue").DefineComponent<{
1406
1455
  type: PropType<((string | number) | {
1407
1456
  [key: string]: any;
1408
1457
  key: string | number;
1409
- name: string;
1410
1458
  })[]>;
1411
1459
  default: () => never[];
1412
1460
  };
@@ -1426,6 +1474,7 @@ declare const _default: import("vue").DefineComponent<{
1426
1474
  };
1427
1475
  wordbook: {
1428
1476
  type: PropType<{
1477
+ [key: string]: any;
1429
1478
  parent_id_obj: string | number;
1430
1479
  parent_name_obj: string | number;
1431
1480
  user_count_obj?: string | number | undefined;
@@ -1475,6 +1524,24 @@ declare const _default: import("vue").DefineComponent<{
1475
1524
  type: PropType<(keyWork: string) => Promise<AnyObject[]>>;
1476
1525
  default: () => Promise<never[]>;
1477
1526
  };
1527
+ showSelectType: {
1528
+ type: BooleanConstructor;
1529
+ default: boolean;
1530
+ };
1531
+ roleData: {
1532
+ type: PropType<(import("naive-ui/es/tree/src/interface").TreeOptionBase & {
1533
+ [k: string]: unknown;
1534
+ } & AnyObject)[]>;
1535
+ default: () => never[];
1536
+ };
1537
+ roleFields: {
1538
+ type: ObjectConstructor;
1539
+ default: () => {
1540
+ label: string;
1541
+ key: string;
1542
+ children: string;
1543
+ };
1544
+ };
1478
1545
  }>> & {
1479
1546
  onCheck?: ((...args: any[]) => any) | undefined;
1480
1547
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1485,11 +1552,11 @@ declare const _default: import("vue").DefineComponent<{
1485
1552
  defaultList: ((string | number) | {
1486
1553
  [key: string]: any;
1487
1554
  key: string | number;
1488
- name: string;
1489
1555
  })[];
1490
1556
  searchPlaceholder: string;
1491
1557
  searchButtonText: string;
1492
1558
  wordbook: {
1559
+ [key: string]: any;
1493
1560
  parent_id_obj: string | number;
1494
1561
  parent_name_obj: string | number;
1495
1562
  user_count_obj?: string | number | undefined;
@@ -1510,6 +1577,11 @@ declare const _default: import("vue").DefineComponent<{
1510
1577
  } & AnyObject;
1511
1578
  queryLoadChildData: (node: import("naive-ui").TreeOption) => Promise<AnyObject>;
1512
1579
  queryTreeSearch: (keyWork: string) => Promise<AnyObject[]>;
1580
+ showSelectType: boolean;
1581
+ roleData: (import("naive-ui/es/tree/src/interface").TreeOptionBase & {
1582
+ [k: string]: unknown;
1583
+ } & AnyObject)[];
1584
+ roleFields: Record<string, any>;
1513
1585
  }>>;
1514
1586
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("check" | "changeModalVisible")[], "check" | "changeModalVisible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1515
1587
  visible: {
@@ -32,7 +32,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
32
32
  "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
33
33
  "onClick:grid"?: ((...args: any[]) => any) | undefined;
34
34
  }>>;
35
- emits: (event: "select" | "add" | "change" | "remove" | "add:prevent" | "click:grid", ...args: any[]) => void;
35
+ emits: (event: "add" | "change" | "remove" | "select" | "add:prevent" | "click:grid", ...args: any[]) => void;
36
36
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
37
37
  canvas: import("vue").Ref<any>;
38
38
  pointTipProps: {
@@ -165,7 +165,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
165
165
  show: boolean;
166
166
  list: unknown[];
167
167
  }>;
168
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "add" | "change" | "remove" | "add:prevent" | "click:grid")[], "remove" | "select" | "add" | "change" | "add:prevent" | "click:grid", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
168
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("add" | "change" | "remove" | "select" | "add:prevent" | "click:grid")[], "remove" | "add" | "change" | "select" | "add:prevent" | "click:grid", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
169
169
  type: {
170
170
  type: import("vue").PropType<import("./src/interface").IType>;
171
171
  default: string;
@@ -34,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
34
34
  "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
35
35
  "onClick:grid"?: ((...args: any[]) => any) | undefined;
36
36
  }>>;
37
- emits: (event: "select" | "add" | "change" | "remove" | "add:prevent" | "click:grid", ...args: any[]) => void;
37
+ emits: (event: "add" | "change" | "remove" | "select" | "add:prevent" | "click:grid", ...args: any[]) => void;
38
38
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
39
39
  canvas: import("vue").Ref<any>;
40
40
  pointTipProps: {
@@ -167,7 +167,7 @@ declare const _default: import("vue").DefineComponent<{
167
167
  show: boolean;
168
168
  list: unknown[];
169
169
  }>;
170
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "add" | "change" | "remove" | "add:prevent" | "click:grid")[], "remove" | "select" | "add" | "change" | "add:prevent" | "click:grid", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
170
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("add" | "change" | "remove" | "select" | "add:prevent" | "click:grid")[], "remove" | "add" | "change" | "select" | "add:prevent" | "click:grid", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
171
171
  type: {
172
172
  type: PropType<IType>;
173
173
  default: string;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as l,withDirectives as a,createVNode as o,vShow as r}from"vue";import{NSpace as n,NInputNumber as u}from"naive-ui";import s from"./useStyle.js";import{useEventListener as i,onClickOutside as p}from"@vueuse/core";var c=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:c,slots:f,emit:m}){const v=t(null);i(v,"contextmenu",(e=>(e.preventDefault(),!1))),p(v,(e=>{m("update:show",!1)}));const{left:d}=e.propItems,h=s(e);function y(e){if("string"==typeof e&&(e.startsWith("新增")||e.startsWith("删除")))return!0}function g(t){var l;if("string"==typeof t)return t;if("boolean"==typeof t.value)return t.label;if(t.renderItem)return t.renderItem();const a=+((null==(l=d.yScaleValue.find((t=>t.type===e.target.origin.type)))?void 0:l.list[0])||0);return o(n,{inline:!0,align:"center"},{default:()=>[o("span",null,[t.label]),o(u,{style:"width: 110px",size:"small",value:t.value,"onUpdate:value":e=>t.value=e,clearable:!0,placeholder:"请输入数值",max:e.target.origin.data.value,min:a,showButton:!1,onFocus:()=>m("update:show",!0)},null)]})}return l((()=>e.show),(t=>{t&&e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)}))})),()=>a(o("ul",{ref:v,class:"c-fabric-chart-popup-menu",style:h.value},[e.list.map((t=>e.show?o("li",{class:{"no-click":y(t)},onClick:l=>function(t,l){y(l)||""===(null==t?void 0:t.target.className)&&(m("update:show",!1),m("clickMenu",{item:l,target:e.target}))}(l,t)},[g(t)]):null))]),[[r,e.show]])}});export{c as default};
1
+ import{defineComponent as e,ref as t,watch as l,withDirectives as o,createVNode as a,vShow as s}from"vue";import{NSpace as r,NInputNumber as u}from"naive-ui";import n from"./useStyle.js";import{useEventListener as p,onClickOutside as i}from"@vueuse/core";var c=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:c,slots:f,emit:m}){const h=t(null);p(h,"contextmenu",(e=>(e.preventDefault(),!1))),i(h,(e=>{m("update:show",!1)})),e.propItems;const v=n(e);function d(e){if("string"==typeof e&&(e.startsWith("新增")||e.startsWith("删除")))return!0}function y(e){return"string"==typeof e?e:"boolean"==typeof e.value?e.label:e.renderItem?e.renderItem():a(r,{inline:!0,align:"center"},{default:()=>[a("span",null,[e.label]),a(u,{style:"width: 110px",size:"small",value:e.value,"onUpdate:value":t=>e.value=t,clearable:!0,placeholder:"请输入数值",showButton:!1,onFocus:()=>m("update:show",!0)},null)]})}return l((()=>e.show),(t=>{t&&e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)}))})),()=>o(a("ul",{ref:h,class:"c-fabric-chart-popup-menu",style:v.value},[e.list.map((t=>e.show?a("li",{class:{"no-click":d(t)},onClick:l=>function(t,l){d(l)||""===(null==t?void 0:t.target.className)&&(m("update:show",!1),m("clickMenu",{item:l,target:e.target}))}(l,t)},[y(t)]):null))]),[[s,e.show]])}});export{c as default};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{drawLine as i}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as a}from"../../constants/index.js";import"naive-ui";function l(l,d,u){const{computedX:c,computedY:m}=s(d),{borderStyle:f,originX:h,originY:g,xCellWidth:L,yCellHeight:p,canvasWidth:E,canvasHeight:M,dataList:v,columnNumber:N,gridYNumber:C,gridXNumber:x,rowNumber:S,lineStyle:b,titleStyle:w}=d,j=new Set,R=new Set;function y(t=0){v.forEach(((r,o)=>{if(o===v.length-1&&arguments.length)return;const{x:i,y:n,offsetY:s,rowIdx:l}=r.origin,f=~~(r.data.length/N),h=r.data.reduce(((e,r,i)=>{const n=o<a.MAXLINENUMBER-1&&i>=t&&i<=t+f||o===a.MAXLINENUMBER-1?[{x:c(e.length+1),y:m(-+r)+s}]:[];return e.concat(n)}),[]),g=new e.Polyline(h,{...b,fill:"transparent",strokeWidth:1,left:i,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(A(g,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>u.value&&Promise.reject()}),g.startIdx=t,o<v.length-1?j.add(g):R.add(g),arguments.length)return;const p=new e.Text(String(r.title),{...w,left:i+L,top:n,originX:"left",originY:"top"});R.add(p)}));const r=arguments.length?[...j]:[...j,...R];l.value.add(...r)}function A(e,t){o(e,t)}n(l,{...d,gridXNumber:x*a.SMALLCELLNUMBER,gridYNumber:C*a.SMALLCELLNUMBER,xCellWidth:L/a.SMALLCELLNUMBER,yCellHeight:p/a.SMALLCELLNUMBER,grid:{...d.grid,subXCell:a.SMALLCELLNUMBER,subYCell:a.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=f,r=new e.Rect({...f,width:E-t,height:M-t,left:h,top:g,fill:"transparent"});l.value.add(r)}(),function(){const e=E/N,t=[];r(N).forEach((r=>{if(r+1>=N)return;const o=(r+1)*e,n=i([o,0,o,M],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),y();return{updatePolyline:t((t=>{if(1===N)return;const r=v[v.length-1].data.length,o=~~(r/N),i=t/100*r-o/2,n=i+o>r?r-o:Math.max(0,i);e.util.requestAnimFrame((()=>{if(j.size){const[e]=[...j];if(e.startIdx===n)return;[...j].forEach((e=>l.value.remove(e))),j.clear()}y(n)}))}),150)}}export{l as useElectrocardiogram};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{drawLine as i}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as a}from"../../constants/index.js";import"naive-ui";function l(l,d,u){const{computedX:m,computedY:c}=s(d),{borderStyle:h,originX:f,originY:g,xCellWidth:L,yCellHeight:p,canvasWidth:E,canvasHeight:M,dataList:v,columnNumber:N,gridYNumber:C,gridXNumber:b,rowNumber:x,lineStyle:S,titleStyle:w}=d,j=new Set,R=new Set;function y(t=0){v.forEach(((r,o)=>{if(o===v.length-1&&arguments.length)return;const{x:i,y:n,rowIdx:s}=r.origin,l=~~(r.data.length/N),h=r.data.reduce(((e,r,i)=>{const s=o<a.MAXLINENUMBER-1&&i>=t&&i<=t+l||o===a.MAXLINENUMBER-1?[{x:m(e.length+1),y:c(-+r)+n}]:[];return e.concat(s)}),[]),f=new e.Polyline(h,{...S,fill:"transparent",strokeWidth:1,left:i,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(A(f,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>u.value&&Promise.reject()}),f.startIdx=t,o<v.length-1?j.add(f):R.add(f),arguments.length)return;const g=new e.Text(String(r.title),{...w,left:i+L,top:n,originX:"left",originY:"bottom"});R.add(g)}));const r=arguments.length?[...j]:[...j,...R];l.value.add(...r)}function A(e,t){o(e,t)}n(l,{...d,gridXNumber:b*a.SMALLCELLNUMBER,gridYNumber:C*a.SMALLCELLNUMBER,xCellWidth:L/a.SMALLCELLNUMBER,yCellHeight:p/a.SMALLCELLNUMBER,grid:{...d.grid,subXCell:a.SMALLCELLNUMBER,subYCell:a.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=h,r=new e.Rect({...h,width:E-t,height:M-t,left:f,top:g,fill:"transparent"});l.value.add(r)}(),function(){const e=E/N,t=[];r(N).forEach((r=>{if(r+1>=N)return;const o=(r+1)*e,n=i([o,0,o,M],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),y();return{updatePolyline:t((t=>{if(1===N)return;const r=v[v.length-1].data.length,o=~~(r/N),i=t/100*r-o/2,n=i+o>r?r-o:Math.max(0,i);e.util.requestAnimFrame((()=>{if(j.size){const[e]=[...j];if(e.startIdx===n)return;[...j].forEach((e=>l.value.remove(e))),j.clear()}y(n)}))}),150)}}export{l as useElectrocardiogram};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,watch as l}from"vue";import{defaultBorderStyle as u,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as o}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as s}from"./useElectrocardiogram.js";import{useMeasureInstrument as d}from"./useMeasureInstrument.js";function m(m,v,c,g,h,p){const f=e(),N=e(),b=e(),y=e(),M=t((()=>v.data.width)),L=t((()=>v.data.height)),S=t((()=>(M.value-0)/C.value)),w=t((()=>(L.value-0)/x.value)),C=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data.length/t.hz;return Math.ceil(a/t.mainXCellValue)})),x=t((()=>{const{config:e}=v.data;return Math.ceil(26*j.value/e.mainYCellValue)})),j=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data,r=Math.max(...a)-Math.min(...a);return"uv"===t.valueUnit?.001*r:"v"===t.valueUnit?1e3*r:r})),E=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=t((()=>{const{mode:e="2-6"}=v.data,[t,a]=e.split("-").map((e=>+e));return{columnNumber:t,rowNumber:a}})),I=t((()=>{const{dataList:e,width:t,config:a}=v.data,{columnNumber:r,rowNumber:l}=R.value,u=t/r,i=e.length;return e.map(((e,t)=>{const a=o.MAXLINENUMBER===i&&t===i-1?l:t%l;return{...e,origin:{x:(o.MAXLINENUMBER===i&&t===i-1?0:Math.floor(t/l))*u,y:a*(2*w.value)+w.value,offsetY:(a+1)*(2*w.value),rowIdx:a}}}))})),X=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle},lineStyle:{...i,...v.data.lineStyle},titleStyle:{...n,...v.data.titleStyle},measureLineStyle:{...i,...v.data.measureLineStyle},measureTextStyle:{...n,...v.data.measureTextStyle},grid:v.data.grid,originX:0,endX:M.value,originY:0,endY:L.value,xCellWidth:S.value,yCellHeight:w.value,gridXNumber:C.value,gridYNumber:x.value,event:E.value,dataList:I.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:v.data.config});return l((()=>m.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:t,useCaliper:a,useCaliperRuler:r}=d(m,X),{updatePolyline:l}=s(m,X,t);N.value=e,b.value=a,y.value=r,f.value=l}()}),{immediate:!0}),{propItems:X,updatePolyline:f,useMeasureRuler:N,useCaliper:b,useCaliperRuler:y,getGridInfo:function(){return{cellWidth:S.value,cellHeight:w.value,smallCellNumber:o.SMALLCELLNUMBER}}}}export{m as useElectrocardiogramChart};
1
+ import{ref as e,computed as a,reactive as t,unref as r,watch as l}from"vue";import{defaultBorderStyle as u,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as o}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as s}from"./useElectrocardiogram.js";import{useMeasureInstrument as d}from"./useMeasureInstrument.js";function m(m,v,c,h,g,p){const f=e(),b=e(),M=e(),N=e(),y=a((()=>v.data.width)),S=a((()=>v.data.height)),L=a((()=>(y.value-0)/x.value)),w=a((()=>(S.value-0)/C.value)),x=a((()=>{const{dataList:e,config:a}=v.data,t=e[e.length-1].data.length/a.hz;return Math.ceil(t/a.mainXCellValue)})),C=a((()=>{const{config:e,grid:a}=v.data;return Math.ceil(13*j.value*2/e.mainYCellValue)})),j=a((()=>{const{dataList:e,config:a}=v.data,t=e[e.length-1].data,r=Math.max(...t),l=Math.min(...t),u=Math.max(Math.abs(r),Math.abs(l));return"uv"===a.valueUnit?.001*u:"v"===a.valueUnit?1e3*u:u})),E=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=a((()=>{const{mode:e="2-6"}=v.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),I=a((()=>{const{columnNumber:e}=R.value;return 2===e?4:4===e?8:2})),X=a((()=>{var e;const{dataList:a,width:t,config:r,grid:l}=v.data,{columnNumber:u,rowNumber:i}=R.value,n=t/u,s=null!=(e=l.rowSpace)?e:I.value,d=a.length;return a.map(((e,a)=>{const t=o.MAXLINENUMBER===d&&a===d-1?i:a%i;return{...e,origin:{x:(o.MAXLINENUMBER===d&&a===d-1?0:Math.floor(a/i))*n,y:t*(w.value*s)+2*w.value,rowIdx:t}}}))})),U=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle},lineStyle:{...i,...v.data.lineStyle},titleStyle:{...n,...v.data.titleStyle},measureLineStyle:{...i,...v.data.measureLineStyle},measureTextStyle:{...n,...v.data.measureTextStyle},grid:v.data.grid,originX:0,endX:y.value,originY:0,endY:S.value,xCellWidth:L.value,yCellHeight:w.value,gridXNumber:x.value,gridYNumber:C.value,event:E.value,dataList:X.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:v.data.config});return l((()=>m.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:r}=d(m,U),{updatePolyline:l}=s(m,U,a);b.value=e,M.value=t,N.value=r,f.value=l}()}),{immediate:!0}),{propItems:U,updatePolyline:f,useMeasureRuler:b,useCaliper:M,useCaliperRuler:N,getGridInfo:function(){return{cellWidth:L.value,cellHeight:w.value,smallCellNumber:o.SMALLCELLNUMBER}}}}export{m as useElectrocardiogramChart};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m,flatten as x}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as b,PAIN_MENU as j,OVERLAP as w}from"../../constants/index.js";function L(L,S,Y,E,M,$,O,P,A,C){r(L,S);const{getEqualXTypes:I,handleAddPrevent:T}=y(L,Y,S),{createShadowLines:R}=t(),{left:X,xScaleList:V,xCellWidth:z,yCellHeight:D,originX:F,endX:H,originY:_,endY:W,itemList:q,event:G,vitalSignsOriginY:B,painOriginY:J,hospitalizationDate:K,config:N,canvasHeight:Q}=S,U=new Set,Z=["xinmai","mai"],ee=new Map,te=new Set,ie=new Set,ne=new Set,oe=m(X.yScaleValue);function le(t){var o;const l=oe.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(U.size&&L.value.remove(...U),U.clear(),ee.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ee.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ee)t.push(e[1]),e[0]===Z[0]&&e[1].forEach((e=>{(ee.get(Z[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],c=n[i-1],p=n[i+1],d=o[r-1],f=o[r+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&s.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),g()}}else p?(l.push(p),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...R(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),U.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...x(t)],{...r,originX:"center"});e.push(n),U.add(n)}))}L.value.add(...e)}U.add(l),L.value.add(l)}))}}function se(){var e;const t=oe.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,X.overlap||{}),l=[];te.size&&[...te].forEach((e=>{[...ie].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},belowMinValueStyle:j={},dataList:w=[],list:E=[]}=r,{type:$,textStyle:P,showConnectLine:C=!1}=b,I=[],T=[],R=[];null==(u=e.list)||u.forEach(((u,b)=>{const X=a(c)?w.find((e=>e.key===u.key)):e,V=ce(u,r),z={};z.value=function(e,t,i){if(!(null==e?void 0:e.length)||!N.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=B.originY+D?e[1]+D:e[1]-D,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return R.push(s),{obj:s,top:-D}}(V,u,X),function(e,t,r,a){var u,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let x,b,j,w,L;if(t.noRise&&h.show){const t=k(h)?M(c,E,35):e[1];if(h.text)j=l([e[0],k(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*D;j=s([e[0],t,i],{...h.style})}R.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?D:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),R.push(w));t.verified&&(L=l([e[0],e[1]-(m?D:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),R.push(L));if(p(t.physicsReduce)||p(t.drugReduce)){const l=M(c,E,null!=(u=t.physicsReduce)?u:t.drugReduce);x=i([...e,e[0],l],{...y,...g.line,...n}),b=o((null==(d=null==g?void 0:g.point)?void 0:d.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===Q?"bottom":"center"}),x&&R.push(x),b&&R.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:h.text?5:2*D,isFixed:k(h)},riseText:{obj:w,top:(m?-D:0)-5},verifiedText:{obj:L,top:(m?-D:0)-5},reducePoint:{obj:b,type:"reduce"}})}(V,u,X,z),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...E),r=Math.min(...E);let a,u,p;const{upArrowShow:d=!1,limitValueShow:f=!1}=i;if(d&&+t.value>180){let t=e[1]-2.5*D,i=[e[1]-D/2,t];t<B.originY&&(t=e[1]+2.5*D,i=[t,e[1]+D/2]),a=s([e[0],i[0],i[1]],m,"up"),R.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>o){const t=a?e[1]+D/2+a.height:e[1]+D;u=l([e[0],t],i),R.push(u)}+t.value<r&&(u=l([e[0],e[1]-D],i),R.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)p=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*D;p=s([e[0],t,i],{...j.style})}R.push(p)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-D},belowMinValue:{obj:p,top:j.text?5:2*D,moveHide:!0}})}(V,u,X,z),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,b=e.list[s+1],j=ce(b,r),w=ae(c,e.list[s].value),k=j&&ae(c,b.value);n&&j&&!l.breakpoint&&(!w&&!k||C)&&n[0]!==j[0]&&(f=i([...n,...j],{...v}));const E=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===$?0:x,M=T[s-1],R={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:d(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...S.event.hovered?S.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:S.event,...w?{selectable:!1,evented:!1,..."number"===$?P:{}}:{}};if(M){const e=M.get("y2");p=o(E,{left:M.get("x2"),top:w?e-5:e,...R})}else n&&(R.leftLine=null,p=o(E,{left:n[0],top:w?n[1]-5:n[1],...R}));T.push(f),p&&(g.includes("脉搏")?te.add(p):ie.add(p),function(e){G.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?J:B;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(L.value.remove(i),delete e.otherObj.obj)))})),le(e)}(e),G.hovered&&ue(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=O(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};L.value.discardActiveObject(),Y("change",n),de(n,"change")}}))}(p),I.push(p),ne.add(p))}(V,u,b,X,z)})),"pulse"===c&&Z.forEach((e=>{ee.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=T.filter((e=>e));Promise.all(R).then((i=>{L.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function ae(e,t){return"pain"===e&&0==t}function ue(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top},A.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:O(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],A.show=!0}function ce(e,t){const i="pain"===t.type?J:B;if(f(e)&&function(e){const[t]=V,i=V.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=E(e.time),o=M(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function pe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return K&&l<h(K)?(T("exceedMin"),!1):!(l>o)||(T("exceedMax"),!1)}function de(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=oe.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;fe()}function fe(){var e;ne.size&&(null==(e=L.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ne]))),ee.clear(),ne.clear(),te.clear(),ie.clear(),oe.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se()}return ee.clear(),te.clear(),ie.clear(),oe.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=M(e.type,e.list,e.positionLine.value),n=i([F,t,H,t],e.positionLine);L.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se(),L.value.on("mouse:up",(e=>{var t;if(3===e.button){if(!S.event.evented)return;const{x:i=0,y:n=0}=e.pointer||{};if(i>=F&&i<=H&&n>=_&&n<=W){C.point={x:i,y:n},C.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(C.list=[...b]),"pain"===o&&(C.list=[...j]),C.target=e.target;else{C.target=null,C.list=["新增节点"],q.forEach((t=>{if(!I([...ne],i,"_type").includes(t.bigType)){const i=["pain"].includes(t.bigType)?J:B;n>=i.originY&&n<=i.endY&&C.list.push({renderItem:P?P(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=pe(i);t&&1!==C.list.length||(C.show=!1,1===C.list.length&&t&&T("repeat"))}}}if(1===e.button){const{x:t=0,y:i=0}=e.pointer||{};t>=F&&t<=H&&i>0&&i<Q&&Y("click:grid",{x:t,y:i,time:$(t)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...b,...j]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),de(r,"change")}else{const t={data:{time:$(e.pointer.x),value:O(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),de(t)}},setPopup:ue,isAddPoint:pe,updateData:de,redrawPoints:fe,gridPoints:ne}}function k(e){return"fixed"===e.position}export{L as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m,flatten as b}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as x,PAIN_MENU as j,OVERLAP as w}from"../../constants/index.js";function L(L,S,Y,E,M,$,O,C,P,A){r(L,S);const{getEqualXTypes:I,handleAddPrevent:R}=y(L,Y,S),{createShadowLines:T}=t(),{left:V,xScaleList:X,xCellWidth:z,yCellHeight:D,originX:F,endX:H,originY:_,endY:W,itemList:q,event:G,vitalSignsOriginY:B,painOriginY:J,hospitalizationDate:K,config:N,canvasHeight:Q}=S,U=new Set,Z=["xinmai","mai"],ee=new Map,te=new Set,ie=new Set,ne=new Set,oe=m(V.yScaleValue);function le(t){var o;const l=oe.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(U.size&&L.value.remove(...U),U.clear(),ee.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ee.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ee)t.push(e[1]),e[0]===Z[0]&&e[1].forEach((e=>{(ee.get(Z[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],c=n[i-1],p=n[i+1],d=o[r-1],f=o[r+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&s.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),g()}}else p?(l.push(p),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...T(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),U.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...r,originX:"center"});e.push(n),U.add(n)}))}L.value.add(...e)}U.add(l),L.value.add(l)}))}}function se(){var e;const t=oe.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,V.overlap||{}),l=[];te.size&&[...te].forEach((e=>{[...ie].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:b={},nonePainPointStyle:x={},belowMinValueStyle:j={},dataList:w=[],list:E=[]}=r,{type:$,textStyle:C,showConnectLine:A=!1}=x,I=[],R=[],T=[];null==(u=e.list)||u.forEach(((u,x)=>{const V=a(c)?w.find((e=>e.key===u.key)):e,X=ce(u,r),F={};F.value=function(e,t,i){if(!(null==e?void 0:e.length)||!N.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=B.originY+D?e[1]+D:e[1]-D,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return T.push(s),{obj:s,top:-D}}(X,u,V),function(e,t,r,a){var u,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let b,x,j,w,L;if(t.noRise&&h.show){const t=k(h)?M(c,E,35):e[1];if(h.text)j=l([e[0],k(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*D;j=s([e[0],t,i],{...h.style})}T.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?D:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),T.push(w));t.verified&&(L=l([e[0],e[1]-(m?D:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),T.push(L));if(p(t.physicsReduce)||p(t.drugReduce)){const l=M(c,E,null!=(u=t.physicsReduce)?u:t.drugReduce),s=l<e[1]&&(null==N?void 0:N.hypothermyViewCustom)?e[0]+z/2:e[0];b=i([...e,s,l],{...y,...g.line,...n}),x=o((null==(d=null==g?void 0:g.point)?void 0:d.type)||"circle",{left:s,top:l,...g.point,...n,originY:l===Q?"bottom":"center"}),b&&T.push(b),x&&T.push(x)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:h.text?5:2*D,isFixed:k(h)},riseText:{obj:w,top:(m?-D:0)-5},verifiedText:{obj:L,top:(m?-D:0)-5},reducePoint:{obj:x,type:"reduce"}})}(X,u,V,F),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...E),r=Math.min(...E);let a,u,p;const{upArrowShow:d=!1,limitValueShow:f=!1}=i;if(d&&+t.value>180){let t=e[1]-2.5*D,i=[e[1]-D/2,t];t<B.originY&&(t=e[1]+2.5*D,i=[t,e[1]+D/2]),a=s([e[0],i[0],i[1]],m,"up"),T.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=a?e[1]+D/2+a.height:e[1]+D;u=l([e[0],t],i),T.push(u)}+t.value<r&&(u=l([e[0],e[1]-D],i),T.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)p=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*D;p=s([e[0],t,i],{...j.style})}T.push(p)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-D},belowMinValue:{obj:p,top:j.text?5:2*D,moveHide:!0}})}(X,u,V,F),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:b="circle"}=a,x=e.list[s+1],j=ce(x,r),w=ae(c,e.list[s].value),k=j&&ae(c,x.value);if(n&&j&&!l.breakpoint&&(!w&&!k||A)&&n[0]!==j[0]){f=i([...n,...j],{...v});const{obj:e}=(null==u?void 0:u.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==N?void 0:N.hypothermyViewCustom)){const t=i([e.left,e.top,...j],{...v});T.unshift(t),Object.assign(u,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const E=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===$?0:b,M=R[s-1],V={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:d(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...S.event.hovered?S.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:S.event,...w?{selectable:!1,evented:!1,..."number"===$?C:{}}:{}};if(M){const e=M.get("y2");p=o(E,{left:M.get("x2"),top:w?e-5:e,...V})}else n&&(V.leftLine=null,p=o(E,{left:n[0],top:w?n[1]-5:n[1],...V}));R.push(f),p&&(g.includes("脉搏")?te.add(p):ie.add(p),function(e){G.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?J:B;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(L.value.remove(i),delete e.otherObj.obj)))})),le(e)}(e),G.hovered&&ue(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=O(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};L.value.discardActiveObject(),Y("change",n),de(n,"change")}}))}(p),I.push(p),ne.add(p))}(X,u,x,V,F)})),"pulse"===c&&Z.forEach((e=>{ee.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=R.filter((e=>e));Promise.all(T).then((i=>{L.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function ae(e,t){return"pain"===e&&0==t}function ue(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:O(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],P.show=!0}function ce(e,t){const i="pain"===t.type?J:B;if(!f(e)||!function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time))return;const n=E(e.time),o=M(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function pe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return K&&l<h(K)?(R("exceedMin"),!1):!(l>o)||(R("exceedMax"),!1)}function de(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=oe.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;fe()}function fe(){var e;ne.size&&(null==(e=L.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ne]))),ee.clear(),ne.clear(),te.clear(),ie.clear(),oe.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se()}return ee.clear(),te.clear(),ie.clear(),oe.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=M(e.type,e.list,e.positionLine.value),n=i([F,t,H,t],e.positionLine);L.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se(),L.value.on("mouse:up",(e=>{var t;if(3===e.button){if(!S.event.evented)return;const{x:i=0,y:n=0}=e.pointer||{};if(i>=F&&i<=H&&n>=_&&n<=W){A.point={x:i,y:n},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...j]),A.target=e.target;else{A.target=null,A.list=["新增节点"],q.forEach((t=>{if(!I([...ne],i,"_type").includes(t.bigType)){const i=["pain"].includes(t.bigType)?J:B;n>=i.originY&&n<=i.endY&&A.list.push({renderItem:C?C(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=pe(i);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&R("repeat"))}}}if(1===e.button){const{x:t=0,y:i=0}=e.pointer||{};t>=F&&t<=H&&i>0&&i<Q&&Y("click:grid",{x:t,y:i,time:$(t)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...j]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),de(r,"change")}else{const t={data:{time:$(e.pointer.x),value:O(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),de(t)}},setPopup:ue,isAddPoint:pe,updateData:de,redrawPoints:fe,gridPoints:ne}}function k(e){return"fixed"===e.position}export{L as useCenter};
@@ -168,11 +168,10 @@ export declare type IPointTipProps = {
168
168
  point: ICoordinateValue;
169
169
  list: Array<string>;
170
170
  };
171
- export declare type IPointMenuProps = {
172
- show: boolean;
173
- point: ICoordinateValue;
171
+ export declare type IPointMenuProps = Pick<IPointTipProps, 'show' | 'point'> & {
174
172
  list: Array<any>;
175
173
  target: any;
176
174
  };
177
175
  export declare type IFabricChartMainParam = [Ref<fabric.Canvas>, any, any, Ref<any>, IPointTipProps, IPointMenuProps];
176
+ export declare type IPonter = [number, number];
178
177
  export {};