cnhis-design-vue 3.1.57 → 3.2.1-alpha.1

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 (145) hide show
  1. package/es/components/button-print/index.d.ts +1 -0
  2. package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -0
  3. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  4. package/es/components/button-print/src/utils/print.d.ts +15 -3
  5. package/es/components/button-print/src/utils/print.js +1 -1
  6. package/es/components/calendar/index.d.ts +24 -13
  7. package/es/components/calendar/src/Calendar.vue.d.ts +24 -13
  8. package/es/components/calendar/src/Calendar.vue2.js +1 -1
  9. package/es/components/callback/src/components/render/popupMaps.d.ts +292 -2
  10. package/es/components/drag-scroll/index.d.ts +2 -0
  11. package/es/components/drag-scroll/index.js +1 -0
  12. package/es/components/drag-scroll/src/index.d.ts +4 -0
  13. package/es/components/drag-scroll/src/index.js +1 -0
  14. package/es/components/drag-scroll/src/types.d.ts +24 -0
  15. package/es/components/drag-scroll/src/types.js +1 -0
  16. package/es/components/fabric-chart/src/constants/index.d.ts +2 -1
  17. package/es/components/fabric-chart/src/constants/index.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  25. package/es/components/fabric-chart/src/interface.d.ts +1 -1
  26. package/es/components/fabric-chart/src/utils/index.js +1 -1
  27. package/es/components/field-set/index.d.ts +1 -1
  28. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -0
  29. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -0
  30. package/es/components/field-set/src/Index.vue.d.ts +1 -1
  31. package/es/components/field-set/src/Index.vue2.js +1 -1
  32. package/es/components/field-set/src/TableStyle.vue.d.ts +71 -0
  33. package/es/components/field-set/src/TableStyle.vue.js +1 -0
  34. package/es/components/field-set/src/TableStyle.vue2.js +1 -0
  35. package/es/components/field-set/src/components/Row.vue.d.ts +1 -0
  36. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  37. package/es/components/field-set/src/types/index.d.ts +1 -1
  38. package/es/components/field-set/style/index.css +1 -1
  39. package/es/components/form-config/index.d.ts +45 -4
  40. package/es/components/form-config/src/FormConfig.vue.d.ts +45 -4
  41. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +16 -2
  42. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +22 -2
  43. package/es/components/form-render/index.d.ts +16 -2
  44. package/es/components/form-render/index.js +1 -1
  45. package/es/components/form-render/src/FormRender.vue.d.ts +15 -1
  46. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  47. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +16 -2
  48. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  49. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  50. package/es/components/form-render/src/components/renderer/index.js +1 -1
  51. package/es/components/form-render/src/components/renderer/select.d.ts +2 -0
  52. package/es/components/form-render/src/components/renderer/select.js +1 -1
  53. package/es/components/form-render/src/components/renderer/simpleComponent.js +1 -1
  54. package/es/components/form-render/src/components/renderer/time.d.ts +7 -0
  55. package/es/components/form-render/src/components/renderer/time.js +1 -0
  56. package/es/components/form-render/src/hooks/index.d.ts +1 -0
  57. package/es/components/form-render/src/hooks/index.js +1 -1
  58. package/es/components/form-render/src/hooks/useAutoHidden.d.ts +1 -1
  59. package/es/components/form-render/src/hooks/useAutoHidden.js +1 -1
  60. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  61. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +6 -4
  62. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  63. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  64. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  65. package/es/components/form-render/src/hooks/useSelectedSetting.d.ts +5 -0
  66. package/es/components/form-render/src/hooks/useSelectedSetting.js +1 -0
  67. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  68. package/es/components/form-render/src/types/index.d.ts +2 -0
  69. package/es/components/form-render/src/utils/business.d.ts +1 -1
  70. package/es/components/form-render/src/utils/business.js +1 -1
  71. package/es/components/form-render/src/utils/index.d.ts +1 -0
  72. package/es/components/form-render/src/utils/index.js +1 -1
  73. package/es/components/iho-table/index.d.ts +276 -0
  74. package/es/components/iho-table/src/IhoTable.vue.d.ts +276 -0
  75. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  76. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -5
  77. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  78. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +2 -1
  79. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  80. package/es/components/iho-table/src/plugins/dragScrollPlugin.js +1 -1
  81. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -1
  82. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  83. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  84. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  85. package/es/components/iho-table/src/plugins/index.js +1 -1
  86. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
  87. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
  88. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +1 -1
  89. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +1 -1
  90. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  91. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  92. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  93. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  94. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +15 -12
  95. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  96. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
  97. package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -1
  98. package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.d.ts +1 -0
  99. package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.js +1 -0
  100. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.d.ts +1 -0
  101. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -0
  102. package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.d.ts +6 -0
  103. package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.js +1 -0
  104. package/es/components/iho-table/src/plugins/verticalTablePlugin/types.d.ts +12 -0
  105. package/es/components/iho-table/src/plugins/verticalTablePlugin/types.js +1 -0
  106. package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.d.ts +28 -0
  107. package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.js +1 -0
  108. package/es/components/iho-table/src/types/index.d.ts +10 -1
  109. package/es/components/iho-table/src/types/pluginType.d.ts +3 -1
  110. package/es/components/iho-table/src/utils/index.d.ts +5 -7
  111. package/es/components/iho-table/src/utils/index.js +1 -1
  112. package/es/components/index.css +1 -1
  113. package/es/components/index.d.ts +2 -2
  114. package/es/components/index.js +1 -1
  115. package/es/components/info-header/index.d.ts +37 -4
  116. package/es/components/info-header/src/InfoHeader.vue.d.ts +37 -4
  117. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
  118. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
  119. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +17 -2
  120. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +16 -2
  121. package/es/components/search-cascader/index.d.ts +1 -1
  122. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +1 -1
  123. package/es/components/search-cascader/src/components/SearchMenu.d.ts +1 -1
  124. package/es/components/shortcut-setter/index.d.ts +17 -2
  125. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +17 -2
  126. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  127. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  128. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  129. package/es/components/table-export-field/style/index.css +1 -1
  130. package/es/components/table-export-field/style/table-export-field-iconfont.ttf +0 -0
  131. package/es/shared/assets/img/table_style_1.png.js +1 -0
  132. package/es/shared/assets/img/table_style_2.png.js +1 -0
  133. package/es/shared/assets/img/table_style_3.png.js +1 -0
  134. package/es/shared/assets/img/table_style_4.png.js +1 -0
  135. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  136. package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +3 -1
  137. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
  138. package/es/shared/hooks/selectHooks/useSearchContent.d.ts +1 -1
  139. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
  140. package/es/shared/package.json.js +1 -1
  141. package/es/shared/types/business.d.ts +15 -6
  142. package/es/shared/utils/business.d.ts +1 -1
  143. package/es/shared/utils/index.d.ts +2 -1
  144. package/es/shared/utils/index.js +1 -1
  145. package/package.json +8 -7
@@ -3,7 +3,7 @@ export declare const CallbackMaps: Map<string, {
3
3
  formRenderRef: import("vue").Ref<import("../../../../../components/form-render").FormRenderExpose | undefined>;
4
4
  key: import("vue").Ref<number>;
5
5
  reload: () => Promise<void>;
6
- formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList"];
6
+ formRenderExposeKeyList: readonly ["validate", "getFormValues", "setFormValues", "setFieldState", "resetFields", "queryWidget", "getFieldList", "applySelectedSetting"];
7
7
  exposed: Partial<import("../../../../../components/form-render").FormRenderExpose>;
8
8
  FormRender: import("vue").DefineComponent<{
9
9
  fieldList: {
@@ -169,6 +169,10 @@ export declare const CallbackMaps: Map<string, {
169
169
  default: boolean;
170
170
  };
171
171
  forceClearable: BooleanConstructor;
172
+ wordSplitFilter: {
173
+ type: BooleanConstructor;
174
+ default: boolean;
175
+ };
172
176
  }, {
173
177
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
174
178
  fieldList: {
@@ -334,6 +338,10 @@ export declare const CallbackMaps: Map<string, {
334
338
  default: boolean;
335
339
  };
336
340
  forceClearable: BooleanConstructor;
341
+ wordSplitFilter: {
342
+ type: BooleanConstructor;
343
+ default: boolean;
344
+ };
337
345
  }>> & {
338
346
  onFormChange?: ((...args: any[]) => any) | undefined;
339
347
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -388,7 +396,7 @@ export declare const CallbackMaps: Map<string, {
388
396
  afterRequest(fieldKey: string, res?: any, payload?: import("../../../..").AnyObject | undefined): import("../../../..").AnyObject[];
389
397
  afterOptionInit(fieldKey: string, options: import("../../../..").AnyObject[], payload?: import("../../../..").AnyObject | undefined): void;
390
398
  }>>[T]>>;
391
- triggerAutoHidden: (field: import("@formily/core").GeneralField) => Promise<void>;
399
+ triggerAutoHidden: (field: import("@formily/core").GeneralField, includeLinebar?: boolean) => Promise<void>;
392
400
  observeFormGraph: Record<string, import("@formily/core").GeneralField>;
393
401
  setGraph: (field: import("@formily/core").GeneralField) => void;
394
402
  removeGraph: (field: import("@formily/core").GeneralField) => void;
@@ -498,6 +506,7 @@ export declare const CallbackMaps: Map<string, {
498
506
  operationalForm: import("../../../..").LowCodeTypes.operationalConfig[];
499
507
  outBordered: boolean;
500
508
  forceClearable: boolean;
509
+ wordSplitFilter: boolean;
501
510
  }>) => Record<string, import("@formily/json-schema").Stringify<{
502
511
  [key: symbol]: any;
503
512
  [key: `x-${string}`]: any;
@@ -839,6 +848,10 @@ export declare const CallbackMaps: Map<string, {
839
848
  default: boolean;
840
849
  };
841
850
  forceClearable: BooleanConstructor;
851
+ wordSplitFilter: {
852
+ type: BooleanConstructor;
853
+ default: boolean;
854
+ };
842
855
  }>> & {
843
856
  onFormChange?: ((...args: any[]) => any) | undefined;
844
857
  onScroll?: ((...args: any[]) => any) | undefined;
@@ -858,6 +871,7 @@ export declare const CallbackMaps: Map<string, {
858
871
  uniqueCacheData: boolean;
859
872
  outBordered: boolean;
860
873
  forceClearable: boolean;
874
+ wordSplitFilter: boolean;
861
875
  operationalFormInit: boolean;
862
876
  }>;
863
877
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
@@ -3016,6 +3030,139 @@ export declare const CallbackMaps: Map<string, {
3016
3030
  isBatchSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
3017
3031
  isSingleSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
3018
3032
  dragScroll?: boolean | undefined;
3033
+ dragScrollConfig?: {
3034
+ dragEle?: string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | HTMLElement | {
3035
+ [x: string]: any;
3036
+ setup?: ((this: void, props: Readonly<import("@vue/shared").LooseRequired<any>>, ctx: import("vue").SetupContext<any>) => any) | undefined;
3037
+ name?: string | undefined;
3038
+ template?: string | object | undefined;
3039
+ render?: Function | undefined;
3040
+ components?: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>> | undefined;
3041
+ directives?: Record<string, import("vue").Directive<any, any>> | undefined;
3042
+ inheritAttrs?: boolean | undefined;
3043
+ emits?: any;
3044
+ expose?: string[] | undefined;
3045
+ serverPrefetch?: (() => Promise<any>) | undefined;
3046
+ compilerOptions?: {
3047
+ isCustomElement?: ((tag: string) => boolean) | undefined;
3048
+ whitespace?: "preserve" | "condense" | undefined;
3049
+ comments?: boolean | undefined;
3050
+ delimiters?: [string, string] | undefined;
3051
+ } | undefined;
3052
+ call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
3053
+ __isFragment?: undefined;
3054
+ __isTeleport?: undefined;
3055
+ __isSuspense?: undefined;
3056
+ __defaults?: {} | undefined;
3057
+ compatConfig?: {
3058
+ GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
3059
+ GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
3060
+ GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
3061
+ GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
3062
+ GLOBAL_SET?: boolean | "suppress-warning" | undefined;
3063
+ GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
3064
+ GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
3065
+ GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
3066
+ CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
3067
+ CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
3068
+ CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
3069
+ CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
3070
+ CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
3071
+ CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
3072
+ CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
3073
+ INSTANCE_SET?: boolean | "suppress-warning" | undefined;
3074
+ INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
3075
+ INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
3076
+ INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
3077
+ INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
3078
+ INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
3079
+ INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
3080
+ INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
3081
+ INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
3082
+ OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
3083
+ OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
3084
+ OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
3085
+ OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
3086
+ WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
3087
+ PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
3088
+ V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
3089
+ CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
3090
+ ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
3091
+ ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
3092
+ TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
3093
+ TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
3094
+ COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
3095
+ COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
3096
+ COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
3097
+ RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
3098
+ FILTERS?: boolean | "suppress-warning" | undefined;
3099
+ PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
3100
+ MODE?: 2 | 3 | ((comp: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | null) => 2 | 3) | undefined;
3101
+ } | undefined;
3102
+ data?: ((this: any, vm: any) => any) | undefined;
3103
+ computed?: import("vue").ComputedOptions | undefined;
3104
+ methods?: import("vue").MethodOptions | undefined;
3105
+ watch?: {
3106
+ [x: string]: (string | import("vue").WatchCallback<any, any> | ({
3107
+ handler: string | import("vue").WatchCallback<any, any>;
3108
+ } & import("vue").WatchOptions<boolean>)) | (string | import("vue").WatchCallback<any, any> | ({
3109
+ handler: string | import("vue").WatchCallback<any, any>;
3110
+ } & import("vue").WatchOptions<boolean>))[];
3111
+ } | undefined;
3112
+ provide?: import("vue").ComponentProvideOptions | undefined;
3113
+ inject?: (string[] | {
3114
+ [x: string]: string | symbol | {
3115
+ from?: string | symbol | undefined;
3116
+ default?: unknown;
3117
+ };
3118
+ [x: symbol]: string | symbol | {
3119
+ from?: string | symbol | undefined;
3120
+ default?: unknown;
3121
+ };
3122
+ }) | undefined;
3123
+ filters?: Record<string, Function> | undefined;
3124
+ mixins?: any[] | undefined;
3125
+ extends?: any;
3126
+ beforeCreate?: (() => void) | undefined;
3127
+ created?: (() => void) | undefined;
3128
+ beforeMount?: (() => void) | undefined;
3129
+ mounted?: (() => void) | undefined;
3130
+ beforeUpdate?: (() => void) | undefined;
3131
+ updated?: (() => void) | undefined;
3132
+ activated?: (() => void) | undefined;
3133
+ deactivated?: (() => void) | undefined;
3134
+ beforeDestroy?: (() => void) | undefined;
3135
+ beforeUnmount?: (() => void) | undefined;
3136
+ destroyed?: (() => void) | undefined;
3137
+ unmounted?: (() => void) | undefined;
3138
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | undefined;
3139
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | undefined;
3140
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | undefined;
3141
+ delimiters?: [string, string] | undefined;
3142
+ __differentiator?: string | number | symbol | undefined;
3143
+ __isBuiltIn?: boolean | undefined;
3144
+ __file?: string | undefined;
3145
+ __name?: string | undefined;
3146
+ } | undefined;
3147
+ changeCursor?: boolean | undefined;
3148
+ scrollTarget?: any;
3149
+ duration?: number | undefined;
3150
+ type?: "px" | "percent" | undefined;
3151
+ isDraggableEle?: ((event: MouseEvent) => boolean) | undefined;
3152
+ getScrollState?: ((target: import("../../../..").DragScrollTargetType | undefined) => {
3153
+ scrollTop: number;
3154
+ scrollLeft: number;
3155
+ }) | undefined;
3156
+ setScrollState?: ((target: import("../../../..").DragScrollTargetType | undefined, state: {
3157
+ scrollTarget: any;
3158
+ scrollTop: number;
3159
+ scrollLeft: number;
3160
+ offsetX: number;
3161
+ offsetY: number;
3162
+ startScrollX: number;
3163
+ startScrollY: number;
3164
+ }) => void) | undefined;
3165
+ } | undefined;
3019
3166
  selectType?: "checkbox" | "radio" | null | undefined;
3020
3167
  rowDraggable?: boolean | undefined;
3021
3168
  showSeq?: boolean | undefined;
@@ -3102,10 +3249,14 @@ export declare const CallbackMaps: Map<string, {
3102
3249
  startDateField: string;
3103
3250
  endDateField: string;
3104
3251
  }[] | undefined;
3252
+ verticalConfig?: {
3253
+ enable?: boolean | undefined;
3254
+ } | undefined;
3105
3255
  }>;
3106
3256
  updateConfigRefDebounced: () => void;
3107
3257
  updateConfigRef: () => void;
3108
3258
  fieldListRef: import("vue").Ref<{
3259
+ [x: string]: any;
3109
3260
  property?: string | undefined;
3110
3261
  type?: import("vxe-table").VxeColumnPropTypes.Type | undefined;
3111
3262
  field?: string | undefined;
@@ -3403,6 +3554,8 @@ export declare const CallbackMaps: Map<string, {
3403
3554
  getTitle?: (() => string) | undefined;
3404
3555
  getKey?: (() => string) | undefined;
3405
3556
  annotation?: boolean | undefined;
3557
+ depth?: number | undefined;
3558
+ parent?: any | undefined;
3406
3559
  }[]>;
3407
3560
  updateFieldListRefDebounced: () => void;
3408
3561
  updateFieldListRef: () => void;
@@ -5474,6 +5627,139 @@ export declare const CallbackMaps: Map<string, {
5474
5627
  isBatchSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
5475
5628
  isSingleSelect?: import("../../../..").MaybeString<0 | 1> | undefined;
5476
5629
  dragScroll?: boolean | undefined;
5630
+ dragScrollConfig?: {
5631
+ dragEle?: string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | HTMLElement | {
5632
+ [x: string]: any;
5633
+ setup?: ((this: void, props: Readonly<import("@vue/shared").LooseRequired<any>>, ctx: import("vue").SetupContext<any>) => any) | undefined;
5634
+ name?: string | undefined;
5635
+ template?: string | object | undefined;
5636
+ render?: Function | undefined;
5637
+ components?: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>> | undefined;
5638
+ directives?: Record<string, import("vue").Directive<any, any>> | undefined;
5639
+ inheritAttrs?: boolean | undefined;
5640
+ emits?: any;
5641
+ expose?: string[] | undefined;
5642
+ serverPrefetch?: (() => Promise<any>) | undefined;
5643
+ compilerOptions?: {
5644
+ isCustomElement?: ((tag: string) => boolean) | undefined;
5645
+ whitespace?: "preserve" | "condense" | undefined;
5646
+ comments?: boolean | undefined;
5647
+ delimiters?: [string, string] | undefined;
5648
+ } | undefined;
5649
+ call?: ((this: unknown, ...args: unknown[]) => never) | undefined;
5650
+ __isFragment?: undefined;
5651
+ __isTeleport?: undefined;
5652
+ __isSuspense?: undefined;
5653
+ __defaults?: {} | undefined;
5654
+ compatConfig?: {
5655
+ GLOBAL_MOUNT?: boolean | "suppress-warning" | undefined;
5656
+ GLOBAL_MOUNT_CONTAINER?: boolean | "suppress-warning" | undefined;
5657
+ GLOBAL_EXTEND?: boolean | "suppress-warning" | undefined;
5658
+ GLOBAL_PROTOTYPE?: boolean | "suppress-warning" | undefined;
5659
+ GLOBAL_SET?: boolean | "suppress-warning" | undefined;
5660
+ GLOBAL_DELETE?: boolean | "suppress-warning" | undefined;
5661
+ GLOBAL_OBSERVABLE?: boolean | "suppress-warning" | undefined;
5662
+ GLOBAL_PRIVATE_UTIL?: boolean | "suppress-warning" | undefined;
5663
+ CONFIG_SILENT?: boolean | "suppress-warning" | undefined;
5664
+ CONFIG_DEVTOOLS?: boolean | "suppress-warning" | undefined;
5665
+ CONFIG_KEY_CODES?: boolean | "suppress-warning" | undefined;
5666
+ CONFIG_PRODUCTION_TIP?: boolean | "suppress-warning" | undefined;
5667
+ CONFIG_IGNORED_ELEMENTS?: boolean | "suppress-warning" | undefined;
5668
+ CONFIG_WHITESPACE?: boolean | "suppress-warning" | undefined;
5669
+ CONFIG_OPTION_MERGE_STRATS?: boolean | "suppress-warning" | undefined;
5670
+ INSTANCE_SET?: boolean | "suppress-warning" | undefined;
5671
+ INSTANCE_DELETE?: boolean | "suppress-warning" | undefined;
5672
+ INSTANCE_DESTROY?: boolean | "suppress-warning" | undefined;
5673
+ INSTANCE_EVENT_EMITTER?: boolean | "suppress-warning" | undefined;
5674
+ INSTANCE_EVENT_HOOKS?: boolean | "suppress-warning" | undefined;
5675
+ INSTANCE_CHILDREN?: boolean | "suppress-warning" | undefined;
5676
+ INSTANCE_LISTENERS?: boolean | "suppress-warning" | undefined;
5677
+ INSTANCE_SCOPED_SLOTS?: boolean | "suppress-warning" | undefined;
5678
+ INSTANCE_ATTRS_CLASS_STYLE?: boolean | "suppress-warning" | undefined;
5679
+ OPTIONS_DATA_FN?: boolean | "suppress-warning" | undefined;
5680
+ OPTIONS_DATA_MERGE?: boolean | "suppress-warning" | undefined;
5681
+ OPTIONS_BEFORE_DESTROY?: boolean | "suppress-warning" | undefined;
5682
+ OPTIONS_DESTROYED?: boolean | "suppress-warning" | undefined;
5683
+ WATCH_ARRAY?: boolean | "suppress-warning" | undefined;
5684
+ PROPS_DEFAULT_THIS?: boolean | "suppress-warning" | undefined;
5685
+ V_ON_KEYCODE_MODIFIER?: boolean | "suppress-warning" | undefined;
5686
+ CUSTOM_DIR?: boolean | "suppress-warning" | undefined;
5687
+ ATTR_FALSE_VALUE?: boolean | "suppress-warning" | undefined;
5688
+ ATTR_ENUMERATED_COERCION?: boolean | "suppress-warning" | undefined;
5689
+ TRANSITION_CLASSES?: boolean | "suppress-warning" | undefined;
5690
+ TRANSITION_GROUP_ROOT?: boolean | "suppress-warning" | undefined;
5691
+ COMPONENT_ASYNC?: boolean | "suppress-warning" | undefined;
5692
+ COMPONENT_FUNCTIONAL?: boolean | "suppress-warning" | undefined;
5693
+ COMPONENT_V_MODEL?: boolean | "suppress-warning" | undefined;
5694
+ RENDER_FUNCTION?: boolean | "suppress-warning" | undefined;
5695
+ FILTERS?: boolean | "suppress-warning" | undefined;
5696
+ PRIVATE_APIS?: boolean | "suppress-warning" | undefined;
5697
+ MODE?: 2 | 3 | ((comp: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | null) => 2 | 3) | undefined;
5698
+ } | undefined;
5699
+ data?: ((this: any, vm: any) => any) | undefined;
5700
+ computed?: import("vue").ComputedOptions | undefined;
5701
+ methods?: import("vue").MethodOptions | undefined;
5702
+ watch?: {
5703
+ [x: string]: (string | import("vue").WatchCallback<any, any> | ({
5704
+ handler: string | import("vue").WatchCallback<any, any>;
5705
+ } & import("vue").WatchOptions<boolean>)) | (string | import("vue").WatchCallback<any, any> | ({
5706
+ handler: string | import("vue").WatchCallback<any, any>;
5707
+ } & import("vue").WatchOptions<boolean>))[];
5708
+ } | undefined;
5709
+ provide?: import("vue").ComponentProvideOptions | undefined;
5710
+ inject?: (string[] | {
5711
+ [x: string]: string | symbol | {
5712
+ from?: string | symbol | undefined;
5713
+ default?: unknown;
5714
+ };
5715
+ [x: symbol]: string | symbol | {
5716
+ from?: string | symbol | undefined;
5717
+ default?: unknown;
5718
+ };
5719
+ }) | undefined;
5720
+ filters?: Record<string, Function> | undefined;
5721
+ mixins?: any[] | undefined;
5722
+ extends?: any;
5723
+ beforeCreate?: (() => void) | undefined;
5724
+ created?: (() => void) | undefined;
5725
+ beforeMount?: (() => void) | undefined;
5726
+ mounted?: (() => void) | undefined;
5727
+ beforeUpdate?: (() => void) | undefined;
5728
+ updated?: (() => void) | undefined;
5729
+ activated?: (() => void) | undefined;
5730
+ deactivated?: (() => void) | undefined;
5731
+ beforeDestroy?: (() => void) | undefined;
5732
+ beforeUnmount?: (() => void) | undefined;
5733
+ destroyed?: (() => void) | undefined;
5734
+ unmounted?: (() => void) | undefined;
5735
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | undefined;
5736
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | undefined;
5737
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | undefined;
5738
+ delimiters?: [string, string] | undefined;
5739
+ __differentiator?: string | number | symbol | undefined;
5740
+ __isBuiltIn?: boolean | undefined;
5741
+ __file?: string | undefined;
5742
+ __name?: string | undefined;
5743
+ } | undefined;
5744
+ changeCursor?: boolean | undefined;
5745
+ scrollTarget?: any;
5746
+ duration?: number | undefined;
5747
+ type?: "px" | "percent" | undefined;
5748
+ isDraggableEle?: ((event: MouseEvent) => boolean) | undefined;
5749
+ getScrollState?: ((target: import("../../../..").DragScrollTargetType | undefined) => {
5750
+ scrollTop: number;
5751
+ scrollLeft: number;
5752
+ }) | undefined;
5753
+ setScrollState?: ((target: import("../../../..").DragScrollTargetType | undefined, state: {
5754
+ scrollTarget: any;
5755
+ scrollTop: number;
5756
+ scrollLeft: number;
5757
+ offsetX: number;
5758
+ offsetY: number;
5759
+ startScrollX: number;
5760
+ startScrollY: number;
5761
+ }) => void) | undefined;
5762
+ } | undefined;
5477
5763
  selectType?: "checkbox" | "radio" | null | undefined;
5478
5764
  rowDraggable?: boolean | undefined;
5479
5765
  showSeq?: boolean | undefined;
@@ -5560,6 +5846,9 @@ export declare const CallbackMaps: Map<string, {
5560
5846
  startDateField: string;
5561
5847
  endDateField: string;
5562
5848
  }[] | undefined;
5849
+ verticalConfig?: {
5850
+ enable?: boolean | undefined;
5851
+ } | undefined;
5563
5852
  }>;
5564
5853
  configChanged: boolean;
5565
5854
  fieldChanged: boolean;
@@ -5569,6 +5858,7 @@ export declare const CallbackMaps: Map<string, {
5569
5858
  footer: any;
5570
5859
  slotPropertiesPicker: (args: import("../../../..").AnyObject) => Pick<import("../../../..").AnyObject, "row" | "column" | "rowIndex" | "checked" | "$rowIndex" | "disabled" | "columnIndex" | "$columnIndex" | "_columnIndex" | "indeterminate">;
5571
5860
  useVersion: typeof import("../../../..").useVersion;
5861
+ NConfigProvider: any;
5572
5862
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd" | "pageChange")[], "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd" | "pageChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
5573
5863
  tableConfig: {
5574
5864
  type: import("vue").PropType<import("../../../../../components/iho-table").IhoTableConfig>;
@@ -0,0 +1,2 @@
1
+ export * from './src';
2
+ export * from './src/types';
@@ -0,0 +1 @@
1
+ export{DragScroll,useDragScroll}from"./src/index.js";
@@ -0,0 +1,4 @@
1
+ import { Directive } from 'vue';
2
+ import { DragScrollConfig, DragScrollTargetType } from '../../../components/drag-scroll';
3
+ export declare function useDragScroll<T extends DragScrollTargetType>(uuid: any, config: DragScrollConfig<T>): () => void;
4
+ export declare const DragScroll: Directive<HTMLElement, Partial<DragScrollConfig<any>>>;
@@ -0,0 +1 @@
1
+ import{findAncestor as e,isHTMLElement as t}from"../../../shared/utils/index.js";import{useThrottleFn as r}from"@vueuse/core";import{isFunction as l,isObject as s,isString as o,flow as n}from"lodash-es";import{unref as a}from"vue";const c={events:new Map,regist(e,t,r){window.addEventListener(t,r);const l=this.events.get(e)||[];l.push((()=>window.removeEventListener(t,r))),this.events.set(e,l)},stopper(e){var t;n(null!=(t=this.events.get(e))?t:[])(),this.events.delete(e)}};class i{constructor(){this.queue=[],this.lock=!1}add(e){this.queue.push(e),this.execute()}async execute(){if(!this.lock){this.lock=!0;try{for(;this.queue.length;)await this.queue.shift()()}finally{this.lock=!1}}}clear(){this.queue.length=0}}function u(o,n){var a;c.stopper(o);let u=0,g=0,d=0,p=0,f=!1;const m=new i;return c.regist(o,"mousemove",r((r=>{var s;if(!f){const t=h(n.dragEle);if(!t)return;if(!1!==n.changeCursor){const s=r.target;if(!e(s,(e=>e===t)))return;const o=!l(n.isDraggableEle)||n.isDraggableEle(r);t.style.cursor=o?"grab":"default"}return}const{pageX:o,pageY:a}=r,c=o-u,i=a-g;m.add((()=>{let e=Math.max(0,d-c),r=Math.max(0,p-i);const s=h(n.scrollTarget);if("percent"===n.type)if(t(s)){const{scrollWidth:t,scrollHeight:l,clientHeight:o,clientWidth:n}=s;e=Math.max(0,d-c/n*t),r=Math.max(0,p-i/o*l)}else console.warn(`[DragScroll]: scrollTarget ${s} is not HTMLElement`);l(n.setScrollState)?n.setScrollState(n.scrollTarget,{scrollTarget:n.scrollTarget,scrollLeft:e,scrollTop:r,startScrollX:d,startScrollY:p,offsetX:c,offsetY:i}):null==s||s.scrollTo(e,r)})),window.getSelection&&(null==(s=window.getSelection())||s.removeAllRanges())}),null!=(a=n.duration)?a:50)),c.regist(o,"mousedown",(t=>{const r=h(n.dragEle);if(!r)return;const o=t.target;if(!e(o,(e=>e===r)))return;if(!(!l(n.isDraggableEle)||n.isDraggableEle(t)))return;const a=l(n.getScrollState)?n.getScrollState(n.scrollTarget):h(n.scrollTarget);s(a)&&(u=t.pageX,g=t.pageY,d=a.scrollLeft,p=a.scrollTop,f=!0)})),c.regist(o,"mouseup",(()=>{f=!1,m.clear()})),()=>c.stopper(o)}const g={mounted(e,t){u(e,Object.assign({dragEle:e,scrollTarget:e},t.value))},unmounted(e){c.stopper(e)},updated(e,t){c.stopper(e),u(e,Object.assign({dragEle:e,scrollTarget:e},t.value))}};function h(e){return e=a(e),o(e)?document.querySelector(e):t(e)?e:s(e)?Reflect.get(e,"$el"):null}export{g as DragScroll,u as useDragScroll};
@@ -0,0 +1,24 @@
1
+ import { MaybeRef } from '@vueuse/shared';
2
+ import { Component } from 'vue';
3
+ export declare type DragScrollTargetType = MaybeRef<HTMLElement | string | Component>;
4
+ export declare type DragScrollConfig<T extends DragScrollTargetType = any> = Partial<{
5
+ dragEle: DragScrollTargetType;
6
+ changeCursor: boolean;
7
+ scrollTarget: T;
8
+ duration: number;
9
+ type: 'percent' | 'px';
10
+ isDraggableEle: (event: MouseEvent) => boolean;
11
+ getScrollState: (target: DragScrollTargetType | undefined) => {
12
+ scrollTop: number;
13
+ scrollLeft: number;
14
+ };
15
+ setScrollState: (target: DragScrollTargetType | undefined, state: {
16
+ scrollTarget: T;
17
+ scrollTop: number;
18
+ scrollLeft: number;
19
+ offsetX: number;
20
+ offsetY: number;
21
+ startScrollX: number;
22
+ startScrollY: number;
23
+ }) => void;
24
+ }>;
@@ -58,5 +58,6 @@ export declare const OVERLAP: {
58
58
  };
59
59
  export declare enum ECG {
60
60
  SMALLCELLNUMBER = 5,
61
- MAXLINENUMBER = 13
61
+ MAXLINENUMBER = 13,
62
+ DEFAULTMAINXCELLVALUE = 0.2
62
63
  }
@@ -1 +1 @@
1
- const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,fill:"green"},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}};var d=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e))(d||{});export{d as ECG,l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
1
+ const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,fill:"green"},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}};var d=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e[e.DEFAULTMAINXCELLVALUE=.2]="DEFAULTMAINXCELLVALUE",e))(d||{});export{d as ECG,l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
@@ -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: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
+ 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 n}from"../useDraw.js";import{useGrid as i}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as l}from"../../constants/index.js";import"naive-ui";function s(s,u,d){const{computedX:c,computedY:m}=a(u),{borderStyle:h,originX:f,originY:L,xCellWidth:g,yCellHeight:p,canvasWidth:E,canvasHeight:M,dataList:v,columnNumber:C,gridYNumber:N,gridXNumber:b,rowNumber:x,lineStyle:S,titleStyle:w,config:A}=u,j=new Set,X=new Set;function R(e=[]){return~~(e.length/C)*(A.mainXCellValue/l.DEFAULTMAINXCELLVALUE)}function U(t=0){v.forEach(((r,o)=>{if(o===v.length-1&&arguments.length)return;const{x:n,y:i,rowIdx:a}=r.origin,s=R(r.data),h=r.data.reduce(((e,r,n)=>{const a=o<l.MAXLINENUMBER-1&&n>=t&&n<=t+s||o===l.MAXLINENUMBER-1?[{x:c(e.length+1),y:m(-+r)+i}]:[];return e.concat(a)}),[]),f=new e.Polyline(h,{...S,fill:"transparent",strokeWidth:1,left:n,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(y(f,{...u.config,...u,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>d.value&&Promise.reject()}),f.startIdx=t,o<v.length-1?j.add(f):X.add(f),arguments.length)return;const L=new e.Text(String(r.title),{...w,left:n+g,top:i,originX:"left",originY:"bottom"});X.add(L)}));const r=arguments.length?[...j]:[...j,...X];s.value.add(...r)}function y(e,t){o(e,t)}i(s,{...u,gridXNumber:b*l.SMALLCELLNUMBER,gridYNumber:N*l.SMALLCELLNUMBER,xCellWidth:g/l.SMALLCELLNUMBER,yCellHeight:p/l.SMALLCELLNUMBER,grid:{...u.grid,subXCell:l.SMALLCELLNUMBER,subYCell:l.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=h,r=new e.Rect({...h,width:E-t,height:M-t,left:f,top:L,fill:"transparent"});s.value.add(r)}(),function(){const e=E/C,t=[];r(C).forEach((r=>{if(r+1>=C)return;const o=(r+1)*e,i=n([o,0,o,M],{stroke:"#000"});t.push(i)})),s.value.add(...t)}(),U();return{updatePolyline:t((t=>{const r=R(v[v.length-1].data);if(r===v[0].data.length)return;const o=v[v.length-1].data.length,n=t/100*o-r/2,i=n+r>o?o-r:Math.max(0,n);e.util.requestAnimFrame((()=>{if(j.size){const[e]=[...j];if(e.startIdx===i)return;[...j].forEach((e=>s.value.remove(e))),j.clear()}U(i)}))}),150)}}export{s as useElectrocardiogram};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,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 d}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function m(m,v,c,g,h,p){const N=e(),f=e(),b=e(),M=e(),L=t((()=>v.data.width)),y=t((()=>v.data.height)),S=t((()=>(L.value-0)/C.value)),w=t((()=>(y.value-0)/E.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)})),E=t((()=>{const{config:e,grid:t,dataList:a}=v.data;if(t.gridYNumber)return t.gridYNumber;const r=a.length;return Math.ceil(x.value*r*2/e.mainYCellValue)})),x=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})),j=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{rowNumber:e}=R.value,{dataList:t}=v.data,a=t.length;return Math.round(E.value/(e+(a===o.MAXLINENUMBER?1:0)))})),X=t((()=>{const{dataList:e,width:t,config:a,grid:r}=v.data,{columnNumber:u,rowNumber:l}=R.value,i=t/u,n=e.length;return e.map(((e,t)=>{const a=o.MAXLINENUMBER===n&&t===n-1?l:t%l;return{...e,origin:{x:(o.MAXLINENUMBER===n&&t===n-1?0:Math.floor(t/l))*i,y:a*(w.value*I.value)+w.value*Math.ceil(I.value/2),rowIdx:a}}}))})),U=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...l,...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:L.value,originY:0,endY:y.value,xCellWidth:S.value,yCellHeight:w.value,gridXNumber:C.value,gridYNumber:E.value,event:j.value,dataList:X.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:v.data.config});return u((()=>m.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:t,useCaliper:a,useCaliperRuler:r}=s(m,U),{updatePolyline:u}=d(m,U,t);f.value=e,b.value=a,M.value=r,N.value=u}()}),{immediate:!0}),{propItems:U,updatePolyline:N,useMeasureRuler:f,useCaliper:b,useCaliperRuler:M,getGridInfo:function(){return{cellWidth:S.value,cellHeight:w.value,smallCellNumber:o.SMALLCELLNUMBER}}}}export{m as useElectrocardiogramChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{isNumber as o}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as d}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function v(v,c,g,h,f,p){const N=e(),M=e(),b=e(),L=e(),y=t((()=>c.data.width)),x=t((()=>c.data.height)),S=t((()=>(y.value-0)/C.value)),w=t((()=>(x.value-0)/E.value)),C=t((()=>{const{dataList:e,config:t,grid:a}=c.data;if(o(a.gridXNumber))return a.gridXNumber;const r=e[e.length-1].data.length/t.hz;return Math.ceil(r/t.mainXCellValue)})),E=t((()=>{const{config:e,grid:t,dataList:a}=c.data;if(o(t.gridYNumber))return t.gridYNumber;const r=a.length;return Math.ceil(X.value*r*2/e.mainYCellValue)})),X=t((()=>{const{dataList:e,config:t}=c.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})),j=t((()=>{var e;return(null==(e=c.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=t((()=>{const{mode:e="2-6"}=c.data,[t,a]=e.split("-").map((e=>+e));return{columnNumber:t,rowNumber:a}})),I=t((()=>{const{rowNumber:e}=R.value,{dataList:t}=c.data,a=t.length;return Math.round(E.value/(e+(a===d.MAXLINENUMBER?1:0)))})),U=t((()=>{const{dataList:e,width:t,config:a,grid:r}=c.data,{columnNumber:u,rowNumber:l}=R.value,i=t/u,n=e.length,o=Math.ceil(I.value/2),m=function(){const{valueUnit:t,mainYCellValue:r}=a,l=e[0].data,i=d(Math.max(...l));if(2!==u)return i;const n=e[6].data,o=d(Math.max(...n));return Math.max(i,o);function d(e){return("uv"===t?.001*e:"v"===t?1e3*e:e)/r*w.value}}(),s=w.value*o,v=1===u||s<m?w.value*Math.ceil(m/w.value):s;return e.map(((e,t)=>{const a=d.MAXLINENUMBER===n&&t===n-1?l:t%l;return{...e,origin:{x:(d.MAXLINENUMBER===n&&t===n-1?0:Math.floor(t/l))*i,y:a*(w.value*I.value)+v,rowIdx:a}}}))})),Y=a({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...l,...c.data.borderStyle},lineStyle:{...i,...c.data.lineStyle},titleStyle:{...n,...c.data.titleStyle},measureLineStyle:{...i,...c.data.measureLineStyle},measureTextStyle:{...n,...c.data.measureTextStyle},grid:c.data.grid,originX:0,endX:y.value,originY:0,endY:x.value,xCellWidth:S.value,yCellHeight:w.value,gridXNumber:C.value,gridYNumber:E.value,event:j.value,dataList:U.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:c.data.config});return u((()=>v.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:t,useCaliper:a,useCaliperRuler:r}=s(v,Y),{updatePolyline:u}=m(v,Y,t);M.value=e,b.value=a,L.value=r,N.value=u}()}),{immediate:!0}),{propItems:Y,updatePolyline:N,useMeasureRuler:M,useCaliper:b,useCaliperRuler:L,getGridInfo:function(){return{cellWidth:S.value,cellHeight:w.value,smallCellNumber:d.SMALLCELLNUMBER}}}}export{v as useElectrocardiogramChart};
@@ -1 +1 @@
1
- import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L){const{computedX:P,computedY:b,getXValue:w,getYValue:A}=r(h),{xCellWidth:I,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:X,event:M,scaleValues:T,xAxis:V,startTime:Y,timeXCell:S,itemList:$,dialog:F}=h,O=new Map,D=new Set,_=p(T);let z=[],N=null;const G=new Set;l(y,h);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:R}=s(y,k,h),{pause:W,resume:B}=g((()=>{!function(){if(!G.size)return;for(const e of G)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function H(){_.forEach((e=>{e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=b(t.type,t.range,n),a=i([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{x.point={...e||{x:a.left,y:a.top}},x.list=[`${o} ${n}${t.unit||""}`],x.show=!0})),a.on("mouseout",(()=>{x.show=!1}))),y.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ee(t,n,e))}))}))}function Q(e=[]){if(!(null==N?void 0:N.areaPos))return[];const{startPos:t,endPos:n}=N.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:fe()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function U(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),Z()},onNegativeClick:()=>Z(),onClose:()=>Z()})}function Z(){N&&y.value.remove(N),N=null}function ee(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];O.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,g=u;l.key&&(g=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:b="",key:C,type:K="circle"}=g,j=se(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:b,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...h.event.hovered?h.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:h.event};e&&(E||(X.leftLine=null),p=o(K,{left:e[0],top:e[1],...X}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){M.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ae(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),M.hovered&&re(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/I);if(a>l+I){if(0===z.length){ne(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+I*c;if(z.every((e=>e.left!==u))){const t=w(u),n=A(f.type,s);z.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),ne(e,[...e.prevPointer,u,s])}if(z.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+I*l,r=z.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=z.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=z[l-1]||{left:n,top:i},f=~~((r.left-(t-I))/I),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:w(t),value:A(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},z.splice(l,0,a),ne(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=O.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=I/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?te(e,"#999"):te(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(z.length>0&&i<z[z.length-1].left){for(const e of D)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(z=z.filter((e=>e.left<=i)),0===z.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(z.length>0){const t=z.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:A(t,e.top)}};if(y.value.discardActiveObject(),z.length>0){const l=_.find((e=>e.type===t));let r=-1;const a=z.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void oe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ie({...o,data:a,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ie(o,"change")}}))}(p),null==(d=O.get(u.key))||d.push(p))}(se(l,n),l,c,e)})),Promise.all(O.get(e.key)).then((t=>{const n=f.filter((e=>e));R(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||G.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function te(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function ne(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function ie(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=_.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}oe({dataIndex:s,scaleValue:f})}function oe(e){var t,n,i;if(D.size&&(null==(t=y.value)||t.remove(...le([...D]))),D.clear(),z=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...le(O.get(o.key))),O.delete(o.key),ee(o,t,i)}else O.size&&(null==(i=y.value)||i.remove(...le(fe()))),O.clear(),H()}function le(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)})),t}function re(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;x.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:A(i,e.top)}`;x.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],x.show=!0}function ae(e){e.setCoords();const t=6e4/S,n=e.prevPoint?e.prevPoint.left+t:K,i=j;e.top<E&&e.set("top",E),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function se(e,t){if(u(e)&&function(e){const t=Date.parse(V.list.at(-1)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=P(e.time),i=b(t.type,t.range,e.value);return[n,i<E?E:i>X?X:i]}}function fe(){return v(Array.from(O.values()))}return e((()=>{W()})),H(),function(){if(!M.evented)return;let e=!1,i={x:0,y:0};y.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=j&&n>=E&&n<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);fe().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{J(fe(),t,"key",2*I).includes(n.linkKey||n.key)||L.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===L.list.length&&(L.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Q();t.length>0?U((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ie(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);k("remove",e)})):a.emit(N)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),y.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;N&&y.value.remove(N),N=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),N.areaPos={startPos:i,endPos:o.pointer},y.value.add(N)}))}(),{redrawPoints:oe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),ie(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),ie({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ae,setPopup:re,updateData:ie,getGridPoints:fe,getContainPoints:Q,showDialog:U,removeCurrentSelection:Z}}export{y as useCenter};
1
+ import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L){const{computedX:P,computedY:b,getXValue:w,getYValue:A}=r(h),{xCellWidth:I,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:X,event:M,scaleValues:V,xAxis:T,startTime:Y,timeXCell:S,itemList:$,dialog:F}=h,O=new Map,D=new Set,_=p(V);let z=[],N=null;const G=new Set;l(y,h);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:R}=s(y,k,h),{pause:W,resume:B}=g((()=>{!function(){if(!G.size)return;for(const e of G)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function H(){_.forEach((e=>{const{range:t=[],spaceValue:n}=e;n&&(t[0]||t[1])&&e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=b(t.type,t.range,n),a=i([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{x.point={...e||{x:a.left,y:a.top}},x.list=[`${o} ${n}${t.unit||""}`],x.show=!0})),a.on("mouseout",(()=>{x.show=!1}))),y.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ee(t,n,e))}))}))}function Q(e=[]){if(!(null==N?void 0:N.areaPos))return[];const{startPos:t,endPos:n}=N.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:fe()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function U(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),Z()},onNegativeClick:()=>Z(),onClose:()=>Z()})}function Z(){N&&y.value.remove(N),N=null}function ee(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];O.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,g=u;l.key&&(g=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:b="",key:C,type:K="circle"}=g,j=se(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:b,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...h.event.hovered?h.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:h.event};e&&(E||(X.leftLine=null),p=o(K,{left:e[0],top:e[1],...X}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){M.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ae(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),M.hovered&&re(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/I);if(a>l+I){if(0===z.length){ne(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+I*c;if(z.every((e=>e.left!==u))){const t=w(u),n=A(f.type,s);z.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),ne(e,[...e.prevPointer,u,s])}if(z.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+I*l,r=z.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=z.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=z[l-1]||{left:n,top:i},f=~~((r.left-(t-I))/I),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:w(t),value:A(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},z.splice(l,0,a),ne(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=O.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=I/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?te(e,"#999"):te(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(z.length>0&&i<z[z.length-1].left){for(const e of D)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(z=z.filter((e=>e.left<=i)),0===z.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(z.length>0){const t=z.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:A(t,e.top)}};if(y.value.discardActiveObject(),z.length>0){const l=_.find((e=>e.type===t));let r=-1;const a=z.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void oe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ie({...o,data:a,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ie(o,"change")}}))}(p),null==(d=O.get(u.key))||d.push(p))}(se(l,n),l,c,e)})),Promise.all(O.get(e.key)).then((t=>{const n=f.filter((e=>e));R(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||G.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function te(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function ne(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function ie(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=_.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}oe({dataIndex:s,scaleValue:f})}function oe(e){var t,n,i;if(D.size&&(null==(t=y.value)||t.remove(...le([...D]))),D.clear(),z=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...le(O.get(o.key))),O.delete(o.key),ee(o,t,i)}else O.size&&(null==(i=y.value)||i.remove(...le(fe()))),O.clear(),H()}function le(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)})),t}function re(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;x.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:A(i,e.top)}`;x.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],x.show=!0}function ae(e){e.setCoords();const t=6e4/S,n=e.prevPoint?e.prevPoint.left+t:K,i=j;e.top<E&&e.set("top",E),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function se(e,t){if(u(e)&&function(e){const t=Date.parse(T.list.at(-1)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=P(e.time),i=b(t.type,t.range,e.value);return[n,i<E?E:i>X?X:i]}}function fe(){return v(Array.from(O.values()))}return e((()=>{W()})),H(),function(){if(!M.evented)return;let e=!1,i={x:0,y:0};y.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=j&&n>=E&&n<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);fe().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{J(fe(),t,"key",2*I).includes(n.linkKey||n.key)||L.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===L.list.length&&(L.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Q();t.length>0?U((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ie(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);k("remove",e)})):a.emit(N)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),y.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;N&&y.value.remove(N),N=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),N.areaPos={startPos:i,endPos:o.pointer},y.value.add(N)}))}(),{redrawPoints:oe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),ie(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),ie({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ae,setPopup:re,updateData:ie,getGridPoints:fe,getContainPoints:Q,showDialog:U,removeCurrentSelection:Z}}export{y as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function p(p,h,f,m,g,v,y,k){const{getYValue:w,getXValue:j}=s(h),{getEqualXTypes:x,handleAddPrevent:b,isGridLimit:W}=u(p,f,h),{originY:X,endY:C,borderStyle:E,left:S,itemList:Y,scaleValues:K,originX:L,endX:V,yCellHeight:G,markHeight:H,canvasWidth:N,canvasHeight:T,xCellWidth:M}=h;!function(){if(!S)return;const{title:t,titleWidth:i,titleStyle:o}=S,n=e({width:i,height:C-X+H,...E},{value:t.split("").join("\n"),...o||{}},{left:0,top:X},!0);p.value.add(n)}(),K.forEach(((e,i)=>{var o,s;const u="left"===e.layout?L-5:V+5,{range:c,spaceValue:h,title:f,unit:m,titleStyle:g,spaceGridNumber:v=1,showNumber:y,showMaxMinNumber:k}=e,w=[],j=d(c,h),x=j.length;j.forEach(((t,i)=>{const o=0===i?C-5:C-i*G*v;!y||(0===i||i===x-1)&&!k||w.push(a(String(t),{...e,position:e.layout},u,o))}));const b=f&&n(["left"===e.layout?S.width/2:V+(N-V)/2,(null!=(s=null==(o=w.at(-1))?void 0:o.top)?s:330)-G],{value:`${f}${m?"\n"+m:""}`,...r,...g}),W=new t.Group([...w,...b?[b]:[]],{objectCaching:!1,...l});p.value.add(W),W.sendToBack()})),function(){const e=new t.Rect({width:L-S.titleWidth,height:C-X+H,left:S.titleWidth,top:X,...i,originX:"left",originY:"top",...E});p.value.add(e);const n=c(Y),r=c(S.externalIconList||[]).map((t=>({...t,isExternal:!0})));let l=C;const s=S.titleWidth+15;r.concat(n.reverse()).forEach((t=>{l-=10;const e=t.title,{text:i,icon:n}=o(e,t,{text:{left:s,top:l},icon:{leftX:s,topY:l,...t.isExternal?{evented:!1,selectable:!1}:{},origin:{linkKey:t.linkKey}}});var r;l-=i.height||30,(r=n).on("moving",(()=>{r.set("originX","center"),W(r)?(g(r),v(r)):m.show=!1})),r.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&W(r)){const t=r.origin.linkKey||r.origin.key;if(x(k(),r.left,"key",2*M).includes(t))b("repeat");else{const e={data:{time:j(r.left),value:w(r.origin.type,r.top),...r.origin.linkKey?{key:r.origin.key}:{}},...r.origin};f("add",e),y({...e,key:t})}}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(r)})),p.value.add(i,n)}))}(),p.value.add(new t.Rect({left:0,top:0,width:N-E.strokeWidth,height:T-E.strokeWidth,fill:"transparent",...E}))}export{p as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as s}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function f(f,p,g,h,m,v,y,k){const{getYValue:w,getXValue:j}=a(p),{getEqualXTypes:x,handleAddPrevent:b,isGridLimit:X}=u(f,g,p),{originY:W,endY:C,borderStyle:E,left:S,itemList:Y,scaleValues:K,originX:L,endX:M,yCellHeight:N,markHeight:V,canvasWidth:G,canvasHeight:H,xCellWidth:T}=p;!function(){if(!S)return;const{title:t,titleWidth:i,titleStyle:o}=S,n=e({width:i,height:C-W+V,...E},{value:t.split("").join("\n"),...o||{}},{left:0,top:W},!0);f.value.add(n)}(),K.forEach(((e,i)=>{var o,a;const{range:u,spaceValue:c,title:p,unit:g,titleStyle:h,spaceGridNumber:m=1,showNumber:v,showMaxMinNumber:y,titleMargin:k=[5,30],margin:w=5}=e,j="left"===e.layout?L-w:M+w,x=[],b=d(u,c),X=b.length;b.forEach(((t,i)=>{const o=0===i?C-5:C-i*N*m;!v||(0===i||i===X-1)&&!y||x.push(s(String(t),{...e,position:e.layout},j,o))}));const W="left"===e.layout?"right":"left",E=p&&n(["left"===e.layout?L-k[0]:M+k[0],(null!=(a=null==(o=x.at(-1))?void 0:o.top)?a:330)-N-k[1]],{value:`${p}${g?"\n"+g:""}`,...r,...h,textAlign:W,originX:W,originY:"bottom"}),S=new t.Group([...x,...E?[E]:[]],{objectCaching:!1,...l});f.value.add(S),S.sendToBack()})),function(){const e=new t.Rect({width:L-S.titleWidth,height:C-W+V,left:S.titleWidth,top:W,...i,originX:"left",originY:"top",...E});f.value.add(e);const n=c(Y),r=c(S.externalIconList||[]).map((t=>({...t,isExternal:!0}))),{projectNameMargin:l=[5,30],titleWidth:a=20}=S;let s=C+V-l[0];const u=a+l[1];r.concat(n.reverse()).forEach((t=>{s-=10;const e=t.title,{text:i,icon:n}=o(e,t,{text:{left:u,top:s},icon:{leftX:u,topY:s,originX:"center",...t.isExternal?{evented:!1,selectable:!1}:{},origin:{linkKey:t.linkKey}}});var r;s-=i.height||30,n.set("left",n.left+n.width/2),(r=n).on("moving",(()=>{r.set("originX","center"),X(r)?(m(r),v(r)):h.show=!1})),r.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&X(r)){const t=r.origin.linkKey||r.origin.key;if(x(k(),r.left,"key",2*T).includes(t))b("repeat");else{const e={data:{time:j(r.left),value:w(r.origin.type,r.top),...r.origin.linkKey?{key:r.origin.key}:{}},...r.origin};g("add",e),y({...e,key:t})}}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(r)})),f.value.add(i,n)}))}(),f.value.add(new t.Rect({left:0,top:0,width:G-E.strokeWidth,height:H-E.strokeWidth,fill:"transparent",...E}))}export{f as useLeft};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{useDialog as n}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"../useEvent.js";import{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useCenter as g}from"./useCenter.js";import{useOther as f}from"./useOther.js";function y(y,x,w,b,j,C){const Y=n(),H=e(),S=e(),D=e(),A=t((()=>x.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),M=t((()=>{var e;return null!=(e=x.data.left.width)?e:0})),T=t((()=>{const{grid:e}=x.data;return e.mainXCell*e.subXCell})),X=t((()=>{const{grid:e}=x.data;return e.mainYCell*e.subYCell})),G=t((()=>s(x.data.top.treeData))),V=t((()=>x.data.top.tree.cellHeight)),k=t((()=>V.value*G.value)),P=t((()=>te(_("drug")||"top"))),L=t((()=>P.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=x.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(x.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(T.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:M.value}})),E=function(){const e=d(x.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=x.data.top.tree;return function e(i,l=0){i.forEach((i=>{var n;const o={top:t*r+P.value,left:l*a,width:a,height:r};if(t++,null==(n=i.children)?void 0:n.length){t--;const a=s(i.children);o.height=a*r,e(i.children,l+1)}else o.width=M.value-o.left;Object.assign(i,o)}))}(e),e}(),W=t((()=>te(_("xAxis")||"center"))),I=t((()=>{var e;const{width:t,right:a}=x.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),q=t((()=>te(_("intraoperatively")||"bottom"))),z=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=x.data.other)?void 0:e.mark)||{};return t&&a?a:0})),B=t((()=>q.value+(x.data.height-k.value-O.value.height-z.value))),F=t((()=>(I.value-M.value)/T.value)),J=t((()=>(B.value-q.value)/X.value)),K=t((()=>O.value.spaceTimeStamp/F.value)),Q=t((()=>{const{scaleValues:e}=x.data;return p(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),R=t((()=>ae("pulse"))),U=t((()=>ae("temperature"))),Z=t((()=>{var e;return(null==(e=x.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),$=a({canvasWidth:x.data.width,canvasHeight:x.data.height,borderStyle:{...o,...x.data.borderStyle},pointSelectionStyle:x.data.pointSelectionStyle||{},grid:x.data.grid,top:x.data.top,left:x.data.left,other:x.data.other,topGridYNumber:r(G),topGridYCellHeight:r(V),topGridOriginY:r(P),topGridEndY:r(L),treeData:E,xAxis:r(O),originYXAxis:r(W),startTime:r(N),timeXCell:r(K),gridXNumber:r(T),gridYNumber:r(X),xCellWidth:r(F),yCellHeight:r(J),originX:r(M),endX:r(I),originY:r(q),endY:r(B),markHeight:r(z),itemList:r(Q),scaleValues:x.data.scaleValues,pulseYCell:r(R),temperatureYCell:r(U),event:r(Z),dialog:Y});function _(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ee(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return x.data.height-k.value-a}}function te(e){switch(e){case"top":return 0;case"center":return ee("top");default:return ee("top")+ee("center")}}function ae(e){const{scaleValues:t}=x.data,a=t.find((t=>t.type===e));return J.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),v(y,$,w,j);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:n,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=g(y,$,w,j,C);h(y,$,w,j,a,r,i,n);const{clickMenu:d}=f(y,$,w,j,C,a,o,u,s);S.value=e,D.value=e=>{const{item:a}=e;a.type&&m.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:$,redrawPoints:S,select:H,clickMenu:D}}export{y as useSurgicalAnesthesiaChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as n}from"vue";import{useDialog as l}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"../useEvent.js";import{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useCenter as f}from"./useCenter.js";import{useOther as g}from"./useOther.js";function y(y,w,x,b,j,C){const Y=l(),H=e(),S=e(),D=e(),A=t((()=>w.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),M=t((()=>{var e;return null!=(e=w.data.left.width)?e:0})),T=t((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell})),X=t((()=>{const{grid:e}=w.data;return e.mainYCell*e.subYCell})),G=t((()=>{const{treeData:e=[],show:t=!0}=w.data.top;return t?s(e):0})),V=t((()=>w.data.top.tree.cellHeight)),k=t((()=>V.value*G.value)),P=t((()=>te(_("drug")||"top"))),L=t((()=>P.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=w.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(w.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(T.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:M.value}})),E=function(){const{show:e=!0}=w.data.top;if(!e)return[];const t=d(w.data.top.treeData);let a=0;const{cellWidth:r,cellHeight:i}=w.data.top.tree;return function e(t,n=0){t.forEach((t=>{var l;const o={top:a*i+P.value,left:n*r,width:r,height:i};if(a++,null==(l=t.children)?void 0:l.length){a--;const r=s(t.children);o.height=r*i,e(t.children,n+1)}else o.width=M.value-o.left;Object.assign(t,o)}))}(t),t}(),W=t((()=>te(_("xAxis")||"center"))),I=t((()=>{var e;const{width:t,right:a}=w.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),q=t((()=>te(_("intraoperatively")||"bottom"))),z=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=w.data.other)?void 0:e.mark)||{};return t&&a?a:0})),B=t((()=>q.value+(w.data.height-k.value-O.value.height-z.value))),F=t((()=>(I.value-M.value)/T.value)),J=t((()=>(B.value-q.value)/X.value)),K=t((()=>O.value.spaceTimeStamp/F.value)),Q=t((()=>{const{scaleValues:e}=w.data;return p(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),R=t((()=>ae("pulse"))),U=t((()=>ae("temperature"))),Z=t((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),$=a({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...o,...w.data.borderStyle},pointSelectionStyle:w.data.pointSelectionStyle||{},grid:w.data.grid,top:w.data.top,left:w.data.left,other:w.data.other,topGridYNumber:r(G),topGridYCellHeight:r(V),topGridOriginY:r(P),topGridEndY:r(L),treeData:E,xAxis:r(O),originYXAxis:r(W),startTime:r(N),timeXCell:r(K),gridXNumber:r(T),gridYNumber:r(X),xCellWidth:r(F),yCellHeight:r(J),originX:r(M),endX:r(I),originY:r(q),endY:r(B),markHeight:r(z),itemList:r(Q),scaleValues:w.data.scaleValues,pulseYCell:r(R),temperatureYCell:r(U),event:r(Z),dialog:Y});function _(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ee(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return w.data.height-k.value-a}}function te(e){switch(e){case"top":return 0;case"center":return ee("top");default:return ee("top")+ee("center")}}function ae(e){const{scaleValues:t}=w.data,a=t.find((t=>t.type===e));return J.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await n(),v(y,$,x,j);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=f(y,$,x,j,C);h(y,$,x,j,a,r,i,l);const{clickMenu:d}=g(y,$,x,j,C,a,o,u,s);S.value=e,D.value=e=>{const{item:a}=e;a.type&&m.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:$,redrawPoints:S,select:H,clickMenu:D}}export{y as useSurgicalAnesthesiaChart};