cnhis-design-vue 3.2.15-beta.17 → 3.2.15-beta.20

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.
Files changed (33) hide show
  1. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  2. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +1 -0
  3. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  4. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  5. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -2
  6. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  7. package/es/components/form-config/index.d.ts +1021 -1
  8. package/es/components/form-config/src/FormConfig.vue.d.ts +1021 -1
  9. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +0 -1
  10. package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
  11. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +1019 -0
  12. package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
  13. package/es/components/form-config/src/constants/index.js +1 -1
  14. package/es/components/form-config/style/index.css +1 -1
  15. package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
  16. package/es/components/iho-chat/index.d.ts +232 -57
  17. package/es/components/iho-chat/src/Index.vue.d.ts +232 -57
  18. package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +33 -8
  19. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  20. package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +33 -8
  21. package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +33 -8
  22. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +99 -24
  23. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +33 -8
  24. package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +33 -8
  25. package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +33 -8
  26. package/es/components/iho-chat/style/iconfont.ttf +0 -0
  27. package/es/components/iho-chat/style/index.css +1 -1
  28. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  29. package/es/components/index.css +1 -1
  30. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  31. package/es/shared/package.json.js +1 -1
  32. package/es/shared/types/business.d.ts +4 -0
  33. package/package.json +2 -2
@@ -1 +1 @@
1
- import{isFunction as a}from"lodash-es";import{ensureUID2IdCard as t}from"./utils/ensureUID2IdCard.js";import{TRANS_CMD as e,defaultInsuranceParams as s}from"./constants/index.js";import r from"./insuranceSDK.js";import{ReadHealthCard as n}from"./utils/readHealthCard.js";let i=null;const c=class{constructor(a){if(this.options=a,this.loading=!1,this.readHealthCardDialog=new n,i)return i;i=this,this.insurance=new r({selfWindow:a.selfWindow})}get basicParamsRes(){return a(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(a={}){return new c(a)}static destroy(){null==i||i.destroy(),i=null}destroy(){this.insurance.destroy()}createParams(a,t){return{transcmd:a,...this.basicParamsRes,...t}}checkLoading(){if(this.loading)return Promise.reject("请勿重复操作")}async checkResCodeAndLoading(a){try{this.loading=!0;const t=await a;return 3===t.returncode||"3"===t.returncode?Promise.reject(`${t.returnmsg||"操作失败"}`):t.returndata}finally{this.loading=!1}}async readHealthCard(a,t){return await this.checkLoading(),this.readHealthCardDialog.show({instance:a,...t})}async readIdCard(a={},s){await this.checkLoading();const r=this.createParams(e.ID_CARD_READ,{transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"2",...a.transdata}}),n=await this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(r));return(null==n?void 0:n.cardinfo)&&s&&await t(n.cardinfo,s),n}async readMemberCard(a={}){await this.checkLoading();const t=this.createParams(e.MEMBER_CARD_READ,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async writeMemberCard(a={}){await this.checkLoading();const t=this.createParams(e.MEMBER_CARD_WRITE,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async readInsuranceCard(a={}){var t,r;await this.checkLoading();const n=this.createParams(e.NS_GETPERSONALINFO,{transchannel:"101",interfaceid:a.interfaceid,transtype:"YB0000",...a,transdata:{...a.transdata,iar1:{...s.iar1,...null==(t=a.transdata)?void 0:t.iar1},personinfo:{...s.personinfo,...null==(r=a.transdata)?void 0:r.personinfo}}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(n))}async getCardType(){await this.checkLoading();const a=this.createParams(e.CARD_TYPE_READ,{transsystem:"10",transtype:"IDCARD",interfaceid:"0"});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(a))}async generalRequest(a={}){await this.checkLoading();const t=this.createParams(e.NS_GETPERSONALINFO,a);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}};let o=c;o.version=1,o.TRANS_CMD=e;export{o as default};
1
+ import{isFunction as a}from"lodash-es";import{ensureUID2IdCard as t}from"./utils/ensureUID2IdCard.js";import{TRANS_CMD as e,defaultInsuranceParams as s}from"./constants/index.js";import n from"./insuranceSDK.js";import{ReadHealthCard as r}from"./utils/readHealthCard.js";let i=null;const c=class{constructor(a){if(this.options=a,this.loading=!1,this.readHealthCardDialog=new r,i)return i;i=this,this.insurance=new n({selfWindow:a.selfWindow})}get basicParamsRes(){return a(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(a={}){return new c(a)}static destroy(){null==i||i.destroy(),i=null}destroy(){this.insurance.destroy(),i=null}createParams(a,t){return{transcmd:a,...this.basicParamsRes,...t}}checkLoading(){if(this.loading)return Promise.reject("请勿重复操作")}async checkResCodeAndLoading(a){try{this.loading=!0;const t=await a;return 3===t.returncode||"3"===t.returncode?Promise.reject(`${t.returnmsg||"操作失败"}`):t.returndata}finally{this.loading=!1}}async readHealthCard(a,t){return await this.checkLoading(),this.readHealthCardDialog.show({instance:a,...t})}async readIdCard(a={},s){await this.checkLoading();const n=this.createParams(e.ID_CARD_READ,{transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"2",...a.transdata}}),r=await this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(n));return(null==r?void 0:r.cardinfo)&&s&&await t(r.cardinfo,s),r}async readMemberCard(a={}){await this.checkLoading();const t=this.createParams(e.MEMBER_CARD_READ,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async writeMemberCard(a={}){await this.checkLoading();const t=this.createParams(e.MEMBER_CARD_WRITE,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",...a,transdata:{readtype:"1",...a.transdata}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async readInsuranceCard(a={}){var t,n;await this.checkLoading();const r=this.createParams(e.NS_GETPERSONALINFO,{transchannel:"101",interfaceid:a.interfaceid,transtype:"YB0000",...a,transdata:{...a.transdata,iar1:{...s.iar1,...null==(t=a.transdata)?void 0:t.iar1},personinfo:{...s.personinfo,...null==(n=a.transdata)?void 0:n.personinfo}}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(r))}async getCardType(){await this.checkLoading();const a=this.createParams(e.CARD_TYPE_READ,{transsystem:"10",transtype:"IDCARD",interfaceid:"0"});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(a))}async generalRequest(a={}){await this.checkLoading();const t=this.createParams(e.NS_GETPERSONALINFO,a);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}};let o=c;o.version=1,o.TRANS_CMD=e;export{o as default};
@@ -7,4 +7,5 @@ export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: AnyObjec
7
7
  item: AnyObject;
8
8
  target: any;
9
9
  }) => void;
10
+ handleKeydown: (evt: KeyboardEvent) => void;
10
11
  };
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o,drawLine as i,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as u,cloneDeep as d,omit as f,flatten as h}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const g=u(m,(t=>"add"!==t.type));function x(u,m,x,v,y,k,C,w,X){const{computedX:b,getXValue:A}=r(m),{getEqualXTypes:j,handleAddPrevent:E,isGridLimit:P,getPointEventProps:L}=s(u,x,m),{createShadowLines:S}=l(),{canvasWidth:M,other:T,yCellHeight:z,xCellWidth:H,endX:I,originX:O,originY:W,endY:Y,markHeight:$,event:B,topGridYCellHeight:D,extracorporealCirculationHeight:_}=m,V=new Map,G=d(T);function K(){var i;if(!(null==(i=null==G?void 0:G.horizontal)?void 0:i.length))return;const n="horizontal";V.set(n,[]);const{horizontal:r}=G;let a=W+z/2;r.forEach(((i,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:u={},data:d,showIcon:f=!0}=i;let h=null;d.forEach(((i,d)=>{const{time:p,value:m}=i,g=b(p);if(!Z(g))return;const x=[],v=f&&e(s,{...c,left:g,top:a});v&&x.push(v);const y=f?g+v.width/2+2:g,k=o([y,a],{value:m,...u,originX:"left"});x.push(k);const C=new t.Group(x,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...L()});Object.assign(C,{originLeft:g,iconHalfWidth:v?v.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:d,data:i,title:l},limitX:{x1:O,x2:I-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,Q(C),V.get(n).push(C)})),a+=z})),u.value.add(...V.get(n))}function q(){var t;if(!(null==(t=null==G?void 0:G.vertical)?void 0:t.length))return;const o="vertical";V.set(o,[]);const{vertical:i}=G;i.forEach(((t,i)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=b(s);if(!n||!Z(c))return;const{lineHeight:u=z}=a;let d=W+r+u/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:d,origin:{type:"other",key:o,dataIndex:i,index:n,data:{value:t}},...L()});d+=u,Q(r),V.get(o).push(r)}));const f=V.get(o).filter((t=>t.origin.dataIndex===i)),h=Math.max(...f.map((t=>t.width))),p=c>I-h;f.forEach(((t,e,o)=>{t.siblingPoints=o.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,p&&t.set("originX","right")}))})),u.value.add(...V.get(o))}function F(t,e="add"){const{dataIndex:o,data:i,index:n,key:r,dataKey:a,time:l}=t,s=G[r],u=["mark","extracorporealCirculation"].includes(r)?s.dataList[o]:s[o];switch(e){case"remove":u.data.splice(n,1);break;case"change":if("mark"===r){u.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(i):(s.dataList.push({time:l,list:[i]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?u[a]=i:u.data[n]=i;break;default:{const t=Array.isArray(i)?i[0].time:i.time,e=c(t,u.data),o=Array.isArray(i)?i:[i];u.data.splice(e,0,...o);break}}J(t)}function J(t){var e;const{key:o}=t;switch(null==(e=u.value)||e.remove(...V.get(o)),V.delete(o),o){case"horizontal":K();break;case"vertical":q();break;case"mark":N();break;case"extracorporealCirculation":et()}}function N(){if(!$)return;const{title:t,titleStyle:i,pointAttr:n,dataList:r}=G.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";V.set(a,[]);const l=o([O-5,Y+$/2],{value:t,...i,originX:"right"});u.value.add(l);const s=Y+$+_,c=Y+_;let d=0;const f={};r.forEach(((t,o)=>{const{time:i,list:r=[]}=t,l=b(i);if(!Z(l))return;let h=c+1;r.forEach(((t,i)=>{var r;const{style:p}=t,m=e((null==p?void 0:p.type)||"circleAndText",{...(null==p?void 0:p.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:o,index:i}}),g=m.height;d&&l-d<=H&&(null==(r=f[`x_${d}`])||r.forEach((([t,e])=>{h+g>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:x,startTop:v,oldStartTop:y}=function(t,e){const o={};let i;if(t>Y){const r=t+e;o.y2=t+e/2,r>=s?n(Y-1):(i=t,t=r)}else n(t);function n(n){i=n,o.y2=n-e/2;t=n-e}return{topObj:o,startTop:t,oldStartTop:i}}(h,g);h=v,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",x.y2),V.get(a).push(m),Q(m),u.value.add(m)})),d=l})),function(t){const e=t=>{var e,o;return null==(o=null==(e=t.origin)?void 0:e.data)?void 0:o.isStart},o=t.find((t=>e(t))),i=t.find((t=>!e(t)&&t.left>o.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:O,x2:I};e(t)?(r.x2=i.left,t.otherPoints=n):(r.x1=o.left,t.startPoint=o),t.limitX=r}))}(V.get(a))}function Q(t){if(B.hovered&&(t.on("mouseover",(()=>{R(t)})),t.on("mouseout",(()=>{v.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,o=["mark","horizontal"].includes(e),i=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{o?function(t){const e=t.origin.key,o="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(o?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(o?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+_+$-t.height/2;t.top>e&&t.set("top",e)}o&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:o}=t,i=p(new Date,"yyyy-MM-dd HH:mm"),n=b(i);o.isCurrentTime&&o.x2<n&&n>0&&n<M&&(o.x2=n);e<o.x1&&t.set({x1:o.x1,x2:o.x1});e>o.x2&&t.set({x1:o.x2,x2:o.x2});U(t,"left"),U(t,"right")}(t):(k(t),function(t){const e=t.left+t.maxTextWidth>I?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((o=>o.setCoords().set({originX:e,left:t.left})))}(t)),B.hovered&&R(t)})),t.on("mouseup",(r=>{var a;if(v.show=!1,1===r.button){o&&function(t){var e,o;if("mark"===t.origin.key){if((null==(o=null==(e=t.origin)?void 0:e.data)?void 0:o.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),o=Math.min(...e);t.startPoint.limitX.x2=o}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=A(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...i?{time:e}:{data:{...t.origin.data,time:e}}};u.value.discardActiveObject(),x("change",r),n&&F(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(y.point={x:t.left,y:t.top},y.show=!0,y.target=t,y.list=g.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function R(t){v.isTarget=!0,v.show=!0;const{key:e,data:o={}}=t.origin||{};let i=o.value;const n="extracorporealCirculation"===e||"mark"===e;v.point={x:t.left,y:n?t.top:t.top+D/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=A(r);v.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(i=o.name),v.list.unshift(i+" ")),v.sourceData=[{type:"other",key:e,time:a,value:i}]}function U(t,e){const{shadowObjs:o,params:i}=t[`${e}ShadowBox`]||{};if(!o||!i)return;o.forEach((t=>u.value.remove(t)));i["left"===e?1:0]=t.left;const n=tt(...i);t[`${e}ShadowBox`]={shadowObjs:n,params:i}}function Z(t){return t>=O&&t<=I}function tt(...e){const[o,i,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),d=[[o,Y],[i,Y],[i,r],[o,r]],h=new t.Polygon(d.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),p=[];return["slash"].includes(l)&&p.push(...S(d,s.angle,s.space,c)),u.value.add(h,...p),V.get("extracorporealCirculation").push(h,...p),[h,...p]}function et(){if(!_)return;const{dataList:e,ascendAortaStyle:o,extracorporealCirculationStyle:i}=G.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";V.set(n,[]);const r=Y+_;let a,l;function s(t){return t&&t>O&&t<M}function c(t){return void 0===t||""===t}e.forEach(((d,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:o,openAscendAorta:i,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=b(e.time)),o&&(a=b(o.time)),i&&(l=b(i.time)),n&&(s=b(n.time)),[r,a,l,s]}(d);if(-1===h.findIndex((t=>t>0&&t<M)))return;let m;h.forEach(((g,x)=>{if(c(g))return;const v=h[x+1],y=h[x-1];if(s(g)||s(v)){const k=s(g)?g:O,C=s(v)?v:c(v)?null:I,w=s(y)?y:O,X={};if(x<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(x)?i:o],X.shadowObjs=tt(...X.params)),s(g)){const o=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(x),i=p(new Date,"yyyy-MM-dd HH:mm"),c=b(i),v=g<c&&s(c)?c:g,y=function(e,o){const i=new t.Line(e,{...o,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return Q(i),u.value.add(i),V.get("extracorporealCirculation").push(i),i}([g,Y,g,r],{origin:{dataIndex:f,dataKey:o,key:n,data:d[o],type:"other"},limitX:{x1:0===x?null!=a?a:O:w,x2:C||v,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(x)?{leftShadowBox:m}:{},...[0,1,2].includes(x)?{rightShadowBox:X}:{}});x===h.length-1&&(a=g,l=y),0===x&&l&&(l.limitX.x2=k)}m=X}}))}))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,o=b(t),n=i([o,0,o,Y],e);u.value.add(n)}(),function(){var t;if(!(null==(t=null==G?void 0:G.horizontal)?void 0:t.length))return;const{horizontal:o}=G,i=O-5;let n=W+z/2;o.forEach(((t,o)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:i,top:n,origin:{defaultAddValue:l,dataIndex:o,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:i,originTop:n});var c;(c=s).on("moving",(()=>{c.set("originX","center"),P(c)?R(c):v.show=!1})),c.on("mouseup:before",(t=>{if(v.show=!1,0===t.e.button&&P(c))if(j(V.get("horizontal"),c.left,"key",H).includes(c.origin.key))E("repeat"),console.log("重复节点");else{const t={data:{time:A(c.left),value:c.origin.defaultAddValue},...c.origin};x("add",f(t,["isMenu"])),F(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(c)})),u.value.add(s),n+=z}))}(),K(),q(),N(),et(),a.on((()=>{const t="horizontal",e=C(V.get(t));e.length>0?w((()=>{const o=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:o}=e.origin;return t[o]=t[o]?t[o].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const o=e[t];return G.horizontal[t].data.splice(o[0].index,o.length),o})))}(e);J({key:t}),x("remove",o)})):X()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:o,_type:i}=t,n={...e.origin,type:i};x(o,n),"remove"===o&&F(n,o)}}}export{x as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as d,cloneDeep as u,omit as f,flatten as h,isNumber as g,pick as m}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const x=d(v,(t=>"add"!==t.type));function y(d,v,y,k,C,w,X,b,E){const{computedX:A,getXValue:L}=r(v),{getEqualXTypes:j,handleAddPrevent:P,isGridLimit:S,getPointEventProps:z}=s(d,y,v),{createShadowLines:I}=l(),{canvasWidth:M,other:T,yCellHeight:H,xCellWidth:O,endX:$,originX:B,originY:W,endY:Y,markHeight:D,event:_,topGridYCellHeight:V,extracorporealCirculationHeight:G}=v,K=new Map,R=u(T);let q=[],F=null;function J(){var o;if(!(null==(o=null==R?void 0:R.horizontal)?void 0:o.length))return;const n="horizontal";K.set(n,[]);const{horizontal:r}=R;let a=W+H/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:g,value:m}=o,p=A(g);if(!ot(p))return;const v=[],x=f&&e(s,{...c,left:p,top:a});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,a],{value:m,...d,originX:"left"});v.push(k);const C=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...z()});Object.assign(C,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:B,x2:$-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,tt(C),K.get(n).push(C)})),a+=H})),d.value.add(...K.get(n))}function N(){var t;if(!(null==(t=null==R?void 0:R.vertical)?void 0:t.length))return;const i="vertical";K.set(i,[]);const{vertical:o}=R;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!ot(c))return;const{lineHeight:d=H}=a;let u=W+r+d/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...z()});u+=d,tt(r),K.get(i).push(r)}));const f=K.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=c>$-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),d.value.add(...K.get(i))}function Q(t,e="add"){const{dataIndex:i,data:o,index:n,key:r,dataKey:a,time:l}=t,s=R[r],d=["mark","extracorporealCirculation"].includes(r)?s.dataList[i]:s[i];switch(e){case"remove":d.data.splice(n,1);break;case"change":if("mark"===r){d.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(o):(s.dataList.push({time:l,list:[o]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?d[a]=o:d.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=c(t,d.data),i=Array.isArray(o)?o:[o];d.data.splice(e,0,...i);break}}U(t)}function U(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...K.get(i)),K.delete(i),i){case"horizontal":J();break;case"vertical":N();break;case"mark":Z();break;case"extracorporealCirculation":rt()}}function Z(){if(!D)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=R.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";K.set(a,[]);const l=i([B-5,Y+D/2],{value:t,...o,originX:"right"});d.value.add(l);const s=Y+D+G,c=Y+G;let u=0;const f={};r.forEach(((t,i)=>{const{time:o,list:r=[]}=t,l=A(o);if(!ot(l))return;let h=c+1;r.forEach(((t,o)=>{var r;const{style:g}=t,m=e((null==g?void 0:g.type)||"circleAndText",{...(null==g?void 0:g.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:i,index:o}}),p=m.height;u&&l-u<=O&&(null==(r=f[`x_${u}`])||r.forEach((([t,e])=>{h+p>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:v,startTop:x,oldStartTop:y}=function(t,e){const i={};let o;if(t>Y){const r=t+e;i.y2=t+e/2,r>=s?n(Y-1):(o=t,t=r)}else n(t);function n(n){o=n,i.y2=n-e/2;t=n-e}return{topObj:i,startTop:t,oldStartTop:o}}(h,p);h=x,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",v.y2),K.get(a).push(m),tt(m),d.value.add(m)})),u=l})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:B,x2:$};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(K.get(a))}function tt(t){if(_.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{k.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{t.moving=!0,i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+G+D-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:i}=t,o=p(new Date,"yyyy-MM-dd HH:mm"),n=A(o);i.isCurrentTime&&i.x2<n&&n>0&&n<M&&(i.x2=n);e<i.x1&&t.set({x1:i.x1,x2:i.x1});e>i.x2&&t.set({x1:i.x2,x2:i.x2});it(t,"left"),it(t,"right")}(t):(w(t),function(t){const e=t.left+t.maxTextWidth>$?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),_.hovered&&et(t)})),t.on("mouseup",(r=>{var a;if(k.show=!1,1===r.button){if(!t.moving)return;t.moving=!1,i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=L(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),y("change",r),n&&Q(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(C.point={x:t.left,y:t.top},C.show=!0,C.target=t,C.list=x.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function et(t){k.isTarget=!0,k.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;const n="extracorporealCirculation"===e||"mark"===e;k.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=L(r);k.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(o=i.name),k.list.unshift(o+" ")),k.sourceData=[{type:"other",key:e,time:a,value:o}]}function it(t,e){const{shadowObjs:i,params:o}=t[`${e}ShadowBox`]||{};if(!i||!o)return;i.forEach((t=>d.value.remove(t)));o["left"===e?1:0]=t.left;const n=nt(...o);t[`${e}ShadowBox`]={shadowObjs:n,params:o}}function ot(t){return t>=B&&t<=$}function nt(...e){const[i,o,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),u=[[i,Y],[o,Y],[o,r],[i,r]],h=new t.Polygon(u.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),g=[];return["slash"].includes(l)&&g.push(...I(u,s.angle,s.space,c)),d.value.add(h,...g),K.get("extracorporealCirculation").push(h,...g),[h,...g]}function rt(){if(!G)return;const{dataList:e,ascendAortaStyle:i,extracorporealCirculationStyle:o}=R.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";K.set(n,[]);const r=Y+G;let a,l;function s(t){return t&&t>B&&t<M}function c(t){return void 0===t||""===t}e.forEach(((u,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:i,openAscendAorta:o,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),i&&(a=A(i.time)),o&&(l=A(o.time)),n&&(s=A(n.time)),[r,a,l,s]}(u);if(-1===h.findIndex((t=>t>0&&t<M)))return;let g;h.forEach(((m,v)=>{if(c(m))return;const x=h[v+1],y=h[v-1];if(s(m)||s(x)){const k=s(m)?m:B,C=s(x)?x:c(x)?null:$,w=s(y)?y:B,X={};if(v<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(v)?o:i],X.shadowObjs=nt(...X.params)),s(m)){const i=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(v),o=p(new Date,"yyyy-MM-dd HH:mm"),c=A(o),x=m<c&&s(c)?c:m,y=function(e,i){const o=new t.Line(e,{...i,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return tt(o),d.value.add(o),K.get("extracorporealCirculation").push(o),o}([m,Y,m,r],{origin:{dataIndex:f,dataKey:i,key:n,data:u[i],type:"other"},limitX:{x1:0===v?null!=a?a:B:w,x2:C||x,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(v)?{leftShadowBox:g}:{},...[0,1,2].includes(v)?{rightShadowBox:X}:{}});v===h.length-1&&(a=m,l=y),0===v&&l&&(l.limitX.x2=k)}g=X}}))}))}function at(t){const{code:e}=t;F&&(e.includes("Enter")||e.includes("Esc"))&&(e.includes("Esc")&&(F.text=""),F.exitEditing(),d.value.discardActiveObject(F))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,i=A(t),n=o([i,0,i,Y],e);d.value.add(n)}(),function(){var t;if(!(null==(t=null==R?void 0:R.horizontal)?void 0:t.length))return;q=[];const{horizontal:i}=R,o=B-5;let n=W+H/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l,data:s=[]}=t,c=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;q.push({type:"other",title:r,key:"horizontal",dataIndex:i,dataList:s.map((t=>A(t.time))),y1:n-c.height/2,y2:n+c.height/2}),(u=c).on("moving",(()=>{u.set("originX","center"),S(u)?et(u):k.show=!1})),u.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&S(u))if(j(K.get("horizontal"),u.left,"key",O).includes(u.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:L(u.left),value:u.origin.defaultAddValue},...u.origin};y("add",f(t,["isMenu"])),Q(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(c),n+=H}))}(),J(),N(),Z(),rt(),a.on((()=>{const t="horizontal",e=X(K.get(t));e.length>0?b((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const i=e[t];return R.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);U({key:t}),y("remove",i)})):E()})),_.evented&&(window.addEventListener("keydown",at,!0),d.value.on("mouse:up",(e=>{var i,o,n,r;if(1===e.button){const{target:a,pointer:l={}}=e,{x:s=0,y:c=0}=l;if(!S({left:s,top:c}))return;if(!(null==q?void 0:q.length)||F)return;if(a&&"horizontal"!==(null==(i=a.origin)?void 0:i.key))return;let u="";if(a){if(a.moving)return;u=null==(r=null==(n=null==(o=a.origin)?void 0:o.data)?void 0:n.value)?void 0:r.toString()}const f=q.find((({y1:t,y2:e})=>c>=t&&c<=e));g(null==f?void 0:f.dataIndex)&&(F=new t.Textbox(u,{left:s,top:c,width:100,height:100,fontSize:18,objectCaching:!1,hasControls:!1,borderColor:"#000",editingBorderColor:"#000",backgroundColor:"#fff",fontFamily:"微软雅黑"}),F.otherListPointHeightRangeItem={...f,left:s,target:a},d.value.add(F),d.value.setActiveObject(F),F.enterEditing(),u&&F.setSelectionEnd(u.length))}})),d.value.on("selection:cleared",(({deselected:t})=>{var e;if(null==t?void 0:t.find((t=>t.otherListPointHeightRangeItem))){let{text:t}=F;const{otherListPointHeightRangeItem:i}=F;if(t=t.replace(/^\s+|\s+$/g,""),d.value.remove(F),F=null,!t)return;const{left:o,target:n}=i;if(n){if(t==(null==(e=n.origin)?void 0:e.data.value))return;const i={...n.origin,data:{...n.origin.data,value:t}};y("change",i),Q(i,"change")}else{const e={...m(i,["title","type","key","dataIndex"]),data:{time:L(o),value:t}};y("add",e),Q(e)}}}))),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};y(i,n),"remove"===i&&Q(n,i)},handleKeydown:at}}export{y as useOther};
@@ -1 +1 @@
1
- import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as n,watch as l,toRefs as u}from"vue";import{useDialog as s}from"naive-ui";import{defaultBorderStyle as d}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as c}from"date-fns";import{getChildrenSize as m}from"../../utils/index.js";import{cloneDeep as p,range as h,flatten as v}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as g}from"./useTop.js";import{useLeft as f}from"./useLeft.js";import{useCenter as w}from"./useCenter.js";import{useOther as x}from"./useOther.js";import{uuidGenerator as b}from"../../../../../shared/utils/index.js";function y(y,C,j,Y,H,M,T){var k;const D=s(),P=e({redrawPoints:null,clickMenu:null,redrawLinePoints:null}),S=t();let A=null;const L=m((null==(k=C.data.top)?void 0:k.treeData)||[]),X=a((()=>C.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),G=a((()=>{var e;return null!=(e=C.data.left.width)?e:0})),N=a((()=>{const{grid:e}=C.data;return e.mainXCell*e.subXCell})),V=a((()=>{const{grid:e}=C.data;return e.mainYCell*e.subYCell})),O=a((()=>{const{show:e=!0,tree:t={}}=C.data.top;if(!e)return 0;const{rowNumber:a=L}=t;return L<a?a:L})),E=a((()=>C.data.top.tree.cellHeight)),W=a((()=>E.value*O.value)),I=a((()=>ue(ne("drug")||"top"))),F=a((()=>I.value+W.value)),_=a((()=>{var e;return Date.parse((null==(e=C.data.xAxis)?void 0:e.startTime)||c(new Date,"yyyy-MM-dd HH:mm:ss"))})),q=a((()=>{const e=p(C.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=h(N.value/t+1).map((r=>0===r?e.startTime:c(new Date(_.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:G.value}})),z=se(),B=a((()=>ue(ne("xAxis")||"center"))),J=a((()=>{var e;const{width:t,right:a}=C.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),K=a((()=>ue(ne("intraoperatively")||"bottom"))),Q=a((()=>{var e;const{show:t,height:a}=(null==(e=C.data.other)?void 0:e.extracorporealCirculation)||{};return t&&a?a:0})),R=a((()=>{var e;const{show:t,height:a}=(null==(e=C.data.other)?void 0:e.mark)||{};return t&&a?a:0})),U=a((()=>K.value+(C.data.height-W.value-q.value.height-R.value-Q.value))),Z=a((()=>(J.value-G.value)/N.value)),$=a((()=>(U.value-K.value)/V.value)),ee=a((()=>q.value.spaceTimeStamp/Z.value)),te=a((()=>{const{scaleValues:e}=C.data;return v(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),ae=a((()=>de("pulse"))),re=a((()=>de("temperature"))),ie=a((()=>{var e;return(null==(e=C.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),oe=e({canvasWidth:C.data.width,canvasHeight:C.data.height,borderStyle:{...d,...C.data.borderStyle},pointSelectionStyle:C.data.pointSelectionStyle||{},grid:C.data.grid,top:C.data.top,left:C.data.left,other:C.data.other,topGridYNumber:r(O),topGridYCellHeight:r(E),topGridOriginY:r(I),topGridEndY:r(F),treeData:z,getTreeData:se,xAxis:r(q),originYXAxis:r(B),startTime:r(_),timeXCell:r(ee),gridXNumber:r(N),gridYNumber:r(V),xCellWidth:r(Z),yCellHeight:r($),originX:r(G),endX:r(J),originY:r(K),endY:r(U),markHeight:r(R),extracorporealCirculationHeight:r(Q),itemList:r(te),scaleValues:C.data.scaleValues,pulseYCell:r(ae),temperatureYCell:r(re),event:r(ie),dialog:D,extraMenuConfig:C.data.extraMenuConfig||{}});function ne(e){let t="";return Object.entries(X.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function le(e){const t=X.value[e],a=q.value.height;switch(t){case"drug":return W.value;case"xAxis":return a;default:return C.data.height-W.value-a}}function ue(e){switch(e){case"top":return 0;case"center":return le("top");default:return le("top")+le("center")}}function se(){const{show:e=!0,tree:t={}}=C.data.top;if(!e)return[];const a=p(C.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=C.data.top.tree,{rowNumber:n=L}=t;return L<n&&a.push(...h(n-L).map((()=>({})))),function e(t,a=0){t.forEach((t=>{var n;const l={top:r*o+I.value,left:a*i,width:i,height:o,uuid:b()};if(r++,null==(n=t.children)?void 0:n.length){r--;const i=m(t.children);l.height=i*o,e(t.children,a+1)}else l.width=G.value-l.left;Object.assign(t,l)}))}(a),a}function de(e){const{scaleValues:t}=C.data,a=t.find((t=>t.type===e));return $.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o();const{redrawLinePoints:e,clickMenu:t}=g(y,oe,j,H,M),{redrawPoints:a,clickMenu:r,moveLimit:i,setPopup:n,updateData:l,getGridPoints:u,getContainPoints:s,showDialog:d,removeCurrentSelection:c,pauseFlickerPoint:m}=w(y,oe,j,H,M,T);S.value=m,f(y,oe,j,H,i,n,l,u);const{clickMenu:p}=x(y,oe,j,H,M,i,s,d,c);P.redrawPoints=a,P.redrawLinePoints=e,P.clickMenu=e=>{const{item:a}=e;switch(a._type){case"tree":t(e);break;case"other":p(e);break;default:r(e)}}})),n((()=>{S.value()})),T&&l((()=>null==H?void 0:H.point),(()=>{H.movable?(H.show=!0,A&&clearTimeout(A),A=setTimeout((()=>{H.show=!1,H.movable=!1}),3e3)):A&&clearTimeout(A)}),{deep:!0}),{propItems:oe,...u(P)}}export{y as useSurgicalAnesthesiaChart};
1
+ import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as n,watch as l,toRefs as u}from"vue";import{useDialog as s}from"naive-ui";import{defaultBorderStyle as d}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as c}from"date-fns";import{getChildrenSize as m}from"../../utils/index.js";import{cloneDeep as p,range as h,flatten as v,isFunction as g}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as f}from"./useTop.js";import{useLeft as w}from"./useLeft.js";import{useCenter as x}from"./useCenter.js";import{useOther as y}from"./useOther.js";import{uuidGenerator as b}from"../../../../../shared/utils/index.js";function C(C,j,Y,k,H,M,T){var D;let P=null;const S=s(),L=e({redrawPoints:null,clickMenu:null,redrawLinePoints:null}),A=t();let X=null;const G=m((null==(D=j.data.top)?void 0:D.treeData)||[]),N=a((()=>j.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),V=a((()=>{var e;return null!=(e=j.data.left.width)?e:0})),E=a((()=>{const{grid:e}=j.data;return e.mainXCell*e.subXCell})),O=a((()=>{const{grid:e}=j.data;return e.mainYCell*e.subYCell})),W=a((()=>{const{show:e=!0,tree:t={}}=j.data.top;if(!e)return 0;const{rowNumber:a=G}=t;return G<a?a:G})),I=a((()=>j.data.top.tree.cellHeight)),F=a((()=>I.value*W.value)),K=a((()=>de(ue("drug")||"top"))),_=a((()=>K.value+F.value)),q=a((()=>{var e;return Date.parse((null==(e=j.data.xAxis)?void 0:e.startTime)||c(new Date,"yyyy-MM-dd HH:mm:ss"))})),z=a((()=>{const e=p(j.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=h(E.value/t+1).map((r=>0===r?e.startTime:c(new Date(q.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:V.value}})),B=ce(),J=a((()=>de(ue("xAxis")||"center"))),Q=a((()=>{var e;const{width:t,right:a}=j.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),R=a((()=>de(ue("intraoperatively")||"bottom"))),U=a((()=>{var e;const{show:t,height:a}=(null==(e=j.data.other)?void 0:e.extracorporealCirculation)||{};return t&&a?a:0})),Z=a((()=>{var e;const{show:t,height:a}=(null==(e=j.data.other)?void 0:e.mark)||{};return t&&a?a:0})),$=a((()=>R.value+(j.data.height-F.value-z.value.height-Z.value-U.value))),ee=a((()=>(Q.value-V.value)/E.value)),te=a((()=>($.value-R.value)/O.value)),ae=a((()=>z.value.spaceTimeStamp/ee.value)),re=a((()=>{const{scaleValues:e}=j.data;return v(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),ie=a((()=>me("pulse"))),oe=a((()=>me("temperature"))),ne=a((()=>{var e;return(null==(e=j.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),le=e({canvasWidth:j.data.width,canvasHeight:j.data.height,borderStyle:{...d,...j.data.borderStyle},pointSelectionStyle:j.data.pointSelectionStyle||{},grid:j.data.grid,top:j.data.top,left:j.data.left,other:j.data.other,topGridYNumber:r(W),topGridYCellHeight:r(I),topGridOriginY:r(K),topGridEndY:r(_),treeData:B,getTreeData:ce,xAxis:r(z),originYXAxis:r(J),startTime:r(q),timeXCell:r(ae),gridXNumber:r(E),gridYNumber:r(O),xCellWidth:r(ee),yCellHeight:r(te),originX:r(V),endX:r(Q),originY:r(R),endY:r($),markHeight:r(Z),extracorporealCirculationHeight:r(U),itemList:r(re),scaleValues:j.data.scaleValues,pulseYCell:r(ie),temperatureYCell:r(oe),event:r(ne),dialog:S,extraMenuConfig:j.data.extraMenuConfig||{}});function ue(e){let t="";return Object.entries(N.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function se(e){const t=N.value[e],a=z.value.height;switch(t){case"drug":return F.value;case"xAxis":return a;default:return j.data.height-F.value-a}}function de(e){switch(e){case"top":return 0;case"center":return se("top");default:return se("top")+se("center")}}function ce(){const{show:e=!0,tree:t={}}=j.data.top;if(!e)return[];const a=p(j.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=j.data.top.tree,{rowNumber:n=G}=t;return G<n&&a.push(...h(n-G).map((()=>({})))),function e(t,a=0){t.forEach((t=>{var n;const l={top:r*o+K.value,left:a*i,width:i,height:o,uuid:b()};if(r++,null==(n=t.children)?void 0:n.length){r--;const i=m(t.children);l.height=i*o,e(t.children,a+1)}else l.width=V.value-l.left;Object.assign(t,l)}))}(a),a}function me(e){const{scaleValues:t}=j.data,a=t.find((t=>t.type===e));return te.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o();const{redrawLinePoints:e,clickMenu:t}=f(C,le,Y,H,M),{redrawPoints:a,clickMenu:r,moveLimit:i,setPopup:n,updateData:l,getGridPoints:u,getContainPoints:s,showDialog:d,removeCurrentSelection:c,pauseFlickerPoint:m}=x(C,le,Y,H,M,T);A.value=m,w(C,le,Y,H,i,n,l,u);const{clickMenu:p,handleKeydown:h}=y(C,le,Y,H,M,i,s,d,c);P=h,L.redrawPoints=a,L.redrawLinePoints=e,L.clickMenu=e=>{const{item:a}=e;switch(a._type){case"tree":t(e);break;case"other":p(e);break;default:r(e)}}})),n((()=>{A.value(),g(P)&&window.removeEventListener("keydown",P,!0)})),T&&l((()=>null==H?void 0:H.point),(()=>{H.movable?(H.show=!0,X&&clearTimeout(X),X=setTimeout((()=>{H.show=!1,H.movable=!1}),3e3)):X&&clearTimeout(X)}),{deep:!0}),{propItems:le,...u(L)}}export{C as useSurgicalAnesthesiaChart};
@@ -1,11 +1,10 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../shared/utils/fabricjs';
3
- import { IObject } from '../interface';
4
3
  import { AnyObject } from '../../../../shared/types';
5
4
  export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function, propItems: AnyObject): {
6
5
  getEqualXTypes: (points: any[], pointX: number, field: string, range?: any) => string[];
7
6
  handleAddPrevent: (type: 'repeat' | 'exceedMax' | 'exceedMin') => void;
8
- isGridLimit: (point: IObject) => boolean;
7
+ isGridLimit: (point: any) => boolean;
9
8
  setPrevAndNextPoint: (pointList: any[]) => void;
10
9
  getPointEventProps: () => any;
11
10
  };
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{omit as t}from"lodash-es";const n={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,strokeUniform:!0,...n},i={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...n},o={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...n},c={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...n};function l(t,n){return new e.Line(t,{...i,...n})}function s([t,n],r){return new e.Text(String(r.value),{...c,left:t,top:n,...r})}function a([t,r,i],o,c="down"){const a=l([t,r,t,i],{strokeWidth:o.strokeWidth||1,stroke:o.fill||o.stroke}),g=s([t+.5,"up"===c?i-3:i+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===c?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...n,originX:"center",originY:"top",objectCaching:!1})}function g(t,r,i,l=!1){const s=new e.Rect({...o,...t,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=r,f=t.width/2,h=t.height/2,d=new e.Text(String(a),{...c,...r,..."left"==g||"right"==g?{originX:g,left:"left"==g?-f:f}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...n,...i})}function u(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function f(n="circle",r){var i;const o={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...r},c=r.radius?(r.radius||5)+(r.strokeWidth||1):null!=(i=r.width)?i:0;switch(n){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...o});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...o});case"image":return new e.Image(r.element,o);case"yemai":{const t=()=>{const t=2*c,n={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},i=new e.Line([0,c,t,c],n),o=new e.Line([c,0,c,t],n);return new e.Group([i,o])};return new e.Group([u(r),t()],o)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:c-.5,top:c-.5});return new e.Group([u(r),t],o)}case"circleAndText":{const t=new e.Text(String(r.text),{fontFamily:"微软雅黑",fontSize:o.fontSize||12,originX:"center",originY:"center",fill:r.textFill||r.stroke,left:c-.5,top:c-1,fontWeight:r.fontWeight||500,objectCaching:!1});return new e.Group([u(r),t],o)}case"circleAndCircle":return f("koumai",r);case"cg":{const{left:t,radius:n,top:i,stroke:c="#000"}=r,l=new e.Line([0,n,2*n,n],{stroke:c,objectCaching:!1}),s=n+1,a=Math.round(n/2),g=new e.Polyline([{x:s,y:a},{x:2*n,y:n},{x:s,y:n+a}],{stroke:c,fill:"transparent",objectCaching:!1});return new e.Group([u(r),l,g],{...o,left:Math.round(t),top:Math.round(i)})}case"qgcg":{const{radius:t,stroke:n="#000"}=r,i=new e.Line([0,t,4*t,t],{stroke:n,objectCaching:!1,left:-t});return new e.Group([u(r),i],o)}case"zrhz":{const{radius:t,stroke:n="#000"}=r,i=t/3*2,c=new e.Circle({objectCaching:!1,radius:i,fill:"#fff",left:t-i,top:t-i,stroke:n}),l=new e.Line([0,t,4*t,t],{stroke:n,objectCaching:!1,left:-t});return new e.Group([u(r),c,l],o)}case"plus":{const n=t(o,["big","small"]),{big:i,small:c}=r,l=f(i.type,{fill:"#fff",...n,...i.style}),s=f(c.type,{...n,...c.style});return new e.Group([l,s],n)}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(n),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...o})}}function h(t,r,i,o="horizontal"){const c=new e.Text(String(t),{...n,objectCaching:!1,...r.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...i.text}),{top:l,topY:s,left:a,leftX:g}=i.icon,u=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,h=null!=a?a:g+c.width+5;return{text:c,icon:f(r.type,{...r.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:u,...i.icon,origin:{title:r.title,unit:r.unit,type:r.bigType,dataIndex:r.dataIndex,key:r.key,isMenu:!0,...i.icon.origin},left:h,top:u})}}export{r as defaultBorderStyle,i as defaultLineStyle,o as defaultRectStyle,n as defaultStyle,c as defaultTextStyle,a as drawArrow,l as drawLine,f as drawPoint,s as drawText,h as drawTextAndIconGroup,g as drawTextGroup};
1
+ import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{omit as t}from"lodash-es";const n={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,strokeUniform:!0,...n},i={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...n},o={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...n},c={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...n};function l(t,n){return new e.Line(t,{...i,...n})}function s([t,n],r){return new e.Text(String(r.value),{...c,left:t,top:n,...r})}function a([t,r,i],o,c="down"){const a=l([t,r,t,i],{strokeWidth:o.strokeWidth||1,stroke:o.fill||o.stroke}),g=s([t+.5,"up"===c?i-3:i+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===c?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...n,originX:"center",originY:"top",objectCaching:!1})}function g(t,r,i,l=!1){const s=new e.Rect({...o,...t,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=r,f=t.width/2,h=t.height/2,d=new e.Text(String(a),{...c,...r,..."left"==g||"right"==g?{originX:g,left:"left"==g?-f:f}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...n,...i})}function u(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function f(n="circle",r){var i;const o={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...r},c=r.radius?(r.radius||5)+(r.strokeWidth||1):null!=(i=r.width)?i:0;switch(n){case"rect":return new e.Rect({width:10,height:10,strokeWidth:1,fill:"#fff",...o});case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...o});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...o});case"image":return new e.Image(r.element,o);case"yemai":{const t=()=>{const t=2*c,n={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},i=new e.Line([0,c,t,c],n),o=new e.Line([c,0,c,t],n);return new e.Group([i,o])};return new e.Group([u(r),t()],o)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:c-.5,top:c-.5});return new e.Group([u(r),t],o)}case"circleAndText":{const t=new e.Text(String(r.text),{fontFamily:"微软雅黑",fontSize:o.fontSize||12,originX:"center",originY:"center",fill:r.textFill||r.stroke,left:c-.5,top:c-1,fontWeight:r.fontWeight||500,objectCaching:!1});return new e.Group([u(r),t],o)}case"circleAndCircle":return f("koumai",r);case"cg":{const{left:t,radius:n,top:i,stroke:c="#000"}=r,l=new e.Line([0,n,2*n,n],{stroke:c,objectCaching:!1}),s=n+1,a=Math.round(n/2),g=new e.Polyline([{x:s,y:a},{x:2*n,y:n},{x:s,y:n+a}],{stroke:c,fill:"transparent",objectCaching:!1});return new e.Group([u(r),l,g],{...o,left:Math.round(t),top:Math.round(i)})}case"qgcg":{const{radius:t,stroke:n="#000"}=r,i=new e.Line([0,t,4*t,t],{stroke:n,objectCaching:!1,left:-t});return new e.Group([u(r),i],o)}case"zrhz":{const{radius:t,stroke:n="#000"}=r,i=t/3*2,c=new e.Circle({objectCaching:!1,radius:i,fill:"#fff",left:t-i,top:t-i,stroke:n}),l=new e.Line([0,t,4*t,t],{stroke:n,objectCaching:!1,left:-t});return new e.Group([u(r),c,l],o)}case"jxtq":{const{width:n=14,height:i=8}=r;return new e.Polyline([{x:0,y:i},{x:n/5,y:0},{x:n/5*2,y:i},{x:n/5*3,y:0},{x:n/5*4,y:i},{x:n/5*5,y:0}],{fill:"transparent",...t(o,["width","height"])})}case"plus":{const n=t(o,["big","small"]),{big:i,small:c}=r,l=f(i.type,{fill:"#fff",...n,...i.style}),s=f(c.type,{...n,...c.style});return new e.Group([l,s],n)}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(n),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...o})}}function h(t,r,i,o="horizontal"){const c=new e.Text(String(t),{...n,objectCaching:!1,...r.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...i.text}),{top:l,topY:s,left:a,leftX:g}=i.icon,u=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,h=null!=a?a:g+c.width+5;return{text:c,icon:f(r.type,{...r.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:u,...i.icon,origin:{title:r.title,unit:r.unit,type:r.bigType,dataIndex:r.dataIndex,key:r.key,isMenu:!0,...i.icon.origin},left:h,top:u})}}export{r as defaultBorderStyle,i as defaultLineStyle,o as defaultRectStyle,n as defaultStyle,c as defaultTextStyle,a as drawArrow,l as drawLine,f as drawPoint,s as drawText,h as drawTextAndIconGroup,g as drawTextGroup};