cnhis-design-vue 3.1.52-beta.16 → 3.1.52-beta.18

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.
@@ -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,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function w(w,k,S,Y,E,M,$,O,P,A){r(w,k);const{getEqualXTypes:C,handleAddPrevent:I}=y(w,S,k),{createShadowLines:T}=t(),{left:R,xScaleList:X,xCellWidth:V,yCellHeight:z,originX:D,endX:F,originY:H,endY:_,itemList:W,event:q,vitalSignsOriginY:G,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ie=new Set,ne=m(R.yScaleValue);function oe(t){var o;const l=ne.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Q.size&&w.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Z.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 Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[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],p=n[i+1],d=o[r-1],f=o[r+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&s.push(d);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(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),g()}}else p?(l.push(p),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(...T(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),Q.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([...t.flat()],{...r,originX:"center"});e.push(n),Q.add(n)}))}w.value.add(...e)}Q.add(l),w.value.add(l)}))}}function le(){var e;const t=ne.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({},j,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].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((()=>{w.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function se(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},belowMinValueStyle:j={},dataList:Y=[],list:M=[]}=r,{type:O,textStyle:A,showConnectLine:C=!1}=b,I=[],T=[],R=[];null==(u=e.list)||u.forEach(((u,b)=>{const X=a(c)?Y.find((e=>e.key===u.key)):e,V=ue(u,r),D={};D.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=G.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return R.push(s),{obj:s,top:-z}}(V,u,X),function(e,t,r,a){var u,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let x,b,j,w,k;if(t.noRise&&h.show){const t=L(h)?E(c,M,35):e[1];if(h.text)j=l([e[0],L(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*z;j=s([e[0],t,i],{...h.style})}R.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),R.push(w));t.verified&&(k=l([e[0],e[1]-(m?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),R.push(k));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,M,null!=(u=t.physicsReduce)?u:t.drugReduce);x=i([...e,e[0],l],{...y,...g.line,...n}),b=o((null==(d=null==g?void 0:g.point)?void 0:d.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===N?"bottom":"center"}),x&&R.push(x),b&&R.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:h.text?5:2*z,isFixed:L(h)},riseText:{obj:w,top:(m?-z:0)-5},verifiedText:{obj:k,top:(m?-z:0)-5},reducePoint:{obj:b,type:"reduce"}})}(V,u,X,D),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,p;const{upArrowShow:d=!1,limitValueShow:f=!1}=i;if(d&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<G.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),a=s([e[0],i[0],i[1]],m,"up"),R.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>o){const t=a?e[1]+z/2+a.height:e[1]+z;u=l([e[0],t],i),R.push(u)}+t.value<r&&(u=l([e[0],e[1]-z],i),R.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)p=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*z;p=s([e[0],t,i],{...j.style})}R.push(p)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-z},belowMinValue:{obj:p,top:j.text?5:2*z,moveHide:!0}})}(V,u,X,D),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,b=e.list[s+1],j=ue(b,r),L=re(c,e.list[s].value),Y=j&&re(c,b.value);n&&j&&!l.breakpoint&&(!L&&!Y||C)&&n[0]!==j[0]&&(f=i([...n,...j],{...v}));const E=l.pacemakerShow&&"pulse"==c?y.value:L&&"number"===O?0:x,M=T[s-1],R={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:d(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...L?{selectable:!1,evented:!1,..."number"===O?A:{}}:{}};if(M){const e=M.get("y2");p=o(E,{left:M.get("x2"),top:L?e-5:e,...R})}else n&&(R.leftLine=null,p=o(E,{left:n[0],top:L?n[1]-5:n[1],...R}));T.push(f),p&&(g.includes("脉搏")?ee.add(p):te.add(p),function(e){q.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:G;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&&(w.value.remove(i),delete e.otherObj.obj)))})),oe(e)}(e),q.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=$(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};w.value.discardActiveObject(),S("change",n),pe(n,"change")}}))}(p),I.push(p),ie.add(p))}(V,u,b,X,D)})),"pulse"===c&&U.forEach((e=>{Z.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=T.filter((e=>e));Promise.all(R).then((i=>{w.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&&w.value.remove(e.leftLine),e.rightLine&&w.value.remove(e.rightLine))}}(t,e)}))}))}))}function re(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:$(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)||M(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const i="pain"===t.type?B:G;if(f(e)&&function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=Y(e.time),o=E(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function ce(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${M(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function pe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ne.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;de()}function de(){var e;ie.size&&(null==(e=w.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}([...ie]))),Z.clear(),ie.clear(),ee.clear(),te.clear(),ne.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ne.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),n=i([D,t,F,t],e.positionLine);w.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le(),k.event.evented&&w.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=F&&n>=H&&n<=_){A.point={x:i,y:n},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],W.forEach((t=>{if(!C([...ie],i,"_type").includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:G;n>=i.originY&&n<=i.endY&&A.list.push({renderItem:O?O(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ce(i);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&I("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};S("change",r),pe(r,"change")}else{const t={data:{time:M(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};S("add",t),pe(t)}},setPopup:ae,isAddPoint:ce,updateData:pe,redrawPoints:de,gridPoints:ie}}function L(e){return"fixed"===e.position}export{w 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 a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function w(w,k,S,Y,E,M,$,O,P,A){r(w,k);const{getEqualXTypes:C,handleAddPrevent:I}=y(w,S,k),{createShadowLines:T}=t(),{left:R,xScaleList:X,xCellWidth:V,yCellHeight:z,originX:D,endX:F,originY:H,endY:_,itemList:W,event:q,vitalSignsOriginY:G,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ie=new Set,ne=m(R.yScaleValue);function oe(t){var o;const l=ne.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Q.size&&w.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Z.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 Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[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],p=n[i+1],d=o[r-1],f=o[r+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&s.push(d);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(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),g()}}else p?(l.push(p),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(...T(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),Q.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([...t.flat()],{...r,originX:"center"});e.push(n),Q.add(n)}))}w.value.add(...e)}Q.add(l),w.value.add(l)}))}}function le(){var e;const t=ne.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({},j,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].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((()=>{w.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function se(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},belowMinValueStyle:j={},dataList:Y=[],list:M=[]}=r,{type:O,textStyle:A,showConnectLine:C=!1}=b,I=[],T=[],R=[];null==(u=e.list)||u.forEach(((u,b)=>{const X=a(c)?Y.find((e=>e.key===u.key)):e,V=ue(u,r),D={};D.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=G.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return R.push(s),{obj:s,top:-z}}(V,u,X),function(e,t,r,a){var u,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let x,b,j,w,k;if(t.noRise&&h.show){const t=L(h)?E(c,M,35):e[1];if(h.text)j=l([e[0],L(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*z;j=s([e[0],t,i],{...h.style})}R.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),R.push(w));t.verified&&(k=l([e[0],e[1]-(m?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),R.push(k));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,M,null!=(u=t.physicsReduce)?u:t.drugReduce);x=i([...e,e[0],l],{...y,...g.line,...n}),b=o((null==(d=null==g?void 0:g.point)?void 0:d.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===N?"bottom":"center"}),x&&R.push(x),b&&R.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:h.text?5:2*z,isFixed:L(h)},riseText:{obj:w,top:(m?-z:0)-5},verifiedText:{obj:k,top:(m?-z:0)-5},reducePoint:{obj:b,type:"reduce"}})}(V,u,X,D),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,p;const{upArrowShow:d=!1,limitValueShow:f=!1}=i;if(d&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<G.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),a=s([e[0],i[0],i[1]],m,"up"),R.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>o){const t=a?e[1]+z/2+a.height:e[1]+z;u=l([e[0],t],i),R.push(u)}+t.value<r&&(u=l([e[0],e[1]-z],i),R.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)p=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*z;p=s([e[0],t,i],{...j.style})}R.push(p)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-z},belowMinValue:{obj:p,top:j.text?5:2*z,moveHide:!0}})}(V,u,X,D),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,b=e.list[s+1],j=ue(b,r),L=re(c,e.list[s].value),Y=j&&re(c,b.value);n&&j&&!l.breakpoint&&(!L&&!Y||C)&&n[0]!==j[0]&&(f=i([...n,...j],{...v}));const E=l.pacemakerShow&&"pulse"==c?y.value:L&&"number"===O?0:x,M=T[s-1],R={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:d(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...L?{selectable:!1,evented:!1,..."number"===O?A:{}}:{}};if(M){const e=M.get("y2");p=o(E,{left:M.get("x2"),top:L?e-5:e,...R})}else n&&(R.leftLine=null,p=o(E,{left:n[0],top:L?n[1]-5:n[1],...R}));T.push(f),p&&(g.includes("脉搏")?ee.add(p):te.add(p),function(e){q.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:G;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&&(w.value.remove(i),delete e.otherObj.obj)))})),oe(e)}(e),q.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=$(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};w.value.discardActiveObject(),S("change",n),pe(n,"change")}}))}(p),I.push(p),ie.add(p))}(V,u,b,X,D)})),"pulse"===c&&U.forEach((e=>{Z.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=T.filter((e=>e));Promise.all(R).then((i=>{w.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&&w.value.remove(e.leftLine),e.rightLine&&w.value.remove(e.rightLine))}}(t,e)}))}))}))}function re(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:$(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)||M(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const i="pain"===t.type?B:G;if(f(e)&&function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=Y(e.time),o=E(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function ce(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${M(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function pe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ne.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;de()}function de(){var e;ie.size&&(null==(e=w.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}([...ie]))),Z.clear(),ie.clear(),ee.clear(),te.clear(),ne.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ne.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),n=i([D,t,F,t],e.positionLine);w.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le(),k.event.evented&&w.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=F&&n>=H&&n<=_){A.point={x:i,y:n},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],W.forEach((t=>{if(!C([...ie],i,"_type").includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:G;n>=i.originY&&n<=i.endY&&A.list.push({renderItem:O?O(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ce(i);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&I("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};S("change",r),pe(r,"change")}else{const t={data:{time:M(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};S("add",t),pe(t)}},setPopup:ae,isAddPoint:ce,updateData:pe,redrawPoints:de,gridPoints:ie}}function L(e){return"fixed"===e.position}export{w as useCenter};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as r}from"../useEvent.js";import{setOtherType as n,getFloorNumber as o}from"../../utils/index.js";import"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as c}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as h}from"./useCenter.js";import{useBottom as g}from"./useBottom.js";import{useOther as m}from"./useOther.js";function f(f,y,Y,S,b,w){const C=15,x=e(),D=e(),j=e(),V=t((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||C)||0})),X=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||C)||0})),H=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||C)||0})),L=t((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),I=t((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),M=t((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+e.surplusXCell})),P=t((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+e.surplusYCell})),N=t((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),O=t((()=>{const{grid:e}=y.data;return N.value-e.surplusXCell*R.value})),W=t((()=>{const{top:e,left:t}=y.data;return e.titleWidth+z.value})),$=t((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),k=t((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||C)||0;return V.value+a+l+X.value+H.value})),G=t((()=>{const{grid:e}=y.data;return k.value+e.surplusYCell*q.value})),R=t((()=>(N.value-W.value)/M.value)),q=t((()=>($.value-k.value)/P.value)),z=t((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),T=t((()=>{var e,t;const{top:a,grid:l}=y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=W.value-R.value;const n=a.date.startDate||s(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(s(d(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=R.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+R.value/2,scaleCell:(l-a)/R.value}})))).flat()})),A=t((()=>le("breathe"))),B=t((()=>le("pulse"))),E=t((()=>le("temperature"))),F=t((()=>le("pain"))),J=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),K=t((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:n(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Q=t((()=>{const{left:e}=y.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),U=t((()=>{const{grid:e}=y.data;return-1===Q.value?0:q.value*e.subYCell})),Z=t((()=>{const{left:e}=y.data,t={originY:$.value,endY:$.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=G.value,t.endY=G.value+U.value):Q.value===e.yScaleValue.length-1&&(t.originY=$.value-U.value,t.endY=$.value),t})),_=t((()=>{const{left:e}=y.data,t={originY:k.value,endY:$.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=G.value+U.value,t.endY=$.value):Q.value===e.yScaleValue.length-1&&(t.originY=G.value,t.endY=$.value-U.value),t})),ee=t((()=>{var e,t;const{top:a,grid:l}=y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),te=t((()=>{var e;const{left:t,right:a}=y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>o(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ae=a({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...u,...y.data.borderStyle||{}},selectionStyle:y.data.selectionStyle||{},dateHeight:V.value,hospitalDaysHeight:X.value,operationDaysHeight:H.value,xScalevalueHeight:L.value,topList:ee.value,breathingHeight:I.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:Z.value,vitalSignsOriginY:_.value,gridXNumber:M.value,gridYNumber:P.value,iconsWidth:z.value,originX:W.value,originY:k.value,originYLimit:G.value,endX:N.value,endXLimit:O.value,endY:$.value,xCellWidth:R.value,yCellHeight:q.value,xScaleList:T.value,breatheYCell:A.value,pulseYCell:B.value,temperatureYCell:E.value,painYCell:F.value,event:J.value,itemList:K.value,getRightInfo:te.value,config:y.data.config||{}});function le(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?q.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:ue,cumputedY:ie,getXValue:re,getYValue:ne}=i(ae);return l((()=>f.value),(e=>{e&&function(){v(f,ae);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=h(f,ae,Y,ue,ie,re,ne,y.addRenderItem,b,w);D.value=l,j.value=u;const{drawScaleValue:n}=c(f,ae,Y,e,b,ue,ie,re,ne,t,a,i);p(f,ae,n),g(f,ae),m(f,ae,ue);const{select:o}=r(f,ae,Y);x.value=o}()}),{immediate:!0}),{propItems:ae,redrawPoints:D,select:x,clickMenu:j}}export{f as useTemperatureChart};
1
+ import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as r}from"../useEvent.js";import{setOtherType as n,getFloorNumber as o}from"../../utils/index.js";import"lodash-es";import{format as s,addDays as v}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as d}from"./useTop.js";import{useLeft as c}from"./useLeft.js";import{useRight as h}from"./useRight.js";import{useCenter as p}from"./useCenter.js";import{useBottom as g}from"./useBottom.js";import{useOther as m}from"./useOther.js";function f(f,y,S,b,Y,w){const C=15,x=e(),D=e(),j=e(),V=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),H=t((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||C)||0})),X=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||C)||0})),L=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||C)||0})),I=t((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),M=t((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),P=t((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+V.value[1]+V.value[3]})),N=t((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+V.value[0]+V.value[2]})),O=t((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),W=t((()=>O.value-V.value[2]*z.value)),$=t((()=>{const{top:e,left:t}=y.data;return e.titleWidth+A.value})),k=t((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),G=t((()=>k.value-V.value[2]*T.value)),R=t((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||C)||0;return H.value+a+l+X.value+L.value})),q=t((()=>R.value+V.value[0]*T.value)),z=t((()=>(O.value-$.value)/P.value)),T=t((()=>(k.value-R.value)/N.value)),A=t((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=t((()=>{var e,t;const{top:a,grid:l}=y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=$.value-z.value;const n=a.date.startDate||s(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(s(v(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=z.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+z.value/2,scaleCell:(l-a)/z.value}})))).flat()})),E=t((()=>ie("breathe"))),F=t((()=>ie("pulse"))),J=t((()=>ie("temperature"))),K=t((()=>ie("pain"))),Q=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=t((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:n(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Z=t((()=>{const{left:e}=y.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),_=t((()=>{const{grid:e}=y.data;return-1===Z.value?0:T.value*e.subYCell})),ee=t((()=>{const{left:e}=y.data,t={originY:q.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?t.endY=q.value+_.value:Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value),t})),te=t((()=>{const{left:e}=y.data,t={originY:q.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?t.originY=q.value+_.value:Z.value===e.yScaleValue.length-1&&(t.endY=G.value-_.value),t})),ae=t((()=>{var e,t;const{top:a,grid:l}=y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=t((()=>{var e;const{left:t,right:a}=y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>o(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ue=a({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...u,...y.data.borderStyle||{}},selectionStyle:y.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:X.value,operationDaysHeight:L.value,xScalevalueHeight:I.value,topList:ae.value,breathingHeight:M.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:P.value,gridYNumber:N.value,iconsWidth:A.value,originX:$.value,originY:R.value,originYLimit:q.value,endX:O.value,endXLimit:W.value,endY:k.value,xCellWidth:z.value,yCellHeight:T.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:y.data.config||{},surplusCell:V.value});function ie(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?T.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:re,cumputedY:ne,getXValue:oe,getYValue:se}=i(ue);return l((()=>f.value),(e=>{e&&function(){d(f,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=p(f,ue,S,re,ne,oe,se,y.addRenderItem,Y,w);D.value=l,j.value=u;const{drawScaleValue:n}=c(f,ue,S,e,Y,re,ne,oe,se,t,a,i);h(f,ue,n),g(f,ue),m(f,ue,re);const{select:o}=r(f,ue,S);x.value=o}()}),{immediate:!0}),{propItems:ue,redrawPoints:D,select:x,clickMenu:j}}export{f as useTemperatureChart};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as i,defaultTextStyle as s}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:v,endXLimit:g,canvasWidth:y,borderStyle:m}=u;!function(){const S=[];g&&S.push(new t.Line([g,0,y,0],m));let w=0;v.forEach(((t,l)=>{if(l>0&&(w+=u[`${v[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-h.surplusXCell)/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=i({width:d,height:u,...m},{value:c,...s,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,S,w),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,v=d-r;if(!v)return;l.push(e([f,o+d,a,o+d],m));const g=i({width:n-f,height:d,...m},{value:p.xScalevalue.title,...s,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(g),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=i({width:c,height:v,...m},{value:u.value,...s,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+v],m))}))}(t,S,w);else{if(!u[`${t.key}Height`])return;const o=u[`${v[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=i({width:n-f,height:a,...m},{value:t.title,...s,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=i({width:p,height:a,...m},{value:u,...s,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,S,w),S.push(e([f,w+o,a,w+o],m)),S.push(e([n,w,n,w+o],m))}}));const X=S.length>0?new t.Group([...S],{...l,objectCaching:!1}):null;X&&X.sendToBack(),X&&o.value.add(X)}()}export{o as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as i,defaultTextStyle as s}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:v,endXLimit:g,canvasWidth:y,borderStyle:m,surplusCell:S}=u;!function(){const w=[];g&&w.push(new t.Line([g,0,y,0],m));let x=0;v.forEach(((t,l)=>{if(l>0&&(x+=u[`${v[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-S[1]-S[3])/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=i({width:d,height:u,...m},{value:c,...s,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,w,x),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,v=d-r;if(!v)return;l.push(e([f,o+d,a,o+d],m));const g=i({width:n-f,height:d,...m},{value:p.xScalevalue.title,...s,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(g),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=i({width:c,height:v,...m},{value:u.value,...s,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+v],m))}))}(t,w,x);else{if(!u[`${t.key}Height`])return;const o=u[`${v[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=i({width:n-f,height:a,...m},{value:t.title,...s,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=i({width:p,height:a,...m},{value:u,...s,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,w,x),w.push(e([f,x+o,a,x+o],m)),w.push(e([n,x,n,x+o],m))}}));const X=w.length>0?new t.Group([...w],{...l,objectCaching:!1}):null;X&&X.sendToBack(),X&&o.value.add(X)}()}export{o as useTop};
@@ -31,8 +31,7 @@ interface IGrid {
31
31
  subSecondXCell: number;
32
32
  mainYCell: number;
33
33
  subYCell: number;
34
- surplusXCell: number;
35
- surplusYCell: number;
34
+ surplusCell: [number, number, number, number];
36
35
  mainLineStyle?: ImainLineStyle;
37
36
  subLineStyle?: fabric.ILineOptions;
38
37
  subSecondLineStyle?: fabric.ILineOptions;
@@ -80,6 +79,7 @@ export interface IPropItems {
80
79
  itemList: Array<any>;
81
80
  getRightInfo: AnyObject;
82
81
  config: AnyObject;
82
+ surplusCell: [number, number, number, number];
83
83
  }
84
84
  export interface IPoint {
85
85
  time: string;
@@ -1,6 +1,9 @@
1
1
  import { PropType } from 'vue';
2
2
  export declare const DATE: import("vue").DefineComponent<{
3
3
  onChange: {};
4
+ disabled: {
5
+ type: BooleanConstructor;
6
+ };
4
7
  value: {
5
8
  type: StringConstructor;
6
9
  };
@@ -29,8 +32,15 @@ export declare const DATE: import("vue").DefineComponent<{
29
32
  type: StringConstructor;
30
33
  default: string;
31
34
  };
35
+ dbclickToCurrent: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
32
39
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
33
40
  onChange: {};
41
+ disabled: {
42
+ type: BooleanConstructor;
43
+ };
34
44
  value: {
35
45
  type: StringConstructor;
36
46
  };
@@ -59,9 +69,15 @@ export declare const DATE: import("vue").DefineComponent<{
59
69
  type: StringConstructor;
60
70
  default: string;
61
71
  };
72
+ dbclickToCurrent: {
73
+ type: BooleanConstructor;
74
+ default: boolean;
75
+ };
62
76
  }>> & {
63
77
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
64
78
  }, {
79
+ disabled: boolean;
65
80
  allowedInvalidValue: string;
66
81
  valueFormat: string;
82
+ dbclickToCurrent: boolean;
67
83
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,watch as a,createVNode as o,mergeProps as r}from"vue";import{generateTimeFormat as i}from"../../../../../shared/utils/index.js";import{connect as n,mapProps as u}from"@formily/vue";import{isObject as l}from"@vueuse/core";import{format as s}from"date-fns";import m from"../../../../date-picker/index.js";import{useCommonInjection as d}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../../index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const p=n(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"},allowedInvalidValue:{type:String,default:"-"}},emits:["update:value"],setup(e,{emit:n}){const{injectValueValidate:u,injectValueBindKey:v}=d();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function p(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function f(e){return c()&&e<Date.now()-864e5||p()&&e>Date.now()}function y(e){const t=new Date(e),a=new Date,o=new Date(t);o.setHours(0),o.setMinutes(0),o.setSeconds(0);const r=new Date(t);r.setHours(23),r.setMinutes(59),r.setSeconds(59);const i=o>a,n=r<a,u=t.getHours(),l=a.getHours(),s=a.getMinutes();return{isHourDisabled:function(e){return c()&&!i&&e<l||p()&&!n&&e>l},isMinuteDisabled:function(e){if(u===l)return c()&&!i&&e<s||p()&&!n&&e>s;return c()&&!i&&u<l||p()&&!n&&u>l}}}u((()=>e.value));const D=t((()=>{const t={};if(l(e.validate)){const{min_date:a,max_date:o}=e.validate;(a||o)&&(t.isDateDisabled=f,t.isTimeDisabled=y)}return t})),w=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:i(e.valueFormat)}})));function j(t){return t!==e.allowedInvalidValue&&t?s(new Date(t),e.valueFormat):t}a((()=>e.value),(e=>{e&&j(e)!==e&&n("update:value",j(e))}));const g=t({get:()=>j(e.value),set:e=>{n("update:value",e)}}),h=v(g);return()=>o(m,r({key:h.value,allowedInvalidValue:e.allowedInvalidValue},D.value,w.value,{"formatted-value":g.value,"onUpdate:formatted-value":e=>g.value=e}),null)}}),u(v,c));export{p as DATE};
1
+ import{defineComponent as e,computed as t,watch as a,ref as o,onMounted as i,createVNode as n,mergeProps as r}from"vue";import{generateTimeFormat as u}from"../../../../../shared/utils/index.js";import{connect as l,mapProps as s}from"@formily/vue";import{isObject as d,useEventListener as m}from"@vueuse/core";import{format as v}from"date-fns";import c from"../../../../date-picker/index.js";import{useCommonInjection as p}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../../index.js";import{assignUpdateValue as f,assignClearBindVisited as y}from"../../utils/schema.js";const w=l(e({props:{onChange:{},disabled:{type:Boolean},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"},allowedInvalidValue:{type:String,default:"-"},dbclickToCurrent:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{emit:l}){const{injectValueValidate:s,injectValueBindKey:f}=p();function y(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function w(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function D(e){return y()&&e<Date.now()-864e5||w()&&e>Date.now()}function b(e){const t=new Date(e),a=new Date,o=new Date(t);o.setHours(0),o.setMinutes(0),o.setSeconds(0);const i=new Date(t);i.setHours(23),i.setMinutes(59),i.setSeconds(59);const n=o>a,r=i<a,u=t.getHours(),l=a.getHours(),s=a.getMinutes();return{isHourDisabled:function(e){return y()&&!n&&e<l||w()&&!r&&e>l},isMinuteDisabled:function(e){if(u===l)return y()&&!n&&e<s||w()&&!r&&e>s;return y()&&!n&&u<l||w()&&!r&&u>l}}}s((()=>e.value));const j=t((()=>{const t={};if(d(e.validate)){const{min_date:a,max_date:o}=e.validate;(a||o)&&(t.isDateDisabled=D,t.isTimeDisabled=b)}return t})),g=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:u(e.valueFormat)}})));function h(t){return t!==e.allowedInvalidValue&&t?v(new Date(t),e.valueFormat):t}a((()=>e.value),(e=>{e&&h(e)!==e&&l("update:value",h(e))}));const k=t({get:()=>h(e.value),set:e=>{l("update:value",e)}}),F=f(k),V=o();return i((()=>{var t;if(!e.dbclickToCurrent)return;const a=null==(t=V.value)?void 0:t.$el;if(!a)return;const o=a.querySelector("input");o&&m(a,"dblclick",(()=>function(t){e.disabled||(t.value=v(Date.now(),e.valueFormat),t.dispatchEvent(new Event("input")))}(o)))})),()=>n(c,r({ref:V,key:F.value,disabled:e.disabled,allowedInvalidValue:e.allowedInvalidValue},j.value,g.value,{"formatted-value":k.value,"onUpdate:formatted-value":e=>k.value=e}),null)}}),s(f,y));export{w as DATE};
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,createVNode as o,isVNode as l}from"vue";import a from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{connect as i,mapProps as r}from"@formily/vue";import{isNumber as n,isEmpty as u,isArray as d}from"lodash-es";import{NRadioGroup as s,NCheckboxGroup as c,NCheckbox as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as m}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as f,createVisitedSetter as v}from"../../utils/schema.js";import{useUrlConfigOptions as y,useAutographOptions as h}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as j}from"../../hooks/useCommonInjection.js";import{useFormField as b}from"../../hooks/useFormField.js";function g(a,i,r){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:s}=b();const c=t({get(){return t=e.value,n(t)?t+"":t;var t},set(e){a("update:value",e)}}),{renderComplexOption:p}=m(e,c),{labelKey:f,valueKey:g,fullOptions:x}=e.urlConfig?y(e,c):h(e,c),{injectValueBindKey:C,injectValueValidate:F}=j();F(c);const S=C(c);function k(){c.value=null}function O(t){let a;const i={display:"flex",alignItems:"center"};if(t.__spanPercent&&"inner"===e.childWidthMode){const e=`${t.__spanPercent}%`;i.maxWidth=e,function(e,t){return!u(t.childrenFields)&&(d(e)?e.includes(t[g.value]):e===t[g.value])}(c.value,t)&&(i.width=e)}return o(r,{key:t[g.value],value:t[g.value],disabled:t.disabled,currentValue:c.value,cancelable:e.clearable,onCancel:k,style:i},"function"==typeof(n=a=p({value:c.value,option:t,valueKey:g.value,labelKey:f.value,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode}))||"[object Object]"===Object.prototype.toString.call(n)&&!l(n)?a:{default:()=>[a]});var n}return()=>{const t=x.value.map((e=>{var t;const o=null==(t=e.childrenFields)?void 0:t.reduce(((e,t)=>e+ +(t.elem_width||3)),0);return{...e,__spanPercent:(o||0)/12*100}})),l={display:"flex",flexDirection:e.vertical?"column":"row",flexWrap:"wrap",justifyItems:"flex-start",alignItems:"center",width:"100%"};return o(i,{key:S.value,value:c.value,"onUpdate:value":e=>c.value=e,onClick:v(s),style:{width:"100%"}},{default:()=>[o("section",{style:l},[t.map(O)])]})}}})}const x=i(g("FormRadio",s,a),r({dataSource:"options"},f)),C=i(g("FormCheckbox",c,p),r({dataSource:"options"},f));export{C as CHECKBOX,x as RADIO};
1
+ import{defineComponent as e,computed as t,createVNode as o,isVNode as l}from"vue";import a from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{connect as r,mapProps as i}from"@formily/vue";import{isNumber as n,isEmpty as u,isArray as d}from"lodash-es";import{NRadioGroup as s,NCheckboxGroup as c,NCheckbox as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as m}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as f,createVisitedSetter as v}from"../../utils/schema.js";import{useUrlConfigOptions as y,useAutographOptions as h}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as j}from"../../hooks/useCommonInjection.js";import{useFormField as b}from"../../hooks/useFormField.js";function g(a,r,i){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:s}=b();const c=t({get(){return t=e.value,n(t)?t+"":t;var t},set(e){a("update:value",e)}}),{renderComplexOption:p}=m(e,c),{labelKey:f,valueKey:g,fullOptions:x}=e.urlConfig?y(e,c):h(e,c),{injectValueBindKey:C,injectValueValidate:F}=j();F(c);const S=C(c);function k(){c.value=null}function O(t){let a;const r={display:"flex",alignItems:"center"};if(t.__spanPercent&&"inner"===e.childWidthMode){const e=`${t.__spanPercent}%`;r.maxWidth=e,function(e,t){return!u(t.childrenFields)&&(d(e)?e.includes(t[g.value]):e===t[g.value])}(c.value,t)&&(r.width=e)}return o(i,{key:t[g.value],value:t[g.value],disabled:t.disabled,currentValue:c.value,cancelable:e.clearable,onCancel:k,style:r},"function"==typeof(n=a=p({value:c.value,option:t,valueKey:g.value,labelKey:f.value,childFieldStrategy:e.childFieldStrategy,childWidthMode:e.childWidthMode}))||"[object Object]"===Object.prototype.toString.call(n)&&!l(n)?a:{default:()=>[a]});var n}return()=>{const t=x.value.map((e=>{var t;const o=null==(t=e.childrenFields)?void 0:t.reduce(((e,t)=>e+ +(t.elem_width||3)),0);return{...e,__spanPercent:(o||0)/12*100}})),l={display:"flex",flexDirection:e.vertical?"column":"row",flexWrap:"wrap",justifyItems:"flex-start",alignItems:e.vertical?"flex-start":"center",width:"100%"};return o(r,{key:S.value,value:c.value,"onUpdate:value":e=>c.value=e,onClick:v(s),style:{width:"100%"}},{default:()=>[o("section",{style:l},[t.map(O)])]})}}})}const x=r(g("FormRadio",s,a),i({dataSource:"options"},f)),C=r(g("FormCheckbox",c,p),i({dataSource:"options"},f));export{C as CHECKBOX,x as RADIO};
@@ -1 +1 @@
1
- import{COMPONENT_NAMESPACE as s}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import{once as t}from"lodash-es";import a from"./src/IhoTable.vue.js";import e from"./src/plugins/index.js";import"vue";import"./src/constants/index.js";import"@vueuse/shared";import"./src/utils/separateMap.js";import"../../shared/utils/tapable/SyncHook.js";import"../../shared/utils/tapable/SyncBailHook.js";import"../../shared/utils/tapable/SyncWaterfallHook.js";import"../../shared/utils/tapable/SyncLoopHook.js";import"../../shared/utils/tapable/AsyncParallelHook.js";import"../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../shared/utils/tapable/AsyncSeriesHook.js";import"../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";export{AbstractConfigHooks,AbstractDataHooks,AbstractDomInsertHooks,AbstractEventHooks,AbstractExposeHooks,AbstractFieldHooks,AbstractSetupHooks}from"./src/types/pluginType.js";import{useTablePlugin as r}from"./src/hooks/useTablePlugin.js";export{defineTablePlugin,useTablePlugin}from"./src/hooks/useTablePlugin.js";export{useColumnConfigAdaptor}from"./src/hooks/useColumnConfigAdaptor.js";const{use:l}=r(),i=t((s=>{l(Object.values(e).map((s=>s())),s)})),p=a;p.install=function(t){o(t,p,s+"IhoTable")};export{p as default,i as useIhoTablePresetPlugins};
1
+ import{COMPONENT_NAMESPACE as s}from"../../shared/global/variable.js";import{safeComponentRegister as o}from"../../shared/utils/index.js";import{once as t}from"lodash-es";import a from"./src/IhoTable.vue.js";import e from"./src/plugins/index.js";import"vue";import"./src/constants/index.js";import"@vueuse/shared";import"date-fns";import"./src/utils/separateMap.js";import"../../shared/utils/tapable/SyncHook.js";import"../../shared/utils/tapable/SyncBailHook.js";import"../../shared/utils/tapable/SyncWaterfallHook.js";import"../../shared/utils/tapable/SyncLoopHook.js";import"../../shared/utils/tapable/AsyncParallelHook.js";import"../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../shared/utils/tapable/AsyncSeriesHook.js";import"../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";export{AbstractConfigHooks,AbstractDataHooks,AbstractDomInsertHooks,AbstractEventHooks,AbstractExposeHooks,AbstractFieldHooks,AbstractSetupHooks}from"./src/types/pluginType.js";import{useTablePlugin as r}from"./src/hooks/useTablePlugin.js";export{defineTablePlugin,useTablePlugin}from"./src/hooks/useTablePlugin.js";export{useColumnConfigAdaptor}from"./src/hooks/useColumnConfigAdaptor.js";const{use:l}=r(),i=t((s=>{l(Object.values(e).map((s=>s())),s)})),p=a;p.install=function(t){o(t,p,s+"IhoTable")};export{p as default,i as useIhoTablePresetPlugins};
@@ -1 +1 @@
1
- import{unref as e}from"vue";import{promiseTimeout as t}from"@vueuse/shared";import"../../../index.js";import{useSessionStorage as n}from"@vueuse/core";import{selectOptionsMap as o}from"../rendererPlugins/editableWidgets/hooks/useSelectOption.js";import{IhoTableUtils as l}from"../../utils/index.js";import{EDITABLE_WIDGET_TYPE as i}from"../../constants/index.js";import{isString as r,trim as u,isEmpty as d,isEqual as a,isFunction as s}from"lodash-es";import{parse as c,isValid as p,compareDesc as f}from"date-fns";import{defineTablePlugin as m}from"../../hooks/useTablePlugin.js";function v(){const v="keyboardEventPlugin",g=n("ihoTableClipData","");return m({name:v,apply(n){function m(t,n,m,v,w){var b,C;if(!(null==(b=null==m?void 0:m.keyboardConfig)?void 0:b.isClip))return;if("paste"===t&&!n.getSelectedCell())return;const{row:y,column:R}=n.getSelectedCell()||n.getEditRecord()||{};if(!y||!R||!E(R,i.SELECT)&&e(g)===y[R.field])return;const x=m.uuid&&E(R,i.SELECT)&&o.get(m.uuid)[R.field],T=y[R.field];if("copy"===t){const e=(null==(C=(x||[]).filter((e=>T.includes(e.value))))?void 0:C.map((e=>e.label)).join(","))||T;g.value=e}else{if(r(e(g))&&(g.value=u(e(g)||"")),!e(g)||!function(e){var t;const n=null==(t=e.editRender)?void 0:t.props;return n&&Object.keys(i).includes(l.getCellType(n))}(R)||y.$__SEPARATE||!function(e,t,n,o){var l,i;const{beforeEditMethod:r}=t.editConfig||{},u={rowIndex:null!=(l=e.getRowIndex(n))?l:0,columnIndex:null!=(i=e.getColumnIndex(o))?i:0};return!r||s(r)&&r({row:n,column:o,...u,$table:e,$grid:void 0})}(n,m,y,R))return;if(E(R,i.DATE)&&function(t,n){var o;const l=null==(o=t.editRender)?void 0:o.props,i=e(g)||"";return!p(new Date(i))||r(l.connectField)&&n[l.connectField]&&(l.isStartDate&&f(new Date(i),new Date(n[l.connectField]))<0||l.isEndDate&&f(new Date(i),new Date(n[l.connectField]))>0)}(R,y))return;if(E(R,i.NUMBER)&&!/^-?\d*\.?\d+$/.test((e(g)||"").toString()))return;if(E(R,i.TIME)&&function(t){var n,o;const l=e(g)||"",i=null==(n=t.editRender)?void 0:n.props,r=c(l,(null==(o=null==i?void 0:i.componentProps)?void 0:o.valueFormat)||"HH:mm",new Date);return!p(r)}(R))return;let t=e(g)||"";if(x&&!d(x)){const e=x.filter((e=>t.split(",").includes(e.label))).map((e=>e.value));if(d(e))return;if(function(e){var t,n;const o=null==(t=e.editRender)?void 0:t.props;return E(e,i.SELECT)&&(null==(n=o.componentProps)?void 0:n.multiple)}(R)){if(a(T,e))return;t=e}else{if(e.includes(T))return;t=e[0]}}y[R.field]=t,v("formChange",{column:R,row:y,oldValue:T,value:t,index:n.getRowIndex(y)}),E(R,i.SEPARATE)&&(null==w||w())}}function E(e,t){var n;const o=null==(n=e.editRender)?void 0:n.props;return o&&l.getCellType(o)===t}n.eventHooks.onCopy.tap(v,(({$table:e},t,{emits:n})=>m("copy",e,t,n))),n.eventHooks.onPaste.tap(v,(({$table:e},t,{emits:n,updateTableDataRef:o})=>m("paste",e,t,n,o))),n.eventHooks.onKeydown.tap(v,(async({$event:e,$table:n},o,{emits:l})=>{await t(0);const{row:i,column:r}=n.getSelectedCell()||n.getEditRecord()||{};if(!i||!r)return;l("keyboard",{$table:n,key:e.key,index:n.getRowIndex(i),value:i[r.field],row:i,column:r})}))}})}export{v as keyboardEventPlugin};
1
+ import{unref as e}from"vue";import{promiseTimeout as t}from"@vueuse/shared";import"../../../index.js";import{useSessionStorage as o}from"@vueuse/core";import{selectOptionsMap as n}from"../rendererPlugins/editableWidgets/hooks/useSelectOption.js";import{isInvalidDate as l,isInvalidTime as i,IhoTableUtils as r}from"../../utils/index.js";import{EDITABLE_WIDGET_TYPE as u}from"../../constants/index.js";import{isString as d,trim as s,isEmpty as a,isEqual as f,isFunction as c}from"lodash-es";import{defineTablePlugin as p}from"../../hooks/useTablePlugin.js";function m(){const m="keyboardEventPlugin",v=o("ihoTableClipData","");return p({name:m,apply(o){function p(t,o,p,m,E){var b,C;if(!(null==(b=null==p?void 0:p.keyboardConfig)?void 0:b.isClip))return;if("paste"===t&&!o.getSelectedCell())return;const{row:y,column:x}=o.getSelectedCell()||o.getEditRecord()||{};if(!y||!x||!g(x,u.SELECT)&&e(v)===y[x.field])return;const R=p.uuid&&g(x,u.SELECT)&&n.get(p.uuid)[x.field],T=y[x.field];if("copy"===t){const e=(null==(C=(R||[]).filter((e=>T.includes(e.value))))?void 0:C.map((e=>e.label)).join(","))||T;v.value=e}else{if(d(e(v))&&(v.value=s(e(v)||"")),!e(v)||!function(e){var t;const o=null==(t=e.editRender)?void 0:t.props;return o&&Object.keys(u).includes(r.getCellType(o))}(x)||y.$__SEPARATE||!function(e,t,o,n){var l,i;const{beforeEditMethod:r}=t.editConfig||{},u={rowIndex:null!=(l=e.getRowIndex(o))?l:0,columnIndex:null!=(i=e.getColumnIndex(n))?i:0};return!r||c(r)&&r({row:o,column:n,...u,$table:e,$grid:void 0})}(o,p,y,x))return;if(g(x,u.DATE)&&l(x,y,v))return;if(g(x,u.NUMBER)&&!/^-?\d*\.?\d+$/.test((e(v)||"").toString()))return;if(g(x,u.TIME)&&i(x,v))return;let t=e(v)||"";if(R&&!a(R)){const e=R.filter((e=>t.split(",").includes(e.label))).map((e=>e.value));if(a(e))return;if(function(e){var t,o;const n=null==(t=e.editRender)?void 0:t.props;return g(e,u.SELECT)&&(null==(o=n.componentProps)?void 0:o.multiple)}(x)){if(f(T,e))return;t=e}else{if(e.includes(T))return;t=e[0]}}y[x.field]=t,m("formChange",{column:x,row:y,oldValue:T,value:t,index:o.getRowIndex(y)}),g(x,u.SEPARATE)&&(null==E||E())}}function g(e,t){var o;const n=null==(o=e.editRender)?void 0:o.props;return n&&r.getCellType(n)===t}o.eventHooks.onCopy.tap(m,(({$table:e},t,{emits:o})=>p("copy",e,t,o))),o.eventHooks.onPaste.tap(m,(({$table:e},t,{emits:o,updateTableDataRef:n})=>p("paste",e,t,o,n))),o.eventHooks.onKeydown.tap(m,(async({$event:e,$table:o},n,{emits:l})=>{await t(0);const{row:i,column:r}=o.getSelectedCell()||o.getEditRecord()||{};if(!i||!r)return;l("keyboard",{$table:o,key:e.key,index:o.getRowIndex(i),value:i[r.field],row:i,column:r})}))}})}export{m as keyboardEventPlugin};
@@ -1 +1 @@
1
- import{createVNode as e,mergeProps as t}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as n,IhoTableRenderHelper as o}from"../../../../utils/index.js";import i from"./editDate.vue.js";import{defineTablePlugin as d}from"../../../../hooks/useTablePlugin.js";function a(){return d({name:"dateRendererPlugin",vxe(d){d.interceptor.add("event.clearActived",n(r.DATE,(e=>e.classList.contains("n-date-panel")))),d.renderer.add(r.DATE,{renderCell:o.createDefaultRenderCell(),renderEdit:o.createRenderEdit((({fieldItem:r,emitFormClick:n,row:o,column:d,$rowIndex:a})=>[e(i,t({value:o[d.field],"onUpdate:value":e=>o[d.field]=e,isStartDate:r.isStartDate,isEndDate:r.isEndDate,connectField:r.connectField,valueFormat:r.valueFormat},r.componentProps,{column:d,row:o,"row-index":a,onClick:n}),null)]))})}})}export{a as dateRendererPlugin};
1
+ import{createVNode as e,mergeProps as o}from"vue";import{format as t}from"date-fns";import{isFunction as n}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r}from"../../../../constants/index.js";import{createIhoTableClearActivedInterceptor as i,IhoTableRenderHelper as d,isInvalidDate as l,getLowCodeFieldFromField as a}from"../../../../utils/index.js";import m from"./editDate.vue.js";import{defineTablePlugin as s}from"../../../../hooks/useTablePlugin.js";function u(){const u="dateRendererPlugin";return s({name:u,vxe(t){t.interceptor.add("event.clearActived",i(r.DATE,(e=>e.classList.contains("n-date-panel")))),t.renderer.add(r.DATE,{renderCell:d.createDefaultRenderCell(),renderEdit:d.createRenderEdit((({fieldItem:t,emitFormClick:n,row:r,column:i,$rowIndex:d})=>[e(m,o({value:r[i.field],"onUpdate:value":e=>r[i.field]=e,isStartDate:t.isStartDate,isEndDate:t.isEndDate,connectField:t.connectField,valueFormat:t.valueFormat},t.componentProps,{column:i,row:r,"row-index":d,onClick:n}),null)]))})},apply(e){e.eventHooks.onCellDblclick.tap(u,(({row:e,column:o,columnIndex:i,rowIndex:d},m,{$table:s})=>{var u,c,f,p;if((null==(u=o.editRender)?void 0:u.name)!==r.DATE||e[o.field])return;if(n(null==(c=m.editConfig)?void 0:c.beforeEditMethod)){if(!(null==(f=m.editConfig)?void 0:f.beforeEditMethod({row:e,column:o,columnIndex:i,rowIndex:d,$table:s,$grid:s})))return}const v=new Date;l(o,e,v)||(e[o.field]=t(v,(null==(p=a(o))?void 0:p.valueFormat)||"yyyy-MM-dd HH:mm:ss"))}))}})}export{u as dateRendererPlugin};
@@ -1 +1 @@
1
- import{createVNode as e,mergeProps as o}from"vue";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as t}from"../../../../constants/index.js";import{useAutoFocus as r}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as n,IhoTableRenderHelper as i}from"../../../../utils/index.js";import d from"./editTime.vue.js";import{defineTablePlugin as l}from"../../../../hooks/useTablePlugin.js";function m(){const m="timeRendererPlugin";return l({name:m,vxe(r){r.interceptor.add("event.clearActived",n(t.TIME,(e=>e.classList.contains("n-popover")))),r.renderer.add(t.TIME,{renderCell:i.createDefaultRenderCell(),renderEdit:i.createRenderEdit((({fieldItem:t,emitFormClick:r,row:n,column:i,$rowIndex:l})=>[e(d,o({formattedValue:n[i.field],"onUpdate:formattedValue":e=>n[i.field]=e,column:i,row:n,"row-index":l,valueFormat:t.valueFormat},t.componentProps,{onClick:r}),null)]))})},apply(e){r(e).bindAutoFocusConfig(m,t.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)})}})}export{m as timeRendererPlugin};
1
+ import{createVNode as e,mergeProps as o}from"vue";import{format as t}from"date-fns";import{isFunction as r}from"lodash-es";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as n}from"../../../../constants/index.js";import{useAutoFocus as i}from"../hooks/useAutoFocus.js";import{createIhoTableClearActivedInterceptor as l,IhoTableRenderHelper as d,getLowCodeFieldFromField as m,isInvalidTime as u}from"../../../../utils/index.js";import a from"./editTime.vue.js";import{defineTablePlugin as f}from"../../../../hooks/useTablePlugin.js";function s(){const s="timeRendererPlugin";return f({name:s,vxe(t){t.interceptor.add("event.clearActived",l(n.TIME,(e=>e.classList.contains("n-popover")))),t.renderer.add(n.TIME,{renderCell:d.createDefaultRenderCell(),renderEdit:d.createRenderEdit((({fieldItem:t,emitFormClick:r,row:n,column:i,$rowIndex:l})=>[e(a,o({formattedValue:n[i.field],"onUpdate:formattedValue":e=>n[i.field]=e,column:i,row:n,"row-index":l,valueFormat:t.valueFormat},t.componentProps,{onClick:r}),null)]))})},apply(e){i(e).bindAutoFocusConfig(s,n.TIME,".n-input__input-el",{after:e=>(Reflect.set(e.editRender,"autoselect",!0),e)}),e.eventHooks.onCellDblclick.tap(s,(({row:e,column:o,columnIndex:i,rowIndex:l},d,{$table:a})=>{var f,s,c,p;if((null==(f=o.editRender)?void 0:f.name)!==n.TIME||e[o.field])return;if(r(null==(s=d.editConfig)?void 0:s.beforeEditMethod)){if(!(null==(c=d.editConfig)?void 0:c.beforeEditMethod({row:e,column:o,columnIndex:i,rowIndex:l,$table:a,$grid:a})))return}const v=t(new Date,(null==(p=m(o))?void 0:p.valueFormat)||"HH:mm");u(o,v)||(e[o.field]=v)}))}})}export{s as timeRendererPlugin};
@@ -95,7 +95,7 @@ export declare namespace IhoTableLowCodeField {
95
95
  }
96
96
  export declare type LowCodeTableFieldItem = {
97
97
  columnName: string;
98
- [K: string]: unknown;
98
+ [K: string]: any;
99
99
  } & Partial<{
100
100
  id: number | string;
101
101
  alias: string;
@@ -55,3 +55,5 @@ export declare function parseRichContent(richContent: string): any;
55
55
  export declare function parseMergeField(row: AnyObject, column: VxeTableDefines.ColumnInfo): any;
56
56
  export declare function isCompatibleColumn(field: LowCodeTableFieldItem): number | false;
57
57
  export declare function getTitle(column: VxeTableDefines.ColumnInfo, value?: string): string;
58
+ export declare function isInvalidTime(column: VxeTableDefines.ColumnInfo, newValue: MaybeRef<any>): boolean;
59
+ export declare function isInvalidDate(column: VxeTableDefines.ColumnInfo, row: AnyObject, newValue: MaybeRef<any>): any;
@@ -1 +1 @@
1
- import{reactive as e,inject as t,unref as n,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{isNumber as c,isFunction as s,isString as d,isObject as f,isArray as p}from"lodash-es";import{InjectionIhoTableConfig as m,InjectionIhoTableEmits as v,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as g,IHO_TABLE_TREE_TYPE as h,InjectionIhoTableUUID as E}from"../constants/index.js";import{getSeparateInfo as T}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function w(e){return console.warn(`[IhoTable]: ${e}`)}const C=Object.freeze({getCellType(e){var t;return((null==(t=e.settingObj)?void 0:t.attr)||e.formType||"DEFAULT").toUpperCase()}});function R(){var e,n,r;const o=t(m);return o||w("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(n=null==(e=null==o?void 0:o.value)?void 0:e.rowConfig)?void 0:n.height)?r:32}function S(e){const t=e.slice(2);return`${t[0].toLowerCase()}${t.slice(1)}`}function O(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function P(t,n=!0){const r=n?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||t()).get(e)},setItemFromUUID:function(e,t){r.set(e,t)},removeItemFromUUID:function(e){r.delete(e)}}}async function F(e,t,r,o){const i=u();return c(i)||await a(0),u()||function(){const t=+e.colWidth;return c(t)?t:64}();function u(){var i;const u=null==(i=n(o))?void 0:i.getColumnByField(e.field);if(!u)return;const l=$(u);return l?s(l.separateWidth)?l.separateWidth({column:u,row:t,rowIndex:r,$table:n(o)}):c(l.separateWidth)?l.separateWidth:u.renderWidth:u.renderWidth}}function A(e){const o=t(v);function i(){var t;const r=n(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(t=r.column.editRender)?void 0:t.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function u(e={}){o("formChange",{...i(),...r(e)})}function l(e={}){o("formClick",{...i(),...r(e)})}return{emitFormChange:function(){u()},emitFormClick:function(){l()},emitFormChangeWithParams:u,emitFormClickWithParams:l}}function $(e){var t;return null==(t=e.editRender)?void 0:t.props}const b=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:n,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(n[r.field]);const i=t(E),u=T(i,n);if(!u)return c(n[r.field]);const{originalData:l=n,isLastRow:a}=u;return c(a?l[r.field]:null);function c(e){return[o("span",{title:_(r,e)},[e])]}}},createRenderEdit:function(e){return function({props:t},n){return e({...n,fieldItem:t||{},...A(n)})}},isEditableColumn(e,t){var n;return!1!==(null==(n=e.editConfig)?void 0:n.showIcon)&&t.editRender&&!1!==t.editRender.enabled},hasFilter(e){if(y(e))return!0;let t=e.fieldSetting;return d(t)&&(t=i(t||"")),f(t)&&((n=t).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(r=n.mapping)?void 0:r.type));var n,r},hasDateFiler(e){var t;return null==(t=null==e?void 0:e.filterSetting)?void 0:t.daterange}}),x=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}),N=(e,t)=>({$event:n,column:r})=>{var o;if(!u(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==n?void 0:n.target;return!f(i)||!l(i,t)};function V(e){return[h.TRANSFORM_WITH_SPAN_METHOD,h.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function W(e){return d(e)&&!!e.match(/^###\{[^{}]+}$/)}function D(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function U(e,t){if(e.$__SEPARATE||!t.editRender||!t.editRender.props)return e[t.field];const{fieldSetting:n}=t.editRender.props;if(!d(n))return e[t.field];const{mergedFeildExpression:r}=i(n);return r&&d(r)?r.replace(/#{(.+?)}/g,(function(t,n){let r=n?e[n.trim()]:null;W(r)&&(r=D(r).change_text);return r||(null==r?"--":r)})):e[t.field]}const j=["SEARCH","SELECT","RADIO","CHECKBOX"];function y(e){return e.notParticipatingSearch===g.NEGATIVE&&j.includes(C.getCellType(e))&&p(e.options)&&e.options.length}function _(e,t=""){return"tooltip"===e.showOverflow?"":t}export{b as IhoTableRenderHelper,x as IhoTableStatusHelper,C as IhoTableUtils,w as IhoTableWarn,N as createIhoTableClearActivedInterceptor,S as eventListener2EventName,O as eventName2EventListener,F as getColumnRenderWidth,$ as getLowCodeFieldFromField,R as getRowHeight,_ as getTitle,y as isCompatibleColumn,W as isRichContent,V as isTransformTreeType,U as parseMergeField,D as parseRichContent,A as useIhoTableFormEvent,P as useUUIDMap};
1
+ import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as o}from"vue";import{jsonParse as i,arrayed as l,findAncestor as u}from"../../../../shared/utils/index.js";import{promiseTimeout as a}from"@vueuse/shared";import{parse as c,isValid as d,compareDesc as s}from"date-fns";import{isNumber as f,isFunction as p,isString as m,isObject as v,isArray as I}from"lodash-es";import{InjectionIhoTableConfig as g,InjectionIhoTableEmits as h,IHO_TABLE_STRING_STATUS as E,IHO_TABLE_NUMBER_STATUS as w,IHO_TABLE_TREE_TYPE as T,InjectionIhoTableUUID as R}from"../constants/index.js";import{getSeparateInfo as S}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function C(e){return console.warn(`[IhoTable]: ${e}`)}const F=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function D(){var e,t,r;const o=n(g);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 O(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function P(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function A(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 $(e,n,r,o){const i=l();return f(i)||await a(0),l()||function(){const n=+e.colWidth;return f(n)?n:64}();function l(){var i;const l=null==(i=t(o))?void 0:i.getColumnByField(e.field);if(!l)return;const u=x(l);return u?p(u.separateWidth)?u.separateWidth({column:l,row:n,rowIndex:r,$table:t(o)}):f(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}}function b(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 N=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(R),l=S(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:G(r,e)},[e])]}}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...b(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(M(e))return!0;let n=e.fieldSetting;return m(n)&&(n=i(n||"")),v(n)&&((t=n).notParticipatingSearch!==E.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}}),V=Object.freeze({isPositive:e=>e===w.POSITIVE||e===E.POSITIVE,isNegative:e=>e===w.NEGATIVE||e===E.NEGATIVE,notPositive:e=>e!==w.POSITIVE&&e!==E.POSITIVE,notNegative:e=>e!==w.NEGATIVE&&e!==E.NEGATIVE}),W=(e,n)=>({$event:t,column:r})=>{var o;if(!l(e).includes(null==(o=r.editRender)?void 0:o.name))return!0;const i=null==t?void 0:t.target;return!v(i)||!u(i,n)};function U(e){return[T.TRANSFORM_WITH_SPAN_METHOD,T.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function j(e){return m(e)&&!!e.match(/^###\{[^{}]+}$/)}function y(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(!m(t))return e[n.field];const{mergedFeildExpression:r}=i(t);return r&&m(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;j(r)&&(r=y(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const H=["SEARCH","SELECT","RADIO","CHECKBOX"];function M(e){return e.notParticipatingSearch===w.NEGATIVE&&H.includes(F.getCellType(e))&&I(e.options)&&e.options.length}function G(e,n=""){return"tooltip"===e.showOverflow?"":n}function L(e,n){var r,o,i;n=t(n)||"";const l=null!=(o=null==(r=e.editRender)?void 0:r.props)?o:{},u=c(n,(null==(i=null==l?void 0:l.componentProps)?void 0:i.valueFormat)||"HH:mm",new Date);return!d(u)}function k(e,n,r){var o,i;const l=null!=(i=null==(o=e.editRender)?void 0:o.props)?i:{};return r=t(r)||"",!d(new Date(r))||m(l.connectField)&&n[l.connectField]&&(l.isStartDate&&s(new Date(r),new Date(n[l.connectField]))<0||l.isEndDate&&s(new Date(r),new Date(n[l.connectField]))>0)}export{N as IhoTableRenderHelper,V as IhoTableStatusHelper,F as IhoTableUtils,C as IhoTableWarn,W as createIhoTableClearActivedInterceptor,O as eventListener2EventName,P as eventName2EventListener,$ as getColumnRenderWidth,x as getLowCodeFieldFromField,D as getRowHeight,G as getTitle,M as isCompatibleColumn,k as isInvalidDate,L as isInvalidTime,j as isRichContent,U as isTransformTreeType,_ as parseMergeField,y as parseRichContent,b as useIhoTableFormEvent,A as useUUIDMap};
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.1.52-beta.16",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.52-beta.16",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.1.52-beta.18",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.52-beta.18",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.1.52-beta.16",
3
+ "version": "3.1.52-beta.18",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -63,5 +63,5 @@
63
63
  "iOS 7",
64
64
  "last 3 iOS versions"
65
65
  ],
66
- "gitHead": "0f23c5f0bfb4e023d68045363faf3bcea4dd82f6"
66
+ "gitHead": "53c43e392e64b840485904a2a582e6bc2b6af9fd"
67
67
  }