cnhis-design-vue 3.2.4-beta.26 → 3.2.4-beta.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
  2. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  3. package/es/components/classification/src/index.vue.d.ts +3 -0
  4. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  5. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  6. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  7. package/es/components/fabric-chart/src/interface.d.ts +1 -0
  8. package/es/components/field-set/src/FieldColor.vue.d.ts +6 -6
  9. package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
  10. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  11. package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
  12. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +5 -5
  13. package/es/components/field-set/src/components/edit-filter.vue.d.ts +2 -2
  14. package/es/components/form-config/index.d.ts +50 -7070
  15. package/es/components/form-config/src/FormConfig.vue.d.ts +84 -7104
  16. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  17. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
  18. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowClassName.d.ts +2 -0
  19. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useRowClassName.js +1 -0
  20. package/es/env.d.ts +25 -25
  21. package/es/shared/package.json.js +1 -1
  22. package/package.json +2 -2
@@ -1 +1 @@
1
- import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as c,withCtx as r,createCommentVNode as u,Fragment as d,renderList as f,createBlock as p,createTextVNode as m,toDisplayString as g,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as x}from"naive-ui";import{format as C}from"date-fns";import{useState as T}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as w,alt as E}from"../utils/emoji.js";import{MESSAGE_TYPE as I}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],U={class:"btn-box"},X=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var z=t({__name:"ChatFooter",setup(t){const z=e(),B=e(""),{state:R,stompClient:q}=T(),{setCurrentSessionItem:P}=b(R),Q=e(!1);function V(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Z()))}function W(){var t,e;B.value=(null==(e=null==(t=z.value)?void 0:t.innerText)?void 0:e.trim())||""}async function Y(t,e){const{file:n,name:s}=t.file,i=new FormData;i.append("sender",R.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");$({chatMessageType:e,msg:e===I.FILE?s:a,url:a})}function Z(){if(!(B.value.length>2e3))return B.value?void $({msg:B.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function $(t){const{chatMessageType:e=I.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===I.FILE&&(i.fileUrl=s),[I.TEXT,I.BLEND].includes(e)&&(z.value.innerHTML="",B.value="");const a=C(new Date,"yyyy-MM-dd HH:mm:ss");R.currentMsg={content:i,sender:R.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},R.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i,sortTime:a});try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:R.currentSessionItem.receiver})),R.currentMsg={...R.currentMsg,fail:!1}}catch(t){R.currentMsg={...R.currentMsg,fail:!0}}finally{R.currentMsg={...R.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(R).id?"default":"not-allowed"})},[l("div",S,[c(o(v),{show:Q.value,"onUpdate:show":e[0]||(e[0]=t=>Q.value=t),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:r((()=>[j])),default:r((()=>[l("div",L,[u(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,f(o(w),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),p(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:r((()=>[l("i",{onClick:()=>function(t){Q.value=!1,$({chatMessageType:I.EMOJI,msg:t})}(e)},[l("img",{src:t},null,8,H)],8,D)])),default:r((()=>[m(" "+g(o(E)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1},8,["show"]),l("span",{onClick:e[1]||(e[1]=()=>$({chatMessageType:o(I).EMOJI,msg:0}))},J),c(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[2]||(e[2]=t=>Y(t,o(I).IMAGE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),c(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[3]||(e[3]=t=>Y(t,o(I).FILE))},{default:r((()=>[c(o(k),{abstract:""},{default:r((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:z,class:"input-box",contenteditable:"",onKeydown:V,onInput:W},null,544),[[h,o(R).id]]),l("div",U,[X,c(o(x),{type:"primary",round:"",disabled:!B.value,onClick:Z},{default:r((()=>[m("发送")])),_:1},8,["disabled"])])],4)),[[h,o(R).id]])}});export{z as default};
1
+ import{defineComponent as t,ref as e,withDirectives as n,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as o,createElementVNode as l,createVNode as r,withCtx as c,createCommentVNode as u,Fragment as d,renderList as f,createBlock as p,createTextVNode as m,toDisplayString as g,vShow as h}from"vue";import{NPopover as v,NTooltip as y,NUpload as M,NUploadTrigger as k,NButton as x}from"naive-ui";import{format as C}from"date-fns";import{useState as T}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{images as w,alt as E}from"../utils/emoji.js";import{MESSAGE_TYPE as I}from"../constants/index.js";import{uploadFileApi as _}from"../api/index.js";const S={class:"tool-box"},j=l("span",null,[l("i",{class:"chat--iconfont chat--icon-face"})],-1),L={class:"emoji-box"},F=l("span",null,"默认表情",-1),K={class:"list-box"},D=["onClick"],H=["src"],J=[l("i",{class:"chat--iconfont chat--icon-good"},null,-1)],N=["onClick"],O=[l("i",{class:"chat--iconfont chat--icon-image"},null,-1)],A=["onClick"],G=[l("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],U={class:"btn-box"},X=l("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var z=t({__name:"ChatFooter",setup(t){const z=e(),B=e(""),{state:R,stompClient:q}=T(),{setCurrentSessionItem:P}=b(R),Q=e(!1);function V(t){["Enter"].includes(t.key)&&(function(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}(t)||(t.preventDefault(),Z()))}function W(){var t,e;B.value=(null==(e=null==(t=z.value)?void 0:t.innerText)?void 0:e.trim())||""}async function Y(t,e){const{file:n,name:s}=t.file,i=new FormData;i.append("sender",R.userInfo.id),i.append("file",n);const a=await _(i);if(!a)return console.log("上传失败");$({chatMessageType:e,msg:e===I.FILE?s:a,url:a})}function Z(){if(!(B.value.length>2e3))return B.value?void $({msg:B.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function $(t){const{chatMessageType:e=I.TEXT,msg:n,url:s}=t,i={msg:n,chatMessageType:e};e===I.FILE&&(i.fileUrl=s),[I.TEXT,I.BLEND].includes(e)&&(z.value.innerHTML="",B.value="");const a=C(new Date,"yyyy-MM-dd HH:mm:ss");R.currentMsg={content:i,sender:R.userInfo.id,id:"",sendTime:a,sending:!0,fail:!1},R.isAppendMsg=!0,P({lastMessageSendTime:a,lastMessage:i,sortTime:a});try{q.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:R.currentSessionItem.receiver})),R.currentMsg={...R.currentMsg,fail:!1}}catch(t){R.currentMsg={...R.currentMsg,fail:!0}}finally{R.currentMsg={...R.currentMsg,sending:!1}}}return(t,e)=>n((s(),i("section",{class:"chat-footer",style:a({cursor:o(R).id?"default":"not-allowed"})},[l("div",S,[r(o(v),{show:Q.value,"onUpdate:show":e[0]||(e[0]=t=>Q.value=t),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:c((()=>[j])),default:c((()=>[l("div",L,[u(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),F,l("div",K,[(s(!0),i(d,null,f(o(w),((t,e)=>(s(),i(d,{key:e},[e>0?(s(),p(o(y),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:c((()=>[l("i",{onClick:()=>function(t){Q.value=!1,$({chatMessageType:I.EMOJI,msg:t})}(e)},[l("img",{src:t},null,8,H)],8,D)])),default:c((()=>[m(" "+g(o(E)[e-1]||"微笑"),1)])),_:2},1024)):u("v-if",!0)],64)))),128))])])])),_:1},8,["show"]),l("span",{onClick:e[1]||(e[1]=()=>$({chatMessageType:o(I).EMOJI,msg:0}))},J),r(o(M),{abstract:"",multiple:"",accept:"image/*",onChange:e[2]||(e[2]=t=>Y(t,o(I).IMAGE))},{default:c((()=>[r(o(k),{abstract:""},{default:c((({handleClick:t})=>[l("span",{onClick:t},O,8,N)])),_:1})])),_:1}),r(o(M),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:e[3]||(e[3]=t=>Y(t,o(I).FILE))},{default:c((()=>[r(o(k),{abstract:""},{default:c((({handleClick:t})=>[l("span",{onClick:t},G,8,A)])),_:1})])),_:1})]),n(l("div",{ref_key:"inputRef",ref:z,class:"input-box",contenteditable:"",onKeydown:V,onInput:W},null,544),[[h,o(R).id]]),l("div",U,[X,r(o(x),{type:"primary",round:"",disabled:!B.value,onClick:Z},{default:c((()=>[m("发送")])),_:1},8,["disabled"])])],4)),[[h,o(R).id]])}});export{z as default};
@@ -175,6 +175,9 @@ declare const _default: import("vue").DefineComponent<{
175
175
  modelValue: unknown[];
176
176
  componentData: Record<string, any>;
177
177
  } & {
178
+ /**
179
+ * 改变弹窗大小
180
+ */
178
181
  itemKey?: string | Function | undefined;
179
182
  }>, {
180
183
  move: Function;
@@ -699,6 +699,9 @@ declare const _default: import("vue").DefineComponent<{
699
699
  handleInitConditions: () => Promise<void>;
700
700
  validate: () => Promise<unknown>;
701
701
  saveAdd: () => void;
702
+ /**
703
+ * 改变展示方式
704
+ */
702
705
  cancelSaveAdd: () => void;
703
706
  checkActionList: () => boolean;
704
707
  NSpin: any;
@@ -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 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
+ 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{format as u}from"date-fns";import{isOneLine as a,getType as c,isOverlapPoint as d,getFloorNumber as p,isValidValue as f,setOtherType as h,getTime as v,isEffectiveNode as g,getIndex as m,deleteProperty as y}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as L,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as E}from"@vueuse/shared";function Y(Y,$,O,T,C,P,A,I,R,V){r(Y,$);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(Y,O,$),{createShadowLines:z}=t(),{left:F,xScaleList:_,xCellWidth:W,yCellHeight:q,originX:G,endX:B,originY:J,endY:K,itemList:N,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie}=$,ne=new Set,oe=["xinmai","mai"],le=new Map,se=new Set,re=new Set,ue=new Set,ae=x(F.yScaleValue);function ce(){[...ue].forEach((e=>{null==e||e.bringToFront()}))}function de(t){var o;const l=ae.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ne.size&&Y.value.remove(...ne),ne.clear(),le.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=le.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 le)t.push(e[1]),e[0]===oe[0]&&e[1].forEach((e=>{(le.get(oe[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=j(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){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(ue).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)===oe[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&&Y.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(...z(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),ne.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...r,originX:"center"});e.push(n),ne.add(n)}))}Y.value.add(...e)}ne.add(l),Y.value.add(l)}))}}function pe(){var e;const t=ae.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({},S,F.overlap||{}),l=[];se.size&&[...se].forEach((e=>{[...re].forEach((t=>{if(t.origin&&d(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((()=>{Y.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ue.add(e)}))}))}function fe(e,t,r){var u;const{type:c,riseStyle:d={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:m={},pacemaker:y={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},dataList:k=[],list:L=[]}=r,{type:S,textStyle:E,showConnectLine:$=!1}=j,P=[],I=[],V=[];let X=null;if(null==(u=e.list)||u.forEach(((u,j)=>{const D=a(c)?k.find((e=>e.key===u.key)):e,z=me(u,r),F=e.list[j+1],_=F?me(F,r):void 0,G=F?a(c)?k.find((e=>e.key===F.key)):e:{},{title:B=""}=D;if("脉搏"===B&&"脉搏"!==G.title||"脉搏"!==B&&"脉搏"===G.title||!z||!_||p(z[0],1)!==p(_[0],1))z&&X&&(z[0]=X),X=null;else{const e=z[0]-W/2;z[0]=e+W/4,_[0]=X=z[0]+W/2}const J={};J.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return V.push(s),{obj:s,top:-q}}(z,u,D),function(e,t,r,u){var a,p;if(!["temperature","pain"].includes(c))return;if(!(null==e?void 0:e.length)&&("pain"===c||"temperature"===c&&!ge(t.time)))return;const{lineAttr:h={}}=r,{value:y}=u,x=T(t.time);let b,j,w,k,S;if(t.noRise&&v.show){const i=M(v,t)?C(c,L,35):(null==e?void 0:e[1])||0;if(v.text)w=l([x,M(v,t)?i:i+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),t.value||ue.add(w);else if(t.value){w=s([x,i,i+2*q],{...v.style})}w&&V.push(w)}if((null==e?void 0:e[1])&&(t.rise&&d.show&&d.text&&(k=l([x,e[1]-(y?q:0)-5],{value:d.text.split("").join("\n"),originY:"bottom",...d.style}),V.push(k)),t.verified&&(S=l([x,e[1]-(y?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),V.push(S)),f(t.physicsReduce)||f(t.drugReduce))){const l=C(c,L,null!=(a=t.physicsReduce)?a:t.drugReduce),s=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+W/2:x;b=i([...e,s,l],{...h,...m.line,...n}),j=o((null==(p=null==m?void 0:m.point)?void 0:p.type)||"circle",{left:s,top:l,...m.point,...n,originY:l===ie?"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*q,isFixed:M(v,t)},riseText:{obj:k,top:(y?-q:0)-5},verifiedText:{obj:S,top:(y?-q:0)-5},reducePoint:{obj:j,type:"reduce"}})}(z,u,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*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/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]+q/2+u.height:e[1]+q;a=l([e[0],t],i),V.push(a)}+t.value<r&&(a=l([e[0],e[1]-q],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*q;d=s([e[0],t,i],{...w.style})}V.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:a,top:-q},belowMinValue:{obj:d,top:w.text?5:2*q,moveHide:!0}})}(z,u,D,J),function(n,l,s,u,a,d){let p,f;const{pointAttr:v={},lineAttr:g={},title:m="",key:x,type:b="circle"}=a,j=e.list[u+1],w=he(c,e.list[u].value),k=l&&he(c,j.value);if(n&&l&&!s.breakpoint&&(!w&&!k||$)){f=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});V.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const L=s.pacemakerShow&&"pulse"==c?y.value:w&&"number"===S?0:b,M=I[u-1],T={origin:{data:s,title:m,key:x||"",unit:r.unit,type:c,_type:h(m,c),dataIndex:t,index:u},leftLine:M,rightLine:f,otherObj:d,...s.pacemakerShow&&"pulse"==c?y.style:v,lockMovementX:!0,...H(),...w?{selectable:!1,evented:!1,..."number"===S?E:{}}:{}};n&&(M?T.leftLine.set("x2",n[0]):T.leftLine=null,p=o(L,{left:n[0],top:w?n[1]-5:n[1],...T}));I.push(f),p&&(x===oe[1]?se.add(p):re.add(p),function(e){Q.hovered&&(e.on("mouseover",(()=>{ve(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?Z:U;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide: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&&(Y.value.remove(i),delete e.otherObj.obj)))})),de(e)}(e),Q.hovered&&ve(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}};Y.value.discardActiveObject(),O("change",n),xe(n,"change")}}))}(p),P.push(p),ue.add(p))}(z,_,u,j,D,J)})),"pulse"===c){const{key:t}=e;let i=null;le.set(t,P.map(((e,t,n)=>{var o,l;const s=n[t+1];if(s&&p(e.left,1)===p(s.left,1)){const t=e.left-W/2;e.set("left",t+W/4),null==(o=e.rightLine)||o.set("x1",e.left),i=e.left+W/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=I.filter((e=>e));Y.value.add(...D,...P,...V)}function he(e,t){return"pain"===e&&0==t}function ve(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;R.point={x:e.left,y:e.top};let s=`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`;R.list=[function(){const{drugReduce:r,physicsReduce:u}=l||{},a="hover"===t?l.value:A(o,e.top);if(f(r))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;if(f(u))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),s],R.show=!0}function ge(e){const[t]=_,i=j(_),n=t.start,o=i.end,l=v(e);return l>=n&&l<=o}function me(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ge(e.time))return;const n=T(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=v(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=v(`${P(e)}:00`);return ee&&l<v(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function xe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ae.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=m(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;be()}function be(){var e;ue.size&&(null==(e=Y.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}([...ue]))),le.clear(),ue.clear(),se.clear(),re.clear(),ae.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||fe(t,i,e)}))})),de(),ce(),pe()}return le.clear(),se.clear(),re.clear(),ae.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=C(e.type,e.list,e.positionLine.value),n=i([G,t,B,t],e.positionLine);Y.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||fe(t,i,e)}))})),de(),ce(),pe(),Y.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!$.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=B&&t>=J&&t<=K){V.point={x:e,y:t},V.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(V.list=[...k]),"pain"===o&&(V.list=[...L]),V.target=i;else{V.target=null,V.list=["新增节点"],N.forEach((i=>{if(!X([...ue],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&V.list.push({renderItem:I?I(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:c(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=ye(e);i&&1!==V.list.length||(V.show=!1,1===V.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=B&&t>0&&t<ie&&O("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...k,...L]);s[`${e.type}`]=e.value,s.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};O("change",r),xe(r,"change")}else{const t={data:{time:P(e.pointer.x),value:A(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};O("add",t),xe(t)}},setPopup:ve,isAddPoint:ye,updateData:xe,redrawPoints:be,gridPoints:ue}}function M(e,t){return"fixed"===e.position||!t.value&&0!==t.value}export{Y 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"@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
+ 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,isOneLine as r}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 p(p,d,g,f,m,v,y,w,S,b,Y,x){var j,C;const{getEqualXTypes:X,handleAddPrevent:N,isGridLimit:T}=c(p,g,d),{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,painSurplusCell:z}=d;function F(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let c=H,d=k;"right"===r&&(c=E,d=E+(null!=(s=null==B?void 0:B.width)?s:0));const g=[],f=A&&"right"!==r?o.length-1:o.length,m=(d-c)/f,v=m+(d-c)%f;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=R.originY-z[0]*W,v=l({width:k-H,height:A+(z[0]+z[1])*W,...D},{value:`${f}`,...i,...g||{}},{left:H,top:m}),y=t([H,m,k,m],D),w=[];if(r||h){const{lineXMain:t,textLeft:i}=u(c,H,k-H),l=o.length;o.forEach(((o,u)=>{let c=R.endY-u*W*s;if(0===u&&0===z[1]&&(c=L-5),h&&(!(0===u||u===l-1)||d||0===u&&z[1]>0||u===l-1&&z[0]>0)&&w.push(a(o,n,i,c)),r&&(0!==u||z[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...D,...g});w.push(o)}}))}p.value.add(y,v,...w),v.sendToBack()}(o);const d=[],f=0===s?v:m,y=0===s?c:v+c+(s-1)*m,w="right"===r?0:O.originY,S="right"===r?$:O.endY,b=s>0?t([y,w,y,S],{objectCaching:!1,...D}):null;b&&d.push(b);const Y=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[e,t]=G,{lineXMain:i,lineXSub:n,textLeft:l}=u(N,y,f),s=(x[1]-x[0])/2,r=M&&!E.length?x.reduce(((e,t,i)=>{const n=e[e.length-1];return 0===i?[t]:e.concat([n+s,n+2*s])}),[]):M&&(null==E?void 0:E.length)?E:x,c=r.length;r.forEach(((s,r)=>{if(e&&+s<e)return;if(t&&+s>t)return;const u=O.endY-r*W*(M?j/2:j);if(X&&(!(0===r||r===c-1)||T)&&e!==+s){const e=0==r?u-5:u,t=a(s,o,l,e),i=O.originY+t.height/2;e<i&&t.set({top:i}),d.push(t)}d.push(...h(o,r,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&&d.push(new e.Text(String(I),{...i,left:Y,top:B,textAlign:"center",...o.style}));const J=new e.Group(d,{...n,objectCaching:!1});g.push(J)}));const y=g.length>0?new e.Group([...g],{...n,objectCaching:!1}):null;y&&p.value.add(y),y&&y.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(I));let t=L;const i=H-G.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{type:s(e.bigType),_type:e.bigType},...d.event}});var a;t-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(e){if(e.left>=k&&e.left<=E){e.setCoords();const t="pain"===e.origin.type?R:O;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(a),T(a)?f(a):m.show=!1})),a.on("mouseup:before",(e=>{if(m.show=!1,0===e.e.button&&T(a)){const e=X([...x],a.left,"_type").includes(a.origin._type),t=b(a.left);if(!t||e)e&&t&&N("repeat");else{const e={data:{time:w(a.left),value:S(a.origin.type,a.top),...r(a.origin.type)?{key:a.origin.key}:{}},...a.origin};g("add",e),Y(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(a)})),p.value.add(l,u)}))}();const K=G.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==B?void 0:B.width)&&"left"===(null==(j=null==B?void 0:B.yScaleValue)?void 0:j.layout)&&(null==(C=null==B?void 0:B.yScaleValue)?void 0:C.show)&&K.push(q),_>0&&G.yScaleValue[_].show){const e=G.yScaleValue[_];0===_&&G.yScaleValue.length>1&&K.unshift(e),_==G.yScaleValue.length-1&&K.push(e)}const Q=K.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),U=K[Q];return Q>-1&&K.splice(Q,0,{...U,title:(null==U?void 0:U.doubleTitle)||(null==U?void 0:U.title)}),F(K),p.value.add(new e.Rect({left:H,top:0,width:J-H-D.strokeWidth,height:$-D.strokeWidth,fill:"transparent",...D})),{drawScaleValue:F}}export{p as useLeft};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,watch 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 r}from"../useEvent.js";import{setOtherType as n,getFloorNumber as o}from"../../utils/index.js";import{flatten as s}from"lodash-es";import{format as d,addDays as v}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,b,w,Y,C){const x=15,D=e(),j=e(),V=e(),H=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),X=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||x)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||x)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=t((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=t((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),O=t((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+H.value[0]+H.value[2]})),W=t((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=t((()=>W.value-H.value[2]*T.value)),k=t((()=>{const{top:e,left:t}=S.data;return e.titleWidth+B.value})),G=t((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=t((()=>G.value-H.value[2]*A.value)),q=t((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||x)||0;return X.value+a+l+L.value+I.value})),z=t((()=>q.value+H.value[0]*A.value)),T=t((()=>(W.value-k.value)/N.value)),A=t((()=>(G.value-q.value)/O.value)),B=t((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),E=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-T.value;const n=a.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(d(v(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=T.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+T.value/2,scaleCell:(l-a)/T.value}}))));return s(o)})),F=t((()=>re("breathe"))),J=t((()=>re("pulse"))),K=t((()=>re("temperature"))),Q=t((()=>re("pain"))),U=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Z=t((()=>{const{left:e}=S.data;return s(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:n(t.title,e.type),unit:e.unit,dataIndex:a}))))))})),_=t((()=>{var e,t;const{left:a}=S.data,l=a.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(t=null==(e=a.yScaleValue[l].dataList)?void 0:e[0])?void 0:t.show)?l:-1})),ee=t((()=>{const{grid:e}=S.data;return-1===_.value?0:A.value*e.subYCell})),te=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.endY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.originY=R.value-ee.value),t})),ae=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.originY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.endY=R.value-ee.value),t})),le=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),ue=t((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.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 t=e[e.length-1];return t?e.concat([t+1,t+2]):e.concat([92])}),[]):[],t=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:t,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ie=a({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:I.value,xScalevalueHeight:M.value,topList:le.value,breathingHeight:P.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:_.value,painHeight:ee.value,painOriginY:te.value,vitalSignsOriginY:ae.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:B.value,originX:k.value,originY:q.value,originYLimit:z.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,breatheYCell:F.value,pulseYCell:J.value,temperatureYCell:K.value,painYCell:Q.value,event:U.value,itemList:Z.value,getRightInfo:ue.value,config:S.data.config||{},surplusCell:H.value});function re(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?A.value/((l[1]-l[0])/a.spaceGridNumber):0}const{computedX:ne,computedY:oe,getXValue:se,getYValue:de}=i(ie);return l((()=>y.value),(e=>{e&&function(){c(y,ie);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=g(y,ie,b,ne,oe,se,de,S.addRenderItem,Y,C);j.value=l,V.value=u;const{drawScaleValue:n}=h(y,ie,b,e,Y,ne,oe,se,de,t,a,i);p(y,ie,n),m(y,ie),f(y,ie,b,ne);const{select:o}=r(y,ie,b);D.value=o}()}),{immediate:!0}),{propItems:ie,redrawPoints:j,select:D,clickMenu:V}}export{y as useTemperatureChart};
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{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as r}from"../useEvent.js";import{setOtherType as n,getFloorNumber as o}from"../../utils/index.js";import{flatten as s}from"lodash-es";import{format as v,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as h}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,b,w,Y,C){const x=15,D=e(),j=e(),V=e(),H=a((()=>{const{painSurplusCell:e=[0,0]}=S.data.grid||{};return~ee.value?e:[0,0]})),X=a((()=>{const{surplusCell:e=[0,0,0,0]}=S.data.grid||{};return 0===ee.value?e[0]=e[0]+H.value[0]:ee.value>0&&(e[2]=e[2]+H.value[1]),e})),L=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),I=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||x)||0})),M=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||x)||0})),P=a((()=>{var e,a,t;const{top:l}=S.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)})),N=a((()=>{var e;const{bottom:a}=S.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),O=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+X.value[1]+X.value[3]})),W=a((()=>{const{grid:e}=S.data,a=ee.value>0?H.value[0]:0;return e.mainYCell*e.subYCell+X.value[0]+X.value[2]+a})),$=a((()=>{var e;const{width:a,right:t=null,top:l}=S.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),k=a((()=>$.value-X.value[1]*A.value)),G=a((()=>{const{top:e,left:a}=S.data;return e.titleWidth+E.value})),R=a((()=>{const{bottom:e=null,height:a}=S.data;if(!e)return a;return a-(e.height||30)})),q=a((()=>R.value-X.value[2]*B.value)),z=a((()=>{var e;const{top:a}=S.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||x)||0;return L.value+t+l+I.value+M.value})),T=a((()=>z.value+X.value[0]*B.value)),A=a((()=>($.value-G.value)/O.value)),B=a((()=>(R.value-z.value)/W.value)),E=a((()=>{var e,a;const{left:t}=S.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),F=a((()=>{var e,a;const{top:t,grid:l}=S.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 r=G.value-A.value;const n=t.date.startDate||v(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(n):e.concat(v(d(new Date(n.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{r+=A.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:r,center:r+A.value/2,scaleCell:(l-t)/A.value}}))));return s(o)})),J=a((()=>ne("breathe"))),K=a((()=>ne("pulse"))),Q=a((()=>ne("temperature"))),U=a((()=>ne("pain"))),Z=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),_=a((()=>{const{left:e}=S.data;return s(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:n(a.title,e.type),unit:e.unit,dataIndex:t}))))))})),ee=a((()=>{var e,a;const{left:t}=S.data,l=t.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(a=null==(e=t.yScaleValue[l].dataList)?void 0:e[0])?void 0:a.show)?l:-1})),ae=a((()=>{const{grid:e}=S.data;return-1===ee.value?0:B.value*e.subYCell})),te=a((()=>{const{left:e}=S.data,a={originY:T.value,endY:q.value};return 0===ee.value&&e.yScaleValue.length>1?a.endY=T.value+ae.value:ee.value===e.yScaleValue.length-1&&(a.originY=q.value-ae.value),a})),le=a((()=>{const{left:e}=S.data,a={originY:T.value,endY:q.value};return 0===ee.value&&e.yScaleValue.length>1?a.originY=T.value+ae.value+H.value[1]*B.value:ee.value===e.yScaleValue.length-1&&(a.endY=q.value-ae.value-H.value[1]*B.value),a})),ue=a((()=>{var e,a;const{top:t,grid:l}=S.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))})),ie=a((()=>{var e;const{left:a,right:t}=S.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=>o(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),re=t({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:L.value,hospitalDaysHeight:I.value,operationDaysHeight:M.value,xScalevalueHeight:P.value,topList:ue.value,breathingHeight:N.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:ee.value,painHeight:ae.value,painOriginY:te.value,vitalSignsOriginY:le.value,gridXNumber:O.value,gridYNumber:W.value,iconsWidth:E.value,originX:G.value,originY:z.value,originYLimit:T.value,endX:$.value,endXLimit:k.value,endY:R.value,xCellWidth:A.value,yCellHeight:B.value,xScaleList:F.value,breatheYCell:J.value,pulseYCell:K.value,temperatureYCell:Q.value,painYCell:U.value,event:Z.value,itemList:_.value,getRightInfo:ie.value,config:S.data.config||{},surplusCell:X.value,painSurplusCell:H.value});function ne(e){const{yScaleValue:a}=S.data.left,t=a.find((a=>a.type===e)),l=(null==t?void 0:t.list)||[];return l.length?B.value/((l[1]-l[0])/t.spaceGridNumber):0}const{computedX:oe,computedY:se,getXValue:ve,getYValue:de}=i(re);return l((()=>y.value),(e=>{e&&function(){c(y,re);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i}=g(y,re,b,oe,se,ve,de,S.addRenderItem,Y,C);j.value=l,V.value=u;const{drawScaleValue:n}=p(y,re,b,e,Y,oe,se,ve,de,a,t,i);h(y,re,n),m(y,re),f(y,re,b,oe);const{select:o}=r(y,re,b);D.value=o}()}),{immediate:!0}),{propItems:re,redrawPoints:j,select:D,clickMenu:V}}export{y as useTemperatureChart};
@@ -81,6 +81,7 @@ export interface IPropItems {
81
81
  getRightInfo: AnyObject;
82
82
  config: AnyObject;
83
83
  surplusCell: ILineCoordinate;
84
+ painSurplusCell: [number, number];
84
85
  }
85
86
  export interface IPoint {
86
87
  time: string;
@@ -437,9 +437,9 @@ declare const _default: import("vue").DefineComponent<{
437
437
  requiredDisable: boolean;
438
438
  hide: boolean;
439
439
  }>;
440
+ isHighlightRow: boolean;
440
441
  idx: number;
441
442
  isHighlight: boolean;
442
- isHighlightRow: boolean;
443
443
  }>;
444
444
  EditDialog: import("vue").DefineComponent<{
445
445
  visible: {
@@ -480,11 +480,11 @@ declare const _default: import("vue").DefineComponent<{
480
480
  onConfirm?: ((...args: any[]) => any) | undefined;
481
481
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
482
482
  }>>;
483
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
483
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
484
484
  formRef: import("vue").Ref<any>;
485
485
  conditionRef: import("vue").Ref<any>;
486
486
  filterVisible: import("vue").Ref<boolean>;
487
- title: import("vue").ComputedRef<"修改" | "新增" | "过滤条件">;
487
+ title: import("vue").ComputedRef<"新增" | "修改" | "过滤条件">;
488
488
  model: {
489
489
  name: string;
490
490
  color: string;
@@ -1352,7 +1352,7 @@ declare const _default: import("vue").DefineComponent<{
1352
1352
  onConfirm?: ((...args: any[]) => any) | undefined;
1353
1353
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
1354
1354
  }>>;
1355
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
1355
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
1356
1356
  conditionRef: import("vue").Ref<any>;
1357
1357
  onConfirm: () => void;
1358
1358
  onClose: () => void;
@@ -1598,7 +1598,7 @@ declare const _default: import("vue").DefineComponent<{
1598
1598
  }>>, {
1599
1599
  data: AnyObject;
1600
1600
  }>;
1601
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1601
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1602
1602
  visible: {
1603
1603
  type: BooleanConstructor;
1604
1604
  default: boolean;
@@ -1614,7 +1614,7 @@ declare const _default: import("vue").DefineComponent<{
1614
1614
  visible: boolean;
1615
1615
  model: AnyObject;
1616
1616
  }>;
1617
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1617
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1618
1618
  visible: {
1619
1619
  type: BooleanConstructor;
1620
1620
  default: boolean;
@@ -458,9 +458,9 @@ declare const _default: import("vue").DefineComponent<{
458
458
  requiredDisable: boolean;
459
459
  hide: boolean;
460
460
  }>;
461
+ isHighlightRow: boolean;
461
462
  idx: number;
462
463
  isHighlight: boolean;
463
- isHighlightRow: boolean;
464
464
  }>;
465
465
  setStyle: typeof setStyle;
466
466
  }, 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<{
@@ -555,9 +555,9 @@ declare const _default: import("vue").DefineComponent<{
555
555
  requiredDisable: boolean;
556
556
  hide: boolean;
557
557
  }>;
558
+ isHighlightRow: boolean;
558
559
  idx: number;
559
560
  isHighlight: boolean;
560
- isHighlightRow: boolean;
561
561
  }>;
562
562
  isArray: {
563
563
  (value?: any): value is any[];
@@ -279,8 +279,8 @@ declare const _default: import("vue").DefineComponent<{
279
279
  requiredDisable: boolean;
280
280
  hide: boolean;
281
281
  }>;
282
+ isHighlightRow: boolean;
282
283
  idx: number;
283
284
  isHighlight: boolean;
284
- isHighlightRow: boolean;
285
285
  }>;
286
286
  export default _default;
@@ -40,11 +40,11 @@ declare const _default: import("vue").DefineComponent<{
40
40
  onConfirm?: ((...args: any[]) => any) | undefined;
41
41
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
42
42
  }>>;
43
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
43
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
44
44
  formRef: import("vue").Ref<any>;
45
45
  conditionRef: import("vue").Ref<any>;
46
46
  filterVisible: import("vue").Ref<boolean>;
47
- title: import("vue").ComputedRef<"修改" | "新增" | "过滤条件">;
47
+ title: import("vue").ComputedRef<"新增" | "修改" | "过滤条件">;
48
48
  model: {
49
49
  name: string;
50
50
  color: string;
@@ -912,7 +912,7 @@ declare const _default: import("vue").DefineComponent<{
912
912
  onConfirm?: ((...args: any[]) => any) | undefined;
913
913
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
914
914
  }>>;
915
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
915
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
916
916
  conditionRef: import("vue").Ref<any>;
917
917
  onConfirm: () => void;
918
918
  onClose: () => void;
@@ -1158,7 +1158,7 @@ declare const _default: import("vue").DefineComponent<{
1158
1158
  }>>, {
1159
1159
  data: AnyObject;
1160
1160
  }>;
1161
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1161
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1162
1162
  visible: {
1163
1163
  type: BooleanConstructor;
1164
1164
  default: boolean;
@@ -1174,7 +1174,7 @@ declare const _default: import("vue").DefineComponent<{
1174
1174
  visible: boolean;
1175
1175
  model: AnyObject;
1176
1176
  }>;
1177
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1177
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1178
1178
  visible: {
1179
1179
  type: BooleanConstructor;
1180
1180
  default: boolean;
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
23
23
  onConfirm?: ((...args: any[]) => any) | undefined;
24
24
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
25
25
  }>>;
26
- emit: (event: "confirm" | "update:visible", ...args: any[]) => void;
26
+ emit: (event: "update:visible" | "confirm", ...args: any[]) => void;
27
27
  conditionRef: import("vue").Ref<any>;
28
28
  onConfirm: () => void;
29
29
  onClose: () => void;
@@ -269,7 +269,7 @@ declare const _default: import("vue").DefineComponent<{
269
269
  }>>, {
270
270
  data: AnyObject;
271
271
  }>;
272
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("confirm" | "update:visible")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
272
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:visible" | "confirm")[], "confirm" | "update:visible", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
273
273
  visible: {
274
274
  type: BooleanConstructor;
275
275
  default: boolean;