cnhis-design-vue 3.2.19-beta.1 → 3.2.19-beta.11

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 (126) hide show
  1. package/es/components/ai-chat/index.d.ts +17 -144
  2. package/es/components/ai-chat/src/Index.vue.d.ts +17 -144
  3. package/es/components/ai-chat/src/Index.vue2.js +1 -1
  4. package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +2 -2
  5. package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -1
  6. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +2 -52
  8. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  9. package/es/components/ai-chat/src/components/ChatMain.d.ts +7 -1
  10. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  11. package/es/components/ai-chat/src/utils/index.d.ts +0 -1
  12. package/es/components/ai-chat/src/utils/index.js +1 -1
  13. package/es/components/ai-chat/style/index.css +1 -1
  14. package/es/components/audio-sdk/src/audioSDK.d.ts +7 -6
  15. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  16. package/es/components/audio-sdk/src/utils/recordingModal.d.ts +1 -2
  17. package/es/components/audio-sdk/src/utils/recordingModal.js +1 -1
  18. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  19. package/es/components/{template-render → card-render}/index.d.ts +2 -2
  20. package/es/components/card-render/index.js +1 -0
  21. package/es/components/card-render/src/CardRender.vue.js +1 -0
  22. package/es/components/card-render/src/CardRender.vue2.js +1 -0
  23. package/es/components/{template-render → card-render}/src/components/Button.vue2.js +1 -1
  24. package/es/components/card-render/src/components/Field.vue2.js +1 -0
  25. package/es/components/{template-render → card-render}/src/components/FieldGroup.vue2.js +1 -1
  26. package/es/components/{template-render → card-render}/src/components/Label.vue2.js +1 -1
  27. package/es/components/card-render/src/components/Row.vue2.js +1 -0
  28. package/es/components/card-render/src/components/Text.vue2.js +1 -0
  29. package/es/components/card-render/style/index.css +1 -0
  30. package/es/components/editor/src/Editor.js +1 -1
  31. package/es/components/editor/style/index.css +0 -1
  32. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
  37. package/es/components/fabric-chart/src/interface.d.ts +2 -0
  38. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
  39. package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/index.d.ts +1 -0
  40. package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/index.js +1 -0
  41. package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/remoteFilter.vue.d.ts +68 -0
  42. package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/remoteFilter.vue.js +1 -0
  43. package/es/components/iho-table/src/plugins/filterRemoteSearchPlugin/remoteFilter.vue2.js +1 -0
  44. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +7 -9
  45. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  46. package/es/components/iho-table/src/plugins/index.js +1 -1
  47. package/es/components/iho-table/src/plugins/pluginHooks/index.d.ts +1 -0
  48. package/es/components/iho-table/src/plugins/pluginHooks/index.js +1 -0
  49. package/es/components/iho-table/src/plugins/pluginHooks/useFilter.d.ts +21 -0
  50. package/es/components/iho-table/src/plugins/pluginHooks/useFilter.js +1 -0
  51. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +13 -0
  52. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue2.js +1 -1
  53. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
  54. package/es/components/iho-table/src/types/index.d.ts +3 -1
  55. package/es/components/iho-table/src/utils/index.d.ts +1 -0
  56. package/es/components/iho-table/src/utils/index.js +1 -1
  57. package/es/components/index.css +1 -1
  58. package/es/components/index.d.ts +2 -2
  59. package/es/components/index.js +1 -1
  60. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  61. package/es/components/shortcut-provider/src/types/index.d.ts +3 -0
  62. package/es/components/shortcut-provider/src/utils/index.d.ts +1 -1
  63. package/es/components/shortcut-provider/src/utils/index.js +1 -1
  64. package/es/shared/package.json.js +1 -1
  65. package/es/shared/types/business.d.ts +14 -0
  66. package/package.json +2 -2
  67. package/es/components/ai-chat/src/api/index.d.ts +0 -6
  68. package/es/components/ai-chat/src/api/index.js +0 -1
  69. package/es/components/ai-chat/src/components/ChatAudio.vue.d.ts +0 -40
  70. package/es/components/ai-chat/src/components/ChatAudio.vue.js +0 -1
  71. package/es/components/ai-chat/src/components/ChatAudio.vue2.js +0 -1
  72. package/es/components/ai-chat/src/components/ChatMainInner.d.ts +0 -2
  73. package/es/components/ai-chat/src/components/ChatMainInner.js +0 -1
  74. package/es/components/ai-chat/src/components/ChatRight.vue.d.ts +0 -56
  75. package/es/components/ai-chat/src/components/ChatRight.vue.js +0 -1
  76. package/es/components/ai-chat/src/components/ChatRight.vue2.js +0 -1
  77. package/es/components/ai-chat/src/components/card/JsonCard.d.ts +0 -25
  78. package/es/components/ai-chat/src/components/card/JsonCard.js +0 -1
  79. package/es/components/ai-chat/src/components/card/SelectIcon.d.ts +0 -14
  80. package/es/components/ai-chat/src/components/card/SelectIcon.js +0 -1
  81. package/es/components/ai-chat/src/hooks/useProgram.d.ts +0 -6
  82. package/es/components/ai-chat/src/hooks/useProgram.js +0 -1
  83. package/es/components/ai-chat/src/hooks/useWebsocket.d.ts +0 -2
  84. package/es/components/ai-chat/src/hooks/useWebsocket.js +0 -1
  85. package/es/components/template-render/index.js +0 -1
  86. package/es/components/template-render/src/TemplateRender.vue.js +0 -1
  87. package/es/components/template-render/src/TemplateRender.vue2.js +0 -1
  88. package/es/components/template-render/src/components/Field.vue2.js +0 -1
  89. package/es/components/template-render/src/components/Row.vue2.js +0 -1
  90. package/es/components/template-render/src/components/Text.vue2.js +0 -1
  91. package/es/components/template-render/style/index.css +0 -1
  92. package/es/shared/assets/img/file-emr.png.js +0 -1
  93. package/es/shared/assets/img/file.png.js +0 -1
  94. package/es/shared/assets/img/use.png.js +0 -1
  95. /package/es/components/{template-render/src/TemplateRender.vue.d.ts → card-render/src/CardRender.vue.d.ts} +0 -0
  96. /package/es/components/{template-render → card-render}/src/components/Box.vue.d.ts +0 -0
  97. /package/es/components/{template-render → card-render}/src/components/Box.vue.js +0 -0
  98. /package/es/components/{template-render → card-render}/src/components/Box.vue2.js +0 -0
  99. /package/es/components/{template-render → card-render}/src/components/Button.vue.d.ts +0 -0
  100. /package/es/components/{template-render → card-render}/src/components/Button.vue.js +0 -0
  101. /package/es/components/{template-render → card-render}/src/components/Divider.vue.d.ts +0 -0
  102. /package/es/components/{template-render → card-render}/src/components/Divider.vue.js +0 -0
  103. /package/es/components/{template-render → card-render}/src/components/Divider.vue2.js +0 -0
  104. /package/es/components/{template-render → card-render}/src/components/Field.vue.d.ts +0 -0
  105. /package/es/components/{template-render → card-render}/src/components/Field.vue.js +0 -0
  106. /package/es/components/{template-render → card-render}/src/components/FieldGroup.vue.d.ts +0 -0
  107. /package/es/components/{template-render → card-render}/src/components/FieldGroup.vue.js +0 -0
  108. /package/es/components/{template-render → card-render}/src/components/Image.vue.d.ts +0 -0
  109. /package/es/components/{template-render → card-render}/src/components/Image.vue.js +0 -0
  110. /package/es/components/{template-render → card-render}/src/components/Image.vue2.js +0 -0
  111. /package/es/components/{template-render → card-render}/src/components/Label.vue.d.ts +0 -0
  112. /package/es/components/{template-render → card-render}/src/components/Label.vue.js +0 -0
  113. /package/es/components/{template-render → card-render}/src/components/Row.vue.d.ts +0 -0
  114. /package/es/components/{template-render → card-render}/src/components/Row.vue.js +0 -0
  115. /package/es/components/{template-render → card-render}/src/components/Slot.d.ts +0 -0
  116. /package/es/components/{template-render → card-render}/src/components/Slot.js +0 -0
  117. /package/es/components/{template-render → card-render}/src/components/Text.vue.d.ts +0 -0
  118. /package/es/components/{template-render → card-render}/src/components/Text.vue.js +0 -0
  119. /package/es/components/{template-render → card-render}/src/components/index.d.ts +0 -0
  120. /package/es/components/{template-render → card-render}/src/components/index.js +0 -0
  121. /package/es/components/{template-render → card-render}/src/constants/index.d.ts +0 -0
  122. /package/es/components/{template-render → card-render}/src/constants/index.js +0 -0
  123. /package/es/components/{template-render → card-render}/src/hooks/useCommon.d.ts +0 -0
  124. /package/es/components/{template-render → card-render}/src/hooks/useCommon.js +0 -0
  125. /package/es/components/{template-render → card-render}/src/utils/index.d.ts +0 -0
  126. /package/es/components/{template-render → card-render}/src/utils/index.js +0 -0
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as d,cloneDeep as u,omit as f,flatten as h,isNumber as g,pick as m}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const x=d(v,(t=>"add"!==t.type));function y(d,v,y,k,C,w,X,b,E){const{computedX:A,getXValue:L}=r(v),{getEqualXTypes:j,handleAddPrevent:P,isGridLimit:S,getPointEventProps:z}=s(d,y,v),{createShadowLines:I}=l(),{canvasWidth:M,other:T,yCellHeight:H,xCellWidth:O,endX:$,originX:B,originY:W,endY:Y,markHeight:D,event:_,topGridYCellHeight:V,extracorporealCirculationHeight:G}=v,K=new Map,R=u(T);let q=[],F=null;function J(){var o;if(!(null==(o=null==R?void 0:R.horizontal)?void 0:o.length))return;const n="horizontal";K.set(n,[]);const{horizontal:r}=R;let a=W+H/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:g,value:m}=o,p=A(g);if(!ot(p))return;const v=[],x=f&&e(s,{...c,left:p,top:a});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,a],{value:m,...d,originX:"left"});v.push(k);const C=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...z()});Object.assign(C,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:B,x2:$-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,tt(C),K.get(n).push(C)})),a+=H})),d.value.add(...K.get(n))}function N(){var t;if(!(null==(t=null==R?void 0:R.vertical)?void 0:t.length))return;const i="vertical";K.set(i,[]);const{vertical:o}=R;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!ot(c))return;const{lineHeight:d=H}=a;let u=W+r+d/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...z()});u+=d,tt(r),K.get(i).push(r)}));const f=K.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=c>$-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),d.value.add(...K.get(i))}function Q(t,e="add"){const{dataIndex:i,data:o,index:n,key:r,dataKey:a,time:l}=t,s=R[r],d=["mark","extracorporealCirculation"].includes(r)?s.dataList[i]:s[i];switch(e){case"remove":d.data.splice(n,1);break;case"change":if("mark"===r){d.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(o):(s.dataList.push({time:l,list:[o]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?d[a]=o:d.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=c(t,d.data),i=Array.isArray(o)?o:[o];d.data.splice(e,0,...i);break}}U(t)}function U(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...K.get(i)),K.delete(i),i){case"horizontal":J();break;case"vertical":N();break;case"mark":Z();break;case"extracorporealCirculation":rt()}}function Z(){if(!D)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=R.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";K.set(a,[]);const l=i([B-5,Y+D/2],{value:t,...o,originX:"right"});d.value.add(l);const s=Y+D+G,c=Y+G;let u=0;const f={};r.forEach(((t,i)=>{const{time:o,list:r=[]}=t,l=A(o);if(!ot(l))return;let h=c+1;r.forEach(((t,o)=>{var r;const{style:g}=t,m=e((null==g?void 0:g.type)||"circleAndText",{...(null==g?void 0:g.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:i,index:o}}),p=m.height;u&&l-u<=O&&(null==(r=f[`x_${u}`])||r.forEach((([t,e])=>{h+p>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:v,startTop:x,oldStartTop:y}=function(t,e){const i={};let o;if(t>Y){const r=t+e;i.y2=t+e/2,r>=s?n(Y-1):(o=t,t=r)}else n(t);function n(n){o=n,i.y2=n-e/2;t=n-e}return{topObj:i,startTop:t,oldStartTop:o}}(h,p);h=x,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",v.y2),K.get(a).push(m),tt(m),d.value.add(m)})),u=l})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:B,x2:$};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(K.get(a))}function tt(t){if(_.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{k.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{t.moving=!0,i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+G+D-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:i}=t,o=p(new Date,"yyyy-MM-dd HH:mm"),n=A(o);i.isCurrentTime&&i.x2<n&&n>0&&n<M&&(i.x2=n);e<i.x1&&t.set({x1:i.x1,x2:i.x1});e>i.x2&&t.set({x1:i.x2,x2:i.x2});it(t,"left"),it(t,"right")}(t):(w(t),function(t){const e=t.left+t.maxTextWidth>$?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),_.hovered&&et(t)})),t.on("mouseup",(r=>{var a;if(k.show=!1,1===r.button){if(!t.moving)return;t.moving=!1,i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=L(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),y("change",r),n&&Q(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(C.point={x:t.left,y:t.top},C.show=!0,C.target=t,C.list=x.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function et(t){k.isTarget=!0,k.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;const n="extracorporealCirculation"===e||"mark"===e;k.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=L(r);k.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(o=i.name),k.list.unshift(o+" ")),k.sourceData=[{type:"other",key:e,time:a,value:o}]}function it(t,e){const{shadowObjs:i,params:o}=t[`${e}ShadowBox`]||{};if(!i||!o)return;i.forEach((t=>d.value.remove(t)));o["left"===e?1:0]=t.left;const n=nt(...o);t[`${e}ShadowBox`]={shadowObjs:n,params:o}}function ot(t){return t>=B&&t<=$}function nt(...e){const[i,o,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),u=[[i,Y],[o,Y],[o,r],[i,r]],h=new t.Polygon(u.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),g=[];return["slash"].includes(l)&&g.push(...I(u,s.angle,s.space,c)),d.value.add(h,...g),K.get("extracorporealCirculation").push(h,...g),[h,...g]}function rt(){if(!G)return;const{dataList:e,ascendAortaStyle:i,extracorporealCirculationStyle:o}=R.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";K.set(n,[]);const r=Y+G;let a,l;function s(t){return t&&t>B&&t<M}function c(t){return void 0===t||""===t}e.forEach(((u,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:i,openAscendAorta:o,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),i&&(a=A(i.time)),o&&(l=A(o.time)),n&&(s=A(n.time)),[r,a,l,s]}(u);if(-1===h.findIndex((t=>t>0&&t<M)))return;let g;h.forEach(((m,v)=>{if(c(m))return;const x=h[v+1],y=h[v-1];if(s(m)||s(x)){const k=s(m)?m:B,C=s(x)?x:c(x)?null:$,w=s(y)?y:B,X={};if(v<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(v)?o:i],X.shadowObjs=nt(...X.params)),s(m)){const i=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(v),o=p(new Date,"yyyy-MM-dd HH:mm"),c=A(o),x=m<c&&s(c)?c:m,y=function(e,i){const o=new t.Line(e,{...i,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return tt(o),d.value.add(o),K.get("extracorporealCirculation").push(o),o}([m,Y,m,r],{origin:{dataIndex:f,dataKey:i,key:n,data:u[i],type:"other"},limitX:{x1:0===v?null!=a?a:B:w,x2:C||x,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(v)?{leftShadowBox:g}:{},...[0,1,2].includes(v)?{rightShadowBox:X}:{}});v===h.length-1&&(a=m,l=y),0===v&&l&&(l.limitX.x2=k)}g=X}}))}))}function at(t){const{code:e}=t;F&&(e.includes("Enter")||e.includes("Esc"))&&(e.includes("Esc")&&(F.text=""),F.exitEditing(),d.value.discardActiveObject(F))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,i=A(t),n=o([i,0,i,Y],e);d.value.add(n)}(),function(){var t;if(!(null==(t=null==R?void 0:R.horizontal)?void 0:t.length))return;q=[];const{horizontal:i}=R,o=B-5;let n=W+H/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l,data:s=[]}=t,c=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;q.push({type:"other",title:r,key:"horizontal",dataIndex:i,dataList:s.map((t=>A(t.time))),y1:n-c.height/2,y2:n+c.height/2}),(u=c).on("moving",(()=>{u.set("originX","center"),S(u)?et(u):k.show=!1})),u.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&S(u))if(j(K.get("horizontal"),u.left,"key",O).includes(u.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:L(u.left),value:u.origin.defaultAddValue},...u.origin};y("add",f(t,["isMenu"])),Q(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(c),n+=H}))}(),J(),N(),Z(),rt(),a.on((()=>{const t="horizontal",e=X(K.get(t));e.length>0?b((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const i=e[t];return R.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);U({key:t}),y("remove",i)})):E()})),_.evented&&(window.addEventListener("keydown",at,!0),d.value.on("mouse:up",(e=>{var i,o,n,r;if(1===e.button){const{target:a,pointer:l={}}=e,{x:s=0,y:c=0}=l;if(!S({left:s,top:c}))return;if(!(null==q?void 0:q.length)||F)return;if(a&&"horizontal"!==(null==(i=a.origin)?void 0:i.key))return;let u="";if(a){if(a.moving)return;u=null==(r=null==(n=null==(o=a.origin)?void 0:o.data)?void 0:n.value)?void 0:r.toString()}const f=q.find((({y1:t,y2:e})=>c>=t&&c<=e));g(null==f?void 0:f.dataIndex)&&(F=new t.Textbox(u,{left:s,top:c,width:100,height:100,fontSize:18,objectCaching:!1,hasControls:!1,borderColor:"#000",editingBorderColor:"#000",backgroundColor:"#fff",fontFamily:"微软雅黑"}),F.otherListPointHeightRangeItem={...f,left:s,target:a},d.value.add(F),d.value.setActiveObject(F),F.enterEditing(),u&&F.setSelectionEnd(u.length))}})),d.value.on("selection:cleared",(({deselected:t})=>{var e;if(null==t?void 0:t.find((t=>t.otherListPointHeightRangeItem))){let{text:t}=F;const{otherListPointHeightRangeItem:i}=F;if(t=t.replace(/^\s+|\s+$/g,""),d.value.remove(F),F=null,!t)return;const{left:o,target:n}=i;if(n){if(t==(null==(e=n.origin)?void 0:e.data.value))return;const i={...n.origin,data:{...n.origin.data,value:t}};y("change",i),Q(i,"change")}else{const e={...m(i,["title","type","key","dataIndex"]),data:{time:L(o),value:t}};y("add",e),Q(e)}}}))),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};y(i,n),"remove"===i&&Q(n,i)},handleKeydown:at}}export{y as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as d,cloneDeep as u,omit as f,flatten as h,isNumber as g,pick as m}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const x=d(v,(t=>"add"!==t.type));function y(d,v,y,k,C,w,X,b,E){const{computedX:A,getXValue:L}=r(v),{getEqualXTypes:j,handleAddPrevent:P,isGridLimit:S,getPointEventProps:z}=s(d,y,v),{createShadowLines:I}=l(),{canvasWidth:M,other:T,yCellHeight:H,xCellWidth:O,endX:$,originX:B,originY:W,endY:Y,markHeight:D,event:_,topGridYCellHeight:V,extracorporealCirculationHeight:G}=v,K=new Map,R=u(T);let q=[],F=null;function J(){var o;if(!(null==(o=null==R?void 0:R.horizontal)?void 0:o.length))return;const n="horizontal";K.set(n,[]);const{horizontal:r}=R;let a=W+H/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:g,value:m}=o,p=A(g);if(!ot(p))return;const v=[],x=f&&e(s,{...c,left:p,top:a});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,a],{value:m,...d,originX:"left"});v.push(k);const C=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...z()});Object.assign(C,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:B,x2:$-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,tt(C),K.get(n).push(C)})),a+=H})),d.value.add(...K.get(n))}function N(){var t;if(!(null==(t=null==R?void 0:R.vertical)?void 0:t.length))return;const i="vertical";K.set(i,[]);const{vertical:o}=R;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!ot(c))return;const{lineHeight:d=H}=a;let u=W+r+d/2;l.forEach(((t,n)=>{const r=e(String(t.value),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:t},...z()});u+=d,tt(r),K.get(i).push(r)}));const f=K.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=c>$-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),d.value.add(...K.get(i))}function Q(t,e="add"){const{dataIndex:i,data:o,index:n,key:r,dataKey:a,time:l}=t,s=R[r],d=["mark","extracorporealCirculation"].includes(r)?s.dataList[i]:s[i];switch(e){case"remove":d.data.splice(n,1);break;case"change":if("mark"===r){d.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(o):(s.dataList.push({time:l,list:[o]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?d[a]=o:d.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=c(t,d.data),i=Array.isArray(o)?o:[o];d.data.splice(e,0,...i);break}}U(t)}function U(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...K.get(i)),K.delete(i),i){case"horizontal":J();break;case"vertical":N();break;case"mark":Z();break;case"extracorporealCirculation":rt()}}function Z(){if(!D)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=R.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";K.set(a,[]);const l=i([B-5,Y+D/2],{value:t,...o,originX:"right"});d.value.add(l);const s=Y+D+G,c=Y+G;let u=0;const f={};r.forEach(((t,i)=>{const{time:o,list:r=[]}=t,l=A(o);if(!ot(l))return;let h=c+1;r.forEach(((t,o)=>{var r;const{style:g}=t,m=e((null==g?void 0:g.type)||"circleAndText",{...(null==g?void 0:g.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:i,index:o}}),p=m.height;u&&l-u<=O&&(null==(r=f[`x_${u}`])||r.forEach((([t,e])=>{h+p>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:v,startTop:x,oldStartTop:y}=function(t,e){const i={};let o;if(t>Y){const r=t+e;i.y2=t+e/2,r>=s?n(Y-1):(o=t,t=r)}else n(t);function n(n){o=n,i.y2=n-e/2;t=n-e}return{topObj:i,startTop:t,oldStartTop:o}}(h,p);h=x,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",v.y2),K.get(a).push(m),tt(m),d.value.add(m)})),u=l})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:B,x2:$};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(K.get(a))}function tt(t){if(_.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{k.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{t.moving=!0,i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+G+D-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:i}=t,o=p(new Date,"yyyy-MM-dd HH:mm"),n=A(o);i.isCurrentTime&&i.x2<n&&n>0&&n<M&&(i.x2=n);e<i.x1&&t.set({x1:i.x1,x2:i.x1});e>i.x2&&t.set({x1:i.x2,x2:i.x2});it(t,"left"),it(t,"right")}(t):(w(t),function(t){const e=t.left+t.maxTextWidth>$?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),_.hovered&&et(t)})),t.on("mouseup",(r=>{var a;if(k.show=!1,1===r.button){if(!t.moving)return;t.moving=!1,i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=L(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),y("change",r),n&&Q(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(C.point={x:t.left,y:t.top},C.show=!0,C.target=t,C.list=x.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function et(t){k.isTarget=!0,k.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;const n="extracorporealCirculation"===e||"mark"===e;k.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=L(r);k.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(o=i.name),k.list.unshift(o+" ")),k.sourceData=[{type:"other",key:e,time:a,value:o}]}function it(t,e){const{shadowObjs:i,params:o}=t[`${e}ShadowBox`]||{};if(!i||!o)return;i.forEach((t=>d.value.remove(t)));o["left"===e?1:0]=t.left;const n=nt(...o);t[`${e}ShadowBox`]={shadowObjs:n,params:o}}function ot(t){return t>=B&&t<=$}function nt(...e){const[i,o,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),u=[[i,Y],[o,Y],[o,r],[i,r]],h=new t.Polygon(u.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),g=[];return["slash"].includes(l)&&g.push(...I(u,s.angle,s.space,c)),d.value.add(h,...g),K.get("extracorporealCirculation").push(h,...g),[h,...g]}function rt(){if(!G)return;const{dataList:e,ascendAortaStyle:i,extracorporealCirculationStyle:o}=R.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";K.set(n,[]);const r=Y+G;let a,l;function s(t){return t&&t>B&&t<M}function c(t){return void 0===t||""===t}e.forEach(((u,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:i,openAscendAorta:o,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),i&&(a=A(i.time)),o&&(l=A(o.time)),n&&(s=A(n.time)),[r,a,l,s]}(u);if(-1===h.findIndex((t=>t>0&&t<M)))return;let g;h.forEach(((m,v)=>{if(c(m))return;const x=h[v+1],y=h[v-1];if(s(m)||s(x)){const k=s(m)?m:B,C=s(x)?x:c(x)?null:$,w=s(y)?y:B,X={};if(v<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(v)?o:i],X.shadowObjs=nt(...X.params)),s(m)){const i=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(v),o=p(new Date,"yyyy-MM-dd HH:mm"),c=A(o),x=m<c&&s(c)?c:m,y=function(e,i){const o=new t.Line(e,{...i,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return tt(o),d.value.add(o),K.get("extracorporealCirculation").push(o),o}([m,Y,m,r],{origin:{dataIndex:f,dataKey:i,key:n,data:u[i],type:"other"},limitX:{x1:0===v?null!=a?a:B:w,x2:C||x,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(v)?{leftShadowBox:g}:{},...[0,1,2].includes(v)?{rightShadowBox:X}:{}});v===h.length-1&&(a=m,l=y),0===v&&l&&(l.limitX.x2=k)}g=X}}))}))}function at(t){const{code:e}=t;F&&(e.includes("Enter")||e.includes("Esc"))&&(e.includes("Esc")&&(F.text=""),F.exitEditing(),d.value.discardActiveObject(F))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,i=A(t),n=o([i,0,i,Y],e);d.value.add(n)}(),function(){var t;if(!(null==(t=null==R?void 0:R.horizontal)?void 0:t.length))return;q=[];const{horizontal:i}=R,o=B-5;let n=W+H/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l,data:s=[]}=t,c=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;q.push({type:"other",title:r,key:"horizontal",dataIndex:i,dataList:s.map((t=>A(t.time))),y1:n-c.height/2,y2:n+c.height/2}),(u=c).on("moving",(()=>{u.set("originX","center"),S(u)?et(u):k.show=!1})),u.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&S(u))if(j(K.get("horizontal"),u.left,"key",O).includes(u.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:L(u.left),value:u.origin.defaultAddValue},...u.origin};y("add",f(t,["isMenu"])),Q(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(c),n+=H}))}(),J(),N(),Z(),rt(),a.on((()=>{const t="horizontal",e=X(K.get(t));e.length>0?b((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const i=e[t];return R.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);U({key:t}),y("remove",i)})):E()})),_.evented&&(window.addEventListener("keydown",at,!0),d.value.on("mouse:up",(e=>{var i,o,n,r;if(1===e.button){const{target:a,pointer:l={}}=e,{x:s=0,y:c=0}=l;if(!S({left:s,top:c}))return;if(!(null==q?void 0:q.length)||F)return;if(a&&"horizontal"!==(null==(i=a.origin)?void 0:i.key))return;let u="";if(a){if(a.moving)return;u=null==(r=null==(n=null==(o=a.origin)?void 0:o.data)?void 0:n.value)?void 0:r.toString()}const f=q.find((({y1:t,y2:e})=>c>=t&&c<=e));g(null==f?void 0:f.dataIndex)&&(F=new t.Textbox(u,{left:s,top:c,width:100,height:100,fontSize:18,objectCaching:!1,hasControls:!1,borderColor:"#000",editingBorderColor:"#000",backgroundColor:"#fff",fontFamily:"微软雅黑"}),F.otherListPointHeightRangeItem={...f,left:s,target:a},d.value.add(F),d.value.setActiveObject(F),F.enterEditing(),u&&F.setSelectionEnd(u.length))}})),d.value.on("selection:cleared",(({deselected:t})=>{var e;if(null==t?void 0:t.find((t=>t.otherListPointHeightRangeItem))){let{text:t}=F;const{otherListPointHeightRangeItem:i}=F;if(t=t.replace(/^\s+|\s+$/g,""),d.value.remove(F),F=null,!t)return;const{left:o,target:n}=i;if(n){if(t==(null==(e=n.origin)?void 0:e.data.value))return;const i={...n.origin,data:{...n.origin.data,value:t}};y("change",i),Q(i,"change")}else{const e={...m(i,["title","type","key","dataIndex"]),data:{time:L(o),value:t}};y("add",e),Q(e)}}}))),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};y(i,n),"remove"===i&&Q(n,i)},handleKeydown:at}}export{y as useOther};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as s}from"date-fns";import{getType as a,getTime as u,isOneLine as d,isOverlapPoint as c,getFloorNumber as p,isValidValue as f,setOtherType as h,isEffectiveNode as v,deleteProperty as g,getIndex as y}from"../../utils/index.js";import{cloneDeep as m,omit as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useShadow as j}from"../useShadow.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as S,OVERLAP as Y}from"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{promiseTimeout as E}from"@vueuse/shared";function M(M,C,T,$,P,V,A,R,I,X){r(M,{...C,isTemperature:!0});const{getEqualXTypes:H,handleAddPrevent:B,getPointEventProps:D}=L(M,T,C),{createShadowLines:W}=j(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:K,originX:q,endX:G,originY:N,endY:J,itemList:Q,event:U,vitalSignsOriginY:Z,painOriginY:ee,hospitalizationDate:te,config:ie,canvasHeight:ne,painSurplusCell:oe,iconsWidth:le,canvasWidth:re,borderStyle:se,painScalePositionSurplusHeight:ae}=C,ue=new Set,de=["xinmai","mai"],ce=new Map,pe=new Set,fe=new Set,he=new Set,ve=m(z.yScaleValue),ge=new Set;function ye(n){var o;const l=ve.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ue.size&&M.value.remove(...ue),ue.clear(),ce.size>1)){if(n){const{type:e,key:t}=n.origin||{};if("pulse"===e){const e=ce.get(t),i=null==e?void 0:e.findIndex((e=>e[0]===n.left));e.splice(i,1,[n.left,n.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ce)t.push(e[1]),e[0]===de[0]&&e[1].forEach((e=>{(ce.get(de[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&r.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(he).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===de[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&M.value.remove(e.rightLine):e.leftLine&&M.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((n=>{const o=n.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(n,s._angle,s.space,w(s,["_angle","space"]))),e.forEach((e=>{ue.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(n);i.forEach((i=>{const n=t([...x(i)],{...s,originX:"center"});e.push(n),ue.add(n)}))}M.value.add(...e)}ue.add(l),M.value.add(l)}))}}function me(e,r,s){var a;const{type:u,riseStyle:c={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:w={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:E,textStyle:C}=j,V=[],R=[],X=[];let H=null;const B=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&be(e.time),W=d(s);if(null==(a=e.list)||a.forEach(((a,d)=>{var j,z,F,q;const G=W?S.find((e=>e.key===a.key)):e,N=je(B(a)?{...a,value:k.fixedValue}:a,s),J=e.list[d+1],Q=J?je(B(J)?{...J,value:k.fixedValue}:J,s):void 0,te=J?W?S.find((e=>e.key===J.key)):e:{},{title:le=""}=G;if(le===((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.235"))||"脉搏")&&te.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.235"))||"脉搏")&&te.title===((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")||!N||!Q||p(N[0],1)!==p(Q[0],1))N&&H&&(N[0]=H),H=null;else{const e=N[0]-_/2;N[0]=e+_/4,Q[0]=H=N[0]+_/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ie.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=Z.originY+K?e[1]+K:e[1]-K,r=o([e[0],l],{value:B(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-K}}(N,a,G),function(e,r,s,a){var d,p,h;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!be(r.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!r.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=$(r.time);let j,L,S,Y,E,M;if(r.noRise&&v.show){const t=O(v,r)?P(u,35):(null==e?void 0:e[1])||0;if(v.text)S=o([b,O(v,r)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),r.value||he.add(S);else if(r.value){S=l([b,t,t+2*K],{...v.style})}S&&X.push(S),S&&O(v,r)&&ge.add(S)}if(null==e?void 0:e[1]){if(r.rise&&c.show&&c.text&&(Y=o([b,e[1]-(x?K:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(Y)),r.verified){const t=(null==(d=null==g?void 0:g.position)?void 0:d[w])||"top";E=o(["top-right"===t?b+_/2:b,e[1]-(x?K:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(f(r.physicsReduce)||f(r.drugReduce)){const o=P(u,null!=(p=r.physicsReduce)?p:r.drugReduce),l=o<e[1]&&(null==ie?void 0:ie.hypothermyViewCustom)?b+_/2:b;j=t([...e,l,o],{...m,...y.line,...i}),L=n((null==(h=null==y?void 0:y.point)?void 0:h.type)||"circle",{left:l,top:o,...y.point,...i,originY:o===ne?"bottom":"center"}),j&&X.push(j),L&&X.push(L)}r.respirator&&(M=n(k.type,{left:b,top:e[1]-(x?K:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(M))}Object.assign(a,{reduceLine:{obj:j,type:"line"},noRiseText:{obj:S,top:v.text?5:2*K,isFixed:O(v,r)},riseText:{obj:Y,top:(x?-K:0)-5},verifiedText:{obj:E,left:_/2,top:(x?-K:0)-5},reducePoint:{obj:L,type:"reduce"},respirator:{obj:M,top:(x?-K:0)-5}})}(N,a,G,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const r=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*K,i=[e[1]-K/2,t];t<Z.originY&&(t=e[1]+2.5*K,i=[t,e[1]+K/2]),a=l([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>r){const t=a?e[1]+K/2+a.height:e[1]+K;d=o([e[0],t],i),X.push(d)}+t.value<s&&(d=o([e[0],e[1]-K],i),X.push(d))}if(L.show&&+t.value<s){const t=e[1];if(L.text)c=o([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*K;c=l([e[0],t,i],{...L.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-K},belowMinValue:{obj:c,top:L.text?5:2*K,moveHide:!0}})}(N,a,G,re),function(i,o,l,a,d,c){let p,f;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:j="circle",overlapKey:L}=d,S=g.height?g.height/2:5,Y=e.list[a+1];let O=m(i),H=m(o);const z=we(u,e.list[a].value),F=()=>"pulse"==u&&l.pacemakerShow?w.value:B(l)?k.type:z&&"number"===E?0:j,_=e=>e&&v.show&&v.fixed&&be(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(l.breakpoint)return!1;if("temperature"===u&&(i||_(l))&&(o||_(Y))){const e=P(u,35);return i||(O=[$(l.time),e]),o||(H=[$(Y.time),e]),!0}return!!i&&!!o})()){O&&H&&z&&we(u,Y.value)&&!oe[1]&&!ae&&"icon"===E&&(O[1]=O[1]-S,H[1]=H[1]-S),f=t([...O,...H],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(i&&o&&(null==e?void 0:e.top)<i[1]&&(null==ie?void 0:ie.hypothermyViewCustom)){const i=t([e.left,e.top,...o],{...y});X.unshift(i),Object.assign(c,{reduceRightLine:{obj:i,type:"reduce"}}),f.set("stroke","transparent")}}const K=F(),q=R[a-1],G={origin:{data:B(l)?{...l,value:k.fixedValue}:l,title:x,key:b||"",overlapKey:L,unit:s.unit,type:u,_type:h(x,u),dataIndex:r,index:a,isOneLine:W},leftLine:q,rightLine:f,otherObj:c,...l.pacemakerShow&&"pulse"==u?w.style:B(l)?k.style:g,...D(),lockMovementX:!0,...z?{selectable:!1,evented:!1,..."number"===E?C:{}}:{}};i&&(q?G.leftLine.set("x2",i[0]):G.leftLine=null,p=n(K,{left:i[0],top:!z||oe[1]||ae?i[1]:i[1]-S,...G}));R.push(f),p&&(b===de[1]?pe.add(p):B(l)||fe.add(p),function(e){U.hovered&&(e.on("mouseover",(()=>{xe(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?ee:Z;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(M.value.remove(i),delete e.otherObj.obj)))})),ye(e)}(e),U.hovered&&xe(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=A(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};M.value.discardActiveObject(),T("change",n),ke(n,"change")}}))}(p),V.push(p),he.add(p))}(N,Q,a,d,G,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&p(e.left,1)===p(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};de.forEach((t=>{e[t]=V.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ce.set(t,i(e[t]))}))}else{const{key:t}=e;ce.set(t,i(V))}}const z=R.filter((e=>e));M.value.add(...z,...V,...X)}function we(e,t){return"pain"===e&&0==t}function xe(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||V(e.left)).slice(-5)}`;I.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:A(o,e.top);if(f(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(f(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],I.show=!0}function be(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=u(e);return l>=n&&l<=o}function je(e,t){const i="pain"===t.type?ee:Z;if(!v(e)||!be(e.time))return;const n=$(e.time),o=P(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function Le(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=u(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=u(`${V(e)}:00`);return te&&l<u(te)?(B("exceedMin"),!1):!(l>o)||(B("exceedMax"),!1)}function ke(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=ve.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;Se()}function Se(){var e;he.size&&(null==(e=M.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...he]))),he.clear(),Ye()}function Ye(e){ce.clear(),he.clear(),pe.clear(),ge.clear(),fe.clear(),ve.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||me(e,i,t)})))})),ye(),[...he].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ve.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const o=Object.assign({},Y,z.overlap||{}),l=[];pe.size&&[...pe].forEach((e=>{[...fe].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key,r=t.origin.overlapKey;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let a=r||"koumai";"yemai"===e&&(a=e);const u=r||e;l.push(n(a,{...o[u],...s}))}}}))})),setTimeout((()=>{M.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),he.add(e)}))}))}()}return function(){const t=new e.Rect({left:le,top:0,width:re-le-se.strokeWidth,height:ne-se.strokeWidth,fill:"transparent",...se});M.value.add(t)}(),Ye((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const i=P(e.type,e.positionLine.value),n=t([q,i,G,i],e.positionLine);M.value.add(n)}(e))),M.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!C.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){X.point={x:e,y:i},X.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(X.list=[...k]),"pain"===l&&(X.list=[...S]),X.target=n;else{X.target=null,X.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],Q.forEach((t=>{if(!H([...he],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?ee:Z;i>=e.originY&&i<=e.endY&&X.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:a(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=Le(e);n&&1!==X.list.length||(X.show=!1,1===X.list.length&&n&&B("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ne&&T("click:grid",{x:e,y:t,time:V(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,a=g(i,[...k,...S]);a[`${e.type}`]=e.value,a.changeTime=s(new Date,"yyyy-MM-dd HH:mm"),o&&(a.key=t.origin.key);const u={...t.origin,data:a};T("change",u),ke(u,"change")}else{const t={data:{time:V(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};T("add",t),ke(t)}},setPopup:xe,isAddPoint:Le,updateData:ke,redrawPoints:Se,gridPoints:he,fixedNoRisePoints:ge}}function O(e,t){return e.fixed||!t.value&&0!==t.value}export{M as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{format as s}from"date-fns";import{getType as a,getTime as u,isOneLine as d,isOverlapPoint as c,getFloorNumber as p,isValidValue as f,setOtherType as h,isEffectiveNode as v,deleteProperty as g,getIndex as y}from"../../utils/index.js";import{cloneDeep as m,omit as w,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useShadow as j}from"../useShadow.js";import{useCommon as L}from"../useCommon.js";import"vue";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as S,OVERLAP as Y}from"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{promiseTimeout as E}from"@vueuse/shared";function M(M,C,T,$,P,V,A,R,I,X){r(M,{...C,isTemperature:!0});const{getEqualXTypes:H,handleAddPrevent:B,getPointEventProps:D}=L(M,T,C),{createShadowLines:W}=j(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:K,originX:q,endX:G,originY:N,endY:J,itemList:Q,event:U,vitalSignsOriginY:Z,painOriginY:ee,hospitalizationDate:te,config:ie,canvasHeight:ne,painSurplusCell:oe,iconsWidth:le,canvasWidth:re,borderStyle:se,painScalePositionSurplusHeight:ae,painBorderColor:ue,painHeight:de}=C,ce=new Set,pe=["xinmai","mai"],fe=new Map,he=new Set,ve=new Set,ge=new Set,ye=m(z.yScaleValue),me=new Set;function we(n){var o;const l=ye.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ce.size&&M.value.remove(...ce),ce.clear(),fe.size>1)){if(n){const{type:e,key:t}=n.origin||{};if("pulse"===e){const e=fe.get(t),i=null==e?void 0:e.findIndex((e=>e[0]===n.left));e.splice(i,1,[n.left,n.top])}}const o=function(){const e=[],t=[],i=[];for(const e of fe)t.push(e[1]),e[0]===pe[0]&&e[1].forEach((e=>{(fe.get(pe[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],d=n[i-1],c=n[i+1],p=o[s-1],f=o[s+1];if(d&&p){if(d[0]!==p[0]){const e=Math.max(d[0],p[0]);l.push([d,p].find((t=>t[0]===e)))}}else d?l.push(d):p&&r.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){E(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(ge).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===pe[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&M.value.remove(e.rightLine):e.leftLine&&M.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((n=>{const o=n.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(n,s._angle,s.space,w(s,["_angle","space"]))),e.forEach((e=>{ce.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(n);i.forEach((i=>{const n=t([...x(i)],{...s,originX:"center"});e.push(n),ce.add(n)}))}M.value.add(...e)}ce.add(l),M.value.add(l)}))}}function xe(e,r,s){var a;const{type:u,riseStyle:c={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:w={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:E,textStyle:C}=j,V=[],R=[],X=[];let H=null;const B=e=>"breathe"==u&&e.respirator&&k.type&&k.fixedValue&&!e.value&&Le(e.time),W=d(s);if(null==(a=e.list)||a.forEach(((a,d)=>{var j,z,F,q;const G=W?S.find((e=>e.key===a.key)):e,N=ke(B(a)?{...a,value:k.fixedValue}:a,s),J=e.list[d+1],Q=J?ke(B(J)?{...J,value:k.fixedValue}:J,s):void 0,te=J?W?S.find((e=>e.key===J.key)):e:{},{title:le=""}=G;if(le===((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.235"))||"脉搏")&&te.title!==((null==(z=window.getLanguageByCode)?void 0:z.call(window,"10010.1.235"))||"脉搏")||le!==((null==(F=window.getLanguageByCode)?void 0:F.call(window,"10010.1.235"))||"脉搏")&&te.title===((null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.235"))||"脉搏")||!N||!Q||p(N[0],1)!==p(Q[0],1))N&&H&&(N[0]=H),H=null;else{const e=N[0]-_/2;N[0]=e+_/4,Q[0]=H=N[0]+_/2}const re={};re.value=function(e,t,i){if(!(null==e?void 0:e.length)||!ie.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=Z.originY+K?e[1]+K:e[1]-K,r=o([e[0],l],{value:B(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-K}}(N,a,G),function(e,r,s,a){var d,p,h;if(!["temperature","pain","breathe"].includes(u))return;if(!(null==e?void 0:e.length)&&"temperature"===u&&!Le(r.time))return;if(!(null==e?void 0:e.length)&&"pain"===u)return;if(!r.value&&"breathe"===u)return;const{lineAttr:m={},key:w}=s,{value:x}=a,b=$(r.time);let j,L,S,Y,E,M;if(r.noRise&&v.show){const t=O(v,r)?P(u,35):(null==e?void 0:e[1])||0;if(v.text)S=o([b,O(v,r)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style}),r.value||ge.add(S);else if(r.value){S=l([b,t,t+2*K],{...v.style})}S&&X.push(S),S&&O(v,r)&&me.add(S)}if(null==e?void 0:e[1]){if(r.rise&&c.show&&c.text&&(Y=o([b,e[1]-(x?K:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(Y)),r.verified){const t=(null==(d=null==g?void 0:g.position)?void 0:d[w])||"top";E=o(["top-right"===t?b+_/2:b,e[1]-(x?K:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(E)}if(f(r.physicsReduce)||f(r.drugReduce)){const o=P(u,null!=(p=r.physicsReduce)?p:r.drugReduce),l=o<e[1]&&(null==ie?void 0:ie.hypothermyViewCustom)?b+_/2:b;j=t([...e,l,o],{...m,...y.line,...i}),L=n((null==(h=null==y?void 0:y.point)?void 0:h.type)||"circle",{left:l,top:o,...y.point,...i,originY:o===ne?"bottom":"center"}),j&&X.push(j),L&&X.push(L)}r.respirator&&(M=n(k.type,{left:b,top:e[1]-(x?K:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(M))}Object.assign(a,{reduceLine:{obj:j,type:"line"},noRiseText:{obj:S,top:v.text?5:2*K,isFixed:O(v,r)},riseText:{obj:Y,top:(x?-K:0)-5},verifiedText:{obj:E,left:_/2,top:(x?-K:0)-5},reducePoint:{obj:L,type:"reduce"},respirator:{obj:M,top:(x?-K:0)-5}})}(N,a,G,re),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;const r=Math.max(...Y),s=Math.min(...Y);let a,d,c;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*K,i=[e[1]-K/2,t];t<Z.originY&&(t=e[1]+2.5*K,i=[t,e[1]+K/2]),a=l([e[0],i[0],i[1]],x,"up"),X.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>r){const t=a?e[1]+K/2+a.height:e[1]+K;d=o([e[0],t],i),X.push(d)}+t.value<s&&(d=o([e[0],e[1]-K],i),X.push(d))}if(L.show&&+t.value<s){const t=e[1];if(L.text)c=o([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*K;c=l([e[0],t,i],{...L.style})}X.push(c)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:d,top:-K},belowMinValue:{obj:c,top:L.text?5:2*K,moveHide:!0}})}(N,a,G,re),function(i,o,l,a,d,c){let p,f;const{pointAttr:g={},lineAttr:y={},title:x="",key:b,type:j="circle",overlapKey:L}=d,S=g.height?g.height/2:5,Y=e.list[a+1];let O=m(i),H=m(o);const z=be(u,e.list[a].value),F=()=>"pulse"==u&&l.pacemakerShow?w.value:B(l)?k.type:z&&"number"===E?0:j,_=e=>e&&v.show&&v.fixed&&Le(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(l.breakpoint)return!1;if("temperature"===u&&(i||_(l))&&(o||_(Y))){const e=P(u,35);return i||(O=[$(l.time),e]),o||(H=[$(Y.time),e]),!0}return!!i&&!!o})()){O&&H&&z&&be(u,Y.value)&&!oe[1]&&!ae&&"icon"===E&&(O[1]=O[1]-S,H[1]=H[1]-S),f=t([...O,...H],{...y});const{obj:e}=(null==c?void 0:c.reducePoint)||{};if(i&&o&&(null==e?void 0:e.top)<i[1]&&(null==ie?void 0:ie.hypothermyViewCustom)){const i=t([e.left,e.top,...o],{...y});X.unshift(i),Object.assign(c,{reduceRightLine:{obj:i,type:"reduce"}}),f.set("stroke","transparent")}}const K=F(),q=R[a-1],G={origin:{data:B(l)?{...l,value:k.fixedValue}:l,title:x,key:b||"",overlapKey:L,unit:s.unit,type:u,_type:h(x,u),dataIndex:r,index:a,isOneLine:W},leftLine:q,rightLine:f,otherObj:c,...l.pacemakerShow&&"pulse"==u?w.style:B(l)?k.style:g,...D(),lockMovementX:!0,...z?{selectable:!1,evented:!1,..."number"===E?C:{}}:{}};i&&(q?G.leftLine.set("x2",i[0]):G.leftLine=null,p=n(K,{left:i[0],top:!z||oe[1]||ae?i[1]:i[1]-S,...G}));R.push(f),p&&(b===pe[1]?he.add(p):B(l)||ve.add(p),function(e){U.hovered&&(e.on("mouseover",(()=>{je(e,"hover")})),e.on("mouseout",(()=>{I.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?ee:Z;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:r=!1,left:s=0}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left+s,top:e.top+o}),r&&(M.value.remove(i),delete e.otherObj.obj)))})),we(e)}(e),U.hovered&&je(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=A(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};M.value.discardActiveObject(),T("change",n),Ye(n,"change")}}))}(p),V.push(p),ge.add(p))}(N,Q,a,d,G,re)})),"pulse"===u){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&p(e.left,1)===p(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(W){const e={};pe.forEach((t=>{e[t]=V.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),fe.set(t,i(e[t]))}))}else{const{key:t}=e;fe.set(t,i(V))}}const z=R.filter((e=>e));M.value.add(...z,...V,...X)}function be(e,t){return"pain"===e&&0==t}function je(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||V(e.left)).slice(-5)}`;I.list=[function(){const{drugReduce:s,physicsReduce:a}=l||{},u="hover"===t?l.value:A(o,e.top);if(f(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(f(a))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${u}—>${a}${n||""}`;return`${i} ${u}${n||""}`}(),r],I.show=!0}function Le(e){const[t]=F,i=b(F),n=t.start,o=i.end,l=u(e);return l>=n&&l<=o}function ke(e,t){const i="pain"===t.type?ee:Z;if(!v(e)||!Le(e.time))return;const n=$(e.time),o=P(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function Se(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=u(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=u(`${V(e)}:00`);return te&&l<u(te)?(B("exceedMin"),!1):!(l>o)||(B("exceedMax"),!1)}function Ye(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=ye.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;Ee()}function Ee(){var e;ge.size&&(null==(e=M.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ge]))),ge.clear(),Me()}function Me(e){fe.clear(),ge.clear(),he.clear(),me.clear(),ve.clear(),ye.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||xe(e,i,t)})))})),we(),[...ge].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ye.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>{var t;return e.title.includes((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.235"))||"脉搏")})))return;const o=Object.assign({},Y,z.overlap||{}),l=[];he.size&&[...he].forEach((e=>{[...ve].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key,r=t.origin.overlapKey;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let a=r||"koumai";"yemai"===e&&(a=e);const u=r||e;l.push(n(a,{...o[u],...s}))}}}))})),setTimeout((()=>{M.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ge.add(e)}))}))}()}return function(){const i=[];if(i.push(new e.Rect({left:le,top:0,width:re-le-se.strokeWidth,height:ne-se.strokeWidth,fill:"transparent",...se})),ue){const e=ee.originY-oe[0]*K,n=e+de+(oe[0]+oe[1])*K-1,o={...se,stroke:ue},l=t([le,e,G,e],o),r=t([le,n,G,n],o);i.push(l,r)}M.value.add(...i)}(),Me((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const i=P(e.type,e.positionLine.value),n=t([q,i,G,i],e.positionLine);M.value.add(n)}(e))),M.value.on("mouse:up",(e=>{var t;const{button:i,target:n,pointer:o={}}=e;if(3===i){if(!C.event.evented)return;const{x:e=0,y:i=0}=o;if(e>=q&&e<=G&&i>=N&&i<=J){X.point={x:e,y:i},X.show=!0;const{type:l}=(null==n?void 0:n.origin)||{};if(n&&["temperature","pain"].includes(l))"temperature"===l&&(X.list=[...k]),"pain"===l&&(X.list=[...S]),X.target=n;else{X.target=null,X.list=[(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.219"))||"新增节点"],Q.forEach((t=>{if(!H([...ge],e,"_type").includes(t.bigType)){const e=["pain"].includes(t.bigType)?ee:Z;i>=e.originY&&i<=e.endY&&X.list.push({renderItem:R?R(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:a(t.bigType),dataIndex:t.dataIndex,key:t.key,isOneLine:t.isOneLine},pointer:o})}}));const n=Se(e);n&&1!==X.list.length||(X.show=!1,1===X.list.length&&n&&B("repeat"))}}}if(1===i){if(n)return;const{x:e=0,y:t=0}=o;e>=q&&e<=G&&t>0&&t<ne&&T("click:grid",{x:e,y:t,time:V(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,a=g(i,[...k,...S]);a[`${e.type}`]=e.value,a.changeTime=s(new Date,"yyyy-MM-dd HH:mm"),o&&(a.key=t.origin.key);const u={...t.origin,data:a};T("change",u),Ye(u,"change")}else{const t={data:{time:V(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};T("add",t),Ye(t)}},setPopup:je,isAddPoint:Se,updateData:Ye,redrawPoints:Ee,gridPoints:ge,fixedNoRisePoints:me}}function O(e,t){return e.fixed||!t.value&&0!==t.value}export{M as useCenter};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s}from"../../utils/index.js";import{last as r}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function p(p,d,g,f,m,v,y,w,S,b,Y,x){var j,C;const{getEqualXTypes:L,handleAddPrevent:X,isGridLimit:T}=c(p,g,d),{originY:N,endY:O,originX:V,endX:k,xCellWidth:E,yCellHeight:M,left:A,vitalSignsOriginY:G,painOriginY:I,painHeight:W,iconsWidth:H,itemList:R,painIndex:_,right:B,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P,painSurplusCell:z}=d;function F(o){var s;if(!(null==o?void 0:o.length))return;const{layout:c}=o[0];let d=H,g=V;"right"===c&&(d=k,g=k+(null!=(s=null==B?void 0:B.width)?s:0));const f=[],m=W&&"right"!==c?o.length-1:o.length,v=(g-d)/m,y=v+(g-d)%m;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:d,style:g,title:f}=n,m=I.originY-z[0]*M,v=l({width:V-H,height:W+(z[0]+z[1])*M,...D},{value:`${f}`,...i,...g||{}},{left:H,top:m}),y=t([H,m,V,m],D),w=[];if(r||h){const{lineXMain:t,textLeft:i}=u(c,H,V-H),l=o.length;o.forEach(((o,u)=>{let c=I.endY-u*M*s;if(0===u&&0===z[1]&&(c=O-5),h&&(!(0===u||u===l-1)||d||0===u&&z[1]>0||u===l-1&&z[0]>0)&&w.push(a(o,n,i,c)),r&&(0!==u||z[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...D,...g});w.push(o)}}))}p.value.add(y,v,...w),v.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?d:y+d+(s-1)*v,S="right"===c?0:G.originY,b="right"===c?$:G.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...D}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:L,showNumber:X,position:T,showMaxMinNumber:k,detailedList:E=[],showdetailedScale:A,showRange:R=[]}=o;if(L||X){const{lineXMain:e,lineXSub:t,textLeft:i}=u(T,w,m),n=(j[1]-j[0])/2,l=A&&!E.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):A&&(null==E?void 0:E.length)?E:j,[s=l[0],c=r(l)]=R;l.forEach(((n,r)=>{if(s&&+n<+s)return;if(c&&+n>+c)return;const u=G.endY-r*M*(A?C/2:C),p=[s,c].includes(n);if(X&&(!p||k)){const e=0==r?u-5:u,t=a(n,o,i,e),l=G.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...h(o,r,e,t,u,M,G.originY,l.findIndex((e=>e==c))+1))}))}let B=o.title||"";o.unit&&(B+="\n"+o.unit);let J=G.originY+2;0!==_&&P[0]>0&&(J=N+2),B&&g.push(new e.Text(String(B),{...i,originY:"top",left:x,top:J,textAlign:"center",...o.style}));const q=new e.Group(g,{...n,objectCaching:!1});f.push(q)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&p.value.add(w),w&&w.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(R));let t=O;const i=H-A.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:r}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{key:e.key,type:s(e.bigType),_type:e.bigType,isOneLine:e.isOneLine},...d.event}});var u;t-=l.height||30,(u=r).on("moving",(()=>{u.set("originX","center"),function(e){if(e.left>=V&&e.left<=k){e.setCoords();const t="pain"===e.origin.type?I:G;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(u),T(u)?f(u):m.show=!1})),u.on("mouseup:before",(e=>{if(m.show=!1,0===e.e.button&&T(u)){const e=L([...x],u.left,"_type").includes(u.origin._type),t=b(u.left);if(!t||e)e&&t&&X("repeat");else{const e={data:{time:w(u.left),value:S(u.origin.type,u.top),...u.origin.isOneLine?{key:u.origin.key}:{}},...u.origin};g("add",e),Y(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(u)})),p.value.add(l,r)}))}();const K=A.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==B?void 0:B.width)&&"left"===(null==(j=null==B?void 0:B.yScaleValue)?void 0:j.layout)&&(null==(C=null==B?void 0:B.yScaleValue)?void 0:C.show)&&K.push(q),_>0&&A.yScaleValue[_].show){const e=A.yScaleValue[_];0===_&&A.yScaleValue.length>1&&K.unshift(e),_==A.yScaleValue.length-1&&K.push(e)}const Q=K.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),U=K[Q];return Q>-1&&K.splice(Q,0,{...U,title:(null==U?void 0:U.doubleTitle)||(null==U?void 0:U.title)}),F(K),{drawScaleValue:F}}export{p as useLeft};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as s}from"../useDraw.js";import"date-fns";import{getType as l}from"../../utils/index.js";import{last as r}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as c}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";function p(p,d,g,f,m,y,v,w,S,b,x,Y){var j,C;const{getEqualXTypes:T,handleAddPrevent:L,isGridLimit:X}=h(p,g,d),{originY:N,endY:O,originX:V,endX:k,xCellWidth:E,yCellHeight:M,left:A,vitalSignsOriginY:B,painOriginY:G,painHeight:I,iconsWidth:H,itemList:R,painIndex:W,right:_,grid:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P,painSurplusCell:z,painBorderColor:F,config:K}=d;function Q(o){var l;if(!(null==o?void 0:o.length))return;const{layout:h}=o[0];let d=H,g=V;"right"===h&&(d=k,g=k+(null!=(l=null==_?void 0:_.width)?l:0));const f=[],m=I&&"right"!==h?o.length-1:o.length,y=(g-d)/m,v=y+(g-d)%m,w=J.surplusCell||[0,0,0,0],S=B.originY-w[0]*M;o.forEach(((o,l)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:l=5,showScale:r,showNumber:c,position:h,showMaxMinNumber:d,style:g,title:f}=n,m=[],y=G.originY-z[0]*M,v=s({width:V-H,height:I+(z[0]+z[1])*M,...D},{value:`${f}`,...i,...g||{}},{left:H,top:y});m.push(v);const w=F?null:t([H,y,V,y],D);w&&m.push(w);const S=[];if(r||c){const{lineXMain:t,textLeft:i}=u(h,H,V-H),s=o.length;o.forEach(((o,u)=>{let h=G.endY-u*M*l;if(0===u&&0===z[1]&&(h=O-5),c&&(!(0===u||u===s-1)||d||0===u&&z[1]>0||u===s-1&&z[0]>0)&&S.push(a(o,n,i,h)),r&&(0!==u||z[1]>0)){const[i,n]=t,o=new e.Line([i,h,n,h],{...D,...g});S.push(o)}}))}p.value.add(...m,...S),v.sendToBack()}(o);const g=[],m=0===l?v:y,w=0===l?d:v+d+(l-1)*y;let b=0;"right"!==h&&(b=S,K.scaleTitleBorder&&(b+=M));const x="right"===h?$:B.endY,Y=l>0?t([w,b,w,x],{objectCaching:!1,...D}):null;Y&&g.push(Y);const j=w+m/2,{list:C=[],spaceGridNumber:T=5,showScale:L,showNumber:X,position:N,showMaxMinNumber:k,detailedList:E=[],showdetailedScale:A,showRange:R=[]}=o;if(L||X){const{lineXMain:e,lineXSub:t,textLeft:i}=u(N,w,m),n=(C[1]-C[0])/2,s=A&&!E.length?C.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):A&&(null==E?void 0:E.length)?E:C,[l=s[0],h=r(s)]=R;s.forEach(((n,r)=>{if(l&&+n<+l)return;if(h&&+n>+h)return;const u=B.endY-r*M*(A?T/2:T),p=[l,h].includes(n);if(X&&(!p||k)){const e=0==r?u-5:u,t=a(n,o,i,e),s=B.originY+t.height/2;e<s&&t.set({top:s}),g.push(t)}g.push(...c(o,r,e,t,u,M,B.originY,s.findIndex((e=>e==h))+1))}))}let W=o.title||"";o.unit&&(W+="\n"+o.unit);const _=S+2;if(W){const n=new e.Text(String(W),{...i,originY:"top",left:j,top:_,textAlign:"center",...o.style});if(K.scaleTitleBorder){n.setCoords().set({top:M>12?S+1:S});const e=t([w,S+M,w+m,S+M],{objectCaching:!1,...D});g.push(e)}g.push(n)}const J=new e.Group(g,{...n,objectCaching:!1});f.push(J)}));const b=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;b&&p.value.add(b),b&&b.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(R));let t=O;const i=H-A.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:s,icon:r}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{key:e.key,type:l(e.bigType),_type:e.bigType,isOneLine:e.isOneLine},...d.event}});var u;t-=s.height||30,(u=r).on("moving",(()=>{u.set("originX","center"),function(e){if(e.left>=V&&e.left<=k){e.setCoords();const t="pain"===e.origin.type?G:B;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(u),X(u)?f(u):m.show=!1})),u.on("mouseup:before",(e=>{if(m.show=!1,0===e.e.button&&X(u)){const e=T([...Y],u.left,"_type").includes(u.origin._type),t=b(u.left);if(!t||e)e&&t&&L("repeat");else{const e={data:{time:w(u.left),value:S(u.origin.type,u.top),...u.origin.isOneLine?{key:u.origin.key}:{}},...u.origin};g("add",e),x(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(u)})),p.value.add(s,r)}))}();const U=A.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==_?void 0:_.width)&&"left"===(null==(j=null==_?void 0:_.yScaleValue)?void 0:j.layout)&&(null==(C=null==_?void 0:_.yScaleValue)?void 0:C.show)&&U.push(q),W>0&&A.yScaleValue[W].show){const e=A.yScaleValue[W];0===W&&A.yScaleValue.length>1&&U.unshift(e),W==A.yScaleValue.length-1&&U.push(e)}const Z=U.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),ee=U[Z];return Z>-1&&U.splice(Z,0,{...ee,title:(null==ee?void 0:ee.doubleTitle)||(null==ee?void 0:ee.title)}),Q(U),{drawScaleValue:Q}}export{p as useLeft};
@@ -1 +1 @@
1
- import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,w,b,Y,j,x){const C=15,D=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=w.data.grid||{};return~Q.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===Q.value?t[0]=t[0]+V.value[1]:Q.value>0&&(t[2]=t[2]+V.value[0]),t})),P=a((()=>0===Q.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:Q.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),X=a((()=>{const{top:e}=w.data;return e.date.show&&(e.date.height||C)||0})),L=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||C)||0})),M=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||C)||0})),I=a((()=>{var e,a,t;const{top:l}=w.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),O=a((()=>{var e;const{top:a}=w.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||C)||0})),N=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{mainYCell:e,subYCell:a,painSubYCell:t=5}=w.data.grid,l=Q.value>0?V.value[1]:V.value[0];return(e-1)*a+t+H.value[0]+H.value[2]+l})),W=a((()=>{var e;const{width:a,right:t=null,top:l}=w.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),$=a((()=>W.value-H.value[1]*z.value)),A=a((()=>{const{top:e,left:a}=w.data;return e.titleWidth+B.value})),T=a((()=>{const{bottom:e=null,height:a}=w.data;if(!e)return a;return a-(e.height||30)})),q=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||C)||0;return X.value+t+l+L.value+M.value+O.value})),z=a((()=>(W.value-A.value)/k.value)),G=a((()=>(T.value-q.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=A.value-z.value;const r=t.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(d(c(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=z.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+z.value/2,scaleCell:(l-t)/z.value}}))));return v(o)})),F=a((()=>{var e;return(null==(e=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.find((e=>"pain"===e.type));if(!a)return 0;const{numberVerticalPosition:t="bottom"}=a;return"center"===t?G.value/2:0})),Q=a((()=>{const{left:e}=w.data,a=e.yScaleValue.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),U=a((()=>{const{painSubYCell:e=5}=w.data.grid;return-1===Q.value?0:G.value*e})),Z=a((()=>{const{left:e}=w.data,a={originY:q.value+V.value[0]*G.value,endY:T.value-V.value[1]*G.value-K.value};return 0===Q.value&&e.yScaleValue.length>1?a.endY=a.originY+U.value-K.value:Q.value===e.yScaleValue.length-1&&(a.originY=a.endY-U.value+K.value),a})),_=a((()=>{const{left:e}=w.data,a={originY:q.value+H.value[0]*G.value,endY:T.value-H.value[2]*G.value};return 0===Q.value&&e.yScaleValue.length>1?a.originY=Z.value.endY+K.value+H.value[0]*G.value:Q.value===e.yScaleValue.length-1&&(a.endY=Z.value.originY-H.value[2]*G.value),a})),ee=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))})),ae=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})),te=e({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...u,...w.data.borderStyle||{}},selectionStyle:w.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:O.value,topList:ee.value,breathingHeight:N.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:Q.value,painHeight:U.value,painOriginY:Z.value,vitalSignsOriginY:_.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:B.value,originX:A.value,originY:q.value,endX:W.value,endXLimit:$.value,endY:T.value,xCellWidth:z.value,yCellHeight:G.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:ae.value,config:w.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:P.value,painScalePositionSurplusHeight:K.value}),{computedX:le,computedY:ue,getXValue:ie,getYValue:ne}=i(te);return t((()=>S.value),(e=>{e&&function(){h(S,te);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=m(S,te,b,le,ue,ie,ne,w.addRenderItem,j,x);D.redrawPoints=l,D.clickMenu=u;const{drawScaleValue:o}=p(S,te,b,e,j,le,ue,ie,ne,a,t,i);g(S,te,o),f(S,te),y(S,te,b,le,ue,r);const{select:s}=n(S,te,b);D.select=s}()}),{immediate:!0}),{propItems:te,...l(D)}}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"../useShadow.js";import"../useCommon.js";import{setOtherType as r,isOneLine as o,getFloorNumber as s}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as d,addDays as c}from"date-fns";import"naive-ui";import"../surgicalAnesthesia/useTop.js";import"@vueuse/core";import"../../constants/index.js";import"../surgicalAnesthesia/useOther.js";import"../../../../../shared/utils/index.js";import{useTop as h}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function S(S,b,w,Y,C,j){const x=15,D=e({select:null,redrawPoints:null,clickMenu:null}),V=a((()=>{const{painSurplusCell:e=[0,0]}=b.data.grid||{};return~Q.value?e:[0,0]})),H=a((()=>{var e,a;const t=(null==(a=null==(e=b.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===Q.value?t[0]=t[0]+V.value[1]:Q.value>0&&(t[2]=t[2]+V.value[0]),t})),P=a((()=>0===Q.value?[V.value[0],H.value[1],H.value[2],H.value[3]]:Q.value>0?[H.value[0],H.value[1],V.value[1],H.value[3]]:H.value)),X=a((()=>{const{top:e}=b.data;return e.date.show&&(e.date.height||x)||0})),L=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||x)||0})),M=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||x)||0})),I=a((()=>{var e,a,t;const{top:l}=b.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),O=a((()=>{var e;const{top:a}=b.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||x)||0})),N=a((()=>{var e;const{bottom:a}=b.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=b.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),R=a((()=>{const{mainYCell:e,subYCell:a,painSubYCell:t=5}=b.data.grid,l=Q.value>0?V.value[1]:V.value[0];return(e-1)*a+t+H.value[0]+H.value[2]+l})),W=a((()=>{var e;const{width:a,right:t=null,top:l}=b.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),$=a((()=>W.value-H.value[1]*z.value)),A=a((()=>{const{top:e,left:a}=b.data;return e.titleWidth+G.value})),T=a((()=>{const{bottom:e=null,height:a}=b.data;if(!e)return a;return a-(e.height||30)})),q=a((()=>{var e;const{top:a}=b.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||x)||0;return X.value+t+l+L.value+M.value+O.value})),z=a((()=>(W.value-A.value)/k.value)),B=a((()=>(T.value-q.value)/R.value)),G=a((()=>{var e,a;const{left:t}=b.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),E=a((()=>{var e,a;const{top:t,grid:l}=b.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=A.value-z.value;const r=t.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(d(c(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=z.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+z.value/2,scaleCell:(l-t)/z.value}}))));return v(o)})),F=a((()=>{var e;return(null==(e=b.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),J=a((()=>{const{left:e}=b.data;return v(e.yScaleValue.filter((e=>e.show)).map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t,isOneLine:o(e)}))))))})),K=a((()=>{const{left:e}=b.data,a=e.yScaleValue.find((e=>"pain"===e.type));if(!a)return 0;const{numberVerticalPosition:t="bottom"}=a;return"center"===t?B.value/2:0})),Q=a((()=>{const{left:e}=b.data,a=e.yScaleValue.findIndex((e=>"pain"===e.type));return a>-1&&e.yScaleValue[a].show?a:-1})),U=a((()=>{const{painSubYCell:e=5}=b.data.grid;return-1===Q.value?0:B.value*e})),Z=a((()=>{const{left:e}=b.data;return(e.yScaleValue.find((e=>"pain"===e.type))||{}).borderColor})),_=a((()=>{const{left:e}=b.data,a={originY:q.value+V.value[0]*B.value,endY:T.value-V.value[1]*B.value-K.value};return 0===Q.value&&e.yScaleValue.length>1?a.endY=a.originY+U.value-K.value:Q.value===e.yScaleValue.length-1&&(a.originY=a.endY-U.value+K.value),a})),ee=a((()=>{const{left:e}=b.data,a={originY:q.value+H.value[0]*B.value,endY:T.value-H.value[2]*B.value};return 0===Q.value&&e.yScaleValue.length>1?a.originY=_.value.endY+K.value+H.value[0]*B.value:Q.value===e.yScaleValue.length-1&&(a.endY=_.value.originY-H.value[2]*B.value),a})),ae=a((()=>{var e,a;const{top:t,grid:l}=b.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),te=a((()=>{var e;const{left:a,right:t}=b.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>s(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),le=e({canvasWidth:b.data.width,canvasHeight:b.data.height,borderStyle:{...u,...b.data.borderStyle||{}},selectionStyle:b.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:I.value,childbirthDaysHeight:O.value,topList:ae.value,breathingHeight:N.value,hospitalizationDate:b.data.hospitalizationDate,grid:b.data.grid,top:b.data.top,left:b.data.left,right:b.data.right,bottom:b.data.bottom,other:b.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:_.value,vitalSignsOriginY:ee.value,gridXNumber:k.value,gridYNumber:R.value,iconsWidth:G.value,originX:A.value,originY:q.value,endX:W.value,endXLimit:$.value,endY:T.value,xCellWidth:z.value,yCellHeight:B.value,xScaleList:E.value,event:F.value,itemList:J.value,getRightInfo:te.value,config:b.data.config||{},surplusCell:H.value,painSurplusCell:V.value,mainSurplusCell:P.value,painScalePositionSurplusHeight:K.value,painBorderColor:Z.value}),{computedX:ue,computedY:ie,getXValue:ne,getYValue:re}=i(le);return t((()=>S.value),(e=>{e&&function(){h(S,le);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=m(S,le,w,ue,ie,ne,re,b.addRenderItem,C,j);D.redrawPoints=l,D.clickMenu=u;const{drawScaleValue:o}=p(S,le,w,e,C,ue,ie,ne,re,a,t,i);g(S,le,o),f(S,le),y(S,le,w,ue,ie,r);const{select:s}=n(S,le,w);D.select=s}()}),{immediate:!0}),{propItems:le,...l(D)}}export{S as useTemperatureChart};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as s}from"./useDraw.js";function n(n,i){var u,r,t;const{gridYNumber:o,originY:d,grid:a,originX:b,endX:c,xCellWidth:C,yCellHeight:g,gridXNumber:S,endY:m,borderStyle:p,mainSurplusCell:X,isTemperature:f}=i,Y=null!=(u=null!=X?X:i.surplusCell)?u:[0,0,0,0],h=[],y=[],v=new Set,j=(null==(r=a.mainLineStyle)?void 0:r.x)||{},x=(null==(t=a.mainLineStyle)?void 0:t.y)||{},L=a.subLineStyle||j,w=a.subSecondLineStyle||{},{originY:O=0,endY:N=0}=i.vitalSignsOriginY||{},T=Math.round((m-N)/g);for(let e=0;e<=o;e++){const s=d+~~(g*(o-e)),n={...p,...L},i=l([b,s,c,s],n);if(!f&&(e-Y[2])%a.subYCell==0&&e<=o-Y[0])i.set(j),v.add(i);else if(f){const l=d+g*(o-e);l>=O&&l<=N+1&&(e-T)%a.subYCell==0?(i.set(j),v.add(i)):h.push(i)}else h.push(i)}for(let e=0;e<=S;e++){const s=b+~~(C*e),n={...p,...a.subXCell?L:x};a.subXCell&&e%a.subXCell==0?Object.assign(n,{...0!==e&&e!==S?x:p}):a.subSecondXCell&&e%a.subSecondXCell==0&&Object.assign(n,w);const i=l([s,d,s,m],n);a.subXCell&&e%a.subXCell==0?v.add(i):y.push(i)}const k=new e.Group([...h,...y,...v],s);n.value.add(k),n.value.sendToBack(k)}export{n as useGrid};
1
+ import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as n}from"./useDraw.js";function i(i,s){var u,t,r;const{gridYNumber:d,originY:o,grid:a,originX:b,endX:c,xCellWidth:C,yCellHeight:S,gridXNumber:g,endY:m,borderStyle:p,mainSurplusCell:X,isTemperature:f,config:y}=s,Y=null!=(u=null!=X?X:s.surplusCell)?u:[0,0,0,0],h=[],v=[],L=new Set,j=(null==(t=a.mainLineStyle)?void 0:t.x)||{},x=(null==(r=a.mainLineStyle)?void 0:r.y)||{},w=a.subLineStyle||j,O=a.subSecondLineStyle||{},{originY:I=0,endY:N=0}=s.vitalSignsOriginY||{},P=Math.round((m-N)/S);for(let e=0;e<=d;e++){const n=o+~~(S*(d-e)),i={...p,...w},s=l([b,n,c,n],i);if((!f||y.mainLineStyleIncludePain)&&(e-Y[2])%a.subYCell==0&&e<=d-Y[0])s.set(j),L.add(s);else if(f&&!y.mainLineStyleIncludePain){const l=o+S*(d-e);l>=I&&l<=N+1&&(e-P)%a.subYCell==0?(s.set(j),L.add(s)):h.push(s)}else h.push(s)}for(let e=0;e<=g;e++){const n=b+~~(C*e),i={...p,...a.subXCell?w:x};a.subXCell&&e%a.subXCell==0?Object.assign(i,{...0!==e&&e!==g?x:p}):a.subSecondXCell&&e%a.subSecondXCell==0&&Object.assign(i,O);const s=l([n,o,n,m],i);a.subXCell&&e%a.subXCell==0?L.add(s):v.push(s)}const T=new e.Group([...h,...v,...L],n);i.value.add(T),i.value.sendToBack(T)}export{i as useGrid};
@@ -83,6 +83,7 @@ export interface IPropItems {
83
83
  surplusCell: ILineCoordinate;
84
84
  painSurplusCell: [number, number];
85
85
  painScalePositionSurplusHeight: number;
86
+ [key: string]: any;
86
87
  }
87
88
  export interface IPoint {
88
89
  time: string;
@@ -102,6 +103,7 @@ export interface IDate {
102
103
  height?: number;
103
104
  list: Array<string | number>;
104
105
  style?: fabric.ITextOptions;
106
+ key?: string;
105
107
  [key: string]: any;
106
108
  }
107
109
  export interface ITop {
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as r,watch as n,onMounted as t,createVNode as i}from"vue";import{isField as l}from"@formily/core";import{Path as a}from"@formily/path";import{AddCircleOutline as u,RemoveCircle as m}from"@vicons/ionicons5";import{range as s,isNumber as p,isArray as c,isEqual as f}from"lodash-es";import"../../../../index.js";import{useDeepValidate as v}from"./hooks/useDeepValidate.js";import{connect as d,mapProps as y}from"@formily/vue";import{useDebounceFn as h,isObject as N}from"@vueuse/core";import{NButton as g,NIcon as b}from"naive-ui";import x from"../../../FormRender.vue.js";import{formRenderLog as C,mergeDeepProperties as _}from"../../../utils/index.js";import{assignUpdateValue as j}from"../../../utils/schema.js";const G=d(e({name:"FormJsonCombination",props:{title:{type:String,default:""},value:{type:[String,Array]},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},properties:{type:Array,default:()=>[]},showLabel:Boolean,onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:d}){C("当前COMBINATION控件为json模式,推荐使用非json模式,FieldItem.jsonCombination=false");const y=h((function(){d("update:value",JSON.stringify(j.value))}),300),j=o([]),G=r((()=>j.value.length));function I(o,r=!1){c(o)&&(o.length||o.push(...s(e.minGroupNum).map((()=>({})))),o=JSON.stringify(o));const n=function(e){try{if(!e)return null;const o=JSON.parse(e);return Array.isArray(o)?o:null}catch(e){return null}}(o);var t;(t=n)&&!f(t,j.value)&&(n.splice(F.value),n.forEach((function(o,n){if(!N(o))return;j.value[n]=o,r&&_(o,e.properties)})),j.value.splice(n.length),j.value.forEach(w))}n((()=>e.value),(e=>I(e))),t((()=>{const o=`[${s(e.minGroupNum).map((()=>"{}")).join(",")}]`;I(e.value||o,!0),y()}));const S=o([]);function w(e,o){var r;null==(r=S.value[o])||r.setFieldState("*",(o=>{l(o)&&(o.value=a.getIn(e,o.path))}))}function A(){j.value.push(_({},e.properties)),y()}v().bindDeepValidate(S);const F=r((()=>p(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));n(F,(e=>{G.value<=e||(j.value.splice(e),y(),S.value.splice(e))}),{immediate:!0});const J=x;return()=>i("section",{class:"form-render__combination"},[i("header",{class:"form-render__combinationHeader"},[i("div",{class:"form-render__combinationHeaderText"},[e.title]),i(g,{onClick:A,style:{"--n-text-color":"var(--c-primary-color)"},text:!0,disabled:G.value>=F.value},{icon:()=>i(b,{component:u},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.279"))||"新增"}})]),s(G.value).map(((o,r)=>i("section",{class:"form-render__combinationContentJson"},[i(J,{ref:e=>function(e,o){S.value[e]=o,w(j.value[e]||{},e)}(r,e),fieldList:e.properties,onFormChange:e=>function(e,{fieldKey:o,value:r}){!j.value[e]&&(j.value[e]={}),a.setIn(j.value[e],o,r),y()}(r,e)},null),i(g,{text:!0,class:"form-render__combinationClose",type:"error",onClick:()=>function(o){j.value.length>e.minGroupNum?(j.value.splice(o,1),S.value.splice(o,1)):j.value.splice(o,1,{}),y()}(r)},{icon:()=>i(b,{component:m},null)})])))])}}),y(j));export{G as JSON_COMBINATION};
1
+ import{defineComponent as e,ref as o,computed as n,watch as r,onMounted as t,inject as i,createVNode as l}from"vue";import{isField as a}from"@formily/core";import{Path as u}from"@formily/path";import{AddCircleOutline as m,RemoveCircle as s}from"@vicons/ionicons5";import{range as p,isNumber as c,isArray as f,isEqual as v}from"lodash-es";import"../../../../index.js";import{useDeepValidate as d}from"./hooks/useDeepValidate.js";import{connect as y,mapProps as h}from"@formily/vue";import{useDebounceFn as N,isObject as g}from"@vueuse/core";import{NButton as b,NIcon as x}from"naive-ui";import j from"../../../FormRender.vue.js";import{InjectionFormGlobalProps as C}from"../../../constants/index.js";import{formRenderLog as _,mergeDeepProperties as G}from"../../../utils/index.js";import{assignUpdateValue as I}from"../../../utils/schema.js";const S=y(e({name:"FormJsonCombination",props:{title:{type:String,default:""},value:{type:[String,Array]},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},properties:{type:Array,default:()=>[]},showLabel:Boolean,onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e,{emit:y}){_("当前COMBINATION控件为json模式,推荐使用非json模式,FieldItem.jsonCombination=false");const h=N((function(){y("update:value",JSON.stringify(I.value))}),300),I=o([]),S=n((()=>I.value.length));function w(o,n=!1){f(o)&&(o.length||o.push(...p(e.minGroupNum).map((()=>({})))),o=JSON.stringify(o));const r=function(e){try{if(!e)return null;const o=JSON.parse(e);return Array.isArray(o)?o:null}catch(e){return null}}(o);var t;(t=r)&&!v(t,I.value)&&(r.splice(O.value),r.forEach((function(o,r){if(!g(o))return;I.value[r]=o,n&&G(o,e.properties)})),I.value.splice(r.length),I.value.forEach(F))}r((()=>e.value),(e=>w(e))),t((()=>{const o=`[${p(e.minGroupNum).map((()=>"{}")).join(",")}]`;w(e.value||o,!0),h()}));const A=o([]);function F(e,o){var n;null==(n=A.value[o])||n.setFieldState("*",(o=>{a(o)&&(o.value=u.getIn(e,o.path))}))}function J(){I.value.push(G({},e.properties)),h()}d().bindDeepValidate(A);const O=n((()=>c(e.maxGroupNum)?e.maxGroupNum<1?0:~~e.maxGroupNum:1/0));r(O,(e=>{S.value<=e||(I.value.splice(e),h(),A.value.splice(e))}),{immediate:!0});const B=j,k=i(C);return()=>l("section",{class:"form-render__combination"},[l("header",{class:"form-render__combinationHeader"},[l("div",{class:"form-render__combinationHeaderText"},[e.title]),l(b,{onClick:J,style:{"--n-text-color":"var(--c-primary-color)"},text:!0,disabled:S.value>=O.value},{icon:()=>l(x,{component:m},null),default:()=>{var e;return(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.279"))||"新增"}})]),p(S.value).map(((o,n)=>l("section",{class:"form-render__combinationContentJson"},[l(B,{ref:e=>function(e,o){A.value[e]=o,F(I.value[e]||{},e)}(n,e),fieldList:e.properties,components:null==k?void 0:k.components,onFormChange:e=>function(e,{fieldKey:o,value:n}){!I.value[e]&&(I.value[e]={}),u.setIn(I.value[e],o,n),h()}(n,e)},null),l(b,{text:!0,class:"form-render__combinationClose",type:"error",onClick:()=>function(o){I.value.length>e.minGroupNum?(I.value.splice(o,1),A.value.splice(o,1)):I.value.splice(o,1,{}),h()}(n)},{icon:()=>l(x,{component:s},null)})])))])}}),h(I));export{S as JSON_COMBINATION};
@@ -0,0 +1 @@
1
+ export declare function filterRemoteSearchPlugin(): import("../../../../../components/iho-table").TablePlugin;
@@ -0,0 +1 @@
1
+ import{createVNode as e}from"vue";import{isObject as o}from"@vue/shared";import"../../../index.js";import{IhoTableRenderHelper as i}from"../../utils/index.js";import r from"./remoteFilter.vue.js";import{defineTablePlugin as t}from"../../hooks/useTablePlugin.js";function n(){const n="filterRemoteSearchPlugin";return t({name:n,vxe(o){o.renderer.mixin({[n]:{showFilterFooter:!1,renderFilter:o=>e(r,{payload:o},null)}})},apply(e){e.fieldHooks.field.tap(n,((e,r,t,{$table:l})=>{var f;const a=null==(f=e.editRender)?void 0:f.props;return o(a)&&i.hasRemoteSearchFilter(a)?(e.filterRender={name:n},e.filters=[],t.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...t.filterConfig},e):e}))}})}export{n as filterRemoteSearchPlugin};
@@ -0,0 +1,68 @@
1
+ import { AnyObject } from '../../../../../shared/types';
2
+ import { PropType } from 'vue';
3
+ import { VxeColumnPropTypes } from 'vxe-table';
4
+ import { LowCodeTableFieldItem } from '../../../../../components/iho-table';
5
+ declare const _default: import("vue").DefineComponent<{
6
+ payload: {
7
+ type: PropType<VxeColumnPropTypes.FilterSlotParams>;
8
+ required: true;
9
+ };
10
+ }, {
11
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
12
+ payload: {
13
+ type: PropType<VxeColumnPropTypes.FilterSlotParams>;
14
+ required: true;
15
+ };
16
+ }>> & {}>>;
17
+ searchFilterText: import("vue").Ref<string>;
18
+ loading: import("vue").Ref<boolean>;
19
+ optionsListRef: import("vue").Ref<AnyObject[]>;
20
+ lowCodeField: import("vue").ComputedRef<Partial<LowCodeTableFieldItem>>;
21
+ checkedRef: import("vue").Ref<string[]>;
22
+ containerStyleWithHeight: import("vue").ComputedRef<import("vue").CSSProperties>;
23
+ containerProps: {
24
+ ref: import("vue").Ref<any>;
25
+ onScroll: () => void;
26
+ style: Partial<CSSStyleDeclaration>;
27
+ };
28
+ wrapperProps: import("vue").ComputedRef<{
29
+ style: {
30
+ width: string;
31
+ height: string;
32
+ marginTop: string;
33
+ };
34
+ }>;
35
+ list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<AnyObject>[]>;
36
+ reset: () => void;
37
+ close: () => void;
38
+ confirm: () => void;
39
+ SlotRender: import("vue").DefineComponent<{
40
+ renderer: {
41
+ type: PropType<string | import("vue").Component | import("../../../../../shared/types").AnyFn>;
42
+ required: true;
43
+ };
44
+ rootSlots: {
45
+ type: PropType<Record<string, import("../../../../../shared/types").AnyFn>>;
46
+ };
47
+ }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
48
+ renderer: {
49
+ type: PropType<string | import("vue").Component | import("../../../../../shared/types").AnyFn>;
50
+ required: true;
51
+ };
52
+ rootSlots: {
53
+ type: PropType<Record<string, import("../../../../../shared/types").AnyFn>>;
54
+ };
55
+ }>>, {}>;
56
+ NButton: any;
57
+ NButtonGroup: any;
58
+ NCheckbox: any;
59
+ NCheckboxGroup: any;
60
+ NInput: any;
61
+ NSpin: any;
62
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
63
+ payload: {
64
+ type: PropType<VxeColumnPropTypes.FilterSlotParams>;
65
+ required: true;
66
+ };
67
+ }>>, {}>;
68
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"./remoteFilter.vue2.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","remoteFilter.vue"]]);export{t as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as l,computed as a,openBlock as t,createElementBlock as o,createVNode as n,unref as r,withCtx as i,createElementVNode as u,mergeProps as d,normalizeProps as s,guardReactiveProps as p,Fragment as v,renderList as c,createBlock as f,createTextVNode as w,toDisplayString as m,normalizeStyle as _}from"vue";import g from"../../../../../shared/components/SlotRender/SlotRender.js";import{NInput as y,NSpin as h,NCheckboxGroup as b,NCheckbox as L,NButtonGroup as C,NButton as k}from"naive-ui";import{useFilter as B}from"../pluginHooks/useFilter.js";import{getLowCodeFieldFromField as j}from"../../utils/index.js";const R={class:"iho-table__filterWrapper"},F=["title"],S={class:"iho-table__filterFooter"};var W=e({__name:"remoteFilter",props:{payload:{type:Object,required:!0}},setup(e){const W=e,x=l(""),H=l(!1),I=l([]),P=a((()=>j(W.payload.column)||{})),U=l([]),{containerStyleWithHeight:q,containerProps:z,wrapperProps:O,list:A}=B(W,I);function D(){}function E(){}function G(){}return(l,a)=>{var B,j;return t(),o("section",R,[n(r(y),{value:x.value,"onUpdate:value":a[0]||(a[0]=e=>x.value=e)},null,8,["value"]),n(r(h),{show:H.value},{default:i((()=>[n(r(b),{value:U.value,"onUpdate:value":a[1]||(a[1]=e=>U.value=e)},{default:i((()=>[u("section",d(r(z),{style:r(q),class:"iho-table__filterListWrapper"}),[u("section",s(p(r(O))),[(t(!0),o(v,null,c(r(A),(l=>(t(),o("div",{class:"iho-table__filterListItem",key:l.data.value},[n(r(L),{value:l.data.value},{default:i((()=>[u("div",{class:"iho-table__filterListItemContent",title:l.data.label},[r(P).filterLabelRender?(t(),f(r(g),d({key:0,renderer:r(P).filterLabelRender},e.payload,{option:l.data}),null,16,["renderer","option"])):(t(),o(v,{key:1},[w(m(l.data.label),1)],64))],8,F)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])])),_:1},8,["show"]),u("footer",S,[u("section",null,[w((null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.39"))||"已选择"),u("span",{style:_({color:"var(--c-primary-color)"})},m(U.value.length),5),w((null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.417"))||"项")]),n(r(C),{size:"small"},{default:i((()=>[n(r(k),{onClick:D},{default:i((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.509"))||"清空")]})),_:1}),n(r(k),{onClick:E},{default:i((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),n(r(k),{type:"primary",onClick:G},{default:i((()=>{var e;return[w((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})])])}}});export{W as default};
@@ -1,4 +1,4 @@
1
- import { CSSProperties, PropType } from 'vue';
1
+ import { PropType } from 'vue';
2
2
  import { VxeColumnPropTypes, VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from 'vxe-table';
3
3
  import { LowCodeTableFieldItem } from '../../../../../components/iho-table';
4
4
  declare const _default: import("vue").DefineComponent<{
@@ -23,11 +23,14 @@ declare const _default: import("vue").DefineComponent<{
23
23
  checkedCacheRef: import("vue").Ref<string[]>;
24
24
  searchFilterText: import("vue").Ref<string>;
25
25
  close: () => Promise<void>;
26
- OPTION_ITEM_HEIGHT: number;
27
- viewCapacity: import("vue").ComputedRef<number>;
28
26
  customFilterMethod: import("vue").ComputedRef<any>;
29
27
  filteredList: import("vue").ComputedRef<import("vxe-table").VxeTableDefines.FilterOption[]>;
30
- list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<import("vxe-table").VxeTableDefines.FilterOption>[]>;
28
+ partCheckAll: import("vue").WritableComputedRef<boolean>;
29
+ partIndeterminate: import("vue").ComputedRef<boolean>;
30
+ checkAll: import("vue").WritableComputedRef<boolean>;
31
+ indeterminate: import("vue").ComputedRef<boolean>;
32
+ containerStyleWithHeight: import("vue").ComputedRef<import("vue").CSSProperties>;
33
+ list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<import("../../../../../shared/types").AnyObject>[]>;
31
34
  containerProps: {
32
35
  ref: import("vue").Ref<any>;
33
36
  onScroll: () => void;
@@ -40,11 +43,6 @@ declare const _default: import("vue").DefineComponent<{
40
43
  marginTop: string;
41
44
  };
42
45
  }>;
43
- partCheckAll: import("vue").WritableComputedRef<boolean>;
44
- partIndeterminate: import("vue").ComputedRef<boolean>;
45
- checkAll: import("vue").WritableComputedRef<boolean>;
46
- indeterminate: import("vue").ComputedRef<boolean>;
47
- containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
48
46
  confirm: () => void;
49
47
  reset: () => void;
50
48
  loading: import("vue").Ref<boolean>;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as n,onMounted as u,toRaw as o,openBlock as i,createElementBlock as r,unref as v,createBlock as d,createCommentVNode as c,createVNode as s,isRef as p,withCtx as f,createTextVNode as m,createElementVNode as h,toDisplayString as y,mergeProps as _,normalizeProps as g,guardReactiveProps as w,Fragment as k,renderList as b,normalizeStyle as L}from"vue";import C from"../../../../../shared/components/CancelRadio/CancelRadio.js";import D from"../../../../../shared/components/SlotRender/SlotRender.js";import{keywordMatcher as F,widthAppend as R}from"../../../../../shared/utils/index.js";import{useVirtualList as S}from"@vueuse/core";import{isNumber as j,isString as B,isFunction as I,isEqual as x}from"lodash-es";import{NInput as U,NCheckbox as W,NSpin as $,NCheckboxGroup as E,NRadioGroup as O,NButtonGroup as Y,NButton as M}from"naive-ui";import{InjectionIhoTableConfig as P}from"../../constants/index.js";import{getLowCodeFieldFromField as V,isVariableHeightTable as q}from"../../utils/index.js";const z={class:"iho-table__filterWrapper"},A={key:1,class:"iho-table__filterCheckAllWrapper"},H={key:0,class:"iho-table__filterListItem"},N={class:"iho-table__filterListItem"},G=["title"],J=["title"],K={class:"iho-table__filterListItemContent"},Q={class:"iho-table__filterFooter"};var T=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const T=e,X=l("$xetable"),Z=l(P),ee=a((()=>V(T.payload.column)||{})),le=a((()=>{var e;return(null==(e=null==X?void 0:X.internalData)?void 0:e.afterFullData)||[]})),ae=a((()=>{var e;return!!(null==(e=T.payload)?void 0:e.column.filterMultiple)})),te=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=T.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ne=a({get:()=>te.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,n;if(!T.payload||!X)return;const u=X.reactData.filterStore.options||[];if(ae.value?(u.forEach((l=>l._checked=e.includes(l.value))),X.checkFilterOptions()):u.forEach((l=>l._checked=l.value===e[0])),!q(X))return o();function o(){T.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=X.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(n=null==(t=Z.value.scrollY)?void 0:t.gt)?n:100)&&(X.reactData.scrollYLoad=!0),o(),X.reactData.scrollYLoad=!1}}),ue=t([...ne.value]),oe=t("");async function ie(){X&&(X.reactData.filterStore.visible=!1)}n(ie);const re=a((()=>{var e,l;if(!T.payload||!T.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=T.payload.column.editRender)?void 0:e.props)?l:{};return j(a)&&a>0?a:10})),ve=a((()=>{var e;return null==(e=T.payload.column.editRender.props)?void 0:e.filterOptionsFilterMethod})),de=a((()=>oe.value?te.value.filter((e=>ve.value?ve.value(oe.value,e):!!`${e.label}`.includes(oe.value)||(B(e.data)?F(oe.value,e.data):void 0))):te.value)),{list:ce,containerProps:se,wrapperProps:pe}=S(de,{itemHeight:32,overscan:3}),fe=a({get:()=>!!de.value.length&&de.value.every((e=>ue.value.includes(e.value))),set(e){ue.value=e?[...new Set([...ue.value,...de.value.map((e=>e.value))])]:ue.value.filter((e=>de.value.every((l=>l.value!==e))))}}),me=a((()=>de.value.some((e=>ue.value.includes(e.value)))&&!fe.value)),he=a({get:()=>ue.value.length===te.value.length&&0!==te.value.length,set:e=>{ue.value=e?te.value.map((e=>e.value)):[]}}),ye=a((()=>!!ue.value.length&&!he.value)),_e=a((()=>({height:R(32*re.value)})));function ge(){ne.value=ae.value?ue.value:x(ue.value[0],null)?[]:[ue.value[0]],ie()}function we(){ue.value=ae.value?[]:[null]}const ke=t(!1);return u((async()=>{var e;if(!X)return;const l=null==(e=T.payload.column.editRender.props)?void 0:e.onFilterShow;if(I(l))try{ke.value=!0,await l(T.payload);const{filterStore:e}=X.reactData;o(e.options)!==o(te.value)&&(e.options=te.value)}finally{ke.value=!1}})),(l,a)=>{var t,n;return i(),r("section",z,[v(te).length>5?(i(),d(v(U),{key:0,value:oe.value,"onUpdate:value":a[0]||(a[0]=e=>oe.value=e)},null,8,["value"])):c("v-if",!0),v(ae)?(i(),r("div",A,[v(te).length>5?(i(),r("div",H,[s(v(W),{checked:v(fe),"onUpdate:checked":a[1]||(a[1]=e=>p(fe)?fe.value=e:null),indeterminate:v(me)},{default:f((()=>[m("全选当前")])),_:1},8,["checked","indeterminate"])])):c("v-if",!0),h("div",N,[s(v(W),{checked:v(he),"onUpdate:checked":a[2]||(a[2]=e=>p(he)?he.value=e:null),indeterminate:v(ye)},{default:f((()=>{var e;return[m(((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.577"))||"全选所有")+y(v(ee).showFilterFullNums?`(${v(le).length})`:""),1)]})),_:1},8,["checked","indeterminate"])])])):c("v-if",!0),s(v($),{show:ke.value},{default:f((()=>[v(ae)?(i(),d(v(E),{key:0,value:ue.value,"onUpdate:value":a[3]||(a[3]=e=>ue.value=e)},{default:f((()=>[h("section",_(v(se),{style:v(_e),class:"iho-table__filterListWrapper"}),[h("section",g(w(v(pe))),[(i(!0),r(k,null,b(v(ce),(l=>(i(),r("div",{class:"iho-table__filterListItem",key:l.data.value},[s(v(W),{value:l.data.value},{default:f((()=>[h("div",{class:"iho-table__filterListItemContent",title:l.data.label},[v(ee).filterLabelRender?(i(),d(v(D),_({key:0,renderer:v(ee).filterLabelRender},e.payload,{option:l.data}),null,16,["renderer","option"])):(i(),r(k,{key:1},[m(y(l.data.label),1)],64))],8,G)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(i(),d(v(O),{key:1,value:ue.value[0],"onUpdate:value":a[5]||(a[5]=e=>ue.value[0]=e)},{default:f((()=>[h("section",_(v(se),{style:v(_e),class:"iho-table__filterListWrapper"}),[h("section",g(w(v(pe))),[(i(!0),r(k,null,b(v(ce),(e=>(i(),r("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[s(v(C),{value:e.data.value,currentValue:ue.value[0],cancelable:"",onCancel:a[4]||(a[4]=e=>ue.value=[null])},{default:f((()=>[h("div",K,y(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,J)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),h("footer",Q,[h("section",null,[v(ae)?(i(),r(k,{key:0},[m((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.39"))||"已选择"),h("span",{style:L({color:"var(--c-primary-color)"})},y(ue.value.length),5),m((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.417"))||"项")],64)):c("v-if",!0)]),s(v(Y),{size:"small"},{default:f((()=>[s(v(M),{onClick:we},{default:f((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.509"))||"清空")]})),_:1}),s(v(M),{onClick:ie},{default:f((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),s(v(M),{type:"primary",onClick:ge},{default:f((()=>{var e;return[m((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})])])}}});export{T as default};
1
+ import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as n,onMounted as u,toRaw as i,openBlock as o,createElementBlock as r,unref as v,createBlock as d,createCommentVNode as s,createVNode as c,isRef as p,withCtx as f,createTextVNode as h,createElementVNode as m,toDisplayString as y,mergeProps as _,normalizeProps as g,guardReactiveProps as w,Fragment as k,renderList as b,normalizeStyle as L}from"vue";import C from"../../../../../shared/components/CancelRadio/CancelRadio.js";import F from"../../../../../shared/components/SlotRender/SlotRender.js";import{keywordMatcher as D}from"../../../../../shared/utils/index.js";import{isString as R,isFunction as S,isEqual as j}from"lodash-es";import{NInput as B,NCheckbox as I,NSpin as x,NCheckboxGroup as U,NRadioGroup as W,NButtonGroup as $,NButton as E}from"naive-ui";import{InjectionIhoTableConfig as O}from"../../constants/index.js";import{useFilter as Y}from"../pluginHooks/useFilter.js";import{getLowCodeFieldFromField as H,isVariableHeightTable as M}from"../../utils/index.js";const P={class:"iho-table__filterWrapper"},V={key:1,class:"iho-table__filterCheckAllWrapper"},q={key:0,class:"iho-table__filterListItem"},z={class:"iho-table__filterListItem"},A=["title"],N=["title"],G={class:"iho-table__filterListItemContent"},J={class:"iho-table__filterFooter"};var K=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const K=e,Q=l("$xetable"),T=l(O),X=a((()=>H(K.payload.column)||{})),Z=a((()=>{var e;return(null==(e=null==Q?void 0:Q.internalData)?void 0:e.afterFullData)||[]})),ee=a((()=>{var e;return!!(null==(e=K.payload)?void 0:e.column.filterMultiple)})),le=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=K.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ae=a({get:()=>le.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,n;if(!K.payload||!Q)return;const u=Q.reactData.filterStore.options||[];if(ee.value?(u.forEach((l=>l._checked=e.includes(l.value))),Q.checkFilterOptions()):u.forEach((l=>l._checked=l.value===e[0])),!M(Q))return i();function i(){K.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=Q.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(n=null==(t=T.value.scrollY)?void 0:t.gt)?n:100)&&(Q.reactData.scrollYLoad=!0),i(),Q.reactData.scrollYLoad=!1}}),te=t([...ae.value]),ne=t("");async function ue(){Q&&(Q.reactData.filterStore.visible=!1)}n(ue);const ie=a((()=>{var e;return null==(e=K.payload.column.editRender.props)?void 0:e.filterOptionsFilterMethod})),oe=a((()=>ne.value?le.value.filter((e=>ie.value?ie.value(ne.value,e):!!`${e.label}`.includes(ne.value)||(R(e.data)?D(ne.value,e.data):void 0))):le.value)),re=a({get:()=>!!oe.value.length&&oe.value.every((e=>te.value.includes(e.value))),set(e){te.value=e?[...new Set([...te.value,...oe.value.map((e=>e.value))])]:te.value.filter((e=>oe.value.every((l=>l.value!==e))))}}),ve=a((()=>oe.value.some((e=>te.value.includes(e.value)))&&!re.value)),de=a({get:()=>te.value.length===le.value.length&&0!==le.value.length,set:e=>{te.value=e?le.value.map((e=>e.value)):[]}}),se=a((()=>!!te.value.length&&!de.value)),{containerStyleWithHeight:ce,list:pe,containerProps:fe,wrapperProps:he}=Y(K,oe);function me(){ae.value=ee.value?te.value:j(te.value[0],null)?[]:[te.value[0]],ue()}function ye(){te.value=ee.value?[]:[null]}const _e=t(!1);return u((async()=>{var e;if(!Q)return;const l=null==(e=K.payload.column.editRender.props)?void 0:e.onFilterShow;if(S(l))try{_e.value=!0,await l(K.payload);const{filterStore:e}=Q.reactData;i(e.options)!==i(le.value)&&(e.options=le.value)}finally{_e.value=!1}})),(l,a)=>{var t,n;return o(),r("section",P,[v(le).length>5?(o(),d(v(B),{key:0,value:ne.value,"onUpdate:value":a[0]||(a[0]=e=>ne.value=e)},null,8,["value"])):s("v-if",!0),v(ee)?(o(),r("div",V,[v(le).length>5?(o(),r("div",q,[c(v(I),{checked:v(re),"onUpdate:checked":a[1]||(a[1]=e=>p(re)?re.value=e:null),indeterminate:v(ve)},{default:f((()=>[h("全选当前")])),_:1},8,["checked","indeterminate"])])):s("v-if",!0),m("div",z,[c(v(I),{checked:v(de),"onUpdate:checked":a[2]||(a[2]=e=>p(de)?de.value=e:null),indeterminate:v(se)},{default:f((()=>{var e;return[h(((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.577"))||"全选所有")+y(v(X).showFilterFullNums?`(${v(Z).length})`:""),1)]})),_:1},8,["checked","indeterminate"])])])):s("v-if",!0),c(v(x),{show:_e.value},{default:f((()=>[v(ee)?(o(),d(v(U),{key:0,value:te.value,"onUpdate:value":a[3]||(a[3]=e=>te.value=e)},{default:f((()=>[m("section",_(v(fe),{style:v(ce),class:"iho-table__filterListWrapper"}),[m("section",g(w(v(he))),[(o(!0),r(k,null,b(v(pe),(l=>(o(),r("div",{class:"iho-table__filterListItem",key:l.data.value},[c(v(I),{value:l.data.value},{default:f((()=>[m("div",{class:"iho-table__filterListItemContent",title:l.data.label},[v(X).filterLabelRender?(o(),d(v(F),_({key:0,renderer:v(X).filterLabelRender},e.payload,{option:l.data}),null,16,["renderer","option"])):(o(),r(k,{key:1},[h(y(l.data.label),1)],64))],8,A)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(o(),d(v(W),{key:1,value:te.value[0],"onUpdate:value":a[5]||(a[5]=e=>te.value[0]=e)},{default:f((()=>[m("section",_(v(fe),{style:v(ce),class:"iho-table__filterListWrapper"}),[m("section",g(w(v(he))),[(o(!0),r(k,null,b(v(pe),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[c(v(C),{value:e.data.value,currentValue:te.value[0],cancelable:"",onCancel:a[4]||(a[4]=e=>te.value=[null])},{default:f((()=>[m("div",G,y(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,N)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),m("footer",J,[m("section",null,[v(ee)?(o(),r(k,{key:0},[h((null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.39"))||"已选择"),m("span",{style:L({color:"var(--c-primary-color)"})},y(te.value.length),5),h((null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.417"))||"项")],64)):s("v-if",!0)]),c(v($),{size:"small"},{default:f((()=>[c(v(E),{onClick:ye},{default:f((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.509"))||"清空")]})),_:1}),c(v(E),{onClick:ue},{default:f((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),c(v(E),{type:"primary",onClick:me},{default:f((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.27"))||"确定")]})),_:1})])),_:1})])])}}});export{K as default};
@@ -1 +1 @@
1
- import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./crossHeaderPlugin.js";import*as t from"./defaultConfigPlugin.js";import*as l from"./defaultValuePlugin.js";import*as d from"./dragScrollPlugin.js";import*as g from"./dynamicFilterRenderPlugin/index.js";import*as o from"./filterDaterangeRenderPlugin/index.js";import*as u from"./filterRenderPlugin/index.js";import*as a from"./filterTextPlugin/index.js";import*as P from"./filterVisibleEventPlugin.js";import*as m from"./forceArrowKeyPlugin.js";import*as f from"./headerPlugin/index.js";import*as p from"./highLightSetPlugin.js";import*as x from"./keyboardEventPlugin.js";import*as j from"./lowCodeFieldAdaptorPlugin.js";import*as c from"./maxCheckSizePlugin.js";import*as R from"./operationalFormPlugin.js";import*as b from"./pagerScrollPlugin/index.js";import*as w from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as h from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as W from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as S from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as v from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as k from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as y from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as C from"./rendererPlugins/editableWidgets/switchRendererPlugin.js";import*as F from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as A from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as E from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as T from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as D from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as H from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as V from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as q from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as z from"./rowClickPlugin.js";import*as G from"./rowDragPlugin.js";import*as I from"./rowGroupSettingPlugin/index.js";import*as K from"./stickyFixedPlugin.js";import*as L from"./varialbleHeightPlugin.js";import*as O from"./verticalTablePlugin/index.js";import*as B from"./virtualTreePlugin.js";import*as J from"./wordbookSettingPlugin.js";import{separateMetaModule as M}from"../../../../shared/utils/index.js";var N=M(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./crossHeaderPlugin.ts":s,"./defaultConfigPlugin.ts":t,"./defaultValuePlugin.ts":l,"./dragScrollPlugin.ts":d,"./dynamicFilterRenderPlugin/index.tsx":g,"./filterDaterangeRenderPlugin/index.tsx":o,"./filterRenderPlugin/index.tsx":u,"./filterTextPlugin/index.tsx":a,"./filterVisibleEventPlugin.ts":P,"./forceArrowKeyPlugin.ts":m,"./headerPlugin/index.tsx":f,"./highLightSetPlugin.tsx":p,"./keyboardEventPlugin.ts":x,"./lowCodeFieldAdaptorPlugin.tsx":j,"./maxCheckSizePlugin.ts":c,"./operationalFormPlugin.ts":R,"./pagerScrollPlugin/index.ts":b,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":w,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":h,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":W,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":S,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":v,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":k,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":y,"./rendererPlugins/editableWidgets/switchRendererPlugin.tsx":C,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":F,"./rendererPlugins/widgets/checkRendererPlugin.tsx":A,"./rendererPlugins/widgets/colorRendererPlugin.tsx":E,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":T,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":D,"./rendererPlugins/widgets/labelRendererPlugin.tsx":H,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":V,"./rendererPlugins/widgets/seqRendererPlugin.tsx":q,"./rowClickPlugin.ts":z,"./rowDragPlugin.ts":G,"./rowGroupSettingPlugin/index.ts":I,"./stickyFixedPlugin.tsx":K,"./varialbleHeightPlugin.tsx":L,"./verticalTablePlugin/index.ts":O,"./virtualTreePlugin.ts":B,"./wordbookSettingPlugin.ts":J}));export{N as default};
1
+ import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./crossHeaderPlugin.js";import*as t from"./defaultConfigPlugin.js";import*as l from"./defaultValuePlugin.js";import*as d from"./dragScrollPlugin.js";import*as g from"./dynamicFilterRenderPlugin/index.js";import*as o from"./filterDaterangeRenderPlugin/index.js";import*as u from"./filterRemoteSearchPlugin/index.js";import*as a from"./filterRenderPlugin/index.js";import*as P from"./filterTextPlugin/index.js";import*as m from"./filterVisibleEventPlugin.js";import*as f from"./forceArrowKeyPlugin.js";import*as x from"./headerPlugin/index.js";import*as p from"./highLightSetPlugin.js";import*as j from"./keyboardEventPlugin.js";import*as c from"./lowCodeFieldAdaptorPlugin.js";import*as R from"./maxCheckSizePlugin.js";import*as b from"./operationalFormPlugin.js";import*as w from"./pagerScrollPlugin/index.js";import*as h from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as S from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as W from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as v from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as k from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as y from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as C from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as F from"./rendererPlugins/editableWidgets/switchRendererPlugin.js";import*as A from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as E from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as T from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as D from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as H from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as V from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as q from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as z from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as G from"./rowClickPlugin.js";import*as I from"./rowDragPlugin.js";import*as K from"./rowGroupSettingPlugin/index.js";import*as L from"./stickyFixedPlugin.js";import*as O from"./varialbleHeightPlugin.js";import*as B from"./verticalTablePlugin/index.js";import*as J from"./virtualTreePlugin.js";import*as M from"./wordbookSettingPlugin.js";import{separateMetaModule as N}from"../../../../shared/utils/index.js";var Q=N(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./crossHeaderPlugin.ts":s,"./defaultConfigPlugin.ts":t,"./defaultValuePlugin.ts":l,"./dragScrollPlugin.ts":d,"./dynamicFilterRenderPlugin/index.tsx":g,"./filterDaterangeRenderPlugin/index.tsx":o,"./filterRemoteSearchPlugin/index.tsx":u,"./filterRenderPlugin/index.tsx":a,"./filterTextPlugin/index.tsx":P,"./filterVisibleEventPlugin.ts":m,"./forceArrowKeyPlugin.ts":f,"./headerPlugin/index.tsx":x,"./highLightSetPlugin.tsx":p,"./keyboardEventPlugin.ts":j,"./lowCodeFieldAdaptorPlugin.tsx":c,"./maxCheckSizePlugin.ts":R,"./operationalFormPlugin.ts":b,"./pagerScrollPlugin/index.ts":w,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":h,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":S,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":W,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":v,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":k,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":y,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":C,"./rendererPlugins/editableWidgets/switchRendererPlugin.tsx":F,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":A,"./rendererPlugins/widgets/checkRendererPlugin.tsx":E,"./rendererPlugins/widgets/colorRendererPlugin.tsx":T,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":D,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":H,"./rendererPlugins/widgets/labelRendererPlugin.tsx":V,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":q,"./rendererPlugins/widgets/seqRendererPlugin.tsx":z,"./rowClickPlugin.ts":G,"./rowDragPlugin.ts":I,"./rowGroupSettingPlugin/index.ts":K,"./stickyFixedPlugin.tsx":L,"./varialbleHeightPlugin.tsx":O,"./verticalTablePlugin/index.ts":B,"./virtualTreePlugin.ts":J,"./wordbookSettingPlugin.ts":M}));export{Q as default};
@@ -0,0 +1 @@
1
+ export * from './useFilter';
@@ -0,0 +1 @@
1
+ export{useFilter}from"./useFilter.js";
@@ -0,0 +1,21 @@
1
+ import { AnyObject } from '../../../../../shared/types';
2
+ import { CSSProperties, Ref } from 'vue';
3
+ import { VxeColumnPropTypes } from 'vxe-table';
4
+ export declare function useFilter(props: {
5
+ payload: VxeColumnPropTypes.FilterSlotParams;
6
+ }, optionListRef: Ref<AnyObject[]>): {
7
+ containerStyleWithHeight: import("vue").ComputedRef<CSSProperties>;
8
+ list: Ref<import("@vueuse/core").UseVirtualListItem<AnyObject>[]>;
9
+ containerProps: {
10
+ ref: Ref<any>;
11
+ onScroll: () => void;
12
+ style: Partial<CSSStyleDeclaration>;
13
+ };
14
+ wrapperProps: import("vue").ComputedRef<{
15
+ style: {
16
+ width: string;
17
+ height: string;
18
+ marginTop: string;
19
+ };
20
+ }>;
21
+ };
@@ -0,0 +1 @@
1
+ import{widthAppend as r}from"../../../../../shared/utils/index.js";import{useVirtualList as o}from"@vueuse/core";import{isNumber as e}from"lodash-es";import{computed as t}from"vue";function i(i,n){const p=t((()=>{var r,o;if(!i.payload||!i.payload.column)return 10;const{filterCapacity:t}=null!=(o=null==(r=i.payload.column.editRender)?void 0:r.props)?o:{};return e(t)&&t>0?t:10})),a=t((()=>({height:r(32*p.value)}))),{list:l,containerProps:s,wrapperProps:u}=o(n,{itemHeight:32,overscan:3});return{containerStyleWithHeight:a,list:l,containerProps:s,wrapperProps:u}}export{i as useFilter};
@@ -25,6 +25,10 @@ declare const _default: import("vue").DefineComponent<{
25
25
  type: BooleanConstructor;
26
26
  default: boolean;
27
27
  };
28
+ checkAbleLevel: {
29
+ type: PropType<number | "last">;
30
+ default: string;
31
+ };
28
32
  wordbook: {
29
33
  type: PropType<Partial<{
30
34
  level_num: number;
@@ -88,6 +92,10 @@ declare const _default: import("vue").DefineComponent<{
88
92
  type: BooleanConstructor;
89
93
  default: boolean;
90
94
  };
95
+ checkAbleLevel: {
96
+ type: PropType<number | "last">;
97
+ default: string;
98
+ };
91
99
  wordbook: {
92
100
  type: PropType<Partial<{
93
101
  level_num: number;
@@ -503,6 +511,10 @@ declare const _default: import("vue").DefineComponent<{
503
511
  type: BooleanConstructor;
504
512
  default: boolean;
505
513
  };
514
+ checkAbleLevel: {
515
+ type: PropType<number | "last">;
516
+ default: string;
517
+ };
506
518
  wordbook: {
507
519
  type: PropType<Partial<{
508
520
  level_num: number;
@@ -549,5 +561,6 @@ declare const _default: import("vue").DefineComponent<{
549
561
  valueField: string;
550
562
  lazyRequest: boolean;
551
563
  requestCache: boolean;
564
+ checkAbleLevel: number | "last";
552
565
  }>;
553
566
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as a,openBlock as t,createBlock as o,unref as r,isRef as s,withCtx as i,createVNode as u}from"vue";import l from"../../../../../../../shared/components/no-data/NoData.vue.js";import"../../../../../../../shared/utils/index.js";import"naive-ui";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{useLevelSearchCascader as p}from"../../../../../../../shared/hooks/useLevelSearchCascader.js";import"@vueuse/shared";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../../../../shared/hooks/useScrollLoading.js";import{InjectionTableAsyncQueue as n}from"../../../../constants/index.js";import d from"../../../../../../search-cascader/index.js";var c=e({__name:"levelSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},value:{type:[String,Array]},fieldKey:{type:String,required:!0},payload:{type:Object,required:!0}},emits:["update:value","click"],setup(e,{emit:c}){const h=e,m=a(n),{valueKey:y,valueRef:f,labelKey:v,optionsRef:k,showRef:j,fetchData:S,menuWidth:g,searchCascaderRef:b}=p(h,c,{fieldKey:h.fieldKey,asyncQueue:m,getRequestPayload:()=>h.payload});function q(){g.value=150}function w(e){c("click",e)}return(e,a)=>(t(),o(r(d),{ref_key:"searchCascaderRef",ref:b,value:r(f),"onUpdate:value":a[0]||(a[0]=e=>s(f)?f.value=e:null),show:r(j),"onUpdate:show":a[1]||(a[1]=e=>s(j)?j.value=e:null),options:r(k),"label-key":r(v),"value-key":r(y),search:r(S),"menu-width":r(g),"input-props":{onClick:w},onFocus:q},{empty:i((()=>[u(r(l))])),_:1},8,["value","show","options","label-key","value-key","search","menu-width","input-props"]))}});export{c as default};
1
+ import{defineComponent as e,inject as a,openBlock as t,createBlock as o,unref as r,isRef as s,withCtx as l,createVNode as u}from"vue";import i from"../../../../../../../shared/components/no-data/NoData.vue.js";import"../../../../../../../shared/utils/index.js";import"naive-ui";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{useLevelSearchCascader as p}from"../../../../../../../shared/hooks/useLevelSearchCascader.js";import"@vueuse/shared";import"../../../../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../../../../../shared/hooks/useScrollLoading.js";import{InjectionTableAsyncQueue as n}from"../../../../constants/index.js";import d from"../../../../../../search-cascader/index.js";var c=e({__name:"levelSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},checkAbleLevel:{type:[Number,String],default:"last"},wordbook:{type:Object,required:!0},value:{type:[String,Array]},fieldKey:{type:String,required:!0},payload:{type:Object,required:!0}},emits:["update:value","click"],setup(e,{emit:c}){const h=e,m=a(n),{valueKey:y,valueRef:f,labelKey:v,optionsRef:k,showRef:S,fetchData:b,menuWidth:g,searchCascaderRef:j}=p(h,c,{fieldKey:h.fieldKey,asyncQueue:m,getRequestPayload:()=>h.payload});function q(){g.value=150}function w(e){c("click",e)}return(e,a)=>(t(),o(r(d),{ref_key:"searchCascaderRef",ref:j,value:r(f),"onUpdate:value":a[0]||(a[0]=e=>s(f)?f.value=e:null),show:r(S),"onUpdate:show":a[1]||(a[1]=e=>s(S)?S.value=e:null),options:r(k),"label-key":r(v),"value-key":r(y),search:r(b),"menu-width":r(g),"input-props":{onClick:w},onFocus:q},{empty:l((()=>[u(r(i))])),_:1},8,["value","show","options","label-key","value-key","search","menu-width","input-props"]))}});export{c as default};