cnhis-design-vue 3.2.2-beta.2 → 3.2.2-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/biunique-chat/index.d.ts +738 -562
- package/es/components/biunique-chat/index.js +1 -1
- package/es/components/biunique-chat/src/Index.vue.d.ts +1201 -0
- package/es/components/biunique-chat/src/Index.vue.js +1 -0
- package/es/components/biunique-chat/src/Index.vue2.js +1 -0
- package/es/components/biunique-chat/src/api/index.d.ts +2 -5
- package/es/components/biunique-chat/src/api/index.js +1 -1
- package/es/components/biunique-chat/src/components/ChatFile.vue.d.ts +241 -0
- package/es/components/biunique-chat/src/components/ChatFile.vue.js +1 -0
- package/es/components/biunique-chat/src/components/ChatFile.vue2.js +1 -0
- package/es/components/biunique-chat/src/components/ChatFooter.vue.d.ts +3 -5
- package/es/components/biunique-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatHeader.vue.d.ts +639 -0
- package/es/components/biunique-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatMain.vue.d.ts +61 -5
- package/es/components/biunique-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/biunique-chat/src/components/ChatRecord.vue.d.ts +101 -0
- package/es/components/biunique-chat/src/components/ChatRecord.vue.js +1 -0
- package/es/components/biunique-chat/src/components/ChatRecord.vue2.js +1 -0
- package/es/components/biunique-chat/src/components/ChatSet.vue.d.ts +246 -0
- package/es/components/biunique-chat/src/components/ChatSet.vue.js +1 -0
- package/es/components/biunique-chat/src/components/ChatSet.vue2.js +1 -0
- package/es/components/biunique-chat/src/components/PersonProfile.vue.d.ts +59 -0
- package/es/components/biunique-chat/src/components/PersonProfile.vue.js +1 -0
- package/es/components/biunique-chat/src/components/PersonProfile.vue2.js +1 -0
- package/es/components/biunique-chat/src/components/SiderList.vue.d.ts +18 -28
- package/es/components/biunique-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/biunique-chat/src/hooks/useState.d.ts +7 -0
- package/es/components/biunique-chat/src/hooks/useState.js +1 -0
- package/es/components/biunique-chat/src/types/index.d.ts +10 -0
- package/es/components/biunique-chat/src/types/index.js +1 -0
- package/es/components/biunique-chat/src/utils/index.d.ts +6 -0
- package/es/components/biunique-chat/src/utils/index.js +1 -0
- package/es/components/biunique-chat/style/iconfont.ttf +0 -0
- package/es/components/biunique-chat/style/index.css +1 -1
- package/es/components/button-print/src/utils/print.d.ts +1 -0
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/calendar/index.d.ts +1 -11
- package/es/components/calendar/src/Calendar.vue.d.ts +1 -11
- package/es/components/callback/src/components/render/popupMaps.d.ts +2 -0
- package/es/components/classification/src/index.vue.d.ts +0 -3
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
- package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useSelectedSetting.d.ts +3 -4
- package/es/components/form-render/src/hooks/useSelectedSetting.js +1 -1
- package/es/components/iho-table/index.d.ts +2 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.d.ts +5 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHeaderCSS.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useHoverColumn.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/renderer.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/types.d.ts +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.d.ts +1 -0
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.d.ts +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/step-notice/index.d.ts +1 -0
- package/es/components/step-notice/src/StepNotice.vue.d.ts +2 -0
- package/es/components/step-notice/src/StepNotice.vue2.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/biunique-chat/src/BiuniqueChat.vue.d.ts +0 -1005
- package/es/components/biunique-chat/src/BiuniqueChat.vue.js +0 -1
- package/es/components/biunique-chat/src/BiuniqueChat.vue2.js +0 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as n}from"vue";import{useDialog as l}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import
|
|
1
|
+
import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as n}from"vue";import{useDialog as l}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useCenter as f}from"./useCenter.js";import{useOther as g}from"./useOther.js";function y(y,w,x,b,j,C){const Y=l(),H=e(),S=e(),D=e(),A=t((()=>w.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),M=t((()=>{var e;return null!=(e=w.data.left.width)?e:0})),T=t((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell})),X=t((()=>{const{grid:e}=w.data;return e.mainYCell*e.subYCell})),G=t((()=>{const{treeData:e=[],show:t=!0}=w.data.top;return t?s(e):0})),V=t((()=>w.data.top.tree.cellHeight)),k=t((()=>V.value*G.value)),P=t((()=>te(_("drug")||"top"))),L=t((()=>P.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=w.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(w.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(T.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:M.value}})),E=function(){const{show:e=!0}=w.data.top;if(!e)return[];const t=d(w.data.top.treeData);let a=0;const{cellWidth:r,cellHeight:i}=w.data.top.tree;return function e(t,n=0){t.forEach((t=>{var l;const o={top:a*i+P.value,left:n*r,width:r,height:i};if(a++,null==(l=t.children)?void 0:l.length){a--;const r=s(t.children);o.height=r*i,e(t.children,n+1)}else o.width=M.value-o.left;Object.assign(t,o)}))}(t),t}(),W=t((()=>te(_("xAxis")||"center"))),I=t((()=>{var e;const{width:t,right:a}=w.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),q=t((()=>te(_("intraoperatively")||"bottom"))),z=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=w.data.other)?void 0:e.mark)||{};return t&&a?a:0})),B=t((()=>q.value+(w.data.height-k.value-O.value.height-z.value))),F=t((()=>(I.value-M.value)/T.value)),J=t((()=>(B.value-q.value)/X.value)),K=t((()=>O.value.spaceTimeStamp/F.value)),Q=t((()=>{const{scaleValues:e}=w.data;return p(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),R=t((()=>ae("pulse"))),U=t((()=>ae("temperature"))),Z=t((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),$=a({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...o,...w.data.borderStyle},pointSelectionStyle:w.data.pointSelectionStyle||{},grid:w.data.grid,top:w.data.top,left:w.data.left,other:w.data.other,topGridYNumber:r(G),topGridYCellHeight:r(V),topGridOriginY:r(P),topGridEndY:r(L),treeData:E,xAxis:r(O),originYXAxis:r(W),startTime:r(N),timeXCell:r(K),gridXNumber:r(T),gridYNumber:r(X),xCellWidth:r(F),yCellHeight:r(J),originX:r(M),endX:r(I),originY:r(q),endY:r(B),markHeight:r(z),itemList:r(Q),scaleValues:w.data.scaleValues,pulseYCell:r(R),temperatureYCell:r(U),event:r(Z),dialog:Y});function _(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ee(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return w.data.height-k.value-a}}function te(e){switch(e){case"top":return 0;case"center":return ee("top");default:return ee("top")+ee("center")}}function ae(e){const{scaleValues:t}=w.data,a=t.find((t=>t.type===e));return J.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await n(),v(y,$,x,j);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=f(y,$,x,j,C);h(y,$,x,j,a,r,i,l);const{clickMenu:d}=g(y,$,x,j,C,a,o,u,s);S.value=e,D.value=e=>{const{item:a}=e;a.type&&m.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:$,redrawPoints:S,select:H,clickMenu:D}}export{y as useSurgicalAnesthesiaChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,getFloorNumber as d,isValidValue as p,setOtherType as f,isEffectiveNode as h,getTime as v,getIndex as g,deleteProperty as y}from"../../utils/index.js";import"../useEvent.js";import{useCommon as m}from"../useCommon.js";import"vue";import{cloneDeep as x,flatten as b}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as j,PAIN_MENU as w,OVERLAP as L}from"../../constants/index.js";function k(k,Y,E,M,$,O,C,P,A,I){r(k,Y);const{getEqualXTypes:R,handleAddPrevent:T}=m(k,E,Y),{createShadowLines:V}=t(),{left:X,xScaleList:z,xCellWidth:D,yCellHeight:F,originX:H,endX:_,originY:W,endY:q,itemList:G,event:B,vitalSignsOriginY:J,painOriginY:K,hospitalizationDate:N,config:Q,canvasHeight:U}=Y,Z=new Set,ee=["xinmai","mai"],te=new Map,ie=new Set,ne=new Set,oe=new Set,le=x(X.yScaleValue);function se(t){var o;const l=le.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Z.size&&k.value.remove(...Z),Z.clear(),te.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=te.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of te)t.push(e[1]),e[0]===ee[0]&&e[1].forEach((e=>{(te.get(ee[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...V(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),Z.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...r,originX:"center"});e.push(n),Z.add(n)}))}k.value.add(...e)}Z.add(l),k.value.add(l)}))}}function re(){var e;const t=le.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},L,X.overlap||{}),l=[];ie.size&&[...ie].forEach((e=>{[...ne].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{k.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),oe.add(e)}))}))}function ae(e,t,r){var u;const{type:c,riseStyle:h={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},dataList:L=[],list:M=[]}=r,{type:O,textStyle:P,showConnectLine:I=!1}=j,R=[],T=[],V=[];let X=null;if(null==(u=e.list)||u.forEach(((u,j)=>{const z=a(c)?L.find((e=>e.key===u.key)):e,H=de(u,r),_=e.list[j+1],W=_?de(_,r):void 0,q=_?a(c)?L.find((e=>e.key===_.key)):e:{},{title:G=""}=z;if("脉搏"===G&&"脉搏"!==q.title||"脉搏"!==G&&"脉搏"===q.title||!H||!W||d(H[0],1)!==d(W[0],1))H&&X&&(H[0]=X),X=null;else{const e=H[0]-D/2;H[0]=e+D/4,W[0]=X=H[0]+D/2}const N={};N.value=function(e,t,i){if(!(null==e?void 0:e.length)||!Q.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=J.originY+F?e[1]+F:e[1]-F,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return V.push(s),{obj:s,top:-F}}(H,u,z),function(e,t,r,a){var u,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:f={}}=r,{value:m}=a;let x,b,j,w,L;if(t.noRise&&v.show){const t=S(v)?$(c,M,35):e[1];if(v.text)j=l([e[0],S(v)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style});else{const i=t+2*F;j=s([e[0],t,i],{...v.style})}V.push(j)}t.rise&&h.show&&h.text&&(w=l([e[0],e[1]-(m?F:0)-5],{value:h.text.split("").join("\n"),originY:"bottom",...h.style}),V.push(w));t.verified&&(L=l([e[0],e[1]-(m?F:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),V.push(L));if(p(t.physicsReduce)||p(t.drugReduce)){const l=$(c,M,null!=(u=t.physicsReduce)?u:t.drugReduce),s=l<e[1]&&(null==Q?void 0:Q.hypothermyViewCustom)?e[0]+D/2:e[0];x=i([...e,s,l],{...f,...y.line,...n}),b=o((null==(d=null==y?void 0:y.point)?void 0:d.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===U?"bottom":"center"}),x&&V.push(x),b&&V.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:v.text?5:2*F,isFixed:S(v)},riseText:{obj:w,top:(m?-F:0)-5},verifiedText:{obj:L,top:(m?-F:0)-5},reducePoint:{obj:b,type:"reduce"}})}(H,u,z,N),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...M),r=Math.min(...M);let a,u,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*F,i=[e[1]-F/2,t];t<J.originY&&(t=e[1]+2.5*F,i=[t,e[1]+F/2]),a=s([e[0],i[0],i[1]],x,"up"),V.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=a?e[1]+F/2+a.height:e[1]+F;u=l([e[0],t],i),V.push(u)}+t.value<r&&(u=l([e[0],e[1]-F],i),V.push(u))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*F;d=s([e[0],t,i],{...w.style})}V.push(d)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-F},belowMinValue:{obj:d,top:w.text?5:2*F,moveHide:!0}})}(H,u,z,N),function(n,l,s,a,u,d){let p,h;const{pointAttr:v={},lineAttr:g={},title:y="",key:x,type:b="circle"}=u,j=e.list[a+1],w=ue(c,e.list[a].value),L=l&&ue(c,j.value);if(n&&l&&!s.breakpoint&&(!w&&!L||I)){h=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==Q?void 0:Q.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});V.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const S=s.pacemakerShow&&"pulse"==c?m.value:w&&"number"===O?0:b,M=T[a-1],$={origin:{data:s,title:y,key:x||"",unit:r.unit,type:c,_type:f(y,c),dataIndex:t,index:a},leftLine:M,rightLine:h,otherObj:d,lockMovementX:!0,...s.pacemakerShow&&"pulse"==c?m.style:v,...Y.event.hovered?Y.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:Y.event,...w?{selectable:!1,evented:!1,..."number"===O?P:{}}:{}};n&&(M?$.leftLine.set("x2",n[0]):$.leftLine=null,p=o(S,{left:n[0],top:w?n[1]-5:n[1],...$}));T.push(h),p&&(y.includes("脉搏")?ie.add(p):ne.add(p),function(e){B.hovered&&(e.on("mouseover",(()=>{ce(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?K:J;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(k.value.remove(i),delete e.otherObj.obj)))})),se(e)}(e),B.hovered&&ce(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=C(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};k.value.discardActiveObject(),E("change",n),fe(n,"change")}}))}(p),R.push(p),oe.add(p))}(H,W,u,j,z,N)})),"pulse"===c){const e={};ee.forEach((t=>{e[t]=R.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t}))}));let t=null;ee.forEach((i=>{te.set(i,e[i].map(((e,i,n)=>{var o,l;const s=n[i+1];if(s&&d(e.left,1)===d(s.left,1)){const i=e.left-D/2;e.set("left",i+D/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+D/2,s.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]})))}))}Promise.all(R).then((e=>{const t=T.filter((e=>e));Promise.all(V).then((i=>{k.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&k.value.remove(e.leftLine),e.rightLine&&k.value.remove(e.rightLine))}}(t,e)}))}))}))}function ue(e,t){return"pain"===e&&0==t}function ce(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top},A.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:C(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||O(e.left)).slice(-5)}`],A.show=!0}function de(e,t){const i="pain"===t.type?K:J;if(!h(e)||!function(e){const[t]=z,i=z.at(-1),n=t.start,o=i.end,l=v(e);return l>=n&&l<=o}(e.time))return;const n=M(e.time),o=$(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function pe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=v(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=v(`${O(e)}:00`);return N&&l<v(N)?(T("exceedMin"),!1):!(l>o)||(T("exceedMax"),!1)}function fe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=le.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=g(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;he()}function he(){var e;oe.size&&(null==(e=k.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}([...oe]))),te.clear(),oe.clear(),ie.clear(),ne.clear(),le.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||ae(t,i,e)}))})),se(),re()}return te.clear(),ie.clear(),ne.clear(),le.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=$(e.type,e.list,e.positionLine.value),n=i([H,t,_,t],e.positionLine);k.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||ae(t,i,e)}))})),se(),re(),k.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!Y.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=H&&e<=_&&t>=W&&t<=q){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...j]),"pain"===o&&(I.list=[...w]),I.target=i;else{I.target=null,I.list=["新增节点"],G.forEach((i=>{if(!R([...oe],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?K:J;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:P?P(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:u(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=pe(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&T("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=H&&e<=_&&t>0&&t<U&&E("click:grid",{x:e,y:t,time:O(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...j,...w]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};E("change",r),fe(r,"change")}else{const t={data:{time:O(e.pointer.x),value:C(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};E("add",t),fe(t)}},setPopup:ce,isAddPoint:pe,updateData:fe,redrawPoints:he,gridPoints:oe}}function S(e){return"fixed"===e.position}export{k as useCenter};
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as u,getType as a,isOverlapPoint as c,getFloorNumber as d,isValidValue as p,setOtherType as f,isEffectiveNode as h,getTime as v,getIndex as g,deleteProperty as y}from"../../utils/index.js";import{cloneDeep as m,flatten as x,last as b}from"lodash-es";import"../useEvent.js";import{useCommon as j}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as w,PAIN_MENU as L,OVERLAP as k}from"../../constants/index.js";function S(S,E,M,$,O,C,P,A,I,R){r(S,E);const{getEqualXTypes:T,handleAddPrevent:V}=j(S,M,E),{createShadowLines:X}=t(),{left:z,xScaleList:D,xCellWidth:F,yCellHeight:H,originX:_,endX:W,originY:q,endY:G,itemList:B,event:J,vitalSignsOriginY:K,painOriginY:N,hospitalizationDate:Q,config:U,canvasHeight:Z}=E,ee=new Set,te=["xinmai","mai"],ie=new Map,ne=new Set,oe=new Set,le=new Set,se=m(z.yScaleValue);function re(t){var o;const l=se.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ee.size&&S.value.remove(...ee),ee.clear(),ie.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ie.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ie)t.push(e[1]),e[0]===te[0]&&e[1].forEach((e=>{(ie.get(te[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),u=n[i],a=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);s.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=b(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...X(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),ee.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...x(t)],{...r,originX:"center"});e.push(n),ee.add(n)}))}S.value.add(...e)}ee.add(l),S.value.add(l)}))}}function ue(){var e;const t=se.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},k,z.overlap||{}),l=[];ne.size&&[...ne].forEach((e=>{[...oe].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{S.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),le.add(e)}))}))}function ae(e,t,r){var a;const{type:c,riseStyle:h={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},dataList:L=[],list:k=[]}=r,{type:$,textStyle:C,showConnectLine:A=!1}=j,R=[],T=[],V=[];let X=null;if(null==(a=e.list)||a.forEach(((a,j)=>{const z=u(c)?L.find((e=>e.key===a.key)):e,D=pe(a,r),_=e.list[j+1],W=_?pe(_,r):void 0,q=_?u(c)?L.find((e=>e.key===_.key)):e:{},{title:G=""}=z;if("脉搏"===G&&"脉搏"!==q.title||"脉搏"!==G&&"脉搏"===q.title||!D||!W||d(D[0],1)!==d(W[0],1))D&&X&&(D[0]=X),X=null;else{const e=D[0]-F/2;D[0]=e+F/4,W[0]=X=D[0]+F/2}const B={};B.value=function(e,t,i){if(!(null==e?void 0:e.length)||!U.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=K.originY+H?e[1]+H:e[1]-H,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return V.push(s),{obj:s,top:-H}}(D,a,z),function(e,t,r,u){var a,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:f={}}=r,{value:m}=u;let x,b,j,w,L;if(t.noRise&&v.show){const t=Y(v)?O(c,k,35):e[1];if(v.text)j=l([e[0],Y(v)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style});else{const i=t+2*H;j=s([e[0],t,i],{...v.style})}V.push(j)}t.rise&&h.show&&h.text&&(w=l([e[0],e[1]-(m?H:0)-5],{value:h.text.split("").join("\n"),originY:"bottom",...h.style}),V.push(w));t.verified&&(L=l([e[0],e[1]-(m?H:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),V.push(L));if(p(t.physicsReduce)||p(t.drugReduce)){const l=O(c,k,null!=(a=t.physicsReduce)?a:t.drugReduce),s=l<e[1]&&(null==U?void 0:U.hypothermyViewCustom)?e[0]+F/2:e[0];x=i([...e,s,l],{...f,...y.line,...n}),b=o((null==(d=null==y?void 0:y.point)?void 0:d.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===Z?"bottom":"center"}),x&&V.push(x),b&&V.push(b)}Object.assign(u,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:v.text?5:2*H,isFixed:Y(v)},riseText:{obj:w,top:(m?-H:0)-5},verifiedText:{obj:L,top:(m?-H:0)-5},reducePoint:{obj:b,type:"reduce"}})}(D,a,z,B),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...k),r=Math.min(...k);let u,a,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*H,i=[e[1]-H/2,t];t<K.originY&&(t=e[1]+2.5*H,i=[t,e[1]+H/2]),u=s([e[0],i[0],i[1]],x,"up"),V.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+H/2+u.height:e[1]+H;a=l([e[0],t],i),V.push(a)}+t.value<r&&(a=l([e[0],e[1]-H],i),V.push(a))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*H;d=s([e[0],t,i],{...w.style})}V.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:a,top:-H},belowMinValue:{obj:d,top:w.text?5:2*H,moveHide:!0}})}(D,a,z,B),function(n,l,s,u,a,d){let p,h;const{pointAttr:v={},lineAttr:g={},title:y="",key:x,type:b="circle"}=a,j=e.list[u+1],w=ce(c,e.list[u].value),L=l&&ce(c,j.value);if(n&&l&&!s.breakpoint&&(!w&&!L||A)){h=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==U?void 0:U.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});V.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const k=s.pacemakerShow&&"pulse"==c?m.value:w&&"number"===$?0:b,Y=T[u-1],O={origin:{data:s,title:y,key:x||"",unit:r.unit,type:c,_type:f(y,c),dataIndex:t,index:u},leftLine:Y,rightLine:h,otherObj:d,lockMovementX:!0,...s.pacemakerShow&&"pulse"==c?m.style:v,...E.event.hovered?E.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:E.event,...w?{selectable:!1,evented:!1,..."number"===$?C:{}}:{}};n&&(Y?O.leftLine.set("x2",n[0]):O.leftLine=null,p=o(k,{left:n[0],top:w?n[1]-5:n[1],...O}));T.push(h),p&&(y.includes("脉搏")?ne.add(p):oe.add(p),function(e){J.hovered&&(e.on("mouseover",(()=>{de(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?N:K;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(S.value.remove(i),delete e.otherObj.obj)))})),re(e)}(e),J.hovered&&de(e)})),e.on("mouseup",(t=>{if(I.show=!1,1===t.button){const{type:t}=e.origin,i=P(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};S.value.discardActiveObject(),M("change",n),he(n,"change")}}))}(p),R.push(p),le.add(p))}(D,W,a,j,z,B)})),"pulse"===c){const e={};te.forEach((t=>{e[t]=R.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t}))}));let t=null;te.forEach((i=>{ie.set(i,e[i].map(((e,i,n)=>{var o,l;const s=n[i+1];if(s&&d(e.left,1)===d(s.left,1)){const i=e.left-F/2;e.set("left",i+F/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+F/2,s.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]})))}))}Promise.all(R).then((e=>{const t=T.filter((e=>e));Promise.all(V).then((i=>{S.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&S.value.remove(e.leftLine),e.rightLine&&S.value.remove(e.rightLine))}}(t,e)}))}))}))}function ce(e,t){return"pain"===e&&0==t}function de(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;I.point={x:e.left,y:e.top},I.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},u="hover"===t?l.value:P(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${u}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${u}—>${r}${n||""}`;return`${i} ${u}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||C(e.left)).slice(-5)}`],I.show=!0}function pe(e,t){const i="pain"===t.type?N:K;if(!h(e)||!function(e){const[t]=D,i=b(D),n=t.start,o=i.end,l=v(e);return l>=n&&l<=o}(e.time))return;const n=$(e.time),o=O(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function fe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=v(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=v(`${C(e)}:00`);return Q&&l<v(Q)?(V("exceedMin"),!1):!(l>o)||(V("exceedMax"),!1)}function he(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=se.find((e=>e.type===i));if("add"===t){const e=u(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=g(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ve()}function ve(){var e;le.size&&(null==(e=S.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}([...le]))),ie.clear(),le.clear(),ne.clear(),oe.clear(),se.forEach((e=>{e.dataList.forEach(((t,i)=>{u(e.type)&&!t.enable||ae(t,i,e)}))})),re(),ue()}return ie.clear(),ne.clear(),oe.clear(),se.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=O(e.type,e.list,e.positionLine.value),n=i([_,t,W,t],e.positionLine);S.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||u(e.type)&&!t.enable||ae(t,i,e)}))})),re(),ue(),S.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!E.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=_&&e<=W&&t>=q&&t<=G){R.point={x:e,y:t},R.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(R.list=[...w]),"pain"===o&&(R.list=[...L]),R.target=i;else{R.target=null,R.list=["新增节点"],B.forEach((i=>{if(!T([...le],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?N:K;t>=e.originY&&t<=e.endY&&R.list.push({renderItem:A?A(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=fe(e);i&&1!==R.list.length||(R.show=!1,1===R.list.length&&i&&V("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=_&&e<=W&&t>0&&t<Z&&M("click:grid",{x:e,y:t,time:C(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...w,...L]);s[`${e.type}`]=e.value,u(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};M("change",r),he(r,"change")}else{const t={data:{time:C(e.pointer.x),value:P(e.origin.type,e.pointer.y),...u(e.origin.type)?{key:e.origin.key}:{}},...e.origin};M("add",t),he(t)}},setPopup:de,isAddPoint:fe,updateData:he,redrawPoints:ve,gridPoints:le}}function Y(e){return"fixed"===e.position}export{S as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"../useEvent.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function g(g,d,p,f,m,v,y,w,S,Y,b,x){var j,C;const{getEqualXTypes:X,handleAddPrevent:N,isGridLimit:T}=c(g,p,d),{originY:V,endY:L,originX:k,endX:E,xCellWidth:M,yCellHeight:W,left:G,vitalSignsOriginY:O,painOriginY:R,painHeight:A,iconsWidth:H,itemList:I,painIndex:_,right:B,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P}=d;function z(o){var r;if(!(null==o?void 0:o.length))return;const{layout:s}=o[0];let c=H,d=k;"right"===s&&(c=E,d=E+(null!=(r=null==B?void 0:B.width)?r:0));const p=[],f=A&&"right"!==s?o.length-1:o.length,m=(d-c)/f,v=m+(d-c)%f;o.forEach(((o,r)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:r=5,showScale:s,showNumber:h,position:c,showMaxMinNumber:d,style:p,title:f}=n,m=l({width:k-H,height:A,...D},{value:`${f}`,...i,...p||{}},{left:H,top:R.originY}),v=e([H,R.originY,k,R.originY],D),y=[];if(s||h){const{lineXMain:e,textLeft:i}=u(c,H,k-H),l=o.length;o.forEach(((o,u)=>{let c=R.endY-u*W*r;if(0===u&&(c=L-5),!h||(0===u||u===l-1)&&!d||y.push(a(o,n,i,c)),s&&0!==u){const[i,n]=e,o=new t.Line([i,c,n,c],{...D,...p});y.push(o)}}))}g.value.add(v,m,...y),m.sendToBack()}(o);const d=[],f=0===r?v:m,y=0===r?c:v+c+(r-1)*m,w="right"===s?0:O.originY,S="right"===s?$:O.endY,Y=r>0?e([y,w,y,S],{objectCaching:!1,...D}):null;Y&&d.push(Y);const b=y+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:X,position:N,showMaxMinNumber:T,detailedList:E=[],showdetailedScale:M,showRange:G=[]}=o;if(C||X){const[t,e]=G,{lineXMain:i,lineXSub:n,textLeft:l}=u(N,y,f),r=(x[1]-x[0])/2,s=M&&!E.length?x.reduce(((t,e,i)=>{const n=t[t.length-1];return 0===i?[e]:t.concat([n+r,n+2*r])}),[]):M&&(null==E?void 0:E.length)?E:x,c=s.length;s.forEach(((r,s)=>{if(t&&+r<t)return;if(e&&+r>e)return;const u=O.endY-s*W*(M?j/2:j);if(X&&(!(0===s||s===c-1)||T)&&t!==+r){const t=0==s?u-5:u,e=a(r,o,l,t),i=O.originY+e.height/2;t<i&&e.set({top:i}),d.push(e)}d.push(...h(o,s,i,n,u,W,O.originY))}))}let I=o.title||"";o.unit&&(I+="\n"+o.unit);let B=O.originY+W;0!==_&&P[0]>1&&(B=V+W*P[0]/2),I&&d.push(new t.Text(String(I),{...i,left:b,top:B,textAlign:"center",...o.style}));const J=new t.Group(d,{...n,objectCaching:!1});p.push(J)}));const y=p.length>0?new t.Group([...p],{...n,objectCaching:!1}):null;y&&g.value.add(y),y&&y.sendToBack()}H&&function(){const t=JSON.parse(JSON.stringify(I));let e=L;const i=H-G.icons.marginRight;t.reverse().forEach((t=>{e-=10;let n=t.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:r(t.bigType),_type:t.bigType},...d.event}});var a;e-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(t){if(t.left>=k&&t.left<=E){t.setCoords();const e="pain"===t.origin.type?R:O;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(a),T(a)?f(a):m.show=!1})),a.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&T(a)){const t=X([...x],a.left,"_type").includes(a.origin._type),e=Y(a.left);if(!e||t)t&&e&&N("repeat");else{const t={data:{time:w(a.left),value:S(a.origin.type,a.top),...s(a.origin.type)?{key:a.origin.key}:{}},...a.origin};p("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(a)})),g.value.add(l,u)}))}();const F=G.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==B?void 0:B.width)&&"left"===(null==(j=null==B?void 0:B.yScaleValue)?void 0:j.layout)&&(null==(C=null==B?void 0:B.yScaleValue)?void 0:C.show)&&F.push(q),_>0&&G.yScaleValue[_].show){const t=G.yScaleValue[_];0===_&&G.yScaleValue.length>1&&F.unshift(t),_==G.yScaleValue.length-1&&F.push(t)}const K=F.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),Q=F[K];return K>-1&&F.splice(K,0,{...Q,title:(null==Q?void 0:Q.doubleTitle)||(null==Q?void 0:Q.title)}),z(F),g.value.add(new t.Rect({left:H,top:0,width:J-H-D.strokeWidth,height:$-D.strokeWidth,fill:"transparent",...D})),{drawScaleValue:z}}export{g as useLeft};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import{last as i}from"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function n(n,o,r,l){const{other:s,vitalSignsOriginY:h,xCellWidth:a,yCellHeight:u,endX:c}=o;let f=0;function g(i,o,l){const h=[];String(i.value).split("").forEach(((n,o)=>{const r=new t.Text(n,{left:0,top:u*o,originX:"center",...e,objectCaching:!1,...i.style||{}});f=(u-(r.height||0))/2,h.push(r)}));const c=new t.Rect({left:0,top:0,width:a,height:u*h.length,fill:"transparent",originX:"center",...e}),{eventHighlight:g=!1}=s||{},p={originX:"center",left:o,top:l+f,baseTop:(i.baseTop||0)*u,trueLeft:o,trueHeight:h.length*u,objectCaching:!1,hoverCursor:"pointer",highlightObject:c,originData:i,selectable:!1,evented:g},v=new t.Group([c,...h],p);return function(t){const{highlightColor:e="#ffff00"}=s||{};t.on("mouseover",(()=>{t.highlightObject.set("fill",e),n.value.requestRenderAll()})),t.on("mouseout",(()=>{t.highlightObject.set("fill","transparent"),n.value.requestRenderAll()})),t.on("mousedown",(function(){r("eventClick",t.originData)}))}(v),n.value.add(v),v}!function(){if(!(null==s?void 0:s.list))return!1;const t=[],e=[];s.list.forEach(((t,i)=>{const n=0===i?"vertical":t.align||"vertical",o=l(t.time,!0);if(o>c)return;const r=e.find((t=>t.left==o));if(r)r[n].push(t);else{const i={left:o,vertical:[],horizontal:[]};i[n].push(t),e.push(i)}})),e.forEach((e=>{let n=h.originY,o=e.left;e.vertical.forEach(((r,l)=>{var s,c;const f=(r.baseTop||0)*u,p=(null==(s=i(t))?void 0:s.left)||0;0===l&&e.left<=p&&(o=p+a);if(t.filter((t=>t.trueLeft===o)).length){const e=String(r.value).length*u,l=(null==(c=i(t))?void 0:c.trueHeight)||0;n+=l,n+e+f>h.endY&&(n=h.originY,o+=a)}n+=f,String(r.value).length&&t.push(g(r,o,n))})),e.horizontal.forEach(((n,r)=>{var l;const s=h.originY+(n.baseTop||0)*u,c=(null==(l=i(t))?void 0:l.left)||0;e.left<=c&&(o=c+a),String(n.value).length&&t.push(g(n,o,s))}))}))}()}export{n as useOther};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{format as n}from"date-fns";import{getTime as
|
|
1
|
+
import{format as n}from"date-fns";import{getTime as e,getFloorNumber as t}from"../utils/index.js";import{last as i}from"lodash-es";function u(u){const{xScaleList:l,xCellWidth:r,left:o,vitalSignsOriginY:c,painOriginY:a,canvasWidth:d}=u;return{computedX:function(n,t=!1){const u=e(n),[r]=l,o=i(l);if(u<r.start)return 0;if(u>o.end)return d;const c=l.findIndex((n=>n.end>=u));if(c>-1){return l[c].center}},computedY:function(n,e,t){const i=u[`${n}YCell`],l=+t-Math.min(...e);return("pain"===n?a.endY:c.endY)-i*l},getXValue:function(e){const t=l.findIndex((n=>n.left+r>=e));if(t>-1){const i=l[t],u=e-i.left,r=i.scaleCell*u,o=i.start+r;return n(new Date(o),"yyyy-MM-dd HH:mm")}},getYValue:function(n,e){var i;const l=u[`${n}YCell`],r=(null==(i=o.yScaleValue.find((e=>e.type===n)))?void 0:i.list)||[],d=r.length?Math.min(...r):0,f="pain"===n?a.endY:c.endY;return t((f-e)/l+d)}}}function l(i){const{xAxis:u,originX:l,originY:r,xCellWidth:o,endY:c,timeXCell:a,startTime:d,scaleValues:f}=i;return{computedX:function(n){return(e(n)-d)/a+l},computedY:function(n,e,t){const[u]=e;return c-(+t-u)*i[`${n}YCell`]},getXValue:function(e){return n(new Date((e-l)*a+d),"yyyy-MM-dd HH:mm")},getYValue:function(n,e){const u=f.find((e=>[e.key,e.type||""].includes(n))),[l]=(null==u?void 0:u.range)||[0],r=(c-e)/i[`${n}YCell`]+l;return t(r)}}}function r(n){const{config:e,xCellWidth:i,yCellHeight:u}=n,{hz:l,mainXCellValue:r,valueUnit:o,mainYCellValue:c}=e;return{computedX:function(n){return n/l/r*i},computedY:function(n){return("uv"===o?.001*n:"v"===o?1e3*n:n)/c*u},getXValue:function(n){return t(r/i*n)},getYValue:function(n){return t(c/u*n)}}}export{l as useBirthProcessCumputedPoint,u as useCumputedPoint,r as useElectrocardiogramCumputedPoint};
|
|
@@ -504,7 +504,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
504
504
|
formRef: import("vue").Ref<any>;
|
|
505
505
|
conditionRef: import("vue").Ref<any>;
|
|
506
506
|
filterVisible: import("vue").Ref<boolean>;
|
|
507
|
-
title: import("vue").ComputedRef<"
|
|
507
|
+
title: import("vue").ComputedRef<"新增" | "修改" | "过滤条件">;
|
|
508
508
|
model: {
|
|
509
509
|
name: string;
|
|
510
510
|
color: string;
|
|
@@ -44,7 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
formRef: import("vue").Ref<any>;
|
|
45
45
|
conditionRef: import("vue").Ref<any>;
|
|
46
46
|
filterVisible: import("vue").Ref<boolean>;
|
|
47
|
-
title: import("vue").ComputedRef<"
|
|
47
|
+
title: import("vue").ComputedRef<"新增" | "修改" | "过滤条件">;
|
|
48
48
|
model: {
|
|
49
49
|
name: string;
|
|
50
50
|
color: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findAncestor as e,traverse as o}from"../../../../shared/utils/index.js";import{isFunction as t}from"lodash-es";import{unref as s}from"vue";import{FORM_CONFIG_GROUP as i}from"../constants/index.js";function a({group:a,hooks:r={},fieldList:n,materialList:c}={}){let l,m=null;return{move:function({to:i,from:a,dragged:m}){const{type:f,required:d,extra:u,key:g}=m.dataset||{};if("LINE_BAR"===f&&e(i,(e=>"LINE_BAR"===e.dataset.type)))return!1;const y=e(i,(e=>e.classList.contains("form-config__materialContent"))),h=e(a,(e=>e.classList.contains("form-config__materialContent")));if(
|
|
1
|
+
import{findAncestor as e,traverse as o}from"../../../../shared/utils/index.js";import{isFunction as t}from"lodash-es";import{unref as s}from"vue";import{FORM_CONFIG_GROUP as i}from"../constants/index.js";function a({group:a,hooks:r={},fieldList:n,materialList:c}={}){let l,m=null;return{move:function({to:i,from:a,dragged:m}){const{type:f,required:d,extra:u,key:g}=m.dataset||{};if("LINE_BAR"===f&&e(i,(e=>"LINE_BAR"===e.dataset.type)))return!1;const y=e(i,(e=>e.classList.contains("form-config__materialContent"))),h=e(a,(e=>e.classList.contains("form-config__materialContent")));if(t(r.beforeMove)){const e=[...s(n||[]),...s(c||[])];let t,l,m;o(e,((e,o)=>{t||e.key!==g||(t=e),l||e.key!==a.dataset.key||(l=e),m||e.key!==i.dataset.key||(m=e),t&&l&&m&&o()}));if(!1===r.beforeMove({fromType:h?"material":"layout",toType:y?"material":"layout",dragField:t,fromField:l,toField:m,from:a,to:i}))return!1}if("true"===d&&"true"!==u&&y)return!1;null==l||l.classList.remove("is-choosing-area"),l=i,i!==a&&a.classList.remove("is-choosing-area"),i.classList.add("is-choosing-area")},onChoose:function({target:e,item:o}){m=setTimeout((()=>{e.classList.add("is-choosing-area"),o.classList.add("is-choosing")}),200)},onUnchoose:function({from:e,to:o,target:t,item:s}){clearTimeout(m),[e,o,t].forEach((e=>{e.classList.remove("is-choosing-area")})),s.classList.remove("is-choosing")},tag:"section",forceFallback:!1,animation:"150","item-key":"key",group:a||i}}export{a as useSortableConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as a,isArray as s,isString as d}from"lodash-es";import{nextTick as l}from"vue";import"../../index.js";import{NESTED_FORM_ITEM_TYPE as u}from"../constants/index.js";import{queryDecoratorByAddress as m,queryInput as f,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as
|
|
1
|
+
import{arrayed as e,findAncestor as t}from"../../../../shared/utils/index.js";import{isField as r}from"@formily/core";import{Path as o}from"@formily/path";import{isObject as i}from"@vue/shared";import{promiseTimeout as n}from"@vueuse/shared";import{isFunction as a,isArray as s,isString as d}from"lodash-es";import{nextTick as l}from"vue";import"../../index.js";import{NESTED_FORM_ITEM_TYPE as u}from"../constants/index.js";import{queryDecoratorByAddress as m,queryInput as f,queryDecoratorByFieldKey as c,findNextWidget as p}from"../utils/dom.js";import{validateMessageParser as g,combineExtendKey as v,splitExtendKey as y}from"../utils/index.js";import{getParentLinebar as S}from"../utils/schema.js";import{useSelectedSetting as h}from"./useSelectedSetting.js";function b({formModel:t,formRenderRef:n,formUUID:u,getFieldList:p,formItemDepsCollector:b,businessCollector:F,wordbookSettingHandler:x,operationalFormHandler:D}){const{applySelectedSetting:j}=h();return{validate(o,{force:l}={}){if(null==o&&(o="*"),a(o)){const e=Object.entries(t.fields).reduce(((e,[t,r])=>(o(r)&&e.push(t),e)),[]);if(!e.length)return Promise.resolve();o=e.length?`*(${e.join(",")})`:"*"}const c=[];l&&t.setFieldState(o,(e=>{"visible"===e.display&&"editable"!==e.pattern&&r(e)&&(c.push({pattern:e.pattern,state:e}),e.pattern="editable")}));const p=t.validate(o).catch((e=>Promise.reject(Array.isArray(e)?e.reduce(v,[]):e)));return l&&c.forEach((({pattern:e,state:t})=>t.pattern=e)),p;function v(t,r){if(!i(r))return t;let o=!1;return s(r.messages)&&r.messages.forEach((r=>{i(r)&&(t.push(...e(r).map(y)),o=!0)})),!o&&t.push(y(r)),t}function y(e){if(e.decoratorElement)return e;const r=t.query(e.path),o=r.get("title"),a=e.messages.map((e=>function(e,t){if(!t||!i(t.fieldItem))return e;const r=t.fieldItem.defined_error_msg;return g(r&&d(r)?r:e,t.fieldItem)}(e,r.get("decoratorProps")))),s=m(e.address,n.value,u);return{...e,messages:a,title:o,decoratorElement:s,...f(s)}}},getFormValues(e=!0){let r=t.getFormState().values;return e&&(r=v(p(),r)),r},async setFormValues(e,i){i=Object.assign({avoidDependKeyConnection:!0,needSplitExtendKey:!0,avoidWordbookSettingConnection:!0,avoidOperationalFormConnection:!0,dependKeyKeepValue:!1,avoidBusinessConnection:!1,overwrite:!0},i),F.triggerDisabled=i.avoidBusinessConnection,b.triggerDisabled=i.avoidDependKeyConnection,b.keepValue=i.dependKeyKeepValue,x.triggerDisabled=i.avoidWordbookSettingConnection,D.triggerDisabled=i.avoidOperationalFormConnection,i.needSplitExtendKey&&(e=y(p(),e)),t.setFieldState("*",(t=>{r(t)&&(i.overwrite||o.existIn(e,t.path))&&(t.value=o.getIn(e,t.path))})),await l(),F.triggerDisabled=!1,b.triggerDisabled=!1,x.triggerDisabled=!1,D.triggerDisabled=!1,b.keepValue=!1},setFieldState(e,r){t.setFieldState(e,r)},resetFields:(e="*")=>t.reset(e),queryWidget:e=>async function(e,t,r){if(!n.value)return s();const i=c(e,t,u);if(i)return s(i);const a=S(e,r);return a?(b.trigger(o.parse(a),!0),await l(),s(c(e,t,u))):s();function s(e){return{decoratorElement:e,...f(e)}}}(e,n.value,p()),applySelectedSetting(e){const o=t.getFormState().values;j(o,e,((e,o)=>{t.setFieldState(e,(e=>{r(e)&&e.setValue(o)}))}))}}}function F({props:e,formRenderRef:r,formModel:o}){return{onKeydown:async function i(s){var d;if(e.enterToNextWidget&&s.target){if("TEXTAREA"===s.target.tagName&&!s.ctrlKey)return;s.preventDefault()}if(await n(0),Reflect.get(s,"stopCapture")||!e.enterToNextWidget||!r.value)return;const l=t(s.target,(e=>e.classList.contains("form-render__formItem")));if(!l)return;const m=`.form-render__formItem${u.map((e=>`:not([widget-type=${e}])`)).join("")}`,f=Array.from(r.value.querySelectorAll(m)),c=f.findIndex((e=>e.id===l.id));if(!~c)return;const{widget:g,field:v}=p(f,c,s.target);if(g)if(a(e.enterToNextWidget)){const t=v&&o.query(v).take();!t||e.enterToNextWidget(null==(d=t.decoratorProps)?void 0:d.fieldItem)?y():i({target:g})}else y();async function y(){await n(0),g.focus()}}}}export{F as useFormDomEvent,b as useFormExposeEvent};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LowCodeTypes } from '../../../../shared/types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
applySelectedSetting: (selectedSettings: LowCodeTypes.selectedSettingConfig[]) => void;
|
|
1
|
+
import { AnyObject, LowCodeTypes } from '../../../../shared/types';
|
|
2
|
+
export declare function useSelectedSetting(): {
|
|
3
|
+
applySelectedSetting: (data: AnyObject, selectedSettings: LowCodeTypes.selectedSettingConfig[], setter?: ((key: string, value: any) => void) | undefined) => void;
|
|
5
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../shared/utils/index.js";import{
|
|
1
|
+
import"../../../../shared/utils/index.js";import{isEmpty as e}from"lodash-es";import{isMatchNewLowCodeConditionsWithSqlExpression as i}from"../../../../shared/utils/business.js";function t(){return{applySelectedSetting:function(t,r,s){r.forEach((r=>{if(e(r.children))return;const l=r.children.find((e=>i(t,e)));l&&(s?s(r.selectedField,l.value):t[r.selectedField]=l.value)}))}}}export{t as useSelectedSetting};
|
|
@@ -3211,6 +3211,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3211
3211
|
verticalConfig?: {
|
|
3212
3212
|
enable?: boolean | undefined;
|
|
3213
3213
|
headerWidth?: number | "auto" | ((level: number) => number) | undefined;
|
|
3214
|
+
bodyWidth?: number | ((index: number) => number) | undefined;
|
|
3214
3215
|
} | undefined;
|
|
3215
3216
|
onFormChange?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
3216
3217
|
onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
|
|
@@ -6774,6 +6775,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6774
6775
|
verticalConfig?: {
|
|
6775
6776
|
enable?: boolean | undefined;
|
|
6776
6777
|
headerWidth?: number | "auto" | ((level: number) => number) | undefined;
|
|
6778
|
+
bodyWidth?: number | ((index: number) => number) | undefined;
|
|
6777
6779
|
} | undefined;
|
|
6778
6780
|
onFormChange?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
6779
6781
|
onSettingClick?: (() => void) | undefined;
|
|
@@ -3212,6 +3212,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3212
3212
|
verticalConfig?: {
|
|
3213
3213
|
enable?: boolean | undefined;
|
|
3214
3214
|
headerWidth?: number | "auto" | ((level: number) => number) | undefined;
|
|
3215
|
+
bodyWidth?: number | ((index: number) => number) | undefined;
|
|
3215
3216
|
} | undefined;
|
|
3216
3217
|
onFormChange?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
3217
3218
|
onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
|
|
@@ -6775,6 +6776,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6775
6776
|
verticalConfig?: {
|
|
6776
6777
|
enable?: boolean | undefined;
|
|
6777
6778
|
headerWidth?: number | "auto" | ((level: number) => number) | undefined;
|
|
6779
|
+
bodyWidth?: number | ((index: number) => number) | undefined;
|
|
6778
6780
|
} | undefined;
|
|
6779
6781
|
onFormChange?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
6780
6782
|
onSettingClick?: (() => void) | undefined;
|
|
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
};
|
|
14
14
|
}>> & {}>>;
|
|
15
15
|
$table: (VxeTableConstructor & VxeTablePrivateMethods & VxeTableMethods) | undefined;
|
|
16
|
+
tableConfig: import("vue").Ref<import("../../../../../components/iho-table").IhoTableConfig>;
|
|
16
17
|
multipleRef: import("vue").ComputedRef<boolean>;
|
|
17
18
|
optionsRef: import("vue").ComputedRef<import("vxe-table").VxeTableDefines.FilterOption[] & VxeColumnPropTypes.Filter[]>;
|
|
18
19
|
checkedRef: import("vue").WritableComputedRef<string[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as i,toRaw as
|
|
1
|
+
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as i,toRaw as n,openBlock as o,createElementBlock as r,unref as v,createBlock as s,createCommentVNode as c,createElementVNode as d,createVNode as p,isRef as f,withCtx as m,mergeProps as h,normalizeProps as _,guardReactiveProps as y,Fragment as b,renderList as k,toDisplayString as g,createTextVNode as C,normalizeStyle as L}from"vue";import w from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{keywordMatcher as D,widthAppend as I}from"../../../../../shared/utils/index.js";import{useVirtualList as j}from"@vueuse/core";import{isNumber as x,isString as F,isFunction as S,isEqual as U}from"lodash-es";import{NInput as R,NCheckbox as W,NSpin as E,NCheckboxGroup as Y,NRadioGroup as $,NButtonGroup as O,NButton as P}from"naive-ui";import{InjectionIhoTableConfig as V}from"../../constants/index.js";import{isVariableHeightTable as q}from"../../utils/index.js";const z={class:"iho-table__filterWrapper"},A={key:1,class:"iho-table__filterCheckAllWrapper"},H={class:"iho-table__filterListItem"},M={class:"iho-table__filterListItem"},B=["title"],G=["title"],J={class:"iho-table__filterListItemContent"},K={class:"iho-table__filterFooter"};var N=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const N=e,Q=l("$xetable"),T=l(V),X=a((()=>{var e;return!!(null==(e=N.payload)?void 0:e.column.filterMultiple)})),Z=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=N.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ee=a({get:()=>Z.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,u;if(!N.payload||!Q)return;const i=Q.reactData.filterStore.options||[];if(X.value?(i.forEach((l=>l._checked=e.includes(l.value))),Q.checkFilterOptions()):i.forEach((l=>l._checked=l.value===e[0])),!q(Q))return n();function n(){N.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=Q.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(u=null==(t=T.value.scrollY)?void 0:t.gt)?u:100)&&(Q.reactData.scrollYLoad=!0),n(),Q.reactData.scrollYLoad=!1}}),le=t([...ee.value]),ae=t("");async function te(){Q&&(Q.reactData.filterStore.visible=!1)}u(te);const ue=a((()=>{var e,l;if(!N.payload||!N.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=N.payload.column.editRender)?void 0:e.props)?l:{};return x(a)&&a>0?a:10})),ie=a((()=>ae.value?Z.value.filter((e=>!!`${e.label}`.includes(ae.value)||(F(e.data)?D(ae.value,e.data):void 0))):Z.value)),{list:ne,containerProps:oe,wrapperProps:re}=j(ie,{itemHeight:32,overscan:3}),ve=a({get:()=>ie.value.every((e=>le.value.includes(e.value))),set(e){le.value=e?[...new Set([...le.value,...ie.value.map((e=>e.value))])]:le.value.filter((e=>ie.value.every((l=>l.value!==e))))}}),se=a((()=>ie.value.some((e=>le.value.includes(e.value)))&&!ve.value)),ce=a({get:()=>le.value.length===Z.value.length&&0!==Z.value.length,set:e=>{le.value=e?Z.value.map((e=>e.value)):[]}}),de=a((()=>!!le.value.length&&!ce.value)),pe=a((()=>({height:I(32*ue.value)})));function fe(){ee.value=X.value?le.value:U(le.value[0],null)?[]:[le.value[0]],te()}function me(){le.value=X.value?[]:[null]}const he=t(!1);return i((async()=>{var e;if(!Q)return;const l=null==(e=N.payload.column.editRender.props)?void 0:e.onFilterShow;if(S(l))try{he.value=!0,await l(N.payload);const{filterStore:e}=Q.reactData;n(e.options)!==n(Z.value)&&(e.options=Z.value)}finally{he.value=!1}})),(e,l)=>(o(),r("section",z,[v(Z).length>5?(o(),s(v(R),{key:0,value:ae.value,"onUpdate:value":l[0]||(l[0]=e=>ae.value=e)},null,8,["value"])):c("v-if",!0),v(X)?(o(),r("div",A,[d("div",H,[p(v(W),{label:"全选当前",checked:v(ve),"onUpdate:checked":l[1]||(l[1]=e=>f(ve)?ve.value=e:null),indeterminate:v(se)},null,8,["checked","indeterminate"])]),d("div",M,[p(v(W),{label:"全选所有",checked:v(ce),"onUpdate:checked":l[2]||(l[2]=e=>f(ce)?ce.value=e:null),indeterminate:v(de)},null,8,["checked","indeterminate"])])])):c("v-if",!0),p(v(E),{show:he.value},{default:m((()=>[v(X)?(o(),s(v(Y),{key:0,value:le.value,"onUpdate:value":l[3]||(l[3]=e=>le.value=e)},{default:m((()=>[d("section",h(v(oe),{style:v(pe),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(re))),[(o(!0),r(b,null,k(v(ne),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value},[p(v(W),{value:e.data.value},{default:m((()=>[d("div",{class:"iho-table__filterListItemContent",title:e.data.label},g(e.data.label),9,B)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(o(),s(v($),{key:1,value:le.value[0],"onUpdate:value":l[5]||(l[5]=e=>le.value[0]=e)},{default:m((()=>[d("section",h(v(oe),{style:v(pe),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(re))),[(o(!0),r(b,null,k(v(ne),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[p(v(w),{value:e.data.value,currentValue:le.value[0],cancelable:"",onCancel:l[4]||(l[4]=e=>le.value=[null])},{default:m((()=>[d("div",J,g(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,G)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),d("footer",K,[d("section",null,[v(X)?(o(),r(b,{key:0},[C(" 已选择 "),d("span",{style:L({color:"var(--c-primary-color)"})},g(le.value.length),5),C(" 项 ")],64)):c("v-if",!0)]),p(v(O),{size:"small"},{default:m((()=>[p(v(P),{onClick:me},{default:m((()=>[C("清空")])),_:1}),p(v(P),{onClick:te},{default:m((()=>[C("取消")])),_:1}),p(v(P),{type:"primary",onClick:fe},{default:m((()=>[C("确定")])),_:1})])),_:1})])]))}});export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useAttrs as e,onBeforeUnmount as t,inject as l,createVNode as o}from"vue";import{arrayed as n,widthAppend as a}from"../../../../shared/utils/index.js";import{isObject as r,isString as i,isFunction as s}from"lodash-es";import u from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as d,InjectionIhoTableConfig as m}from"../constants/index.js";import{getLowCodeFieldFromField as
|
|
1
|
+
import{useAttrs as e,onBeforeUnmount as t,inject as l,createVNode as o}from"vue";import{arrayed as n,widthAppend as a}from"../../../../shared/utils/index.js";import{isObject as r,isString as i,isFunction as s}from"lodash-es";import u from"../../../annotation-edit/index.js";import"../../index.js";import{InjectionIhoTableAnnotation as d,InjectionIhoTableConfig as m}from"../constants/index.js";import{getLowCodeFieldFromField as c,IhoTableRenderHelper as h}from"../utils/index.js";import{defineTablePlugin as p}from"../hooks/useTablePlugin.js";function f(){const f="headerPlugin";return p({name:f,apply(p){let v=null;p.setupHooks.setup.tap(f,(()=>{v=e(),t((()=>{v=null}))})),p.fieldHooks.field.tap(f,(e=>{var t;const p=null==(t=e.slots)?void 0:t.header;return e.slots={...e.slots,header:t=>function(e,t,c){const p=l(d),f=l(m),x=l("$xetable"),b=e.column||{},j=r(null==p?void 0:p.value)&&!1!==t.annotation,g=h.isEditableColumn(f.value,b),w=h.hasFilter(t)||h.hasDateFiler(t),W=h.hasTitlePrefix(e.column),k=i(c)?c:s(c)?c(e):null;let y=!1;if(f.value){const e=f.value.editRules&&f.value.editRules[b.field];e&&(y=n(e).some((e=>e.required)))}const D=f.value.border?Math.max(2,Math.ceil(x.reactData.scrollbarWidth/x.reactData.tableColumn.length)):1,M=a(Math.max(0,b.renderWidth-20-D-(y?14:0)-(j?18:0)-(w?23:0)-(g?22:0)-(W?20:0)-(b.sortable?23:0)));return o("section",{class:"iho-table__headerWrapper"},[o("section",{style:{width:M}},[null!=k?k:o("div",{style:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},[function(){const e=b.title,t=/\\n|\n|\r/g;if(!t.test(e))return e;const l=e.replace(t,"<br>").split("<br>");return l.map(((e,t)=>[e,t===l.length-1?null:o("br",null,null)]))}()])]),j?o(u,{modelValue:p.value[b.field],"onUpdate:modelValue":e=>p.value[b.field]=e,shortcuts:v&&(v["annotation-shortcuts"]||v.annotationShortcuts)||[]},null):null])}(t,c(e),p)},e}))}})}export{f as default};
|
|
@@ -28,6 +28,7 @@ export declare const createVerticalTableHooks: () => {
|
|
|
28
28
|
} | null;
|
|
29
29
|
editStateEvent: (event: MouseEvent) => void;
|
|
30
30
|
hoveringRow: AnyObject | null;
|
|
31
|
+
hoveringFieldKey: string | null;
|
|
31
32
|
}>], void, import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
32
33
|
cellStyle: SyncWaterfallHook<[CSSProperties, {
|
|
33
34
|
column: VxeTableDefines.ColumnInfo;
|
|
@@ -48,6 +49,7 @@ export declare const createVerticalTableHooks: () => {
|
|
|
48
49
|
} | null;
|
|
49
50
|
editStateEvent: (event: MouseEvent) => void;
|
|
50
51
|
hoveringRow: AnyObject | null;
|
|
52
|
+
hoveringFieldKey: string | null;
|
|
51
53
|
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
52
54
|
cellClassName: SyncWaterfallHook<[Record<string, boolean>, {
|
|
53
55
|
column: VxeTableDefines.ColumnInfo;
|
|
@@ -67,6 +69,7 @@ export declare const createVerticalTableHooks: () => {
|
|
|
67
69
|
} | null;
|
|
68
70
|
editStateEvent: (event: MouseEvent) => void;
|
|
69
71
|
hoveringRow: AnyObject | null;
|
|
72
|
+
hoveringFieldKey: string | null;
|
|
70
73
|
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
71
74
|
config: SyncWaterfallHook<[IhoTableConfig, Partial<{
|
|
72
75
|
originalTableConfig: IhoTableConfig;
|
|
@@ -84,6 +87,7 @@ export declare const createVerticalTableHooks: () => {
|
|
|
84
87
|
} | null;
|
|
85
88
|
editStateEvent: (event: MouseEvent) => void;
|
|
86
89
|
hoveringRow: AnyObject | null;
|
|
90
|
+
hoveringFieldKey: string | null;
|
|
87
91
|
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
88
92
|
headerRowStyle: SyncWaterfallHook<[CSSProperties, {
|
|
89
93
|
$table: VxeTableConstructor & VxeTablePrivateMethods;
|
|
@@ -106,6 +110,7 @@ export declare const createVerticalTableHooks: () => {
|
|
|
106
110
|
} | null;
|
|
107
111
|
editStateEvent: (event: MouseEvent) => void;
|
|
108
112
|
hoveringRow: AnyObject | null;
|
|
113
|
+
hoveringFieldKey: string | null;
|
|
109
114
|
}>], import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
|
|
110
115
|
};
|
|
111
116
|
export declare const usePresetVerticalPlugins: VerticalTablePlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isVerticalHeader as e,getOriginFieldFromRowData as t,getSpanInfo as
|
|
1
|
+
import{isVerticalHeader as e,getOriginFieldFromRowData as t,getSpanInfo as l}from"../utils.js";const n=n=>{n.cellStyle.tap("useHeaderCSS",((n,{column:c,row:s})=>(e(c.field)||(s&&["checkbox","radio","seq"].includes(t(s).type||"")&&Object.assign(n,{textAlign:"center"}),Object.assign(n,{textShadow:"none"})),s&&l({row:s,column:c}).colspan>1&&Object.assign(n,{textAlign:"center"}),c.colSpan>1&&Object.assign(n,{textAlign:"center"}),n))),n.cellClassName.tap("useHeaderCSS",((t,{column:l})=>{const n=e(l.field);return Object.assign(t,{"vxe-header--column":n,"vxe-table--header":n,[l.field.replaceAll("_parent","")]:!0})}))};export{n as useHeaderCSS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useThrottleFn as o}from"@vueuse/core";import{promiseTimeout as e}from"@vueuse/shared";import{unref as r}from"vue";import{
|
|
1
|
+
import{useThrottleFn as o}from"@vueuse/core";import{promiseTimeout as e}from"@vueuse/shared";import{unref as r}from"vue";import{createVerticalStateHandler as n,getVerticalInfoFromEvent as l}from"../utils.js";const u=(u,i,t)=>{u.config.tap("useHoverColumn",((r,u)=>{if(!n(u).getTableConfig("rowConfig.isHover"))return r;function i(o){var e,n;if(o){const r=l(o);if(i(),!r||"body"!==r.type)return;u.hoveringRow=null!=(n=null==(e=u.originalData)?void 0:e[r.sequence])?n:null,u.hoveringFieldKey=r.fieldKey,t(r.fieldKey).forEach((o=>{o.style.backgroundColor||(o.style.backgroundColor="var(--c-hover-color)")}))}else i();function i(){u.hoveringRow=null;const o=u.hoveringFieldKey;o&&(t(o).forEach((o=>{"var(--c-hover-color)"===o.style.backgroundColor&&(o.style.backgroundColor="")})),u.hoveringFieldKey=null)}function t(o){const e=r.uuid;if(!e)return[];const n=document.querySelector(`[uuid="${e}"]`);return n?Array.from(n.querySelectorAll(`.${o}`)):[]}}return Object.assign(r,{onMousemove:o(i,100),async onMouseleave(){await e(101),i()},async onScroll(){i()}})})),i.exposeHooks.expose.tap("VerticalTable-useHoverColumn",((o,e)=>Object.assign(o,{verticalTable:{...o.verticalTable,getHoveringRow:()=>{var o;const n=null==(o=r(e))?void 0:o.uuid;return n?t(n).hoveringRow:null}}})))};export{u as useHoverColumn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as e,
|
|
1
|
+
import{inject as e,createVNode as l,toRaw as n,computed as r,withModifiers as i}from"vue";import{property as o,isFunction as t,isEmpty as d,identity as u}from"lodash-es";import{NPopover as c,NCheckbox as a,NRadio as s}from"naive-ui";import{InjectionIhoTableUUID as f,WIDGET_TYPE as v}from"../../../constants/index.js";import{IhoTableRenderHelper as x}from"../../../utils/index.js";import{isVerticalHeader as m,getHeaderDepthByField as p,getOriginBasePayload as h,getOriginRowFromRowData as w}from"./utils.js";const k={seq:e=>e.rowIndex+1,checkbox:e=>l(a,{checked:e.row.checked,"onUpdate:checked":l=>e.row.checked=l,onClick:i(u,["stop"])},null),radio(e,n){const o=r({get:()=>e.row===n.currentRow,set(){n.currentRow=e.row}});return l(s,{checked:o.value,"onUpdate:checked":e=>o.value=e,onClick:i(u,["stop"])},null)}};function g(n,i,u){return(s,w)=>{var g,b;const I=e(f),C=i(I),{row:D,column:H}=w;if(m(H.field)){const e=o("originalField")(D);if("checkbox"===e.type)return function(e){var n,i;const o=r({get(){var l,n;return!d(e.originalData)&&null!=(n=null==(l=e.originalData)?void 0:l.every((e=>e.checked)))&&n},set(l){var n;null==(n=e.originalData)||n.forEach((e=>e.checked=l))}}),t=r((()=>{var l,n;return null!=(n=null==(l=e.originalData)?void 0:l.some((e=>e.checked)))&&n}));return l(a,{checked:o.value,"onUpdate:checked":e=>o.value=e,indeterminate:!o.value&&t.value,disabled:null==(i=null==(n=e.originalTableConfig)?void 0:n.checkboxConfig)?void 0:i.disableHeader},null)}(C);const n=D[H.field.replaceAll("_parent","")];return x.hasTitlePrefix(e)&&p(H.field)===C.headerDepth?[l(c,null,{trigger:()=>l("i",{class:"vxe-cell-help-icon vxe-icon-question-circle-fill"},null),default:()=>e.titlePrefix.useHTML?l("div",{innerHTML:e.titlePrefix.useHTML},null):l("div",null,[e.titlePrefix.content])}),n]:n}const y={$table:w.$table,columnIndex:w.rowIndex,$columnIndex:w.rowIndex,isHidden:w.isHidden,rowid:w.rowid,...h(D,H)};if(!y.row)return null;const{originalField:{editRender:T={},slots:$={}}={}}=D;if(t($[u]))return $[u](y);if($.default&&!$.edit)return $.default(y);if(k[y.type])return k[y.type](y,C);const L=T.name||v.DEFAULT,F=n.renderer.get(L);return F?"default"===u?null==(g=F.renderCell)?void 0:g.call(F,T,y):null==(b=F.renderEdit)?void 0:b.call(F,T,y):{}}}function b(l,r){return(i,t)=>{var d,u,c;const a=e(f),s=r(a),v=null==(d=s.fixedLeftVerticalData)?void 0:d[t.$rowIndex];if(!v)return null;const x=o("originalField")(v),m=w(v,p(t.column.field)),h=n(null==(u=s.editCell)?void 0:u.row)===n(m)&&n(null==(c=s.editCell)?void 0:c.column)===n(x);return g(l,r,h?"edit":"default")(null,{...t,row:v,rowIndex:t.$rowIndex,rowid:t.$rowIndex+"",fixed:t.column.fixed,isHidden:!t.column.visible,type:t.column.type})}}export{k as VerticalRenderMap,g as createCellRender,b as createHeaderCellRender};
|
|
@@ -16,6 +16,7 @@ export declare function getSpanInfo({ row, column }: {
|
|
|
16
16
|
};
|
|
17
17
|
export declare function createVerticalFieldList(tableData: AnyObject[], headerDepth: number, verticalState: IhoTableVerticalState): IhoTableFieldItem[];
|
|
18
18
|
export declare function getVerticalInfoFromEvent(event: MouseEvent): {
|
|
19
|
+
fieldKey: string;
|
|
19
20
|
type: string;
|
|
20
21
|
sequence: number;
|
|
21
22
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as a,range as l,property as u}from"lodash-es";import{
|
|
1
|
+
import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as a,range as l,property as u}from"lodash-es";import{IhoTableRenderHelper as c}from"../../../utils/index.js";import{VERTICAL_CELL_TYPE as f}from"./constants.js";function d(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function s(e){return!!r(e)&&e.startsWith("header_")}function p(e){return!!r(e)&&e.startsWith("body_")}function h(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function _(n,t){const r=[];return e(n,((e,n,o)=>{e.parent=o,e.children||(!function(e,n){let t=e,r=n;if(!e.parent)return e[`header_${n}`]=e.title,void l(n+1).forEach((t=>{e[`header_${t}_colspan`]=t===n?n+1:0,e[`header_${t}_rowspan`]=t===n?1:0}));for(;t;)e[`header_${r}`]=t.title,e[`header_${r}_rowspan`]=i(t),e[`header_${r}_colspan`]=1,r--,t=t.parent}(e,t),r.push(e))})),r.forEach(((e,n)=>{const t=r[n-1];t&&Object.entries(e).forEach((([n,r])=>{n.match(/^header_(\d+)$/)&&r===t[n]&&r&&(e[`${n}_colspan`]=0,e[`${n}_rowspan`]=0)}))})),r;function i(n){if(!n.children)return 1;let t=0;return e(n.children,(e=>{e.children||t++})),t}}function g({row:e,column:n}){var t,r;return s(n.field)?{rowspan:null!=(t=e[n.field+"_rowspan"])?t:1,colspan:null!=(r=e[n.field+"_colspan"])?r:1}:{colspan:1,rowspan:1}}const m=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el");return n&&n.click(),n};function $(n,r){let i=120;return e(r,((e,r,o,a)=>{a===n&&(i=Math.max(i,t(e.title||"")+20+(c.hasTitlePrefix(e)?20:0)))})),Math.ceil(i)}function b(e,n,t){const r=T(t);let u=r.getTableConfig("verticalConfig.headerWidth");u="auto"===u?$:i(u)?o(u):a(u)?u:$;let c=r.getTableConfig("verticalConfig.bodyWidth");return c=i(c)?o(c):a(c)?c:o(120),[...l(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:u(e,t.originalFieldList),fixed:"left",editRender:{name:f,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:c(n),editRender:{name:f,props:{},enable:!0,autofocus:m}})))]}function y(e){const t=n(e.target,(e=>"TD"===e.tagName||"TH"===e.tagName));if(!t)return;const r=t.className.match(/(body|header)_(\d+)/);if(!r)return;const[i,o,a]=r;return{fieldKey:i,type:o,sequence:+a}}function w(e){return u("originalField")(e)}function x(e,n){return u(`originalData.${n}`)(e)}function v(e,n){const t=h(n.field),r=w(e);return{row:x(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function C(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function T(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[h(n.field)]},getTableConfig:n=>u(n)(e.originalTableConfig)}}function D(e,n){return new Proxy({},{get(t,r){var i;if("originalField"===r)return e;if("originalData"===r)return a(n)?n():n;if(s(r))return e[r];if(p(r)){const t=h(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}},set(t,r,i){if(!s(r)){const t=h(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}m.toString=()=>"input,.n-input__input-el";export{_ as bindHeaderInfoAndFlatten,D as createDataProxy,b as createVerticalFieldList,T as createVerticalStateHandler,C as findFixedLeftFields,h as getHeaderDepthByField,v as getOriginBasePayload,w as getOriginFieldFromRowData,x as getOriginRowFromRowData,g as getSpanInfo,y as getVerticalInfoFromEvent,p as isVerticalBody,s as isVerticalHeader,d as isVerticalTable};
|
|
@@ -37,7 +37,7 @@ export declare const IhoTableRenderHelper: Readonly<{
|
|
|
37
37
|
isEditableColumn(config: IhoTableConfig, column: IhoTableFieldItem): boolean | undefined;
|
|
38
38
|
hasFilter(lowCodeField: LowCodeTableFieldItem): boolean;
|
|
39
39
|
hasDateFiler(lowCodeField: LowCodeTableFieldItem): boolean | undefined;
|
|
40
|
-
hasTitlePrefix(lowCodeField:
|
|
40
|
+
hasTitlePrefix(lowCodeField: VxeTableDefines.ColumnInfo | IhoTableFieldItem): boolean | import("vxe-table").VxeTooltipPropTypes.Content | undefined;
|
|
41
41
|
}>;
|
|
42
42
|
export declare const IhoTableStatusHelper: Readonly<{
|
|
43
43
|
isPositive(value: string | number | undefined | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i}from"../../../../shared/utils/index.js";import{promiseTimeout as l}from"@vueuse/shared";import{parse as u,isValid as a,compareDesc as c}from"date-fns";import{isNumber as d,isFunction as s,isString as f,isObject as p,isArray as m}from"lodash-es";import{InjectionIhoTableConfig as v,InjectionIhoTableEmits as
|
|
1
|
+
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i}from"../../../../shared/utils/index.js";import{promiseTimeout as l}from"@vueuse/shared";import{parse as u,isValid as a,compareDesc as c}from"date-fns";import{isNumber as d,isFunction as s,isString as f,isObject as p,isArray as m}from"lodash-es";import{InjectionIhoTableConfig as v,InjectionIhoTableEmits as h,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as g,IHO_TABLE_TREE_TYPE as E,EDITABLE_WIDGET_TYPE as T,InjectionIhoTableUUID as w}from"../constants/index.js";import{getSeparateInfo as R}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function C(e){return console.warn(`[IhoTable]: ${e}`)}const S=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function F(){var e,t,r;const o=n(v);return o||C("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function P(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function D(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function b(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function A(e,n,r,o,i=2){const u=function(){var i;const l=null==(i=t(o))?void 0:i.getColumnByField(e.field);if(!l)return;const u=x(l);return u?s(u.separateWidth)?u.separateWidth({column:l,row:n,rowIndex:r,$table:t(o)}):d(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}();return d(u)&&u>0?u:i<=0?function(){const n=+e.colWidth;return d(n)?n:64}():(await l(0),A(e,n,r,o,i-1))}function O(e){const o=n(h);function i(){var n;const r=t(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(n=r.column.editRender)?void 0:n.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){o("formChange",{...i(),...r(e)})}function u(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function x(e){var n;return null==(n=e.editRender)?void 0:n.props}const $=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:t,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(t[r.field]);const i=n(w),l=R(i,t);if(!l)return c(t[r.field]);const{originalData:u=t,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:j(r,e),class:"iho-table__colorAndIcon"},[e])]}}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...O(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(U(e))return!0;let n=e.fieldSetting;return f(n)&&(n=i(n||"")),p(n)&&((t=n).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange},hasTitlePrefix(e){var n,t;return e&&((null==(n=e.titlePrefix)?void 0:n.content)||(null==(t=e.titlePrefix)?void 0:t.useHTML))}}),N=Object.freeze({isPositive:e=>e===g.POSITIVE||e===I.POSITIVE,isNegative:e=>e===g.NEGATIVE||e===I.NEGATIVE,notPositive:e=>e!==g.POSITIVE&&e!==I.POSITIVE,notNegative:e=>e!==g.NEGATIVE&&e!==I.NEGATIVE});function H(e){return[E.TRANSFORM_WITH_SPAN_METHOD,E.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function V(e){return f(e)&&!!e.match(/^###\{[^{}]+}$/)}function W(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function _(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!f(t))return e[n.field];const{mergedFeildExpression:r}=i(t);return r&&f(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;V(r)&&(r=W(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const y=["SEARCH","SELECT","RADIO","CHECKBOX"];function U(e){return e.notParticipatingSearch===g.NEGATIVE&&y.includes(S.getCellType(e))&&m(e.options)&&e.options.length}function j(e,n=""){return"tooltip"!==e.showOverflow&&f(n)?n:""}function M(e,n){var r,o,i;n=t(n)||"";const l=null!=(o=null==(r=e.editRender)?void 0:r.props)?o:{},c=u(n,(null==(i=null==l?void 0:l.componentProps)?void 0:i.valueFormat)||"HH:mm",new Date);return!a(c)}function G(e,n,r){var o,i;const l=null!=(i=null==(o=e.editRender)?void 0:o.props)?i:{};return r=t(r)||"",!a(new Date(r))||f(l.connectField)&&n[l.connectField]&&(l.isStartDate&&c(new Date(r),new Date(n[l.connectField]))<0||l.isEndDate&&c(new Date(r),new Date(n[l.connectField]))>0)}function L(e){var n,t;return(!0===e.variableHeight||"1"===e.variableHeight)&&(null!=(t=null==(n=e.editRender)?void 0:n.name)?t:S.getCellType(e))!==T.SEPARATE}function k(e){const n=e.internalData.tableFullColumn;return!!m(n)&&n.some((e=>{var n,t;return L(null!=(t=null==(n=e.editRender)?void 0:n.props)?t:{})}))}export{$ as IhoTableRenderHelper,N as IhoTableStatusHelper,S as IhoTableUtils,C as IhoTableWarn,P as eventListener2EventName,D as eventName2EventListener,A as getColumnRenderWidth,x as getLowCodeFieldFromField,F as getRowHeight,j as getTitle,U as isCompatibleColumn,G as isInvalidDate,M as isInvalidTime,V as isRichContent,H as isTransformTreeType,L as isVariableHeightColumn,k as isVariableHeightTable,_ as parseMergeField,W as parseRichContent,O as useIhoTableFormEvent,b as useUUIDMap};
|