cnhis-design-vue 3.2.11-release.1 → 3.2.11-release.3
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/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/expand-field/index.d.ts +34 -4
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +34 -4
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +34 -4
- package/es/components/expand-field/src/components/form.vue.d.ts +34 -4
- package/es/components/expand-field/src/index.vue.d.ts +34 -4
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +2 -2
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/form-config/index.d.ts +3 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
- package/es/components/form-render/src/components/renderer/remoteSearch.d.ts +3 -3
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/components/form-render/src/utils/business.js +1 -1
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue.d.ts +673 -0
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/treeFilter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rowDragPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +19 -0
- package/es/components/iho-table/src/utils/index.d.ts +17 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/select-person/index.d.ts +34 -4
- package/es/components/select-person/src/SelectPerson.vue.d.ts +11 -4
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/SelectPersonType.vue.d.ts +10 -0
- package/es/components/select-person/src/SelectPersonType.vue2.js +1 -1
- package/es/components/select-person/src/index.vue.d.ts +34 -4
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/shared/hooks/useFormRequest/index.js +1 -1
- package/es/shared/hooks/useFormRequest/types.d.ts +4 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -520,6 +520,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
520
520
|
type: PropType<AnyObject>;
|
521
521
|
default: () => {};
|
522
522
|
};
|
523
|
+
forceShowSelectAll: {
|
524
|
+
type: BooleanConstructor;
|
525
|
+
};
|
523
526
|
}, {
|
524
527
|
$attrs: {
|
525
528
|
[x: string]: unknown;
|
@@ -622,6 +625,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
622
625
|
type: PropType<AnyObject>;
|
623
626
|
default: () => {};
|
624
627
|
};
|
628
|
+
forceShowSelectAll: {
|
629
|
+
type: BooleanConstructor;
|
630
|
+
};
|
625
631
|
}>> & {
|
626
632
|
onCheck?: ((...args: any[]) => any) | undefined;
|
627
633
|
onCheckWithLevel?: ((...args: any[]) => any) | undefined;
|
@@ -710,6 +716,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
710
716
|
type: PropType<AnyObject>;
|
711
717
|
default: () => {};
|
712
718
|
};
|
719
|
+
forceShowSelectAll: {
|
720
|
+
type: BooleanConstructor;
|
721
|
+
};
|
713
722
|
}, {
|
714
723
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
715
724
|
defaultList: {
|
@@ -793,6 +802,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
793
802
|
type: PropType<AnyObject>;
|
794
803
|
default: () => {};
|
795
804
|
};
|
805
|
+
forceShowSelectAll: {
|
806
|
+
type: BooleanConstructor;
|
807
|
+
};
|
796
808
|
}>> & {}>>;
|
797
809
|
emit: any;
|
798
810
|
keyword: import("vue").Ref<string>;
|
@@ -943,6 +955,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
943
955
|
type: PropType<AnyObject>;
|
944
956
|
default: () => {};
|
945
957
|
};
|
958
|
+
forceShowSelectAll: {
|
959
|
+
type: BooleanConstructor;
|
960
|
+
};
|
946
961
|
}>>, {
|
947
962
|
data: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
|
948
963
|
defaultList: ((string | number) | {
|
@@ -974,6 +989,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
974
989
|
switchTypeProps: AnyObject[];
|
975
990
|
switchTypeData: AnyObject;
|
976
991
|
tagProps: AnyObject;
|
992
|
+
forceShowSelectAll: boolean;
|
977
993
|
}> | import("vue").DefineComponent<{
|
978
994
|
defaultList: {
|
979
995
|
type: PropType<((string | number) | {
|
@@ -1060,6 +1076,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1060
1076
|
children: string;
|
1061
1077
|
};
|
1062
1078
|
};
|
1079
|
+
forceShowSelectAll: {
|
1080
|
+
type: BooleanConstructor;
|
1081
|
+
};
|
1063
1082
|
}, {
|
1064
1083
|
searchFilterBase: {
|
1065
1084
|
isOpen: boolean;
|
@@ -1071,10 +1090,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1071
1090
|
key: string;
|
1072
1091
|
label: string;
|
1073
1092
|
}[];
|
1074
|
-
labelListName:
|
1075
|
-
dept: string;
|
1076
|
-
role: string;
|
1077
|
-
};
|
1093
|
+
labelListName: any;
|
1078
1094
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1079
1095
|
defaultList: {
|
1080
1096
|
type: PropType<((string | number) | {
|
@@ -1161,6 +1177,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1161
1177
|
children: string;
|
1162
1178
|
};
|
1163
1179
|
};
|
1180
|
+
forceShowSelectAll: {
|
1181
|
+
type: BooleanConstructor;
|
1182
|
+
};
|
1164
1183
|
}>> & {}>>;
|
1165
1184
|
emit: any;
|
1166
1185
|
keyword: import("vue").Ref<string>;
|
@@ -1576,6 +1595,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1576
1595
|
children: string;
|
1577
1596
|
};
|
1578
1597
|
};
|
1598
|
+
forceShowSelectAll: {
|
1599
|
+
type: BooleanConstructor;
|
1600
|
+
};
|
1579
1601
|
}>>, {
|
1580
1602
|
data: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
|
1581
1603
|
defaultList: ((string | number) | {
|
@@ -1607,6 +1629,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1607
1629
|
showSelectType: boolean;
|
1608
1630
|
roleData: (import("naive-ui/es/tree/src/interface").TreeOptionBase & Record<string, unknown> & AnyObject)[];
|
1609
1631
|
roleFields: Record<string, any>;
|
1632
|
+
forceShowSelectAll: boolean;
|
1610
1633
|
}>>;
|
1611
1634
|
getProps: import("vue").ComputedRef<Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1612
1635
|
defaultList: {
|
@@ -1706,6 +1729,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1706
1729
|
type: PropType<AnyObject>;
|
1707
1730
|
default: () => {};
|
1708
1731
|
};
|
1732
|
+
forceShowSelectAll: {
|
1733
|
+
type: BooleanConstructor;
|
1734
|
+
};
|
1709
1735
|
}>> & {
|
1710
1736
|
onCheck?: ((...args: any[]) => any) | undefined;
|
1711
1737
|
onCheckWithLevel?: ((...args: any[]) => any) | undefined;
|
@@ -1812,6 +1838,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1812
1838
|
type: PropType<AnyObject>;
|
1813
1839
|
default: () => {};
|
1814
1840
|
};
|
1841
|
+
forceShowSelectAll: {
|
1842
|
+
type: BooleanConstructor;
|
1843
|
+
};
|
1815
1844
|
}>> & {
|
1816
1845
|
onCheck?: ((...args: any[]) => any) | undefined;
|
1817
1846
|
onCheckWithLevel?: ((...args: any[]) => any) | undefined;
|
@@ -1849,6 +1878,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1849
1878
|
switchTypeProps: AnyObject[];
|
1850
1879
|
switchTypeData: AnyObject;
|
1851
1880
|
tagProps: AnyObject;
|
1881
|
+
forceShowSelectAll: boolean;
|
1852
1882
|
}>>;
|
1853
1883
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("check" | "changeModalVisible")[], "check" | "changeModalVisible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1854
1884
|
visible: {
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{format as u}from"date-fns";import{getType as a,getTime as c,isOneLine as d,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as m,getIndex as y}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as L,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,$,O,T,V,P,R,C,A,I){s(E,$);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,O,$),{createShadowLines:W}=t(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:q,originX:G,endX:N,originY:B,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie,painSurplusCell:ne,iconsWidth:oe,canvasWidth:le,borderStyle:re}=$,se=new Set,ue=["xinmai","mai"],ae=new Map,ce=new Set,de=new Set,pe=new Set,fe=x(z.yScaleValue),he=new Set;function ve(t){var o;const l=fe.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(se.size&&E.value.remove(...se),se.clear(),ae.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ae.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ae)t.push(e[1]),e[0]===ue[0]&&e[1].forEach((e=>{(ae.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)),u=n[i],a=o[s],c=n[i-1],d=n[i+1],p=o[s-1],f=o[s+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&r.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);r.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=j(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(pe).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)=>{t>0&&e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...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(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...n,...s}),se.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...s,originX:"center"});e.push(n),se.add(n)}))}E.value.add(...e)}se.add(l),E.value.add(l)}))}}function ge(e,t,s){var u;const{type:a,riseStyle:c={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:m={},pacemaker:y={},upArrowStyle:b={},limitValueStyle:j={},nonePainPointStyle:w={},belowMinValueStyle:k={},respiratorStyle:L={},dataList:S=[],list:Y=[]}=s,{type:$,textStyle:P}=w,C=[],I=[],X=[];let D=null;const W=e=>"breathe"==a&&e.respirator&&L.type&&L.fixedValue&&!e.value&&ye(e.time);if(null==(u=e.list)||u.forEach(((u,w)=>{const z=d(a)?S.find((e=>e.key===u.key)):e,F=xe(W(u)?{...u,value:L.fixedValue}:u,s),G=e.list[w+1],N=G?xe(W(G)?{...G,value:L.fixedValue}:G,s):void 0,B=G?d(a)?S.find((e=>e.key===G.key)):e:{},{title:J=""}=z;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!F||!N||f(F[0],1)!==f(N[0],1))F&&D&&(F[0]=D),D=null;else{const e=F[0]-_/2;F[0]=e+_/4,N[0]=D=F[0]+_/2}const K={};K.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,r=l([e[0],o],{value:W(t)?L.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-q}}(F,u,z),function(e,t,s,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!ye(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===a)return;if(!t.value&&"breathe"===a)return;const{lineAttr:v={}}=s,{value:y}=u,x=T(t.time);let b,j,w,k,S,Y;if(t.noRise&&p.show){const i=M(p,t)?V(a,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(w);else if(t.value){w=r([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&he.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(k=l([x,e[1]-(y?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(k)),t.verified&&(S=l([x,e[1]-(y?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(S)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,null!=(d=t.physicsReduce)?d:t.drugReduce),r=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+_/2:x;b=i([...e,r,l],{...v,...m.line,...n}),j=o((null==(f=null==m?void 0:m.point)?void 0:f.type)||"circle",{left:r,top:l,...m.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(Y=o(L.type,{left:x,top:e[1]-(y?q:0)-5,originX:"center",originY:"bottom",...L.style}),X.push(Y))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:k,top:(y?-q:0)-5},verifiedText:{obj:S,top:(y?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:Y,top:(y?-q:0)-5}})}(F,u,z,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...Y),s=Math.min(...Y);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=r([e[0],i[0],i[1]],b,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...j};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<s&&(c=l([e[0],e[1]-q],i),X.push(c))}if(k.show&&+t.value<s){const t=e[1];if(k.text)d=l([e[0],e[1]+5],{value:k.text.split("").join("\n"),originY:"top",...k.style});else{const i=t+2*q;d=r([e[0],t,i],{...k.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:k.text?5:2*q,moveHide:!0}})}(F,u,z,K),function(n,l,r,u,c,d){let f,h;const{pointAttr:g={},lineAttr:m={},title:b="",key:j,type:w="circle"}=c,k=e.list[u+1];let S=x(n),Y=x(l);const M=function(e,t){return"pain"===e&&0==t}(a,e.list[u].value),D=()=>"pulse"==a&&r.pacemakerShow?y.value:W(r)?L.type:M&&"number"===$?0:w,z=e=>e&&p.show&&p.fixed&&ye(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(r.breakpoint)return!1;if("temperature"===a&&(n||z(r))&&(l||z(k))){const e=V(a,35);return n||(S=[T(r.time),e]),l||(Y=[T(k.time),e]),!0}return!!n&&!!l})()){h=i([...S,...Y],{...m});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if(n&&l&&(null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...m});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const F=D(),_=I[u-1],q={origin:{data:W(r)?{...r,value:L.fixedValue}:r,title:b,key:j||"",unit:s.unit,type:a,_type:v(b,a),dataIndex:t,index:u},leftLine:_,rightLine:h,otherObj:d,...r.pacemakerShow&&"pulse"==a?y.style:W(r)?L.style:g,lockMovementX:!0,...H(),...M?{selectable:!1,evented:!1,..."number"===$?P:{}}:{}};n&&(_?q.leftLine.set("x2",n[0]):q.leftLine=null,f=o(F,{left:n[0],top:M&&!ne[1]?n[1]-5:n[1],...q}));I.push(h),f&&(j===ue[1]?ce.add(f):W(r)||de.add(f),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;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}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),r&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=R(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),O("change",n),je(n,"change")}}))}(f),C.push(f),pe.add(f))}(F,N,u,w,z,K)})),"pulse"===a){const{key:t}=e;let i=null;ae.set(t,C.map(((e,t,n)=>{var o,l;const r=n[t+1];if(r&&f(e.left,1)===f(r.left,1)){const t=e.left-_/2;e.set("left",t+_/4),null==(o=e.rightLine)||o.set("x1",e.left),i=e.left+_/2,r.set("left",i)}else i&&(null==(l=e.leftLine)||l.set("x2",i),e.set("left",i)),i=null;return[e.left,e.top]})))}const z=I.filter((e=>e));E.value.add(...z,...C,...X)}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:s,physicsReduce:u}=l||{},a="hover"===t?l.value:R(o,e.top);if(h(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(h(u))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),r],A.show=!0}function ye(e){const[t]=F,i=j(F),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function xe(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ye(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 be(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${P(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function je(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=fe.find((e=>e.type===i));if("add"===t){const e=d(i)?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;we()}function we(){var e;pe.size&&(null==(e=E.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}([...pe]))),pe.clear(),ke()}function ke(e){ae.clear(),pe.clear(),ce.clear(),he.clear(),de.clear(),fe.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t.type)&&!e.enable||ge(e,i,t)})))})),ve(),[...pe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=fe.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},S,z.overlap||{}),l=[];ce.size&&[...ce].forEach((e=>{[...de].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...n,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),l.push(o(s,{...i[e],...r}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),pe.add(e)}))}))}()}return function(){const t=new e.Rect({left:oe,top:0,width:le-oe-re.strokeWidth,height:ie-re.strokeWidth,fill:"transparent",...re});E.value.add(t)}(),ke((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.positionLine.value),n=i([G,t,N,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!$.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=N&&t>=B&&t<=J){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...k]),"pain"===o&&(I.list=[...L]),I.target=i;else{I.target=null,I.list=["新增节点"],K.forEach((i=>{if(!X([...pe],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:C?C(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=be(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=N&&t>0&&t<ie&&O("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,r=m(i,[...k,...L]);r[`${e.type}`]=e.value,r.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),d(n)&&(r.key=t.origin.key);const s={...t.origin,data:r};O("change",s),je(s,"change")}else{const t={data:{time:P(e.pointer.x),value:R(e.origin.type,e.pointer.y),...d(e.origin.type)?{key:e.origin.key}:{}},...e.origin};O("add",t),je(t)}},setPopup:me,isAddPoint:be,updateData:je,redrawPoints:we,gridPoints:pe,fixedNoRisePoints:he}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E as useCenter};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{format as u}from"date-fns";import{getType as a,getTime as c,isOneLine as d,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as m,getIndex as y}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as L,PAIN_MENU as k,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,O,$,T,V,P,R,C,A,I){s(E,O);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,$,O),{createShadowLines:W}=t(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:q,originX:G,endX:N,originY:B,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie,painSurplusCell:ne,iconsWidth:oe,canvasWidth:le,borderStyle:re}=O,se=new Set,ue=["xinmai","mai"],ae=new Map,ce=new Set,de=new Set,pe=new Set,fe=x(z.yScaleValue),he=new Set;function ve(t){var o;const l=fe.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(se.size&&E.value.remove(...se),se.clear(),ae.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ae.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ae)t.push(e[1]),e[0]===ue[0]&&e[1].forEach((e=>{(ae.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)),u=n[i],a=o[s],c=n[i-1],d=n[i+1],p=o[s-1],f=o[s+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&r.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);r.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=j(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(pe).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&&E.value.remove(e.rightLine):e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...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(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...n,...s}),se.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...s,originX:"center"});e.push(n),se.add(n)}))}E.value.add(...e)}se.add(l),E.value.add(l)}))}}function ge(e,t,s){var u;const{type:a,riseStyle:c={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:m={},pacemaker:y={},upArrowStyle:b={},limitValueStyle:j={},nonePainPointStyle:w={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:O,textStyle:P}=w,C=[],I=[],X=[];let D=null;const W=e=>"breathe"==a&&e.respirator&&k.type&&k.fixedValue&&!e.value&&ye(e.time),z=d(s);if(null==(u=e.list)||u.forEach(((u,d)=>{const w=z?S.find((e=>e.key===u.key)):e,F=xe(W(u)?{...u,value:k.fixedValue}:u,s),G=e.list[d+1],N=G?xe(W(G)?{...G,value:k.fixedValue}:G,s):void 0,B=G?z?S.find((e=>e.key===G.key)):e:{},{title:J=""}=w;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!F||!N||f(F[0],1)!==f(N[0],1))F&&D&&(F[0]=D),D=null;else{const e=F[0]-_/2;F[0]=e+_/4,N[0]=D=F[0]+_/2}const K={};K.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,r=l([e[0],o],{value:W(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-q}}(F,u,w),function(e,t,s,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!ye(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===a)return;if(!t.value&&"breathe"===a)return;const{lineAttr:v={}}=s,{value:y}=u,x=T(t.time);let b,j,w,L,S,Y;if(t.noRise&&p.show){const i=M(p,t)?V(a,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(w);else if(t.value){w=r([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&he.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(L=l([x,e[1]-(y?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(L)),t.verified&&(S=l([x,e[1]-(y?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(S)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,null!=(d=t.physicsReduce)?d:t.drugReduce),r=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+_/2:x;b=i([...e,r,l],{...v,...m.line,...n}),j=o((null==(f=null==m?void 0:m.point)?void 0:f.type)||"circle",{left:r,top:l,...m.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(Y=o(k.type,{left:x,top:e[1]-(y?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(Y))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:L,top:(y?-q:0)-5},verifiedText:{obj:S,top:(y?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:Y,top:(y?-q:0)-5}})}(F,u,w,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...Y),s=Math.min(...Y);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=r([e[0],i[0],i[1]],b,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...j};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<s&&(c=l([e[0],e[1]-q],i),X.push(c))}if(L.show&&+t.value<s){const t=e[1];if(L.text)d=l([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*q;d=r([e[0],t,i],{...L.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:L.text?5:2*q,moveHide:!0}})}(F,u,w,K),function(n,l,r,u,c,d){let f,h;const{pointAttr:g={},lineAttr:m={},title:b="",key:j,type:w="circle"}=c,L=e.list[u+1];let S=x(n),Y=x(l);const M=function(e,t){return"pain"===e&&0==t}(a,e.list[u].value),D=()=>"pulse"==a&&r.pacemakerShow?y.value:W(r)?k.type:M&&"number"===O?0:w,F=e=>e&&p.show&&p.fixed&&ye(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(r.breakpoint)return!1;if("temperature"===a&&(n||F(r))&&(l||F(L))){const e=V(a,35);return n||(S=[T(r.time),e]),l||(Y=[T(L.time),e]),!0}return!!n&&!!l})()){h=i([...S,...Y],{...m});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if(n&&l&&(null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...m});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const _=D(),q=I[u-1],G={origin:{data:W(r)?{...r,value:k.fixedValue}:r,title:b,key:j||"",unit:s.unit,type:a,_type:v(b,a),dataIndex:t,index:u,isOneLine:z},leftLine:q,rightLine:h,otherObj:d,...r.pacemakerShow&&"pulse"==a?y.style:W(r)?k.style:g,lockMovementX:!0,...H(),...M?{selectable:!1,evented:!1,..."number"===O?P:{}}:{}};n&&(q?G.leftLine.set("x2",n[0]):G.leftLine=null,f=o(_,{left:n[0],top:M&&!ne[1]?n[1]-5:n[1],...G}));I.push(h),f&&(j===ue[1]?ce.add(f):W(r)||de.add(f),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;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}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),r&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=R(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),$("change",n),je(n,"change")}}))}(f),C.push(f),pe.add(f))}(F,N,u,d,w,K)})),"pulse"===a){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&f(e.left,1)===f(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(z){const e={};ue.forEach((t=>{e[t]=C.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ae.set(t,i(e[t]))}))}else{const{key:t}=e;ae.set(t,i(C))}}const F=I.filter((e=>e));E.value.add(...F,...C,...X)}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:s,physicsReduce:u}=l||{},a="hover"===t?l.value:R(o,e.top);if(h(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(h(u))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),r],A.show=!0}function ye(e){const[t]=F,i=j(F),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function xe(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ye(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 be(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${P(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function je(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=fe.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;we()}function we(){var e;pe.size&&(null==(e=E.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}([...pe]))),pe.clear(),Le()}function Le(e){ae.clear(),pe.clear(),ce.clear(),he.clear(),de.clear(),fe.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||ge(e,i,t)})))})),ve(),[...pe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=fe.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},S,z.overlap||{}),l=[];ce.size&&[...ce].forEach((e=>{[...de].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...n,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),l.push(o(s,{...i[e],...r}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),pe.add(e)}))}))}()}return function(){const t=new e.Rect({left:oe,top:0,width:le-oe-re.strokeWidth,height:ie-re.strokeWidth,fill:"transparent",...re});E.value.add(t)}(),Le((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.positionLine.value),n=i([G,t,N,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!O.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=N&&t>=B&&t<=J){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...L]),"pain"===o&&(I.list=[...k]),I.target=i;else{I.target=null,I.list=["新增节点"],K.forEach((i=>{if(!X([...pe],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:C?C(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key,isOneLine:i.isOneLine},pointer:n})}}));const i=be(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=N&&t>0&&t<ie&&$("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,s=m(i,[...L,...k]);s[`${e.type}`]=e.value,s.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),o&&(s.key=t.origin.key);const a={...t.origin,data:s};$("change",a),je(a,"change")}else{const t={data:{time:P(e.pointer.x),value:R(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};$("add",t),je(t)}},setPopup:me,isAddPoint:be,updateData:je,redrawPoints:we,gridPoints:pe,fixedNoRisePoints:he}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E as useCenter};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s}from"../../utils/index.js";import{last as r}from"lodash-es";import"../useEvent.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function p(p,d,g,f,m,v,y,w,S,b,Y,x){var j,C;const{getEqualXTypes:L,handleAddPrevent:X,isGridLimit:N}=c(p,g,d),{originY:T,endY:V,originX:O,endX:k,xCellWidth:E,yCellHeight:M,left:G,vitalSignsOriginY:I,painOriginY:W,painHeight:A,iconsWidth:H,itemList:R,painIndex:_,right:B,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P,painSurplusCell:z}=d;function F(o){var s;if(!(null==o?void 0:o.length))return;const{layout:c}=o[0];let d=H,g=O;"right"===c&&(d=k,g=k+(null!=(s=null==B?void 0:B.width)?s:0));const f=[],m=A&&"right"!==c?o.length-1:o.length,v=(g-d)/m,y=v+(g-d)%m;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:d,style:g,title:f}=n,m=W.originY-z[0]*M,v=l({width:O-H,height:A+(z[0]+z[1])*M,...D},{value:`${f}`,...i,...g||{}},{left:H,top:m}),y=t([H,m,O,m],D),w=[];if(r||h){const{lineXMain:t,textLeft:i}=u(c,H,O-H),l=o.length;o.forEach(((o,u)=>{let c=W.endY-u*M*s;if(0===u&&0===z[1]&&(c=V-5),h&&(!(0===u||u===l-1)||d||0===u&&z[1]>0||u===l-1&&z[0]>0)&&w.push(a(o,n,i,c)),r&&(0!==u||z[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...D,...g});w.push(o)}}))}p.value.add(y,v,...w),v.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?d:y+d+(s-1)*v,S="right"===c?0:I.originY,b="right"===c?$:I.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...D}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:L,showNumber:X,position:N,showMaxMinNumber:k,detailedList:E=[],showdetailedScale:G,showRange:R=[]}=o;if(L||X){const{lineXMain:e,lineXSub:t,textLeft:i}=u(N,w,m),n=(j[1]-j[0])/2,l=G&&!E.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):G&&(null==E?void 0:E.length)?E:j,[s=l[0],c=r(l)]=R;l.forEach(((n,r)=>{if(s&&+n<+s)return;if(c&&+n>+c)return;const u=I.endY-r*M*(G?C/2:C),p=[s,c].includes(n);if(X&&(!p||k)){const e=0==r?u-5:u,t=a(n,o,i,e),l=I.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...h(o,r,e,t,u,M,I.originY,l.findIndex((e=>e==c))+1))}))}let B=o.title||"";o.unit&&(B+="\n"+o.unit);let J=I.originY+2;0!==_&&P[0]>0&&(J=T+2),B&&g.push(new e.Text(String(B),{...i,originY:"top",left:x,top:J,textAlign:"center",...o.style}));const q=new e.Group(g,{...n,objectCaching:!1});f.push(q)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&p.value.add(w),w&&w.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(R));let t=V;const i=H-G.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:r}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{key:e.key,type:s(e.bigType),_type:e.bigType,isOneLine:e.isOneLine},...d.event}});var u;t-=l.height||30,(u=r).on("moving",(()=>{u.set("originX","center"),function(e){if(e.left>=O&&e.left<=k){e.setCoords();const t="pain"===e.origin.type?W:I;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(u),N(u)?f(u):m.show=!1})),u.on("mouseup:before",(e=>{if(m.show=!1,0===e.e.button&&N(u)){const e=L([...x],u.left,"_type").includes(u.origin._type),t=b(u.left);if(!t||e)e&&t&&X("repeat");else{const e={data:{time:w(u.left),value:S(u.origin.type,u.top),...u.origin.isOneLine?{key:u.origin.key}:{}},...u.origin};g("add",e),Y(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(u)})),p.value.add(l,r)}))}();const K=G.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==B?void 0:B.width)&&"left"===(null==(j=null==B?void 0:B.yScaleValue)?void 0:j.layout)&&(null==(C=null==B?void 0:B.yScaleValue)?void 0:C.show)&&K.push(q),_>0&&G.yScaleValue[_].show){const e=G.yScaleValue[_];0===_&&G.yScaleValue.length>1&&K.unshift(e),_==G.yScaleValue.length-1&&K.push(e)}const Q=K.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),U=K[Q];return Q>-1&&K.splice(Q,0,{...U,title:(null==U?void 0:U.doubleTitle)||(null==U?void 0:U.title)}),F(K),{drawScaleValue:F}}export{p as useLeft};
|
@@ -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{setOtherType as r,getFloorNumber as
|
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{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"@vueuse/core";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,D,x){const C=15,j=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=w.data.grid||{};return~K.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===K.value?t[0]=t[0]+V.value[1]:K.value>0&&(t[2]=t[2]+V.value[0]),t})),X=a((()=>0===K.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:K.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),L=a((()=>{const{top:e}=w.data;return e.date.show&&(e.date.height||C)||0})),P=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)})),N=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||C)||0})),O=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{grid:e}=w.data,a=K.value>0?V.value[1]:V.value[0];return e.mainYCell*e.subYCell+H.value[0]+H.value[2]+a})),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]*T.value)),q=a((()=>{const{top:e,left:a}=w.data;return e.titleWidth+B.value})),z=a((()=>{const{bottom:e=null,height:a}=w.data;if(!e)return a;return a-(e.height||30)})),G=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 L.value+t+l+P.value+M.value+N.value})),T=a((()=>(W.value-q.value)/k.value)),A=a((()=>(z.value-G.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=q.value-T.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+=T.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+T.value/2,scaleCell:(l-t)/T.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.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),Q=a((()=>{const{grid:e}=w.data;return-1===K.value?0:A.value*e.subYCell})),U=a((()=>{const{left:e}=w.data,a={originY:G.value+V.value[0]*A.value,endY:z.value-V.value[1]*A.value};return 0===K.value&&e.yScaleValue.length>1?a.endY=a.originY+Q.value:K.value===e.yScaleValue.length-1&&(a.originY=a.endY-Q.value),a})),Z=a((()=>{const{left:e}=w.data,a={originY:G.value+H.value[0]*A.value,endY:z.value-H.value[2]*A.value};return 0===K.value&&e.yScaleValue.length>1?a.originY=U.value.endY+H.value[0]*A.value:K.value===e.yScaleValue.length-1&&(a.endY=U.value.originY-H.value[2]*A.value),a})),_=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))})),ee=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})),ae=e({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...u,...w.data.borderStyle||{}},selectionStyle:w.data.selectionStyle||{},dateHeight:L.value,hospitalDaysHeight:P.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:N.value,topList:_.value,breathingHeight:O.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:K.value,painHeight:Q.value,painOriginY:U.value,vitalSignsOriginY:Z.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:B.value,originX:q.value,originY:G.value,endX:W.value,endXLimit:$.value,endY:z.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:ee.value,config:w.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:X.value}),{computedX:te,computedY:le,getXValue:ue,getYValue:ie}=i(ae);return t((()=>S.value),(e=>{e&&function(){h(S,ae);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=m(S,ae,b,te,le,ue,ie,w.addRenderItem,D,x);j.redrawPoints=l,j.clickMenu=u;const{drawScaleValue:o}=p(S,ae,b,e,D,te,le,ue,ie,a,t,i);g(S,ae,o),f(S,ae),y(S,ae,b,te,le,r);const{select:s}=n(S,ae,b);j.select=s}()}),{immediate:!0}),{propItems:ae,...l(j)}}export{S as useTemperatureChart};
|
@@ -2,13 +2,13 @@ import { IPoint, ITreeItem } from '../interface';
|
|
2
2
|
import { AnyObject } from '../../../../shared/types';
|
3
3
|
export declare function isEffectiveNode(node: IPoint): string | number | boolean;
|
4
4
|
export declare function deleteProperty(data: AnyObject, list: AnyObject[]): {};
|
5
|
-
export declare function getIndex(time: string, list: AnyObject[]): number;
|
6
5
|
/**
|
7
6
|
* @description: 判断yScaleValue数组内的项类型是否可以连成一条折线,比如温度线
|
8
7
|
* @param {string} type
|
9
8
|
* @return {*}
|
10
9
|
*/
|
11
|
-
export declare function isOneLine(
|
10
|
+
export declare function isOneLine(scaleItem: AnyObject): any;
|
11
|
+
export declare function getIndex(time: string, list: AnyObject[]): number;
|
12
12
|
export declare function setOtherType(title: string, type: string): string;
|
13
13
|
export declare function getType(type: string): string;
|
14
14
|
export declare function isValidValue(value: number | string): boolean;
|
@@ -1 +1 @@
|
|
1
|
-
import{isNull as
|
1
|
+
import{isNull as t,isNumber as n}from"lodash-es";function e(t){return(null==t?void 0:t.time)&&((null==t?void 0:t.value)||0===(null==t?void 0:t.value))}function r(t,n){const e={};for(const r in t)n.map((t=>t.type)).includes(r)||(e[r]=t[r]);return e}function u(t){return["temperature","pulse"].includes(t.type)&&t.dataList.length&&!!t.dataList.find((t=>t.enable))}function o(t,n){const e=n.findIndex((n=>d(n.time)>d(t)));return~e?e:n.length}function i(t,n){return t.includes("心率")?"pulse_other":n}function l(t){return t.includes("_other")?t.split("_")[0]:t}function c(n){return!Number.isNaN(+n)&&!t(n)}function f(t,n){return a(t.left,1)===a(n.left,1)&&Math.abs(a(t.top,1)-a(n.top,1))<=2}function a(t,n=100){return Math.floor(t*n)/n}function s(t){let n=0;return t.forEach((t=>{var e;(null==(e=t.children)?void 0:e.length)?n+=s(t.children):n++})),n}function d(t){return t?n(t)?new Date(t).getTime():Date.parse(t.replace(/-/g,"/")):Date.now()}function p(t,n){const e=[],[r,u]=t;n=n||1;for(let t=r;n>0?t<=u:t>=u;t+=n)e.push(t);return e}function h(t){const{width:n,height:e,left:r,top:u}=t,o=n/2,i=e/2;return{minLeft:r-o,maxLeft:r+o,minTop:u-i,maxTop:u+i}}export{r as deleteProperty,s as getChildrenSize,a as getFloorNumber,o as getIndex,h as getPointRange,p as getScaleNumberList,d as getTime,l as getType,e as isEffectiveNode,u as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
|
@@ -1928,7 +1928,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
1928
1928
|
} | undefined;
|
1929
1929
|
display?: "flex" | "grid" | undefined;
|
1930
1930
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
1931
|
-
wrapperStyle?: Record<string, string> | undefined;
|
1931
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
1932
1932
|
childFieldStrategy?: "checked" | "all" | undefined;
|
1933
1933
|
childWidthMode?: "inner" | "outer" | undefined;
|
1934
1934
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -2176,7 +2176,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2176
2176
|
} | undefined;
|
2177
2177
|
display?: "flex" | "grid" | undefined;
|
2178
2178
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
2179
|
-
wrapperStyle?: Record<string, string> | undefined;
|
2179
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
2180
2180
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2181
2181
|
childWidthMode?: "inner" | "outer" | undefined;
|
2182
2182
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -2395,7 +2395,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
2395
2395
|
} | undefined;
|
2396
2396
|
display?: "flex" | "grid" | undefined;
|
2397
2397
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
2398
|
-
wrapperStyle?: Record<string, string> | undefined;
|
2398
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
2399
2399
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2400
2400
|
childWidthMode?: "inner" | "outer" | undefined;
|
2401
2401
|
validator?: ((value: unknown, fieldItem: import("..").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -1931,7 +1931,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1931
1931
|
} | undefined;
|
1932
1932
|
display?: "flex" | "grid" | undefined;
|
1933
1933
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
1934
|
-
wrapperStyle?: Record<string, string> | undefined;
|
1934
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
1935
1935
|
childFieldStrategy?: "checked" | "all" | undefined;
|
1936
1936
|
childWidthMode?: "inner" | "outer" | undefined;
|
1937
1937
|
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -2179,7 +2179,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2179
2179
|
} | undefined;
|
2180
2180
|
display?: "flex" | "grid" | undefined;
|
2181
2181
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
2182
|
-
wrapperStyle?: Record<string, string> | undefined;
|
2182
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
2183
2183
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2184
2184
|
childWidthMode?: "inner" | "outer" | undefined;
|
2185
2185
|
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -2398,7 +2398,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2398
2398
|
} | undefined;
|
2399
2399
|
display?: "flex" | "grid" | undefined;
|
2400
2400
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
2401
|
-
wrapperStyle?: Record<string, string> | undefined;
|
2401
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
2402
2402
|
childFieldStrategy?: "checked" | "all" | undefined;
|
2403
2403
|
childWidthMode?: "inner" | "outer" | undefined;
|
2404
2404
|
validator?: ((value: unknown, fieldItem: import("../../../components/form-render").FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -417,7 +417,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
417
417
|
} | undefined;
|
418
418
|
display?: "flex" | "grid" | undefined;
|
419
419
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
420
|
-
wrapperStyle?: Record<string, string> | undefined;
|
420
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
421
421
|
childFieldStrategy?: "checked" | "all" | undefined;
|
422
422
|
childWidthMode?: "inner" | "outer" | undefined;
|
423
423
|
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -665,7 +665,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
665
665
|
} | undefined;
|
666
666
|
display?: "flex" | "grid" | undefined;
|
667
667
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
668
|
-
wrapperStyle?: Record<string, string> | undefined;
|
668
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
669
669
|
childFieldStrategy?: "checked" | "all" | undefined;
|
670
670
|
childWidthMode?: "inner" | "outer" | undefined;
|
671
671
|
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -884,7 +884,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
884
884
|
} | undefined;
|
885
885
|
display?: "flex" | "grid" | undefined;
|
886
886
|
slots?: Record<string, (...args: unknown[]) => unknown> | undefined;
|
887
|
-
wrapperStyle?: Record<string, string> | undefined;
|
887
|
+
wrapperStyle?: Record<string, string | number> | undefined;
|
888
888
|
childFieldStrategy?: "checked" | "all" | undefined;
|
889
889
|
childWidthMode?: "inner" | "outer" | undefined;
|
890
890
|
validator?: ((value: unknown, fieldItem: FieldItem, field: import("@formily/core").Field<any, any, any, any>) => string | void) | undefined;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { AnyObject } from '../../../../../shared/types';
|
1
|
+
import { AnyObject, ArrayAble } from '../../../../../shared/types';
|
2
2
|
import { PropType } from 'vue';
|
3
3
|
import { UrlConfig } from '../../../../../components/form-render';
|
4
4
|
export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
5
5
|
value: {
|
6
|
-
type: PropType<string | null>;
|
6
|
+
type: PropType<ArrayAble<string | number> | null>;
|
7
7
|
};
|
8
8
|
requestCache: {
|
9
9
|
type: BooleanConstructor;
|
@@ -69,7 +69,7 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
69
69
|
deletable: BooleanConstructor;
|
70
70
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
71
71
|
value: {
|
72
|
-
type: PropType<string | null>;
|
72
|
+
type: PropType<ArrayAble<string | number> | null>;
|
73
73
|
};
|
74
74
|
requestCache: {
|
75
75
|
type: BooleanConstructor;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,watch as l,inject as a,computed as o,ref as t,createVNode as
|
1
|
+
import{defineComponent as e,watch as l,inject as a,computed as o,ref as t,createVNode as u}from"vue";import{connect as n,mapProps as r}from"@formily/vue";import{HelpCircleSharp as i}from"@vicons/ionicons5";import{useVModel as s,useDebounceFn as v}from"@vueuse/core";import{cloneDeep as p,isString as d}from"lodash-es";import{NSelect as m,NSpin as c,NEmpty as f,NTooltip as y,NIcon as g,NTag as h}from"naive-ui";import"../../../index.js";import{InjectionChangeContextCollector as C}from"../../constants/index.js";import{useCommonInjection as b,useSelectOptionProps as F}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as j,assignClearBindVisited as S,createVisitedSetter as w}from"../../utils/schema.js";import{useFormField as x}from"../../hooks/useFormField.js";import{useUrlConfigOptions as B,useAutographOptions as K}from"../../hooks/useFormRenderOptions.js";const k=n(e({name:"FormRemoteSearch",props:{value:{type:[String,Number,Array]},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},allowCreate:Boolean,labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},onChange:{},useLoading:{type:Boolean,default:!0},lazyRequest:{type:Boolean,default:!0},multiple:Boolean,deletable:Boolean},emits:["update:value"],setup(e,{slots:n,emit:r}){const j=s(e,"value",r),{field:S,fieldKey:k}=x(),{injectValueValidate:O,injectValueBindKey:D}=b();O(j);const R=D(j),q={onRequestConfigChange:({fetchData:e,valueKey:l})=>e(j.value,{[l]:j.value}),onDepsChange:({fetchData:e,valueKey:l})=>e(j.value,{[l]:j.value})},{labelKey:L,valueKey:P,showKey:V,fetchData:A,searchContent:I,fullOptions:U,loading:z}=e.urlConfig?B(e,j,q):K(e,j,q),N=v(((e,l="label")=>A(e,{["value"===l?P.value:"keyword"]:e},{avoidSearchContent:!1})),300);l(j,(e=>{if(e&&!U.value.find((l=>l[P.value]===e)))return N(e,"value")}),{immediate:!0});a(C).setContext(k.value,(e=>{return{currentOption:p((l=e,U.value.find((e=>e[P.value]===l)))),labelField:L.value,valueField:P.value};var l}));const{menuProps:T,nodeProps:$}=F(),E=o((()=>U.value.length||!e.allowCreate?U.value:I.value?[{[L.value]:I.value,[P.value]:I.value},...U.value]:U.value));async function G(e){z.value=e,e&&N()}function H(e){const l=e.alias||e[L.value];if(!l||!d(l))return"";const a=l;return e.desc?u("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[a,e.desc?u(y,null,{trigger:()=>u(g,{component:i},null),default:()=>e.desc}):null]):a}function J({option:l,handleClose:a}){var o;const t=null!=(o=V.value&&l[V.value])?o:l[L.value];if(!e.multiple)return M.value=t,t;return M.value="",e.deletable?u(h,{closable:!0,onClose:function(e){e.stopPropagation(),a()}},{default:()=>t}):`${t};`}const M=t("");return()=>u(m,{title:M.value,remote:!0,filterable:!0,key:R.value,value:j.value,"onUpdate:value":e=>j.value=e,labelField:L.value,valueField:P.value,"menu-props":T,"node-props":$,onSearch:N,"onUpdate:show":G,options:E.value,onFocus:w(S),renderLabel:H,renderTag:J},{empty:()=>e.useLoading&&z.value?u(c,null,null):u(f,{description:"无数据"},null),...n})}}),r(j,S));export{k as REMOTE_SEARCH};
|
@@ -151,7 +151,7 @@ export type FieldItem = {
|
|
151
151
|
noDecorator: Boolean;
|
152
152
|
display: 'grid' | 'flex';
|
153
153
|
slots: Record<string, (...args: unknown[]) => unknown>;
|
154
|
-
wrapperStyle: Record<string, string>;
|
154
|
+
wrapperStyle: Record<string, string | number>;
|
155
155
|
childFieldStrategy?: 'checked' | 'all';
|
156
156
|
childWidthMode?: 'inner' | 'outer';
|
157
157
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
import{format as t,differenceInDays as e,differenceInMonths as n,differenceInYears as r,differenceInHours as s,differenceInMinutes as a}from"date-fns";import{range as u,isString as i}from"lodash-es";import{FIELD_AGE_UNIT as c,FIELD_SEX_VALUE as o}from"../constants/index.js";function d(t){function e(t,e,n,r){t.birthday=e+"-"+n+"-"+r+" 00:00";const s=new Date,a=s.getMonth()+1<parseInt(n,10)||s.getMonth()+1==parseInt(n,10)&&s.getDate()<parseInt(r,10)?1:0;return Object.assign(t,U(t.birthday)),t.age=t.year=s.getFullYear()-parseInt(e,10)-a,t}return t.match(/^[A-Z]{3}/)?e({},"19"+(n=t).slice(7,9),n.slice(9,11),n.slice(11,13)):((t,n,r)=>{const s={};if(!t.startsWith("9")){const e=1-+t.substr(n,1)%2;s.sex=1===e?o.FEMALE:o.MALE}return e(s,(2==r?"19":"")+t.substr(6,r),t.substr(6+r,2),t.substr(8+r,2))})(t,15==t.length?14:16,15==t.length?2:4);var n}function l(t=""){if(!i(t)||!t)return"date";const e=t.includes("y"),n=t.includes("M"),r=t.includes("d"),s=t.includes("H"),a=t.includes("m"),u=t.includes("s");return e||n||r||!(s||a||u)?s||a||u?"datetime":!e||n||r?!e&&n&&r?"month":"date":"year":"time"}const f=/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}(\d|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}))$/,h=/^[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}$/,g=u(65,91).reduce(((t,e,n)=>(t[String.fromCharCode(e)]=10+n,t)),{}),m=[7,3,1,7,3,1,7,3,1,7,3,1,7,3],p=/^[A-Z]{3}[0-9]{12}$/,M=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],y=["1","0","X","9","8","7","6","5","4","3","2"];function D(t){try{if(!t||![15,18].includes(t.length))return!1;if(15===t.length){if(!p.test(t))return!1;if(!("19"+t.slice(7,13)))return!1;const e=t.split("");e[0]=g[e[0]],e[1]=g[e[1]],e[2]=g[e[2]];let n=0;for(let t=0;t<14;t++){n+=parseInt(e[t])*m[t]}return n%10===parseInt(e[14])}{t=t.toUpperCase();if(!/^9[0-9]{16}[0-9X]$/.test(t))return!1;if(!t.slice(6,14))return!1;let e=0;for(let n=0;n<17;n++){e+=parseInt(t.slice(n,n+1))*M[n]}return y[e%11]===t.slice(17)}}catch(t){return!1}}function E(t){return f.test(t)&&function(t){if(!t||18!==t.length)return!1;const e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let r=0;r<17;r++)n+=+t[r]*e[r];return t.charAt(17).toUpperCase()===["1","0","X","9","8","7","6","5","4","3","2"][n%11]}(t)||h.test(t)||D(t)}function $(t){return/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(t)}function U(t){const u={},i=new Date,c=new Date(t),o=[["day",e],["month",n],["year",r],["hours",s],["minutes",a]];return Object.defineProperties(u,o.reduce(((t,[e,n])=>(t[e]={get:(()=>{let t=null;return()=>(null===t&&(t=n(i,c)),t)})()},t)),{})),u}function A(e,n,r="yyyy-MM-dd HH:mm"){var s;const a=new Date,u={[c.MINUTE]:()=>i(a,"Minutes",e),[c.HOUR]:()=>i(a,"Hours",e),[c.DAY]:()=>i(a,"Date",e),[c.WEEK]:()=>i(a,"Date",7*e),[c.MONTH]:()=>i(a,"Month",e),[c.YEAR]:()=>i(a,"FullYear",e)};return null==(s=u[n])||s.call(u),t(function(t,e){const n=[{[c.DAY]:"Date",[c.WEEK]:"Date",[c.MONTH]:"Date",[c.YEAR]:"Date"},{[c.HOUR]:"Hours"},{[c.MINUTE]:"Minutes"}],r=n.findIndex((t=>Reflect.has(t,e)));~r&&n.slice(r+1).forEach((e=>{Object.values(e).forEach((e=>{t[`set${e}`]("Date"===e?1:0)}))}));return t.setSeconds(0),t}(a,n),r);function i(t,e,n){t[`set${e}`](t[`get${e}`]()-n)}}function H(t){const e=t.minutes<60?{ageUnit:c.MINUTE,age:t.minutes}:t.hours<24?{ageUnit:c.HOUR,age:t.hours}:t.day<30?{ageUnit:c.DAY,age:t.day}:t.day<365?{ageUnit:c.MONTH,age:t.month}:{ageUnit:c.YEAR,age:t.year};return e.age=Math.max(e.age,1),e}const I=/^(\d{4})-?(\d{2})-?(\d{2})?\s?(\d{2})?:?(\d{2})?:?(\d{2})?$/;function b(t){if(!i(t))return;const e=t.match(I);if(!e)return;const[,n,r,s,a,u,c]=e;return new Date(`${n}-${r}-${s||"01"} ${a||"00"}:${u||"00"}:${c||"00"}`)}export{b as businessDateParser,D as isForeignerID,E as isIdCard,$ as isMobile,A as parseAge2Birthday,H as parseAgeFromContext,U as parseBirthday,d as parseIdCard,l as transformDateFormat};
|
1
|
+
import{format as t,differenceInDays as e,differenceInMonths as n,differenceInYears as r,differenceInHours as s,differenceInMinutes as a}from"date-fns";import{range as u,isString as i}from"lodash-es";import{FIELD_AGE_UNIT as c,FIELD_SEX_VALUE as o}from"../constants/index.js";function d(t){function e(t,e,n,r){t.birthday=e+"-"+n+"-"+r+" 00:00";const s=new Date,a=s.getMonth()+1<parseInt(n,10)||s.getMonth()+1==parseInt(n,10)&&s.getDate()<parseInt(r,10)?1:0;return Object.assign(t,U(t.birthday)),t.age=t.year=s.getFullYear()-parseInt(e,10)-a,t}return t.match(/^[A-Z]{3}/)?e({},"19"+(n=t).slice(7,9),n.slice(9,11),n.slice(11,13)):((t,n,r)=>{const s={};if(!t.startsWith("9")){const e=1-+t.substr(n,1)%2;s.sex=1===e?o.FEMALE:o.MALE}return e(s,(2==r?"19":"")+t.substr(6,r),t.substr(6+r,2),t.substr(8+r,2))})(t,15==t.length?14:16,15==t.length?2:4);var n}function l(t=""){if(!i(t)||!t)return"date";const e=t.includes("y"),n=t.includes("M"),r=t.includes("d"),s=t.includes("H"),a=t.includes("m"),u=t.includes("s");return e||n||r||!(s||a||u)?s||a||u?"datetime":!e||n||r?!e&&n&&r?"month":"date":"year":"time"}const f=/^\d{6}(((19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}(\d|x|X))|(\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}))$/,h=/^[1-9]\d{5}\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}$/,g=u(65,91).reduce(((t,e,n)=>(t[String.fromCharCode(e)]=10+n,t)),{}),m=[7,3,1,7,3,1,7,3,1,7,3,1,7,3],p=/^[A-Z]{3}[0-9]{12}$/,M=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],y=["1","0","X","9","8","7","6","5","4","3","2"];function D(t){try{if(!t||![15,18].includes(t.length))return!1;if(15===t.length){if(!p.test(t))return!1;if(!("19"+t.slice(7,13)))return!1;const e=t.split("");e[0]=g[e[0]],e[1]=g[e[1]],e[2]=g[e[2]];let n=0;for(let t=0;t<14;t++){n+=parseInt(e[t])*m[t]}return n%10===parseInt(e[14])}{t=t.toUpperCase();if(!/^9[0-9]{16}[0-9X]$/.test(t))return!1;if(!t.slice(6,14))return!1;let e=0;for(let n=0;n<17;n++){e+=parseInt(t.slice(n,n+1))*M[n]}return y[e%11]===t.slice(17)}}catch(t){return!1}}function E(t){return f.test(t)&&function(t){if(!t||18!==t.length)return!1;const e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let n=0;for(let r=0;r<17;r++)n+=+t[r]*e[r];return t.charAt(17).toUpperCase()===["1","0","X","9","8","7","6","5","4","3","2"][n%11]}(t)||h.test(t)||D(t)}function $(t){return/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(t)}function U(t){const u={},i=new Date,c=new Date(t),o=[["day",e],["month",n],["year",r],["hours",s],["minutes",a]];return Object.defineProperties(u,o.reduce(((t,[e,n])=>(t[e]={get:(()=>{let t=null;return()=>(null===t&&(t=n(i,c)),t)})(),enumerable:!0},t)),{})),u}function A(e,n,r="yyyy-MM-dd HH:mm"){var s;const a=new Date,u={[c.MINUTE]:()=>i(a,"Minutes",e),[c.HOUR]:()=>i(a,"Hours",e),[c.DAY]:()=>i(a,"Date",e),[c.WEEK]:()=>i(a,"Date",7*e),[c.MONTH]:()=>i(a,"Month",e),[c.YEAR]:()=>i(a,"FullYear",e)};return null==(s=u[n])||s.call(u),t(function(t,e){const n=[{[c.DAY]:"Date",[c.WEEK]:"Date",[c.MONTH]:"Date",[c.YEAR]:"Date"},{[c.HOUR]:"Hours"},{[c.MINUTE]:"Minutes"}],r=n.findIndex((t=>Reflect.has(t,e)));~r&&n.slice(r+1).forEach((e=>{Object.values(e).forEach((e=>{t[`set${e}`]("Date"===e?1:0)}))}));return t.setSeconds(0),t}(a,n),r);function i(t,e,n){t[`set${e}`](t[`get${e}`]()-n)}}function H(t){const e=t.minutes<60?{ageUnit:c.MINUTE,age:t.minutes}:t.hours<24?{ageUnit:c.HOUR,age:t.hours}:t.day<30?{ageUnit:c.DAY,age:t.day}:t.day<365?{ageUnit:c.MONTH,age:t.month}:{ageUnit:c.YEAR,age:t.year};return e.age=Math.max(e.age,1),e}const I=/^(\d{4})-?(\d{2})-?(\d{2})?\s?(\d{2})?:?(\d{2})?:?(\d{2})?$/;function b(t){if(!i(t))return;const e=t.match(I);if(!e)return;const[,n,r,s,a,u,c]=e;return new Date(`${n}-${r}-${s||"01"} ${a||"00"}:${u||"00"}:${c||"00"}`)}export{b as businessDateParser,D as isForeignerID,E as isIdCard,$ as isMobile,A as parseAge2Birthday,H as parseAgeFromContext,U as parseBirthday,d as parseIdCard,l as transformDateFormat};
|