cnhis-design-vue 3.2.16-beta.8 → 3.2.17-release.0
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.
- package/es/components/base-search/style/index.css +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/card-reader-sdk-cn/index.d.ts +18 -0
- package/es/components/card-reader-sdk-cn/index.js +1 -0
- package/es/components/card-reader-sdk-cn/src/henan/index.d.ts +17 -0
- package/es/components/card-reader-sdk-cn/src/henan/index.js +1 -0
- package/es/components/classification/index.d.ts +9 -0
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +9 -0
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +9 -0
- package/es/components/classification/src/index.vue.d.ts +9 -0
- package/es/components/expand-field/index.d.ts +28 -1
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +28 -1
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +28 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +28 -1
- package/es/components/expand-field/src/index.vue.d.ts +28 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +1 -0
- package/es/components/form-config/index.d.ts +147 -24
- package/es/components/form-config/src/FormConfig.vue.d.ts +147 -24
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +8 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +210 -95
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/text.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +3 -1
- package/es/components/iho-chat/index.d.ts +321 -365
- package/es/components/iho-chat/src/Index.vue.d.ts +321 -365
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +18 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +18 -0
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +65 -182
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +94 -182
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +37 -20
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +19 -91
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +10 -91
- package/es/components/iho-chat/src/components/MessageEvent.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +18 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +12 -46
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SelectLabel.vue.d.ts +54 -0
- package/es/components/iho-chat/src/components/SelectLabel.vue.js +1 -0
- package/es/components/iho-chat/src/components/SelectLabel.vue2.js +1 -0
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/Video.vue.d.ts +9 -0
- package/es/components/iho-chat/src/hooks/useData.d.ts +30 -0
- package/es/components/iho-chat/src/hooks/useData.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +9 -0
- package/es/components/iho-chat/src/types/index.d.ts +9 -0
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +3 -0
- package/es/components/index.css +1 -1
- package/es/components/quick-search/style/index.css +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +7 -7
- package/es/components/select-label/index.d.ts +7 -7
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue.d.ts +5 -1
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue.d.ts +7 -7
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue.d.ts +5 -1
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -1
- package/es/components/select-label/src/index.vue.d.ts +7 -7
- package/es/components/select-label/src/types/index.d.ts +4 -1
- package/es/components/select-label/style/index.css +1 -1
- package/es/components/select-person/index.d.ts +28 -1
- package/es/components/select-person/src/SelectPerson.vue.d.ts +15 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/index.vue.d.ts +28 -1
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +2 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +9 -0
- package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue.d.ts +8 -0
- package/es/components/table-filter/src/components/classify-filter/components/SelectLabel.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +9 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +9 -0
- package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue.d.ts +2 -7
- package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue.d.ts +8 -0
- package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +11 -7
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +11 -7
- package/es/components/table-filter/src/types/index.d.ts +3 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -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
|
-
|
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
|
-
|
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};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,w,b,Y,j,x){const C=15,D=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=w.data.grid||{};return~
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,w,b,Y,j,x){const C=15,D=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=w.data.grid||{};return~Q.value?e:[0,0]})),H=a((()=>{var e,a;const t=(null==(a=null==(e=w.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===Q.value?t[0]=t[0]+V.value[1]:Q.value>0&&(t[2]=t[2]+V.value[0]),t})),P=a((()=>0===Q.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:Q.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),X=a((()=>{const{top:e}=w.data;return e.date.show&&(e.date.height||C)||0})),L=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||C)||0})),M=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||C)||0})),I=a((()=>{var e,a,t;const{top:l}=w.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),O=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||C)||0})),N=a((()=>{var e;const{bottom:a}=w.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),R=a((()=>{const{mainYCell:e,subYCell:a,painSubYCell:t=5}=w.data.grid,l=Q.value>0?V.value[1]:V.value[0];return(e-1)*a+t+H.value[0]+H.value[2]+l})),W=a((()=>{var e;const{width:a,right:t=null,top:l}=w.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),$=a((()=>W.value-H.value[1]*z.value)),A=a((()=>{const{top:e,left:a}=w.data;return e.titleWidth+B.value})),T=a((()=>{const{bottom:e=null,height:a}=w.data;if(!e)return a;return a-(e.height||30)})),q=a((()=>{var e;const{top:a}=w.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||C)||0;return X.value+t+l+L.value+M.value+O.value})),z=a((()=>(W.value-A.value)/k.value)),G=a((()=>(T.value-q.value)/R.value)),B=a((()=>{var e,a;const{left:t}=w.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),E=a((()=>{var e,a;const{top:t,grid:l}=w.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=A.value-z.value;const r=t.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(d(c(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=z.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+z.value/2,scaleCell:(l-t)/z.value}}))));return v(o)})),F=a((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),J=a((()=>{const{left:e}=w.data;return v(e.yScaleValue.filter((e=>e.show)).map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t,isOneLine:o(e)}))))))})),K=a((()=>{const{left:e}=w.data,a=e.yScaleValue.find((e=>"pain"===e.type));if(!a)return 0;const{numberVerticalPosition:t="bottom"}=a;return"center"===t?G.value/2:0})),Q=a((()=>{const{left:e}=w.data,a=e.yScaleValue.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),U=a((()=>{const{painSubYCell:e=5}=w.data.grid;return-1===Q.value?0:G.value*e})),Z=a((()=>{const{left:e}=w.data,a={originY:q.value+V.value[0]*G.value,endY:T.value-V.value[1]*G.value-K.value};return 0===Q.value&&e.yScaleValue.length>1?a.endY=a.originY+U.value-K.value:Q.value===e.yScaleValue.length-1&&(a.originY=a.endY-U.value+K.value),a})),_=a((()=>{const{left:e}=w.data,a={originY:q.value+H.value[0]*G.value,endY:T.value-H.value[2]*G.value};return 0===Q.value&&e.yScaleValue.length>1?a.originY=Z.value.endY+K.value+H.value[0]*G.value:Q.value===e.yScaleValue.length-1&&(a.endY=Z.value.originY-H.value[2]*G.value),a})),ee=a((()=>{var e,a;const{top:t,grid:l}=w.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),ae=a((()=>{var e;const{left:a,right:t}=w.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>s(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),te=e({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...u,...w.data.borderStyle||{}},selectionStyle:w.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:O.value,topList:ee.value,breathingHeight:N.value,hospitalizationDate:w.data.hospitalizationDate,grid:w.data.grid,top:w.data.top,left:w.data.left,right:w.data.right,bottom:w.data.bottom,other:w.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:Z.value,vitalSignsOriginY:_.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:B.value,originX:A.value,originY:q.value,endX:W.value,endXLimit:$.value,endY:T.value,xCellWidth:z.value,yCellHeight:G.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:ae.value,config:w.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:P.value,painScalePositionSurplusHeight:K.value}),{computedX:le,computedY:ue,getXValue:ie,getYValue:ne}=i(te);return t((()=>S.value),(e=>{e&&function(){h(S,te);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=m(S,te,b,le,ue,ie,ne,w.addRenderItem,j,x);D.redrawPoints=l,D.clickMenu=u;const{drawScaleValue:o}=p(S,te,b,e,j,le,ue,ie,ne,a,t,i);g(S,te,o),f(S,te),y(S,te,b,le,ue,r);const{select:s}=n(S,te,b);D.select=s}()}),{immediate:!0}),{propItems:te,...l(D)}}export{S as useTemperatureChart};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as s}from"./useDraw.js";function n(n,
|
1
|
+
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as s}from"./useDraw.js";function n(n,i){var u,r,t;const{gridYNumber:o,originY:d,grid:a,originX:b,endX:c,xCellWidth:C,yCellHeight:g,gridXNumber:S,endY:m,borderStyle:p,mainSurplusCell:X,isTemperature:f}=i,Y=null!=(u=null!=X?X:i.surplusCell)?u:[0,0,0,0],h=[],y=[],v=new Set,j=(null==(r=a.mainLineStyle)?void 0:r.x)||{},x=(null==(t=a.mainLineStyle)?void 0:t.y)||{},L=a.subLineStyle||j,w=a.subSecondLineStyle||{},{originY:O=0,endY:N=0}=i.vitalSignsOriginY||{},T=Math.round((m-N)/g);for(let e=0;e<=o;e++){const s=d+~~(g*(o-e)),n={...p,...L},i=l([b,s,c,s],n);if(!f&&(e-Y[2])%a.subYCell==0&&e<=o-Y[0])i.set(j),v.add(i);else if(f){const l=d+g*(o-e);l>=O&&l<=N+1&&(e-T)%a.subYCell==0?(i.set(j),v.add(i)):h.push(i)}else h.push(i)}for(let e=0;e<=S;e++){const s=b+~~(C*e),n={...p,...a.subXCell?L:x};a.subXCell&&e%a.subXCell==0?Object.assign(n,{...0!==e&&e!==S?x:p}):a.subSecondXCell&&e%a.subSecondXCell==0&&Object.assign(n,w);const i=l([s,d,s,m],n);a.subXCell&&e%a.subXCell==0?v.add(i):y.push(i)}const k=new e.Group([...h,...y,...v],s);n.value.add(k),n.value.sendToBack(k)}export{n as useGrid};
|