cnhis-design-vue 3.2.3-beta.25 → 3.2.3-beta.27
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/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- 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/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/components/renderer/index.js +1 -1
- package/es/components/form-render/src/components/renderer/simpleComponent.d.ts +0 -8
- package/es/components/form-render/src/components/renderer/simpleComponent.js +1 -1
- package/es/components/form-render/src/components/renderer/text.d.ts +17 -0
- package/es/components/form-render/src/components/renderer/text.js +1 -0
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +4 -0
- package/es/components/form-render/src/utils/index.d.ts +8 -1
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/index.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w}from"lodash-es";import"../temperature/useShadow.js";import{format as x}from"date-fns";import"naive-ui";import"@vueuse/core";function b(b,j,P,C,E){const{computedX:S,computedY:G,getXValue:T,getYValue:L}=c(j),{getEqualXTypes:Y,handleAddPrevent:M,isGridLimit:A,setPrevAndNextPoint:X,getPointEventProps:I}=h(b,P,j),{xAxis:H,grid:W,originX:N,originY:O,xCellWidth:V,endY:D,startTime:R,leftAddAreaWidth:$,leftScales:B,rightScales:F,yCellHeight:q,endX:z,scaleValues:J,canvasWidth:K,borderStyle:Q,rightAddAreaWidth:U,event:Z,originYCervix:_,other:tt,canvasHeight:et}=j,ot=k(J),nt=new Set;function it(){ot.filter((t=>t.show)).forEach(((t,s)=>{var l;const a=[],u=[],c=[];null==(l=t.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=t,x=t.data[f+1],j=ut(x,t);if(l&&j&&!d.breakpoint)h=e([...l,...j],{...m});else if(l&&!j&&!d.breakpoint){const o=ut(x,t);h=o?e([...l,...o],{...m}):null}let E,S;if(d.childbirth){const t=l[1]+q;E=o([l[0],l[1],t],w),c.push(E),S=n([l[0]+V/2,t-q/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(S)}const G=u[f-1],Y={origin:{data:d,title:v,key:y||"",dataIndex:s,index:f},leftLine:G,rightLine:h,arrowGroup:E,arrowGroupText:S,...g,...I()};l&&(G||(Y.leftLine=null),p=r(k,{left:l[0],top:l[1],...Y}));u.push(h),p&&(!function(t){Z.hovered&&(t.on("mouseover",(()=>{at(t,"hover")})),t.on("mouseout",(()=>{C.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{lt(t),function(t){var e,o,n,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top}),null==(n=t.arrowGroup)||n.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+V/2,top:t.top+q/2})}(t),Z.hovered&&at(t)})),t.on("mouseup",(e=>{if(C.show=!1,1===e.button){const{key:e}=t.origin,o={...t.origin,data:{...t.origin.data,time:T(t.left),value:L(e,t.top)}};b.value.discardActiveObject(),P("change",o),rt(o,"change")}}))}(p),a.push(p),nt.add(p))}(ut(l,t),l,d)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));X(t),Promise.all(c).then((o=>{b.value.add(...e,...t,...o),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function rt(t,e="add"){const{dataIndex:o,data:n,index:i,key:r}=t,s=ot.find((t=>t.key===r));switch(e){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const t=g(n.time,s.data);s.data.splice(t,0,n);break}}st()}function st(){var t;nt.size&&(null==(t=b.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...nt]))),nt.clear(),it()}function lt(t){const e=t.prevPoint?t.prevPoint.left:N,o=t.nextPoint?t.nextPoint.left:z;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<_&&t.set("top",_),t.top<O&&t.set("top",O),t.top>D&&t.set("top",D),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}function at(t,e="moving"){const{title:o,key:n,data:i}=t.origin;C.point={x:t.left,y:t.top},C.list=[`${o} ${"hover"===e?i.value:L(n,t.top)}`,`时间 ${T(t.left).slice(-5)}`],C.show=!0}function ut(t,e){if(m(t)&&function(t){const e=R+864e5,o=v(t);return o>=R&&o<=e}(t.time)){const o=S(t.time),n=G(e.key,e.range,t.value);return[o,n<O?O:n>D?D:n]}}function ct(t,e){return t+1>e[1]?e[0]:t+1}return u(b,j),function(){const e=new t.Rect({...Q,width:K-$-U-1,height:D-1,left:$,top:0,fill:"transparent"});b.value.add(e)}(),function(){function e(e,o="left"){let r="left"===o?$:z;e.forEach(((e,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=e,j=[],P=[],C=r+c/2,E=y(s,u),S=E.length,{lineXMain:G,lineXSub:T,textLeft:L}=d(v,r,c);E.forEach(((t,o)=>{const n=D-o*q*k,i=0===o?D-8:o!==E.length-1||O||_&&"FHR"!==m?n:O+8;!w||(0===o||o===S-1)&&!x||j.push(f(String(t),e,L,i)),P.push(...p(e,o,G,T,n,q,O,S))}));const Y=new t.Rect({...a,strokeWidth:.5,width:c,height:D,left:C,top:D/2}),M=n([C,O>0?O-q/2:q/2],{value:String(h),...i,...g}),A=new t.Group([...P,...j,Y,...M?[M]:[]],{objectCaching:!1,...l});b.value.add(A),A.sendToBack(),r+=c}))}e(B),e(F,"right")}(),function(){const{show:e,startTime:o,range:r=[0,23],position:s="top",style:a}=H.time,{show:u,range:c=[0,23],position:d,style:f}=H.processTime;if(e||u){const p=[],h=[],g=[],m=[],v=N+V/2,y=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const e=0===t?+o.slice(11,13):ct(w(p),r);p.push(e);const l="top"===s?O-y:D+y;g.push(n([v+t*V,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:w(h)+1;h.push(e);const o="top"===d?y:et-y;m.push(n([v+t*V,o],{value:String(e),...i,...f||{}}))}}const k=new t.Group([...g,...m],{objectCaching:!1,...l});b.value.add(k),b.value.sendToBack(k)}}(),function(){var t;const o=Object.values(tt),n=[],i={},r=ot.find((t=>"cervix"===t.key&&t.show)),s=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function l(t,e){const{key:o,range:n}=r||{},i=G(o,n,10),s=[0,e],l=[-e/t,0],a=[(D-i-e)/t,D-i],u=[z-N,t*(z-N)+e];let c=[],d=[];function f([o,n]){return Math.abs(n-t*o-e)<=1}function p([t,e]){const[o,n]=[...h([t,e])];return o>=N&&o<=z&&n>=i&&n<=D}function h([t,e]){return[N+t,D-e]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((t=>{if(!t.show)return;const{key:o}=t;switch(o){case"fetalPresentation":{const{range:i,show:r}=ot.find((t=>t.key===o));if(r){const r=G(o,i,0);n.push(e([N,r,z,r],{...t}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:x(new Date(v(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-N,D-G(o,a,s.value)],[p,h]=[S(c.time)-N,D-G(o,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=l(g,m);y.length>0&&(n.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(x(new Date(v(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(e(u,{...t}))}}})),b.value.add(...n)}(),it(),function(){function t(t,e){const o=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:o,key:t.key},pointer:e}}j.event.evented&&b.value.on("mouse:up",(e=>{if(3===e.button){const{x:o=0,y:n=0}=e.pointer||{};o>=N&&o<=z&&n>=O&&n<=D&&(E.point={x:o,y:n},E.show=!0,e.target?(E.target=e.target,E.list=["删除节点"],[...nt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&E.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(E.target=null,E.list=["新增节点"],ot.filter((t=>t.show)).forEach((i=>{if(!Y([...nt],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<_)return;E.list.push(t(i,e.pointer))}})),1===E.list.length&&(E.show=!1,M("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=K-U/2;function e(t,e){if(!t.length)return;let n=O;const i=[];t.forEach((t=>{const o=t.title.split("").join("\n"),r=J.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(o,t,{text:{originY:"top",left:e,top:n},icon:{left:e,topY:n,originY:"top",origin:{type:t.type,dataIndex:r},...j.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),A(u)?(lt(u),at(u)):C.show=!1})),u.on("mouseup:before",(t=>{if(C.show=!1,0===t.e.button&&A(u))if(Y([...nt],u.left,"key").includes(u.origin.key))M("repeat");else{const t={data:{time:T(u.left),value:L(u.origin.key,u.top)},...u.origin};P("add",t),rt(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(u)})),i.push(l,a)})),o(i),b.value.add(...i)}function o(t){const e=w(t),o=(D-O)/2,n=(e.height+e.top-O)/2;t.forEach((t=>{const e=t.top+o-n;t.set({top:e,originTop:e})}))}e(B,$/2),e(F,t)}(),{clickMenu:function({item:t,target:e}){const o={...t.origin};"remove"===t.mode?(P("remove",o),rt(o,"remove")):(Object.assign(o,{data:{time:T(t.pointer.x),value:L(t.origin.key,t.pointer.y)}}),P("add",o),rt(o))},redrawPoints:st}}export{b as useBirthProcess};
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as x}from"date-fns";import"naive-ui";import"@vueuse/core";function b(b,j,P,C,E){const{computedX:S,computedY:G,getXValue:T,getYValue:L}=c(j),{getEqualXTypes:Y,handleAddPrevent:M,isGridLimit:A,setPrevAndNextPoint:X,getPointEventProps:I}=h(b,P,j),{xAxis:H,grid:W,originX:N,originY:O,xCellWidth:V,endY:D,startTime:R,leftAddAreaWidth:$,leftScales:B,rightScales:F,yCellHeight:q,endX:z,scaleValues:J,canvasWidth:K,borderStyle:Q,rightAddAreaWidth:U,event:Z,originYCervix:_,other:tt,canvasHeight:et}=j,ot=k(J),nt=new Set;function it(){ot.filter((t=>t.show)).forEach(((t,s)=>{var l;const a=[],u=[],c=[];null==(l=t.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=t,x=t.data[f+1],j=ut(x,t);if(l&&j&&!d.breakpoint)h=e([...l,...j],{...m});else if(l&&!j&&!d.breakpoint){const o=ut(x,t);h=o?e([...l,...o],{...m}):null}let E,S;if(d.childbirth){const t=l[1]+q;E=o([l[0],l[1],t],w),c.push(E),S=n([l[0]+V/2,t-q/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(S)}const G=u[f-1],Y={origin:{data:d,title:v,key:y||"",dataIndex:s,index:f},leftLine:G,rightLine:h,arrowGroup:E,arrowGroupText:S,...g,...I()};l&&(G||(Y.leftLine=null),p=r(k,{left:l[0],top:l[1],...Y}));u.push(h),p&&(!function(t){Z.hovered&&(t.on("mouseover",(()=>{at(t,"hover")})),t.on("mouseout",(()=>{C.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{lt(t),function(t){var e,o,n,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top}),null==(n=t.arrowGroup)||n.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+V/2,top:t.top+q/2})}(t),Z.hovered&&at(t)})),t.on("mouseup",(e=>{if(C.show=!1,1===e.button){const{key:e}=t.origin,o={...t.origin,data:{...t.origin.data,time:T(t.left),value:L(e,t.top)}};b.value.discardActiveObject(),P("change",o),rt(o,"change")}}))}(p),a.push(p),nt.add(p))}(ut(l,t),l,d)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));X(t),Promise.all(c).then((o=>{b.value.add(...e,...t,...o),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function rt(t,e="add"){const{dataIndex:o,data:n,index:i,key:r}=t,s=ot.find((t=>t.key===r));switch(e){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const t=g(n.time,s.data);s.data.splice(t,0,n);break}}st()}function st(){var t;nt.size&&(null==(t=b.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...nt]))),nt.clear(),it()}function lt(t){const e=t.prevPoint?t.prevPoint.left:N,o=t.nextPoint?t.nextPoint.left:z;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<_&&t.set("top",_),t.top<O&&t.set("top",O),t.top>D&&t.set("top",D),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}function at(t,e="moving"){const{title:o,key:n,data:i}=t.origin;C.point={x:t.left,y:t.top},C.list=[`${o} ${"hover"===e?i.value:L(n,t.top)}`,`时间 ${T(t.left).slice(-5)}`],C.show=!0}function ut(t,e){if(m(t)&&function(t){const e=R+864e5,o=v(t);return o>=R&&o<=e}(t.time)){const o=S(t.time),n=G(e.key,e.range,t.value);return[o,n<O?O:n>D?D:n]}}function ct(t,e){return t+1>e[1]?e[0]:t+1}return u(b,j),function(){const e=new t.Rect({...Q,width:K-$-U-1,height:D-1,left:$,top:0,fill:"transparent"});b.value.add(e)}(),function(){function e(e,o="left"){let r="left"===o?$:z;e.forEach(((e,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=e,j=[],P=[],C=r+c/2,E=y(s,u),S=E.length,{lineXMain:G,lineXSub:T,textLeft:L}=d(v,r,c);E.forEach(((t,o)=>{const n=D-o*q*k,i=0===o?D-8:o!==E.length-1||O||_&&"FHR"!==m?n:O+8;!w||(0===o||o===S-1)&&!x||j.push(f(String(t),e,L,i)),P.push(...p(e,o,G,T,n,q,O,S))}));const Y=new t.Rect({...a,strokeWidth:.5,width:c,height:D,left:C,top:D/2}),M=n([C,O>0?O-q/2:q/2],{value:String(h),...i,...g}),A=new t.Group([...P,...j,Y,...M?[M]:[]],{objectCaching:!1,...l});b.value.add(A),A.sendToBack(),r+=c}))}e(B),e(F,"right")}(),function(){const{show:e,startTime:o,range:r=[0,23],position:s="top",style:a}=H.time,{show:u,range:c=[0,23],position:d,style:f}=H.processTime;if(e||u){const p=[],h=[],g=[],m=[],v=N+V/2,y=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const e=0===t?+o.slice(11,13):ct(w(p),r);p.push(e);const l="top"===s?O-y:D+y;g.push(n([v+t*V,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:w(h)+1;h.push(e);const o="top"===d?y:et-y;m.push(n([v+t*V,o],{value:String(e),...i,...f||{}}))}}const k=new t.Group([...g,...m],{objectCaching:!1,...l});b.value.add(k),b.value.sendToBack(k)}}(),function(){var t;const o=Object.values(tt),n=[],i={},r=ot.find((t=>"cervix"===t.key&&t.show)),s=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function l(t,e){const{key:o,range:n}=r||{},i=G(o,n,10),s=[0,e],l=[-e/t,0],a=[(D-i-e)/t,D-i],u=[z-N,t*(z-N)+e];let c=[],d=[];function f([o,n]){return Math.abs(n-t*o-e)<=1}function p([t,e]){const[o,n]=[...h([t,e])];return o>=N&&o<=z&&n>=i&&n<=D}function h([t,e]){return[N+t,D-e]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((t=>{if(!t.show)return;const{key:o}=t;switch(o){case"fetalPresentation":{const{range:i,show:r}=ot.find((t=>t.key===o));if(r){const r=G(o,i,0);n.push(e([N,r,z,r],{...t}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:x(new Date(v(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-N,D-G(o,a,s.value)],[p,h]=[S(c.time)-N,D-G(o,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=l(g,m);y.length>0&&(n.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(x(new Date(v(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(e(u,{...t}))}}})),b.value.add(...n)}(),it(),function(){function t(t,e){const o=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:o,key:t.key},pointer:e}}j.event.evented&&b.value.on("mouse:up",(e=>{if(3===e.button){const{x:o=0,y:n=0}=e.pointer||{};o>=N&&o<=z&&n>=O&&n<=D&&(E.point={x:o,y:n},E.show=!0,e.target?(E.target=e.target,E.list=["删除节点"],[...nt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&E.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(E.target=null,E.list=["新增节点"],ot.filter((t=>t.show)).forEach((i=>{if(!Y([...nt],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<_)return;E.list.push(t(i,e.pointer))}})),1===E.list.length&&(E.show=!1,M("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=K-U/2;function e(t,e){if(!t.length)return;let n=O;const i=[];t.forEach((t=>{const o=t.title.split("").join("\n"),r=J.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(o,t,{text:{originY:"top",left:e,top:n},icon:{left:e,topY:n,originY:"top",origin:{type:t.type,dataIndex:r},...j.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),A(u)?(lt(u),at(u)):C.show=!1})),u.on("mouseup:before",(t=>{if(C.show=!1,0===t.e.button&&A(u))if(Y([...nt],u.left,"key").includes(u.origin.key))M("repeat");else{const t={data:{time:T(u.left),value:L(u.origin.key,u.top)},...u.origin};P("add",t),rt(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(u)})),i.push(l,a)})),o(i),b.value.add(...i)}function o(t){const e=w(t),o=(D-O)/2,n=(e.height+e.top-O)/2;t.forEach((t=>{const e=t.top+o-n;t.set({top:e,originTop:e})}))}e(B,$/2),e(F,t)}(),{clickMenu:function({item:t,target:e}){const o={...t.origin};"remove"===t.mode?(P("remove",o),rt(o,"remove")):(Object.assign(o,{data:{time:T(t.pointer.x),value:L(t.origin.key,t.pointer.y)}}),P("add",o),rt(o))},redrawPoints:st}}export{b as useBirthProcess};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as r}from"../../utils/index.js";import"lodash-es";import{useCanvasEvent as i}from"../useEvent.js";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{useBirthProcess as s}from"./useBirthProcess.js";function d(d,n,o,v,c,h){const m=e(),f=e(),p=e(),g=a((()=>n.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),x=a((()=>n.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=a((()=>{var e;return(null==(e=x.value)?void 0:e.length)?30:0})),y=a((()=>{var e;return 30+(null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),V=a((()=>{var e;const{width:a}=n.data,t=null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-w.value-t})),b=a((()=>n.data.grid.mainXCell)),j=a((()=>{const e=n.data.grid.mainYCell||14;return n.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),A=a((()=>(V.value-y.value)/b.value)),C=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),k=a((()=>{const{xAxis:e}=n.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return C.value*a})),Y=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!k.value)return k.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return S.value-l*u*C.value})),S=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-C.value*t})),H=a((()=>r(n.data.xAxis.time.startTime))),P=a((()=>36e5/A.value)),X=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),F=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return C.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=t({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...u,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:y.value,endX:V.value,originY:k.value,endY:S.value,xCellWidth:A.value,yCellHeight:C.value,gridXNumber:b.value,gridYNumber:j.value,xAxis:n.data.xAxis,leftScales:g.value,rightScales:x.value,leftAddAreaWidth:30,rightAddAreaWidth:w.value,startTime:H.value,timeXCell:P.value,cervixYCell:X.value,FHRYCell:F.value,fetalPresentationYCell:R.value,scaleValues:n.data.scaleValues,event:W.value,originYCervix:Y.value});return l((()=>d.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=s(d,O,o,c,h);f.value=a,p.value=e;const{select:t}=i(d,O,o);m.value=t}()}),{immediate:!0}),{propItems:O,redrawPoints:f,select:m,clickMenu:p}}export{d as useBirthProcessChart};
|
|
1
|
+
import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as r}from"../../utils/index.js";import"lodash-es";import{useCanvasEvent as i}from"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as s}from"./useBirthProcess.js";function d(d,n,o,v,c,h){const m=e(),f=e(),p=e(),g=a((()=>n.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),x=a((()=>n.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=a((()=>{var e;return(null==(e=x.value)?void 0:e.length)?30:0})),y=a((()=>{var e;return 30+(null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),V=a((()=>{var e;const{width:a}=n.data,t=null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-w.value-t})),b=a((()=>n.data.grid.mainXCell)),j=a((()=>{const e=n.data.grid.mainYCell||14;return n.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),A=a((()=>(V.value-y.value)/b.value)),C=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),k=a((()=>{const{xAxis:e}=n.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return C.value*a})),Y=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!k.value)return k.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return S.value-l*u*C.value})),S=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-C.value*t})),H=a((()=>r(n.data.xAxis.time.startTime))),P=a((()=>36e5/A.value)),X=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),F=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return C.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=t({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...u,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:y.value,endX:V.value,originY:k.value,endY:S.value,xCellWidth:A.value,yCellHeight:C.value,gridXNumber:b.value,gridYNumber:j.value,xAxis:n.data.xAxis,leftScales:g.value,rightScales:x.value,leftAddAreaWidth:30,rightAddAreaWidth:w.value,startTime:H.value,timeXCell:P.value,cervixYCell:X.value,FHRYCell:F.value,fetalPresentationYCell:R.value,scaleValues:n.data.scaleValues,event:W.value,originYCervix:Y.value});return l((()=>d.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=s(d,O,o,c,h);f.value=a,p.value=e;const{select:t}=i(d,O,o);m.value=t}()}),{immediate:!0}),{propItems:O,redrawPoints:f,select:m,clickMenu:p}}export{d as useBirthProcessChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../../shared/utils/fabricjs/index.js";import{range as t}from"lodash-es";import{defaultStyle as n}from"../../useDraw.js";import{useElectrocardiogramCumputedPoint as o}from"../../useCumputedPoint.js";import"../../useEvent.js";import"vue";import"date-fns";import"../../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function r(r,i){const{scale:l,beforeEvent:a,endY:s,endX:u,showScaleText:c,showNumberText:
|
|
1
|
+
import{fabric as e}from"../../../../../../shared/utils/fabricjs/index.js";import{range as t}from"lodash-es";import{defaultStyle as n}from"../../useDraw.js";import{useElectrocardiogramCumputedPoint as o}from"../../useCumputedPoint.js";import"../../useEvent.js";import"vue";import"date-fns";import"../../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function r(r,i){const{scale:l,beforeEvent:a,endY:s,endX:u,showScaleText:c,showNumberText:p,detailRadius:y,points:f,lineStartIndex:h,xCellWidth:d,yCellHeight:m,grid:x={subLineStyle:{},mainLineStyle:{x:{},y:{}}}}=i;let w=null;const{computedX:g,computedY:v,getYValue:b}=o(i);function S(e){return g(e)*l}function L(e){return v(e)*l}function k(e){return b(e/l)}const M=m*l;function j(){var e;w&&(null==(e=r.canvas)||e.remove(w)),w=null}r.on("mousedown",(async o=>{var i,d;if(await(null==a?void 0:a()),1!==o.button||!o.target||!o.pointer)return;const m=o.target;if(!m.points)return;const{x:g,y:v}=o.pointer,b=Math.floor((g-m.left)/m.width*m.points.length)+h;let G=b-y,T=b+y;G<=0?(G=0,T=Math.min(2*y,f.length-1)):T>=f.length-1&&(T=f.length-1,G=Math.max(f.length-2*y,0));const C=f.slice(G,T).map(((e,t)=>({x:G+S(t),y:L(e)}))),W=b-G;let Y=0,$=0;C.forEach(((e,t)=>{e.y>C[Y].y&&(Y=t),e.y<C[$].y&&($=t)}));const E=S(2*y-1),X=C[Y].y-C[$].y-1,z=X+30+70,A={x:u-g<=E?g-E:g,y:s-v<=z?v-z:v};j(),w=new e.Group;const D=[new e.Rect({...n,left:A.x,top:A.y,width:E,height:z,stroke:"transparent",fill:"#fff",shadow:new e.Shadow({color:"rgba(0, 0, 0, 0.3)",blur:15,offsetX:8,offsetY:8})}),function(n,o){const r=e=>e%5?x.subLineStyle:null,i=M/5,l=30+n[Y].y/Math.abs(n[Y].y-n[$].y)*X,a=Math.ceil(l/i),s=Math.ceil((z-l)/i);function u(t,n){return new e.Line([A.x,A.y+t,A.x+E,A.y+t],{...x.mainLineStyle.x,...r(n)})}const c=new e.Group([...t(s).map((e=>u(e*i+l,e))),...t(a).map((e=>u(-e*i+l,e)))]),p=o/n.length*E,y=Math.ceil(p/i),f=Math.ceil((E-p)/i);function h(t,n){return new e.Line([A.x+t,A.y,A.x+t,A.y+z],{...x.mainLineStyle.y,...0===n?x.subLineStyle:r(n)})}const d=new e.Group([...t(f).map((e=>h(e*i+p,e))),...t(y).map((e=>h(-e*i+p,e)))]);return new e.Group([d,c])}(C,W),(H=C.map((({x:e,y:t})=>({x:e,y:-t}))),new e.Polyline(H,{...n,fill:"transparent",stroke:"red",strokeWidth:1,left:A.x,top:A.y+30})),function(t,o){const r={strokeDashArray:[3,4],width:3,top:A.y},i=new e.Line(s(t[Y]),{...n,...r,left:A.x+Y/t.length*E,stroke:"red"}),l=new e.Line(s(t[$]),{...n,...r,stroke:"blue",left:A.x+$/t.length*E}),a=new e.Line(s(t[o]),{...n,...r,stroke:"green",left:A.x+o/t.length*E});return new e.Group([i,l,a]);function s(e){return[e.x,e.y,e.x,e.y-z]}}(C,W),(P=C,R=W,new e.Circle({...n,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:A.x+R/P.length*E-5,top:A.y+30+(P[Y].y-P[R].y)/Math.abs(P[Y].y-P[$].y)*X-5}))];var P,R,H;c&&D.push(new e.Text(`x${l}`,{...n,fill:"black",fontSize:20,left:A.x+10,top:A.y+z-30})),p&&D.push(function(t,o){const r={fontSize:16,left:A.x+E/2+10},i=new e.Text(`最大: ${k(t[Y].y)} mv`,{...n,...r,fill:"red",top:A.y+z-20}),l=new e.Text(`最小: ${k(t[$].y)} mv`,{...n,...r,fill:"blue",top:A.y+z-40}),a=new e.Text(`当前: ${k(t[o].y)} mv`,{...n,...r,fill:"green",top:A.y+z-60});return new e.Group([i,l,a])}(C,W)),w.add(...D).addWithUpdate(),null==(i=r.canvas)||i.add(w),null==(d=r.canvas)||d.discardActiveObject()})),r.on("mouseup",(async e=>{await(null==a?void 0:a()),1===e.button&&j()}))}export{r as useDetailEvent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as n}from"./hooks/useDetailEvent.js";import{defaultStyle as o,drawLine as i}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as s}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";function u(u,d,c){const{computedX:m,computedY:h}=l(d),{borderStyle:f,originX:L,originY:g,xCellWidth:p,yCellHeight:E,canvasWidth:x,canvasHeight:M,dataList:v,columnNumber:C,gridYNumber:N,gridXNumber:y,rowNumber:b,lineStyle:S,titleStyle:w,config:A,calibrationLineHeight:j}=d,R=new Set,U=new Set;function X(e=[]){return~~(e.length/C)*(A.mainXCellValue/s.DEFAULTMAINXCELLVALUE)}function B(t=0){v.forEach(((r,n)=>{if(n===v.length-1&&arguments.length)return;const{x:o,y:i,rowIdx:a}=r.origin,l=X(r.data),u=r.data.reduce(((e,r,o)=>{const a=n<s.MAXLINENUMBER-1&&o>=t&&o<=t+l||n===s.MAXLINENUMBER-1?[{x:m(e.length+1),y:h(-+r)+i}]:[];return e.concat(a)}),[]),f=new e.Polyline(u,{...S,fill:"transparent",strokeWidth:1,left:o,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(k(f,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>c.value&&Promise.reject()}),f.startIdx=t,n<v.length-1?R.add(f):U.add(f),arguments.length)return;I({x:o,y:i},S);const L=new e.Text(String(r.title),{...w,left:o+(4===C?p:p/2),top:i,originX:"left",originY:"bottom"});U.add(L)}));const r=arguments.length?[...R]:[...R,...U];u.value.add(...r)}function k(e,t){n(e,t)}function I({x:t,y:r},n){if(4===C)return;const i=t-p,a=p/s.SMALLCELLNUMBER,l=new e.Polyline([{x:i,y:r},{x:i+a,y:r},{x:i+a,y:r-j},{x:i+3*a,y:r-j},{x:i+3*a,y:r},{x:i+4*a,y:r}],{...n,fill:"transparent",strokeWidth:1,left:i,...o});U.add(l)}a(u,{...d,gridXNumber:y*s.SMALLCELLNUMBER,gridYNumber:N*s.SMALLCELLNUMBER,xCellWidth:p/s.SMALLCELLNUMBER,yCellHeight:E/s.SMALLCELLNUMBER,grid:{...d.grid,subXCell:s.SMALLCELLNUMBER,subYCell:s.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=f,r=new e.Rect({...f,width:x-t,height:M-t,left:L,top:g,fill:"transparent"});u.value.add(r)}(),function(){const e=x/C,t=[];r(C).forEach((r=>{if(r+1>=C)return;const n=(r+1)*e,o=i([n,0,n,M],{stroke:"#000"});t.push(o)})),u.value.add(...t)}(),B();return{updatePolyline:t((t=>{const r=X(v[v.length-1].data);if(r===v[0].data.length)return;const n=v[v.length-1].data.length,o=t/100*n-r/2,i=o+r>n?n-r:Math.max(0,o);e.util.requestAnimFrame((()=>{if(R.size){const[e]=[...R];if(e.startIdx===i)return;[...R].forEach((e=>u.value.remove(e))),R.clear()}B(i)}))}),150)}}export{u as useElectrocardiogram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as a,reactive as t,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{isNumber as o}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as d}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function v(v,c,g,h,f,p){const N=e(),b=e(),M=e(),L=e(),y=a((()=>c.data.width)),x=a((()=>c.data.height)),C=a((()=>(y.value-0)/w.value)),S=a((()=>(x.value-0)/E.value)),w=a((()=>{const{dataList:e,config:a,grid:t}=c.data;if(o(t.gridXNumber))return t.gridXNumber;const r=e[e.length-1].data.length/a.hz;return Math.ceil(r/a.mainXCellValue)})),E=a((()=>{const{config:e,grid:a,dataList:t}=c.data;if(o(a.gridYNumber))return a.gridYNumber;const r=t.length;return Math.ceil(X.value*r*2/e.mainYCellValue)})),X=a((()=>{const{dataList:e,config:a}=c.data,t=e[e.length-1].data,r=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*r:"v"===a.valueUnit?1e3*r:r})),Y=a((()=>{var e;return(null==(e=c.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),j=a((()=>{const{mode:e="2-6"}=c.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),R=a((()=>{const{rowNumber:e}=j.value,{dataList:a}=c.data,t=a.length;return Math.round(E.value/(e+(t===d.MAXLINENUMBER?1:0)))})),I=a((()=>{const{dataList:e,width:a,config:t,grid:r}=c.data,{columnNumber:u,rowNumber:l}=j.value,i=a/u,n=e.length,o=Math.ceil(R.value/2),m=function(){const{valueUnit:a,mainYCellValue:r}=t,l=e[0].data,i=d(Math.max(...l));if(2!==u)return i;const n=e[6].data,o=d(Math.max(...n));return Math.max(i,o);function d(e){return("uv"===a?.001*e:"v"===a?1e3*e:e)/r*S.value}}(),s=S.value*o,v=1===u||s<m?S.value*Math.ceil(m/S.value):s,g=4===u?0:C.value;return e.map(((e,a)=>{const t=d.MAXLINENUMBER===n&&a===n-1?l:a%l;return{...e,origin:{x:(d.MAXLINENUMBER===n&&a===n-1?0:Math.floor(a/l))*i+g,y:t*(S.value*R.value)+v,rowIdx:t}}}))})),U=a((()=>{var e;const{calibrationLineGridYNumber:a,mainYCellValue:t}=(null==(e=c.data)?void 0:e.config)||{};return a?S.value*a:t?S.value/t:S.value})),A=t({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...l,...c.data.borderStyle},lineStyle:{...i,...c.data.lineStyle},titleStyle:{...n,...c.data.titleStyle},measureLineStyle:{...i,...c.data.measureLineStyle},measureTextStyle:{...n,...c.data.measureTextStyle},grid:c.data.grid,originX:0,endX:y.value,originY:0,endY:x.value,xCellWidth:C.value,yCellHeight:S.value,gridXNumber:w.value,gridYNumber:E.value,event:Y.value,dataList:I.value,columnNumber:r(j).columnNumber,rowNumber:r(j).rowNumber,config:c.data.config,calibrationLineHeight:r(U)});return u((()=>v.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:r}=s(v,A),{updatePolyline:u}=m(v,A,a);b.value=e,M.value=t,L.value=r,N.value=u}()}),{immediate:!0}),{propItems:A,updatePolyline:N,useMeasureRuler:b,useCaliper:M,useCaliperRuler:L,getGridInfo:function(){return{cellWidth:C.value,cellHeight:S.value,smallCellNumber:d.SMALLCELLNUMBER}}}}export{v as useElectrocardiogramChart};
|
|
1
|
+
import{ref as e,computed as a,reactive as t,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{isNumber as o}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as d}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function v(v,c,g,h,f,p){const N=e(),b=e(),M=e(),L=e(),y=a((()=>c.data.width)),x=a((()=>c.data.height)),C=a((()=>(y.value-0)/w.value)),S=a((()=>(x.value-0)/E.value)),w=a((()=>{const{dataList:e,config:a,grid:t}=c.data;if(o(t.gridXNumber))return t.gridXNumber;const r=e[e.length-1].data.length/a.hz;return Math.ceil(r/a.mainXCellValue)})),E=a((()=>{const{config:e,grid:a,dataList:t}=c.data;if(o(a.gridYNumber))return a.gridYNumber;const r=t.length;return Math.ceil(X.value*r*2/e.mainYCellValue)})),X=a((()=>{const{dataList:e,config:a}=c.data,t=e[e.length-1].data,r=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*r:"v"===a.valueUnit?1e3*r:r})),Y=a((()=>{var e;return(null==(e=c.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),j=a((()=>{const{mode:e="2-6"}=c.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),R=a((()=>{const{rowNumber:e}=j.value,{dataList:a}=c.data,t=a.length;return Math.round(E.value/(e+(t===d.MAXLINENUMBER?1:0)))})),I=a((()=>{const{dataList:e,width:a,config:t,grid:r}=c.data,{columnNumber:u,rowNumber:l}=j.value,i=a/u,n=e.length,o=Math.ceil(R.value/2),m=function(){const{valueUnit:a,mainYCellValue:r}=t,l=e[0].data,i=d(Math.max(...l));if(2!==u)return i;const n=e[6].data,o=d(Math.max(...n));return Math.max(i,o);function d(e){return("uv"===a?.001*e:"v"===a?1e3*e:e)/r*S.value}}(),s=S.value*o,v=1===u||s<m?S.value*Math.ceil(m/S.value):s,g=4===u?0:C.value;return e.map(((e,a)=>{const t=d.MAXLINENUMBER===n&&a===n-1?l:a%l;return{...e,origin:{x:(d.MAXLINENUMBER===n&&a===n-1?0:Math.floor(a/l))*i+g,y:t*(S.value*R.value)+v,rowIdx:t}}}))})),U=a((()=>{var e;const{calibrationLineGridYNumber:a,mainYCellValue:t}=(null==(e=c.data)?void 0:e.config)||{};return a?S.value*a:t?S.value/t:S.value})),A=t({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...l,...c.data.borderStyle},lineStyle:{...i,...c.data.lineStyle},titleStyle:{...n,...c.data.titleStyle},measureLineStyle:{...i,...c.data.measureLineStyle},measureTextStyle:{...n,...c.data.measureTextStyle},grid:c.data.grid,originX:0,endX:y.value,originY:0,endY:x.value,xCellWidth:C.value,yCellHeight:S.value,gridXNumber:w.value,gridYNumber:E.value,event:Y.value,dataList:I.value,columnNumber:r(j).columnNumber,rowNumber:r(j).rowNumber,config:c.data.config,calibrationLineHeight:r(U)});return u((()=>v.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:r}=s(v,A),{updatePolyline:u}=m(v,A,a);b.value=e,M.value=t,L.value=r,N.value=u}()}),{immediate:!0}),{propItems:A,updatePolyline:N,useMeasureRuler:b,useCaliper:M,useCaliperRuler:L,getGridInfo:function(){return{cellWidth:C.value,cellHeight:S.value,smallCellNumber:d.SMALLCELLNUMBER}}}}export{v as useElectrocardiogramChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as o,drawText as r}from"../useDraw.js";import{useElectrocardiogramCumputedPoint as i}from"../useCumputedPoint.js";import"../useEvent.js";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function n(n,l){const{getXValue:s,getYValue:u}=i(l),{yCellHeight:a,xCellWidth:c,measureLineStyle:f,measureTextStyle:h}=l,d=e(!1),v={origin:{x:0,y:0},line:null,rendering:!1},p={origin:{x:300,y:0},caliper:{width:4*c,height:60,rect:null},caliperRuler:{width:6*c,height:120,rect:null}};function m(e){C();const{width:o,height:i,rect:l}=p[e];if(l)return;const{x:s,y:u}=p.origin,a=p.caliper.height;p[e].rect=new t.Rect({left:s,top:u,width:o,height:i,strokeWidth:0,fill:"transparent",hasControls:!1,hasBorders:!1,hoverCursor:"move"});const c={...f,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",strokeWidth:2,__type:e,evented:!0,selectable:!0},d=new t.Line([s,u,s,i],{...c,lockMovementY:!0,originX:"center"}),v=new t.Line([s+o,u,s+o,i],{...c,lockMovementY:!0,originX:"center"}),m=new t.Line([s,a,s+o,a],{...c,lockMovementX:!0,evented:"caliper"===e,hoverCursor:"caliper"===e?"n-resize":"default",originY:"center"}),y=r([s,m.top+10],{value:x(m.x1,m.x2),...h,originX:"left",originY:"top"});d.rect=p[e].rect,v.rect=p[e].rect,m.rect=p[e].rect,Object.assign(p[e].rect,{leftLine:d,rightLine:v,horizontalLine:m,text:y}),function(e,t){e.on("moving",(()=>{const{leftLine:o,rightLine:r,horizontalLine:i,text:n}=e;null==o||o.setCoords().set({x1:e.left,y1:e.top,x2:e.left,y2:e.top+e.height}),null==r||r.setCoords().set({x1:e.left+e.width,y1:e.top,x2:e.left+e.width,y2:e.top+e.height});const l="caliper"===t?e.top+e.height:e.top+e.height/2;null==i||i.setCoords().set({x1:e.left,y1:l,x2:e.left+e.width,y2:l}),n.setCoords().set({left:e.left,top:l+10})})),e.on("mouseup",(t=>{1===t.button&&(n.value.discardActiveObject(),e.leftLine.bringToFront(),e.rightLine.bringToFront(),e.horizontalLine.bringToFront())}))}(p[e].rect,e),g(d,"left"),g(v,"right"),"caliper"===e&&g(m,"horizontal"),n.value.add(p[e].rect,d,v,m,y)}function x(e,t){return`${1e3*s(t-e)}ms`}function g(e,t){e.on("moving",(()=>{const{rect:o}=e;if(!o)return;const{leftLine:r,rightLine:i,horizontalLine:n,text:l}=o;if("horizontal"===t)return e.top<=o.top?e.setCoords().set({y1:o.top,y2:o.top}):e.setCoords().set({y1:e.top,y2:e.top}),o.setCoords().set({height:e.top-o.top}),null==r||r.setCoords().set({y2:e.top}),null==i||i.setCoords().set({y2:e.top}),void l.setCoords().set({top:e.top+10});"left"===t&&(e.left>=i.left?e.setCoords().set({x1:i.left,x2:i.left}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({left:e.left,width:i.left-e.left}),n.setCoords().set({x1:e.left}),l.setCoords().set({left:e.left})),"right"===t&&(e.left<=r.left?e.setCoords().set({x1:r.left,x2:r.left}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({width:e.left-r.left}),n.setCoords().set({x2:e.left})),l.set("text",x(n.x1,n.x2))}))}function C(){Object.values(p).forEach((e=>{const{rect:t}=e;t&&(n.value.remove(t),n.value.remove(t.leftLine),n.value.remove(t.rightLine),n.value.remove(t.horizontalLine),n.value.remove(t.text),e.rect=null)})),v.line&&(n.value.remove(v.line),v.line.text&&n.value.remove(v.line.text),v.line=null)}return n.value.on("mouse:down",(e=>{if(1===e.button&&d.value){const{x:t=0,y:o=0}=e.pointer||{};v.origin={x:t,y:o},v.rendering=!0}})),n.value.on("mouse:up",(e=>{const{button:t}=e;1===t&&d.value&&setTimeout((()=>{d.value=!1,v.rendering=!1})),3===t&&C()})),n.value.on("mouse:move",(e=>{var t;if(1===e.button&&d.value&&v.rendering){const{x:i=0,y:l=0}=e.pointer||{};v.line&&n.value.remove(v.line),(null==(t=v.line)?void 0:t.text)&&n.value.remove(v.line.text);const{x:c,y:d}=v.origin;v.line=o([c,d,i,l],f);const p=-u(l-d).toFixed(2),m=1e3*s(i-c),x=r([i,l+2*a],{value:`${p}mv\n${m}ms`,...h});v.line.text=x,n.value.add(v.line,x)}})),{flag:d,useMeasureRuler:function(){d.value||(d.value=!0)},useCaliper:function(){m("caliper")},useCaliperRuler:function(){m("caliperRuler")}}}export{n as useMeasureInstrument};
|
|
1
|
+
import{ref as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as o,drawText as r}from"../useDraw.js";import{useElectrocardiogramCumputedPoint as i}from"../useCumputedPoint.js";import"../useEvent.js";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function n(n,l){const{getXValue:s,getYValue:u}=i(l),{yCellHeight:a,xCellWidth:c,measureLineStyle:f,measureTextStyle:h}=l,d=e(!1),v={origin:{x:0,y:0},line:null,rendering:!1},p={origin:{x:300,y:0},caliper:{width:4*c,height:60,rect:null},caliperRuler:{width:6*c,height:120,rect:null}};function m(e){C();const{width:o,height:i,rect:l}=p[e];if(l)return;const{x:s,y:u}=p.origin,a=p.caliper.height;p[e].rect=new t.Rect({left:s,top:u,width:o,height:i,strokeWidth:0,fill:"transparent",hasControls:!1,hasBorders:!1,hoverCursor:"move"});const c={...f,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",strokeWidth:2,__type:e,evented:!0,selectable:!0},d=new t.Line([s,u,s,i],{...c,lockMovementY:!0,originX:"center"}),v=new t.Line([s+o,u,s+o,i],{...c,lockMovementY:!0,originX:"center"}),m=new t.Line([s,a,s+o,a],{...c,lockMovementX:!0,evented:"caliper"===e,hoverCursor:"caliper"===e?"n-resize":"default",originY:"center"}),y=r([s,m.top+10],{value:x(m.x1,m.x2),...h,originX:"left",originY:"top"});d.rect=p[e].rect,v.rect=p[e].rect,m.rect=p[e].rect,Object.assign(p[e].rect,{leftLine:d,rightLine:v,horizontalLine:m,text:y}),function(e,t){e.on("moving",(()=>{const{leftLine:o,rightLine:r,horizontalLine:i,text:n}=e;null==o||o.setCoords().set({x1:e.left,y1:e.top,x2:e.left,y2:e.top+e.height}),null==r||r.setCoords().set({x1:e.left+e.width,y1:e.top,x2:e.left+e.width,y2:e.top+e.height});const l="caliper"===t?e.top+e.height:e.top+e.height/2;null==i||i.setCoords().set({x1:e.left,y1:l,x2:e.left+e.width,y2:l}),n.setCoords().set({left:e.left,top:l+10})})),e.on("mouseup",(t=>{1===t.button&&(n.value.discardActiveObject(),e.leftLine.bringToFront(),e.rightLine.bringToFront(),e.horizontalLine.bringToFront())}))}(p[e].rect,e),g(d,"left"),g(v,"right"),"caliper"===e&&g(m,"horizontal"),n.value.add(p[e].rect,d,v,m,y)}function x(e,t){return`${1e3*s(t-e)}ms`}function g(e,t){e.on("moving",(()=>{const{rect:o}=e;if(!o)return;const{leftLine:r,rightLine:i,horizontalLine:n,text:l}=o;if("horizontal"===t)return e.top<=o.top?e.setCoords().set({y1:o.top,y2:o.top}):e.setCoords().set({y1:e.top,y2:e.top}),o.setCoords().set({height:e.top-o.top}),null==r||r.setCoords().set({y2:e.top}),null==i||i.setCoords().set({y2:e.top}),void l.setCoords().set({top:e.top+10});"left"===t&&(e.left>=i.left?e.setCoords().set({x1:i.left,x2:i.left}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({left:e.left,width:i.left-e.left}),n.setCoords().set({x1:e.left}),l.setCoords().set({left:e.left})),"right"===t&&(e.left<=r.left?e.setCoords().set({x1:r.left,x2:r.left}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({width:e.left-r.left}),n.setCoords().set({x2:e.left})),l.set("text",x(n.x1,n.x2))}))}function C(){Object.values(p).forEach((e=>{const{rect:t}=e;t&&(n.value.remove(t),n.value.remove(t.leftLine),n.value.remove(t.rightLine),n.value.remove(t.horizontalLine),n.value.remove(t.text),e.rect=null)})),v.line&&(n.value.remove(v.line),v.line.text&&n.value.remove(v.line.text),v.line=null)}return n.value.on("mouse:down",(e=>{if(1===e.button&&d.value){const{x:t=0,y:o=0}=e.pointer||{};v.origin={x:t,y:o},v.rendering=!0}})),n.value.on("mouse:up",(e=>{const{button:t}=e;1===t&&d.value&&setTimeout((()=>{d.value=!1,v.rendering=!1})),3===t&&C()})),n.value.on("mouse:move",(e=>{var t;if(1===e.button&&d.value&&v.rendering){const{x:i=0,y:l=0}=e.pointer||{};v.line&&n.value.remove(v.line),(null==(t=v.line)?void 0:t.text)&&n.value.remove(v.line.text);const{x:c,y:d}=v.origin;v.line=o([c,d,i,l],f);const p=-u(l-d).toFixed(2),m=1e3*s(i-c),x=r([i,l+2*a],{value:`${p}mv\n${m}ms`,...h});v.line.text=x,n.value.add(v.line,x)}})),{flag:d,useMeasureRuler:function(){d.value||(d.value=!0)},useCaliper:function(){m("caliper")},useCaliperRuler:function(){m("caliperRuler")}}}export{n as useMeasureInstrument};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as s,drawScaleNumber as u,drawScaleLine as a}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import{isEffectiveNode as d,getTime as h,getScaleNumberList as f}from"../../utils/index.js";import{cloneDeep as p,last as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function v(v,g,x,y,b){const{computedX:w,computedY:S,getXValue:E,getYValue:L}=l(g),{getEqualXTypes:j,handleAddPrevent:k,isGridLimit:X,setPrevAndNextPoint:P,getPointEventProps:A}=c(v,x,g),{xAxis:C,grid:T,originX:G,originY:Y,xCellWidth:N,endY:V,startTime:H,leftScales:M,rightScales:$,yCellHeight:B,endX:W,scaleValues:q,canvasWidth:z,borderStyle:D,event:F,other:I,timeXAxisHeight:R,canvasHeight:J,extraTimeXAxisList:K}=g,O=p(q),Q=new Set;function U(){O.filter((t=>t.show)).forEach(((t,r)=>{var l;const s=[],u=[],a=[];null==(l=t.data)||l.forEach(((l,c)=>{!function(l,c,d){if(!l&&!c.childbirth||!(null==c?void 0:c.time)||!tt(c.time))return;let h,f;const{pointAttr:v={},lineAttr:g={},title:x="",key:b,type:S="circle",childbirthStyle:j={}}=t,k=p(t.data[d+1]);k&&!k.value&&k.childbirth&&(k.value=c.value);const X=_(k,t);l&&X&&!c.breakpoint&&(f=Z([...l,...X],g));if(c.childbirth){const t=l?l[0]:w(c.time),n=l?l[1]:m(s).top,o=n+B/2,r=Z([t,n,t,o],g);a.push(r);const u=e([t,o],{value:String(c.childbirth),...i,...j,backgroundColor:"#fff"});a.push(u)}const P=u[d-1],C={origin:{data:c,title:x,key:b||"",dataIndex:r,index:d},leftLine:P,rightLine:f,...v,...A(),...n};l&&(P||(C.leftLine=null),h=o(S,{left:l[0],top:l[1],...C}));f&&u.push(f),h&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{!function(t,e="moving"){const{title:i,key:n,data:o}=t.origin;y.point={x:t.left,y:t.top},y.list=[`${i} ${"hover"===e?o.value:L(n,t.top)}`,`时间 ${E(t.left).slice(-5)}`],y.show=!0}(t,"hover")})),t.on("mouseout",(()=>{y.show=!1})))}(h),s.push(h),Q.add(h))}(_(l,t),l,c)})),Promise.all(s).then((t=>{P(t),Promise.all(a).then((e=>{v.value.add(...u,...t,...e),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Z([e,i,o,r],l){return new t.Polyline([{x:e,y:i},{x:o,y:i},{x:o,y:r}],{...l,fill:"transparent",...n})}function _(t,e){if(d(t)&&tt(t.time)){const i=w(t.time),n=S(e.key,e.range,t.value);return[i,n<Y?Y:n>V?V:n]}}function tt(t){var e,i;const n=(null==(i=null==(e=null==C?void 0:C.time)?void 0:e.range)?void 0:i[1])||20,o=H+60*n*60*1e3,r=h(t);return r>=H&&r<=o}return r(v,g),function(){const e=new t.Rect({...D,width:W-G,height:V-Y,left:G,top:Y,fill:"transparent"});v.value.add(e)}(),function(){function o(o,r="left"){const l=10;let c="left"===r?0:W;o.forEach(((o,r)=>{const{range:d,spaceValue:h,width:p,title:m,titleStyle:g,unit:x,key:y,position:b="center",spaceGridNumber:w=1,showNumber:S,showMaxMinNumber:E}=o,L=[],j=[],k=f(d,h),X=k.length,{lineXMain:P,lineXSub:A,textLeft:C}=s(b,c,p);k.forEach(((t,e)=>{const i=V-e*B*w;!S||(0===e||e===X-1)&&!E||L.push(u(String(t),o,C,i)),j.push(...a(o,e,P,A,i,B,Y,X))}));const T=e([c+l,Y+(V-Y)/2],{value:String(m+"("+x+")"),...i,originX:"center",angle:-90,...g}),G=new t.Group([...j,...L,...T?[T]:[]],{objectCaching:!1,...n});v.value.add(G),G.sendToBack(),c+=p}))}o(M),o($,"right")}(),function(){const{show:o,range:r=[0,20],position:l="top",style:s,spaceGridNumber:u=2,spaceValue:a=2}=C.time;if(o){const o=[],c=B/2;f(r,a).forEach(((t,n)=>{const r="top"===l?Y-c:V+R+c;o.push(e([G+n*N*u,r],{value:0===n?"Admission":String(t),...i,...s}))}));const d=new t.Group(o,{objectCaching:!1,...n});v.value.add(d),v.value.sendToBack(d)}!function(){if((null==K?void 0:K.length)>0){const t=[];K.forEach((n=>{const o=w(n),r=V+R;t.push(e([o,r],{value:String(n.slice(11,16)),...i,originY:"bottom"}))})),v.value.add(...t)}}()}(),function(){const{alertLineList:t=[],alertLineTitle:n="入院时宫颈扩张不同情况"}=I;if(t.length<1)return;const o=e([W,0],{value:n,...i,originX:"right",originY:"top"});v.value.add(o),t.forEach((t=>{const{style:i,data:n=[]}=t;if(n.length<1)return;const o=[],r=O.find((t=>"cervix"===t.key));n.map((t=>({...t,time:H+60*t.time*60*1e3}))).forEach(((t,n,l)=>{const s=_(t,r),u=_(l[n+1],r);s&&!u&&o.push(e([s[0],Y-10],{value:l[0].value+(r.unit||"cm"),fill:i.stroke||"#000"})),s&&u&&o.push(Z([...s,...u],i))})),v.value.add(...o)}))}(),U(),{redrawPoints:function(){var t;Q.size&&(null==(t=v.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...Q]))),Q.clear(),U()}}}export{v as useNewBirthProcess};
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as s,drawScaleNumber as u,drawScaleLine as a}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import{isEffectiveNode as d,getTime as h,getScaleNumberList as f}from"../../utils/index.js";import{cloneDeep as p,last as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function v(v,g,x,y,b){const{computedX:w,computedY:S,getXValue:E,getYValue:L}=l(g),{getEqualXTypes:j,handleAddPrevent:k,isGridLimit:X,setPrevAndNextPoint:P,getPointEventProps:A}=c(v,x,g),{xAxis:C,grid:T,originX:G,originY:Y,xCellWidth:N,endY:V,startTime:H,leftScales:M,rightScales:$,yCellHeight:B,endX:W,scaleValues:q,canvasWidth:z,borderStyle:D,event:F,other:I,timeXAxisHeight:R,canvasHeight:J,extraTimeXAxisList:K}=g,O=p(q),Q=new Set;function U(){O.filter((t=>t.show)).forEach(((t,r)=>{var l;const s=[],u=[],a=[];null==(l=t.data)||l.forEach(((l,c)=>{!function(l,c,d){if(!l&&!c.childbirth||!(null==c?void 0:c.time)||!tt(c.time))return;let h,f;const{pointAttr:v={},lineAttr:g={},title:x="",key:b,type:S="circle",childbirthStyle:j={}}=t,k=p(t.data[d+1]);k&&!k.value&&k.childbirth&&(k.value=c.value);const X=_(k,t);l&&X&&!c.breakpoint&&(f=Z([...l,...X],g));if(c.childbirth){const t=l?l[0]:w(c.time),n=l?l[1]:m(s).top,o=n+B/2,r=Z([t,n,t,o],g);a.push(r);const u=e([t,o],{value:String(c.childbirth),...i,...j,backgroundColor:"#fff"});a.push(u)}const P=u[d-1],C={origin:{data:c,title:x,key:b||"",dataIndex:r,index:d},leftLine:P,rightLine:f,...v,...A(),...n};l&&(P||(C.leftLine=null),h=o(S,{left:l[0],top:l[1],...C}));f&&u.push(f),h&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{!function(t,e="moving"){const{title:i,key:n,data:o}=t.origin;y.point={x:t.left,y:t.top},y.list=[`${i} ${"hover"===e?o.value:L(n,t.top)}`,`时间 ${E(t.left).slice(-5)}`],y.show=!0}(t,"hover")})),t.on("mouseout",(()=>{y.show=!1})))}(h),s.push(h),Q.add(h))}(_(l,t),l,c)})),Promise.all(s).then((t=>{P(t),Promise.all(a).then((e=>{v.value.add(...u,...t,...e),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Z([e,i,o,r],l){return new t.Polyline([{x:e,y:i},{x:o,y:i},{x:o,y:r}],{...l,fill:"transparent",...n})}function _(t,e){if(d(t)&&tt(t.time)){const i=w(t.time),n=S(e.key,e.range,t.value);return[i,n<Y?Y:n>V?V:n]}}function tt(t){var e,i;const n=(null==(i=null==(e=null==C?void 0:C.time)?void 0:e.range)?void 0:i[1])||20,o=H+60*n*60*1e3,r=h(t);return r>=H&&r<=o}return r(v,g),function(){const e=new t.Rect({...D,width:W-G,height:V-Y,left:G,top:Y,fill:"transparent"});v.value.add(e)}(),function(){function o(o,r="left"){const l=10;let c="left"===r?0:W;o.forEach(((o,r)=>{const{range:d,spaceValue:h,width:p,title:m,titleStyle:g,unit:x,key:y,position:b="center",spaceGridNumber:w=1,showNumber:S,showMaxMinNumber:E}=o,L=[],j=[],k=f(d,h),X=k.length,{lineXMain:P,lineXSub:A,textLeft:C}=s(b,c,p);k.forEach(((t,e)=>{const i=V-e*B*w;!S||(0===e||e===X-1)&&!E||L.push(u(String(t),o,C,i)),j.push(...a(o,e,P,A,i,B,Y,X))}));const T=e([c+l,Y+(V-Y)/2],{value:String(m+"("+x+")"),...i,originX:"center",angle:-90,...g}),G=new t.Group([...j,...L,...T?[T]:[]],{objectCaching:!1,...n});v.value.add(G),G.sendToBack(),c+=p}))}o(M),o($,"right")}(),function(){const{show:o,range:r=[0,20],position:l="top",style:s,spaceGridNumber:u=2,spaceValue:a=2}=C.time;if(o){const o=[],c=B/2;f(r,a).forEach(((t,n)=>{const r="top"===l?Y-c:V+R+c;o.push(e([G+n*N*u,r],{value:0===n?"Admission":String(t),...i,...s}))}));const d=new t.Group(o,{objectCaching:!1,...n});v.value.add(d),v.value.sendToBack(d)}!function(){if((null==K?void 0:K.length)>0){const t=[];K.forEach((n=>{const o=w(n),r=V+R;t.push(e([o,r],{value:String(n.slice(11,16)),...i,originY:"bottom"}))})),v.value.add(...t)}}()}(),function(){const{alertLineList:t=[],alertLineTitle:n="入院时宫颈扩张不同情况"}=I;if(t.length<1)return;const o=e([W,0],{value:n,...i,originX:"right",originY:"top"});v.value.add(o),t.forEach((t=>{const{style:i,data:n=[]}=t;if(n.length<1)return;const o=[],r=O.find((t=>"cervix"===t.key));n.map((t=>({...t,time:H+60*t.time*60*1e3}))).forEach(((t,n,l)=>{const s=_(t,r),u=_(l[n+1],r);s&&!u&&o.push(e([s[0],Y-10],{value:l[0].value+(r.unit||"cm"),fill:i.stroke||"#000"})),s&&u&&o.push(Z([...s,...u],i))})),v.value.add(...o)}))}(),U(),{redrawPoints:function(){var t;Q.size&&(null==(t=v.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...Q]))),Q.clear(),U()}}}export{v as useNewBirthProcess};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as r}from"date-fns";import{getTime as u}from"../../utils/index.js";import{range as s,last as n}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{useNewBirthProcess as o}from"./useNewBirthProcess.js";function d(d,v,c,m,h,x){const p=e(),g=e(),f=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),b=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=a((()=>{var e;return null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0)})),j=a((()=>{var e;const{width:a}=v.data;return a-((null==(e=b.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))||15)})),A=a((()=>v.data.grid.mainXCell||20)),M=a((()=>v.data.grid.mainYCell||8)),S=a((()=>(j.value-y.value)/A.value)),V=a((()=>{var e;const{xAxis:a,height:t,other:l}=v.data,i=Object.values(a).reduce(((e,a)=>(a.show&&e++,e)),0),r=(null!=(e=null==l?void 0:l.alertLineList.length)?e:0)>0;return(t-H.value)/(M.value+i+(r?1:0))})),X=a((()=>{var e;const{xAxis:a,other:t}=v.data,l=Object.values(a).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0),i=(null!=(e=null==t?void 0:t.alertLineList.length)?e:0)>0;return V.value*(l||i?1:0)})),C=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-V.value*t-H.value})),H=a((()=>{const e=w.value.concat(b.value);return(null==e?void 0:e.length)>0?20:0})),L=a((()=>u(v.data.xAxis.time.startTime))),Y=a((()=>{const{spaceValue:e,spaceGridNumber:a}=v.data.xAxis.time||{};return 60*e*60*1e3/(S.value*a)})),N=a((()=>{var e,a,t;const l=null==(t=null==(a=null==(e=w.value.concat(b.value))?void 0:e[0])?void 0:a.data)?void 0:t.map((e=>u(e.time))),i=Math.min(...l);let o=Math.min(Math.max(...l));const d=Y.value*S.value,v=s(1,A.value+1).reduce(((e,a,t)=>e.concat(L.value+a*d)),[L.value]);o=Math.min(o,n(v));const c=v.findIndex((e=>Math.abs(e-i)<d)),m=v.findIndex((e=>Math.abs(e-o)<d))+1;return v.filter(((e,a)=>a>=c&&a<=m)).map((e=>r(new Date(e),"yyyy-MM-dd HH:mm:ss")))})),I=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return V.value/((null==a?void 0:a.spaceValue)||1)})),O=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),P=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...i,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:y.value,endX:j.value,originY:X.value,endY:C.value,xCellWidth:S.value,yCellHeight:V.value,gridXNumber:A.value,gridYNumber:M.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:b.value,startTime:L.value,timeXCell:Y.value,cervixYCell:I.value,scaleValues:v.data.scaleValues,timeXAxisHeight:H.value,extraTimeXAxisList:N.value,event:O.value});return l((()=>d.value),(e=>{e&&function(){const{redrawPoints:e}=o(d,P,c,h);g.value=e}()}),{immediate:!0}),{propItems:P,redrawPoints:g,select:p,clickMenu:f}}export{d as useNewBirthProcessChart};
|
|
1
|
+
import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as r}from"date-fns";import{getTime as u}from"../../utils/index.js";import{range as s,last as n}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useNewBirthProcess as o}from"./useNewBirthProcess.js";function d(d,v,c,m,h,x){const p=e(),g=e(),f=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),b=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=a((()=>{var e;return null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0)})),j=a((()=>{var e;const{width:a}=v.data;return a-((null==(e=b.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))||15)})),A=a((()=>v.data.grid.mainXCell||20)),M=a((()=>v.data.grid.mainYCell||8)),S=a((()=>(j.value-y.value)/A.value)),V=a((()=>{var e;const{xAxis:a,height:t,other:l}=v.data,i=Object.values(a).reduce(((e,a)=>(a.show&&e++,e)),0),r=(null!=(e=null==l?void 0:l.alertLineList.length)?e:0)>0;return(t-H.value)/(M.value+i+(r?1:0))})),X=a((()=>{var e;const{xAxis:a,other:t}=v.data,l=Object.values(a).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0),i=(null!=(e=null==t?void 0:t.alertLineList.length)?e:0)>0;return V.value*(l||i?1:0)})),C=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-V.value*t-H.value})),H=a((()=>{const e=w.value.concat(b.value);return(null==e?void 0:e.length)>0?20:0})),L=a((()=>u(v.data.xAxis.time.startTime))),Y=a((()=>{const{spaceValue:e,spaceGridNumber:a}=v.data.xAxis.time||{};return 60*e*60*1e3/(S.value*a)})),N=a((()=>{var e,a,t;const l=null==(t=null==(a=null==(e=w.value.concat(b.value))?void 0:e[0])?void 0:a.data)?void 0:t.map((e=>u(e.time))),i=Math.min(...l);let o=Math.min(Math.max(...l));const d=Y.value*S.value,v=s(1,A.value+1).reduce(((e,a,t)=>e.concat(L.value+a*d)),[L.value]);o=Math.min(o,n(v));const c=v.findIndex((e=>Math.abs(e-i)<d)),m=v.findIndex((e=>Math.abs(e-o)<d))+1;return v.filter(((e,a)=>a>=c&&a<=m)).map((e=>r(new Date(e),"yyyy-MM-dd HH:mm:ss")))})),I=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return V.value/((null==a?void 0:a.spaceValue)||1)})),O=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),P=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...i,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:y.value,endX:j.value,originY:X.value,endY:C.value,xCellWidth:S.value,yCellHeight:V.value,gridXNumber:A.value,gridYNumber:M.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:b.value,startTime:L.value,timeXCell:Y.value,cervixYCell:I.value,scaleValues:v.data.scaleValues,timeXAxisHeight:H.value,extraTimeXAxisList:N.value,event:O.value});return l((()=>d.value),(e=>{e&&function(){const{redrawPoints:e}=o(d,P,c,h);g.value=e}()}),{immediate:!0}),{propItems:P,redrawPoints:g,select:p,clickMenu:f}}export{d as useNewBirthProcessChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as s}from"../useEvent.js";import{useCommon as a}from"../useCommon.js";import{getPointRange as f,getIndex as u,isEffectiveNode as c,getTime as p}from"../../utils/index.js";import{cloneDeep as d,last as m,omit as v,flatten as g}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as y}from"@vueuse/core";function h(h,k,x,L,P,w){const{computedX:b,computedY:A,getXValue:I,getYValue:C}=r(k),{xCellWidth:K,pointSelectionStyle:E,originX:j,endX:T,originY:X,endY:V,event:Y,scaleValues:M,xAxis:S,startTime:D,timeXCell:O,itemList:$,dialog:F,topGridOriginY:_,topGridEndY:z}=k,G=new Map,N=new Set,J=d(M);let q=[],R=null;const W=new Set;l(h,k);const{getEqualXTypes:B,handleAddPrevent:H,setPrevAndNextPoint:Q,getPointEventProps:U}=a(h,x,k),{pause:Z,resume:ee}=y((()=>{!function(){if(!W.size)return;for(const e of W)e.set("opacity",1===e.opacity?.5:1);h.value.renderAll()}()}),800);function te(){J.forEach((e=>{const{range:t=[],spaceValue:n}=e;n&&(t[0]||t[1])&&e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function s({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=A(t.type,t.range,n),s=i([j,r,T,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});Y.hovered&&o&&(s.on("mousemove",(({pointer:e})=>{L.point={...e||{x:s.left,y:s.top}},L.list=[`${o} ${n}${t.unit||""}`],L.show=!0})),s.on("mouseout",(()=>{L.show=!1}))),h.value.add(s)}s(n),s(o),s(l),s(r)}(t,e),le(t,n,e))}))}))}function ne(e=[]){if(!(null==R?void 0:R.areaPos))return[];const{startPos:t,endPos:n}=R.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:me()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ie(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),oe()},onNegativeClick:()=>oe(),onClose:()=>oe()})}function oe(){R&&h.value.remove(R),R=null}function le(e,t,n){var l;const{type:r,unit:s,dataList:a=[]}=n,f=[];G.set(e.key,[]),function(e,t){W.size&&[...W].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&W.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let d,g,y=c;l.key&&(y=a.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:w="",key:b,type:A="circle"}=y,E=de(c.list[u+1],n);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(g=i([...e,...E],P));const j=f[u-1],T={origin:{data:l,title:w,key:c.key,selfKey:b,unit:s,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:j,rightLine:g,...k,...U()};e&&(j||(T.leftLine=null),d=o(A,{left:e[0],top:e[1],...T}));f.push(g),d&&(d.originLeft=d.left,d.originTop=d.top,function(e){Y.hovered&&(e.on("mouseover",(()=>{ce(e,"hover")})),e.on("mouseout",(()=>{L.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{pe(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),Y.hovered&&ce(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:s,top:a,origin:f}=e,u=~~((s-l)/K);if(s>l+K){if(0===q.length){se(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const c=l+K*u;if(q.every((e=>e.left!==c))){const t=I(c),n=C(f.type,a);q.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:c,top:a}),se(e,[...e.prevPointer,c,a])}if(q.length<u&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+K*l,r=q.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=q.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=q[l-1]||{left:n,top:i},f=~~((r.left-(t-K))/K),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:I(t),value:C(o.type,s.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},q.splice(l,0,s),se(e,[a.left,a.top,s.left,s.top])}}l++}}(e,u),e.nextPoint){const t=G.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=K/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<s?re(e,"#999"):re(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(q.length>0&&i<q[q.length-1].left){for(const e of N)e.left>i&&(e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e));if(q=q.filter((e=>e.left<=i)),0===q.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of N)e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e)}if(q.length>0){const t=m(q);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(L.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:I(e.left),value:C(t,e.top)}};if(h.value.discardActiveObject(),q.length>0){const l=J.find((e=>e.type===t));let r=-1;const s=q.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void fe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1?s[o].value=n.value:s.push({...m(s),time:n.time,value:n.value})}const a=l.dataList.findIndex((e=>e.key===n));x("add",{...v(o,["index","selfKey","lineAttr"]),dataIndex:a,key:n,data:s}),ae({...o,data:s,coincideIndex:r})}else x("change",{...v(o,["selfKey","lineAttr"]),key:n}),ae(o,"change")}}))}(d),null==(p=G.get(c.key))||p.push(d))}(de(l,n),l,u,e)})),Promise.all(G.get(e.key)).then((t=>{const n=f.filter((e=>e));Q(t),h.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||W.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function re(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function se(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,N.add(l),h.value.add(r,l)}))}function ae(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:s}=e;let{dataIndex:a}=e;const f=J.find((e=>e.type===r)),c=f.dataList.find(((e,t)=>(a=t,e.key===l)));switch(t){case"remove":c.list.splice(o,n),c.list[o-1]&&(c.list[o-1].breakpoint=!0);break;case"change":c.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=u(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,s>-1?s-t+1:0,...n);break}}fe({dataIndex:a,scaleValue:f})}function fe(e){var t,n,i;if(N.size&&(null==(t=h.value)||t.remove(...ue([...N]))),N.clear(),q=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=h.value)||n.remove(...ue(G.get(o.key))),G.delete(o.key),le(o,t,i)}else G.size&&(null==(i=h.value)||i.remove(...ue(me()))),G.clear(),te()}function ue(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function ce(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;L.point={x:e.left,y:e.top};const s=I(e.left),a=`${"hover"===t?o.value:C(i,e.top)}`;L.list=[`${n} ${a}${l||""}`,`时间 ${s.slice(-5)}`],L.sourceData=[{type:i,title:n,unit:l,key:r,time:s,value:a}],L.isTarget=!0,L.show=!0}function pe(e){e.setCoords();const t=6e4/O,n=e.prevPoint?e.prevPoint.left+t:j,i=T;e.top<X&&e.set("top",X),e.top>V&&e.set("top",V),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function de(e,t){if(c(e)&&function(e){const t=Date.parse(m(S.list)),n=p(e);return n>=D&&n<=t}(e.time)){const n=b(e.time),i=A(t.type,t.range,e.value);return[n,i<X?X:i>V?V:i]}}function me(){return g(Array.from(G.values()))}return e((()=>{Z()})),te(),function(){if(!Y.evented)return;let e=!1,i={x:0,y:0};h.value.on("mouse:up",(t=>{if(3===t.button&&function(e){L.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=j&&t<=T&&n>=X&&n<=V)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);me().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&P.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===P.list.length&&(P.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{B(me(),t,"key",2*K).includes(n.linkKey||n.key)||P.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===P.list.length&&(P.show=!1,H("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=ne();t.length>0?ie((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ae(n[0],"remove",n.length),n.map((e=>({...v(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);x("remove",e)})):s.emit(R)}})),h.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),h.value.on("mouse:move",(o=>{if(function(e){if(!w||P.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;L.movable=!1,(i<j||i>T)&&(L.show=!1);if(!t&&i>=j&&i<=T){const e=o>=X&&o<=V,l=o>=_&&o<=z;if(e||l){const l=I(i);L.sourceData=e?J.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:C(t,o)}})):[{type:"tree",time:l}],L.isTarget=!!t,L.point=n,L.movable=!0}else L.show=!1}}(o),!e)return;const{x:l,y:r}=i,{x:s,y:a}=o.pointer;R&&h.value.remove(R),R=new t.Rect({...n,fill:"#CAF982",opacity:.4,...E,left:l,top:r,width:s-l,height:a-r,objectCaching:!0}),R.areaPos={startPos:i,endPos:o.pointer},h.value.add(R)}))}(),{redrawPoints:fe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(x("remove",n),ae(n,"remove")):(Object.assign(n,{data:{time:I(e.pointer.x),value:C(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),x("add",n),ae({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:pe,setPopup:ce,updateData:ae,getGridPoints:me,getContainPoints:ne,showDialog:ie,removeCurrentSelection:oe}}export{h as useCenter};
|
|
1
|
+
import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as s}from"../useEvent.js";import{useCommon as a}from"../useCommon.js";import{getPointRange as f,getIndex as u,isEffectiveNode as c,getTime as p}from"../../utils/index.js";import{cloneDeep as d,last as m,omit as v,flatten as g}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import{useIntervalFn as y}from"@vueuse/core";function h(h,k,x,L,P,w){const{computedX:b,computedY:A,getXValue:I,getYValue:C}=r(k),{xCellWidth:K,pointSelectionStyle:E,originX:j,endX:T,originY:X,endY:V,event:Y,scaleValues:M,xAxis:S,startTime:D,timeXCell:O,itemList:$,dialog:F,topGridOriginY:_,topGridEndY:z}=k,G=new Map,N=new Set,J=d(M);let q=[],R=null;const W=new Set;l(h,k);const{getEqualXTypes:B,handleAddPrevent:H,setPrevAndNextPoint:Q,getPointEventProps:U}=a(h,x,k),{pause:Z,resume:ee}=y((()=>{!function(){if(!W.size)return;for(const e of W)e.set("opacity",1===e.opacity?.5:1);h.value.renderAll()}()}),800);function te(){J.forEach((e=>{const{range:t=[],spaceValue:n}=e;n&&(t[0]||t[1])&&e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function s({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=A(t.type,t.range,n),s=i([j,r,T,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});Y.hovered&&o&&(s.on("mousemove",(({pointer:e})=>{L.point={...e||{x:s.left,y:s.top}},L.list=[`${o} ${n}${t.unit||""}`],L.show=!0})),s.on("mouseout",(()=>{L.show=!1}))),h.value.add(s)}s(n),s(o),s(l),s(r)}(t,e),le(t,n,e))}))}))}function ne(e=[]){if(!(null==R?void 0:R.areaPos))return[];const{startPos:t,endPos:n}=R.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:me()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ie(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),oe()},onNegativeClick:()=>oe(),onClose:()=>oe()})}function oe(){R&&h.value.remove(R),R=null}function le(e,t,n){var l;const{type:r,unit:s,dataList:a=[]}=n,f=[];G.set(e.key,[]),function(e,t){W.size&&[...W].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&W.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let d,g,y=c;l.key&&(y=a.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:w="",key:b,type:A="circle"}=y,E=de(c.list[u+1],n);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(g=i([...e,...E],P));const j=f[u-1],T={origin:{data:l,title:w,key:c.key,selfKey:b,unit:s,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:j,rightLine:g,...k,...U()};e&&(j||(T.leftLine=null),d=o(A,{left:e[0],top:e[1],...T}));f.push(g),d&&(d.originLeft=d.left,d.originTop=d.top,function(e){Y.hovered&&(e.on("mouseover",(()=>{ce(e,"hover")})),e.on("mouseout",(()=>{L.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{pe(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),Y.hovered&&ce(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:s,top:a,origin:f}=e,u=~~((s-l)/K);if(s>l+K){if(0===q.length){se(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const c=l+K*u;if(q.every((e=>e.left!==c))){const t=I(c),n=C(f.type,a);q.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:c,top:a}),se(e,[...e.prevPointer,c,a])}if(q.length<u&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+K*l,r=q.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=q.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=q[l-1]||{left:n,top:i},f=~~((r.left-(t-K))/K),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:I(t),value:C(o.type,s.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},q.splice(l,0,s),se(e,[a.left,a.top,s.left,s.top])}}l++}}(e,u),e.nextPoint){const t=G.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=K/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<s?re(e,"#999"):re(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(q.length>0&&i<q[q.length-1].left){for(const e of N)e.left>i&&(e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e));if(q=q.filter((e=>e.left<=i)),0===q.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of N)e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e)}if(q.length>0){const t=m(q);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(L.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:I(e.left),value:C(t,e.top)}};if(h.value.discardActiveObject(),q.length>0){const l=J.find((e=>e.type===t));let r=-1;const s=q.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void fe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1?s[o].value=n.value:s.push({...m(s),time:n.time,value:n.value})}const a=l.dataList.findIndex((e=>e.key===n));x("add",{...v(o,["index","selfKey","lineAttr"]),dataIndex:a,key:n,data:s}),ae({...o,data:s,coincideIndex:r})}else x("change",{...v(o,["selfKey","lineAttr"]),key:n}),ae(o,"change")}}))}(d),null==(p=G.get(c.key))||p.push(d))}(de(l,n),l,u,e)})),Promise.all(G.get(e.key)).then((t=>{const n=f.filter((e=>e));Q(t),h.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||W.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function re(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function se(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,N.add(l),h.value.add(r,l)}))}function ae(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:s}=e;let{dataIndex:a}=e;const f=J.find((e=>e.type===r)),c=f.dataList.find(((e,t)=>(a=t,e.key===l)));switch(t){case"remove":c.list.splice(o,n),c.list[o-1]&&(c.list[o-1].breakpoint=!0);break;case"change":c.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=u(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,s>-1?s-t+1:0,...n);break}}fe({dataIndex:a,scaleValue:f})}function fe(e){var t,n,i;if(N.size&&(null==(t=h.value)||t.remove(...ue([...N]))),N.clear(),q=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=h.value)||n.remove(...ue(G.get(o.key))),G.delete(o.key),le(o,t,i)}else G.size&&(null==(i=h.value)||i.remove(...ue(me()))),G.clear(),te()}function ue(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function ce(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;L.point={x:e.left,y:e.top};const s=I(e.left),a=`${"hover"===t?o.value:C(i,e.top)}`;L.list=[`${n} ${a}${l||""}`,`时间 ${s.slice(-5)}`],L.sourceData=[{type:i,title:n,unit:l,key:r,time:s,value:a}],L.isTarget=!0,L.show=!0}function pe(e){e.setCoords();const t=6e4/O,n=e.prevPoint?e.prevPoint.left+t:j,i=T;e.top<X&&e.set("top",X),e.top>V&&e.set("top",V),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function de(e,t){if(c(e)&&function(e){const t=Date.parse(m(S.list)),n=p(e);return n>=D&&n<=t}(e.time)){const n=b(e.time),i=A(t.type,t.range,e.value);return[n,i<X?X:i>V?V:i]}}function me(){return g(Array.from(G.values()))}return e((()=>{Z()})),te(),function(){if(!Y.evented)return;let e=!1,i={x:0,y:0};h.value.on("mouse:up",(t=>{if(3===t.button&&function(e){L.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=j&&t<=T&&n>=X&&n<=V)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);me().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&P.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===P.list.length&&(P.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{B(me(),t,"key",2*K).includes(n.linkKey||n.key)||P.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===P.list.length&&(P.show=!1,H("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=ne();t.length>0?ie((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ae(n[0],"remove",n.length),n.map((e=>({...v(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);x("remove",e)})):s.emit(R)}})),h.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),h.value.on("mouse:move",(o=>{if(function(e){if(!w||P.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;L.movable=!1,(i<j||i>T)&&(L.show=!1);if(!t&&i>=j&&i<=T){const e=o>=X&&o<=V,l=o>=_&&o<=z;if(e||l){const l=I(i);L.sourceData=e?J.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:C(t,o)}})):[{type:"tree",time:l}],L.isTarget=!!t,L.point=n,L.movable=!0}else L.show=!1}}(o),!e)return;const{x:l,y:r}=i,{x:s,y:a}=o.pointer;R&&h.value.remove(R),R=new t.Rect({...n,fill:"#CAF982",opacity:.4,...E,left:l,top:r,width:s-l,height:a-r,objectCaching:!0}),R.areaPos={startPos:i,endPos:o.pointer},h.value.add(R)}))}(),{redrawPoints:fe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(x("remove",n),ae(n,"remove")):(Object.assign(n,{data:{time:I(e.pointer.x),value:C(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),x("add",n),ae({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:pe,setPopup:ce,updateData:ae,getGridPoints:me,getContainPoints:ne,showDialog:ie,removeCurrentSelection:oe}}export{h as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as c,last as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as c,last as p}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function f(f,h,m,g,v,y,k,w){const{getYValue:j,getXValue:x}=s(h),{getEqualXTypes:b,handleAddPrevent:X,isGridLimit:W}=u(f,m,h),{originY:C,endY:E,borderStyle:S,left:Y,itemList:K,scaleValues:L,originX:M,endX:N,yCellHeight:V,markHeight:G,canvasWidth:H,canvasHeight:T,xCellWidth:A}=h;!function(){if(!Y)return;const{title:t,titleWidth:i,titleStyle:o}=Y,n=e({width:i,height:E-C+G,...S},{value:t.split("").join("\n"),...o||{}},{left:0,top:C},!0);f.value.add(n)}(),L.forEach(((e,i)=>{var o,s;const{range:u,spaceValue:c,title:h,unit:m,titleStyle:g,spaceGridNumber:v=1,showNumber:y,showMaxMinNumber:k,titleMargin:w=[5,30],margin:j=5}=e,x="left"===e.layout?M-j:N+j,b=[],X=d(u,c),W=X.length;X.forEach(((t,i)=>{const o=0===i?E-5:E-i*V*v;!y||(0===i||i===W-1)&&!k||b.push(a(String(t),{...e,position:e.layout},x,o))}));const C="left"===e.layout?"right":"left",S=(h||m)&&n(["left"===e.layout?M-w[0]:N+w[0],(null!=(s=null==(o=p(b))?void 0:o.top)?s:330)-V-w[1]],{value:`${h}${m?"\n"+m:""}`,...r,...g,textAlign:C,originX:C,originY:"bottom"}),Y=new t.Group([...b,...S?[S]:[]],{objectCaching:!1,...l});f.value.add(Y),Y.sendToBack()})),function(){const e=new t.Rect({width:M-Y.titleWidth,height:E-C+G,left:Y.titleWidth,top:C,...i,originX:"left",originY:"top",...S});f.value.add(e);const n=c(K),r=c(Y.externalIconList||[]).map((t=>({...t,isExternal:!0}))),{projectNameMargin:l=[5,30],titleWidth:s=20}=Y;let a=E+G-l[0];const u=s+l[1];r.concat(n.reverse()).forEach((t=>{a-=10;const e=t.title,{text:i,icon:n}=o(e,t,{text:{left:u,top:a},icon:{leftX:u,topY:a,originX:"center",...t.isExternal?{evented:!1,selectable:!1}:{},origin:{linkKey:t.linkKey}}});var r;a-=i.height||30,n.set("left",n.left+n.width/2),(r=n).on("moving",(()=>{r.set("originX","center"),W(r)?(v(r),y(r)):g.show=!1})),r.on("mouseup:before",(t=>{if(g.show=!1,0===t.e.button&&W(r)){const t=r.origin.linkKey||r.origin.key;if(b(w(),r.left,"key",2*A).includes(t))X("repeat");else{const e={data:{time:x(r.left),value:j(r.origin.type,r.top),...r.origin.linkKey?{key:r.origin.key}:{}},...r.origin};m("add",e),k({...e,key:t})}}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(r)})),f.value.add(i,n)}))}(),f.value.add(new t.Rect({left:0,top:0,width:H-S.strokeWidth,height:T-S.strokeWidth,fill:"transparent",...S}))}export{f as useLeft};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as d}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function c(c,u,f,h,m,g,p,v,x){const{computedX:k,getXValue:y}=o(u),{getEqualXTypes:X,handleAddPrevent:P,isGridLimit:b,getPointEventProps:w}=r(c,f,u),{other:E,yCellHeight:j,xCellWidth:z,endX:A,originX:C,originY:L,endY:M,markHeight:S,event:T,topGridYCellHeight:I}=u,H=new Map,Y=l(E);function W(){var o;if(!(null==(o=null==Y?void 0:Y.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=Y;let a=L+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:d={},textStyle:c={},data:u}=o;let f=null;u.forEach(((o,u)=>{const{time:h,value:m}=o,g=k(h);if(!$(g))return;const p=e(s,{...d,left:g,top:a}),v=g+p.width/2+2,x=i([v,a],{value:m,...c,originX:"left"}),y=new t.Group([p,x],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...w()});Object.assign(y,{originLeft:g,iconHalfWidth:p.width/2,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:C,x2:A-y.width}}),f&&(y.limitX.x1=f.left,f.limitX.x2=y.left,y.prevPoint=f,f.nextPoint=y),f=y,q(y),H.get(n).push(y)})),a+=j})),c.value.add(...H.get(n))}function V(){var t;if(!(null==(t=null==Y?void 0:Y.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=Y;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,d=k(s);if(!n||!$(d))return;const{lineHeight:c=j}=a;let u=L+r+c/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:d,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...w()});u+=c,q(r),H.get(i).push(r)}));const f=H.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),m=d>A-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),c.value.add(...H.get(i))}function G(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=Y[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}O(t)}function O(t){var e;const{key:i}=t;switch(null==(e=c.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":W();break;case"vertical":V();break;case"mark":D()}}function D(){if(!(null==E?void 0:E.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=E.mark,a=i([C-5,M+S/2],{value:t,...o,originX:"right"});c.value.add(a);const l=M+S,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=k(i);if(!$(r))return;let a=M;o.forEach((t=>{let i=!1;const o=e("circleAndText",{...n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),d=o.height;a+d<=l&&a>=M?(o.set("top",a+d/2),a+=d):(i||(a=M,i=!0),o.set("top",a-d/2),a-=d),s.push(o),q(o),c.value.add(o)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:A};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function q(t){if(T.hovered&&(t.on("mouseover",(()=>{B(t)})),t.on("mouseout",(()=>{h.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<L&&t.set("top",L);const e=M+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(g(t),function(t){const e=t.left+t.maxTextWidth>A?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),T.hovered&&B(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=y(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};c.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(m.point={x:t.left,y:t.top},m.show=!0,m.target=t,m.list=d.map((t=>({...t,renderItem:()=>t.label}))))}))}function B(t){const{key:e,data:i={}}=t.origin||{};let o=i.value;h.point={x:t.left,y:"mark"===e?t.top:t.top+I/2};const n=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,r=y(n);h.list=[`时间 ${r.slice(-5)}`],"mark"===e&&(o=i.name,h.list.unshift(o+" ")),h.sourceData=[{type:"other",key:e,time:r,value:o}],h.isTarget=!0,h.show=!0}function $(t){return t>=C&&t<=A}return function(){var t;if(!(null==(t=null==Y?void 0:Y.horizontal)?void 0:t.length))return;const{horizontal:i}=Y,o=C-5;let n=L+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var d;(d=s).on("moving",(()=>{d.set("originX","center"),b(d)?B(d):h.show=!1})),d.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&b(d))if(X(H.get("horizontal"),d.left,"key",z).includes(d.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:y(d.left),value:d.origin.defaultAddValue},...d.origin};f("add",t),G(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(d)})),c.value.add(s),n+=j}))}(),W(),V(),D(),n.on((()=>{const t="horizontal",e=p(H.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return Y.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);O({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&G(o,i)}}}export{c as useOther};
|
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as
|
|
1
|
+
import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as o,watch as l}from"vue";import{useDialog as n}from"naive-ui";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as s}from"date-fns";import{getChildrenSize as d}from"../../utils/index.js";import{cloneDeep as c,range as p,flatten as m}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as h}from"./useTop.js";import{useLeft as f}from"./useLeft.js";import{useCenter as g}from"./useCenter.js";import{useOther as y}from"./useOther.js";function w(w,x,b,j,C,Y,H){const S=n(),T=e(),D=e(),A=e();let M=null;const X=t((()=>x.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),G=t((()=>{var e;return null!=(e=x.data.left.width)?e:0})),V=t((()=>{const{grid:e}=x.data;return e.mainXCell*e.subXCell})),k=t((()=>{const{grid:e}=x.data;return e.mainYCell*e.subYCell})),P=t((()=>{const{treeData:e=[],show:t=!0}=x.data.top;return t?d(e):0})),L=t((()=>x.data.top.tree.cellHeight)),N=t((()=>L.value*P.value)),O=t((()=>ie(ae("drug")||"top"))),E=t((()=>O.value+N.value)),W=t((()=>{var e;return Date.parse((null==(e=x.data.xAxis)?void 0:e.startTime)||s(new Date,"yyyy-MM-dd HH:mm:ss"))})),I=t((()=>{const e=c(x.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=p(V.value/t+1).map((r=>0===r?e.startTime:s(new Date(W.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:G.value}})),q=function(){const{show:e=!0}=x.data.top;if(!e)return[];const t=c(x.data.top.treeData);let a=0;const{cellWidth:r,cellHeight:i}=x.data.top.tree;return function e(t,o=0){t.forEach((t=>{var l;const n={top:a*i+O.value,left:o*r,width:r,height:i};if(a++,null==(l=t.children)?void 0:l.length){a--;const r=d(t.children);n.height=r*i,e(t.children,o+1)}else n.width=G.value-n.left;Object.assign(t,n)}))}(t),t}(),z=t((()=>ie(ae("xAxis")||"center"))),B=t((()=>{var e;const{width:t,right:a}=x.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),F=t((()=>ie(ae("intraoperatively")||"bottom"))),J=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=x.data.other)?void 0:e.mark)||{};return t&&a?a:0})),K=t((()=>F.value+(x.data.height-N.value-I.value.height-J.value))),Q=t((()=>(B.value-G.value)/V.value)),R=t((()=>(K.value-F.value)/k.value)),U=t((()=>I.value.spaceTimeStamp/Q.value)),Z=t((()=>{const{scaleValues:e}=x.data;return m(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),$=t((()=>oe("pulse"))),_=t((()=>oe("temperature"))),ee=t((()=>{var e;return(null==(e=x.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),te=a({canvasWidth:x.data.width,canvasHeight:x.data.height,borderStyle:{...u,...x.data.borderStyle},pointSelectionStyle:x.data.pointSelectionStyle||{},grid:x.data.grid,top:x.data.top,left:x.data.left,other:x.data.other,topGridYNumber:r(P),topGridYCellHeight:r(L),topGridOriginY:r(O),topGridEndY:r(E),treeData:q,xAxis:r(I),originYXAxis:r(z),startTime:r(W),timeXCell:r(U),gridXNumber:r(V),gridYNumber:r(k),xCellWidth:r(Q),yCellHeight:r(R),originX:r(G),endX:r(B),originY:r(F),endY:r(K),markHeight:r(J),itemList:r(Z),scaleValues:x.data.scaleValues,pulseYCell:r($),temperatureYCell:r(_),event:r(ee),dialog:S});function ae(e){let t="";return Object.entries(X.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function re(e){const t=X.value[e],a=I.value.height;switch(t){case"drug":return N.value;case"xAxis":return a;default:return x.data.height-N.value-a}}function ie(e){switch(e){case"top":return 0;case"center":return re("top");default:return re("top")+re("center")}}function oe(e){const{scaleValues:t}=x.data,a=t.find((t=>t.type===e));return R.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o(),h(w,te,b,C);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:n,showDialog:u,removeCurrentSelection:s}=g(w,te,b,C,Y,H);f(w,te,b,C,a,r,i,l);const{clickMenu:d}=y(w,te,b,C,Y,a,n,u,s);D.value=e,A.value=e=>{const{item:a}=e;a.type&&v.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),H&&l((()=>null==C?void 0:C.point),(()=>{C.movable?(C.show=!0,M&&clearTimeout(M),M=setTimeout((()=>{C.show=!1,C.movable=!1}),3e3)):M&&clearTimeout(M)}),{deep:!0}),{propItems:te,redrawPoints:D,select:T,clickMenu:A}}export{w as useSurgicalAnesthesiaChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function f(f,u,d,m,h){const{computedX:v,getXValue:p}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=E(n,e,i);n&&(n.set(c),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:f};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,f],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}function $(t){I.hovered&&(t.on("mouseover",(()=>{D(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&D(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function D(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=p(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.sourceData=[{type:"tree",startTime:r,endTime:s,value:l.value}],m.isTarget=!0,m.show=!0}s(f,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a,style:c,marginBottom:u}=S;if(!l)return;const d=[],m=X+(u?l-u:l/2),h=u?"bottom":"center";r.forEach(((t,i)=>{const n=s+i*L*a;d.push(e([n,m],{value:t.slice(11,16),originY:h,...c}))}));const v=d.length>0?new t.Group([...d],{...i,objectCaching:!1}):null;v&&f.value.add(v);const p=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y});f.value.add(p);const{show:g=!0}=C;if(!g)return;const y=e([x+(w-x)/2,m],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});f.value.add(y)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=c(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!f});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),p&&z.add(p),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&f.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},p,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&f.value.add(a),z.size&&f.value.add(...z)}()}export{f as useTop};
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function f(f,u,d,m,h){const{computedX:v,getXValue:p}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=E(n,e,i);n&&(n.set(c),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:f};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,f],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}function $(t){I.hovered&&(t.on("mouseover",(()=>{D(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&D(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function D(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=p(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.sourceData=[{type:"tree",startTime:r,endTime:s,value:l.value}],m.isTarget=!0,m.show=!0}s(f,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a,style:c,marginBottom:u}=S;if(!l)return;const d=[],m=X+(u?l-u:l/2),h=u?"bottom":"center";r.forEach(((t,i)=>{const n=s+i*L*a;d.push(e([n,m],{value:t.slice(11,16),originY:h,...c}))}));const v=d.length>0?new t.Group([...d],{...i,objectCaching:!1}):null;v&&f.value.add(v);const p=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y});f.value.add(p);const{show:g=!0}=C;if(!g)return;const y=e([x+(w-x)/2,m],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});f.value.add(y)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=c(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!f});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),p&&z.add(p),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&f.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},p,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&f.value.add(a),z.size&&f.value.add(...z)}()}export{f as useTop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultTextStyle as i,defaultStyle as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultTextStyle as i,defaultStyle as o}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function n(n,s){const{xScaleList:r,originX:a,endX:l,endY:h,xCellWidth:u,canvasWidth:c,canvasHeight:d,bottom:p,breathingHeight:m,iconsWidth:g,borderStyle:v}=s;!function(){var s,c,d;if(!m||!p){const e=new t.Line([g,h-1,l,h-1],v);return n.value.add(e),e.sendToBack(),!1}const f=m,b=(null==(s=p.breathing)?void 0:s.list)||[],w=[];let j=!0;r.forEach(((t,o)=>{const n=a+o*u;let s="";b.forEach(((e,i)=>{const o=new Date(e.time).getTime();o>=t&&o<+t+t.scaleCell&&(s=e.value)}));const r=j?{top:-(f/2-10)}:{top:f/2-10};s&&(j=!j);const l=e({width:u,height:f,...v},Object.assign({},{text:String(s),...i},s?r:{}),{left:n,top:h});w.push(l)}));const x=e({width:l,height:f,...v},{text:String((null==(c=p.breathing)?void 0:c.title)+(null==(d=p.breathing)?void 0:d.unit)),...i,left:-(l-a)/2},{left:0,top:h});w.push(x);const S=w.length>0?new t.Group([...w],{...o}):null;S&&S.sendToBack(),S&&n.value.add(S)}()}export{n as useBottom};
|
|
@@ -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 s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as u,getType as a,isOverlapPoint as c,getFloorNumber as d,isValidValue as p,setOtherType as f,getTime as h,isEffectiveNode as v,getIndex as g,deleteProperty as y}from"../../utils/index.js";import{cloneDeep as m,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useCommon as j}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as w,PAIN_MENU as L,OVERLAP as k}from"../../constants/index.js";function S(S,E,M,$,O,P,C,A,I,R){r(S,E);const{getEqualXTypes:T,handleAddPrevent:V,getPointEventProps:X}=j(S,M,E),{createShadowLines:z}=t(),{left:D,xScaleList:F,xCellWidth:H,yCellHeight:_,originX:W,endX:q,originY:G,endY:B,itemList:J,event:K,vitalSignsOriginY:N,painOriginY:Q,hospitalizationDate:U,config:Z,canvasHeight:ee}=E,te=new Set,ie=["xinmai","mai"],ne=new Map,oe=new Set,le=new Set,se=new Set,re=m(D.yScaleValue);function ue(t){var o;const l=re.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(te.size&&S.value.remove(...te),te.clear(),ne.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ne.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 ne)t.push(e[1]),e[0]===ie[0]&&e[1].forEach((e=>{(ne.get(ie[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),u=n[i],a=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+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&&s.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]);s.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};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?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...z(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),te.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([...x(t)],{...r,originX:"center"});e.push(n),te.add(n)}))}S.value.add(...e)}te.add(l),S.value.add(l)}))}}function ae(){var e;const t=re.find((e=>"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({},k,D.overlap||{}),l=[];oe.size&&[...oe].forEach((e=>{[...le].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{S.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),se.add(e)}))}))}function ce(e,t,r){var a;const{type:c,riseStyle:h={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},dataList:L=[],list:k=[]}=r,{type:E,textStyle:P,showConnectLine:A=!1}=j,R=[],T=[],V=[];let z=null;if(null==(a=e.list)||a.forEach(((a,j)=>{const D=u(c)?L.find((e=>e.key===a.key)):e,F=he(a,r),W=e.list[j+1],q=W?he(W,r):void 0,G=W?u(c)?L.find((e=>e.key===W.key)):e:{},{title:B=""}=D;if("脉搏"===B&&"脉搏"!==G.title||"脉搏"!==B&&"脉搏"===G.title||!F||!q||d(F[0],1)!==d(q[0],1))F&&z&&(F[0]=z),z=null;else{const e=F[0]-H/2;F[0]=e+H/4,q[0]=z=F[0]+H/2}const J={};J.value=function(e,t,i){if(!(null==e?void 0:e.length)||!Z.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=N.originY+_?e[1]+_:e[1]-_,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return V.push(s),{obj:s,top:-_}}(F,a,D),function(e,t,r,u){var a,d;if(!["temperature","pain"].includes(c))return;if(!(null==e?void 0:e.length)&&("pain"===c||"temperature"===c&&!fe(t.time)))return;const{lineAttr:f={}}=r,{value:m}=u,x=$(t.time);let b,j,w,L,S;if(t.noRise&&v.show){const i=Y(v,t)?O(c,k,35):(null==e?void 0:e[1])||0;if(v.text)w=l([x,Y(v,t)?i:i+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),t.value||se.add(w);else if(t.value){w=s([x,i,i+2*_],{...v.style})}w&&V.push(w)}if((null==e?void 0:e[1])&&(t.rise&&h.show&&h.text&&(L=l([x,e[1]-(m?_:0)-5],{value:h.text.split("").join("\n"),originY:"bottom",...h.style}),V.push(L)),t.verified&&(S=l([x,e[1]-(m?_:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),V.push(S)),p(t.physicsReduce)||p(t.drugReduce))){const l=O(c,k,null!=(a=t.physicsReduce)?a:t.drugReduce),s=l<e[1]&&(null==Z?void 0:Z.hypothermyViewCustom)?x+H/2:x;b=i([...e,s,l],{...f,...y.line,...n}),j=o((null==(d=null==y?void 0:y.point)?void 0:d.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===ee?"bottom":"center"}),b&&V.push(b),j&&V.push(j)}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:v.text?5:2*_,isFixed:Y(v,t)},riseText:{obj:L,top:(m?-_:0)-5},verifiedText:{obj:S,top:(m?-_:0)-5},reducePoint:{obj:j,type:"reduce"}})}(F,a,D,J),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...k),r=Math.min(...k);let u,a,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*_,i=[e[1]-_/2,t];t<N.originY&&(t=e[1]+2.5*_,i=[t,e[1]+_/2]),u=s([e[0],i[0],i[1]],x,"up"),V.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+_/2+u.height:e[1]+_;a=l([e[0],t],i),V.push(a)}+t.value<r&&(a=l([e[0],e[1]-_],i),V.push(a))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*_;d=s([e[0],t,i],{...w.style})}V.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:a,top:-_},belowMinValue:{obj:d,top:w.text?5:2*_,moveHide:!0}})}(F,a,D,J),function(n,l,s,u,a,d){let p,h;const{pointAttr:v={},lineAttr:g={},title:y="",key:x,type:b="circle"}=a,j=e.list[u+1],w=de(c,e.list[u].value),L=l&&de(c,j.value);if(n&&l&&!s.breakpoint&&(!w&&!L||A)){h=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==Z?void 0:Z.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});V.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const k=s.pacemakerShow&&"pulse"==c?m.value:w&&"number"===E?0:b,Y=T[u-1],$={origin:{data:s,title:y,key:x||"",unit:r.unit,type:c,_type:f(y,c),dataIndex:t,index:u},leftLine:Y,rightLine:h,otherObj:d,...s.pacemakerShow&&"pulse"==c?m.style:v,lockMovementX:!0,...X(),...w?{selectable:!1,evented:!1,..."number"===E?P:{}}:{}};n&&(Y?$.leftLine.set("x2",n[0]):$.leftLine=null,p=o(k,{left:n[0],top:w?n[1]-5:n[1],...$}));T.push(h),p&&(y.includes("脉搏")?oe.add(p):le.add(p),function(e){K.hovered&&(e.on("mouseover",(()=>{pe(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?Q:N;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:s=!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}),s&&(S.value.remove(i),delete e.otherObj.obj)))})),ue(e)}(e),K.hovered&&pe(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=C(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};S.value.discardActiveObject(),M("change",n),ge(n,"change")}}))}(p),R.push(p),se.add(p))}(F,q,a,j,D,J)})),"pulse"===c){const e={};ie.forEach((t=>{e[t]=R.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t}))}));let t=null;ie.forEach((i=>{ne.set(i,e[i].map(((e,i,n)=>{var o,l;const s=n[i+1];if(s&&d(e.left,1)===d(s.left,1)){const i=e.left-H/2;e.set("left",i+H/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+H/2,s.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]})))}))}Promise.all(R).then((e=>{const t=T.filter((e=>e));Promise.all(V).then((i=>{S.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&S.value.remove(e.leftLine),e.rightLine&&S.value.remove(e.rightLine))}}(t,e)}))}))}))}function de(e,t){return"pain"===e&&0==t}function pe(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top},I.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},u="hover"===t?l.value:C(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${u}—>${r}${n||""}`;return`${i} ${u}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`],I.show=!0}function fe(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}function he(e,t){const i="pain"===t.type?Q:N;if(!v(e)||!fe(e.time))return;const n=$(e.time),o=O(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function ve(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${P(e)}:00`);return U&&l<h(U)?(V("exceedMin"),!1):!(l>o)||(V("exceedMax"),!1)}function ge(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=re.find((e=>e.type===i));if("add"===t){const e=u(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=g(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ye()}function ye(){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]))),ne.clear(),se.clear(),oe.clear(),le.clear(),re.forEach((e=>{e.dataList.forEach(((t,i)=>{u(e.type)&&!t.enable||ce(t,i,e)}))})),ue(),ae()}return ne.clear(),oe.clear(),le.clear(),re.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=O(e.type,e.list,e.positionLine.value),n=i([W,t,q,t],e.positionLine);S.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||u(e.type)&&!t.enable||ce(t,i,e)}))})),ue(),ae(),S.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!E.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=W&&e<=q&&t>=G&&t<=B){R.point={x:e,y:t},R.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(R.list=[...w]),"pain"===o&&(R.list=[...L]),R.target=i;else{R.target=null,R.list=["新增节点"],J.forEach((i=>{if(!T([...se],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Q:N;t>=e.originY&&t<=e.endY&&R.list.push({renderItem:A?A(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=ve(e);i&&1!==R.list.length||(R.show=!1,1===R.list.length&&i&&V("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=W&&e<=q&&t>0&&t<ee&&M("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,s=y(i,[...w,...L]);s[`${e.type}`]=e.value,u(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};M("change",r),ge(r,"change")}else{const t={data:{time:P(e.pointer.x),value:C(e.origin.type,e.pointer.y),...u(e.origin.type)?{key:e.origin.key}:{}},...e.origin};M("add",t),ge(t)}},setPopup:pe,isAddPoint:ve,updateData:ge,redrawPoints:ye,gridPoints:se}}function Y(e,t){return"fixed"===e.position||!t.value&&0!==t.value}export{S 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 s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as u,getType as a,isOverlapPoint as c,getFloorNumber as d,isValidValue as p,setOtherType as f,getTime as h,isEffectiveNode as v,getIndex as g,deleteProperty as y}from"../../utils/index.js";import{cloneDeep as m,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useCommon as j}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as w,PAIN_MENU as k,OVERLAP as L}from"../../constants/index.js";import{promiseTimeout as S}from"@vueuse/shared";function E(E,M,$,O,C,P,A,I,R,T){r(E,M);const{getEqualXTypes:V,handleAddPrevent:X,getPointEventProps:z}=j(E,$,M),{createShadowLines:D}=t(),{left:F,xScaleList:H,xCellWidth:_,yCellHeight:W,originX:q,endX:G,originY:B,endY:J,itemList:K,event:N,vitalSignsOriginY:Q,painOriginY:U,hospitalizationDate:Z,config:ee,canvasHeight:te}=M,ie=new Set,ne=["xinmai","mai"],oe=new Map,le=new Set,se=new Set,re=new Set,ue=m(F.yScaleValue);function ae(){[...re].forEach((e=>{null==e||e.bringToFront()}))}function ce(t){var o;const l=ue.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ie.size&&E.value.remove(...ie),ie.clear(),oe.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=oe.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 oe)t.push(e[1]),e[0]===ne[0]&&e[1].forEach((e=>{(oe.get(ne[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),u=n[i],a=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+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&&s.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]);s.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};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?(s.push(f),g()):g()})),e}();o.length>0&&function(e){S(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(re).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)===ne[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:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...D(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),ie.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([...x(t)],{...r,originX:"center"});e.push(n),ie.add(n)}))}E.value.add(...e)}ie.add(l),E.value.add(l)}))}}function de(){var e;const t=ue.find((e=>"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({},L,F.overlap||{}),l=[];le.size&&[...le].forEach((e=>{[...se].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),re.add(e)}))}))}function pe(e,t,r){var a;const{type:c,riseStyle:h={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},dataList:k=[],list:L=[]}=r,{type:S,textStyle:M,showConnectLine:P=!1}=j,I=[],T=[],V=[];let X=null;if(null==(a=e.list)||a.forEach(((a,j)=>{const D=u(c)?k.find((e=>e.key===a.key)):e,F=ge(a,r),H=e.list[j+1],q=H?ge(H,r):void 0,G=H?u(c)?k.find((e=>e.key===H.key)):e:{},{title:B=""}=D;if("脉搏"===B&&"脉搏"!==G.title||"脉搏"!==B&&"脉搏"===G.title||!F||!q||d(F[0],1)!==d(q[0],1))F&&X&&(F[0]=X),X=null;else{const e=F[0]-_/2;F[0]=e+_/4,q[0]=X=F[0]+_/2}const J={};J.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ee.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=Q.originY+W?e[1]+W:e[1]-W,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return V.push(s),{obj:s,top:-W}}(F,a,D),function(e,t,r,u){var a,d;if(!["temperature","pain"].includes(c))return;if(!(null==e?void 0:e.length)&&("pain"===c||"temperature"===c&&!ve(t.time)))return;const{lineAttr:f={}}=r,{value:m}=u,x=O(t.time);let b,j,w,k,S;if(t.noRise&&v.show){const i=Y(v,t)?C(c,L,35):(null==e?void 0:e[1])||0;if(v.text)w=l([x,Y(v,t)?i:i+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),t.value||re.add(w);else if(t.value){w=s([x,i,i+2*W],{...v.style})}w&&V.push(w)}if((null==e?void 0:e[1])&&(t.rise&&h.show&&h.text&&(k=l([x,e[1]-(m?W:0)-5],{value:h.text.split("").join("\n"),originY:"bottom",...h.style}),V.push(k)),t.verified&&(S=l([x,e[1]-(m?W:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),V.push(S)),p(t.physicsReduce)||p(t.drugReduce))){const l=C(c,L,null!=(a=t.physicsReduce)?a:t.drugReduce),s=l<e[1]&&(null==ee?void 0:ee.hypothermyViewCustom)?x+_/2:x;b=i([...e,s,l],{...f,...y.line,...n}),j=o((null==(d=null==y?void 0:y.point)?void 0:d.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===te?"bottom":"center"}),b&&V.push(b),j&&V.push(j)}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:v.text?5:2*W,isFixed:Y(v,t)},riseText:{obj:k,top:(m?-W:0)-5},verifiedText:{obj:S,top:(m?-W:0)-5},reducePoint:{obj:j,type:"reduce"}})}(F,a,D,J),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...L),r=Math.min(...L);let u,a,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*W,i=[e[1]-W/2,t];t<Q.originY&&(t=e[1]+2.5*W,i=[t,e[1]+W/2]),u=s([e[0],i[0],i[1]],x,"up"),V.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+W/2+u.height:e[1]+W;a=l([e[0],t],i),V.push(a)}+t.value<r&&(a=l([e[0],e[1]-W],i),V.push(a))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*W;d=s([e[0],t,i],{...w.style})}V.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:a,top:-W},belowMinValue:{obj:d,top:w.text?5:2*W,moveHide:!0}})}(F,a,D,J),function(n,l,s,u,a,d){let p,h;const{pointAttr:v={},lineAttr:g={},title:y="",key:x,type:b="circle"}=a,j=e.list[u+1],w=fe(c,e.list[u].value),k=l&&fe(c,j.value);if(n&&l&&!s.breakpoint&&(!w&&!k||P)){h=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==ee?void 0:ee.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});V.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const L=s.pacemakerShow&&"pulse"==c?m.value:w&&"number"===S?0:b,Y=T[u-1],O={origin:{data:s,title:y,key:x||"",unit:r.unit,type:c,_type:f(y,c),dataIndex:t,index:u},leftLine:Y,rightLine:h,otherObj:d,...s.pacemakerShow&&"pulse"==c?m.style:v,lockMovementX:!0,...z(),...w?{selectable:!1,evented:!1,..."number"===S?M:{}}:{}};n&&(Y?O.leftLine.set("x2",n[0]):O.leftLine=null,p=o(L,{left:n[0],top:w?n[1]-5:n[1],...O}));T.push(h),p&&(x===ne[1]?le.add(p):se.add(p),function(e){N.hovered&&(e.on("mouseover",(()=>{he(e,"hover")})),e.on("mouseout",(()=>{R.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?U:Q;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:s=!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}),s&&(E.value.remove(i),delete e.otherObj.obj)))})),ce(e)}(e),N.hovered&&he(e)})),e.on("mouseup",(t=>{if(R.show=!1,1===t.button){const{type:t}=e.origin,i=A(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),$("change",n),me(n,"change")}}))}(p),I.push(p),re.add(p))}(F,q,a,j,D,J)})),"pulse"===c){const{key:t}=e;let i=null;oe.set(t,I.map(((e,t,n)=>{var o,l;const s=n[t+1];if(s&&d(e.left,1)===d(s.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,s.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 D=T.filter((e=>e));E.value.add(...D,...I,...V)}function fe(e,t){return"pain"===e&&0==t}function he(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;R.point={x:e.left,y:e.top},R.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},u="hover"===t?l.value:A(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${u}—>${r}${n||""}`;return`${i} ${u}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`],R.show=!0}function ve(e){const[t]=H,i=b(H),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}function ge(e,t){const i="pain"===t.type?U:Q;if(!v(e)||!ve(e.time))return;const n=O(e.time),o=C(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function ye(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${P(e)}:00`);return Z&&l<h(Z)?(X("exceedMin"),!1):!(l>o)||(X("exceedMax"),!1)}function me(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ue.find((e=>e.type===i));if("add"===t){const e=u(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=g(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;xe()}function xe(){var e;re.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}([...re]))),oe.clear(),re.clear(),le.clear(),se.clear(),ue.forEach((e=>{e.dataList.forEach(((t,i)=>{u(e.type)&&!t.enable||pe(t,i,e)}))})),ce(),ae(),de()}return oe.clear(),le.clear(),se.clear(),ue.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=C(e.type,e.list,e.positionLine.value),n=i([q,t,G,t],e.positionLine);E.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||u(e.type)&&!t.enable||pe(t,i,e)}))})),ce(),ae(),de(),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!M.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=q&&e<=G&&t>=B&&t<=J){T.point={x:e,y:t},T.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(T.list=[...w]),"pain"===o&&(T.list=[...k]),T.target=i;else{T.target=null,T.list=["新增节点"],K.forEach((i=>{if(!V([...re],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?U:Q;t>=e.originY&&t<=e.endY&&T.list.push({renderItem:I?I(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=ye(e);i&&1!==T.list.length||(T.show=!1,1===T.list.length&&i&&X("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=q&&e<=G&&t>0&&t<te&&$("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,s=y(i,[...w,...k]);s[`${e.type}`]=e.value,u(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};$("change",r),me(r,"change")}else{const t={data:{time:P(e.pointer.x),value:A(e.origin.type,e.pointer.y),...u(e.origin.type)?{key:e.origin.key}:{}},...e.origin};$("add",t),me(t)}},setPopup:he,isAddPoint:ye,updateData:me,redrawPoints:xe,gridPoints:re}}function Y(e,t){return"fixed"===e.position||!t.value&&0!==t.value}export{E as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"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"naive-ui";import"@vueuse/core";function
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"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 d(d,g,p,f,m,v,y,w,S,Y,b,x){var j,C;const{getEqualXTypes:X,handleAddPrevent:N,isGridLimit:T}=c(d,p,g),{originY:V,endY:L,originX:k,endX:E,xCellWidth:M,yCellHeight:W,left:G,vitalSignsOriginY:O,painOriginY:R,painHeight:A,iconsWidth:H,itemList:I,painIndex:_,right:B,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P}=g;function z(o){var r;if(!(null==o?void 0:o.length))return;const{layout:s}=o[0];let c=H,g=k;"right"===s&&(c=E,g=E+(null!=(r=null==B?void 0:B.width)?r:0));const p=[],f=A&&"right"!==s?o.length-1:o.length,m=(g-c)/f,v=m+(g-c)%f;o.forEach(((o,r)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:r=5,showScale:s,showNumber:h,position:c,showMaxMinNumber:g,style:p,title:f}=n,m=l({width:k-H,height:A,...D},{value:`${f}`,...i,...p||{}},{left:H,top:R.originY}),v=e([H,R.originY,k,R.originY],D),y=[];if(s||h){const{lineXMain:e,textLeft:i}=u(c,H,k-H),l=o.length;o.forEach(((o,u)=>{let c=R.endY-u*W*r;if(0===u&&(c=L-5),!h||(0===u||u===l-1)&&!g||y.push(a(o,n,i,c)),s&&0!==u){const[i,n]=e,o=new t.Line([i,c,n,c],{...D,...p});y.push(o)}}))}d.value.add(v,m,...y),m.sendToBack()}(o);const g=[],f=0===r?v:m,y=0===r?c:v+c+(r-1)*m,w="right"===s?0:O.originY,S="right"===s?$:O.endY,Y=r>0?e([y,w,y,S],{objectCaching:!1,...D}):null;Y&&g.push(Y);const b=y+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:X,position:N,showMaxMinNumber:T,detailedList:E=[],showdetailedScale:M,showRange:G=[]}=o;if(C||X){const[t,e]=G,{lineXMain:i,lineXSub:n,textLeft:l}=u(N,y,f),r=(x[1]-x[0])/2,s=M&&!E.length?x.reduce(((t,e,i)=>{const n=t[t.length-1];return 0===i?[e]:t.concat([n+r,n+2*r])}),[]):M&&(null==E?void 0:E.length)?E:x,c=s.length;s.forEach(((r,s)=>{if(t&&+r<t)return;if(e&&+r>e)return;const u=O.endY-s*W*(M?j/2:j);if(X&&(!(0===s||s===c-1)||T)&&t!==+r){const t=0==s?u-5:u,e=a(r,o,l,t),i=O.originY+e.height/2;t<i&&e.set({top:i}),g.push(e)}g.push(...h(o,s,i,n,u,W,O.originY))}))}let I=o.title||"";o.unit&&(I+="\n"+o.unit);let B=O.originY+W;0!==_&&P[0]>1&&(B=V+W*P[0]/2),I&&g.push(new t.Text(String(I),{...i,left:b,top:B,textAlign:"center",...o.style}));const J=new t.Group(g,{...n,objectCaching:!1});p.push(J)}));const y=p.length>0?new t.Group([...p],{...n,objectCaching:!1}):null;y&&d.value.add(y),y&&y.sendToBack()}H&&function(){const t=JSON.parse(JSON.stringify(I));let e=L;const i=H-G.icons.marginRight;t.reverse().forEach((t=>{e-=10;let n=t.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:r(t.bigType),_type:t.bigType},...g.event}});var a;e-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(t){if(t.left>=k&&t.left<=E){t.setCoords();const e="pain"===t.origin.type?R:O;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(a),T(a)?f(a):m.show=!1})),a.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&T(a)){const t=X([...x],a.left,"_type").includes(a.origin._type),e=Y(a.left);if(!e||t)t&&e&&N("repeat");else{const t={data:{time:w(a.left),value:S(a.origin.type,a.top),...s(a.origin.type)?{key:a.origin.key}:{}},...a.origin};p("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(a)})),d.value.add(l,u)}))}();const F=G.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.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)&&F.push(q),_>0&&G.yScaleValue[_].show){const t=G.yScaleValue[_];0===_&&G.yScaleValue.length>1&&F.unshift(t),_==G.yScaleValue.length-1&&F.push(t)}const K=F.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),Q=F[K];return K>-1&&F.splice(K,0,{...Q,title:(null==Q?void 0:Q.doubleTitle)||(null==Q?void 0:Q.title)}),z(F),d.value.add(new t.Rect({left:H,top:0,width:J-H-D.strokeWidth,height:$-D.strokeWidth,fill:"transparent",...D})),{drawScaleValue:z}}export{d as useLeft};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t}from"../useDraw.js";import"date-fns";import{last as i}from"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function n(n,o,r,l){const{other:s,vitalSignsOriginY:h,xCellWidth:u,yCellHeight:a,endX:c}=o;let f=0;function g(i,o,l){const h=[];String(i.value).split("").forEach(((n,o)=>{const r=new e.Text(n,{left:0,top:a*o,originX:"center",...t,objectCaching:!1,...i.style||{}});f=(a-(r.height||0))/2,h.push(r)}));const c=new e.Rect({left:0,top:0,width:u,height:a*h.length,fill:"transparent",originX:"center",...t}),{eventHighlight:g=!1}=s||{},p={originX:"center",left:o,top:l+f,baseTop:(i.baseTop||0)*a,trueLeft:o,trueHeight:h.length*a,objectCaching:!1,hoverCursor:"pointer",highlightObject:c,originData:i,selectable:!1,evented:g},v=new e.Group([c,...h],p);return function(e){const{highlightColor:t="#ffff00"}=s||{};e.on("mouseover",(()=>{e.highlightObject.set("fill",t),n.value.requestRenderAll()})),e.on("mouseout",(()=>{e.highlightObject.set("fill","transparent"),n.value.requestRenderAll()})),e.on("mousedown",(function(){r("eventClick",e.originData)}))}(v),n.value.add(v),v}!function(){if(!(null==s?void 0:s.list))return!1;const e=[],t=[];s.list.forEach(((e,i)=>{const n=0===i?"vertical":e.align||"vertical",o=l(e.time,!0);if(o>c)return;const r=t.find((e=>e.left==o));if(r)r[n].push(e);else{const i={left:o,vertical:[],horizontal:[]};i[n].push(e),t.push(i)}})),t.forEach((t=>{let n=h.originY,o=t.left;t.vertical.forEach(((r,l)=>{var s,c;const f=(r.baseTop||0)*a,p=(null==(s=i(e))?void 0:s.left)||0;0===l&&t.left<=p&&(o=p+u);if(e.filter((e=>e.trueLeft===o)).length){const t=String(r.value).length*a,l=(null==(c=i(e))?void 0:c.trueHeight)||0;n+=l,n+t+f>h.endY&&(n=h.originY,o+=u)}n+=f,String(r.value).length&&e.push(g(r,o,n))})),t.horizontal.forEach(((n,r)=>{var l;const s=h.originY+(n.baseTop||0)*a,c=(null==(l=i(e))?void 0:l.left)||0;t.left<=c&&(o=c+u),String(n.value).length&&e.push(g(n,o,s))}))}))}()}export{n as useOther};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as l,drawTextGroup as s,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import{flatten as o}from"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function u(u,h){const{grid:n,originX:r,endX:a,xCellWidth:c,gridXNumber:p,top:d,xScalevalueHeight:f,iconsWidth:v,topList:g,endXLimit:m,canvasWidth:y,borderStyle:S,surplusCell:w}=h;!function(){const x=[];m&&x.push(new e.Line([m,0,y,0],S));let X=0;g.forEach(((e,l)=>{if(l>0&&(X+=h[`${g[l-1].key}Height`]),"xScalevalue"==e.key)!function(e,l,o){const u=d.dayHeight;if(!u)return;l.push(t([r,o+u,a,o+u],S));const h=c*n.subSecondXCell,f=(p-w[1]-w[3])/n.subSecondXCell;for(let n=0;n<f;n++){const a=r+n*h,c=n%2==0?"上午":"下午",p=s({width:h,height:u,...S},{value:c,...i,...e.style||{}},{left:a,top:o});l.push(p),l.push(t([a+h,o,a+h,o+u],S))}}(e,x,X),function(e,l,u){var h;const p=d.xScalevalue.show&&null!=(h=d.dayHeight)?h:0,g=f-p;if(!g)return;l.push(t([v,u+f,a,u+f],S));const m=s({width:r-v,height:f,...S},{value:d.xScalevalue.title,...i,...e.style||{},...e.titleStyle||{}},{left:v,top:u});l.push(m),l.push(t([r,u,r,u+f],S));const y=[];for(let e=0;e<n.mainXCell;e++)y.push(d.xScalevalue.list);o(y).forEach(((o,h)=>{const n=r+h*c,a=s({width:c,height:g,...S},{value:o.value,...i,...e.style||{},...o.style||{}},{left:n,top:u+p});l.push(a),l.push(t([n+c,u+p,n+c,u+p+g],S))}))}(e,x,X);else{if(!h[`${e.key}Height`])return;const o=h[`${g[l].key}Height`];!function(e,l,o){const u=h[`${e.key}Height`],a=s({width:r-v,height:u,...S},{value:e.title,...i,...(null==e?void 0:e.style)||{},...e.titleStyle||{}},{left:v,top:o});l.push(a);const p=c*n.subXCell;e.list.forEach(((h,n)=>{const a=r+n*p,c=s({width:p,height:u,...S},{value:h,...i,...(null==e?void 0:e.style)||{}},{left:a,top:o});l.push(t([a+p,o,a+p,o+u],S)),l.push(c)}))}(e,x,X),x.push(t([v,X+o,a,X+o],S)),x.push(t([r,X,r,X+o],S))}}));const b=x.length>0?new e.Group([...x],{...l,objectCaching:!1}):null;b&&b.sendToBack(),b&&u.value.add(b)}()}export{u as useTop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>p(t.time)>p(n)));return~e?e:t.length}function o(n){return["temperature"
|
|
1
|
+
import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>p(t.time)>p(n)));return~e?e:t.length}function o(n){return["temperature"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return a(n.left,1)===a(t.left,1)&&Math.abs(a(n.top,1)-a(t.top,1))<=2}function a(n,t=100){return Math.floor(n*t)/t}function s(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=s(n.children):t++})),t}function p(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}function d(n,t){const e=[],[r,u]=n;t=t||1;for(let n=r;t>0?n<=u:n>=u;n+=t)e.push(n);return e}function h(n){const{width:t,height:e,left:r,top:u}=n,o=t/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,u as getIndex,h as getPointRange,d as getScaleNumberList,p as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import s from"./src/FormRenderWrapper.vue.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useAutoHidden}from"./src/hooks/useAutoHidden.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./src/hooks/useComplexOptions.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./src/hooks/useFormEvent.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormGraph}from"./src/hooks/useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useFormRenderLifeCycle}from"./src/hooks/useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{useLowCodeEvent}from"./src/hooks/useLowCodeEvent.js";export{useLowCodeReactions}from"./src/hooks/useLowCodeReactions.js";export{useNuiThemeOverrides}from"./src/hooks/useNuiThemeOverrides.js";export{useOperationalForm}from"./src/hooks/useOperationalForm.js";export{usePresetScope}from"./src/hooks/usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./src/hooks/useWordbookSetting.js";export{useNewLowCodeReactions}from"./src/hooks/useNewLowCodeReactions.js";export{useSelectedSetting}from"./src/hooks/useSelectedSetting.js";export{combineExtendKey,createInputSlot,createSlot,editorUnescape,formRenderLog,getAbsoluteKey,injectOrProvide,isNestedFieldType,isNestedType,mergeDeepProperties,parseNumberFromMaybeString,renderDescOption,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const r=s;r.install=function(s){o(s,r,e+"FormRender")};export{r as default};
|
|
1
|
+
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import s from"./src/FormRenderWrapper.vue.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useAutoHidden}from"./src/hooks/useAutoHidden.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./src/hooks/useComplexOptions.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./src/hooks/useFormEvent.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormGraph}from"./src/hooks/useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useFormRenderLifeCycle}from"./src/hooks/useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{useLowCodeEvent}from"./src/hooks/useLowCodeEvent.js";export{useLowCodeReactions}from"./src/hooks/useLowCodeReactions.js";export{useNuiThemeOverrides}from"./src/hooks/useNuiThemeOverrides.js";export{useOperationalForm}from"./src/hooks/useOperationalForm.js";export{usePresetScope}from"./src/hooks/usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./src/hooks/useWordbookSetting.js";export{useNewLowCodeReactions}from"./src/hooks/useNewLowCodeReactions.js";export{useSelectedSetting}from"./src/hooks/useSelectedSetting.js";export{FieldListFilter,combineExtendKey,createInputSlot,createSlot,editorUnescape,findItemByValCondition,formRenderLog,getAbsoluteKey,injectOrProvide,isNestedFieldType,isNestedType,mergeDeepProperties,parseEnhanceText,parseNumberFromMaybeString,renderDescOption,replace2Any,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const r=s;r.install=function(s){o(s,r,e+"FormRender")};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as s from"./combination/index.js";import*as t from"./complex.js";import*as r from"./date.js";import*as o from"./formItem.js";import*as e from"./input.js";import*as m from"./inputGroup.js";import*as i from"./inputNumber.js";import*as a from"./levelSearchCascader/index.js";import*as p from"./lineBar/index.js";import*as x from"./radio_checkbox.js";import*as n from"./remoteSearch.js";import*as c from"./searchCascade.js";import*as f from"./select.js";import*as j from"./simpleComponent.js";import*as d from"./slider.js";import*as l from"./switch.js";import*as u from"./
|
|
1
|
+
import*as s from"./combination/index.js";import*as t from"./complex.js";import*as r from"./date.js";import*as o from"./formItem.js";import*as e from"./input.js";import*as m from"./inputGroup.js";import*as i from"./inputNumber.js";import*as a from"./levelSearchCascader/index.js";import*as p from"./lineBar/index.js";import*as x from"./radio_checkbox.js";import*as n from"./remoteSearch.js";import*as c from"./searchCascade.js";import*as f from"./select.js";import*as j from"./simpleComponent.js";import*as d from"./slider.js";import*as l from"./switch.js";import*as u from"./text.js";import*as h from"./textarea.js";import*as b from"./time.js";import{separateMetaModule as C}from"../../../../../shared/utils/index.js";var S=C(Object.assign({"./combination/index.ts":s,"./complex.tsx":t,"./date.tsx":r,"./formItem.tsx":o,"./input.tsx":e,"./inputGroup.ts":m,"./inputNumber.tsx":i,"./levelSearchCascader/index.tsx":a,"./lineBar/index.ts":p,"./radio&checkbox.tsx":x,"./remoteSearch.tsx":n,"./searchCascade.tsx":c,"./select.tsx":f,"./simpleComponent.tsx":j,"./slider.tsx":d,"./switch.tsx":l,"./text.tsx":u,"./textarea.tsx":h,"./time.tsx":b}));export{S as default};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { AnyObject } from '../../../../../shared/types';
|
|
2
|
-
export declare const TEXT: {
|
|
3
|
-
(props: AnyObject): JSX.Element;
|
|
4
|
-
props: {
|
|
5
|
-
content: {};
|
|
6
|
-
fieldItem: {};
|
|
7
|
-
value: {};
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
2
|
export declare const BUTTON: {
|
|
11
3
|
(props: AnyObject): JSX.Element;
|
|
12
4
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as n,createVNode as
|
|
1
|
+
import{inject as n,createVNode as o}from"vue";import{connect as r,mapProps as t}from"@formily/vue";import{isFunction as e}from"lodash-es";import{NButton as l}from"naive-ui";import{InjectionFormGlobalProps as i}from"../../constants/index.js";import{createSlot as m}from"../../utils/index.js";const u=n=>{const r=function(n){return o=>{var r;return null==(r=n.fieldItem)?void 0:r[o]}}(n);return o(l,{onClick:function(){var o;const t=r("onClick")||(null==(o=r("componentProps"))?void 0:o.onClick);return()=>e(t)&&t(n.fieldItem)}()},m(n.content,n))};u.props={onClick:{},fieldItem:{},content:{}};const c=r(u,t((n=>{var o,r,t;return{...n,content:null!=(t=null==(o=n.fieldItem)?void 0:o.content)?t:null==(r=n.fieldItem)?void 0:r.alias}}))),s=r((r=>{var t;const e=n(i,{}),l=(null!=(t=r.border)?t:null==e?void 0:e.outBordered)?{background:"rgb(31,34,37)",margin:"0 -8px"}:null;return o("section",{class:"form-render__linebreaks",style:{"--form-item-column":999,height:"1px",...l}},null)}));export{c as BUTTON,s as LINE_BREAKS};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { FieldItem } from '../../../../../components/form-render';
|
|
3
|
+
export declare const TEXT: import("vue").DefineComponent<{
|
|
4
|
+
content: {};
|
|
5
|
+
fieldItem: {
|
|
6
|
+
type: PropType<FieldItem>;
|
|
7
|
+
};
|
|
8
|
+
value: {};
|
|
9
|
+
onChange: {};
|
|
10
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
content: {};
|
|
12
|
+
fieldItem: {
|
|
13
|
+
type: PropType<FieldItem>;
|
|
14
|
+
};
|
|
15
|
+
value: {};
|
|
16
|
+
onChange: {};
|
|
17
|
+
}>>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,computed as t,inject as n,createVNode as o}from"vue";import{connect as r,mapProps as l,RecursionField as i}from"@formily/vue";import{isString as s}from"lodash-es";import"../../../index.js";import{InjectionBusinessCollector as a,InjectionFormGlobalProps as u}from"../../constants/index.js";import{createSlot as m,replace2Any as c}from"../../utils/index.js";import{useFieldListAdaptor as p}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as d}from"../../utils/schema.js";const f=r(e({name:"FORM_TEXT",props:{content:{},fieldItem:{type:Object},value:{},onChange:{}},setup(e){function r(t,n=!1){var r,l;return o("div",{style:n?{display:"flex",alignItems:"center"}:{}},[null==(l=(r=m(t,e,(e=>s(e)?e=c(e.replace("\n","<br>"),[{from:"<br>",to:o("br",null,null)},{from:" ",to:o("i",{style:{display:"inline-block",width:"4px"}},null)}]):[e]))).default)?void 0:l.call(r)])}const l=t((()=>{var t,n;return null!=(n=null==(t=e.fieldItem)?void 0:t.__textEnhance)?n:[]})),f=t((()=>l.value.length&&l.value.some((e=>"widget"===e.type)))),v=n(a),h=n(u),{schemaAdaptor:y}=p(v,h.lifeCycle);return()=>{var t;return f.value?o("div",{style:{display:"flex",alignItems:"center"}},[l.value.map((e=>{if("text"===e.type)return r(e.content,!0);if(s(e.content))return r(e.content,!0);const t={...e.content};return t.decoratorProps={...t.decoratorProps,showLabel:!1,showFeedback:!1},o(i,{basePath:".",schema:d(y([t]))},null)}))]):r(null!=(t=e.content)?t:e.value)}}}),l((e=>{var t;return{...e,content:null==(t=e.fieldItem)?void 0:t.content}})));export{f as TEXT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,traverse as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import l from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{isString as o}from"lodash-es";import"../../index.js";import{FIELD_BUSINESS_TYPE as r}from"../constants/index.js";import{
|
|
1
|
+
import{arrayed as e,traverse as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import l from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{isString as o}from"lodash-es";import"../../index.js";import{FIELD_BUSINESS_TYPE as r}from"../constants/index.js";import{FieldListFilter as a,findItemByValCondition as s,parseEnhanceText as i}from"../utils/index.js";import{transformDateFormat as _}from"../utils/business.js";function p(){const p=new l(["fieldList","props"]),n=new l(["fieldItem","props"]);n.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),n.tap("__time",(e=>("DATE"===e.html_type&&"time"===_(e.date_format)&&(e.html_type="TIME"),e))),n.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),n.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:r.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),n.tap("__multiple_select",(e=>{const{html_type:t,multi_select:l,__multiple:o}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===l:o)),e}));const m=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];n.tap("__normalize",(e=>(m.some((([t,l])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=l))),e)));const E=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return n.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...E].some((([l,o])=>{if(!e(l).includes(t.html_type))return;const r=o.get(t.show_mode);return r&&r(t),!0})),t):t)),p.tap("__out_bordered",((e,{column:t,outBordered:l})=>e)),p.tap("__prefix/suffix",(e=>{const l=[];return t(e,(t=>{["prefix","suffix"].forEach((r=>{const a=t[r];if(!o(a))return;const i=a.match("#{(.+)}");if(!i)return;const _=o(i[1])&&s(e,(e=>e.val_key===i[1].trim()));_&&(Reflect.deleteProperty(t,r),t[`${r}Config`]=t[`${r}Config`]||[],t[`${r}Config`].push(_),l.push(_))}))}),["children","properties"]),l.length?a(e,(e=>l.includes(e))):e})),p.tap("__textEnhance",(e=>{const l=[];return t(e,(t=>{if("TEXT"!==t.html_type||!o(t.default_val))return;const r=i(t.default_val);t.__textEnhance=r,r.forEach((o=>{if("text"===o.type)return;const r=s(e,(e=>[e.name,e.val_key].includes(o.content)));r&&(Reflect.deleteProperty(t,"default_val"),l.push(r),o.content=r)}))}),["children","properties"]),a(e,(e=>l.includes(e)))})),{FieldNormalizeWaterfallHook:n,FieldListNormalizeWaterfallHook:p}}export{p as useFieldNormalize};
|
|
@@ -165,3 +165,7 @@ export declare type FormBusinessFormatter = (payload: {
|
|
|
165
165
|
type: FIELD_BUSINESS_TYPE;
|
|
166
166
|
from: FIELD_BUSINESS_TYPE;
|
|
167
167
|
}) => unknown;
|
|
168
|
+
export declare type TextNodeType<T extends 'text' | 'widget' = 'text' | 'widget'> = {
|
|
169
|
+
type: T;
|
|
170
|
+
content: T extends 'text' ? string : FieldItem | string;
|
|
171
|
+
};
|
|
@@ -2,7 +2,7 @@ import { AnyObject, ArrayAble } from '../../../../shared/types';
|
|
|
2
2
|
import { GeneralField } from '@formily/core';
|
|
3
3
|
import { Pattern } from '@formily/path';
|
|
4
4
|
import { FunctionalComponent, InjectionKey, VNode } from 'vue';
|
|
5
|
-
import { FieldItem } from '../types';
|
|
5
|
+
import { FieldItem, TextNodeType } from '../types';
|
|
6
6
|
export * from './business';
|
|
7
7
|
export * from './dom';
|
|
8
8
|
export * from './schema';
|
|
@@ -22,3 +22,10 @@ export declare function isNestedFieldType(field: FieldItem | GeneralField): bool
|
|
|
22
22
|
export declare function renderDescOption(labelNode: any, option: AnyObject): JSX.Element;
|
|
23
23
|
export declare function getAbsoluteKey(fieldKey: string, field: Pattern): string;
|
|
24
24
|
export declare function editorUnescape(content: string): string;
|
|
25
|
+
export declare function FieldListFilter(list: FieldItem[], condition: (item: FieldItem) => boolean): FieldItem[];
|
|
26
|
+
export declare function findItemByValCondition(fieldList: FieldItem[], condition: (item: FieldItem) => boolean): FieldItem | null;
|
|
27
|
+
export declare function parseEnhanceText(str: string): TextNodeType<"text" | "widget">[];
|
|
28
|
+
export declare function replace2Any(str: string, replacer: {
|
|
29
|
+
from: string;
|
|
30
|
+
to: any;
|
|
31
|
+
}[]): any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as
|
|
1
|
+
import{inject as t,provide as n,computed as e,createVNode as r,Fragment as o}from"vue";import{traverse as i,arrayed as u}from"../../../../shared/utils/index.js";import{isGeneralField as c}from"@formily/core";import{Path as f}from"@formily/path";import{HelpCircleSharp as s}from"@vicons/ionicons5";import{isObject as l}from"@vue/shared";import{useMemoize as p}from"@vueuse/core";import{isString as a,isFunction as d,omit as E,castArray as T,flattenDeep as h}from"lodash-es";import{NTooltip as m,NIcon as R}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as v}from"../constants/index.js";import"date-fns";function x(t){console.warn(`[FormRender]: ${t}`)}function y(t,n,e=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function t(n,r){r.forEach((r=>{l(r)&&(null!=c(r)&&null==n[i(r)]&&f.setIn(n,i(r),c(r)),e.forEach((e=>{r[e]&&(n[i(r)]||(n[i(r)]={}),t(n[i(r)],u(r[e])))})))}))}(t,n),t;function i(t){return t[r]}function c(t){return t[o]}}function g(e,r){let o=t(e,null);return o||(o=r(),n(e,o)),o}function I(t){return t&&a(t)?+t:t}function A(t,n,e){if(l(t)&&!d(t)){const e={};return Object.entries(t).forEach((([t,r])=>{d(r)&&(e[t]=()=>r(n))})),e}return{default:()=>d(t)?t(n):e?e(t):[t]}}function W(t,n){return e((()=>{const e={};return t.prefix&&(e.prefix=()=>r(o,null,[A(t.prefix,t,n).default()])),t.suffix&&(e.suffix=()=>r(o,null,[A(t.suffix,t,n).default()])),e}))}function _(t,n){return a(t)&&t?t.replace(/\$\{([^}]*)}/g,(function(t,e){const r=e.split("||");for(const t of r){const e=n[t.trim()];if(e)return e}return""})):""}function D(t){return t.reduce(((t,n)=>(a(n.extendKey)&&n.extendKey&&t.push(n),$(n)&&t.push(...D(n.children||[])),t)),[])}function G(t,n){const e=D(t);if(!e.length)return n;const r={},o=new Map;return Object.entries(n).forEach((([t,i])=>{const u=e.find((n=>n.val_key===t));if(!u)return r[t]=i;const{val_key:c,extendKey:f}=u,s=o.get(f)||{};o.set(f,s),s[c]=n[c]})),[...o.entries()].forEach((([t,n])=>{r[t]=JSON.stringify(n)})),r}function P(t,n){const e=D(t);if(!e.length)return n;const r=p((t=>{try{return l(n[t])?n[t]:JSON.parse(n[t])||{}}catch(t){return{}}})),o=E(n,e.map((t=>t.extendKey)));return e.forEach((({val_key:t,extendKey:n})=>{Reflect.has(o,t)||(o[t]=r(n)[t])})),o}function S(t){return t&&v.includes(t)}function $(t){return S(c(t)?t.componentType:t.html_type)}function w(t,n){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[t,n.desc?r(m,null,{trigger:()=>r(R,{component:s},null),default:()=>n.desc}):null])}function K(t,n){return f.parse(t.startsWith(".")?t:`.${t}`,n).toString()}function X(t){return t.replace(/</g,"<").replace(/>/g,">")}function j(t,n){return t.reduce(((t,e)=>(n(e)||(t.push(e),e.properties&&(e.properties=j(e.properties,n)),e.children&&(e.children=j(e.children,n))),t)),[])}function k(t,n){let e=null;return i(t,((t,r)=>{n(t)&&(e=t,r())}),["children","properties"]),e}var O=function(t){return t[t.PREPARE=0]="PREPARE",t[t.TEXT=1]="TEXT",t[t.WIDGET_START=2]="WIDGET_START",t[t.WIDGET=3]="WIDGET",t}(O||{});function b(t){const n=[...t],e=[];let r=O.PREPARE,o="";function i(t){switch(r=t,r){case O.PREPARE:case O.WIDGET_START:case O.WIDGET:o=""}}function u(t="text",n=o){e.push({type:t,content:n})}function c(){const t=e.pop();t&&("text"===t.type?o=t.content:e.push(t))}return n.forEach(((t,e)=>{const f=e===n.length-1;switch(r){case O.PREPARE:return"#"===t?(i(O.WIDGET_START),void(f&&u())):(i(O.TEXT),o=t,void(f&&u()));case O.TEXT:return"#"===t?void(f?(o+=t,u()):(u(),i(O.WIDGET_START))):(o+=t,void(f&&u()));case O.WIDGET_START:return"{"!==t||f?(c(),i(O.TEXT),o+=`#${t}`,void(f&&u())):void i(O.WIDGET);case O.WIDGET:return"}"===t?(u("widget"),void i(O.PREPARE)):"#"===t?(c(),u(),i(O.WIDGET_START),o+=`#${t}`,void(f&&u())):(o+=t,void(f&&u("text",`#{${o}`)))}})),e}function J(t,n){let e=T(t);return n.forEach((({from:t,to:n})=>{e.forEach(((r,o)=>{a(r)&&(e[o]=r.split(t).map(((t,e,r)=>[t,e<r.length-1?n:null])))})),e=h(e)})),e}export{j as FieldListFilter,G as combineExtendKey,W as createInputSlot,A as createSlot,X as editorUnescape,k as findItemByValCondition,x as formRenderLog,K as getAbsoluteKey,g as injectOrProvide,$ as isNestedFieldType,S as isNestedType,y as mergeDeepProperties,b as parseEnhanceText,I as parseNumberFromMaybeString,w as renderDescOption,J as replace2Any,P as splitExtendKey,_ as validateMessageParser};
|
package/es/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./grid/index.js";export{default as CGrid}from"./grid/index.js";import r from"./big-table/index.js";export{default as CBigTable}from"./big-table/index.js";import o from"./field-set/index.js";export{default as CFieldSet}from"./field-set/index.js";import s from"./button-print/index.js";export{default as CButtonPrint}from"./button-print/index.js";import t from"./select-person/index.js";export{default as CSelectPerson}from"./select-person/index.js";import i,{CLabelFormContent as a}from"./select-label/index.js";export{CLabelFormContent,default as CSelectLabel}from"./select-label/index.js";import d from"./map/index.js";export{default as CMap}from"./map/index.js";import n from"./vod-chunk-upload/index.js";export{default as CVodChunkUpload}from"./vod-chunk-upload/index.js";import{CScaleView as m,CRadio as f,CCheckbox as p,CSelect as l,CDatetime as u}from"./scale-view/index.js";export{CCheckbox,CDatetime,CRadio,CScaleView,CSelect}from"./scale-view/index.js";import c from"./info-header/index.js";export{default as CInfoHeader}from"./info-header/index.js";import x from"./time-line/index.js";export{default as CTimeLine}from"./time-line/index.js";import C from"./base-search/index.js";export{default as CBaseSearch}from"./base-search/index.js";import
|
|
1
|
+
import e from"./grid/index.js";export{default as CGrid}from"./grid/index.js";import r from"./big-table/index.js";export{default as CBigTable}from"./big-table/index.js";import o from"./field-set/index.js";export{default as CFieldSet}from"./field-set/index.js";import s from"./button-print/index.js";export{default as CButtonPrint}from"./button-print/index.js";import t from"./select-person/index.js";export{default as CSelectPerson}from"./select-person/index.js";import i,{CLabelFormContent as a}from"./select-label/index.js";export{CLabelFormContent,default as CSelectLabel}from"./select-label/index.js";import d from"./map/index.js";export{default as CMap}from"./map/index.js";import n from"./vod-chunk-upload/index.js";export{default as CVodChunkUpload}from"./vod-chunk-upload/index.js";import{CScaleView as m,CRadio as f,CCheckbox as p,CSelect as l,CDatetime as u}from"./scale-view/index.js";export{CCheckbox,CDatetime,CRadio,CScaleView,CSelect}from"./scale-view/index.js";import c from"./info-header/index.js";export{default as CInfoHeader}from"./info-header/index.js";import x from"./time-line/index.js";export{default as CTimeLine}from"./time-line/index.js";import C from"./base-search/index.js";export{default as CBaseSearch}from"./base-search/index.js";import h from"./quick-search/index.js";export{default as CQuickSearch}from"./quick-search/index.js";import j from"./classification/index.js";export{default as CClassification}from"./classification/index.js";import k from"./bpmn-workflow/index.js";export{default as CBpmnWorkflow}from"./bpmn-workflow/index.js";import b from"./steps-wheel/index.js";export{default as CStepsWheel}from"./steps-wheel/index.js";import S from"./editor/index.js";export{default as CEditor}from"./editor/index.js";import g from"./form-render/index.js";export{default as CFormRender}from"./form-render/index.js";import F from"./fabric-chart/index.js";export{default as CFabricChart}from"./fabric-chart/index.js";import y from"./shortcut-provider/index.js";export{default as CShortcutProvider}from"./shortcut-provider/index.js";import T from"./shortcut-setter/index.js";export{default as CShortcutSetter}from"./shortcut-setter/index.js";import v from"./form-config/index.js";export{default as CFormConfig}from"./form-config/index.js";import D from"./iho-table/index.js";export{default as CIhoTable,useIhoTablePresetPlugins}from"./iho-table/index.js";import P from"./keyboard/index.js";export{default as CKeyboard}from"./keyboard/index.js";import R from"./search-cascader/index.js";export{default as CSearchCascader}from"./search-cascader/index.js";import A from"./recommend-search/index.js";export{default as CRecommendSearch}from"./recommend-search/index.js";import w from"./date-picker/index.js";export{default as CDatePicker}from"./date-picker/index.js";import E from"./time-picker/index.js";export{default as CTimePicker}from"./time-picker/index.js";import L from"./config-provider/index.js";export{default as CConfigProvider}from"./config-provider/index.js";import B from"./picture-clipper/index.js";export{default as CPictureClipper}from"./picture-clipper/index.js";import I from"./table-export-field/index.js";export{default as CTableExportField}from"./table-export-field/index.js";import O from"./expand-field/index.js";export{default as CExpandField}from"./expand-field/index.js";import V from"./biunique-chat/index.js";export{default as CBiuniqueChat}from"./biunique-chat/index.js";import H from"./callback/index.js";export{default as CCallback}from"./callback/index.js";import K from"./slider-tree/index.js";export{default as CSliderTree}from"./slider-tree/index.js";import N from"./body-select/index.js";export{default as CBodySelect}from"./body-select/index.js";import q from"./default-page/index.js";export{default as CDefaultPage}from"./default-page/index.js";import M from"./step-notice/index.js";export{default as CStepNotice}from"./step-notice/index.js";export{default as CInsuranceSDK}from"./card-reader-sdk/src/insuranceSDK.js";export{default as CCardReaderSDK}from"./card-reader-sdk/src/cardReaderSDK.js";export{formatDateRangeInfo,presetValToDateRangestr,presetValToTimestamp}from"./table-filter/src/components/render-widget/helpers/presetValToTimestamp.js";export{DatePresetValEnums,DateRangeInnerValEnums,DateRangeOutDefEnums}from"./table-filter/src/components/render-widget/enums.js";export{createOpacityColor,useTheme}from"../shared/hooks/useTheme.js";export{handleInputEvent,useDateTime}from"../shared/hooks/useDateTime.js";export{AsyncQueue,ENTRY_STATE}from"../shared/hooks/useAsyncQueue/index.js";export{presetRequestHandler,useFormAsyncQueue,useFormRequest}from"../shared/hooks/useFormRequest/index.js";export{useLevelSearchCascader}from"../shared/hooks/useLevelSearchCascader.js";export{useSelectAllowModify}from"../shared/hooks/selectHooks/useSelectAllowModify.js";export{useOptionFiltered}from"../shared/hooks/selectHooks/useOptionFiltered.js";export{searchContentMatcher,useSearchContent}from"../shared/hooks/selectHooks/useSearchContent.js";export{useSelectRenders}from"../shared/hooks/selectHooks/useSelectRenders.js";export{useVersion}from"../shared/hooks/useVersion.js";export{vFlexibleResize}from"../shared/directive/flexibleResize.js";export{useGuide}from"./guide/src/useGuide.js";export{DragScroll,useDragScroll}from"./drag-scroll/src/index.js";export{default as CAudioSDK}from"./audio-sdk/src/audioSDK.js";export{useAnchor}from"./form-render/src/hooks/useAnchor.js";export{useAutoHidden}from"./form-render/src/hooks/useAutoHidden.js";export{BusinessCollector,useBusinessBinding}from"./form-render/src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./form-render/src/hooks/useChangeContext.js";export{useCommonInjection,useSelectOptionProps}from"./form-render/src/hooks/useCommonInjection.js";export{useCommonLog}from"./form-render/src/hooks/useCommonLog.js";export{useComplexOptions,useComplexOptionsSpan}from"./form-render/src/hooks/useComplexOptions.js";export{useFieldListAdaptor}from"./form-render/src/hooks/useFieldListAdaptor.js";export{useFieldNormalize}from"./form-render/src/hooks/useFieldNormalize.js";export{useFieldVisitor}from"./form-render/src/hooks/useFieldVisitor.js";export{useFormContext}from"./form-render/src/hooks/useFormContext.js";export{useFormDomEvent,useFormExposeEvent}from"./form-render/src/hooks/useFormEvent.js";export{useFormField}from"./form-render/src/hooks/useFormField.js";export{useFormGraph}from"./form-render/src/hooks/useFormGraph.js";export{FormItemDepsCollector,useFormItemDeps}from"./form-render/src/hooks/useFormItemDeps.js";export{useFormRenderLifeCycle}from"./form-render/src/hooks/useFormRenderLifeCycle.js";export{useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./form-render/src/hooks/useFormRenderOptions.js";export{useFormValidator,validateMessageLocale}from"./form-render/src/hooks/useFormValidator.js";export{useLowCodeEvent}from"./form-render/src/hooks/useLowCodeEvent.js";export{useLowCodeReactions}from"./form-render/src/hooks/useLowCodeReactions.js";export{useNuiThemeOverrides}from"./form-render/src/hooks/useNuiThemeOverrides.js";export{useOperationalForm}from"./form-render/src/hooks/useOperationalForm.js";export{usePresetScope}from"./form-render/src/hooks/usePresetScope.js";export{useWordbookSetting,wordbookSettingHandler}from"./form-render/src/hooks/useWordbookSetting.js";export{useNewLowCodeReactions}from"./form-render/src/hooks/useNewLowCodeReactions.js";export{useSelectedSetting}from"./form-render/src/hooks/useSelectedSetting.js";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./form-render/src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./form-render/src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./form-render/src/utils/schema.js";export{FieldListFilter,combineExtendKey,createInputSlot,createSlot,editorUnescape,findItemByValCondition,formRenderLog,getAbsoluteKey,injectOrProvide,isNestedFieldType,isNestedType,mergeDeepProperties,parseEnhanceText,parseNumberFromMaybeString,renderDescOption,replace2Any,splitExtendKey,validateMessageParser}from"./form-render/src/utils/index.js";export{GlobalShortcutProvider,ShortcutManager,useShortcuts}from"./shortcut-provider/src/hooks/useShortcuts.js";export{useShortcutSignature}from"./shortcut-provider/src/hooks/useShortcutSignature.js";export{defineTablePlugin,useTablePlugin}from"./iho-table/src/hooks/useTablePlugin.js";export{useColumnConfigAdaptor}from"./iho-table/src/hooks/useColumnConfigAdaptor.js";export{AbstractConfigHooks,AbstractDataHooks,AbstractDomInsertHooks,AbstractEventHooks,AbstractExposeHooks,AbstractFieldHooks,AbstractSetupHooks}from"./iho-table/src/types/pluginType.js";export{Print}from"./button-print/src/utils/print.js";export{getFileUrl,isIReport,useBrowserPrint}from"./button-print/src/utils/browserPrint.js";export{transformOriginToTree}from"./slider-tree/src/utils/index.js";const G={CGrid:e,CBigTable:r,CFieldSet:o,CButtonPrint:s,CSelectPerson:t,CSelectLabel:i,CLabelFormContent:a,CScaleView:m,CMap:d,CVodChunkUpload:n,CRadio:f,CCheckbox:p,CSelect:l,CDatetime:u,CInfoHeader:c,CTimeLine:x,CBaseSearch:C,CQuickSearch:h,CClassification:j,CBpmnWorkflow:k,CStepsWheel:b,CEditor:S,CFormRender:g,CFabricChart:F,CShortcutProvider:y,CShortcutSetter:T,CFormConfig:v,CIhoTable:D,CKeyboard:P,CSearchCascader:R,CRecommendSearch:A,CDatePicker:w,CTimePicker:E,CConfigProvider:L,CPictureClipper:B,CTableExportField:I,CExpandField:O,CBiuniqueChat:V,CCallback:H,CSliderTree:K,CBodySelect:N,CDefaultPage:q,CStepNotice:M};var W={install:function(e){Object.values(G).forEach((r=>{r.install(e)}))},...G};export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.2.3-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.2.3-beta.27",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.3-beta.27",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.2.3-beta.
|
|
3
|
+
"version": "3.2.3-beta.27",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"iOS 7",
|
|
72
72
|
"last 3 iOS versions"
|
|
73
73
|
],
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "14ae8ea5339d92a23d332fd739db9b130d01aa8b"
|
|
75
75
|
}
|