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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,isEffectiveNode as h,getTime 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:$,showConnectLine:P=!1}=j,A=[],R=[],T=[];let V=null;if(null==(a=e.list)||a.forEach(((a,j)=>{const z=u(c)?L.find((e=>e.key===a.key)):e,D=fe(a,r),F=e.list[j+1],W=F?fe(F,r):void 0,q=F?u(c)?L.find((e=>e.key===F.key)):e:{},{title:G=""}=z;if("脉搏"===G&&"脉搏"!==q.title||"脉搏"!==G&&"脉搏"===q.title||!D||!W||d(D[0],1)!==d(W[0],1))D&&V&&(D[0]=V),V=null;else{const e=D[0]-H/2;D[0]=e+H/4,W[0]=V=D[0]+H/2}const B={};B.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 T.push(s),{obj:s,top:-_}}(D,a,z),function(e,t,r,u){var a,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:f={}}=r,{value:m}=u;let x,b,j,w,L;if(t.noRise&&v.show){const t=Y(v)?O(c,k,35):e[1];if(v.text)j=l([e[0],Y(v)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style});else{const i=t+2*_;j=s([e[0],t,i],{...v.style})}T.push(j)}t.rise&&h.show&&h.text&&(w=l([e[0],e[1]-(m?_:0)-5],{value:h.text.split("").join("\n"),originY:"bottom",...h.style}),T.push(w));t.verified&&(L=l([e[0],e[1]-(m?_:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),T.push(L));if(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)?e[0]+H/2:e[0];x=i([...e,s,l],{...f,...y.line,...n}),b=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"}),x&&T.push(x),b&&T.push(b)}Object.assign(u,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:v.text?5:2*_,isFixed:Y(v)},riseText:{obj:w,top:(m?-_:0)-5},verifiedText:{obj:L,top:(m?-_:0)-5},reducePoint:{obj:b,type:"reduce"}})}(D,a,z,B),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"),T.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),T.push(a)}+t.value<r&&(a=l([e[0],e[1]-_],i),T.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})}T.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:a,top:-_},belowMinValue:{obj:d,top:w.text?5:2*_,moveHide:!0}})}(D,a,z,B),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||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==Z?void 0:Z.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});T.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=R[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,...X(),...w?{selectable:!1,evented:!1,..."number"===E?$:{}}:{}};n&&(Y?O.leftLine.set("x2",n[0]):O.leftLine=null,p=o(k,{left:n[0],top:w?n[1]-5:n[1],...O}));R.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),ve(n,"change")}}))}(p),A.push(p),se.add(p))}(D,W,a,j,z,B)})),"pulse"===c){const e={};ie.forEach((t=>{e[t]=A.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(A).then((e=>{const t=R.filter((e=>e));Promise.all(T).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,t){const i="pain"===t.type?Q:N;if(!h(e)||!function(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=v(e);return l>=n&&l<=o}(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 he(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=v(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=v(`${P(e)}:00`);return U&&l<v(U)?(V("exceedMin"),!1):!(l>o)||(V("exceedMax"),!1)}function ve(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;ge()}function ge(){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=he(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),ve(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),ve(t)}},setPopup:pe,isAddPoint:he,updateData:ve,redrawPoints:ge,gridPoints:se}}function Y(e){return"fixed"===e.position}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 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 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.2.3-beta.7",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.7",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};
1
+ var e="@cnhis-design-vue/shared",i="3.2.3-beta.8",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.8",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.7",
3
+ "version": "3.2.3-beta.8",
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": "e4565f1d95ed0389eb86c284bde99f904c3e5092"
74
+ "gitHead": "840fff5e15d1d5a9116a44336d9361191f10507f"
75
75
  }