cnhis-design-vue 3.2.19-beta.7 → 3.2.19-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.
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +2 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldFilter.vue.d.ts +4 -4
- package/es/components/field-set/src/FieldSet.vue.d.ts +5 -5
- package/es/components/field-set/src/components/table-row.vue.d.ts +4 -4
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as s}from"date-fns";import{getType as a,getTime as u,isOneLine as d,isOverlapPoint as c,getFloorNumber as p,isValidValue as f,setOtherType as h,isEffectiveNode as v,deleteProperty as g,getIndex as y}from"../../utils/index.js";import{cloneDeep as m,omit as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useShadow as j}from"../useShadow.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as S,OVERLAP as Y}from"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{promiseTimeout as E}from"@vueuse/shared";function M(M,C,T,$,P,V,A,R,I,X){r(M,{...C,isTemperature:!0});const{getEqualXTypes:H,handleAddPrevent:B,getPointEventProps:D}=L(M,T,C),{createShadowLines:W}=j(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:K,originX:q,endX:G,originY:N,endY:J,itemList:Q,event:U,vitalSignsOriginY:Z,painOriginY:ee,hospitalizationDate:te,config:ie,canvasHeight:ne,painSurplusCell:oe,iconsWidth:le,canvasWidth:re,borderStyle:se,painScalePositionSurplusHeight:ae}=C,ue=new Set,de=["xinmai","mai"],ce=new Map,pe=new Set,fe=new Set,he=new Set,ve=m(z.yScaleValue),ge=new Set;function ye(n){var o;const l=ve.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ue.size&&M.value.remove(...ue),ue.clear(),ce.size>1)){if(n){const{type:e,key:t}=n.origin||{};if("pulse"===e){const e=ce.get(t),i=null==e?void 0:e.findIndex((e=>e[0]===n.left));e.splice(i,1,[n.left,n.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ce)t.push(e[1]),e[0]===de[0]&&e[1].forEach((e=>{(ce.get(de[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&r.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(he).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===de[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&M.value.remove(e.rightLine):e.leftLine&&M.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((n=>{const o=n.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(n,s._angle,s.space,w(s,["_angle","space"]))),e.forEach((e=>{ue.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(n);i.forEach((i=>{const n=t([...x(i)],{...s,originX:"center"});e.push(n),ue.add(n)}))}M.value.add(...e)}ue.add(l),M.value.add(l)}))}}function me(e,r,s){var a;const{type:u,riseStyle:c={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:w={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:E,textStyle:C}=j,V=[],R=[],X=[];let H=null;const B=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&be(e.time),W=d(s);if(null==(a=e.list)||a.forEach(((a,d)=>{var j,z,F,q;const G=W?S.find((e=>e.key===a.key)):e,N=je(B(a)?{...a,value:k.fixedValue}:a,s),J=e.list[d+1],Q=J?je(B(J)?{...J,value:k.fixedValue}:J,s):void 0,te=J?W?S.find((e=>e.key===J.key)):e:{},{title:le=""}=G;if(le===((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.235"))||"脉搏")&&te.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.235"))||"脉搏")&&te.title===((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")||!N||!Q||p(N[0],1)!==p(Q[0],1))N&&H&&(N[0]=H),H=null;else{const e=N[0]-_/2;N[0]=e+_/4,Q[0]=H=N[0]+_/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ie.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=Z.originY+K?e[1]+K:e[1]-K,r=o([e[0],l],{value:B(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-K}}(N,a,G),function(e,r,s,a){var d,p,h;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!be(r.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!r.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=$(r.time);let j,L,S,Y,E,M;if(r.noRise&&v.show){const t=O(v,r)?P(u,35):(null==e?void 0:e[1])||0;if(v.text)S=o([b,O(v,r)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),r.value||he.add(S);else if(r.value){S=l([b,t,t+2*K],{...v.style})}S&&X.push(S),S&&O(v,r)&&ge.add(S)}if(null==e?void 0:e[1]){if(r.rise&&c.show&&c.text&&(Y=o([b,e[1]-(x?K:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(Y)),r.verified){const t=(null==(d=null==g?void 0:g.position)?void 0:d[w])||"top";E=o(["top-right"===t?b+_/2:b,e[1]-(x?K:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(f(r.physicsReduce)||f(r.drugReduce)){const o=P(u,null!=(p=r.physicsReduce)?p:r.drugReduce),l=o<e[1]&&(null==ie?void 0:ie.hypothermyViewCustom)?b+_/2:b;j=t([...e,l,o],{...m,...y.line,...i}),L=n((null==(h=null==y?void 0:y.point)?void 0:h.type)||"circle",{left:l,top:o,...y.point,...i,originY:o===ne?"bottom":"center"}),j&&X.push(j),L&&X.push(L)}r.respirator&&(M=n(k.type,{left:b,top:e[1]-(x?K:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(M))}Object.assign(a,{reduceLine:{obj:j,type:"line"},noRiseText:{obj:S,top:v.text?5:2*K,isFixed:O(v,r)},riseText:{obj:Y,top:(x?-K:0)-5},verifiedText:{obj:E,left:_/2,top:(x?-K:0)-5},reducePoint:{obj:L,type:"reduce"},respirator:{obj:M,top:(x?-K:0)-5}})}(N,a,G,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const r=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*K,i=[e[1]-K/2,t];t<Z.originY&&(t=e[1]+2.5*K,i=[t,e[1]+K/2]),a=l([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>r){const t=a?e[1]+K/2+a.height:e[1]+K;d=o([e[0],t],i),X.push(d)}+t.value<s&&(d=o([e[0],e[1]-K],i),X.push(d))}if(L.show&&+t.value<s){const t=e[1];if(L.text)c=o([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*K;c=l([e[0],t,i],{...L.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-K},belowMinValue:{obj:c,top:L.text?5:2*K,moveHide:!0}})}(N,a,G,re),function(i,o,l,a,d,c){let p,f;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:j="circle",overlapKey:L}=d,S=g.height?g.height/2:5,Y=e.list[a+1];let O=m(i),H=m(o);const z=we(u,e.list[a].value),F=()=>"pulse"==u&&l.pacemakerShow?w.value:B(l)?k.type:z&&"number"===E?0:j,_=e=>e&&v.show&&v.fixed&&be(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(l.breakpoint)return!1;if("temperature"===u&&(i||_(l))&&(o||_(Y))){const e=P(u,35);return i||(O=[$(l.time),e]),o||(H=[$(Y.time),e]),!0}return!!i&&!!o})()){O&&H&&z&&we(u,Y.value)&&!oe[1]&&!ae&&"icon"===E&&(O[1]=O[1]-S,H[1]=H[1]-S),f=t([...O,...H],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(i&&o&&(null==e?void 0:e.top)<i[1]&&(null==ie?void 0:ie.hypothermyViewCustom)){const i=t([e.left,e.top,...o],{...y});X.unshift(i),Object.assign(c,{reduceRightLine:{obj:i,type:"reduce"}}),f.set("stroke","transparent")}}const K=F(),q=R[a-1],G={origin:{data:B(l)?{...l,value:k.fixedValue}:l,title:x,key:b||"",overlapKey:L,unit:s.unit,type:u,_type:h(x,u),dataIndex:r,index:a,isOneLine:W},leftLine:q,rightLine:f,otherObj:c,...l.pacemakerShow&&"pulse"==u?w.style:B(l)?k.style:g,...D(),lockMovementX:!0,...z?{selectable:!1,evented:!1,..."number"===E?C:{}}:{}};i&&(q?G.leftLine.set("x2",i[0]):G.leftLine=null,p=n(K,{left:i[0],top:!z||oe[1]||ae?i[1]:i[1]-S,...G}));R.push(f),p&&(b===de[1]?pe.add(p):B(l)||fe.add(p),function(e){U.hovered&&(e.on("mouseover",(()=>{xe(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?ee:Z;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(M.value.remove(i),delete e.otherObj.obj)))})),ye(e)}(e),U.hovered&&xe(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=A(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};M.value.discardActiveObject(),T("change",n),ke(n,"change")}}))}(p),V.push(p),he.add(p))}(N,Q,a,d,G,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&p(e.left,1)===p(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};de.forEach((t=>{e[t]=V.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ce.set(t,i(e[t]))}))}else{const{key:t}=e;ce.set(t,i(V))}}const z=R.filter((e=>e));M.value.add(...z,...V,...X)}function we(e,t){return"pain"===e&&0==t}function xe(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||V(e.left)).slice(-5)}`;I.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:A(o,e.top);if(f(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(f(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],I.show=!0}function be(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=u(e);return l>=n&&l<=o}function je(e,t){const i="pain"===t.type?ee:Z;if(!v(e)||!be(e.time))return;const n=$(e.time),o=P(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function Le(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=u(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=u(`${V(e)}:00`);return te&&l<u(te)?(B("exceedMin"),!1):!(l>o)||(B("exceedMax"),!1)}function ke(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=ve.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;Se()}function Se(){var e;he.size&&(null==(e=M.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...he]))),he.clear(),Ye()}function Ye(e){ce.clear(),he.clear(),pe.clear(),ge.clear(),fe.clear(),ve.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||me(e,i,t)})))})),ye(),[...he].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ve.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const o=Object.assign({},Y,z.overlap||{}),l=[];pe.size&&[...pe].forEach((e=>{[...fe].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key,r=t.origin.overlapKey;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let a=r||"koumai";"yemai"===e&&(a=e);const u=r||e;l.push(n(a,{...o[u],...s}))}}}))})),setTimeout((()=>{M.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),he.add(e)}))}))}()}return function(){const t=new e.Rect({left:le,top:0,width:re-le-se.strokeWidth,height:ne-se.strokeWidth,fill:"transparent",...se});M.value.add(t)}(),Ye((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const i=P(e.type,e.positionLine.value),n=t([q,i,G,i],e.positionLine);M.value.add(n)}(e))),M.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!C.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){X.point={x:e,y:i},X.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(X.list=[...k]),"pain"===l&&(X.list=[...S]),X.target=n;else{X.target=null,X.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],Q.forEach((t=>{if(!H([...he],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?ee:Z;i>=e.originY&&i<=e.endY&&X.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:a(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=Le(e);n&&1!==X.list.length||(X.show=!1,1===X.list.length&&n&&B("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ne&&T("click:grid",{x:e,y:t,time:V(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,a=g(i,[...k,...S]);a[`${e.type}`]=e.value,a.changeTime=s(new Date,"yyyy-MM-dd HH:mm"),o&&(a.key=t.origin.key);const u={...t.origin,data:a};T("change",u),ke(u,"change")}else{const t={data:{time:V(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};T("add",t),ke(t)}},setPopup:xe,isAddPoint:Le,updateData:ke,redrawPoints:Se,gridPoints:he,fixedNoRisePoints:ge}}function O(e,t){return e.fixed||!t.value&&0!==t.value}export{M as useCenter};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as s}from"date-fns";import{getType as a,getTime as u,isOneLine as d,isOverlapPoint as c,getFloorNumber as p,isValidValue as f,setOtherType as h,isEffectiveNode as v,deleteProperty as g,getIndex as y}from"../../utils/index.js";import{cloneDeep as m,omit as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useShadow as j}from"../useShadow.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as S,OVERLAP as Y}from"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{promiseTimeout as E}from"@vueuse/shared";function M(M,C,T,$,P,V,A,R,I,X){r(M,{...C,isTemperature:!0});const{getEqualXTypes:H,handleAddPrevent:B,getPointEventProps:D}=L(M,T,C),{createShadowLines:W}=j(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:K,originX:q,endX:G,originY:N,endY:J,itemList:Q,event:U,vitalSignsOriginY:Z,painOriginY:ee,hospitalizationDate:te,config:ie,canvasHeight:ne,painSurplusCell:oe,iconsWidth:le,canvasWidth:re,borderStyle:se,painScalePositionSurplusHeight:ae,painBorderColor:ue,painHeight:de}=C,ce=new Set,pe=["xinmai","mai"],fe=new Map,he=new Set,ve=new Set,ge=new Set,ye=m(z.yScaleValue),me=new Set;function we(n){var o;const l=ye.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ce.size&&M.value.remove(...ce),ce.clear(),fe.size>1)){if(n){const{type:e,key:t}=n.origin||{};if("pulse"===e){const e=fe.get(t),i=null==e?void 0:e.findIndex((e=>e[0]===n.left));e.splice(i,1,[n.left,n.top])}}const o=function(){const e=[],t=[],i=[];for(const e of fe)t.push(e[1]),e[0]===pe[0]&&e[1].forEach((e=>{(fe.get(pe[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&r.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(ge).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)===pe[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&M.value.remove(e.rightLine):e.leftLine&&M.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((n=>{const o=n.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(n,s._angle,s.space,w(s,["_angle","space"]))),e.forEach((e=>{ce.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(n);i.forEach((i=>{const n=t([...x(i)],{...s,originX:"center"});e.push(n),ce.add(n)}))}M.value.add(...e)}ce.add(l),M.value.add(l)}))}}function xe(e,r,s){var a;const{type:u,riseStyle:c={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:w={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:E,textStyle:C}=j,V=[],R=[],X=[];let H=null;const B=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&Le(e.time),W=d(s);if(null==(a=e.list)||a.forEach(((a,d)=>{var j,z,F,q;const G=W?S.find((e=>e.key===a.key)):e,N=ke(B(a)?{...a,value:k.fixedValue}:a,s),J=e.list[d+1],Q=J?ke(B(J)?{...J,value:k.fixedValue}:J,s):void 0,te=J?W?S.find((e=>e.key===J.key)):e:{},{title:le=""}=G;if(le===((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.235"))||"脉搏")&&te.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.235"))||"脉搏")&&te.title===((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")||!N||!Q||p(N[0],1)!==p(Q[0],1))N&&H&&(N[0]=H),H=null;else{const e=N[0]-_/2;N[0]=e+_/4,Q[0]=H=N[0]+_/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ie.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=Z.originY+K?e[1]+K:e[1]-K,r=o([e[0],l],{value:B(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-K}}(N,a,G),function(e,r,s,a){var d,p,h;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!Le(r.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!r.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=$(r.time);let j,L,S,Y,E,M;if(r.noRise&&v.show){const t=O(v,r)?P(u,35):(null==e?void 0:e[1])||0;if(v.text)S=o([b,O(v,r)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),r.value||ge.add(S);else if(r.value){S=l([b,t,t+2*K],{...v.style})}S&&X.push(S),S&&O(v,r)&&me.add(S)}if(null==e?void 0:e[1]){if(r.rise&&c.show&&c.text&&(Y=o([b,e[1]-(x?K:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(Y)),r.verified){const t=(null==(d=null==g?void 0:g.position)?void 0:d[w])||"top";E=o(["top-right"===t?b+_/2:b,e[1]-(x?K:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(f(r.physicsReduce)||f(r.drugReduce)){const o=P(u,null!=(p=r.physicsReduce)?p:r.drugReduce),l=o<e[1]&&(null==ie?void 0:ie.hypothermyViewCustom)?b+_/2:b;j=t([...e,l,o],{...m,...y.line,...i}),L=n((null==(h=null==y?void 0:y.point)?void 0:h.type)||"circle",{left:l,top:o,...y.point,...i,originY:o===ne?"bottom":"center"}),j&&X.push(j),L&&X.push(L)}r.respirator&&(M=n(k.type,{left:b,top:e[1]-(x?K:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(M))}Object.assign(a,{reduceLine:{obj:j,type:"line"},noRiseText:{obj:S,top:v.text?5:2*K,isFixed:O(v,r)},riseText:{obj:Y,top:(x?-K:0)-5},verifiedText:{obj:E,left:_/2,top:(x?-K:0)-5},reducePoint:{obj:L,type:"reduce"},respirator:{obj:M,top:(x?-K:0)-5}})}(N,a,G,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const r=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*K,i=[e[1]-K/2,t];t<Z.originY&&(t=e[1]+2.5*K,i=[t,e[1]+K/2]),a=l([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>r){const t=a?e[1]+K/2+a.height:e[1]+K;d=o([e[0],t],i),X.push(d)}+t.value<s&&(d=o([e[0],e[1]-K],i),X.push(d))}if(L.show&&+t.value<s){const t=e[1];if(L.text)c=o([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*K;c=l([e[0],t,i],{...L.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-K},belowMinValue:{obj:c,top:L.text?5:2*K,moveHide:!0}})}(N,a,G,re),function(i,o,l,a,d,c){let p,f;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:j="circle",overlapKey:L}=d,S=g.height?g.height/2:5,Y=e.list[a+1];let O=m(i),H=m(o);const z=be(u,e.list[a].value),F=()=>"pulse"==u&&l.pacemakerShow?w.value:B(l)?k.type:z&&"number"===E?0:j,_=e=>e&&v.show&&v.fixed&&Le(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(l.breakpoint)return!1;if("temperature"===u&&(i||_(l))&&(o||_(Y))){const e=P(u,35);return i||(O=[$(l.time),e]),o||(H=[$(Y.time),e]),!0}return!!i&&!!o})()){O&&H&&z&&be(u,Y.value)&&!oe[1]&&!ae&&"icon"===E&&(O[1]=O[1]-S,H[1]=H[1]-S),f=t([...O,...H],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(i&&o&&(null==e?void 0:e.top)<i[1]&&(null==ie?void 0:ie.hypothermyViewCustom)){const i=t([e.left,e.top,...o],{...y});X.unshift(i),Object.assign(c,{reduceRightLine:{obj:i,type:"reduce"}}),f.set("stroke","transparent")}}const K=F(),q=R[a-1],G={origin:{data:B(l)?{...l,value:k.fixedValue}:l,title:x,key:b||"",overlapKey:L,unit:s.unit,type:u,_type:h(x,u),dataIndex:r,index:a,isOneLine:W},leftLine:q,rightLine:f,otherObj:c,...l.pacemakerShow&&"pulse"==u?w.style:B(l)?k.style:g,...D(),lockMovementX:!0,...z?{selectable:!1,evented:!1,..."number"===E?C:{}}:{}};i&&(q?G.leftLine.set("x2",i[0]):G.leftLine=null,p=n(K,{left:i[0],top:!z||oe[1]||ae?i[1]:i[1]-S,...G}));R.push(f),p&&(b===pe[1]?he.add(p):B(l)||ve.add(p),function(e){U.hovered&&(e.on("mouseover",(()=>{je(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?ee:Z;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(M.value.remove(i),delete e.otherObj.obj)))})),we(e)}(e),U.hovered&&je(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=A(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};M.value.discardActiveObject(),T("change",n),Ye(n,"change")}}))}(p),V.push(p),ge.add(p))}(N,Q,a,d,G,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&p(e.left,1)===p(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};pe.forEach((t=>{e[t]=V.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),fe.set(t,i(e[t]))}))}else{const{key:t}=e;fe.set(t,i(V))}}const z=R.filter((e=>e));M.value.add(...z,...V,...X)}function be(e,t){return"pain"===e&&0==t}function je(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||V(e.left)).slice(-5)}`;I.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:A(o,e.top);if(f(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(f(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],I.show=!0}function Le(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=u(e);return l>=n&&l<=o}function ke(e,t){const i="pain"===t.type?ee:Z;if(!v(e)||!Le(e.time))return;const n=$(e.time),o=P(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function Se(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=u(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=u(`${V(e)}:00`);return te&&l<u(te)?(B("exceedMin"),!1):!(l>o)||(B("exceedMax"),!1)}function Ye(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=ye.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;Ee()}function Ee(){var e;ge.size&&(null==(e=M.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ge]))),ge.clear(),Me()}function Me(e){fe.clear(),ge.clear(),he.clear(),me.clear(),ve.clear(),ye.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||xe(e,i,t)})))})),we(),[...ge].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ye.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const o=Object.assign({},Y,z.overlap||{}),l=[];he.size&&[...he].forEach((e=>{[...ve].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key,r=t.origin.overlapKey;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let a=r||"koumai";"yemai"===e&&(a=e);const u=r||e;l.push(n(a,{...o[u],...s}))}}}))})),setTimeout((()=>{M.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ge.add(e)}))}))}()}return function(){const i=[];if(i.push(new e.Rect({left:le,top:0,width:re-le-se.strokeWidth,height:ne-se.strokeWidth,fill:"transparent",...se})),ue){const e=ee.originY-oe[0]*K,n=e+de+(oe[0]+oe[1])*K-1,o={...se,stroke:ue},l=t([le,e,G,e],o),r=t([le,n,G,n],o);i.push(l,r)}M.value.add(...i)}(),Me((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const i=P(e.type,e.positionLine.value),n=t([q,i,G,i],e.positionLine);M.value.add(n)}(e))),M.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!C.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){X.point={x:e,y:i},X.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(X.list=[...k]),"pain"===l&&(X.list=[...S]),X.target=n;else{X.target=null,X.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],Q.forEach((t=>{if(!H([...ge],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?ee:Z;i>=e.originY&&i<=e.endY&&X.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:a(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=Se(e);n&&1!==X.list.length||(X.show=!1,1===X.list.length&&n&&B("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ne&&T("click:grid",{x:e,y:t,time:V(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,a=g(i,[...k,...S]);a[`${e.type}`]=e.value,a.changeTime=s(new Date,"yyyy-MM-dd HH:mm"),o&&(a.key=t.origin.key);const u={...t.origin,data:a};T("change",u),Ye(u,"change")}else{const t={data:{time:V(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};T("add",t),Ye(t)}},setPopup:je,isAddPoint:Se,updateData:Ye,redrawPoints:Ee,gridPoints:ge,fixedNoRisePoints:me}}function O(e,t){return e.fixed||!t.value&&0!==t.value}export{M as useCenter};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s}from"../../utils/index.js";import{last as r}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function p(p,d,g,f,m,v,y,w,S,b,Y,x){var j,C;const{getEqualXTypes:L,handleAddPrevent:X,isGridLimit:T}=c(p,g,d),{originY:N,endY:O,originX:V,endX:k,xCellWidth:E,yCellHeight:M,left:A,vitalSignsOriginY:G,painOriginY:I,painHeight:W,iconsWidth:
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s}from"../../utils/index.js";import{last as r}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function p(p,d,g,f,m,v,y,w,S,b,Y,x){var j,C;const{getEqualXTypes:L,handleAddPrevent:X,isGridLimit:T}=c(p,g,d),{originY:N,endY:O,originX:V,endX:k,xCellWidth:E,yCellHeight:M,left:A,vitalSignsOriginY:G,painOriginY:I,painHeight:W,iconsWidth:B,itemList:H,painIndex:R,right:_,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P,painSurplusCell:z,painBorderColor:F}=d;function K(o){var s;if(!(null==o?void 0:o.length))return;const{layout:c}=o[0];let d=B,g=V;"right"===c&&(d=k,g=k+(null!=(s=null==_?void 0:_.width)?s:0));const f=[],m=W&&"right"!==c?o.length-1:o.length,v=(g-d)/m,y=v+(g-d)%m;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:d,style:g,title:f}=n,m=[],v=I.originY-z[0]*M,y=l({width:V-B,height:W+(z[0]+z[1])*M,...D},{value:`${f}`,...i,...g||{}},{left:B,top:v});m.push(y);const w=F?null:t([B,v,V,v],D);w&&m.push(w);const S=[];if(r||h){const{lineXMain:t,textLeft:i}=u(c,B,V-B),l=o.length;o.forEach(((o,u)=>{let c=I.endY-u*M*s;if(0===u&&0===z[1]&&(c=O-5),h&&(!(0===u||u===l-1)||d||0===u&&z[1]>0||u===l-1&&z[0]>0)&&S.push(a(o,n,i,c)),r&&(0!==u||z[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...D,...g});S.push(o)}}))}p.value.add(...m,...S),y.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?d:y+d+(s-1)*v,S="right"===c?0:G.originY,b="right"===c?$:G.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...D}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:L,showNumber:X,position:T,showMaxMinNumber:k,detailedList:E=[],showdetailedScale:A,showRange:H=[]}=o;if(L||X){const{lineXMain:e,lineXSub:t,textLeft:i}=u(T,w,m),n=(j[1]-j[0])/2,l=A&&!E.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):A&&(null==E?void 0:E.length)?E:j,[s=l[0],c=r(l)]=H;l.forEach(((n,r)=>{if(s&&+n<+s)return;if(c&&+n>+c)return;const u=G.endY-r*M*(A?C/2:C),p=[s,c].includes(n);if(X&&(!p||k)){const e=0==r?u-5:u,t=a(n,o,i,e),l=G.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...h(o,r,e,t,u,M,G.originY,l.findIndex((e=>e==c))+1))}))}let _=o.title||"";o.unit&&(_+="\n"+o.unit);let J=G.originY+2;0!==R&&P[0]>0&&(J=N+2),_&&g.push(new e.Text(String(_),{...i,originY:"top",left:x,top:J,textAlign:"center",...o.style}));const q=new e.Group(g,{...n,objectCaching:!1});f.push(q)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&p.value.add(w),w&&w.sendToBack()}B&&function(){const e=JSON.parse(JSON.stringify(H));let t=O;const i=B-A.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:r}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{key:e.key,type:s(e.bigType),_type:e.bigType,isOneLine:e.isOneLine},...d.event}});var u;t-=l.height||30,(u=r).on("moving",(()=>{u.set("originX","center"),function(e){if(e.left>=V&&e.left<=k){e.setCoords();const t="pain"===e.origin.type?I:G;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(u),T(u)?f(u):m.show=!1})),u.on("mouseup:before",(e=>{if(m.show=!1,0===e.e.button&&T(u)){const e=L([...x],u.left,"_type").includes(u.origin._type),t=b(u.left);if(!t||e)e&&t&&X("repeat");else{const e={data:{time:w(u.left),value:S(u.origin.type,u.top),...u.origin.isOneLine?{key:u.origin.key}:{}},...u.origin};g("add",e),Y(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(u)})),p.value.add(l,r)}))}();const Q=A.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==_?void 0:_.width)&&"left"===(null==(j=null==_?void 0:_.yScaleValue)?void 0:j.layout)&&(null==(C=null==_?void 0:_.yScaleValue)?void 0:C.show)&&Q.push(q),R>0&&A.yScaleValue[R].show){const e=A.yScaleValue[R];0===R&&A.yScaleValue.length>1&&Q.unshift(e),R==A.yScaleValue.length-1&&Q.push(e)}const U=Q.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),Z=Q[U];return U>-1&&Q.splice(U,0,{...Z,title:(null==Z?void 0:Z.doubleTitle)||(null==Z?void 0:Z.title)}),K(Q),{drawScaleValue:K}}export{p as useLeft};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,w,
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,b,w,Y,C,j){const x=15,D=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=b.data.grid||{};return~Q.value?e:[0,0]})),H=a((()=>{var e,a;const t=(null==(a=null==(e=b.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===Q.value?t[0]=t[0]+V.value[1]:Q.value>0&&(t[2]=t[2]+V.value[0]),t})),P=a((()=>0===Q.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:Q.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),X=a((()=>{const{top:e}=b.data;return e.date.show&&(e.date.height||x)||0})),L=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||x)||0})),M=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||x)||0})),I=a((()=>{var e,a,t;const{top:l}=b.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),O=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||x)||0})),N=a((()=>{var e;const{bottom:a}=b.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=b.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),R=a((()=>{const{mainYCell:e,subYCell:a,painSubYCell:t=5}=b.data.grid,l=Q.value>0?V.value[1]:V.value[0];return(e-1)*a+t+H.value[0]+H.value[2]+l})),W=a((()=>{var e;const{width:a,right:t=null,top:l}=b.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),$=a((()=>W.value-H.value[1]*z.value)),A=a((()=>{const{top:e,left:a}=b.data;return e.titleWidth+G.value})),T=a((()=>{const{bottom:e=null,height:a}=b.data;if(!e)return a;return a-(e.height||30)})),q=a((()=>{var e;const{top:a}=b.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||x)||0;return X.value+t+l+L.value+M.value+O.value})),z=a((()=>(W.value-A.value)/k.value)),B=a((()=>(T.value-q.value)/R.value)),G=a((()=>{var e,a;const{left:t}=b.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),E=a((()=>{var e,a;const{top:t,grid:l}=b.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=A.value-z.value;const r=t.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(d(c(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=z.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+z.value/2,scaleCell:(l-t)/z.value}}))));return v(o)})),F=a((()=>{var e;return(null==(e=b.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),J=a((()=>{const{left:e}=b.data;return v(e.yScaleValue.filter((e=>e.show)).map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t,isOneLine:o(e)}))))))})),K=a((()=>{const{left:e}=b.data,a=e.yScaleValue.find((e=>"pain"===e.type));if(!a)return 0;const{numberVerticalPosition:t="bottom"}=a;return"center"===t?B.value/2:0})),Q=a((()=>{const{left:e}=b.data,a=e.yScaleValue.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),U=a((()=>{const{painSubYCell:e=5}=b.data.grid;return-1===Q.value?0:B.value*e})),Z=a((()=>{const{left:e}=b.data;return(e.yScaleValue.find((e=>"pain"===e.type))||{}).borderColor})),_=a((()=>{const{left:e}=b.data,a={originY:q.value+V.value[0]*B.value,endY:T.value-V.value[1]*B.value-K.value};return 0===Q.value&&e.yScaleValue.length>1?a.endY=a.originY+U.value-K.value:Q.value===e.yScaleValue.length-1&&(a.originY=a.endY-U.value+K.value),a})),ee=a((()=>{const{left:e}=b.data,a={originY:q.value+H.value[0]*B.value,endY:T.value-H.value[2]*B.value};return 0===Q.value&&e.yScaleValue.length>1?a.originY=_.value.endY+K.value+H.value[0]*B.value:Q.value===e.yScaleValue.length-1&&(a.endY=_.value.originY-H.value[2]*B.value),a})),ae=a((()=>{var e,a;const{top:t,grid:l}=b.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),te=a((()=>{var e;const{left:a,right:t}=b.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>s(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),le=e({canvasWidth:b.data.width,canvasHeight:b.data.height,borderStyle:{...u,...b.data.borderStyle||{}},selectionStyle:b.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:O.value,topList:ae.value,breathingHeight:N.value,hospitalizationDate:b.data.hospitalizationDate,grid:b.data.grid,top:b.data.top,left:b.data.left,right:b.data.right,bottom:b.data.bottom,other:b.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:_.value,vitalSignsOriginY:ee.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:G.value,originX:A.value,originY:q.value,endX:W.value,endXLimit:$.value,endY:T.value,xCellWidth:z.value,yCellHeight:B.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:te.value,config:b.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:P.value,painScalePositionSurplusHeight:K.value,painBorderColor:Z.value}),{computedX:ue,computedY:ie,getXValue:ne,getYValue:re}=i(le);return t((()=>S.value),(e=>{e&&function(){h(S,le);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=m(S,le,w,ue,ie,ne,re,b.addRenderItem,C,j);D.redrawPoints=l,D.clickMenu=u;const{drawScaleValue:o}=p(S,le,w,e,C,ue,ie,ne,re,a,t,i);g(S,le,o),f(S,le),y(S,le,w,ue,ie,r);const{select:s}=n(S,le,w);D.select=s}()}),{immediate:!0}),{propItems:le,...l(D)}}export{S as useTemperatureChart};
|
@@ -83,6 +83,7 @@ export interface IPropItems {
|
|
83
83
|
surplusCell: ILineCoordinate;
|
84
84
|
painSurplusCell: [number, number];
|
85
85
|
painScalePositionSurplusHeight: number;
|
86
|
+
[key: string]: any;
|
86
87
|
}
|
87
88
|
export interface IPoint {
|
88
89
|
time: string;
|
@@ -102,6 +103,7 @@ export interface IDate {
|
|
102
103
|
height?: number;
|
103
104
|
list: Array<string | number>;
|
104
105
|
style?: fabric.ITextOptions;
|
106
|
+
key?: string;
|
105
107
|
[key: string]: any;
|
106
108
|
}
|
107
109
|
export interface ITop {
|
@@ -534,12 +534,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
534
534
|
}>;
|
535
535
|
developMode: boolean;
|
536
536
|
draggable: boolean;
|
537
|
-
|
538
|
-
isFieldSet: boolean;
|
539
|
-
hideExpressionOption: AnyObject[];
|
537
|
+
isHighlightRow: boolean;
|
540
538
|
idx: number;
|
541
539
|
isHighlight: boolean;
|
542
|
-
|
540
|
+
isFieldSet: boolean;
|
541
|
+
fieldDescribeMode: "column" | "tooltip";
|
542
|
+
hideExpressionOption: AnyObject[];
|
543
543
|
}>;
|
544
544
|
EditDialog: import("vue").DefineComponent<{
|
545
545
|
visible: {
|
@@ -563,12 +563,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
563
563
|
}>;
|
564
564
|
developMode: boolean;
|
565
565
|
draggable: boolean;
|
566
|
-
|
567
|
-
isFieldSet: boolean;
|
568
|
-
hideExpressionOption: AnyObject[];
|
566
|
+
isHighlightRow: boolean;
|
569
567
|
idx: number;
|
570
568
|
isHighlight: boolean;
|
571
|
-
|
569
|
+
isFieldSet: boolean;
|
570
|
+
fieldDescribeMode: "column" | "tooltip";
|
571
|
+
hideExpressionOption: AnyObject[];
|
572
572
|
}>;
|
573
573
|
setStyle: typeof setStyle;
|
574
574
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -722,12 +722,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
722
722
|
}>;
|
723
723
|
developMode: boolean;
|
724
724
|
draggable: boolean;
|
725
|
-
|
726
|
-
isFieldSet: boolean;
|
727
|
-
hideExpressionOption: AnyObject[];
|
725
|
+
isHighlightRow: boolean;
|
728
726
|
idx: number;
|
729
727
|
isHighlight: boolean;
|
730
|
-
|
728
|
+
isFieldSet: boolean;
|
729
|
+
fieldDescribeMode: "column" | "tooltip";
|
730
|
+
hideExpressionOption: AnyObject[];
|
731
731
|
}>;
|
732
732
|
isArray: {
|
733
733
|
(value?: any): value is any[];
|
@@ -857,9 +857,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
857
857
|
showSeq: boolean;
|
858
858
|
developMode: boolean;
|
859
859
|
footerFlag: boolean;
|
860
|
+
fieldDescribeMode: "column" | "tooltip";
|
860
861
|
customColumns: FieldSetColumnItem[];
|
861
862
|
showSortPriority: boolean;
|
862
863
|
showHeadFilter: boolean;
|
863
|
-
fieldDescribeMode: "column" | "tooltip";
|
864
864
|
}>;
|
865
865
|
export default _default;
|
@@ -383,11 +383,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
383
383
|
}>;
|
384
384
|
developMode: boolean;
|
385
385
|
draggable: boolean;
|
386
|
-
|
387
|
-
isFieldSet: boolean;
|
388
|
-
hideExpressionOption: AnyObject[];
|
386
|
+
isHighlightRow: boolean;
|
389
387
|
idx: number;
|
390
388
|
isHighlight: boolean;
|
391
|
-
|
389
|
+
isFieldSet: boolean;
|
390
|
+
fieldDescribeMode: "column" | "tooltip";
|
391
|
+
hideExpressionOption: AnyObject[];
|
392
392
|
}>;
|
393
393
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.2.19-beta.
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.2.19-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.19-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.19-beta.
|
3
|
+
"version": "3.2.19-beta.8",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"iOS 7",
|
73
73
|
"last 3 iOS versions"
|
74
74
|
],
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "00ce397190b9ec57557107d98f620bd5ecaf9ae4"
|
76
76
|
}
|