cnhis-design-vue 3.2.16-beta.8 → 3.2.17-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  2. package/es/components/base-search/src/index.vue2.js +1 -1
  3. package/es/components/base-search/style/index.css +1 -1
  4. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  5. package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +4 -1
  6. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  7. package/es/components/card-reader-sdk/src/types/index.d.ts +1 -0
  8. package/es/components/card-reader-sdk-cn/index.d.ts +96 -0
  9. package/es/components/card-reader-sdk-cn/index.js +1 -0
  10. package/es/components/card-reader-sdk-cn/src/henan/index.d.ts +47 -0
  11. package/es/components/card-reader-sdk-cn/src/henan/index.js +1 -0
  12. package/es/components/classification/index.d.ts +9 -0
  13. package/es/components/classification/src/components/search-filter/index.vue.d.ts +9 -0
  14. package/es/components/classification/src/components/set-classification/index.vue.d.ts +9 -0
  15. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  16. package/es/components/classification/src/index.vue.d.ts +9 -0
  17. package/es/components/expand-field/index.d.ts +28 -1
  18. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +28 -1
  19. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +28 -1
  20. package/es/components/expand-field/src/components/form.vue.d.ts +28 -1
  21. package/es/components/expand-field/src/index.vue.d.ts +28 -1
  22. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  25. package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
  26. package/es/components/fabric-chart/src/interface.d.ts +1 -0
  27. package/es/components/field-editor/index.d.ts +1011 -0
  28. package/es/components/field-editor/index.js +1 -0
  29. package/es/components/field-editor/src/FieldEditor.vue.d.ts +1012 -0
  30. package/es/components/field-editor/src/FieldEditor.vue.js +1 -0
  31. package/es/components/field-editor/src/FieldEditor.vue2.js +1 -0
  32. package/es/components/field-editor/src/fields.d.ts +19 -0
  33. package/es/components/field-editor/src/fields.js +1 -0
  34. package/es/components/field-editor/src/types.d.ts +25 -0
  35. package/es/components/field-editor/src/types.js +1 -0
  36. package/es/components/field-set/src/utils/index.js +1 -1
  37. package/es/components/form-config/index.d.ts +147 -24
  38. package/es/components/form-config/src/FormConfig.vue.d.ts +147 -24
  39. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  40. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +8 -0
  41. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +210 -95
  42. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  43. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  44. package/es/components/form-render/src/components/renderer/text.js +1 -1
  45. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  46. package/es/components/form-render/src/types/fieldItem.d.ts +3 -1
  47. package/es/components/iho-chat/index.d.ts +321 -365
  48. package/es/components/iho-chat/src/Index.vue.d.ts +321 -365
  49. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  50. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +9 -0
  51. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +18 -0
  52. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +18 -0
  53. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +65 -182
  54. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  55. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +94 -182
  56. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  57. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +9 -0
  58. package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +37 -20
  59. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  60. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +19 -91
  61. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  62. package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +10 -91
  63. package/es/components/iho-chat/src/components/MessageEvent.vue2.js +1 -1
  64. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +18 -0
  65. package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +12 -46
  66. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  67. package/es/components/iho-chat/src/components/SelectLabel.vue.d.ts +54 -0
  68. package/es/components/iho-chat/src/components/SelectLabel.vue.js +1 -0
  69. package/es/components/iho-chat/src/components/SelectLabel.vue2.js +1 -0
  70. package/es/components/iho-chat/src/components/SiderList.vue.d.ts +9 -0
  71. package/es/components/iho-chat/src/components/Video.vue.d.ts +9 -0
  72. package/es/components/iho-chat/src/hooks/useData.d.ts +30 -0
  73. package/es/components/iho-chat/src/hooks/useData.js +1 -1
  74. package/es/components/iho-chat/src/hooks/useVideo.d.ts +9 -0
  75. package/es/components/iho-chat/src/types/index.d.ts +9 -0
  76. package/es/components/iho-chat/style/index.css +1 -1
  77. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue.d.ts +1 -0
  78. package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
  79. package/es/components/iho-table/src/types/index.d.ts +3 -0
  80. package/es/components/index.css +1 -1
  81. package/es/components/index.d.ts +2 -1
  82. package/es/components/index.js +1 -1
  83. package/es/components/quick-search/src/index.vue2.js +1 -1
  84. package/es/components/quick-search/style/index.css +1 -1
  85. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  86. package/es/components/scale-view/src/hooks/use-component.d.ts +7 -7
  87. package/es/components/select-label/index.d.ts +7 -7
  88. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue.d.ts +5 -1
  89. package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
  90. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue.d.ts +7 -7
  91. package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
  92. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue.d.ts +5 -1
  93. package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
  94. package/es/components/select-label/src/index.vue.d.ts +7 -7
  95. package/es/components/select-label/src/types/index.d.ts +4 -1
  96. package/es/components/select-label/style/index.css +1 -1
  97. package/es/components/select-person/index.d.ts +28 -1
  98. package/es/components/select-person/src/SelectPerson.vue.d.ts +15 -1
  99. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  100. package/es/components/select-person/src/index.vue.d.ts +28 -1
  101. package/es/components/select-person/src/index.vue2.js +1 -1
  102. package/es/components/shortcut-setter/index.d.ts +2 -0
  103. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -0
  104. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +9 -0
  105. package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue.d.ts +8 -0
  106. package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue2.js +1 -1
  107. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +9 -0
  108. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +9 -0
  109. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue.d.ts +2 -7
  110. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
  111. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue.d.ts +8 -0
  112. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue2.js +1 -1
  113. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +4 -2
  114. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  115. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +15 -9
  116. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +15 -9
  117. package/es/components/table-filter/src/types/index.d.ts +3 -0
  118. package/es/env.d.ts +25 -25
  119. package/es/shared/package.json.js +1 -1
  120. package/package.json +2 -2
@@ -524,6 +524,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
524
524
  uncheckableField: {
525
525
  type: StringConstructor;
526
526
  };
527
+ onlyForwardCascade: {
528
+ type: BooleanConstructor;
529
+ };
527
530
  }, {
528
531
  $attrs: {
529
532
  [x: string]: unknown;
@@ -632,6 +635,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
632
635
  uncheckableField: {
633
636
  type: StringConstructor;
634
637
  };
638
+ onlyForwardCascade: {
639
+ type: BooleanConstructor;
640
+ };
635
641
  }>> & {
636
642
  onCheck?: ((...args: any[]) => any) | undefined;
637
643
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1086,6 +1092,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
1086
1092
  uncheckableField: {
1087
1093
  type: StringConstructor;
1088
1094
  };
1095
+ onlyForwardCascade: {
1096
+ type: BooleanConstructor;
1097
+ };
1089
1098
  }, {
1090
1099
  searchFilterBase: {
1091
1100
  isOpen: boolean;
@@ -1190,6 +1199,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
1190
1199
  uncheckableField: {
1191
1200
  type: StringConstructor;
1192
1201
  };
1202
+ onlyForwardCascade: {
1203
+ type: BooleanConstructor;
1204
+ };
1193
1205
  }>> & {}>>;
1194
1206
  emit: any;
1195
1207
  keyword: import("vue").Ref<string>;
@@ -1274,7 +1286,11 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
1274
1286
  key: string | number;
1275
1287
  }[];
1276
1288
  setTagData: (tree: import("naive-ui").TreeOption[]) => void;
1277
- updateTreeChecked: (keys: (string | number)[]) => void;
1289
+ getFlattenKeys: (tree: import("naive-ui").TreeOption[]) => any[];
1290
+ updateTreeChecked: (keys: (string | number)[], _: any, meta: {
1291
+ node: import("naive-ui").TreeOption | null;
1292
+ action: "check" | "uncheck";
1293
+ }) => void;
1278
1294
  setCheckedAll: () => void;
1279
1295
  clearAll: () => void;
1280
1296
  closeTag: (tag: {
@@ -1616,6 +1632,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
1616
1632
  uncheckableField: {
1617
1633
  type: StringConstructor;
1618
1634
  };
1635
+ onlyForwardCascade: {
1636
+ type: BooleanConstructor;
1637
+ };
1619
1638
  }>>, {
1620
1639
  data: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & import("../../shared/types").AnyObject)[];
1621
1640
  defaultList: ((string | number) | {
@@ -1648,6 +1667,7 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
1648
1667
  roleData: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & import("../../shared/types").AnyObject)[];
1649
1668
  roleFields: Record<string, any>;
1650
1669
  forceShowSelectAll: boolean;
1670
+ onlyForwardCascade: boolean;
1651
1671
  }>>;
1652
1672
  getProps: import("vue").ComputedRef<Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1653
1673
  defaultList: {
@@ -1753,6 +1773,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
1753
1773
  uncheckableField: {
1754
1774
  type: StringConstructor;
1755
1775
  };
1776
+ onlyForwardCascade: {
1777
+ type: BooleanConstructor;
1778
+ };
1756
1779
  }>> & {
1757
1780
  onCheck?: ((...args: any[]) => any) | undefined;
1758
1781
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1865,6 +1888,9 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
1865
1888
  uncheckableField: {
1866
1889
  type: StringConstructor;
1867
1890
  };
1891
+ onlyForwardCascade: {
1892
+ type: BooleanConstructor;
1893
+ };
1868
1894
  }>> & {
1869
1895
  onCheck?: ((...args: any[]) => any) | undefined;
1870
1896
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1903,6 +1929,7 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
1903
1929
  switchTypeData: import("../../shared/types").AnyObject;
1904
1930
  tagProps: import("../../shared/types").AnyObject;
1905
1931
  forceShowSelectAll: boolean;
1932
+ onlyForwardCascade: boolean;
1906
1933
  }>>;
1907
1934
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("check" | "changeModalVisible")[], "check" | "changeModalVisible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1908
1935
  visible: {
@@ -198,6 +198,9 @@ declare const _default: import("vue").DefineComponent<{
198
198
  uncheckableField: {
199
199
  type: StringConstructor;
200
200
  };
201
+ onlyForwardCascade: {
202
+ type: BooleanConstructor;
203
+ };
201
204
  }, {
202
205
  $attrs: {
203
206
  [x: string]: unknown;
@@ -306,6 +309,9 @@ declare const _default: import("vue").DefineComponent<{
306
309
  uncheckableField: {
307
310
  type: StringConstructor;
308
311
  };
312
+ onlyForwardCascade: {
313
+ type: BooleanConstructor;
314
+ };
309
315
  }>> & {
310
316
  onCheck?: ((...args: any[]) => any) | undefined;
311
317
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -760,6 +766,9 @@ declare const _default: import("vue").DefineComponent<{
760
766
  uncheckableField: {
761
767
  type: StringConstructor;
762
768
  };
769
+ onlyForwardCascade: {
770
+ type: BooleanConstructor;
771
+ };
763
772
  }, {
764
773
  searchFilterBase: {
765
774
  isOpen: boolean;
@@ -864,6 +873,9 @@ declare const _default: import("vue").DefineComponent<{
864
873
  uncheckableField: {
865
874
  type: StringConstructor;
866
875
  };
876
+ onlyForwardCascade: {
877
+ type: BooleanConstructor;
878
+ };
867
879
  }>> & {}>>;
868
880
  emit: any;
869
881
  keyword: import("vue").Ref<string>;
@@ -948,7 +960,11 @@ declare const _default: import("vue").DefineComponent<{
948
960
  key: string | number;
949
961
  }[];
950
962
  setTagData: (tree: import("naive-ui").TreeOption[]) => void;
951
- updateTreeChecked: (keys: (string | number)[]) => void;
963
+ getFlattenKeys: (tree: import("naive-ui").TreeOption[]) => any[];
964
+ updateTreeChecked: (keys: (string | number)[], _: any, meta: {
965
+ node: import("naive-ui").TreeOption | null;
966
+ action: "check" | "uncheck";
967
+ }) => void;
952
968
  setCheckedAll: () => void;
953
969
  clearAll: () => void;
954
970
  closeTag: (tag: {
@@ -1290,6 +1306,9 @@ declare const _default: import("vue").DefineComponent<{
1290
1306
  uncheckableField: {
1291
1307
  type: StringConstructor;
1292
1308
  };
1309
+ onlyForwardCascade: {
1310
+ type: BooleanConstructor;
1311
+ };
1293
1312
  }>>, {
1294
1313
  data: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & import("../../../../shared/types").AnyObject)[];
1295
1314
  defaultList: ((string | number) | {
@@ -1322,6 +1341,7 @@ declare const _default: import("vue").DefineComponent<{
1322
1341
  roleData: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & import("../../../../shared/types").AnyObject)[];
1323
1342
  roleFields: Record<string, any>;
1324
1343
  forceShowSelectAll: boolean;
1344
+ onlyForwardCascade: boolean;
1325
1345
  }>>;
1326
1346
  getProps: import("vue").ComputedRef<Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1327
1347
  defaultList: {
@@ -1427,6 +1447,9 @@ declare const _default: import("vue").DefineComponent<{
1427
1447
  uncheckableField: {
1428
1448
  type: StringConstructor;
1429
1449
  };
1450
+ onlyForwardCascade: {
1451
+ type: BooleanConstructor;
1452
+ };
1430
1453
  }>> & {
1431
1454
  onCheck?: ((...args: any[]) => any) | undefined;
1432
1455
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1539,6 +1562,9 @@ declare const _default: import("vue").DefineComponent<{
1539
1562
  uncheckableField: {
1540
1563
  type: StringConstructor;
1541
1564
  };
1565
+ onlyForwardCascade: {
1566
+ type: BooleanConstructor;
1567
+ };
1542
1568
  }>> & {
1543
1569
  onCheck?: ((...args: any[]) => any) | undefined;
1544
1570
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1577,6 +1603,7 @@ declare const _default: import("vue").DefineComponent<{
1577
1603
  switchTypeData: import("../../../../shared/types").AnyObject;
1578
1604
  tagProps: import("../../../../shared/types").AnyObject;
1579
1605
  forceShowSelectAll: boolean;
1606
+ onlyForwardCascade: boolean;
1580
1607
  }>>;
1581
1608
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("check" | "changeModalVisible")[], "check" | "changeModalVisible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1582
1609
  visible: {
@@ -157,6 +157,9 @@ declare const _default: import("vue").DefineComponent<{
157
157
  uncheckableField: {
158
158
  type: StringConstructor;
159
159
  };
160
+ onlyForwardCascade: {
161
+ type: BooleanConstructor;
162
+ };
160
163
  }, {
161
164
  $attrs: {
162
165
  [x: string]: unknown;
@@ -265,6 +268,9 @@ declare const _default: import("vue").DefineComponent<{
265
268
  uncheckableField: {
266
269
  type: StringConstructor;
267
270
  };
271
+ onlyForwardCascade: {
272
+ type: BooleanConstructor;
273
+ };
268
274
  }>> & {
269
275
  onCheck?: ((...args: any[]) => any) | undefined;
270
276
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -719,6 +725,9 @@ declare const _default: import("vue").DefineComponent<{
719
725
  uncheckableField: {
720
726
  type: StringConstructor;
721
727
  };
728
+ onlyForwardCascade: {
729
+ type: BooleanConstructor;
730
+ };
722
731
  }, {
723
732
  searchFilterBase: {
724
733
  isOpen: boolean;
@@ -823,6 +832,9 @@ declare const _default: import("vue").DefineComponent<{
823
832
  uncheckableField: {
824
833
  type: StringConstructor;
825
834
  };
835
+ onlyForwardCascade: {
836
+ type: BooleanConstructor;
837
+ };
826
838
  }>> & {}>>;
827
839
  emit: any;
828
840
  keyword: import("vue").Ref<string>;
@@ -907,7 +919,11 @@ declare const _default: import("vue").DefineComponent<{
907
919
  key: string | number;
908
920
  }[];
909
921
  setTagData: (tree: import("naive-ui").TreeOption[]) => void;
910
- updateTreeChecked: (keys: (string | number)[]) => void;
922
+ getFlattenKeys: (tree: import("naive-ui").TreeOption[]) => any[];
923
+ updateTreeChecked: (keys: (string | number)[], _: any, meta: {
924
+ node: import("naive-ui").TreeOption | null;
925
+ action: "check" | "uncheck";
926
+ }) => void;
911
927
  setCheckedAll: () => void;
912
928
  clearAll: () => void;
913
929
  closeTag: (tag: {
@@ -1249,6 +1265,9 @@ declare const _default: import("vue").DefineComponent<{
1249
1265
  uncheckableField: {
1250
1266
  type: StringConstructor;
1251
1267
  };
1268
+ onlyForwardCascade: {
1269
+ type: BooleanConstructor;
1270
+ };
1252
1271
  }>>, {
1253
1272
  data: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
1254
1273
  defaultList: ((string | number) | {
@@ -1281,6 +1300,7 @@ declare const _default: import("vue").DefineComponent<{
1281
1300
  roleData: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
1282
1301
  roleFields: Record<string, any>;
1283
1302
  forceShowSelectAll: boolean;
1303
+ onlyForwardCascade: boolean;
1284
1304
  }>>;
1285
1305
  getProps: import("vue").ComputedRef<Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1286
1306
  defaultList: {
@@ -1386,6 +1406,9 @@ declare const _default: import("vue").DefineComponent<{
1386
1406
  uncheckableField: {
1387
1407
  type: StringConstructor;
1388
1408
  };
1409
+ onlyForwardCascade: {
1410
+ type: BooleanConstructor;
1411
+ };
1389
1412
  }>> & {
1390
1413
  onCheck?: ((...args: any[]) => any) | undefined;
1391
1414
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1498,6 +1521,9 @@ declare const _default: import("vue").DefineComponent<{
1498
1521
  uncheckableField: {
1499
1522
  type: StringConstructor;
1500
1523
  };
1524
+ onlyForwardCascade: {
1525
+ type: BooleanConstructor;
1526
+ };
1501
1527
  }>> & {
1502
1528
  onCheck?: ((...args: any[]) => any) | undefined;
1503
1529
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1536,6 +1562,7 @@ declare const _default: import("vue").DefineComponent<{
1536
1562
  switchTypeData: AnyObject;
1537
1563
  tagProps: AnyObject;
1538
1564
  forceShowSelectAll: boolean;
1565
+ onlyForwardCascade: boolean;
1539
1566
  }>>;
1540
1567
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("check" | "changeModalVisible")[], "check" | "changeModalVisible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1541
1568
  visible: {
@@ -468,6 +468,9 @@ declare const _default: import("vue").DefineComponent<{
468
468
  uncheckableField: {
469
469
  type: StringConstructor;
470
470
  };
471
+ onlyForwardCascade: {
472
+ type: BooleanConstructor;
473
+ };
471
474
  }, {
472
475
  $attrs: {
473
476
  [x: string]: unknown;
@@ -576,6 +579,9 @@ declare const _default: import("vue").DefineComponent<{
576
579
  uncheckableField: {
577
580
  type: StringConstructor;
578
581
  };
582
+ onlyForwardCascade: {
583
+ type: BooleanConstructor;
584
+ };
579
585
  }>> & {
580
586
  onCheck?: ((...args: any[]) => any) | undefined;
581
587
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1030,6 +1036,9 @@ declare const _default: import("vue").DefineComponent<{
1030
1036
  uncheckableField: {
1031
1037
  type: StringConstructor;
1032
1038
  };
1039
+ onlyForwardCascade: {
1040
+ type: BooleanConstructor;
1041
+ };
1033
1042
  }, {
1034
1043
  searchFilterBase: {
1035
1044
  isOpen: boolean;
@@ -1134,6 +1143,9 @@ declare const _default: import("vue").DefineComponent<{
1134
1143
  uncheckableField: {
1135
1144
  type: StringConstructor;
1136
1145
  };
1146
+ onlyForwardCascade: {
1147
+ type: BooleanConstructor;
1148
+ };
1137
1149
  }>> & {}>>;
1138
1150
  emit: any;
1139
1151
  keyword: import("vue").Ref<string>;
@@ -1218,7 +1230,11 @@ declare const _default: import("vue").DefineComponent<{
1218
1230
  key: string | number;
1219
1231
  }[];
1220
1232
  setTagData: (tree: import("naive-ui").TreeOption[]) => void;
1221
- updateTreeChecked: (keys: (string | number)[]) => void;
1233
+ getFlattenKeys: (tree: import("naive-ui").TreeOption[]) => any[];
1234
+ updateTreeChecked: (keys: (string | number)[], _: any, meta: {
1235
+ node: import("naive-ui").TreeOption | null;
1236
+ action: "check" | "uncheck";
1237
+ }) => void;
1222
1238
  setCheckedAll: () => void;
1223
1239
  clearAll: () => void;
1224
1240
  closeTag: (tag: {
@@ -1560,6 +1576,9 @@ declare const _default: import("vue").DefineComponent<{
1560
1576
  uncheckableField: {
1561
1577
  type: StringConstructor;
1562
1578
  };
1579
+ onlyForwardCascade: {
1580
+ type: BooleanConstructor;
1581
+ };
1563
1582
  }>>, {
1564
1583
  data: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
1565
1584
  defaultList: ((string | number) | {
@@ -1592,6 +1611,7 @@ declare const _default: import("vue").DefineComponent<{
1592
1611
  roleData: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
1593
1612
  roleFields: Record<string, any>;
1594
1613
  forceShowSelectAll: boolean;
1614
+ onlyForwardCascade: boolean;
1595
1615
  }>>;
1596
1616
  getProps: import("vue").ComputedRef<Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1597
1617
  defaultList: {
@@ -1697,6 +1717,9 @@ declare const _default: import("vue").DefineComponent<{
1697
1717
  uncheckableField: {
1698
1718
  type: StringConstructor;
1699
1719
  };
1720
+ onlyForwardCascade: {
1721
+ type: BooleanConstructor;
1722
+ };
1700
1723
  }>> & {
1701
1724
  onCheck?: ((...args: any[]) => any) | undefined;
1702
1725
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1809,6 +1832,9 @@ declare const _default: import("vue").DefineComponent<{
1809
1832
  uncheckableField: {
1810
1833
  type: StringConstructor;
1811
1834
  };
1835
+ onlyForwardCascade: {
1836
+ type: BooleanConstructor;
1837
+ };
1812
1838
  }>> & {
1813
1839
  onCheck?: ((...args: any[]) => any) | undefined;
1814
1840
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1847,6 +1873,7 @@ declare const _default: import("vue").DefineComponent<{
1847
1873
  switchTypeData: AnyObject;
1848
1874
  tagProps: AnyObject;
1849
1875
  forceShowSelectAll: boolean;
1876
+ onlyForwardCascade: boolean;
1850
1877
  }>>;
1851
1878
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("check" | "changeModalVisible")[], "check" | "changeModalVisible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1852
1879
  visible: {
@@ -526,6 +526,9 @@ declare const _default: import("vue").DefineComponent<{
526
526
  uncheckableField: {
527
527
  type: StringConstructor;
528
528
  };
529
+ onlyForwardCascade: {
530
+ type: BooleanConstructor;
531
+ };
529
532
  }, {
530
533
  $attrs: {
531
534
  [x: string]: unknown;
@@ -634,6 +637,9 @@ declare const _default: import("vue").DefineComponent<{
634
637
  uncheckableField: {
635
638
  type: StringConstructor;
636
639
  };
640
+ onlyForwardCascade: {
641
+ type: BooleanConstructor;
642
+ };
637
643
  }>> & {
638
644
  onCheck?: ((...args: any[]) => any) | undefined;
639
645
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1088,6 +1094,9 @@ declare const _default: import("vue").DefineComponent<{
1088
1094
  uncheckableField: {
1089
1095
  type: StringConstructor;
1090
1096
  };
1097
+ onlyForwardCascade: {
1098
+ type: BooleanConstructor;
1099
+ };
1091
1100
  }, {
1092
1101
  searchFilterBase: {
1093
1102
  isOpen: boolean;
@@ -1192,6 +1201,9 @@ declare const _default: import("vue").DefineComponent<{
1192
1201
  uncheckableField: {
1193
1202
  type: StringConstructor;
1194
1203
  };
1204
+ onlyForwardCascade: {
1205
+ type: BooleanConstructor;
1206
+ };
1195
1207
  }>> & {}>>;
1196
1208
  emit: any;
1197
1209
  keyword: import("vue").Ref<string>;
@@ -1276,7 +1288,11 @@ declare const _default: import("vue").DefineComponent<{
1276
1288
  key: string | number;
1277
1289
  }[];
1278
1290
  setTagData: (tree: import("naive-ui").TreeOption[]) => void;
1279
- updateTreeChecked: (keys: (string | number)[]) => void;
1291
+ getFlattenKeys: (tree: import("naive-ui").TreeOption[]) => any[];
1292
+ updateTreeChecked: (keys: (string | number)[], _: any, meta: {
1293
+ node: import("naive-ui").TreeOption | null;
1294
+ action: "check" | "uncheck";
1295
+ }) => void;
1280
1296
  setCheckedAll: () => void;
1281
1297
  clearAll: () => void;
1282
1298
  closeTag: (tag: {
@@ -1618,6 +1634,9 @@ declare const _default: import("vue").DefineComponent<{
1618
1634
  uncheckableField: {
1619
1635
  type: StringConstructor;
1620
1636
  };
1637
+ onlyForwardCascade: {
1638
+ type: BooleanConstructor;
1639
+ };
1621
1640
  }>>, {
1622
1641
  data: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
1623
1642
  defaultList: ((string | number) | {
@@ -1650,6 +1669,7 @@ declare const _default: import("vue").DefineComponent<{
1650
1669
  roleData: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
1651
1670
  roleFields: Record<string, any>;
1652
1671
  forceShowSelectAll: boolean;
1672
+ onlyForwardCascade: boolean;
1653
1673
  }>>;
1654
1674
  getProps: import("vue").ComputedRef<Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1655
1675
  defaultList: {
@@ -1755,6 +1775,9 @@ declare const _default: import("vue").DefineComponent<{
1755
1775
  uncheckableField: {
1756
1776
  type: StringConstructor;
1757
1777
  };
1778
+ onlyForwardCascade: {
1779
+ type: BooleanConstructor;
1780
+ };
1758
1781
  }>> & {
1759
1782
  onCheck?: ((...args: any[]) => any) | undefined;
1760
1783
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1867,6 +1890,9 @@ declare const _default: import("vue").DefineComponent<{
1867
1890
  uncheckableField: {
1868
1891
  type: StringConstructor;
1869
1892
  };
1893
+ onlyForwardCascade: {
1894
+ type: BooleanConstructor;
1895
+ };
1870
1896
  }>> & {
1871
1897
  onCheck?: ((...args: any[]) => any) | undefined;
1872
1898
  onCheckWithLevel?: ((...args: any[]) => any) | undefined;
@@ -1905,6 +1931,7 @@ declare const _default: import("vue").DefineComponent<{
1905
1931
  switchTypeData: AnyObject;
1906
1932
  tagProps: AnyObject;
1907
1933
  forceShowSelectAll: boolean;
1934
+ onlyForwardCascade: boolean;
1908
1935
  }>>;
1909
1936
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("check" | "changeModalVisible")[], "check" | "changeModalVisible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1910
1937
  visible: {
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as d,drawScaleNumber as h,drawScaleLine as f}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as w,range as j}from"lodash-es";import"../../constants/index.js";import"@vueuse/shared";import{format as k}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function x(x,S,C,P,A){const{computedX:E,computedY:O,getXValue:X,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:T,setPrevAndNextPoint:H,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:B,originX:G,originY:N,xCellWidth:W,endY:V,startTime:F,leftAddAreaWidth:R,leftScales:$,rightScales:q,yCellHeight:z,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],d=[],{pointAttr:h={},lineAttr:f={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function w(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:h={}}=e[s+"Style"],p=E(l[s]),g=t([...r,p,r[1]],{...f,strokeDashArray:[4,2],...i}),v="dystocia"===s&&r[1]-N>=z?r[1]-z:r[1],m=n(c,{left:p,top:v,...u,...i}),y=v+m.height/2,b="dystocia"===s?o([p,y+z,y],f,"up"):null;g&&(d.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),m&&(d.push(m),a[s]={obj:m,left:p-r[0]}),b&&(d.push(b),a[s+"Arrow"]={obj:b,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const A=e.data[b+1],E=he(A,e);if(a&&E&&!y.breakpoint)S=t([...a,...E],{...f});else if(a&&!E&&!y.breakpoint){const o=he(A,e);S=o?t([...a,...o],{...f}):null}const O={};if(["fetalPresentation","cervix"].includes(g)){let e,t;if(y.childbirth){const{type:s="arrow",style:c={},textStyle:u={}}=m;if("arrow"===s){const t=a[1]+z;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+W/2,a[1]+z/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",...u}),e&&(d.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(O,{childbirthText:{obj:t,left:W/2,top:z/2}}))}}"fetalPresentation"===g&&(w(a,y,"surgicalDelivery",O),w(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...h,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{de(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&de(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:X(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=k(new Date(X(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(he(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));H(e),Promise.all(d).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ce()}function ce(){var e;le.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:G,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<N&&e.set("top",N),e.top>V&&e.set("top",V),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function de(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${X(e.left).slice(-5)}`],P.show=!0}function he(e,t){if(v(e)&&function(e){const t=F+864e5,o=m(e);return o>=F&&o<=t}(e.time)){const o=E(e.time),n=O(t.key,t.range,e.value);return[o,n<N?N:n>V?V:n]}}function fe(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-R-Z-1,left:R}:{width:J-G-(q.length?0:1),left:G},o=new e.Rect({...U,height:V-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?R:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:w=!0,showMaxMinNumber:j=!0,showName:k=!0}=t,S=[],C=[],P=n+u/2,A=y(s,c),E=A.length,{lineXMain:O,lineXSub:X,textLeft:L}=d(m,n,u);A.forEach(((e,o)=>{const n=V-o*z*b,i=0===o?V-8:o!==A.length-1||!ie[0]||ee&&"FHR"!==v?n:N+8;!w||(0===o||o===E-1)&&!j||S.push(h(String(e),t,L,i)),C.push(...f(t,o,O,X,n,z,N,E,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:V-ie[0],left:P,top:ie[0]+(V-ie[0])/2}):null;if(Y&&M.push(Y),k){const e=r([P,N-ie[0]>0?N-z/2:z/2],{value:String(p),...l,...g});e&&M.push(e)}const T=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(T),T.sendToBack(),n+=u}))}t($),t(q,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:d,style:h={}}=D.processTime;if(t||c){const f=[],p=j(u[0],u[1]+1),g=[],v=[],m=z/2;for(let e=0;e<B.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=G+("center"===t?W/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):fe(w(f),n);f.push(u);const d="top"===s?N-m:V+m;g.push(r([c+e*W,d],{value:String(u),...l,...a})),e===B.mainXCell-1&&"center"!==t&&g.push(r([J-1,d],{value:String(fe(w(f),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=h,o=G+("center"===t?W/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===d?m:oe-m;v.push(r([n+e*W,i],{value:String(p[e]),...l,...h})),e===B.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(w(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(V-i-t)/e,V-i],c=[J-G,e*(J-G)+t];let u=[],d=[];function h([o,n]){return Math.abs(n-e*o-t)<=1}function f([e,t]){const[o,n]=[...p([e,t])];return o>=G&&o<=J&&n>=i&&n<=V}function p([e,t]){return[G+e,V-t]}return h(l)&&f(l)&&(u=p(l)),h(s)&&f(s)&&(u=p(s)),h(a)&&f(a)&&(d=p(a)),h(c)&&f(c)&&(d=p(c)),[...u,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([G,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:k(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,h]=[E(l.time)-G,V-O(o,a,l.value)],[f,p]=[E(u.time)-G,V-O(o,a,u.value)],g=(p-h)/(f-d),v=h-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,c=s(o,r-(E(k(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-E(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{var o,n;if(3===t.button){const{x:i=0,y:r=0}=t.pointer||{};i>=G&&i<=J&&r>=N&&r<=V&&(A.point={x:i,y:r},A.show=!0,t.target?(A.target=t.target,A.list=[(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.220"))||"删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&A.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(A.target=null,A.list=[(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.219"))||"新增节点"],re.filter((e=>e.show)).forEach((o=>{if(!M([...le],i,"key").includes(o.key)){if(["cervix","fetalPresentation"].includes(o.key)&&r<ee)return;A.list.push(e(o,t.pointer))}})),1===A.list.length&&(A.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=N;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),T(c)?(ue(c),de(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&T(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:X(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=w(e),o=(V-N)/2,n=(t.height+t.top-N)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t($,R/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:X(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as i,defaultStyle as n,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as d,drawScaleNumber as h,drawScaleLine as f}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,isString as j,last as k,range as w}from"lodash-es";import"../../constants/index.js";import"@vueuse/shared";import{format as x}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function S(S,C,O,Y,A){const{computedX:E,computedY:P,getXValue:X,getYValue:L}=u(C),{getEqualXTypes:M,handleAddPrevent:I,isGridLimit:T,setPrevAndNextPoint:H,getPointEventProps:D}=p(S,O,C),{xAxis:B,grid:G,originX:N,originY:W,xCellWidth:V,endY:F,startTime:R,leftAddAreaWidth:$,leftScales:_,rightScales:q,yCellHeight:z,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:ee,originYCervix:te,other:oe,canvasHeight:ie,scalebarBorder:ne,padding:re}=C,le=b(K),se=new Set;function ae(){le.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],d=[],{pointAttr:h={},lineAttr:f={},title:p="",key:g,type:v="circle",childbirthStyle:m={}}=e;function y(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:h={}}=e[s+"Style"],p=E(l[s]),g=t([...r,p,r[1]],{...f,strokeDashArray:[4,2],...n}),v="dystocia"===s&&r[1]-W>=z?r[1]-z:r[1],m=i(c,{left:p,top:v,...u,...n}),y=v+m.height/2,b="dystocia"===s?o([p,y+z,y],f,"up"):null;g&&(d.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),m&&(d.push(m),a[s]={obj:m,left:p-r[0]}),b&&(d.push(b),a[s+"Arrow"]={obj:b,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,b)=>{!function(a,b,k){let w,C;const A=e.data[k+1],E=fe(A,e);if(a&&E&&!b.breakpoint)C=t([...a,...E],{...f});else if(a&&!E&&!b.breakpoint){const o=fe(A,e);C=o?t([...a,...o],{...f}):null}const P={};if(["fetalPresentation","cervix"].includes(g)){let e,t;if(b.childbirth){const{type:s="arrow",style:c={},textStyle:u={}}=m;if("arrow"===s){const t=a[1]+z;e=o([a[0],a[1],t],c),e._bottomY=t}else e=i(s,{left:a[0],top:a[1],...c,...n,hoverCursor:"default"}),e._bottomY=a[1]+e.height/2;t=j(b.childbirth)?r([a[0]+V/2,a[1]+z/2],{value:String(b.childbirth),...l,originX:"left",originY:"center",...u}):null,e&&(d.push(e),Object.assign(P,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(P,{childbirthText:{obj:t,left:V/2,top:z/2}}))}}if(b.mark){const{type:e="triangle",style:t={}}=b.markStyle||{},o=P.childbirthIcon?P.childbirthIcon.obj._bottomY+5:a[1]+10,s=j(b.mark)?r([a[0],o],{value:String(b.mark),...l,...t,originY:"top"}):i(e,{left:a[0],top:o,...t,...n,originY:"top",hoverCursor:"default"});d.push(s),Object.assign(P,{markObj:{obj:s,top:o-a[1]}})}"fetalPresentation"===g&&(y(a,b,"surgicalDelivery",P),y(a,b,"dystocia",P));const M=u[k-1],I={origin:{data:b,title:p,key:g||"",dataIndex:s,index:k},leftLine:M,rightLine:C,otherObj:P,...h,...D()};a&&(M||(I.leftLine=null),w=i(v,{left:a[0],top:a[1],...I}));C&&u.push(C),w&&(!function(e){ee.hovered&&(e.on("mouseover",(()=>{he(e,"hover")})),e.on("mouseout",(()=>{Y.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{de(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:i=0,left:n=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+n,y2:e.top}):o.setCoords().set({left:e.left+n,top:e.top+i}),l&&(S.value.remove(o),delete e.otherObj.obj))}))}(e),ee.hovered&&he(e)})),e.on("mouseup",(t=>{if(Y.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:X(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var i;(null==(i=e.otherObj[t])?void 0:i.obj)&&(o.data[t]=x(new Date(X(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),S.value.discardActiveObject(),O("change",o),ce(o,"change")}}))}(w),c.push(w),se.add(w))}(fe(a,e),a,b)})),H(c),S.value.add(...u,...d,...c),c.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}function ce(e,t="add"){const{dataIndex:o,data:i,index:n,key:r}=e,l=le.find((e=>e.key===r));switch(t){case"remove":l.data.splice(n,1);break;case"change":l.data[n]=i;break;default:{const e=g(i.time,l.data);l.data.splice(e,0,i);break}}ue()}function ue(){var e;se.size&&(null==(e=S.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...se]))),se.clear(),ae()}function de(e){const t=e.prevPoint?e.prevPoint.left:N,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<te&&e.set("top",te),e.top<W&&e.set("top",W),e.top>F&&e.set("top",F),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function he(e,t="moving"){const{title:o,key:i,data:n}=e.origin;Y.point={x:e.left,y:e.top},Y.list=[`${o} ${"hover"===t?n.value:L(i,e.top)}`,`时间 ${X(e.left).slice(-5)}`],Y.show=!0}function fe(e,t){if(v(e)&&function(e){const t=R+864e5,o=m(e);return o>=R&&o<=t}(e.time)){const o=E(e.time),i=P(t.key,t.range,e.value);return[o,i<W?W:i>F?F:i]}}function pe(e,t){return e+1>t[1]?t[0]:e+1}return c(S,C),function(){const t=ne?{width:Q-$-Z-1,left:$}:{width:J-N-(q.length?0:1),left:N},o=new e.Rect({...U,height:F-re[0]-1,top:re[0],fill:"transparent",...t});S.value.add(o)}(),function(){function t(t,o="left"){let i="left"===o?$:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:j=!0,showMaxMinNumber:k=!0,showName:w=!0}=t,x=[],C=[],O=i+u/2,Y=y(s,c),A=Y.length,{lineXMain:E,lineXSub:P,textLeft:X}=d(m,i,u);Y.forEach(((e,o)=>{const i=F-o*z*b,n=0===o?F-8:o!==Y.length-1||!re[0]||te&&"FHR"!==v?i:W+8;!j||(0===o||o===A-1)&&!k||x.push(h(String(e),t,X,n)),C.push(...f(t,o,E,P,i,z,W,A,1))}));const L=[],M=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:F-re[0],left:O,top:re[0]+(F-re[0])/2}):null;if(M&&L.push(M),w){const e=r([O,W-re[0]>0?W-z/2:z/2],{value:String(p),...l,...g});e&&L.push(e)}const I=new e.Group([...C,...x,...L],{objectCaching:!1,...n});S.value.add(I),I.sendToBack(),i+=u}))}t(_),t(q,"right")}(),function(){const{show:t,startTime:o,range:i=[0,23],position:s="top",style:a}=B.time,{show:c,range:u=[0,23],position:d,style:h={}}=B.processTime;if(t||c){const f=[],p=w(u[0],u[1]+1),g=[],v=[],m=z/2;for(let e=0;e<G.mainXCell;e++){if(t){const{textAlign:t="center"}=a,n=N+("center"===t?V/2:0),c=0===e&&"center"!==t?n+5:n,u=0===e?+o.slice(11,13):pe(k(f),i);f.push(u);const d="top"===s?W-m:F+m;g.push(r([c+e*V,d],{value:String(u),...l,...a})),e===G.mainXCell-1&&"center"!==t&&g.push(r([J-1,d],{value:String(pe(k(f),i)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=h,o=N+("center"===t?V/2:0),i=0===e&&"center"!==t?o+5:o,n="top"===d?m:ie-m;v.push(r([i+e*V,n],{value:String(p[e]),...l,...h})),e===G.mainXCell-1&&"center"!==t&&v.push(r([J-1,n],{value:String(k(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...n});S.value.add(y),S.value.sendToBack(y)}}(),function(){var e;const o=Object.values(oe),i=[],n={},r=le.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:i}=r||{},n=P(o,i,10),l=[0,t],s=[-t/e,0],a=[(F-n-t)/e,F-n],c=[J-N,e*(J-N)+t];let u=[],d=[];function h([o,i]){return Math.abs(i-e*o-t)<=1}function f([e,t]){const[o,i]=[...p([e,t])];return o>=N&&o<=J&&i>=n&&i<=F}function p([e,t]){return[N+e,F-t]}return h(l)&&f(l)&&(u=p(l)),h(s)&&f(s)&&(u=p(s)),h(a)&&f(a)&&(d=p(a)),h(c)&&f(c)&&(d=p(c)),[...u,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:n,show:r}=le.find((e=>e.key===o));if(r){const r=P(o,n,0);i.push(t([N,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:x(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,h]=[E(l.time)-N,F-P(o,a,l.value)],[f,p]=[E(u.time)-N,F-P(o,a,u.value)],g=(p-h)/(f-d),v=h-d*g,y=s(g,v);y.length>0&&(i.push(t(y,{...e})),Object.assign(n,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=n,a=144e5,c=s(o,r-(E(x(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-E(l.time))*o);c.length>0&&i.push(t(c,{...e}))}}})),S.value.add(...i)}(),ae(),function(){function e(e,t){const o=le.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}C.event.evented&&S.value.on("mouse:up",(t=>{var o,i;if(3===t.button){const{x:n=0,y:r=0}=t.pointer||{};n>=N&&n<=J&&r>=W&&r<=F&&(A.point={x:n,y:r},A.show=!0,t.target?(A.target=t.target,A.list=[(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.220"))||"删除节点"],[...se].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&A.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(A.target=null,A.list=[(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.219"))||"新增节点"],le.filter((e=>e.show)).forEach((o=>{if(!M([...se],n,"key").includes(o.key)){if(["cervix","fetalPresentation"].includes(o.key)&&r<te)return;A.list.push(e(o,t.pointer))}})),1===A.list.length&&(A.show=!1,I("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let i=W;const n=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,i],{value:o,...l,originY:"top",...e.titleStyle});o&&(i+=s.height+15,n.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:i},icon:{left:t,topY:i,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...C.event}},"vertical");i+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),T(c)?(de(c),he(c)):Y.show=!1})),c.on("mouseup:before",(e=>{if(Y.show=!1,0===e.e.button&&T(c))if(M([...se],c.left,"key").includes(c.origin.key))I("repeat");else{const e={data:{time:X(c.left),value:L(c.origin.key,c.top)},...c.origin};O("add",e),ce(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),n.push(r,l)}var c})),o(n),S.value.add(...n)}function o(e){const t=k(e),o=(F-W)/2,i=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-i;e.set({top:t,originTop:t})}))}t(_,$/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(O("remove",o),ce(o,"remove")):(Object.assign(o,{data:{time:X(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),O("add",o),ce(o))},redrawPoints:ue}}export{S as useBirthProcess};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as s}from"date-fns";import{getType as a,getTime as u,isOneLine as d,isOverlapPoint as c,getFloorNumber as p,isValidValue as f,setOtherType as h,isEffectiveNode as v,deleteProperty as g,getIndex as y}from"../../utils/index.js";import{cloneDeep as m,omit as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useShadow as j}from"../useShadow.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as S,OVERLAP as Y}from"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{promiseTimeout as E}from"@vueuse/shared";function M(M,C,$,T,V,A,P,R,I,X){r(M,C);const{getEqualXTypes:B,handleAddPrevent:D,getPointEventProps:H}=L(M,$,C),{createShadowLines:W}=j(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:K,originX:q,endX:G,originY:N,endY:J,itemList:Q,event:U,vitalSignsOriginY:Z,painOriginY:ee,hospitalizationDate:te,config:ie,canvasHeight:ne,painSurplusCell:oe,iconsWidth:le,canvasWidth:re,borderStyle:se}=C,ae=new Set,ue=["xinmai","mai"],de=new Map,ce=new Set,pe=new Set,fe=new Set,he=m(z.yScaleValue),ve=new Set;function ge(n){var o;const l=he.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ae.size&&M.value.remove(...ae),ae.clear(),de.size>1)){if(n){const{type:e,key:t}=n.origin||{};if("pulse"===e){const e=de.get(t),i=null==e?void 0:e.findIndex((e=>e[0]===n.left));e.splice(i,1,[n.left,n.top])}}const o=function(){const e=[],t=[],i=[];for(const e of de)t.push(e[1]),e[0]===ue[0]&&e[1].forEach((e=>{(de.get(ue[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&r.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(fe).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===ue[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&M.value.remove(e.rightLine):e.leftLine&&M.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((n=>{const o=n.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(n,s._angle,s.space,w(s,["_angle","space"]))),e.forEach((e=>{ae.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(n);i.forEach((i=>{const n=t([...x(i)],{...s,originX:"center"});e.push(n),ae.add(n)}))}M.value.add(...e)}ae.add(l),M.value.add(l)}))}}function ye(e,r,s){var a;const{type:u,riseStyle:c={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:w={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:E,textStyle:C}=j,A=[],R=[],X=[];let B=null;const D=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&xe(e.time),W=d(s);if(null==(a=e.list)||a.forEach(((a,d)=>{var j,z,F,q;const G=W?S.find((e=>e.key===a.key)):e,N=be(D(a)?{...a,value:k.fixedValue}:a,s),J=e.list[d+1],Q=J?be(D(J)?{...J,value:k.fixedValue}:J,s):void 0,te=J?W?S.find((e=>e.key===J.key)):e:{},{title:le=""}=G;if(le===((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.235"))||"脉搏")&&te.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.235"))||"脉搏")&&te.title===((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")||!N||!Q||p(N[0],1)!==p(Q[0],1))N&&B&&(N[0]=B),B=null;else{const e=N[0]-_/2;N[0]=e+_/4,Q[0]=B=N[0]+_/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ie.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=Z.originY+K?e[1]+K:e[1]-K,r=o([e[0],l],{value:D(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-K}}(N,a,G),function(e,r,s,a){var d,p,h;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!xe(r.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!r.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=T(r.time);let j,L,S,Y,E,M;if(r.noRise&&v.show){const t=O(v,r)?V(u,35):(null==e?void 0:e[1])||0;if(v.text)S=o([b,O(v,r)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),r.value||fe.add(S);else if(r.value){S=l([b,t,t+2*K],{...v.style})}S&&X.push(S),S&&O(v,r)&&ve.add(S)}if(null==e?void 0:e[1]){if(r.rise&&c.show&&c.text&&(Y=o([b,e[1]-(x?K:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(Y)),r.verified){const t=(null==(d=null==g?void 0:g.position)?void 0:d[w])||"top";E=o(["top-right"===t?b+_/2:b,e[1]-(x?K:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(f(r.physicsReduce)||f(r.drugReduce)){const o=V(u,null!=(p=r.physicsReduce)?p:r.drugReduce),l=o<e[1]&&(null==ie?void 0:ie.hypothermyViewCustom)?b+_/2:b;j=t([...e,l,o],{...m,...y.line,...i}),L=n((null==(h=null==y?void 0:y.point)?void 0:h.type)||"circle",{left:l,top:o,...y.point,...i,originY:o===ne?"bottom":"center"}),j&&X.push(j),L&&X.push(L)}r.respirator&&(M=n(k.type,{left:b,top:e[1]-(x?K:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(M))}Object.assign(a,{reduceLine:{obj:j,type:"line"},noRiseText:{obj:S,top:v.text?5:2*K,isFixed:O(v,r)},riseText:{obj:Y,top:(x?-K:0)-5},verifiedText:{obj:E,left:_/2,top:(x?-K:0)-5},reducePoint:{obj:L,type:"reduce"},respirator:{obj:M,top:(x?-K:0)-5}})}(N,a,G,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const r=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*K,i=[e[1]-K/2,t];t<Z.originY&&(t=e[1]+2.5*K,i=[t,e[1]+K/2]),a=l([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>r){const t=a?e[1]+K/2+a.height:e[1]+K;d=o([e[0],t],i),X.push(d)}+t.value<s&&(d=o([e[0],e[1]-K],i),X.push(d))}if(L.show&&+t.value<s){const t=e[1];if(L.text)c=o([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*K;c=l([e[0],t,i],{...L.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-K},belowMinValue:{obj:c,top:L.text?5:2*K,moveHide:!0}})}(N,a,G,re),function(i,o,l,a,d,c){let p,f;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:j="circle",overlapKey:L}=d,S=g.height?g.height/2:5,Y=e.list[a+1];let O=m(i),B=m(o);const z=me(u,e.list[a].value),F=()=>"pulse"==u&&l.pacemakerShow?w.value:D(l)?k.type:z&&"number"===E?0:j,_=e=>e&&v.show&&v.fixed&&xe(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(l.breakpoint)return!1;if("temperature"===u&&(i||_(l))&&(o||_(Y))){const e=V(u,35);return i||(O=[T(l.time),e]),o||(B=[T(Y.time),e]),!0}return!!i&&!!o})()){O&&B&&z&&me(u,Y.value)&&!oe[1]&&"icon"===E&&(O[1]=O[1]-S,B[1]=B[1]-S),f=t([...O,...B],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(i&&o&&(null==e?void 0:e.top)<i[1]&&(null==ie?void 0:ie.hypothermyViewCustom)){const i=t([e.left,e.top,...o],{...y});X.unshift(i),Object.assign(c,{reduceRightLine:{obj:i,type:"reduce"}}),f.set("stroke","transparent")}}const K=F(),q=R[a-1],G={origin:{data:D(l)?{...l,value:k.fixedValue}:l,title:x,key:b||"",overlapKey:L,unit:s.unit,type:u,_type:h(x,u),dataIndex:r,index:a,isOneLine:W},leftLine:q,rightLine:f,otherObj:c,...l.pacemakerShow&&"pulse"==u?w.style:D(l)?k.style:g,...H(),lockMovementX:!0,...z?{selectable:!1,evented:!1,..."number"===E?C:{}}:{}};i&&(q?G.leftLine.set("x2",i[0]):G.leftLine=null,p=n(K,{left:i[0],top:z&&!oe[1]?i[1]-S:i[1],...G}));R.push(f),p&&(b===ue[1]?ce.add(p):D(l)||pe.add(p),function(e){U.hovered&&(e.on("mouseover",(()=>{we(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?ee:Z;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(M.value.remove(i),delete e.otherObj.obj)))})),ge(e)}(e),U.hovered&&we(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=P(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};M.value.discardActiveObject(),$("change",n),Le(n,"change")}}))}(p),A.push(p),fe.add(p))}(N,Q,a,d,G,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&p(e.left,1)===p(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};ue.forEach((t=>{e[t]=A.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),de.set(t,i(e[t]))}))}else{const{key:t}=e;de.set(t,i(A))}}const z=R.filter((e=>e));M.value.add(...z,...A,...X)}function me(e,t){return"pain"===e&&0==t}function we(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||A(e.left)).slice(-5)}`;I.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:P(o,e.top);if(f(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(f(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],I.show=!0}function xe(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=u(e);return l>=n&&l<=o}function be(e,t){const i="pain"===t.type?ee:Z;if(!v(e)||!xe(e.time))return;const n=T(e.time),o=V(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function je(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=u(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=u(`${A(e)}:00`);return te&&l<u(te)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function Le(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=he.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;ke()}function ke(){var e;fe.size&&(null==(e=M.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...fe]))),fe.clear(),Se()}function Se(e){de.clear(),fe.clear(),ce.clear(),ve.clear(),pe.clear(),he.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||ye(e,i,t)})))})),ge(),[...fe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=he.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const o=Object.assign({},Y,z.overlap||{}),l=[];ce.size&&[...ce].forEach((e=>{[...pe].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key,r=t.origin.overlapKey;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let a=r||"koumai";"yemai"===e&&(a=e);const u=r||e;l.push(n(a,{...o[u],...s}))}}}))})),setTimeout((()=>{M.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),fe.add(e)}))}))}()}return function(){const t=new e.Rect({left:le,top:0,width:re-le-se.strokeWidth,height:ne-se.strokeWidth,fill:"transparent",...se});M.value.add(t)}(),Se((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const i=V(e.type,e.positionLine.value),n=t([q,i,G,i],e.positionLine);M.value.add(n)}(e))),M.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!C.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){X.point={x:e,y:i},X.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(X.list=[...k]),"pain"===l&&(X.list=[...S]),X.target=n;else{X.target=null,X.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],Q.forEach((t=>{if(!B([...fe],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?ee:Z;i>=e.originY&&i<=e.endY&&X.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:a(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=je(e);n&&1!==X.list.length||(X.show=!1,1===X.list.length&&n&&D("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ne&&$("click:grid",{x:e,y:t,time:A(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,a=g(i,[...k,...S]);a[`${e.type}`]=e.value,a.changeTime=s(new Date,"yyyy-MM-dd HH:mm"),o&&(a.key=t.origin.key);const u={...t.origin,data:a};$("change",u),Le(u,"change")}else{const t={data:{time:A(e.pointer.x),value:P(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};$("add",t),Le(t)}},setPopup:we,isAddPoint:je,updateData:Le,redrawPoints:ke,gridPoints:fe,fixedNoRisePoints:ve}}function O(e,t){return e.fixed||!t.value&&0!==t.value}export{M as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as s}from"date-fns";import{getType as a,getTime as u,isOneLine as d,isOverlapPoint as c,getFloorNumber as p,isValidValue as f,setOtherType as h,isEffectiveNode as v,deleteProperty as g,getIndex as y}from"../../utils/index.js";import{cloneDeep as m,omit as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useShadow as j}from"../useShadow.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as S,OVERLAP as Y}from"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{promiseTimeout as E}from"@vueuse/shared";function M(M,C,T,$,P,V,A,R,I,X){r(M,{...C,isTemperature:!0});const{getEqualXTypes:H,handleAddPrevent:B,getPointEventProps:D}=L(M,T,C),{createShadowLines:W}=j(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:K,originX:q,endX:G,originY:N,endY:J,itemList:Q,event:U,vitalSignsOriginY:Z,painOriginY:ee,hospitalizationDate:te,config:ie,canvasHeight:ne,painSurplusCell:oe,iconsWidth:le,canvasWidth:re,borderStyle:se,painScalePositionSurplusHeight:ae}=C,ue=new Set,de=["xinmai","mai"],ce=new Map,pe=new Set,fe=new Set,he=new Set,ve=m(z.yScaleValue),ge=new Set;function ye(n){var o;const l=ve.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ue.size&&M.value.remove(...ue),ue.clear(),ce.size>1)){if(n){const{type:e,key:t}=n.origin||{};if("pulse"===e){const e=ce.get(t),i=null==e?void 0:e.findIndex((e=>e[0]===n.left));e.splice(i,1,[n.left,n.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ce)t.push(e[1]),e[0]===de[0]&&e[1].forEach((e=>{(ce.get(de[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&r.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(he).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===de[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&M.value.remove(e.rightLine):e.leftLine&&M.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((n=>{const o=n.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(n,s._angle,s.space,w(s,["_angle","space"]))),e.forEach((e=>{ue.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(n);i.forEach((i=>{const n=t([...x(i)],{...s,originX:"center"});e.push(n),ue.add(n)}))}M.value.add(...e)}ue.add(l),M.value.add(l)}))}}function me(e,r,s){var a;const{type:u,riseStyle:c={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:w={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:E,textStyle:C}=j,V=[],R=[],X=[];let H=null;const B=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&be(e.time),W=d(s);if(null==(a=e.list)||a.forEach(((a,d)=>{var j,z,F,q;const G=W?S.find((e=>e.key===a.key)):e,N=je(B(a)?{...a,value:k.fixedValue}:a,s),J=e.list[d+1],Q=J?je(B(J)?{...J,value:k.fixedValue}:J,s):void 0,te=J?W?S.find((e=>e.key===J.key)):e:{},{title:le=""}=G;if(le===((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.235"))||"脉搏")&&te.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.235"))||"脉搏")&&te.title===((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")||!N||!Q||p(N[0],1)!==p(Q[0],1))N&&H&&(N[0]=H),H=null;else{const e=N[0]-_/2;N[0]=e+_/4,Q[0]=H=N[0]+_/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ie.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=Z.originY+K?e[1]+K:e[1]-K,r=o([e[0],l],{value:B(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-K}}(N,a,G),function(e,r,s,a){var d,p,h;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!be(r.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!r.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=$(r.time);let j,L,S,Y,E,M;if(r.noRise&&v.show){const t=O(v,r)?P(u,35):(null==e?void 0:e[1])||0;if(v.text)S=o([b,O(v,r)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),r.value||he.add(S);else if(r.value){S=l([b,t,t+2*K],{...v.style})}S&&X.push(S),S&&O(v,r)&&ge.add(S)}if(null==e?void 0:e[1]){if(r.rise&&c.show&&c.text&&(Y=o([b,e[1]-(x?K:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(Y)),r.verified){const t=(null==(d=null==g?void 0:g.position)?void 0:d[w])||"top";E=o(["top-right"===t?b+_/2:b,e[1]-(x?K:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(f(r.physicsReduce)||f(r.drugReduce)){const o=P(u,null!=(p=r.physicsReduce)?p:r.drugReduce),l=o<e[1]&&(null==ie?void 0:ie.hypothermyViewCustom)?b+_/2:b;j=t([...e,l,o],{...m,...y.line,...i}),L=n((null==(h=null==y?void 0:y.point)?void 0:h.type)||"circle",{left:l,top:o,...y.point,...i,originY:o===ne?"bottom":"center"}),j&&X.push(j),L&&X.push(L)}r.respirator&&(M=n(k.type,{left:b,top:e[1]-(x?K:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(M))}Object.assign(a,{reduceLine:{obj:j,type:"line"},noRiseText:{obj:S,top:v.text?5:2*K,isFixed:O(v,r)},riseText:{obj:Y,top:(x?-K:0)-5},verifiedText:{obj:E,left:_/2,top:(x?-K:0)-5},reducePoint:{obj:L,type:"reduce"},respirator:{obj:M,top:(x?-K:0)-5}})}(N,a,G,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const r=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*K,i=[e[1]-K/2,t];t<Z.originY&&(t=e[1]+2.5*K,i=[t,e[1]+K/2]),a=l([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>r){const t=a?e[1]+K/2+a.height:e[1]+K;d=o([e[0],t],i),X.push(d)}+t.value<s&&(d=o([e[0],e[1]-K],i),X.push(d))}if(L.show&&+t.value<s){const t=e[1];if(L.text)c=o([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*K;c=l([e[0],t,i],{...L.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-K},belowMinValue:{obj:c,top:L.text?5:2*K,moveHide:!0}})}(N,a,G,re),function(i,o,l,a,d,c){let p,f;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:j="circle",overlapKey:L}=d,S=g.height?g.height/2:5,Y=e.list[a+1];let O=m(i),H=m(o);const z=we(u,e.list[a].value),F=()=>"pulse"==u&&l.pacemakerShow?w.value:B(l)?k.type:z&&"number"===E?0:j,_=e=>e&&v.show&&v.fixed&&be(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(l.breakpoint)return!1;if("temperature"===u&&(i||_(l))&&(o||_(Y))){const e=P(u,35);return i||(O=[$(l.time),e]),o||(H=[$(Y.time),e]),!0}return!!i&&!!o})()){O&&H&&z&&we(u,Y.value)&&!oe[1]&&!ae&&"icon"===E&&(O[1]=O[1]-S,H[1]=H[1]-S),f=t([...O,...H],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(i&&o&&(null==e?void 0:e.top)<i[1]&&(null==ie?void 0:ie.hypothermyViewCustom)){const i=t([e.left,e.top,...o],{...y});X.unshift(i),Object.assign(c,{reduceRightLine:{obj:i,type:"reduce"}}),f.set("stroke","transparent")}}const K=F(),q=R[a-1],G={origin:{data:B(l)?{...l,value:k.fixedValue}:l,title:x,key:b||"",overlapKey:L,unit:s.unit,type:u,_type:h(x,u),dataIndex:r,index:a,isOneLine:W},leftLine:q,rightLine:f,otherObj:c,...l.pacemakerShow&&"pulse"==u?w.style:B(l)?k.style:g,...D(),lockMovementX:!0,...z?{selectable:!1,evented:!1,..."number"===E?C:{}}:{}};i&&(q?G.leftLine.set("x2",i[0]):G.leftLine=null,p=n(K,{left:i[0],top:!z||oe[1]||ae?i[1]:i[1]-S,...G}));R.push(f),p&&(b===de[1]?pe.add(p):B(l)||fe.add(p),function(e){U.hovered&&(e.on("mouseover",(()=>{xe(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?ee:Z;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(M.value.remove(i),delete e.otherObj.obj)))})),ye(e)}(e),U.hovered&&xe(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=A(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};M.value.discardActiveObject(),T("change",n),ke(n,"change")}}))}(p),V.push(p),he.add(p))}(N,Q,a,d,G,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&p(e.left,1)===p(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};de.forEach((t=>{e[t]=V.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ce.set(t,i(e[t]))}))}else{const{key:t}=e;ce.set(t,i(V))}}const z=R.filter((e=>e));M.value.add(...z,...V,...X)}function we(e,t){return"pain"===e&&0==t}function xe(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||V(e.left)).slice(-5)}`;I.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:A(o,e.top);if(f(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(f(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],I.show=!0}function be(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=u(e);return l>=n&&l<=o}function je(e,t){const i="pain"===t.type?ee:Z;if(!v(e)||!be(e.time))return;const n=$(e.time),o=P(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function Le(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=u(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=u(`${V(e)}:00`);return te&&l<u(te)?(B("exceedMin"),!1):!(l>o)||(B("exceedMax"),!1)}function ke(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=ve.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;Se()}function Se(){var e;he.size&&(null==(e=M.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...he]))),he.clear(),Ye()}function Ye(e){ce.clear(),he.clear(),pe.clear(),ge.clear(),fe.clear(),ve.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||me(e,i,t)})))})),ye(),[...he].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ve.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const o=Object.assign({},Y,z.overlap||{}),l=[];pe.size&&[...pe].forEach((e=>{[...fe].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key,r=t.origin.overlapKey;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let a=r||"koumai";"yemai"===e&&(a=e);const u=r||e;l.push(n(a,{...o[u],...s}))}}}))})),setTimeout((()=>{M.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),he.add(e)}))}))}()}return function(){const t=new e.Rect({left:le,top:0,width:re-le-se.strokeWidth,height:ne-se.strokeWidth,fill:"transparent",...se});M.value.add(t)}(),Ye((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const i=P(e.type,e.positionLine.value),n=t([q,i,G,i],e.positionLine);M.value.add(n)}(e))),M.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!C.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){X.point={x:e,y:i},X.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(X.list=[...k]),"pain"===l&&(X.list=[...S]),X.target=n;else{X.target=null,X.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],Q.forEach((t=>{if(!H([...he],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?ee:Z;i>=e.originY&&i<=e.endY&&X.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:a(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=Le(e);n&&1!==X.list.length||(X.show=!1,1===X.list.length&&n&&B("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ne&&T("click:grid",{x:e,y:t,time:V(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,a=g(i,[...k,...S]);a[`${e.type}`]=e.value,a.changeTime=s(new Date,"yyyy-MM-dd HH:mm"),o&&(a.key=t.origin.key);const u={...t.origin,data:a};T("change",u),ke(u,"change")}else{const t={data:{time:V(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};T("add",t),ke(t)}},setPopup:xe,isAddPoint:Le,updateData:ke,redrawPoints:Se,gridPoints:he,fixedNoRisePoints:ge}}function O(e,t){return e.fixed||!t.value&&0!==t.value}export{M as useCenter};