cnhis-design-vue 3.2.3-beta.6 → 3.2.3-beta.8

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 (247) hide show
  1. package/README.md +87 -87
  2. package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
  3. package/es/components/calendar/index.d.ts +2 -11
  4. package/es/components/calendar/src/Calendar.vue.d.ts +1 -11
  5. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  6. package/es/components/classification/src/index.vue.d.ts +3 -3
  7. package/es/components/fabric-chart/index.d.ts +123 -22
  8. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +115 -26
  9. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  10. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  11. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +79 -19
  12. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +1 -1
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -1
  17. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  20. package/es/components/fabric-chart/src/interface.d.ts +3 -0
  21. package/es/components/fabric-chart/style/index.css +1 -1
  22. package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
  23. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  24. package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
  25. package/es/components/index.css +1 -1
  26. package/es/components/node_modules/naive-ui/node_modules/date-fns/docs/logo.svg +26 -0
  27. package/es/components/node_modules/naive-ui/node_modules/date-fns/docs/logotype.svg +1 -0
  28. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  29. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  30. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  31. package/es/env.d.ts +25 -25
  32. package/es/shared/assets/img/emoji/emotion_001.png.js +1 -1
  33. package/es/shared/assets/img/emoji/emotion_002.png.js +1 -1
  34. package/es/shared/assets/img/emoji/emotion_003.png.js +1 -1
  35. package/es/shared/assets/img/emoji/emotion_004.png.js +1 -1
  36. package/es/shared/assets/img/emoji/emotion_005.png.js +1 -1
  37. package/es/shared/assets/img/emoji/emotion_006.png.js +1 -1
  38. package/es/shared/assets/img/emoji/emotion_007.png.js +1 -1
  39. package/es/shared/assets/img/emoji/emotion_008.png.js +1 -1
  40. package/es/shared/assets/img/emoji/emotion_009.png.js +1 -1
  41. package/es/shared/assets/img/emoji/emotion_010.png.js +1 -1
  42. package/es/shared/assets/img/emoji/emotion_011.png.js +1 -1
  43. package/es/shared/assets/img/emoji/emotion_012.png.js +1 -1
  44. package/es/shared/assets/img/emoji/emotion_013.png.js +1 -1
  45. package/es/shared/assets/img/emoji/emotion_014.png.js +1 -1
  46. package/es/shared/assets/img/emoji/emotion_015.png.js +1 -1
  47. package/es/shared/assets/img/emoji/emotion_016.png.js +1 -1
  48. package/es/shared/assets/img/emoji/emotion_017.png.js +1 -1
  49. package/es/shared/assets/img/emoji/emotion_018.png.js +1 -1
  50. package/es/shared/assets/img/emoji/emotion_019.png.js +1 -1
  51. package/es/shared/assets/img/emoji/emotion_020.png.js +1 -1
  52. package/es/shared/assets/img/emoji/emotion_021.png.js +1 -1
  53. package/es/shared/assets/img/emoji/emotion_022.png.js +1 -1
  54. package/es/shared/assets/img/emoji/emotion_023.png.js +1 -1
  55. package/es/shared/assets/img/emoji/emotion_024.png.js +1 -1
  56. package/es/shared/assets/img/emoji/emotion_025.png.js +1 -1
  57. package/es/shared/assets/img/emoji/emotion_026.png.js +1 -1
  58. package/es/shared/assets/img/emoji/emotion_027.png.js +1 -1
  59. package/es/shared/assets/img/emoji/emotion_028.png.js +1 -1
  60. package/es/shared/assets/img/emoji/emotion_029.png.js +1 -1
  61. package/es/shared/assets/img/emoji/emotion_030.png.js +1 -1
  62. package/es/shared/assets/img/emoji/emotion_031.png.js +1 -1
  63. package/es/shared/assets/img/emoji/emotion_032.png.js +1 -1
  64. package/es/shared/assets/img/emoji/emotion_033.png.js +1 -1
  65. package/es/shared/assets/img/emoji/emotion_034.png.js +1 -1
  66. package/es/shared/assets/img/emoji/emotion_035.png.js +1 -1
  67. package/es/shared/assets/img/emoji/emotion_036.png.js +1 -1
  68. package/es/shared/assets/img/emoji/emotion_037.png.js +1 -1
  69. package/es/shared/assets/img/emoji/emotion_038.png.js +1 -1
  70. package/es/shared/assets/img/emoji/emotion_039.png.js +1 -1
  71. package/es/shared/assets/img/emoji/emotion_040.png.js +1 -1
  72. package/es/shared/assets/img/emoji/emotion_041.png.js +1 -1
  73. package/es/shared/assets/img/emoji/emotion_042.png.js +1 -1
  74. package/es/shared/assets/img/emoji/emotion_043.png.js +1 -1
  75. package/es/shared/assets/img/emoji/emotion_044.png.js +1 -1
  76. package/es/shared/assets/img/emoji/emotion_045.png.js +1 -1
  77. package/es/shared/assets/img/emoji/emotion_046.png.js +1 -1
  78. package/es/shared/assets/img/emoji/emotion_047.png.js +1 -1
  79. package/es/shared/assets/img/emoji/emotion_048.png.js +1 -1
  80. package/es/shared/assets/img/emoji/emotion_049.png.js +1 -1
  81. package/es/shared/assets/img/emoji/emotion_050.png.js +1 -1
  82. package/es/shared/assets/img/emoji/emotion_051.png.js +1 -1
  83. package/es/shared/assets/img/emoji/emotion_052.png.js +1 -1
  84. package/es/shared/assets/img/emoji/emotion_053.png.js +1 -1
  85. package/es/shared/assets/img/emoji/emotion_054.png.js +1 -1
  86. package/es/shared/assets/img/emoji/emotion_055.png.js +1 -1
  87. package/es/shared/assets/img/emoji/emotion_056.png.js +1 -1
  88. package/es/shared/assets/img/emoji/emotion_057.png.js +1 -1
  89. package/es/shared/assets/img/emoji/emotion_058.png.js +1 -1
  90. package/es/shared/assets/img/emoji/emotion_059.png.js +1 -1
  91. package/es/shared/assets/img/emoji/emotion_060.png.js +1 -1
  92. package/es/shared/assets/img/emoji/emotion_061.png.js +1 -1
  93. package/es/shared/assets/img/emoji/emotion_062.png.js +1 -1
  94. package/es/shared/assets/img/emoji/emotion_063.png.js +1 -1
  95. package/es/shared/assets/img/emoji/emotion_064.png.js +1 -1
  96. package/es/shared/assets/img/emoji/emotion_065.png.js +1 -1
  97. package/es/shared/assets/img/emoji/emotion_066.png.js +1 -1
  98. package/es/shared/assets/img/emoji/emotion_067.png.js +1 -1
  99. package/es/shared/assets/img/emoji/emotion_068.png.js +1 -1
  100. package/es/shared/assets/img/emoji/emotion_069.png.js +1 -1
  101. package/es/shared/assets/img/emoji/emotion_070.png.js +1 -1
  102. package/es/shared/assets/img/emoji/emotion_071.png.js +1 -1
  103. package/es/shared/assets/img/emoji/emotion_072.png.js +1 -1
  104. package/es/shared/assets/img/emoji/emotion_073.png.js +1 -1
  105. package/es/shared/assets/img/emoji/emotion_074.png.js +1 -1
  106. package/es/shared/assets/img/emoji/emotion_075.png.js +1 -1
  107. package/es/shared/assets/img/emoji/emotion_076.png.js +1 -1
  108. package/es/shared/assets/img/emoji/emotion_077.png.js +1 -1
  109. package/es/shared/assets/img/emoji/emotion_078.png.js +1 -1
  110. package/es/shared/assets/img/emoji/emotion_079.png.js +1 -1
  111. package/es/shared/assets/img/emoji/emotion_080.png.js +1 -1
  112. package/es/shared/assets/img/emoji/emotion_081.png.js +1 -1
  113. package/es/shared/assets/img/emoji/emotion_082.png.js +1 -1
  114. package/es/shared/assets/img/emoji/emotion_083.png.js +1 -1
  115. package/es/shared/assets/img/emoji/emotion_084.png.js +1 -1
  116. package/es/shared/assets/img/emoji/emotion_085.png.js +1 -1
  117. package/es/shared/assets/img/emoji/emotion_086.png.js +1 -1
  118. package/es/shared/assets/img/emoji/emotion_087.png.js +1 -1
  119. package/es/shared/assets/img/emoji/emotion_088.png.js +1 -1
  120. package/es/shared/assets/img/emoji/emotion_089.png.js +1 -1
  121. package/es/shared/assets/img/emoji/emotion_090.png.js +1 -1
  122. package/es/shared/assets/img/emoji/emotion_091.png.js +1 -1
  123. package/es/shared/assets/img/emoji/emotion_092.png.js +1 -1
  124. package/es/shared/assets/img/emoji/emotion_093.png.js +1 -1
  125. package/es/shared/assets/img/emoji/emotion_094.png.js +1 -1
  126. package/es/shared/assets/img/emoji/emotion_095.png.js +1 -1
  127. package/es/shared/assets/img/emoji/emotion_096.png.js +1 -1
  128. package/es/shared/assets/img/emoji/emotion_097.png.js +1 -1
  129. package/es/shared/assets/img/emoji/emotion_098.png.js +1 -1
  130. package/es/shared/assets/img/emoji/emotion_099.png.js +1 -1
  131. package/es/shared/assets/img/emoji/emotion_100.png.js +1 -1
  132. package/es/shared/assets/img/emoji/emotion_101.png.js +1 -1
  133. package/es/shared/assets/img/emoji/emotion_102.png.js +1 -1
  134. package/es/shared/assets/img/emoji/emotion_103.png.js +1 -1
  135. package/es/shared/assets/img/emoji/emotion_104.png.js +1 -1
  136. package/es/shared/assets/img/emoji/emotion_105.png.js +1 -1
  137. package/es/shared/assets/img/emoji/emotion_106.png.js +1 -1
  138. package/es/shared/assets/img/emoji/emotion_107.png.js +1 -1
  139. package/es/shared/assets/img/emoji/emotion_108.png.js +1 -1
  140. package/es/shared/assets/img/emoji/emotion_109.png.js +1 -1
  141. package/es/shared/assets/img/emoji/emotion_110.png.js +1 -1
  142. package/es/shared/assets/img/emoji/emotion_111.png.js +1 -1
  143. package/es/shared/assets/img/emoji/emotion_112.png.js +1 -1
  144. package/es/shared/assets/img/emoji/emotion_113.png.js +1 -1
  145. package/es/shared/assets/img/emoji/emotion_114.png.js +1 -1
  146. package/es/shared/assets/img/emoji/emotion_115.png.js +1 -1
  147. package/es/shared/assets/img/emoji/emotion_116.png.js +1 -1
  148. package/es/shared/assets/img/emoji/emotion_117.png.js +1 -1
  149. package/es/shared/assets/img/emoji/emotion_118.png.js +1 -1
  150. package/es/shared/assets/img/emoji/emotion_119.png.js +1 -1
  151. package/es/shared/assets/img/emoji/emotion_120.png.js +1 -1
  152. package/es/shared/assets/img/emoji/emotion_121.png.js +1 -1
  153. package/es/shared/assets/img/emoji/emotion_122.png.js +1 -1
  154. package/es/shared/assets/img/emoji/emotion_123.png.js +1 -1
  155. package/es/shared/assets/img/emoji/emotion_124.png.js +1 -1
  156. package/es/shared/assets/img/emoji/emotion_125.png.js +1 -1
  157. package/es/shared/assets/img/emoji/emotion_126.png.js +1 -1
  158. package/es/shared/assets/img/emoji/emotion_127.png.js +1 -1
  159. package/es/shared/assets/img/emoji/emotion_128.png.js +1 -1
  160. package/es/shared/assets/img/emoji/emotion_129.png.js +1 -1
  161. package/es/shared/assets/img/emoji/emotion_130.png.js +1 -1
  162. package/es/shared/assets/img/emoji/emotion_131.png.js +1 -1
  163. package/es/shared/assets/img/emoji/emotion_132.png.js +1 -1
  164. package/es/shared/assets/img/emoji/emotion_133.png.js +1 -1
  165. package/es/shared/assets/img/emoji/emotion_134.png.js +1 -1
  166. package/es/shared/assets/img/emoji/emotion_135.png.js +1 -1
  167. package/es/shared/assets/img/emoji/emotion_136.png.js +1 -1
  168. package/es/shared/assets/img/emoji/emotion_137.png.js +1 -1
  169. package/es/shared/assets/img/emoji/emotion_138.png.js +1 -1
  170. package/es/shared/assets/img/emoji/emotion_139.png.js +1 -1
  171. package/es/shared/assets/img/emoji/emotion_140.png.js +1 -1
  172. package/es/shared/assets/img/emoji/emotion_141.png.js +1 -1
  173. package/es/shared/assets/img/emoji/emotion_142.png.js +1 -1
  174. package/es/shared/assets/img/emoji/emotion_143.png.js +1 -1
  175. package/es/shared/assets/img/emoji/emotion_144.png.js +1 -1
  176. package/es/shared/assets/img/emoji/emotion_145.png.js +1 -1
  177. package/es/shared/assets/img/emoji/emotion_146.png.js +1 -1
  178. package/es/shared/assets/img/emoji/emotion_147.png.js +1 -1
  179. package/es/shared/assets/img/emoji/emotion_148.png.js +1 -1
  180. package/es/shared/assets/img/emoji/emotion_149.png.js +1 -1
  181. package/es/shared/assets/img/emoji/emotion_150.png.js +1 -1
  182. package/es/shared/assets/img/emoji/emotion_151.png.js +1 -1
  183. package/es/shared/assets/img/emoji/emotion_152.png.js +1 -1
  184. package/es/shared/assets/img/emoji/emotion_153.png.js +1 -1
  185. package/es/shared/assets/img/emoji/emotion_154.png.js +1 -1
  186. package/es/shared/assets/img/emoji/emotion_155.png.js +1 -1
  187. package/es/shared/assets/img/emoji/emotion_156.png.js +1 -1
  188. package/es/shared/assets/img/emoji/emotion_157.png.js +1 -1
  189. package/es/shared/assets/img/emoji/emotion_158.png.js +1 -1
  190. package/es/shared/assets/img/emoji/emotion_159.png.js +1 -1
  191. package/es/shared/assets/img/emoji/emotion_160.png.js +1 -1
  192. package/es/shared/assets/img/emoji/emotion_161.png.js +1 -1
  193. package/es/shared/assets/img/emoji/emotion_162.png.js +1 -1
  194. package/es/shared/assets/img/emoji/emotion_163.png.js +1 -1
  195. package/es/shared/assets/img/emoji/emotion_164.png.js +1 -1
  196. package/es/shared/assets/img/emoji/emotion_165.png.js +1 -1
  197. package/es/shared/assets/img/emoji/emotion_166.png.js +1 -1
  198. package/es/shared/assets/img/emoji/emotion_167.png.js +1 -1
  199. package/es/shared/assets/img/emoji/emotion_168.png.js +1 -1
  200. package/es/shared/assets/img/emoji/emotion_169.png.js +1 -1
  201. package/es/shared/assets/img/emoji/emotion_170.png.js +1 -1
  202. package/es/shared/assets/img/emoji/emotion_171.png.js +1 -1
  203. package/es/shared/assets/img/emoji/emotion_172.png.js +1 -1
  204. package/es/shared/assets/img/emoji/emotion_173.png.js +1 -1
  205. package/es/shared/assets/img/emoji/emotion_174.png.js +1 -1
  206. package/es/shared/assets/img/emoji/emotion_175.png.js +1 -1
  207. package/es/shared/assets/img/emoji/emotion_176.png.js +1 -1
  208. package/es/shared/assets/img/emoji/emotion_177.png.js +1 -1
  209. package/es/shared/assets/img/emoji/emotion_178.png.js +1 -1
  210. package/es/shared/assets/img/emoji/emotion_179.png.js +1 -1
  211. package/es/shared/assets/img/emoji/emotion_180.png.js +1 -1
  212. package/es/shared/assets/img/emoji/emotion_181.png.js +1 -1
  213. package/es/shared/assets/img/emoji/emotion_182.png.js +1 -1
  214. package/es/shared/assets/img/emoji/emotion_183.png.js +1 -1
  215. package/es/shared/assets/img/emoji/emotion_184.png.js +1 -1
  216. package/es/shared/assets/img/emoji/emotion_185.png.js +1 -1
  217. package/es/shared/assets/img/emoji/emotion_186.png.js +1 -1
  218. package/es/shared/assets/img/emoji/emotion_187.png.js +1 -1
  219. package/es/shared/assets/img/emoji/emotion_188.png.js +1 -1
  220. package/es/shared/assets/img/emoji/emotion_189.png.js +1 -1
  221. package/es/shared/assets/img/emoji/emotion_190.png.js +1 -1
  222. package/es/shared/assets/img/emoji/emotion_191.png.js +1 -1
  223. package/es/shared/assets/img/emoji/emotion_192.png.js +1 -1
  224. package/es/shared/assets/img/emoji/emotion_193.png.js +1 -1
  225. package/es/shared/assets/img/emoji/emotion_194.png.js +1 -1
  226. package/es/shared/assets/img/emoji/emotion_195.png.js +1 -1
  227. package/es/shared/assets/img/emoji/emotion_196.png.js +1 -1
  228. package/es/shared/assets/img/failure.png.js +1 -1
  229. package/es/shared/assets/img/no-permission.png.js +1 -1
  230. package/es/shared/assets/img/nodata.png.js +1 -1
  231. package/es/shared/assets/img/notfound.png.js +1 -1
  232. package/es/shared/assets/img/qr.png.js +1 -1
  233. package/es/shared/assets/img/success.png.js +1 -1
  234. package/es/shared/assets/img/table_style_2.png.js +1 -1
  235. package/es/shared/assets/img/video.png.js +1 -1
  236. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  237. package/es/shared/assets/img/xb_big.png.js +1 -1
  238. package/es/shared/assets/img/xb_small.png.js +1 -1
  239. package/es/shared/package.json.js +1 -1
  240. package/package.json +2 -2
  241. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  242. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  243. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  244. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  245. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  246. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  247. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1,5 +1,5 @@
1
- import { type PropType } from 'vue';
2
- import { IType } from './interface';
1
+ import { type PropType, VNode } from 'vue';
2
+ import { IType, ICoordinateValue } from './interface';
3
3
  import { AnyObject } from '../../../shared/types';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  type: {
@@ -10,8 +10,15 @@ declare const _default: import("vue").DefineComponent<{
10
10
  type: PropType<AnyObject>;
11
11
  required: true;
12
12
  };
13
+ popupTipRender: {
14
+ type: PropType<(params: {
15
+ isTarget: boolean;
16
+ pointer: ICoordinateValue;
17
+ data: AnyObject[] | undefined;
18
+ }) => VNode>;
19
+ };
13
20
  addRenderItem: {
14
- type: FunctionConstructor;
21
+ type: PropType<() => VNode>;
15
22
  };
16
23
  }, {
17
24
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -23,8 +30,15 @@ declare const _default: import("vue").DefineComponent<{
23
30
  type: PropType<AnyObject>;
24
31
  required: true;
25
32
  };
33
+ popupTipRender: {
34
+ type: PropType<(params: {
35
+ isTarget: boolean;
36
+ pointer: ICoordinateValue;
37
+ data: AnyObject[] | undefined;
38
+ }) => VNode>;
39
+ };
26
40
  addRenderItem: {
27
- type: FunctionConstructor;
41
+ type: PropType<() => VNode>;
28
42
  };
29
43
  }>> & {
30
44
  onChange?: ((...args: any[]) => any) | undefined;
@@ -45,6 +59,9 @@ declare const _default: import("vue").DefineComponent<{
45
59
  y: number;
46
60
  };
47
61
  list: string[];
62
+ movable: boolean;
63
+ sourceData: AnyObject[];
64
+ isTarget: boolean;
48
65
  };
49
66
  pointMenuProps: {
50
67
  show: boolean;
@@ -73,29 +90,73 @@ declare const _default: import("vue").DefineComponent<{
73
90
  PopupTip: import("vue").DefineComponent<{
74
91
  show: {
75
92
  type: BooleanConstructor;
76
- required: true;
77
93
  default: boolean;
78
94
  };
79
95
  point: {
80
- type: null;
96
+ type: PropType<ICoordinateValue>;
81
97
  required: true;
82
98
  };
83
99
  list: {
84
- type: ArrayConstructor;
85
- required: false;
100
+ type: PropType<string[]>;
86
101
  default: () => never[];
87
102
  };
88
103
  propItems: {
89
- type: null;
90
- required: true;
104
+ type: PropType<AnyObject>;
91
105
  };
92
- }, {
93
- props: {
94
- show: boolean;
95
- point: import("./interface").ICoordinateValue;
96
- list: string[];
97
- propItems: AnyObject;
106
+ popupTipRender: {
107
+ type: PropType<(params: {
108
+ isTarget: boolean;
109
+ pointer: ICoordinateValue;
110
+ data: AnyObject[] | undefined;
111
+ }) => VNode<import("vue").RendererNode, import("vue").RendererElement, {
112
+ [key: string]: any;
113
+ }>>;
98
114
  };
115
+ movable: {
116
+ type: BooleanConstructor;
117
+ };
118
+ sourceData: {
119
+ type: PropType<AnyObject[]>;
120
+ };
121
+ isTarget: {
122
+ type: BooleanConstructor;
123
+ };
124
+ }, {
125
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
126
+ show: {
127
+ type: BooleanConstructor;
128
+ default: boolean;
129
+ };
130
+ point: {
131
+ type: PropType<ICoordinateValue>;
132
+ required: true;
133
+ };
134
+ list: {
135
+ type: PropType<string[]>;
136
+ default: () => never[];
137
+ };
138
+ propItems: {
139
+ type: PropType<AnyObject>;
140
+ };
141
+ popupTipRender: {
142
+ type: PropType<(params: {
143
+ isTarget: boolean;
144
+ pointer: ICoordinateValue;
145
+ data: AnyObject[] | undefined;
146
+ }) => VNode<import("vue").RendererNode, import("vue").RendererElement, {
147
+ [key: string]: any;
148
+ }>>;
149
+ };
150
+ movable: {
151
+ type: BooleanConstructor;
152
+ };
153
+ sourceData: {
154
+ type: PropType<AnyObject[]>;
155
+ };
156
+ isTarget: {
157
+ type: BooleanConstructor;
158
+ };
159
+ }>> & {}>>;
99
160
  pointStyle: import("vue").ComputedRef<{
100
161
  top: string;
101
162
  bottom: string;
@@ -103,27 +164,48 @@ declare const _default: import("vue").DefineComponent<{
103
164
  right: string;
104
165
  'transform-origin': string;
105
166
  }>;
167
+ customRender: () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
168
+ [key: string]: any;
169
+ }> | undefined;
106
170
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
107
171
  show: {
108
172
  type: BooleanConstructor;
109
- required: true;
110
173
  default: boolean;
111
174
  };
112
175
  point: {
113
- type: null;
176
+ type: PropType<ICoordinateValue>;
114
177
  required: true;
115
178
  };
116
179
  list: {
117
- type: ArrayConstructor;
118
- required: false;
180
+ type: PropType<string[]>;
119
181
  default: () => never[];
120
182
  };
121
183
  propItems: {
122
- type: null;
123
- required: true;
184
+ type: PropType<AnyObject>;
185
+ };
186
+ popupTipRender: {
187
+ type: PropType<(params: {
188
+ isTarget: boolean;
189
+ pointer: ICoordinateValue;
190
+ data: AnyObject[] | undefined;
191
+ }) => VNode<import("vue").RendererNode, import("vue").RendererElement, {
192
+ [key: string]: any;
193
+ }>>;
194
+ };
195
+ movable: {
196
+ type: BooleanConstructor;
197
+ };
198
+ sourceData: {
199
+ type: PropType<AnyObject[]>;
200
+ };
201
+ isTarget: {
202
+ type: BooleanConstructor;
124
203
  };
125
204
  }>>, {
126
- list: unknown[];
205
+ show: boolean;
206
+ list: string[];
207
+ movable: boolean;
208
+ isTarget: boolean;
127
209
  }>;
128
210
  PopupMenu: import("vue").DefineComponent<{
129
211
  show: {
@@ -135,7 +217,7 @@ declare const _default: import("vue").DefineComponent<{
135
217
  default: () => never[];
136
218
  };
137
219
  point: {
138
- type: PropType<import("./interface").ICoordinateValue>;
220
+ type: PropType<ICoordinateValue>;
139
221
  };
140
222
  propItems: {
141
223
  type: PropType<import("./interface").IPropItems>;
@@ -153,7 +235,7 @@ declare const _default: import("vue").DefineComponent<{
153
235
  default: () => never[];
154
236
  };
155
237
  point: {
156
- type: PropType<import("./interface").ICoordinateValue>;
238
+ type: PropType<ICoordinateValue>;
157
239
  };
158
240
  propItems: {
159
241
  type: PropType<import("./interface").IPropItems>;
@@ -177,8 +259,15 @@ declare const _default: import("vue").DefineComponent<{
177
259
  type: PropType<AnyObject>;
178
260
  required: true;
179
261
  };
262
+ popupTipRender: {
263
+ type: PropType<(params: {
264
+ isTarget: boolean;
265
+ pointer: ICoordinateValue;
266
+ data: AnyObject[] | undefined;
267
+ }) => VNode>;
268
+ };
180
269
  addRenderItem: {
181
- type: FunctionConstructor;
270
+ type: PropType<() => VNode>;
182
271
  };
183
272
  }>> & {
184
273
  onChange?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,reactive as t,computed as s,onMounted as o,onBeforeUnmount as a,openBlock as i,createElementBlock as l,normalizeStyle as n,unref as u,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as m,createCommentVNode as d}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import w from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as g}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as j}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";import{useNewBirthProcessChart as y}from"./hooks/newBirthProcess/useNewBirthProcessChart.js";var P=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid","eventClick"],setup(e,{expose:P,emit:x}){const I=e,b=r(null),M=r(),R=t({show:!1,point:{x:0,y:0},list:[]}),B=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=s((()=>{var e;return null==(e=M.value)?void 0:e.wrapperEl})),E=s((()=>({width:`${I.data.width||800}px`,height:`${I.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:D,getGridInfo:H}=function(){const e=[M,I,x,b,R,B];switch(I.type){case"birthProcess":return g(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return j(...e);case"newBirthProcess":return y(...e);default:return C(...e)}}();return o((()=>{M.value=new f.Canvas(b.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,s;null==(r=null==(e=M.value)?void 0:e.off)||r.call(e),null==(s=null==(t=M.value)?void 0:t.clear)||s.call(t)})),P({redrawPoints:T,select:_,canvas:M,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:D,getGridInfo:H}),(e,r)=>(i(),l("div",{class:"c-fabric-chart",style:n(u(E))},[p("canvas",{ref_key:"canvasRef",ref:b},null,512),u(A)?(i(),l(c,{key:0},[h(v,m({propItems:u(S)},R),null,16,["propItems"]),h(u(w),m({propItems:u(S)},B,{show:B.show,"onUpdate:show":r[0]||(r[0]=e=>B.show=e),onClickMenu:u(F)}),null,16,["propItems","show","onClickMenu"])],64)):d("v-if",!0)],4))}});export{P as default};
1
+ import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as p,normalizeStyle as l,unref as n,createElementVNode as u,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import g from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as w}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as y}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";import{useNewBirthProcessChart as j}from"./hooks/newBirthProcess/useNewBirthProcessChart.js";var P=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},popupTipRender:{type:Function},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid","eventClick"],setup(e,{expose:P,emit:R}){const b=e,x=r(null),I=r(),T=t({show:!1,point:{x:0,y:0},list:[],movable:!1,sourceData:[],isTarget:!1}),M=t({show:!1,point:{x:0,y:0},list:[],target:null}),B=o((()=>{var e;return null==(e=I.value)?void 0:e.wrapperEl})),A=o((()=>({width:`${b.data.width||800}px`,height:`${b.data.height||500}px`}))),{propItems:E,redrawPoints:F,select:S,clickMenu:_,useMeasureRuler:D,useCaliper:G,useCaliperRuler:$,updatePolyline:q,getGridInfo:H}=function(){const e=[I,b,R,x,T,M];switch(b.type){case"birthProcess":return w(...e);case"surgicalAnesthesia":return k(...e,!!b.popupTipRender);case"electrocardiogram":return y(...e);case"newBirthProcess":return j(...e);default:return C(...e)}}();return s((()=>{I.value=new f.Canvas(x.value,{width:E.canvasWidth,height:E.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=I.value)?void 0:e.off)||r.call(e),null==(o=null==(t=I.value)?void 0:t.clear)||o.call(t)})),P({redrawPoints:F,select:S,canvas:I,useMeasureRuler:D,useCaliper:G,useCaliperRuler:$,updatePolyline:q,getGridInfo:H}),(r,t)=>(i(),p("div",{class:"c-fabric-chart",style:l(n(A))},[u("canvas",{ref_key:"canvasRef",ref:x},null,512),n(B)?(i(),p(c,{key:0},[h(v,d({popupTipRender:e.popupTipRender,...T},{propItems:n(E)}),null,16,["propItems"]),h(n(g),d({propItems:n(E)},M,{show:M.show,"onUpdate:show":t[0]||(t[0]=e=>M.show=e),onClickMenu:n(_)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{P as default};
@@ -1 +1 @@
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
+ import{defineComponent as e,ref as t,watch as l,withDirectives as o,createVNode as a,vShow as r}from"vue";import{NSpace as s,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(s,{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 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))]),[[r,e.show]])}});export{c as default};
@@ -1,31 +1,72 @@
1
+ import { PropType, VNode } from 'vue';
1
2
  import { ICoordinateValue } from '../interface';
2
3
  import { AnyObject } from '../../../../shared/types';
3
4
  declare const _default: import("vue").DefineComponent<{
4
5
  show: {
5
6
  type: BooleanConstructor;
6
- required: true;
7
7
  default: boolean;
8
8
  };
9
9
  point: {
10
- type: null;
10
+ type: PropType<ICoordinateValue>;
11
11
  required: true;
12
12
  };
13
13
  list: {
14
- type: ArrayConstructor;
15
- required: false;
14
+ type: PropType<string[]>;
16
15
  default: () => never[];
17
16
  };
18
17
  propItems: {
19
- type: null;
20
- required: true;
18
+ type: PropType<AnyObject>;
21
19
  };
22
- }, {
23
- props: {
24
- show: boolean;
25
- point: ICoordinateValue;
26
- list: Array<string>;
27
- propItems: AnyObject;
20
+ popupTipRender: {
21
+ type: PropType<(params: {
22
+ isTarget: boolean;
23
+ pointer: ICoordinateValue;
24
+ data: AnyObject[] | undefined;
25
+ }) => VNode>;
26
+ };
27
+ movable: {
28
+ type: BooleanConstructor;
28
29
  };
30
+ sourceData: {
31
+ type: PropType<AnyObject[]>;
32
+ };
33
+ isTarget: {
34
+ type: BooleanConstructor;
35
+ };
36
+ }, {
37
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
38
+ show: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ point: {
43
+ type: PropType<ICoordinateValue>;
44
+ required: true;
45
+ };
46
+ list: {
47
+ type: PropType<string[]>;
48
+ default: () => never[];
49
+ };
50
+ propItems: {
51
+ type: PropType<AnyObject>;
52
+ };
53
+ popupTipRender: {
54
+ type: PropType<(params: {
55
+ isTarget: boolean;
56
+ pointer: ICoordinateValue;
57
+ data: AnyObject[] | undefined;
58
+ }) => VNode>;
59
+ };
60
+ movable: {
61
+ type: BooleanConstructor;
62
+ };
63
+ sourceData: {
64
+ type: PropType<AnyObject[]>;
65
+ };
66
+ isTarget: {
67
+ type: BooleanConstructor;
68
+ };
69
+ }>> & {}>>;
29
70
  pointStyle: import("vue").ComputedRef<{
30
71
  top: string;
31
72
  bottom: string;
@@ -33,26 +74,45 @@ declare const _default: import("vue").DefineComponent<{
33
74
  right: string;
34
75
  'transform-origin': string;
35
76
  }>;
77
+ customRender: () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
78
+ [key: string]: any;
79
+ }> | undefined;
36
80
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
37
81
  show: {
38
82
  type: BooleanConstructor;
39
- required: true;
40
83
  default: boolean;
41
84
  };
42
85
  point: {
43
- type: null;
86
+ type: PropType<ICoordinateValue>;
44
87
  required: true;
45
88
  };
46
89
  list: {
47
- type: ArrayConstructor;
48
- required: false;
90
+ type: PropType<string[]>;
49
91
  default: () => never[];
50
92
  };
51
93
  propItems: {
52
- type: null;
53
- required: true;
94
+ type: PropType<AnyObject>;
95
+ };
96
+ popupTipRender: {
97
+ type: PropType<(params: {
98
+ isTarget: boolean;
99
+ pointer: ICoordinateValue;
100
+ data: AnyObject[] | undefined;
101
+ }) => VNode>;
102
+ };
103
+ movable: {
104
+ type: BooleanConstructor;
105
+ };
106
+ sourceData: {
107
+ type: PropType<AnyObject[]>;
108
+ };
109
+ isTarget: {
110
+ type: BooleanConstructor;
54
111
  };
55
112
  }>>, {
56
- list: unknown[];
113
+ show: boolean;
114
+ list: string[];
115
+ movable: boolean;
116
+ isTarget: boolean;
57
117
  }>;
58
118
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as t,withDirectives as l,openBlock as p,createElementBlock as e,normalizeStyle as o,unref as s,Fragment as u,renderList as r,toDisplayString as a,vShow as i}from"vue";import n from"./useStyle.js";var f=t({__name:"PopupTip",props:{show:{type:Boolean,default:!1},point:null,list:{default:()=>[]},propItems:null},setup(t){const f=n(t);return(n,m)=>l((p(),e("ul",{class:"c-fabric-chart-popup-tip",style:o(s(f))},[(p(!0),e(u,null,r(t.list,(t=>(p(),e("li",{key:t},a(t),1)))),128))],4)),[[i,t.show]])}});export{f as default};
1
+ import{defineComponent as e,withDirectives as p,openBlock as t,createElementBlock as o,normalizeStyle as r,unref as a,Fragment as i,renderList as l,toDisplayString as s,createBlock as u,resolveDynamicComponent as n,vShow as c}from"vue";import y from"./useStyle.js";const d={key:0,class:"default-box"};var f=e({__name:"PopupTip",props:{show:{type:Boolean,default:!1},point:{type:Object,required:!0},list:{type:Array,default:()=>[]},propItems:{type:Object},popupTipRender:{type:Function},movable:{type:Boolean},sourceData:{type:Array},isTarget:{type:Boolean}},setup(e){const f=e,m=y(f);return(y,T)=>{return p((t(),o("div",{class:"c-fabric-chart-popup c-fabric-chart-popup__tip",style:r(a(m))},[e.popupTipRender?(t(),u(n(null==(b=f.popupTipRender)?void 0:b.call(f,{isTarget:f.isTarget,pointer:f.point,data:f.sourceData})),{key:1})):(t(),o("ul",d,[(t(!0),o(i,null,l(e.list,(e=>(t(),o("li",{key:e},s(e),1)))),128))]))],4)),[[c,e.show]]);var b}}});export{f as default};
@@ -2,7 +2,7 @@ import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
4
  import { IObject, IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
- export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
5
+ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps, isPopupTipRender: boolean): {
6
6
  redrawPoints: (ItemObj?: AnyObject) => void;
7
7
  clickMenu: ({ item, target }: {
8
8
  item: any;
@@ -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,last as m,omit as v,flatten as g}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as y}from"@vueuse/core";function h(h,k,x,L,P){const{computedX:w,computedY:b,getXValue:A,getYValue:I}=r(k),{xCellWidth:C,pointSelectionStyle:K,originX:j,endX:E,originY:X,endY:V,event:T,scaleValues:M,xAxis:S,startTime:Y,timeXCell:$,itemList:F,dialog:O}=k,D=new Map,_=new Set,z=p(M);let N=[],G=null;const J=new Set;l(h,k);const{getEqualXTypes:q,handleAddPrevent:R,setPrevAndNextPoint:W,getPointEventProps:B}=s(h,x,k),{pause:H,resume:Q}=y((()=>{!function(){if(!J.size)return;for(const e of J)e.set("opacity",1===e.opacity?.5:1);h.value.renderAll()}()}),800);function U(){z.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([j,r,E,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});T.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{L.point={...e||{x:a.left,y:a.top}},L.list=[`${o} ${n}${t.unit||""}`],L.show=!0})),a.on("mouseout",(()=>{L.show=!1}))),h.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ne(t,n,e))}))}))}function Z(e=[]){if(!(null==G?void 0:G.areaPos))return[];const{startPos:t,endPos:n}=G.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:ue()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ee(e){O.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),te()},onNegativeClick:()=>te(),onClose:()=>te()})}function te(){G&&h.value.remove(G),G=null}function ne(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];D.set(e.key,[]),function(e,t){J.size&&[...J].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&J.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,g,y=u;l.key&&(y=s.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:w="",key:b,type:K="circle"}=y,j=ce(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(g=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:w,key:u.key,selfKey:b,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:g,...k,...B()};e&&(E||(X.leftLine=null),p=o(K,{left:e[0],top:e[1],...X}));f.push(g),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){T.hovered&&(e.on("mouseover",(()=>{se(e,"hover")})),e.on("mouseout",(()=>{L.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{fe(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),T.hovered&&se(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/C);if(a>l+C){if(0===N.length){oe(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+C*c;if(N.every((e=>e.left!==u))){const t=A(u),n=I(f.type,s);N.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),oe(e,[...e.prevPointer,u,s])}if(N.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+C*l,r=N.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=N.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=N[l-1]||{left:n,top:i},f=~~((r.left-(t-C))/C),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:A(t),value:I(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},N.splice(l,0,a),oe(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=D.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=C/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?ie(e,"#999"):ie(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(N.length>0&&i<N[N.length-1].left){for(const e of _)e.left>i&&(e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e));if(N=N.filter((e=>e.left<=i)),0===N.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of _)e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e)}if(N.length>0){const t=m(N);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(L.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:I(t,e.top)}};if(h.value.discardActiveObject(),N.length>0){const l=z.find((e=>e.type===t));let r=-1;const a=N.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void re({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({...m(a),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));x("add",{...v(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),le({...o,data:a,coincideIndex:r})}else x("change",{...v(o,["selfKey","lineAttr"]),key:n}),le(o,"change")}}))}(p),null==(d=D.get(u.key))||d.push(p))}(ce(l,n),l,c,e)})),Promise.all(D.get(e.key)).then((t=>{const n=f.filter((e=>e));W(t),h.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||J.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function ie(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 oe(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,_.add(l),h.value.add(r,l)}))}function le(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=z.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}}re({dataIndex:s,scaleValue:f})}function re(e){var t,n,i;if(_.size&&(null==(t=h.value)||t.remove(...ae([..._]))),_.clear(),N=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=h.value)||n.remove(...ae(D.get(o.key))),D.delete(o.key),ne(o,t,i)}else D.size&&(null==(i=h.value)||i.remove(...ae(ue()))),D.clear(),U()}function ae(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 se(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;L.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:I(i,e.top)}`;L.list=[`${n} ${r}${l||""}`,`时间 ${A(e.left).slice(-5)}`],L.show=!0}function fe(e){e.setCoords();const t=6e4/$,n=e.prevPoint?e.prevPoint.left+t:j,i=E;e.top<X&&e.set("top",X),e.top>V&&e.set("top",V),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function ce(e,t){if(u(e)&&function(e){const t=Date.parse(m(S.list)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=w(e.time),i=b(t.type,t.range,e.value);return[n,i<X?X:i>V?V:i]}}function ue(){return g(Array.from(D.values()))}return e((()=>{H()})),U(),function(){if(!T.evented)return;let e=!1,i={x:0,y:0};h.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=j&&t<=E&&n>=X&&n<=V)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);ue().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&P.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===P.list.length&&(P.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),F.forEach((n=>{q(ue(),t,"key",2*C).includes(n.linkKey||n.key)||P.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===P.list.length&&(P.show=!1,R("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Z();t.length>0?ee((()=>{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 le(n[0],"remove",n.length),n.map((e=>({...v(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);x("remove",e)})):a.emit(G)}})),h.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),h.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;G&&h.value.remove(G),G=new t.Rect({...n,fill:"#CAF982",opacity:.4,...K,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),G.areaPos={startPos:i,endPos:o.pointer},h.value.add(G)}))}(),{redrawPoints:re,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(x("remove",n),le(n,"remove")):(Object.assign(n,{data:{time:A(e.pointer.x),value:I(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),x("add",n),le({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:fe,setPopup:se,updateData:le,getGridPoints:ue,getContainPoints:Z,showDialog:ee,removeCurrentSelection:te}}export{h 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 s}from"../useEvent.js";import{useCommon as a}from"../useCommon.js";import{getPointRange as f,getIndex as u,isEffectiveNode as c,getTime as p}from"../../utils/index.js";import{cloneDeep as d,last as m,omit as v,flatten as g}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as y}from"@vueuse/core";function h(h,k,x,L,P,w){const{computedX:b,computedY:A,getXValue:I,getYValue:C}=r(k),{xCellWidth:K,pointSelectionStyle:E,originX:j,endX:T,originY:X,endY:V,event:Y,scaleValues:M,xAxis:S,startTime:D,timeXCell:O,itemList:$,dialog:F,topGridOriginY:_,topGridEndY:z}=k,G=new Map,N=new Set,J=d(M);let q=[],R=null;const W=new Set;l(h,k);const{getEqualXTypes:B,handleAddPrevent:H,setPrevAndNextPoint:Q,getPointEventProps:U}=a(h,x,k),{pause:Z,resume:ee}=y((()=>{!function(){if(!W.size)return;for(const e of W)e.set("opacity",1===e.opacity?.5:1);h.value.renderAll()}()}),800);function te(){J.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 s({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=A(t.type,t.range,n),s=i([j,r,T,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});Y.hovered&&o&&(s.on("mousemove",(({pointer:e})=>{L.point={...e||{x:s.left,y:s.top}},L.list=[`${o} ${n}${t.unit||""}`],L.show=!0})),s.on("mouseout",(()=>{L.show=!1}))),h.value.add(s)}s(n),s(o),s(l),s(r)}(t,e),le(t,n,e))}))}))}function ne(e=[]){if(!(null==R?void 0:R.areaPos))return[];const{startPos:t,endPos:n}=R.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:me()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ie(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),oe()},onNegativeClick:()=>oe(),onClose:()=>oe()})}function oe(){R&&h.value.remove(R),R=null}function le(e,t,n){var l;const{type:r,unit:s,dataList:a=[]}=n,f=[];G.set(e.key,[]),function(e,t){W.size&&[...W].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&W.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let d,g,y=c;l.key&&(y=a.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:w="",key:b,type:A="circle"}=y,E=de(c.list[u+1],n);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(g=i([...e,...E],P));const j=f[u-1],T={origin:{data:l,title:w,key:c.key,selfKey:b,unit:s,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:j,rightLine:g,...k,...U()};e&&(j||(T.leftLine=null),d=o(A,{left:e[0],top:e[1],...T}));f.push(g),d&&(d.originLeft=d.left,d.originTop=d.top,function(e){Y.hovered&&(e.on("mouseover",(()=>{ce(e,"hover")})),e.on("mouseout",(()=>{L.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{pe(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),Y.hovered&&ce(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:s,top:a,origin:f}=e,u=~~((s-l)/K);if(s>l+K){if(0===q.length){se(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 c=l+K*u;if(q.every((e=>e.left!==c))){const t=I(c),n=C(f.type,a);q.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:c,top:a}),se(e,[...e.prevPointer,c,a])}if(q.length<u&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+K*l,r=q.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=q.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=q[l-1]||{left:n,top:i},f=~~((r.left-(t-K))/K),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:I(t),value:C(o.type,s.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},q.splice(l,0,s),se(e,[a.left,a.top,s.left,s.top])}}l++}}(e,u),e.nextPoint){const t=G.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=K/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<s?re(e,"#999"):re(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(q.length>0&&i<q[q.length-1].left){for(const e of N)e.left>i&&(e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e));if(q=q.filter((e=>e.left<=i)),0===q.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of N)e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e)}if(q.length>0){const t=m(q);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(L.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:I(e.left),value:C(t,e.top)}};if(h.value.discardActiveObject(),q.length>0){const l=J.find((e=>e.type===t));let r=-1;const s=q.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void fe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1?s[o].value=n.value:s.push({...m(s),time:n.time,value:n.value})}const a=l.dataList.findIndex((e=>e.key===n));x("add",{...v(o,["index","selfKey","lineAttr"]),dataIndex:a,key:n,data:s}),ae({...o,data:s,coincideIndex:r})}else x("change",{...v(o,["selfKey","lineAttr"]),key:n}),ae(o,"change")}}))}(d),null==(p=G.get(c.key))||p.push(d))}(de(l,n),l,u,e)})),Promise.all(G.get(e.key)).then((t=>{const n=f.filter((e=>e));Q(t),h.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||W.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function re(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 se(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,N.add(l),h.value.add(r,l)}))}function ae(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:s}=e;let{dataIndex:a}=e;const f=J.find((e=>e.type===r)),c=f.dataList.find(((e,t)=>(a=t,e.key===l)));switch(t){case"remove":c.list.splice(o,n),c.list[o-1]&&(c.list[o-1].breakpoint=!0);break;case"change":c.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=u(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,s>-1?s-t+1:0,...n);break}}fe({dataIndex:a,scaleValue:f})}function fe(e){var t,n,i;if(N.size&&(null==(t=h.value)||t.remove(...ue([...N]))),N.clear(),q=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=h.value)||n.remove(...ue(G.get(o.key))),G.delete(o.key),le(o,t,i)}else G.size&&(null==(i=h.value)||i.remove(...ue(me()))),G.clear(),te()}function ue(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 ce(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;L.point={x:e.left,y:e.top};const s=I(e.left),a=`${"hover"===t?o.value:C(i,e.top)}`;L.list=[`${n} ${a}${l||""}`,`时间 ${s.slice(-5)}`],L.sourceData=[{type:i,title:n,unit:l,key:r,time:s,value:a}],L.isTarget=!0,L.show=!0}function pe(e){e.setCoords();const t=6e4/O,n=e.prevPoint?e.prevPoint.left+t:j,i=T;e.top<X&&e.set("top",X),e.top>V&&e.set("top",V),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function de(e,t){if(c(e)&&function(e){const t=Date.parse(m(S.list)),n=p(e);return n>=D&&n<=t}(e.time)){const n=b(e.time),i=A(t.type,t.range,e.value);return[n,i<X?X:i>V?V:i]}}function me(){return g(Array.from(G.values()))}return e((()=>{Z()})),te(),function(){if(!Y.evented)return;let e=!1,i={x:0,y:0};h.value.on("mouse:up",(t=>{if(3===t.button&&function(e){L.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=j&&t<=T&&n>=X&&n<=V)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);me().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&P.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===P.list.length&&(P.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{B(me(),t,"key",2*K).includes(n.linkKey||n.key)||P.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===P.list.length&&(P.show=!1,H("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=ne();t.length>0?ie((()=>{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 ae(n[0],"remove",n.length),n.map((e=>({...v(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);x("remove",e)})):s.emit(R)}})),h.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),h.value.on("mouse:move",(o=>{if(function(e){if(!w||P.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;L.movable=!1,(i<j||i>T)&&(L.show=!1);if(!t&&i>=j&&i<=T){const e=o>=X&&o<=V,l=o>=_&&o<=z;if(e||l){const l=I(i);L.sourceData=e?J.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:C(t,o)}})):[{type:"tree",time:l}],L.isTarget=!!t,L.point=n,L.movable=!0}else L.show=!1}}(o),!e)return;const{x:l,y:r}=i,{x:s,y:a}=o.pointer;R&&h.value.remove(R),R=new t.Rect({...n,fill:"#CAF982",opacity:.4,...E,left:l,top:r,width:s-l,height:a-r,objectCaching:!0}),R.areaPos={startPos:i,endPos:o.pointer},h.value.add(R)}))}(),{redrawPoints:fe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(x("remove",n),ae(n,"remove")):(Object.assign(n,{data:{time:I(e.pointer.x),value:C(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),x("add",n),ae({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:pe,setPopup:ce,updateData:ae,getGridPoints:me,getContainPoints:ne,showDialog:ie,removeCurrentSelection:oe}}export{h as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as d}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";function c(c,u,f,h,g,m,p,v,x){const{computedX:k,getXValue:y}=o(u),{getEqualXTypes:X,handleAddPrevent:P,isGridLimit:b,getPointEventProps:w}=r(c,f,u),{other:E,yCellHeight:j,xCellWidth:z,endX:A,originX:C,originY:L,endY:M,markHeight:S,event:I,topGridYCellHeight:T}=u,H=new Map,W=l(E);function Y(){var o;if(!(null==(o=null==W?void 0:W.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=W;let a=L+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:d={},textStyle:u={},data:f}=o;let h=null;f.forEach(((o,f)=>{const{time:g,value:m}=o,p=k(g);if(!$(p))return;const v=e(s,{...d,left:p,top:a}),x=p+v.width/2+2,y=i([x,a],{value:m,...u,originX:"left"}),X=new t.Group([v,y],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});Object.assign(X,{originLeft:p,iconHalfWidth:v.width/2,origin:{type:"other",key:n,dataIndex:r,index:f,data:o,title:l},limitX:{x1:C,x2:A-X.width}}),h&&(X.limitX.x1=h.left,h.limitX.x2=X.left,X.prevPoint=h,h.nextPoint=X),h=X,B(X),H.get(n).push(X),c.value.add(X)})),a+=j}))}function V(){var t;if(!(null==(t=null==W?void 0:W.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=W;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,d=k(s);if(!n||!$(d))return;const{lineHeight:c=j}=a;let u=L+r+c/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:d,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...w()});u+=c,B(r),H.get(i).push(r)}));const f=H.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=d>A-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),c.value.add(...H.get(i))}function G(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=W[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}O(t)}function O(t){var e;const{key:i}=t;switch(null==(e=c.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":Y();break;case"vertical":V();break;case"mark":q()}}function q(){if(!(null==E?void 0:E.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=E.mark,a=i([C-5,M+S/2],{value:t,...o,originX:"right"});c.value.add(a);const l=M+S,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=k(i);if(!$(r))return;let a=M;o.forEach((t=>{let i=!1;const o=e("circleAndText",{...n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),d=o.height;a+d<=l&&a>=M?(o.set("top",a+d/2),a+=d):(i||(a=M,i=!0),o.set("top",a-d/2),a-=d),s.push(o),B(o),c.value.add(o)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:A};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function B(t){if(I.hovered&&(t.on("mouseover",(()=>{D(t)})),t.on("mouseout",(()=>{h.show=!1}))),!I.evented)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<L&&t.set("top",L);const e=M+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(m(t),function(t){const e=t.left+t.maxTextWidth>A?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),I.hovered&&D(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=y(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};c.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(g.point={x:t.left,y:t.top},g.show=!0,g.target=t,g.list=d.map((t=>({...t,renderItem:()=>t.label}))))}))}function D(t){h.point={x:t.left,y:"mark"===t.origin.key?t.top:t.top+T/2};const e=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left;h.list=[`时间 ${y(e).slice(-5)}`],"mark"===t.origin.key&&h.list.unshift(t.origin.data.name+" "),h.show=!0}function $(t){return t>=C&&t<=A}return function(){var t;if(!(null==(t=null==W?void 0:W.horizontal)?void 0:t.length))return;const{horizontal:i}=W,o=C-5;let n=L+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var d;(d=s).on("moving",(()=>{d.set("originX","center"),b(d)?D(d):h.show=!1})),d.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&b(d))if(X(H.get("horizontal"),d.left,"key",z).includes(d.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:y(d.left),value:d.origin.defaultAddValue},...d.origin};f("add",t),G(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(d)})),c.value.add(s),n+=j}))}(),Y(),V(),q(),n.on((()=>{const t="horizontal",e=p(H.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return W.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);O({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&G(o,i)}}}export{c as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as c}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";function d(d,u,f,h,m,g,p,v,x){const{computedX:k,getXValue:y}=o(u),{getEqualXTypes:X,handleAddPrevent:P,isGridLimit:b,getPointEventProps:w}=r(d,f,u),{other:E,yCellHeight:j,xCellWidth:z,endX:A,originX:C,originY:L,endY:M,markHeight:S,event:T,topGridYCellHeight:I}=u,H=new Map,Y=l(E);function W(){var o;if(!(null==(o=null==Y?void 0:Y.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=Y;let a=L+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u}=o;let f=null;u.forEach(((o,u)=>{const{time:h,value:m}=o,g=k(h);if(!$(g))return;const p=e(s,{...c,left:g,top:a}),v=g+p.width/2+2,x=i([v,a],{value:m,...d,originX:"left"}),y=new t.Group([p,x],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...w()});Object.assign(y,{originLeft:g,iconHalfWidth:p.width/2,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:C,x2:A-y.width}}),f&&(y.limitX.x1=f.left,f.limitX.x2=y.left,y.prevPoint=f,f.nextPoint=y),f=y,q(y),H.get(n).push(y)})),a+=j})),d.value.add(...H.get(n))}function V(){var t;if(!(null==(t=null==Y?void 0:Y.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=Y;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=k(s);if(!n||!$(c))return;const{lineHeight:d=j}=a;let u=L+r+d/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...w()});u+=d,q(r),H.get(i).push(r)}));const f=H.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),m=c>A-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),d.value.add(...H.get(i))}function G(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=Y[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}O(t)}function O(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":W();break;case"vertical":V();break;case"mark":D()}}function D(){if(!(null==E?void 0:E.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=E.mark,a=i([C-5,M+S/2],{value:t,...o,originX:"right"});d.value.add(a);const l=M+S,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=k(i);if(!$(r))return;let a=M;o.forEach((t=>{let i=!1;const o=e("circleAndText",{...n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),c=o.height;a+c<=l&&a>=M?(o.set("top",a+c/2),a+=c):(i||(a=M,i=!0),o.set("top",a-c/2),a-=c),s.push(o),q(o),d.value.add(o)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:A};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function q(t){if(T.hovered&&(t.on("mouseover",(()=>{B(t)})),t.on("mouseout",(()=>{h.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<L&&t.set("top",L);const e=M+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(g(t),function(t){const e=t.left+t.maxTextWidth>A?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),T.hovered&&B(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=y(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(m.point={x:t.left,y:t.top},m.show=!0,m.target=t,m.list=c.map((t=>({...t,renderItem:()=>t.label}))))}))}function B(t){const{key:e,data:i={}}=t.origin||{};let o=i.value;h.point={x:t.left,y:"mark"===e?t.top:t.top+I/2};const n=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,r=y(n);h.list=[`时间 ${r.slice(-5)}`],"mark"===e&&(o=i.name,h.list.unshift(o+" ")),h.sourceData=[{type:"other",key:e,time:r,value:o}],h.isTarget=!0,h.show=!0}function $(t){return t>=C&&t<=A}return function(){var t;if(!(null==(t=null==Y?void 0:Y.horizontal)?void 0:t.length))return;const{horizontal:i}=Y,o=C-5;let n=L+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var c;(c=s).on("moving",(()=>{c.set("originX","center"),b(c)?B(c):h.show=!1})),c.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&b(c))if(X(H.get("horizontal"),c.left,"key",z).includes(c.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:y(c.left),value:c.origin.defaultAddValue},...c.origin};f("add",t),G(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(c)})),d.value.add(s),n+=j}))}(),W(),V(),D(),n.on((()=>{const t="horizontal",e=p(H.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return Y.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);O({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&G(o,i)}}}export{d as useOther};
@@ -2,7 +2,7 @@ import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
4
  import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
- export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
5
+ export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps, isPopupTipRender: boolean): {
6
6
  propItems: any;
7
7
  redrawPoints: Ref<any>;
8
8
  select: Ref<any>;
@@ -1 +1 @@
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{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../useEvent.js";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};
1
+ import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l,watch as o}from"vue";import{useDialog as n}from"naive-ui";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as s}from"date-fns";import{getChildrenSize as d}from"../../utils/index.js";import{cloneDeep as c,range as p,flatten as m}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/core";import{useTop as h}from"./useTop.js";import{useLeft as f}from"./useLeft.js";import{useCenter as g}from"./useCenter.js";import{useOther as y}from"./useOther.js";function w(w,x,b,j,C,Y,H){const S=n(),T=e(),D=e(),A=e();let M=null;const X=t((()=>x.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),G=t((()=>{var e;return null!=(e=x.data.left.width)?e:0})),V=t((()=>{const{grid:e}=x.data;return e.mainXCell*e.subXCell})),k=t((()=>{const{grid:e}=x.data;return e.mainYCell*e.subYCell})),P=t((()=>{const{treeData:e=[],show:t=!0}=x.data.top;return t?d(e):0})),L=t((()=>x.data.top.tree.cellHeight)),N=t((()=>L.value*P.value)),O=t((()=>ie(ae("drug")||"top"))),E=t((()=>O.value+N.value)),W=t((()=>{var e;return Date.parse((null==(e=x.data.xAxis)?void 0:e.startTime)||s(new Date,"yyyy-MM-dd HH:mm:ss"))})),I=t((()=>{const e=c(x.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=p(V.value/t+1).map((r=>0===r?e.startTime:s(new Date(W.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:G.value}})),q=function(){const{show:e=!0}=x.data.top;if(!e)return[];const t=c(x.data.top.treeData);let a=0;const{cellWidth:r,cellHeight:i}=x.data.top.tree;return function e(t,l=0){t.forEach((t=>{var o;const n={top:a*i+O.value,left:l*r,width:r,height:i};if(a++,null==(o=t.children)?void 0:o.length){a--;const r=d(t.children);n.height=r*i,e(t.children,l+1)}else n.width=G.value-n.left;Object.assign(t,n)}))}(t),t}(),z=t((()=>ie(ae("xAxis")||"center"))),B=t((()=>{var e;const{width:t,right:a}=x.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),F=t((()=>ie(ae("intraoperatively")||"bottom"))),J=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=x.data.other)?void 0:e.mark)||{};return t&&a?a:0})),K=t((()=>F.value+(x.data.height-N.value-I.value.height-J.value))),Q=t((()=>(B.value-G.value)/V.value)),R=t((()=>(K.value-F.value)/k.value)),U=t((()=>I.value.spaceTimeStamp/Q.value)),Z=t((()=>{const{scaleValues:e}=x.data;return m(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),$=t((()=>le("pulse"))),_=t((()=>le("temperature"))),ee=t((()=>{var e;return(null==(e=x.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),te=a({canvasWidth:x.data.width,canvasHeight:x.data.height,borderStyle:{...u,...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(P),topGridYCellHeight:r(L),topGridOriginY:r(O),topGridEndY:r(E),treeData:q,xAxis:r(I),originYXAxis:r(z),startTime:r(W),timeXCell:r(U),gridXNumber:r(V),gridYNumber:r(k),xCellWidth:r(Q),yCellHeight:r(R),originX:r(G),endX:r(B),originY:r(F),endY:r(K),markHeight:r(J),itemList:r(Z),scaleValues:x.data.scaleValues,pulseYCell:r($),temperatureYCell:r(_),event:r(ee),dialog:S});function ae(e){let t="";return Object.entries(X.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function re(e){const t=X.value[e],a=I.value.height;switch(t){case"drug":return N.value;case"xAxis":return a;default:return x.data.height-N.value-a}}function ie(e){switch(e){case"top":return 0;case"center":return re("top");default:return re("top")+re("center")}}function le(e){const{scaleValues:t}=x.data,a=t.find((t=>t.type===e));return R.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),h(w,te,b,C);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:o,getContainPoints:n,showDialog:u,removeCurrentSelection:s}=g(w,te,b,C,Y,H);f(w,te,b,C,a,r,i,o);const{clickMenu:d}=y(w,te,b,C,Y,a,n,u,s);D.value=e,A.value=e=>{const{item:a}=e;a.type&&v.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),H&&o((()=>null==C?void 0:C.point),(()=>{C.movable?(C.show=!0,M&&clearTimeout(M),M=setTimeout((()=>{C.show=!1,C.movable=!1}),3e3)):M&&clearTimeout(M)}),{deep:!0}),{propItems:te,redrawPoints:D,select:T,clickMenu:A}}export{w as useSurgicalAnesthesiaChart};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function f(f,u,d,m,h){const{computedX:v,getXValue:p}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=E(n,e,i);n&&(n.set(c),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:f};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,f],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}function $(t){I.hovered&&(t.on("mouseover",(()=>{W(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&W(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function W(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=p(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(f,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a,style:c,marginBottom:u}=S;if(!l)return;const d=[],m=X+(u?l-u:l/2),h=u?"bottom":"center";r.forEach(((t,i)=>{const n=s+i*L*a;d.push(e([n,m],{value:t.slice(11,16),originY:h,...c}))}));const v=d.length>0?new t.Group([...d],{...i,objectCaching:!1}):null;v&&f.value.add(v);const p=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y});f.value.add(p);const{show:g=!0}=C;if(!g)return;const y=e([x+(w-x)/2,m],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});f.value.add(y)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=c(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!f});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),p&&z.add(p),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&f.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},p,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&f.value.add(a),z.size&&f.value.add(...z)}()}export{f as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function f(f,u,d,m,h){const{computedX:v,getXValue:p}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=E(n,e,i);n&&(n.set(c),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:f};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,f],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}function $(t){I.hovered&&(t.on("mouseover",(()=>{D(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&D(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function D(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=p(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.sourceData=[{type:"tree",startTime:r,endTime:s,value:l.value}],m.isTarget=!0,m.show=!0}s(f,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a,style:c,marginBottom:u}=S;if(!l)return;const d=[],m=X+(u?l-u:l/2),h=u?"bottom":"center";r.forEach(((t,i)=>{const n=s+i*L*a;d.push(e([n,m],{value:t.slice(11,16),originY:h,...c}))}));const v=d.length>0?new t.Group([...d],{...i,objectCaching:!1}):null;v&&f.value.add(v);const p=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y});f.value.add(p);const{show:g=!0}=C;if(!g)return;const y=e([x+(w-x)/2,m],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});f.value.add(y)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=c(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!f});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),p&&z.add(p),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&f.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},p,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&f.value.add(a),z.size&&f.value.add(...z)}()}export{f as useTop};