cnhis-design-vue 3.2.14-beta.21 → 3.2.14-beta.24

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 (110) hide show
  1. package/README.md +87 -87
  2. package/es/components/button-print/index.d.ts +4 -0
  3. package/es/components/button-print/src/ButtonPrint.vue.d.ts +4 -0
  4. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +4 -0
  5. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  6. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  7. package/es/components/fabric-chart/index.d.ts +19 -2
  8. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +19 -2
  9. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  10. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  11. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +13 -0
  12. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  13. package/es/components/fabric-chart/src/components/useStyle.js +1 -1
  14. package/es/components/fabric-chart/src/constants/index.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +1 -0
  16. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +1 -0
  17. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -0
  19. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +7 -1
  21. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +1 -0
  24. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  25. package/es/components/fabric-chart/src/interface.d.ts +2 -0
  26. package/es/components/field-set/src/FieldColor.vue.d.ts +2 -2
  27. package/es/components/field-set/src/FieldFilter.vue.d.ts +2 -2
  28. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
  29. package/es/components/field-set/src/components/table-row.vue.d.ts +2 -2
  30. package/es/components/iho-chat/index.d.ts +20 -4
  31. package/es/components/iho-chat/src/Index.vue.d.ts +20 -4
  32. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  33. package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
  34. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  35. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +1 -0
  36. package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
  37. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +1 -1
  38. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  39. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  40. package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
  41. package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
  42. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  43. package/es/components/iho-chat/src/components/MessageTemplate.vue.d.ts +1 -1
  44. package/es/components/iho-chat/src/components/MessageTemplate.vue2.js +1 -1
  45. package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
  46. package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
  47. package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
  48. package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
  49. package/es/components/iho-chat/src/constants/index.d.ts +2 -1
  50. package/es/components/iho-chat/src/constants/index.js +1 -1
  51. package/es/components/iho-chat/src/hooks/useData.d.ts +3 -3
  52. package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
  53. package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -1
  54. package/es/components/index.css +1 -1
  55. package/es/components/scale-view/index.d.ts +31 -0
  56. package/es/components/scale-view/src/ScaleView.vue.d.ts +13 -0
  57. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  58. package/es/components/scale-view/src/components/composables/choose-common.js +1 -1
  59. package/es/components/scale-view/src/components/formitem/r-checkbox.d.ts +9 -0
  60. package/es/components/scale-view/src/components/formitem/r-checkbox.js +1 -1
  61. package/es/components/scale-view/src/components/formitem/r-input.d.ts +9 -0
  62. package/es/components/scale-view/src/components/formitem/r-input.js +1 -1
  63. package/es/components/scale-view/src/components/formitem/r-radio.d.ts +9 -0
  64. package/es/components/scale-view/src/components/formitem/r-radio.js +1 -1
  65. package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
  66. package/es/components/scale-view/src/hooks/scaleview-props.d.ts +4 -0
  67. package/es/components/scale-view/src/hooks/scaleview-props.js +1 -1
  68. package/es/components/scale-view/src/hooks/use-component.d.ts +72 -0
  69. package/es/components/scale-view/style/index.css +1 -1
  70. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  71. package/es/components/template-render/src/components/index.d.ts +23 -23
  72. package/es/env.d.ts +25 -25
  73. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  74. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  75. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  76. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  77. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  78. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  79. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  80. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  81. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  82. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  83. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  84. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  85. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  86. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  87. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  88. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  89. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  90. package/es/shared/assets/img/failure.png.js +1 -1
  91. package/es/shared/assets/img/logo.png.js +1 -1
  92. package/es/shared/assets/img/no-permission.png.js +1 -1
  93. package/es/shared/assets/img/nodata.png.js +1 -1
  94. package/es/shared/assets/img/notfound.png.js +1 -1
  95. package/es/shared/assets/img/qr.png.js +1 -1
  96. package/es/shared/assets/img/success.png.js +1 -1
  97. package/es/shared/assets/img/table_style_2.png.js +1 -1
  98. package/es/shared/assets/img/video.png.js +1 -1
  99. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  100. package/es/shared/assets/img/xb_big.png.js +1 -1
  101. package/es/shared/assets/img/xb_small.png.js +1 -1
  102. package/es/shared/package.json.js +1 -1
  103. package/package.json +2 -2
  104. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  105. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  106. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  107. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  108. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  109. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  110. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
1
- import{computed as t}from"vue";function o(o){const{canvasWidth:r,canvasHeight:n}=o.propItems;return t((()=>{const{x:t,y:i}=o.point,p={top:"",bottom:"",left:"",right:"","transform-origin":""};return r-(t+15)<200?(p.right=r-t+15+"px",p["transform-origin"]="right"):(p.left=t+15+"px",p["transform-origin"]="left"),n-(i+-15)<200?(p.bottom=n-i-15+"px",p["transform-origin"]+=" bottom"):(p.top=i+-15+"px",p["transform-origin"]+=" top"),p}))}export{o as default};
1
+ import{computed as t}from"vue";function o(o){const{canvasWidth:r,canvasHeight:n}=o.propItems;return t((()=>{var t;const{x:i,y:a}=o.point,p=null!=(t=o.marginTop)?t:-15,m={top:"",bottom:"",left:"",right:"","transform-origin":""};return r-(i+15)<200?(m.right=r-i+15+"px",m["transform-origin"]="right"):(m.left=i+15+"px",m["transform-origin"]="left"),n-(a+p)<200?(m.bottom=n-a+p+"px",m["transform-origin"]+=" bottom"):(m.top=a+p+"px",m["transform-origin"]+=" top"),m}))}export{o as default};
@@ -1 +1 @@
1
- var e,l,i,a,d,o,u,r;const n=[{label:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.208"))||"升温",value:!0,type:"rise"},{label:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.209"))||"药物降温",value:void 0,type:"drugReduce"},{label:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.210"))||"物理降温",value:void 0,type:"physicsReduce"},{label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.211"))||"不升",value:!0,type:"noRise"}],t=[{label:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.212"))||"药物降痛",value:void 0,type:"drugReduce"},{label:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.213"))||"物理降痛",value:void 0,type:"physicsReduce"}],w=[{label:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.214"))||"修改",type:"change"},{label:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.215"))||"删除",type:"remove"}],g="#2563F4",s="#FF1818",c={yemai:{stroke:s,strokeX:g,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:s,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:g},gangmai:{radius:6,radiusCircle:3,stroke:g,fillCircle:s},xinmai:{radius:6,radiusCircle:3,stroke:s,fillCircle:s},humai:{radius:6,radiusCircle:3,stroke:s,fillCircle:g},ermai:{stroke:s,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:g}};var L=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e[e.DEFAULTMAINXCELLVALUE=.2]="DEFAULTMAINXCELLVALUE",e))(L||{});export{L as ECG,w as OTHER_MENU,c as OVERLAP,t as PAIN_MENU,n as TEMPERATURE_MENU};
1
+ var e,l,i,a,d,o,u,r;const n=[{label:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.208"))||"升温",value:!0,type:"rise"},{label:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.209"))||"药物降温",value:void 0,type:"drugReduce"},{label:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.210"))||"物理降温",value:void 0,type:"physicsReduce"},{label:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.211"))||"不升",value:!0,type:"noRise"}],t=[{label:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.212"))||"药物降痛",value:void 0,type:"drugReduce"},{label:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.213"))||"物理降痛",value:void 0,type:"physicsReduce"}],w=[{label:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.214"))||"修改",type:"edit"},{label:(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.215"))||"删除",type:"remove"}],g="#2563F4",s="#FF1818",L={yemai:{stroke:s,strokeX:g,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:s,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:g},gangmai:{radius:6,radiusCircle:3,stroke:g,fillCircle:s},xinmai:{radius:6,radiusCircle:3,stroke:s,fillCircle:s},humai:{radius:6,radiusCircle:3,stroke:s,fillCircle:g},ermai:{stroke:s,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:g}};var c=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e[e.DEFAULTMAINXCELLVALUE=.2]="DEFAULTMAINXCELLVALUE",e))(c||{});export{c as ECG,w as OTHER_MENU,L as OVERLAP,t as PAIN_MENU,n as TEMPERATURE_MENU};
@@ -11,5 +11,6 @@ export declare function useBirthProcessChart(canvas: Ref<fabric.Canvas>, props:
11
11
  useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
12
12
  useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
13
  useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
+ redrawLinePoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
15
  propItems: any;
15
16
  };
@@ -17,5 +17,6 @@ export declare function useElectrocardiogramChart(canvas: Ref<fabric.Canvas>, pr
17
17
  useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
18
18
  useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
19
19
  useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
20
+ redrawLinePoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
20
21
  propItems: any;
21
22
  };
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as d}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function c(c,u,f,h,m,g,p,v,x){const{computedX:k,getXValue:y}=o(u),{getEqualXTypes:X,handleAddPrevent:P,isGridLimit:b,getPointEventProps:w}=r(c,f,u),{other:E,yCellHeight:j,xCellWidth:z,endX:A,originX:C,originY:L,endY:M,markHeight:S,event:T,topGridYCellHeight:I}=u,H=new Map,Y=l(E);function W(){var o;if(!(null==(o=null==Y?void 0:Y.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=Y;let a=L+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:d={},textStyle:c={},data:u}=o;let f=null;u.forEach(((o,u)=>{const{time:h,value:m}=o,g=k(h);if(!$(g))return;const p=e(s,{...d,left:g,top:a}),v=g+p.width/2+2,x=i([v,a],{value:m,...c,originX:"left"}),y=new t.Group([p,x],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...w()});Object.assign(y,{originLeft:g,iconHalfWidth:p.width/2,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:C,x2:A-y.width}}),f&&(y.limitX.x1=f.left,f.limitX.x2=y.left,y.prevPoint=f,f.nextPoint=y),f=y,q(y),H.get(n).push(y)})),a+=j})),c.value.add(...H.get(n))}function V(){var t;if(!(null==(t=null==Y?void 0:Y.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=Y;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,d=k(s);if(!n||!$(d))return;const{lineHeight:c=j}=a;let u=L+r+c/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:d,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...w()});u+=c,q(r),H.get(i).push(r)}));const f=H.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),m=d>A-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),c.value.add(...H.get(i))}function G(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=Y[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}O(t)}function O(t){var e;const{key:i}=t;switch(null==(e=c.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":W();break;case"vertical":V();break;case"mark":D()}}function D(){if(!(null==E?void 0:E.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=E.mark,a=i([C-5,M+S/2],{value:t,...o,originX:"right"});c.value.add(a);const l=M+S,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=k(i);if(!$(r))return;let a=M;o.forEach((t=>{const{style:i}=t;let o=!1;const d=e((null==i?void 0:i.type)||"circleAndText",{...(null==i?void 0:i.pointAttr)||n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),u=d.height;a+u<=l&&a>=M?(d.set("top",a+u/2),a+=u):(o||(a=M,o=!0),d.set("top",a-u/2),a-=u),s.push(d),q(d),c.value.add(d)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:A};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function q(t){if(T.hovered&&(t.on("mouseover",(()=>{B(t)})),t.on("mouseout",(()=>{h.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<L&&t.set("top",L);const e=M+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(g(t),function(t){const e=t.left+t.maxTextWidth>A?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),T.hovered&&B(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=y(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};c.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(m.point={x:t.left,y:t.top},m.show=!0,m.target=t,m.list=d.map((t=>({...t,renderItem:()=>t.label}))))}))}function B(t){const{key:e,data:i={}}=t.origin||{};let o=i.value;h.point={x:t.left,y:"mark"===e?t.top:t.top+I/2};const n=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,r=y(n);h.list=[`时间 ${r.slice(-5)}`],"mark"===e&&(o=i.name,h.list.unshift(o+" ")),h.sourceData=[{type:"other",key:e,time:r,value:o}],h.isTarget=!0,h.show=!0}function $(t){return t>=C&&t<=A}return function(){var t;if(!(null==(t=null==Y?void 0:Y.horizontal)?void 0:t.length))return;const{horizontal:i}=Y,o=C-5;let n=L+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var d;(d=s).on("moving",(()=>{d.set("originX","center"),b(d)?B(d):h.show=!1})),d.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&b(d))if(X(H.get("horizontal"),d.left,"key",z).includes(d.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:y(d.left),value:d.origin.defaultAddValue},...d.origin};f("add",t),G(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(d)})),c.value.add(s),n+=j}))}(),W(),V(),D(),n.on((()=>{const t="horizontal",e=p(H.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return Y.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);O({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&G(o,i)}}}export{c as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as d}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function c(c,u,f,h,m,g,p,v,x){const{computedX:y,getXValue:k}=o(u),{getEqualXTypes:X,handleAddPrevent:P,isGridLimit:b,getPointEventProps:w}=r(c,f,u),{other:E,yCellHeight:j,xCellWidth:z,endX:A,originX:C,originY:L,endY:M,markHeight:S,event:T,topGridYCellHeight:I}=u,H=new Map,Y=l(E);function W(){var o;if(!(null==(o=null==Y?void 0:Y.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=Y;let a=L+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:d={},textStyle:c={},data:u}=o;let f=null;u.forEach(((o,u)=>{const{time:h,value:m}=o,g=y(h);if(!$(g))return;const p=e(s,{...d,left:g,top:a}),v=g+p.width/2+2,x=i([v,a],{value:m,...c,originX:"left"}),k=new t.Group([p,x],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...w()});Object.assign(k,{originLeft:g,iconHalfWidth:p.width/2,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:C,x2:A-k.width}}),f&&(k.limitX.x1=f.left,f.limitX.x2=k.left,k.prevPoint=f,f.nextPoint=k),f=k,q(k),H.get(n).push(k)})),a+=j})),c.value.add(...H.get(n))}function V(){var t;if(!(null==(t=null==Y?void 0:Y.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=Y;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,d=y(s);if(!n||!$(d))return;const{lineHeight:c=j}=a;let u=L+r+c/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:d,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...w()});u+=c,q(r),H.get(i).push(r)}));const f=H.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),m=d>A-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),c.value.add(...H.get(i))}function G(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=Y[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}O(t)}function O(t){var e;const{key:i}=t;switch(null==(e=c.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":W();break;case"vertical":V();break;case"mark":D()}}function D(){if(!(null==E?void 0:E.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=E.mark,a=i([C-5,M+S/2],{value:t,...o,originX:"right"});c.value.add(a);const l=M+S,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=y(i);if(!$(r))return;let a=M;o.forEach((t=>{const{style:i}=t;let o=!1;const d=e((null==i?void 0:i.type)||"circleAndText",{...(null==i?void 0:i.pointAttr)||n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),u=d.height;a+u<=l&&a>=M?(d.set("top",a+u/2),a+=u):(o||(a=M,o=!0),d.set("top",a-u/2),a-=u),s.push(d),q(d),c.value.add(d)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:A};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function q(t){if(T.hovered&&(t.on("mouseover",(()=>{B(t)})),t.on("mouseout",(()=>{h.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<L&&t.set("top",L);const e=M+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(g(t),function(t){const e=t.left+t.maxTextWidth>A?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),T.hovered&&B(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=k(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};c.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(m.point={x:t.left,y:t.top},m.show=!0,m.target=t,m.list=d.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function B(t){const{key:e,data:i={}}=t.origin||{};let o=i.value;h.point={x:t.left,y:"mark"===e?t.top:t.top+I/2};const n=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,r=k(n);h.list=[`时间 ${r.slice(-5)}`],"mark"===e&&(o=i.name,h.list.unshift(o+" ")),h.sourceData=[{type:"other",key:e,time:r,value:o}],h.isTarget=!0,h.show=!0}function $(t){return t>=C&&t<=A}return function(){var t;if(!(null==(t=null==Y?void 0:Y.horizontal)?void 0:t.length))return;const{horizontal:i}=Y,o=C-5;let n=L+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var d;(d=s).on("moving",(()=>{d.set("originX","center"),b(d)?B(d):h.show=!1})),d.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&b(d))if(X(H.get("horizontal"),d.left,"key",z).includes(d.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:k(d.left),value:d.origin.defaultAddValue},...d.origin};f("add",t),G(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(d)})),c.value.add(s),n+=j}))}(),W(),V(),D(),n.on((()=>{const t="horizontal",e=p(H.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return Y.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);O({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&G(o,i)}}}export{c as useOther};
@@ -11,5 +11,6 @@ export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, p
11
11
  useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
12
12
  useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
13
  useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
+ redrawLinePoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
15
  propItems: any;
15
16
  };
@@ -1 +1 @@
1
- import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as l,watch as n,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 v,flatten as h}from"lodash-es";import"../useEvent.js";import"../useCommon.js";import"../temperature/useShadow.js";import{OTHER_MENU as f}from"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as g}from"./useTop.js";import{useLeft as w}from"./useLeft.js";import{useCenter as y}from"./useCenter.js";import{useOther as b}from"./useOther.js";function x(x,j,C,Y,H,S,T){var D;const M=s(),k=e({redrawPoints:null,clickMenu:null}),A=t();let P=null;const X=m((null==(D=j.data.top)?void 0:D.treeData)||[]),G=a((()=>j.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),N=a((()=>{var e;return null!=(e=j.data.left.width)?e:0})),V=a((()=>{const{grid:e}=j.data;return e.mainXCell*e.subXCell})),L=a((()=>{const{grid:e}=j.data;return e.mainYCell*e.subYCell})),O=a((()=>{const{show:e=!0,tree:t={}}=j.data.top;if(!e)return 0;const{rowNumber:a=X}=t;return X<a?a:X})),E=a((()=>j.data.top.tree.cellHeight)),W=a((()=>E.value*O.value)),I=a((()=>ne(oe("drug")||"top"))),F=a((()=>I.value+W.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=v(V.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:N.value}})),B=function(){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:l=X}=t;X<l&&a.push(...v(l-X).map((()=>({}))));return function e(t,a=0){t.forEach((t=>{var l;const n={top:r*o+I.value,left:a*i,width:i,height:o};if(r++,null==(l=t.children)?void 0:l.length){r--;const i=m(t.children);n.height=i*o,e(t.children,a+1)}else n.width=N.value-n.left;Object.assign(t,n)}))}(a),a}(),J=a((()=>ne(oe("xAxis")||"center"))),K=a((()=>{var e;const{width:t,right:a}=j.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),Q=a((()=>ne(oe("intraoperatively")||"bottom"))),R=a((()=>{var e;const{show:t,height:a}=(null==(e=j.data.other)?void 0:e.mark)||{};return t&&a?a:0})),U=a((()=>Q.value+(j.data.height-W.value-z.value.height-R.value))),Z=a((()=>(K.value-N.value)/V.value)),$=a((()=>(U.value-Q.value)/L.value)),_=a((()=>z.value.spaceTimeStamp/Z.value)),ee=a((()=>{const{scaleValues:e}=j.data;return h(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),te=a((()=>ue("pulse"))),ae=a((()=>ue("temperature"))),re=a((()=>{var e;return(null==(e=j.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),ie=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(O),topGridYCellHeight:r(E),topGridOriginY:r(I),topGridEndY:r(F),treeData:B,xAxis:r(z),originYXAxis:r(J),startTime:r(q),timeXCell:r(_),gridXNumber:r(V),gridYNumber:r(L),xCellWidth:r(Z),yCellHeight:r($),originX:r(N),endX:r(K),originY:r(Q),endY:r(U),markHeight:r(R),itemList:r(ee),scaleValues:j.data.scaleValues,pulseYCell:r(te),temperatureYCell:r(ae),event:r(re),dialog:M});function oe(e){let t="";return Object.entries(G.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function le(e){const t=G.value[e],a=z.value.height;switch(t){case"drug":return W.value;case"xAxis":return a;default:return j.data.height-W.value-a}}function ne(e){switch(e){case"top":return 0;case"center":return le("top");default:return le("top")+le("center")}}function ue(e){const{scaleValues:t}=j.data,a=t.find((t=>t.type===e));return $.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o(),g(x,ie,C,H);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:n,showDialog:u,removeCurrentSelection:s,pauseFlickerPoint:d}=y(x,ie,C,H,S,T);A.value=d,w(x,ie,C,H,a,r,i,l);const{clickMenu:c}=b(x,ie,C,H,S,a,n,u,s);k.redrawPoints=e,k.clickMenu=e=>{const{item:a}=e;a.type&&f.map((e=>e.type)).includes(a.type)?c(e):t(e)}})),l((()=>{A.value()})),T&&n((()=>null==H?void 0:H.point),(()=>{H.movable?(H.show=!0,P&&clearTimeout(P),P=setTimeout((()=>{H.show=!1,H.movable=!1}),3e3)):P&&clearTimeout(P)}),{deep:!0}),{propItems:ie,...u(k)}}export{x as useSurgicalAnesthesiaChart};
1
+ import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as n,onBeforeUnmount as o,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 v,flatten as h}from"lodash-es";import"../useEvent.js";import"../useCommon.js";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as f}from"./useTop.js";import{useLeft as g}from"./useLeft.js";import{useCenter as w}from"./useCenter.js";import{useOther as b}from"./useOther.js";function x(x,y,C,j,Y,M,k){var H;const P=s(),S=e({redrawPoints:null,clickMenu:null,redrawLinePoints:null}),T=t();let D=null;const A=m((null==(H=y.data.top)?void 0:H.treeData)||[]),L=a((()=>y.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),X=a((()=>{var e;return null!=(e=y.data.left.width)?e:0})),G=a((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell})),N=a((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell})),V=a((()=>{const{show:e=!0,tree:t={}}=y.data.top;if(!e)return 0;const{rowNumber:a=A}=t;return A<a?a:A})),O=a((()=>y.data.top.tree.cellHeight)),E=a((()=>O.value*V.value)),W=a((()=>oe(ie("drug")||"top"))),I=a((()=>W.value+E.value)),F=a((()=>{var e;return Date.parse((null==(e=y.data.xAxis)?void 0:e.startTime)||c(new Date,"yyyy-MM-dd HH:mm:ss"))})),_=a((()=>{const e=p(y.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=v(G.value/t+1).map((r=>0===r?e.startTime:c(new Date(F.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:X.value}})),q=function(){const{show:e=!0,tree:t={}}=y.data.top;if(!e)return[];const a=p(y.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:n}=y.data.top.tree,{rowNumber:o=A}=t;A<o&&a.push(...v(o-A).map((()=>({}))));return function e(t,a=0){t.forEach((t=>{var o;const l={top:r*n+W.value,left:a*i,width:i,height:n};if(r++,null==(o=t.children)?void 0:o.length){r--;const i=m(t.children);l.height=i*n,e(t.children,a+1)}else l.width=X.value-l.left;Object.assign(t,l)}))}(a),a}(),z=a((()=>oe(ie("xAxis")||"center"))),B=a((()=>{var e;const{width:t,right:a}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),J=a((()=>oe(ie("intraoperatively")||"bottom"))),K=a((()=>{var e;const{show:t,height:a}=(null==(e=y.data.other)?void 0:e.mark)||{};return t&&a?a:0})),Q=a((()=>J.value+(y.data.height-E.value-_.value.height-K.value))),R=a((()=>(B.value-X.value)/G.value)),U=a((()=>(Q.value-J.value)/N.value)),Z=a((()=>_.value.spaceTimeStamp/R.value)),$=a((()=>{const{scaleValues:e}=y.data;return h(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),ee=a((()=>le("pulse"))),te=a((()=>le("temperature"))),ae=a((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),re=e({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...d,...y.data.borderStyle},pointSelectionStyle:y.data.pointSelectionStyle||{},grid:y.data.grid,top:y.data.top,left:y.data.left,other:y.data.other,topGridYNumber:r(V),topGridYCellHeight:r(O),topGridOriginY:r(W),topGridEndY:r(I),treeData:q,xAxis:r(_),originYXAxis:r(z),startTime:r(F),timeXCell:r(Z),gridXNumber:r(G),gridYNumber:r(N),xCellWidth:r(R),yCellHeight:r(U),originX:r(X),endX:r(B),originY:r(J),endY:r(Q),markHeight:r(K),itemList:r($),scaleValues:y.data.scaleValues,pulseYCell:r(ee),temperatureYCell:r(te),event:r(ae),dialog:P,extraMenuConfig:y.data.extraMenuConfig||{}});function ie(e){let t="";return Object.entries(L.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ne(e){const t=L.value[e],a=_.value.height;switch(t){case"drug":return E.value;case"xAxis":return a;default:return y.data.height-E.value-a}}function oe(e){switch(e){case"top":return 0;case"center":return ne("top");default:return ne("top")+ne("center")}}function le(e){const{scaleValues:t}=y.data,a=t.find((t=>t.type===e));return U.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await n();const{redrawLinePoints:e,clickMenu:t}=f(x,re,C,Y,M),{redrawPoints:a,clickMenu:r,moveLimit:i,setPopup:o,updateData:l,getGridPoints:u,getContainPoints:s,showDialog:d,removeCurrentSelection:c,pauseFlickerPoint:m}=w(x,re,C,Y,M,k);T.value=m,g(x,re,C,Y,i,o,l,u);const{clickMenu:p}=b(x,re,C,Y,M,i,s,d,c);S.redrawPoints=a,S.redrawLinePoints=e,S.clickMenu=e=>{const{item:a}=e;switch(a._type){case"tree":t(e);break;case"other":p(e);break;default:r(e)}}})),o((()=>{T.value()})),k&&l((()=>null==Y?void 0:Y.point),(()=>{Y.movable?(Y.show=!0,D&&clearTimeout(D),D=setTimeout((()=>{Y.show=!1,Y.movable=!1}),3e3)):D&&clearTimeout(D)}),{deep:!0}),{propItems:re,...u(S)}}export{x as useSurgicalAnesthesiaChart};
@@ -2,4 +2,10 @@ import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
4
  import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
- export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): void;
5
+ export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ redrawLinePoints: () => void;
7
+ clickMenu: ({ item, target }: {
8
+ item: AnyObject;
9
+ target: any;
10
+ }) => void;
11
+ };
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e,drawText as i,defaultRectStyle as n,drawTextGroup as o,drawLine as r,drawPoint as l}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as c}from"../useScaleColumn.js";import{useCommon as f}from"../useCommon.js";import"vue";import{getScaleNumberList as u}from"../../utils/index.js";import{isArray as d,cloneDeep as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function p(p,h,g,v,x){const{computedX:L,getXValue:X}=a(h),{originX:C,endX:w,xCellWidth:y,originYXAxis:Y,top:j,canvasWidth:S,borderStyle:b,treeData:G,xAxis:k,topGridYNumber:E,topGridOriginY:I,topGridYCellHeight:M,topGridEndY:z,event:A}=h,{getPointEventProps:$}=f(p,g,h),V=new Set;function D(t,e,i){let n;const{content:o}=t.value||{},{startLine:r,endLine:s,centerLine:a}=e;if(o&&(r||a||s)){const{textStyle:a}=j.dataStyle||{};n=l(o,{fontSize:12,...a,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=N(n,e,i);n&&(n.set(c),n.origin={data:t},T(n),r&&(r.text=n),s&&(s.text=n))}return n}function N(t,e,i){const n=t.width+1,{startLine:o,centerLine:r,endLine:l}=e,s={top:i,originX:"center",originY:"center"};return r&&n<=r.width?s.left=r.x1+r.width/2:l&&n<=l.limitX.x2-l.left?(s.originX="left",s.left=l.left+1):o&&!l&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):r?(s.originY="top",s.left=r.x1+r.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function P(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<C||s>w)return;const{lineStyle:u}=j.dataStyle||{};let d;const m={left:s,top:f};d=i?l("circle",{fill:u.stroke,...m}):n?l(">",{fill:u.stroke,...m,fontSize:18}):r([s,a,s,f],u);const p=new t.Rect({width:y,height:M,fill:"transparent",left:s-y/2,top:a}),h=new t.Group([d,p],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",...$(),lockMovementY:!0});return h.isLeft=o,h.isCustomIcon=i,T(h),h}function T(t){A.hovered&&(t.on("mouseover",(()=>{B(t,"hover")})),t.on("mouseout",(()=>{v.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=N(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),A.hovered&&B(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};g("change",e)}})))}function B(t,e="moving"){var i,n,o;const{data:r}=t.origin;v.point={x:t.left,y:t.top};let[l="",s=""]=r.time||[];if("moving"===e){const e=X(t.left);t.isLeft?l=e:s=e,r.time=[l,s],t.text&&(t.text.origin.data.time=[l,s])}v.list=[`开始时间 ${l}`,`结束时间 ${s}`,`流速 ${(null==(i=r.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=r.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=r.value)?void 0:o.total)||""}`],v.sourceData=[{type:"tree",startTime:l,endTime:s,value:r.value}],v.isTarget=!0,v.show=!0}s(p,{...h,gridYNumber:E,originY:I,yCellHeight:M,endY:z}),function(){const{height:o,list:r,left:l,spaceValue:s,style:a,marginBottom:c}=k;if(!o)return;const f=[],u=Y+(c?o-c:o/2),d=c?"bottom":"center";r.forEach(((t,e)=>{const n=l+e*y*s;f.push(i([n,u],{value:t.slice(11,16),originY:d,...a}))}));const m=f.length>0?new t.Group([...f],{...e,objectCaching:!1}):null;m&&p.value.add(m);const h=new t.Rect({width:S,height:o,left:0,top:Y,...n,originX:"left",originY:"top",...b});p.value.add(h);const{show:g=!0}=j}(),function(){var i;const n=(null==(i=null==j?void 0:j.tree)?void 0:i.textStyle)||{},l=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:a,left:c,top:f,title:u=""}=e,d={value:u,...n};(null==(i=e.children)?void 0:i.length)?(d.value=u.split("").join("\n"),t(e.children)):(d.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=j.dataStyle||{},i=t.top,n=i+M,o=n-M/2,l={y1:i,y2:n,halfY:o};let s=null;const a=m(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&L(u),p=d&&L(d),h=P({...l,x:m},{isCustomIcon:!p&&!f,isContinue:!1,isLeft:!0}),g=P({...l,x:p},{isCustomIcon:!1,isContinue:!!f});let v;if((h||m<C)&&(g||p>w)){v=r([h?m:C,o,g?p:w,o],e)}const x={startLine:h,centerLine:v,endLine:g};let X,y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:r}=e,{startLine:l,endLine:s}=t||{};if(n){n.origin=i;const t={x1:C,x2:r?r.left:w};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):l&&(t.x1=l.left,l.limitX.x2=n.left,n.prevLine=l,l.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(r){r.origin=i;const t={x1:n?n.left:C,x2:w};r.limitX=t,o&&(r.centerLine=o)}n&&r&&(n.nearLine=r,r.nearLine=n)}(s,x,Object.assign({},a,{data:t,index:i})),s&&(X=D(n[i-1],s,o)),i===n.length-1&&(y=D(t,x,o)),s=x,v&&V.add(v),h&&V.add(h),g&&V.add(g),X&&V.add(X),y&&V.add(y)}))}(e)),l.push(o({width:s,height:a,...b},d,{left:c,top:f},!0))}))}(G);const s=l.length>0?new t.Group([...l],{...e,objectCaching:!1}):null;s&&p.value.add(s),V.size&&p.value.add(...V)}(),function(){const{show:i=!0,range:n,spaceValue:o=.5,spaceGridNumber:r=1,style:l,margin:s=5}=(null==j?void 0:j.scaleValue)||{};if(!i||!d(n))return;const a=u(n,o),f=[];if(a.forEach(((t,e)=>{if(0===e||e===a.length-1)return;const i=z-e*M*r;Math.abs(i-I)<1||f.push(c(String(t),{style:l,position:"right"},w+s,i))})),!f.length)return;const m=new t.Group(f,{objectCaching:!1,...e});p.value.add(m)}()}export{p as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e,drawText as n,defaultRectStyle as i,drawTextGroup as o,drawLine as r,drawPoint as l}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as f}from"../../utils/index.js";import{isArray as d,omit as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as p}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function h(h,g,v,x,L){const{computedX:y,getXValue:X}=c(g),{originX:w,endX:C,xCellWidth:Y,originYXAxis:S,top:b,canvasWidth:j,borderStyle:k,treeData:M,xAxis:G,topGridYNumber:E,topGridOriginY:I,topGridYCellHeight:R,topGridEndY:z,event:A,extraMenuConfig:$}=g,{getPointEventProps:P}=u(h,v,g),T=new Set;function V(n=!1){var i;const l=(null==(i=null==b?void 0:b.tree)?void 0:i.textStyle)||{},s=[];!function t(e){e.forEach((e=>{var i;const{width:c,height:a,left:u,top:f,title:d=""}=e,p={value:d,...l};(null==(i=e.children)?void 0:i.length)?(p.value=d.split("").join("\n"),t(e.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=b.dataStyle||{},n=t.top,i=n+R,o=i-R/2,l={y1:n,y2:i,halfY:o};let s=null;const c=m(t,["data","width","height","left","top"]);t.data.forEach(((t,n,i)=>{const a={...c,data:t,index:n},{time:u,continue:f}=t,[d,m]=u,p=d&&y(d),h=m&&y(m),g=H({...l,x:p},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),v=H({...l,x:h},{isCustomIcon:!1,isContinue:!!f});let x,L;if((g||p<w)&&(v||h>C)){const t=g?p:w,n=v?h:C;x=r([t,o,n,o],e),L=B({width:n-t-Y,left:t+(n-t)/2,top:o,onlyRect:!0}),L.origin=a,x.centerLineRect=L}const X={startLine:g,centerLine:x,endLine:v};let S,b;!function(t,e,n){const{startLine:i,centerLine:o,endLine:r}=e,{startLine:l,endLine:s}=t||{};if(i){i.origin=n;const t={x1:w,x2:r?r.left:C};s?(t.x1=s.left,s.limitX.x2=i.left,i.prevLine=s,s.nextLine=i):l&&(t.x1=l.left,l.limitX.x2=i.left,i.prevLine=l,l.nextLine=i),i.limitX=t,o&&(i.centerLine=o)}if(r){r.origin=n;const t={x1:i?i.left:w,x2:C};r.limitX=t,o&&(r.centerLine=o)}i&&r&&(i.nearLine=r,r.nearLine=i)}(s,X,a),s&&(S=D(i[n-1],s,o,a)),n===i.length-1&&(b=D(t,X,o,a)),s=X,x&&T.add(x),L&&T.add(L),g&&T.add(g),v&&T.add(v),S&&T.add(S),b&&T.add(b)}))}(e)),n||s.push(o({width:c,height:a,...k},p,{left:u,top:f},!0))}))}(M);const c=s.length>0?new t.Group([...s],{...e,objectCaching:!1}):null;c&&h.value.add(c),T.size&&h.value.add(...T)}function D(t,e,n,i){let o;const{content:r}=t.value||{},{startLine:s,endLine:c,centerLine:a}=e;if(r&&(s||a||c)){const{textStyle:t}=b.dataStyle||{};o=l(r,{fontSize:12,...t,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const a=N(o,e,n);o&&(o.set(a),o.origin=i,W(o),s&&(s.text=o),c&&(c.text=o))}return o}function N(t,e,n){const i=t.width+1,{startLine:o,centerLine:r,endLine:l}=e,s={top:n,originX:"center",originY:"center"};return r&&i<=r.width?s.left=r.x1+r.width/2:l&&i<=l.limitX.x2-l.left?(s.originX="left",s.left=l.left+1):o&&!l&&i<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&i<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):r?(s.originY="top",s.left=r.x1+r.width/2,s.top=n+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=n+1),s}function B(e){const{bindLine:n,width:i,left:o,top:r,props:l,onlyRect:s=!1}=e,c={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",left:o,top:r},a=new t.Rect({width:i,height:R,fill:"transparent",opacity:.5,...c});if(s)return a.set({lockMovementX:!0,lockMovementY:!0}),W(a),a;const u=new t.Group([n,a],{...c,...l,lockMovementY:!0});return W(u),u}function H(t,{isCustomIcon:e,isContinue:n,isLeft:i}){const{x:o,y1:s,y2:c,halfY:a}=t;if(!o||o<w||o>C)return;const{lineStyle:u}=b.dataStyle||{};let f;const d={left:o,top:a};f=e?l("circle",{fill:u.stroke,...d}):n?l(">",{fill:u.stroke,...d,fontSize:18}):r([o,s,o,a],u);const m=B({...d,width:Y,bindLine:f,props:P()});return m.isLeft=i,m.isCustomIcon=e,m}function W(t){A.hovered&&(t.on("mouseover",(()=>{O(t,"hover")})),t.on("mouseout",(()=>{x.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=N(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),A.hovered&&O(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){var e,n,i,o;if(t.isLeft){t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left);const i=t.limitX.x2-t.left;null==(n=null==(e=t.centerLine)?void 0:e.centerLineRect)||n.setCoords().set({width:i-Y,left:t.left+i/2})}else{t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left);const e=t.left-t.limitX.x1;null==(o=null==(i=t.centerLine)?void 0:i.centerLineRect)||o.setCoords().set({width:e-Y,left:t.limitX.x1+e/2})}}(t);const e={type:"tree",...t.origin};v("change",e)}})))}function O(t,e="moving"){var n,i,o;x.isTarget=!0,x.show=!0;const{data:r}=t.origin;x.point={x:t.left,y:t.top},x.marginTop=R/2;let[l="",s=""]=r.time||[];if("moving"===e){const e=X(t.left);t.isLeft?l=e:s=e,r.time=[l,s],t.text&&(t.text.origin.data.time=[l,s])}x.list=[`开始时间 ${l}`,`结束时间 ${s}`,`流速 ${(null==(n=r.value)?void 0:n.currentSpeed)||""}`,`浓度 ${(null==(i=r.value)?void 0:i.consistence)||""}`,`总量 ${(null==(o=r.value)?void 0:o.total)||""}`],x.sourceData=[{type:"tree",startTime:l,endTime:s,value:r.value}]}return s(h,{...g,gridYNumber:E,originY:I,yCellHeight:R,endY:z}),function(){const{height:o,list:r,left:l,spaceValue:s,style:c,marginBottom:a}=G;if(!o)return;const u=[],f=S+(a?o-a:o/2),d=a?"bottom":"center";r.forEach(((t,e)=>{const i=l+e*Y*s;u.push(n([i,f],{value:t.slice(11,16),originY:d,...c}))}));const m=u.length>0?new t.Group([...u],{...e,objectCaching:!1}):null;m&&h.value.add(m);const p=new t.Rect({width:j,height:o,left:0,top:S,...i,originX:"left",originY:"top",...k});h.value.add(p);const{show:g=!0}=b}(),V(),function(){const{show:n=!0,range:i,spaceValue:o=.5,spaceGridNumber:r=1,style:l,margin:s=5}=(null==b?void 0:b.scaleValue)||{};if(!n||!d(i))return;const c=f(i,o),u=[];if(c.forEach(((t,e)=>{if(0===e||e===c.length-1)return;const n=z-e*R*r;Math.abs(n-I)<1||u.push(a(String(t),{style:l,position:"right"},C+s,n))})),!u.length)return;const m=new t.Group(u,{objectCaching:!1,...e});h.value.add(m)}(),A.evented&&h.value.on("mouse:up",(t=>{3===t.button&&function(t){x.show=!1;const{x:e=0,y:n=0}=t.pointer||{};if(e>=w&&e<=C&&n>=I&&n<=z&&t.target){const e=t.target;L.point={x:e.left,y:e.top},L.show=!0,L.target=e;const{treeMenuList:n=[]}=$;L.list=p.concat(n).map((t=>({...t,renderItem:()=>t.label,type:t.key||t.type,_type:"tree"})))}}(t)})),{redrawLinePoints:function(){var t;T.size&&(null==(t=h.value)||t.remove(...T)),T.clear(),V(!0)},clickMenu:function({item:t,target:e}){var n;if(!e)return;const{type:i}=t,o={...e.origin,type:"tree"};p.map((t=>t.type)).includes(i)?v(i,o):null==(n=$.click)||n.call($,i,o)}}}export{h as useTop};
@@ -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 r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{format as a}from"date-fns";import{getType as u,getTime as d,isOneLine as c,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as y,getIndex as m}from"../../utils/index.js";import{cloneDeep as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as j,PAIN_MENU as k,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,O,C,$,T,V,P,R,A,I){s(E,O);const{getEqualXTypes:X,handleAddPrevent:B,getPointEventProps:D}=L(E,C,O),{createShadowLines:H}=t(),{left:W,xScaleList:z,xCellWidth:F,yCellHeight:_,originX:q,endX:G,originY:N,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie,painSurplusCell:ne,iconsWidth:oe,canvasWidth:le,borderStyle:re}=O,se=new Set,ae=["xinmai","mai"],ue=new Map,de=new Set,ce=new Set,pe=new Set,fe=w(W.yScaleValue),he=new Set;function ve(t){var o;const l=fe.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(se.size&&E.value.remove(...se),se.clear(),ue.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ue.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 ue)t.push(e[1]),e[0]===ae[0]&&e[1].forEach((e=>{(ue.get(ae[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&r.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(pe).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)===ae[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&E.value.remove(e.rightLine):e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...H(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...n,...s}),se.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)],{...s,originX:"center"});e.push(n),se.add(n)}))}E.value.add(...e)}se.add(l),E.value.add(l)}))}}function ge(e,t,s){var a;const{type:u,riseStyle:d={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:L={},belowMinValueStyle:j={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:O,textStyle:V}=L,R=[],I=[],X=[];let B=null;const H=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&we(e.time),W=c(s);if(null==(a=e.list)||a.forEach(((a,c)=>{var L,z,q,G;const N=W?S.find((e=>e.key===a.key)):e,J=xe(H(a)?{...a,value:k.fixedValue}:a,s),K=e.list[c+1],ee=K?xe(H(K)?{...K,value:k.fixedValue}:K,s):void 0,oe=K?W?S.find((e=>e.key===K.key)):e:{},{title:le=""}=N;if(le===((null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.235"))||"脉搏")&&oe.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")&&oe.title===((null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.235"))||"脉搏")||!J||!ee||f(J[0],1)!==f(ee[0],1))J&&B&&(J[0]=B),B=null;else{const e=J[0]-F/2;J[0]=e+F/4,ee[0]=B=J[0]+F/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+_?e[1]+_:e[1]-_,r=l([e[0],o],{value:H(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-_}}(J,a,N),function(e,t,s,a){var c,f,v;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!we(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!t.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=$(t.time);let L,j,S,Y,E,O;if(t.noRise&&p.show){const i=M(p,t)?T(u,35):(null==e?void 0:e[1])||0;if(p.text)S=l([b,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(S);else if(t.value){S=r([b,i,i+2*_],{...p.style})}S&&X.push(S),S&&M(p,t)&&he.add(S)}if(null==e?void 0:e[1]){if(t.rise&&d.show&&d.text&&(Y=l([b,e[1]-(x?_:0)-5],{value:d.text.split("").join("\n"),originY:"bottom",...d.style}),X.push(Y)),t.verified){const t=(null==(c=null==g?void 0:g.position)?void 0:c[w])||"top";E=l(["top-right"===t?b+F/2:b,e[1]-(x?_:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(h(t.physicsReduce)||h(t.drugReduce)){const l=T(u,null!=(f=t.physicsReduce)?f:t.drugReduce),r=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?b+F/2:b;L=i([...e,r,l],{...m,...y.line,...n}),j=o((null==(v=null==y?void 0:y.point)?void 0:v.type)||"circle",{left:r,top:l,...y.point,...n,originY:l===ie?"bottom":"center"}),L&&X.push(L),j&&X.push(j)}t.respirator&&(O=o(k.type,{left:b,top:e[1]-(x?_:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(O))}Object.assign(a,{reduceLine:{obj:L,type:"line"},noRiseText:{obj:S,top:p.text?5:2*_,isFixed:M(p,t)},riseText:{obj:Y,top:(x?-_:0)-5},verifiedText:{obj:E,left:F/2,top:(x?-_:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:O,top:(x?-_:0)-5}})}(J,a,N,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const o=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*_,i=[e[1]-_/2,t];t<U.originY&&(t=e[1]+2.5*_,i=[t,e[1]+_/2]),a=r([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=a?e[1]+_/2+a.height:e[1]+_;d=l([e[0],t],i),X.push(d)}+t.value<s&&(d=l([e[0],e[1]-_],i),X.push(d))}if(j.show&&+t.value<s){const t=e[1];if(j.text)c=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*_;c=r([e[0],t,i],{...j.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-_},belowMinValue:{obj:c,top:j.text?5:2*_,moveHide:!0}})}(J,a,N,re),function(n,l,r,a,d,c){let f,h;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:L="circle"}=d,j=g.height?g.height/2:5,S=e.list[a+1];let Y=w(n),M=w(l);const B=ye(u,e.list[a].value),z=()=>"pulse"==u&&r.pacemakerShow?m.value:H(r)?k.type:B&&"number"===O?0:L,F=e=>e&&p.show&&p.fixed&&we(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(r.breakpoint)return!1;if("temperature"===u&&(n||F(r))&&(l||F(S))){const e=T(u,35);return n||(Y=[$(r.time),e]),l||(M=[$(S.time),e]),!0}return!!n&&!!l})()){Y&&M&&B&&ye(u,S.value)&&!ne[1]&&"icon"===O&&(Y[1]=Y[1]-j,M[1]=M[1]-j),h=i([...Y,...M],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(n&&l&&(null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...y});X.unshift(t),Object.assign(c,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const _=z(),q=I[a-1],G={origin:{data:H(r)?{...r,value:k.fixedValue}:r,title:x,key:b||"",unit:s.unit,type:u,_type:v(x,u),dataIndex:t,index:a,isOneLine:W},leftLine:q,rightLine:h,otherObj:c,...r.pacemakerShow&&"pulse"==u?m.style:H(r)?k.style:g,...D(),lockMovementX:!0,...B?{selectable:!1,evented:!1,..."number"===O?V:{}}:{}};n&&(q?G.leftLine.set("x2",n[0]):G.leftLine=null,f=o(_,{left:n[0],top:B&&!ne[1]?n[1]-j:n[1],...G}));I.push(h),f&&(b===ae[1]?de.add(f):H(r)||ce.add(f),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.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:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=P(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),C("change",n),Le(n,"change")}}))}(f),R.push(f),pe.add(f))}(J,ee,a,c,N,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&f(e.left,1)===f(r.left,1)){const i=e.left-F/2;e.set("left",i+F/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+F/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};ae.forEach((t=>{e[t]=R.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ue.set(t,i(e[t]))}))}else{const{key:t}=e;ue.set(t,i(R))}}const z=I.filter((e=>e));E.value.add(...z,...R,...X)}function ye(e,t){return"pain"===e&&0==t}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||V(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:P(o,e.top);if(h(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(h(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],A.show=!0}function we(e){const[t]=z,i=b(z),n=t.start,o=i.end,l=d(e);return l>=n&&l<=o}function xe(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!we(e.time))return;const n=$(e.time),o=T(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function be(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=d(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=d(`${V(e)}:00`);return ee&&l<d(ee)?(B("exceedMin"),!1):!(l>o)||(B("exceedMax"),!1)}function Le(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=fe.find((e=>e.type===i));if("add"===t){const e=c(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=m(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;je()}function je(){var e;pe.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}([...pe]))),pe.clear(),ke()}function ke(e){ue.clear(),pe.clear(),de.clear(),he.clear(),ce.clear(),fe.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||c(t)&&!e.enable||ge(e,i,t)})))})),ve(),[...pe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=fe.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const i=Object.assign({},S,W.overlap||{}),l=[];de.size&&[...de].forEach((e=>{[...ce].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...n,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),l.push(o(s,{...i[e],...r}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),pe.add(e)}))}))}()}return function(){const t=new e.Rect({left:oe,top:0,width:le-oe-re.strokeWidth,height:ie-re.strokeWidth,fill:"transparent",...re});E.value.add(t)}(),ke((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=T(e.type,e.positionLine.value),n=i([q,t,G,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!O.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){I.point={x:e,y:i},I.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(I.list=[...j]),"pain"===l&&(I.list=[...k]),I.target=n;else{I.target=null,I.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],K.forEach((t=>{if(!X([...pe],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?Z:U;i>=e.originY&&i<=e.endY&&I.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=be(e);n&&1!==I.list.length||(I.show=!1,1===I.list.length&&n&&B("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ie&&C("click:grid",{x:e,y:t,time:V(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,s=y(i,[...j,...k]);s[`${e.type}`]=e.value,s.changeTime=a(new Date,"yyyy-MM-dd HH:mm"),o&&(s.key=t.origin.key);const u={...t.origin,data:s};C("change",u),Le(u,"change")}else{const t={data:{time:V(e.pointer.x),value:P(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};C("add",t),Le(t)}},setPopup:me,isAddPoint:be,updateData:Le,redrawPoints:je,gridPoints:pe,fixedNoRisePoints:he}}function M(e,t){return e.fixed||!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 r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{format as a}from"date-fns";import{getType as u,getTime as d,isOneLine as c,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as y,getIndex as m}from"../../utils/index.js";import{cloneDeep as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import{TEMPERATURE_MENU as j,PAIN_MENU as k,OVERLAP as S}from"../../constants/index.js";import"@vueuse/core";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,O,C,$,T,V,P,R,A,I){s(E,O);const{getEqualXTypes:X,handleAddPrevent:B,getPointEventProps:D}=L(E,C,O),{createShadowLines:H}=t(),{left:W,xScaleList:z,xCellWidth:F,yCellHeight:_,originX:q,endX:G,originY:N,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie,painSurplusCell:ne,iconsWidth:oe,canvasWidth:le,borderStyle:re}=O,se=new Set,ae=["xinmai","mai"],ue=new Map,de=new Set,ce=new Set,pe=new Set,fe=w(W.yScaleValue),he=new Set;function ve(t){var o;const l=fe.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(se.size&&E.value.remove(...se),se.clear(),ue.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ue.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 ue)t.push(e[1]),e[0]===ae[0]&&e[1].forEach((e=>{(ue.get(ae[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&r.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(pe).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)===ae[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&E.value.remove(e.rightLine):e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...H(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...n,...s}),se.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)],{...s,originX:"center"});e.push(n),se.add(n)}))}E.value.add(...e)}se.add(l),E.value.add(l)}))}}function ge(e,t,s){var a;const{type:u,riseStyle:d={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:L={},belowMinValueStyle:j={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:O,textStyle:V}=L,R=[],I=[],X=[];let B=null;const H=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&we(e.time),W=c(s);if(null==(a=e.list)||a.forEach(((a,c)=>{var L,z,q,G;const N=W?S.find((e=>e.key===a.key)):e,J=xe(H(a)?{...a,value:k.fixedValue}:a,s),K=e.list[c+1],ee=K?xe(H(K)?{...K,value:k.fixedValue}:K,s):void 0,oe=K?W?S.find((e=>e.key===K.key)):e:{},{title:le=""}=N;if(le===((null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.235"))||"脉搏")&&oe.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")&&oe.title===((null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.235"))||"脉搏")||!J||!ee||f(J[0],1)!==f(ee[0],1))J&&B&&(J[0]=B),B=null;else{const e=J[0]-F/2;J[0]=e+F/4,ee[0]=B=J[0]+F/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+_?e[1]+_:e[1]-_,r=l([e[0],o],{value:H(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-_}}(J,a,N),function(e,t,s,a){var c,f,v;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!we(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!t.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=$(t.time);let L,j,S,Y,E,O;if(t.noRise&&p.show){const i=M(p,t)?T(u,35):(null==e?void 0:e[1])||0;if(p.text)S=l([b,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(S);else if(t.value){S=r([b,i,i+2*_],{...p.style})}S&&X.push(S),S&&M(p,t)&&he.add(S)}if(null==e?void 0:e[1]){if(t.rise&&d.show&&d.text&&(Y=l([b,e[1]-(x?_:0)-5],{value:d.text.split("").join("\n"),originY:"bottom",...d.style}),X.push(Y)),t.verified){const t=(null==(c=null==g?void 0:g.position)?void 0:c[w])||"top";E=l(["top-right"===t?b+F/2:b,e[1]-(x?_:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(h(t.physicsReduce)||h(t.drugReduce)){const l=T(u,null!=(f=t.physicsReduce)?f:t.drugReduce),r=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?b+F/2:b;L=i([...e,r,l],{...m,...y.line,...n}),j=o((null==(v=null==y?void 0:y.point)?void 0:v.type)||"circle",{left:r,top:l,...y.point,...n,originY:l===ie?"bottom":"center"}),L&&X.push(L),j&&X.push(j)}t.respirator&&(O=o(k.type,{left:b,top:e[1]-(x?_:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(O))}Object.assign(a,{reduceLine:{obj:L,type:"line"},noRiseText:{obj:S,top:p.text?5:2*_,isFixed:M(p,t)},riseText:{obj:Y,top:(x?-_:0)-5},verifiedText:{obj:E,left:F/2,top:(x?-_:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:O,top:(x?-_:0)-5}})}(J,a,N,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const o=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*_,i=[e[1]-_/2,t];t<U.originY&&(t=e[1]+2.5*_,i=[t,e[1]+_/2]),a=r([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=a?e[1]+_/2+a.height:e[1]+_;d=l([e[0],t],i),X.push(d)}+t.value<s&&(d=l([e[0],e[1]-_],i),X.push(d))}if(j.show&&+t.value<s){const t=e[1];if(j.text)c=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*_;c=r([e[0],t,i],{...j.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-_},belowMinValue:{obj:c,top:j.text?5:2*_,moveHide:!0}})}(J,a,N,re),function(n,l,r,a,d,c){let f,h;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:L="circle"}=d,j=g.height?g.height/2:5,S=e.list[a+1];let Y=w(n),M=w(l);const B=ye(u,e.list[a].value),z=()=>"pulse"==u&&r.pacemakerShow?m.value:H(r)?k.type:B&&"number"===O?0:L,F=e=>e&&p.show&&p.fixed&&we(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(r.breakpoint)return!1;if("temperature"===u&&(n||F(r))&&(l||F(S))){const e=T(u,35);return n||(Y=[$(r.time),e]),l||(M=[$(S.time),e]),!0}return!!n&&!!l})()){Y&&M&&B&&ye(u,S.value)&&!ne[1]&&"icon"===O&&(Y[1]=Y[1]-j,M[1]=M[1]-j),h=i([...Y,...M],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(n&&l&&(null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...y});X.unshift(t),Object.assign(c,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const _=z(),q=I[a-1],G={origin:{data:H(r)?{...r,value:k.fixedValue}:r,title:x,key:b||"",unit:s.unit,type:u,_type:v(x,u),dataIndex:t,index:a,isOneLine:W},leftLine:q,rightLine:h,otherObj:c,...r.pacemakerShow&&"pulse"==u?m.style:H(r)?k.style:g,...D(),lockMovementX:!0,...B?{selectable:!1,evented:!1,..."number"===O?V:{}}:{}};n&&(q?G.leftLine.set("x2",n[0]):G.leftLine=null,f=o(_,{left:n[0],top:B&&!ne[1]?n[1]-j:n[1],...G}));I.push(h),f&&(b===ae[1]?de.add(f):H(r)||ce.add(f),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.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:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=P(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),C("change",n),Le(n,"change")}}))}(f),R.push(f),pe.add(f))}(J,ee,a,c,N,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&f(e.left,1)===f(r.left,1)){const i=e.left-F/2;e.set("left",i+F/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+F/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};ae.forEach((t=>{e[t]=R.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ue.set(t,i(e[t]))}))}else{const{key:t}=e;ue.set(t,i(R))}}const z=I.filter((e=>e));E.value.add(...z,...R,...X)}function ye(e,t){return"pain"===e&&0==t}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||V(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:P(o,e.top);if(h(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(h(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],A.show=!0}function we(e){const[t]=z,i=b(z),n=t.start,o=i.end,l=d(e);return l>=n&&l<=o}function xe(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!we(e.time))return;const n=$(e.time),o=T(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function be(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=d(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=d(`${V(e)}:00`);return ee&&l<d(ee)?(B("exceedMin"),!1):!(l>o)||(B("exceedMax"),!1)}function Le(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=fe.find((e=>e.type===i));if("add"===t){const e=c(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=m(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;je()}function je(){var e;pe.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}([...pe]))),pe.clear(),ke()}function ke(e){ue.clear(),pe.clear(),de.clear(),he.clear(),ce.clear(),fe.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||c(t)&&!e.enable||ge(e,i,t)})))})),ve(),[...pe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=fe.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const i=Object.assign({},S,W.overlap||{}),l=[];de.size&&[...de].forEach((e=>{[...ce].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...n,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),l.push(o(s,{...i[e],...r}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),pe.add(e)}))}))}()}return function(){const t=new e.Rect({left:oe,top:0,width:le-oe-re.strokeWidth,height:ie-re.strokeWidth,fill:"transparent",...re});E.value.add(t)}(),ke((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=T(e.type,e.positionLine.value),n=i([q,t,G,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!O.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){I.point={x:e,y:i},I.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(I.list=[...j]),"pain"===l&&(I.list=[...k]),I.target=n;else{I.target=null,I.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],K.forEach((t=>{if(!X([...pe],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?Z:U;i>=e.originY&&i<=e.endY&&I.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=be(e);n&&1!==I.list.length||(I.show=!1,1===I.list.length&&n&&B("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ie&&C("click:grid",{x:e,y:t,time:V(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,s=y(i,[...j,...k]);s[`${e.type}`]=e.value,s.changeTime=a(new Date,"yyyy-MM-dd HH:mm"),o&&(s.key=t.origin.key);const u={...t.origin,data:s};C("change",u),Le(u,"change")}else{const t={data:{time:V(e.pointer.x),value:P(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};C("add",t),Le(t)}},setPopup:me,isAddPoint:be,updateData:Le,redrawPoints:je,gridPoints:pe,fixedNoRisePoints:he}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E as useCenter};
@@ -11,5 +11,6 @@ export declare function useTemperatureChart(canvas: Ref<fabric.Canvas>, props: A
11
11
  useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
12
12
  useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
13
  useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
+ redrawLinePoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
15
  propItems: any;
15
16
  };
@@ -1 +1 @@
1
- import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"@vueuse/core";import"../../constants/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,w,b,Y,x,C){const D=15,j=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=w.data.grid||{};return~K.value?e:[0,0]})),H=a((()=>{var e,a;const t=(null==(a=null==(e=w.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===K.value?t[0]=t[0]+V.value[1]:K.value>0&&(t[2]=t[2]+V.value[0]),t})),X=a((()=>0===K.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:K.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),L=a((()=>{const{top:e}=w.data;return e.date.show&&(e.date.height||D)||0})),P=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||D)||0})),M=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||D)||0})),I=a((()=>{var e,a,t;const{top:l}=w.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||D)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),N=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||D)||0})),O=a((()=>{var e;const{bottom:a}=w.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),R=a((()=>{const{grid:e}=w.data,a=K.value>0?V.value[1]:V.value[0];return e.mainYCell*e.subYCell+H.value[0]+H.value[2]+a})),W=a((()=>{var e;const{width:a,right:t=null,top:l}=w.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),$=a((()=>W.value-H.value[1]*T.value)),q=a((()=>{const{top:e,left:a}=w.data;return e.titleWidth+B.value})),z=a((()=>{const{bottom:e=null,height:a}=w.data;if(!e)return a;return a-(e.height||30)})),G=a((()=>{var e;const{top:a}=w.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||D)||0;return L.value+t+l+P.value+M.value+N.value})),T=a((()=>(W.value-q.value)/k.value)),A=a((()=>(z.value-G.value)/R.value)),B=a((()=>{var e,a;const{left:t}=w.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),E=a((()=>{var e,a;const{top:t,grid:l}=w.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=q.value-T.value;const r=t.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(d(c(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=T.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+T.value/2,scaleCell:(l-t)/T.value}}))));return v(o)})),F=a((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),J=a((()=>{const{left:e}=w.data;return v(e.yScaleValue.filter((e=>e.show)).map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t,isOneLine:o(e)}))))))})),K=a((()=>{const{left:e}=w.data,a=e.yScaleValue.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),Q=a((()=>{const{grid:e}=w.data;return-1===K.value?0:A.value*e.subYCell})),U=a((()=>{const{left:e}=w.data,a={originY:G.value+V.value[0]*A.value,endY:z.value-V.value[1]*A.value};return 0===K.value&&e.yScaleValue.length>1?a.endY=a.originY+Q.value:K.value===e.yScaleValue.length-1&&(a.originY=a.endY-Q.value),a})),Z=a((()=>{const{left:e}=w.data,a={originY:G.value+H.value[0]*A.value,endY:z.value-H.value[2]*A.value};return 0===K.value&&e.yScaleValue.length>1?a.originY=U.value.endY+H.value[0]*A.value:K.value===e.yScaleValue.length-1&&(a.endY=U.value.originY-H.value[2]*A.value),a})),_=a((()=>{var e,a;const{top:t,grid:l}=w.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))})),ee=a((()=>{var e;const{left:a,right:t}=w.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>s(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ae=e({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...u,...w.data.borderStyle||{}},selectionStyle:w.data.selectionStyle||{},dateHeight:L.value,hospitalDaysHeight:P.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:N.value,topList:_.value,breathingHeight:O.value,hospitalizationDate:w.data.hospitalizationDate,grid:w.data.grid,top:w.data.top,left:w.data.left,right:w.data.right,bottom:w.data.bottom,other:w.data.other,painIndex:K.value,painHeight:Q.value,painOriginY:U.value,vitalSignsOriginY:Z.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:B.value,originX:q.value,originY:G.value,endX:W.value,endXLimit:$.value,endY:z.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:ee.value,config:w.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:X.value}),{computedX:te,computedY:le,getXValue:ue,getYValue:ie}=i(ae);return t((()=>S.value),(e=>{e&&function(){h(S,ae);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=m(S,ae,b,te,le,ue,ie,w.addRenderItem,x,C);j.redrawPoints=l,j.clickMenu=u;const{drawScaleValue:o}=p(S,ae,b,e,x,te,le,ue,ie,a,t,i);g(S,ae,o),f(S,ae),y(S,ae,b,te,le,r);const{select:s}=n(S,ae,b);j.select=s}()}),{immediate:!0}),{propItems:ae,...l(j)}}export{S as useTemperatureChart};
1
+ import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../../constants/index.js";import"@vueuse/core";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,w,b,Y,x,C){const D=15,j=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=w.data.grid||{};return~K.value?e:[0,0]})),H=a((()=>{var e,a;const t=(null==(a=null==(e=w.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===K.value?t[0]=t[0]+V.value[1]:K.value>0&&(t[2]=t[2]+V.value[0]),t})),X=a((()=>0===K.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:K.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),L=a((()=>{const{top:e}=w.data;return e.date.show&&(e.date.height||D)||0})),P=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||D)||0})),M=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||D)||0})),I=a((()=>{var e,a,t;const{top:l}=w.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||D)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),N=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||D)||0})),O=a((()=>{var e;const{bottom:a}=w.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),R=a((()=>{const{grid:e}=w.data,a=K.value>0?V.value[1]:V.value[0];return e.mainYCell*e.subYCell+H.value[0]+H.value[2]+a})),W=a((()=>{var e;const{width:a,right:t=null,top:l}=w.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),$=a((()=>W.value-H.value[1]*T.value)),q=a((()=>{const{top:e,left:a}=w.data;return e.titleWidth+B.value})),z=a((()=>{const{bottom:e=null,height:a}=w.data;if(!e)return a;return a-(e.height||30)})),G=a((()=>{var e;const{top:a}=w.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||D)||0;return L.value+t+l+P.value+M.value+N.value})),T=a((()=>(W.value-q.value)/k.value)),A=a((()=>(z.value-G.value)/R.value)),B=a((()=>{var e,a;const{left:t}=w.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),E=a((()=>{var e,a;const{top:t,grid:l}=w.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=q.value-T.value;const r=t.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(d(c(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=T.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+T.value/2,scaleCell:(l-t)/T.value}}))));return v(o)})),F=a((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),J=a((()=>{const{left:e}=w.data;return v(e.yScaleValue.filter((e=>e.show)).map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t,isOneLine:o(e)}))))))})),K=a((()=>{const{left:e}=w.data,a=e.yScaleValue.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),Q=a((()=>{const{grid:e}=w.data;return-1===K.value?0:A.value*e.subYCell})),U=a((()=>{const{left:e}=w.data,a={originY:G.value+V.value[0]*A.value,endY:z.value-V.value[1]*A.value};return 0===K.value&&e.yScaleValue.length>1?a.endY=a.originY+Q.value:K.value===e.yScaleValue.length-1&&(a.originY=a.endY-Q.value),a})),Z=a((()=>{const{left:e}=w.data,a={originY:G.value+H.value[0]*A.value,endY:z.value-H.value[2]*A.value};return 0===K.value&&e.yScaleValue.length>1?a.originY=U.value.endY+H.value[0]*A.value:K.value===e.yScaleValue.length-1&&(a.endY=U.value.originY-H.value[2]*A.value),a})),_=a((()=>{var e,a;const{top:t,grid:l}=w.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))})),ee=a((()=>{var e;const{left:a,right:t}=w.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>s(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ae=e({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...u,...w.data.borderStyle||{}},selectionStyle:w.data.selectionStyle||{},dateHeight:L.value,hospitalDaysHeight:P.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:N.value,topList:_.value,breathingHeight:O.value,hospitalizationDate:w.data.hospitalizationDate,grid:w.data.grid,top:w.data.top,left:w.data.left,right:w.data.right,bottom:w.data.bottom,other:w.data.other,painIndex:K.value,painHeight:Q.value,painOriginY:U.value,vitalSignsOriginY:Z.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:B.value,originX:q.value,originY:G.value,endX:W.value,endXLimit:$.value,endY:z.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:ee.value,config:w.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:X.value}),{computedX:te,computedY:le,getXValue:ue,getYValue:ie}=i(ae);return t((()=>S.value),(e=>{e&&function(){h(S,ae);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=m(S,ae,b,te,le,ue,ie,w.addRenderItem,x,C);j.redrawPoints=l,j.clickMenu=u;const{drawScaleValue:o}=p(S,ae,b,e,x,te,le,ue,ie,a,t,i);g(S,ae,o),f(S,ae),y(S,ae,b,te,le,r);const{select:s}=n(S,ae,b);j.select=s}()}),{immediate:!0}),{propItems:ae,...l(j)}}export{S as useTemperatureChart};
@@ -173,6 +173,7 @@ export type IPointTipProps = {
173
173
  movable: boolean;
174
174
  sourceData: AnyObject[];
175
175
  isTarget: boolean;
176
+ marginTop?: number;
176
177
  };
177
178
  export type IPointMenuProps = Pick<IPointTipProps, 'show' | 'point'> & {
178
179
  list: Array<any>;
@@ -189,5 +190,6 @@ export type IexposeMethods = Partial<{
189
190
  useCaliper: AnyFn | null;
190
191
  useCaliperRuler: AnyFn | null;
191
192
  useRectRuler: AnyFn | null;
193
+ redrawLinePoints: AnyFn | null;
192
194
  }>;
193
195
  export {};
@@ -348,8 +348,8 @@ declare const _default: import("vue").DefineComponent<{
348
348
  type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
349
349
  };
350
350
  }>> & {
351
- onUpdateChecked?: ((...args: any[]) => any) | undefined;
352
351
  onEdit?: ((...args: any[]) => any) | undefined;
352
+ onUpdateChecked?: ((...args: any[]) => any) | undefined;
353
353
  }>>;
354
354
  emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
355
355
  onRemove: () => void;
@@ -488,8 +488,8 @@ declare const _default: import("vue").DefineComponent<{
488
488
  type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
489
489
  };
490
490
  }>> & {
491
- onUpdateChecked?: ((...args: any[]) => any) | undefined;
492
491
  onEdit?: ((...args: any[]) => any) | undefined;
492
+ onUpdateChecked?: ((...args: any[]) => any) | undefined;
493
493
  }, {
494
494
  data: Partial<{
495
495
  [key: string]: any;
@@ -376,8 +376,8 @@ declare const _default: import("vue").DefineComponent<{
376
376
  type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
377
377
  };
378
378
  }>> & {
379
- onUpdateChecked?: ((...args: any[]) => any) | undefined;
380
379
  onEdit?: ((...args: any[]) => any) | undefined;
380
+ onUpdateChecked?: ((...args: any[]) => any) | undefined;
381
381
  }>>;
382
382
  emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
383
383
  onRemove: () => void;
@@ -516,8 +516,8 @@ declare const _default: import("vue").DefineComponent<{
516
516
  type: PropType<(row: AnyObject) => import("vue").VNodeChild>;
517
517
  };
518
518
  }>> & {
519
- onUpdateChecked?: ((...args: any[]) => any) | undefined;
520
519
  onEdit?: ((...args: any[]) => any) | undefined;
520
+ onUpdateChecked?: ((...args: any[]) => any) | undefined;
521
521
  }, {
522
522
  data: Partial<{
523
523
  [key: string]: any;
@@ -536,8 +536,8 @@ declare const _default: import("vue").DefineComponent<{
536
536
  type: PropType<(row: AnyObject) => VNodeChild>;
537
537
  };
538
538
  }>> & {
539
- onUpdateChecked?: ((...args: any[]) => any) | undefined;
540
539
  onEdit?: ((...args: any[]) => any) | undefined;
540
+ onUpdateChecked?: ((...args: any[]) => any) | undefined;
541
541
  }>>;
542
542
  emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
543
543
  onRemove: () => void;
@@ -676,8 +676,8 @@ declare const _default: import("vue").DefineComponent<{
676
676
  type: PropType<(row: AnyObject) => VNodeChild>;
677
677
  };
678
678
  }>> & {
679
- onUpdateChecked?: ((...args: any[]) => any) | undefined;
680
679
  onEdit?: ((...args: any[]) => any) | undefined;
680
+ onUpdateChecked?: ((...args: any[]) => any) | undefined;
681
681
  }, {
682
682
  data: Partial<{
683
683
  [key: string]: any;
@@ -199,8 +199,8 @@ declare const _default: import("vue").DefineComponent<{
199
199
  type: PropType<(row: AnyObject) => VNodeChild>;
200
200
  };
201
201
  }>> & {
202
- onUpdateChecked?: ((...args: any[]) => any) | undefined;
203
202
  onEdit?: ((...args: any[]) => any) | undefined;
203
+ onUpdateChecked?: ((...args: any[]) => any) | undefined;
204
204
  }>>;
205
205
  emit: (event: "edit" | "updateChecked", ...args: any[]) => void;
206
206
  onRemove: () => void;
@@ -339,8 +339,8 @@ declare const _default: import("vue").DefineComponent<{
339
339
  type: PropType<(row: AnyObject) => VNodeChild>;
340
340
  };
341
341
  }>> & {
342
- onUpdateChecked?: ((...args: any[]) => any) | undefined;
343
342
  onEdit?: ((...args: any[]) => any) | undefined;
343
+ onUpdateChecked?: ((...args: any[]) => any) | undefined;
344
344
  }, {
345
345
  data: Partial<{
346
346
  [key: string]: any;
@@ -27,6 +27,10 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
27
27
  type: BooleanConstructor;
28
28
  default: boolean;
29
29
  };
30
+ extraParams: {
31
+ type: import("vue").PropType<import("../../shared/types").AnyObject>;
32
+ default: () => {};
33
+ };
30
34
  }, {
31
35
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
32
36
  token: {
@@ -56,12 +60,17 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
56
60
  type: BooleanConstructor;
57
61
  default: boolean;
58
62
  };
63
+ extraParams: {
64
+ type: import("vue").PropType<import("../../shared/types").AnyObject>;
65
+ default: () => {};
66
+ };
59
67
  }>> & {
60
68
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
61
69
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
62
70
  "onSession-change"?: ((...args: any[]) => any) | undefined;
71
+ "onSession-close"?: ((...args: any[]) => any) | undefined;
63
72
  }>>;
64
- emit: (event: "template-click" | "unread-message-update" | "session-change", ...args: any[]) => void;
73
+ emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
65
74
  loading: import("vue").Ref<boolean>;
66
75
  data: {
67
76
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
@@ -106,7 +115,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
106
115
  setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
107
116
  setUpdateSessionItem: (item: import("../../shared/types").AnyObject) => void;
108
117
  setSessionList: (list: import("../../shared/types").AnyObject[]) => void;
109
- emit: (event: "template-click" | "unread-message-update" | "session-change", ...args: any[]) => void;
118
+ emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
110
119
  };
111
120
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
112
121
  state: {
@@ -257,6 +266,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
257
266
  isGroupLeader: import("vue").ComputedRef<boolean>;
258
267
  isEnded: import("vue").ComputedRef<boolean>;
259
268
  setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
269
+ emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
260
270
  showChatSet: import("vue").Ref<boolean>;
261
271
  showChatFile: import("vue").Ref<boolean>;
262
272
  chatFileType: import("vue").Ref<string>;
@@ -1386,7 +1396,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1386
1396
  }>> & {}>>;
1387
1397
  describeBodyRef: import("vue").Ref<any>;
1388
1398
  showMore: import("vue").Ref<boolean>;
1389
- emit: (event: "template-click" | "unread-message-update" | "session-change", ...args: any[]) => void;
1399
+ emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
1390
1400
  isOverflow: import("vue").ComputedRef<boolean>;
1391
1401
  setting: import("vue").ComputedRef<any>;
1392
1402
  serverSetting: import("vue").ComputedRef<any>;
@@ -2390,7 +2400,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2390
2400
  MicOff: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2391
2401
  Close: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2392
2402
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2393
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update" | "session-change")[], "template-click" | "unread-message-update" | "session-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
2403
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update" | "session-change" | "session-close")[], "template-click" | "unread-message-update" | "session-change" | "session-close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
2394
2404
  token: {
2395
2405
  type: StringConstructor;
2396
2406
  required: true;
@@ -2418,13 +2428,19 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
2418
2428
  type: BooleanConstructor;
2419
2429
  default: boolean;
2420
2430
  };
2431
+ extraParams: {
2432
+ type: import("vue").PropType<import("../../shared/types").AnyObject>;
2433
+ default: () => {};
2434
+ };
2421
2435
  }>> & {
2422
2436
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
2423
2437
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
2424
2438
  "onSession-change"?: ((...args: any[]) => any) | undefined;
2439
+ "onSession-close"?: ((...args: any[]) => any) | undefined;
2425
2440
  }, {
2426
2441
  show: boolean;
2427
2442
  showHeader: boolean;
2428
2443
  baseURL: string;
2444
+ extraParams: import("../../shared/types").AnyObject;
2429
2445
  }>>;
2430
2446
  export default IhoChat;
@@ -28,6 +28,10 @@ declare const _default: import("vue").DefineComponent<{
28
28
  type: BooleanConstructor;
29
29
  default: boolean;
30
30
  };
31
+ extraParams: {
32
+ type: PropType<AnyObject>;
33
+ default: () => {};
34
+ };
31
35
  }, {
32
36
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
33
37
  token: {
@@ -57,12 +61,17 @@ declare const _default: import("vue").DefineComponent<{
57
61
  type: BooleanConstructor;
58
62
  default: boolean;
59
63
  };
64
+ extraParams: {
65
+ type: PropType<AnyObject>;
66
+ default: () => {};
67
+ };
60
68
  }>> & {
61
69
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
62
70
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
63
71
  "onSession-change"?: ((...args: any[]) => any) | undefined;
72
+ "onSession-close"?: ((...args: any[]) => any) | undefined;
64
73
  }>>;
65
- emit: (event: "template-click" | "unread-message-update" | "session-change", ...args: any[]) => void;
74
+ emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
66
75
  loading: import("vue").Ref<boolean>;
67
76
  data: {
68
77
  cssVars: import("vue").ComputedRef<AnyObject>;
@@ -107,7 +116,7 @@ declare const _default: import("vue").DefineComponent<{
107
116
  setCurrentSessionItem: (item: AnyObject) => void;
108
117
  setUpdateSessionItem: (item: AnyObject) => void;
109
118
  setSessionList: (list: AnyObject[]) => void;
110
- emit: (event: "template-click" | "unread-message-update" | "session-change", ...args: any[]) => void;
119
+ emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
111
120
  };
112
121
  cssVars: import("vue").ComputedRef<AnyObject>;
113
122
  state: {
@@ -258,6 +267,7 @@ declare const _default: import("vue").DefineComponent<{
258
267
  isGroupLeader: import("vue").ComputedRef<boolean>;
259
268
  isEnded: import("vue").ComputedRef<boolean>;
260
269
  setCurrentSessionItem: (item: AnyObject) => void;
270
+ emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
261
271
  showChatSet: import("vue").Ref<boolean>;
262
272
  showChatFile: import("vue").Ref<boolean>;
263
273
  chatFileType: import("vue").Ref<string>;
@@ -1387,7 +1397,7 @@ declare const _default: import("vue").DefineComponent<{
1387
1397
  }>> & {}>>;
1388
1398
  describeBodyRef: import("vue").Ref<any>;
1389
1399
  showMore: import("vue").Ref<boolean>;
1390
- emit: (event: "template-click" | "unread-message-update" | "session-change", ...args: any[]) => void;
1400
+ emit: (event: "template-click" | "unread-message-update" | "session-change" | "session-close", ...args: any[]) => void;
1391
1401
  isOverflow: import("vue").ComputedRef<boolean>;
1392
1402
  setting: import("vue").ComputedRef<any>;
1393
1403
  serverSetting: import("vue").ComputedRef<any>;
@@ -2391,7 +2401,7 @@ declare const _default: import("vue").DefineComponent<{
2391
2401
  MicOff: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2392
2402
  Close: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2393
2403
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2394
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update" | "session-change")[], "template-click" | "unread-message-update" | "session-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
2404
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("template-click" | "unread-message-update" | "session-change" | "session-close")[], "template-click" | "unread-message-update" | "session-change" | "session-close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
2395
2405
  token: {
2396
2406
  type: StringConstructor;
2397
2407
  required: true;
@@ -2419,13 +2429,19 @@ declare const _default: import("vue").DefineComponent<{
2419
2429
  type: BooleanConstructor;
2420
2430
  default: boolean;
2421
2431
  };
2432
+ extraParams: {
2433
+ type: PropType<AnyObject>;
2434
+ default: () => {};
2435
+ };
2422
2436
  }>> & {
2423
2437
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
2424
2438
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
2425
2439
  "onSession-change"?: ((...args: any[]) => any) | undefined;
2440
+ "onSession-close"?: ((...args: any[]) => any) | undefined;
2426
2441
  }, {
2427
2442
  show: boolean;
2428
2443
  showHeader: boolean;
2429
2444
  baseURL: string;
2445
+ extraParams: AnyObject;
2430
2446
  }>;
2431
2447
  export default _default;