cnhis-design-vue 3.1.48-release.6 → 3.1.48

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 r}from"../useDraw.js";import{useGrid as s}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 g,deleteProperty as v}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function L(L,w,S,Y,E,M,$,O,P,A){s(L,w);const{getEqualXTypes:I,handleAddPrevent:T}=y(L,S,w),{createShadowLines:C}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:W,vitalSignsOriginY:q,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=w,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&&L.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=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=n[i],u=o[s],c=n[i-1],p=n[i+1],d=o[s-1],f=o[s+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&&r.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const g=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===g)));const v=()=>{const t=[...l,...r.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};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))),v()}}else p?(l.push(p),v()):f?(r.push(f),v()):v()})),e}(),{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...C(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...n,...s}),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].push(t):e[i]=[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()],{...s,originX:"center"});e.push(n),Q.add(n)}))}L.value.add(...e)}Q.add(l),L.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 r={left:t.left,top:t.top,...n,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),"humai"===e&&(s="circle"),l.push(o(s,{...i[e]||{},...r}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function re(e,t,s){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:g={},reduceStyle:v={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:j=[]}=s,{type:Y,textStyle:M}=b,O=[],A=[],I=[];null==(u=e.list)||u.forEach(((u,b)=>{const T=a(c)?j.find((e=>e.key===u.key)):e,C=ue(u,s),R={};R.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=q.originY+z?e[1]+z:e[1]-z,r=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return I.push(r),{obj:r,top:-z}}(C,u,T),function(e,t,s,a,u){var d,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:m={}}=s,{value:x}=a;let b,j,L,w,S,Y;if(t.noRise&&h.show){const t=k(h)?E(u.type,u.list,35):e[1];if(h.text)L=l([e[0],k(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),I.push(L);else{const i=t+2*z;w=r([e[0],t,i],h.style||{}),I.push(w)}}t.rise&&f.show&&f.text&&(S=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),I.push(S));t.verified&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),I.push(Y));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,u.list,null!=(d=t.physicsReduce)?d:t.drugReduce);b=i([...e,e[0],l],{...m,...v.line,...n}),j=o((null==(y=null==v?void 0:v.point)?void 0:y.type)||"circle",{left:e[0],top:l,...v.point,...n,originY:l===N?"bottom":"center"}),b&&I.push(b),j&&I.push(j)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:L,top:5,isFixed:k(h)},arrowGroup:{obj:w,top:2*z,isFixed:k(h)},riseText:{obj:S,top:(x?-z:0)-5},verifiedText:{obj:Y,top:(x?-z:0)-5},reducePoint:{obj:j,type:"reduce"}})}(C,u,T,R,s),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;let o,a;const{upArrowShow:u=!1,limitValueShow:p=!1}=i;if(u&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<q.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),o=r([e[0],i[0],i[1]],m,"up"),I.push(o)}if(p){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...s.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],i),I.push(a)}+t.value<Math.min(...s.list)&&(a=l([e[0],e[1]-z],i),I.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(C,u,T,R),function(n,l,r,a,u){let p,f;const{pointAttr:h={},lineAttr:g={},title:v="",key:m,type:x="circle"}=a,b=e.list[r+1],j=ue(b,s),k=se(c,e.list[r].value),E=j&&se(c,b.value);!n||!j||l.breakpoint||k||E||n[0]===j[0]||(f=i([...n,...j],{...g}));const I=l.pacemakerShow&&"pulse"==c?y.value:k&&"number"===Y?0:x,T=A[r-1],C={origin:{data:l,title:v,key:m||"",unit:s.unit,type:c,_type:d(v,c),dataIndex:t,index:r},leftLine:T,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...w.event.hovered?w.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:w.event,...k?{selectable:!1,evented:!1,..."number"===Y?M:{}}:{}};if(T){const e=T.get("y2");p=o(I,{left:T.get("x2"),top:k?e-5:e,...C})}else n&&(C.leftLine=null,p=o(I,{left:n[0],top:k?n[1]-5:n[1],...C}));A.push(f),p&&(v.includes("脉搏")?ee.add(p):te.add(p),function(e){W.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:q;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}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==i||i.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),W.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}};L.value.discardActiveObject(),S("change",n),pe(n,"change")}}))}(p),O.push(p),ie.add(p))}(C,u,b,T,R)})),"pulse"===c&&U.forEach((e=>{Z.set(e,O.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(O).then((e=>{const t=A.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(I).then((i=>{L.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&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(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:r,physicsReduce:s}=l||{},a="hover"===t?l.value:$(o,e.top);if(p(r))return`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;if(p(s))return`物理降${"pain"==o?"痛":"温"} ${a}—>${s}${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:q;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)?(T("exceedMin"),!1):!(l>o)||(T("exceedMax"),!1)}function pe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=ne.find((e=>e.type===i));if("add"===t){const e=a(i)?s.dataList.find((e=>e.enable)):s.dataList[n],t=g(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;de()}function de(){var e;ie.size&&(null==(e=L.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||re(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,V,t],e.positionLine);L.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||re(t,i,e)}))})),oe(),le(),w.event.evented&&L.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=V&&n>=_&&n<=G){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=["新增节点"],H.forEach((t=>{if(!I([...ie],i,"_type").includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:q;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&&T("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,r=v(i,[...x,...b]);r[`${e.type}`]=e.value,a(n)&&(r.key=t.origin.key);const s={...t.origin,data:r};S("change",s),pe(s,"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 k(e){return"fixed"===e.position}export{L as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as n,defaultStyle as i,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}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 g,deleteProperty as v}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function L(L,k,S,Y,E,M,$,O,P,A){s(L,k);const{getEqualXTypes:C,handleAddPrevent:I}=y(L,S,k),{createShadowLines:T}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:W,vitalSignsOriginY:q,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ne=new Set,ie=m(R.yScaleValue);function oe(t){var o;const l=ie.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Q.size&&L.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:n}=t.origin||{};if("pulse"===e){const e=Z.get(n),i=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(i,1,[t.left,t.top])}}const o=function(){const e=[],t=[],n=[];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&&n.push(e[0])}));const[i,o]=t;let l=[],r=[];return n.forEach((t=>{const n=i.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=i[n],u=o[s],c=i[n-1],p=i[n+1],d=o[s-1],f=o[s+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&&r.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const g=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===g)));const v=()=>{const t=[...l,...r.reverse()],[n]=t,i=t.at(-1);n[0]===i[0]&&n[1]===i[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};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))),v()}}else p?(l.push(p),v()):f?(r.push(f),v()):v()})),e}(),{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...T(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...i,...s}),Q.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const n=Math.trunc(t[0]);return e[n]=e[n]?e[n].concat(t):[t],e}),{}),n=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return n}(t);i.forEach((t=>{const i=n([...t.flat()],{...s,originX:"center"});e.push(i),Q.add(i)}))}L.value.add(...e)}Q.add(l),L.value.add(l)}))}}function le(){var e;const t=ie.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 n=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 r={left:t.left,top:t.top,...i,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),"humai"===e&&(s="circle"),l.push(o(s,{...n[e]||{},...r}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,s){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:g={},reduceStyle:v={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:j=[]}=s,{type:Y,textStyle:M,showConnectLine:O=!1}=b,A=[],C=[],I=[];null==(u=e.list)||u.forEach(((u,b)=>{const T=a(c)?j.find((e=>e.key===u.key)):e,R=ue(u,s),X={};X.value=function(e,t,n){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:i={}}=n,o=e[1]<=q.originY+z?e[1]+z:e[1]-z,r=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:i.stroke||"#000"});return I.push(r),{obj:r,top:-z}}(R,u,T),function(e,t,s,a,u){var d,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:m={}}=s,{value:x}=a;let b,j,L,k,S,Y;if(t.noRise&&h.show){const t=w(h)?E(u.type,u.list,35):e[1];if(h.text)L=l([e[0],w(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),I.push(L);else{const n=t+2*z;k=r([e[0],t,n],h.style||{}),I.push(k)}}t.rise&&f.show&&f.text&&(S=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),I.push(S));t.verified&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),I.push(Y));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,u.list,null!=(d=t.physicsReduce)?d:t.drugReduce);b=n([...e,e[0],l],{...m,...v.line,...i}),j=o((null==(y=null==v?void 0:v.point)?void 0:y.type)||"circle",{left:e[0],top:l,...v.point,...i,originY:l===N?"bottom":"center"}),b&&I.push(b),j&&I.push(j)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:L,top:5,isFixed:w(h)},arrowGroup:{obj:k,top:2*z,isFixed:w(h)},riseText:{obj:S,top:(x?-z:0)-5},verifiedText:{obj:Y,top:(x?-z:0)-5},reducePoint:{obj:j,type:"reduce"}})}(R,u,T,X,s),function(e,t,n,i){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;let o,a;const{upArrowShow:u=!1,limitValueShow:p=!1}=n;if(u&&+t.value>180){let t=e[1]-2.5*z,n=[e[1]-z/2,t];t<q.originY&&(t=e[1]+2.5*z,n=[t,e[1]+z/2]),o=r([e[0],n[0],n[1]],m,"up"),I.push(o)}if(p){const n={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...s.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],n),I.push(a)}+t.value<Math.min(...s.list)&&(a=l([e[0],e[1]-z],n),I.push(a))}Object.assign(i,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(R,u,T,X),function(i,l,r,a,u){let p,f;const{pointAttr:h={},lineAttr:g={},title:v="",key:m,type:x="circle"}=a,b=e.list[r+1],j=ue(b,s),w=se(c,e.list[r].value),E=j&&se(c,b.value);i&&j&&!l.breakpoint&&(!w&&!E||O)&&i[0]!==j[0]&&(f=n([...i,...j],{...g}));const I=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===Y?0:x,T=C[r-1],R={origin:{data:l,title:v,key:m||"",unit:s.unit,type:c,_type:d(v,c),dataIndex:t,index:r},leftLine:T,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,...w?{selectable:!1,evented:!1,..."number"===Y?M:{}}:{}};if(T){const e=T.get("y2");p=o(I,{left:T.get("x2"),top:w?e-5:e,...R})}else i&&(R.leftLine=null,p=o(I,{left:i[0],top:w?i[1]-5:i[1],...R}));C.push(f),p&&(v.includes("脉搏")?ee.add(p):te.add(p),function(e){W.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:q;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:n,type:i="",top:o=0,isFixed:l}=t||{};"reduce"!==i&&("line"===i?null==n||n.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==n||n.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),W.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,n=$(t,e.top),i={...e.origin,data:{...e.origin.data,value:n}};L.value.discardActiveObject(),S("change",i),pe(i,"change")}}))}(p),A.push(p),ne.add(p))}(R,u,b,T,X)})),"pulse"===c&&U.forEach((e=>{Z.set(e,A.filter((t=>{var n;return(null==(n=t.origin)?void 0:n.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(A).then((e=>{const t=C.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),Promise.all(I).then((n=>{L.value.add(...t,...e,...n),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&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:n,unit:i,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:r,physicsReduce:s}=l||{},a="hover"===t?l.value:$(o,e.top);if(p(r))return`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${i||""}`;if(p(s))return`物理降${"pain"==o?"痛":"温"} ${a}—>${s}${i||""}`;return`${n} ${a}${i||""}`}(),`时间 ${((null==l?void 0:l.time)||M(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const n="pain"===t.type?B:q;if(f(e)&&function(e){const[t]=X,n=X.at(-1),i=t.start,o=n.end,l=h(e);return l>=i&&l<=o}(e.time)){const i=Y(e.time),o=E(t.type,t.list,e.value);return[i,o<n.originY?n.originY:o>n.endY?n.endY:o]}}function ce(e){const t=new Date,n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${n}-${i} 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:n,dataIndex:i,index:o,data:l,key:r}=e,s=ie.find((e=>e.type===n));if("add"===t){const e=a(n)?s.dataList.find((e=>e.enable)):s.dataList[i],t=g(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[i].list[o]=l;de()}function de(){var e;ne.size&&(null==(e=L.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}([...ne]))),Z.clear(),ne.clear(),ee.clear(),te.clear(),ie.forEach((e=>{e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ie.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),i=n([D,t,V,t],e.positionLine);L.value.add(i)}(e),e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le(),k.event.evented&&L.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:n=0,y:i=0}=e.pointer||{};if(n>=D&&n<=V&&i>=_&&i<=G){A.point={x:n,y:i},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=["新增节点"],H.forEach((t=>{if(!C([...ne],n,"_type").includes(t.bigType)){const n=["pain"].includes(t.bigType)?B:q;i>=n.originY&&i<=n.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(n);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:n,type:i,dataIndex:o,index:l}=t.origin,r=v(n,[...x,...b]);r[`${e.type}`]=e.value,a(i)&&(r.key=t.origin.key);const s={...t.origin,data:r};S("change",s),pe(s,"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:ne}}function w(e){return"fixed"===e.position}export{L as useCenter};
@@ -174,6 +174,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
174
174
  })[] | undefined;
175
175
  } | undefined;
176
176
  suffixConfig?: any | any[] | undefined;
177
+ prefixConfig?: any | any[] | undefined;
177
178
  autograph?: string | undefined;
178
179
  defined_error_msg?: string | undefined;
179
180
  extendKey?: string | undefined;
@@ -199,6 +200,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
199
200
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
200
201
  is_allow_check_mid?: import("..").FormCommonState | undefined;
201
202
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
203
+ prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
204
+ suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
202
205
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
203
206
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
204
207
  lazyRequest?: boolean | undefined;
@@ -1898,6 +1901,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1898
1901
  })[] | undefined;
1899
1902
  } | undefined;
1900
1903
  suffixConfig?: any | any[] | undefined;
1904
+ prefixConfig?: any | any[] | undefined;
1901
1905
  autograph?: string | undefined;
1902
1906
  defined_error_msg?: string | undefined;
1903
1907
  extendKey?: string | undefined;
@@ -1923,6 +1927,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1923
1927
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
1924
1928
  is_allow_check_mid?: import("..").FormCommonState | undefined;
1925
1929
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
1930
+ prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
1931
+ suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
1926
1932
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
1927
1933
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
1928
1934
  lazyRequest?: boolean | undefined;
@@ -3631,6 +3637,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
3631
3637
  })[] | undefined;
3632
3638
  } | undefined;
3633
3639
  suffixConfig?: any | any[] | undefined;
3640
+ prefixConfig?: any | any[] | undefined;
3634
3641
  autograph?: string | undefined;
3635
3642
  defined_error_msg?: string | undefined;
3636
3643
  extendKey?: string | undefined;
@@ -3656,6 +3663,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
3656
3663
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
3657
3664
  is_allow_check_mid?: import("..").FormCommonState | undefined;
3658
3665
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
3666
+ prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
3667
+ suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
3659
3668
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
3660
3669
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
3661
3670
  lazyRequest?: boolean | undefined;
@@ -5355,6 +5364,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
5355
5364
  })[] | undefined;
5356
5365
  } | undefined;
5357
5366
  suffixConfig?: any | any[] | undefined;
5367
+ prefixConfig?: any | any[] | undefined;
5358
5368
  autograph?: string | undefined;
5359
5369
  defined_error_msg?: string | undefined;
5360
5370
  extendKey?: string | undefined;
@@ -5380,6 +5390,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
5380
5390
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
5381
5391
  is_allow_check_mid?: import("..").FormCommonState | undefined;
5382
5392
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
5393
+ prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
5394
+ suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
5383
5395
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
5384
5396
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
5385
5397
  lazyRequest?: boolean | undefined;
@@ -8055,6 +8067,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
8055
8067
  })[] | undefined;
8056
8068
  } | undefined;
8057
8069
  suffixConfig?: any | any[] | undefined;
8070
+ prefixConfig?: any | any[] | undefined;
8058
8071
  autograph?: string | undefined;
8059
8072
  defined_error_msg?: string | undefined;
8060
8073
  extendKey?: string | undefined;
@@ -8080,6 +8093,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
8080
8093
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
8081
8094
  is_allow_check_mid?: import("..").FormCommonState | undefined;
8082
8095
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
8096
+ prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
8097
+ suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
8083
8098
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
8084
8099
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
8085
8100
  lazyRequest?: boolean | undefined;
@@ -9790,6 +9805,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
9790
9805
  })[] | undefined;
9791
9806
  } | undefined;
9792
9807
  suffixConfig?: any | any[] | undefined;
9808
+ prefixConfig?: any | any[] | undefined;
9793
9809
  autograph?: string | undefined;
9794
9810
  defined_error_msg?: string | undefined;
9795
9811
  extendKey?: string | undefined;
@@ -9815,6 +9831,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
9815
9831
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
9816
9832
  is_allow_check_mid?: import("..").FormCommonState | undefined;
9817
9833
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
9834
+ prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
9835
+ suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
9818
9836
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
9819
9837
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
9820
9838
  lazyRequest?: boolean | undefined;
@@ -11498,6 +11516,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
11498
11516
  })[] | undefined;
11499
11517
  } | undefined;
11500
11518
  suffixConfig?: any | any[] | undefined;
11519
+ prefixConfig?: any | any[] | undefined;
11501
11520
  autograph?: string | undefined;
11502
11521
  defined_error_msg?: string | undefined;
11503
11522
  extendKey?: string | undefined;
@@ -11523,6 +11542,8 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
11523
11542
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
11524
11543
  is_allow_check_mid?: import("..").FormCommonState | undefined;
11525
11544
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
11545
+ prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
11546
+ suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
11526
11547
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
11527
11548
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
11528
11549
  lazyRequest?: boolean | undefined;
@@ -176,6 +176,7 @@ declare const _default: import("vue").DefineComponent<{
176
176
  })[] | undefined;
177
177
  } | undefined;
178
178
  suffixConfig?: any | any[] | undefined;
179
+ prefixConfig?: any | any[] | undefined;
179
180
  autograph?: string | undefined;
180
181
  defined_error_msg?: string | undefined;
181
182
  extendKey?: string | undefined;
@@ -201,6 +202,8 @@ declare const _default: import("vue").DefineComponent<{
201
202
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
202
203
  is_allow_check_mid?: import("../../../../es/components/form-render").FormCommonState | undefined;
203
204
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
205
+ prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
206
+ suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
204
207
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
205
208
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
206
209
  lazyRequest?: boolean | undefined;
@@ -1900,6 +1903,7 @@ declare const _default: import("vue").DefineComponent<{
1900
1903
  })[] | undefined;
1901
1904
  } | undefined;
1902
1905
  suffixConfig?: any | any[] | undefined;
1906
+ prefixConfig?: any | any[] | undefined;
1903
1907
  autograph?: string | undefined;
1904
1908
  defined_error_msg?: string | undefined;
1905
1909
  extendKey?: string | undefined;
@@ -1925,6 +1929,8 @@ declare const _default: import("vue").DefineComponent<{
1925
1929
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
1926
1930
  is_allow_check_mid?: import("../../../../es/components/form-render").FormCommonState | undefined;
1927
1931
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
1932
+ prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
1933
+ suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
1928
1934
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
1929
1935
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
1930
1936
  lazyRequest?: boolean | undefined;
@@ -3633,6 +3639,7 @@ declare const _default: import("vue").DefineComponent<{
3633
3639
  })[] | undefined;
3634
3640
  } | undefined;
3635
3641
  suffixConfig?: any | any[] | undefined;
3642
+ prefixConfig?: any | any[] | undefined;
3636
3643
  autograph?: string | undefined;
3637
3644
  defined_error_msg?: string | undefined;
3638
3645
  extendKey?: string | undefined;
@@ -3658,6 +3665,8 @@ declare const _default: import("vue").DefineComponent<{
3658
3665
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
3659
3666
  is_allow_check_mid?: import("../../../../es/components/form-render").FormCommonState | undefined;
3660
3667
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
3668
+ prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
3669
+ suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
3661
3670
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
3662
3671
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
3663
3672
  lazyRequest?: boolean | undefined;
@@ -5357,6 +5366,7 @@ declare const _default: import("vue").DefineComponent<{
5357
5366
  })[] | undefined;
5358
5367
  } | undefined;
5359
5368
  suffixConfig?: any | any[] | undefined;
5369
+ prefixConfig?: any | any[] | undefined;
5360
5370
  autograph?: string | undefined;
5361
5371
  defined_error_msg?: string | undefined;
5362
5372
  extendKey?: string | undefined;
@@ -5382,6 +5392,8 @@ declare const _default: import("vue").DefineComponent<{
5382
5392
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
5383
5393
  is_allow_check_mid?: import("../../../../es/components/form-render").FormCommonState | undefined;
5384
5394
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
5395
+ prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
5396
+ suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
5385
5397
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
5386
5398
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
5387
5399
  lazyRequest?: boolean | undefined;
@@ -8057,6 +8069,7 @@ declare const _default: import("vue").DefineComponent<{
8057
8069
  })[] | undefined;
8058
8070
  } | undefined;
8059
8071
  suffixConfig?: any | any[] | undefined;
8072
+ prefixConfig?: any | any[] | undefined;
8060
8073
  autograph?: string | undefined;
8061
8074
  defined_error_msg?: string | undefined;
8062
8075
  extendKey?: string | undefined;
@@ -8082,6 +8095,8 @@ declare const _default: import("vue").DefineComponent<{
8082
8095
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
8083
8096
  is_allow_check_mid?: import("../../../../es/components/form-render").FormCommonState | undefined;
8084
8097
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
8098
+ prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
8099
+ suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
8085
8100
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
8086
8101
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
8087
8102
  lazyRequest?: boolean | undefined;
@@ -9792,6 +9807,7 @@ declare const _default: import("vue").DefineComponent<{
9792
9807
  })[] | undefined;
9793
9808
  } | undefined;
9794
9809
  suffixConfig?: any | any[] | undefined;
9810
+ prefixConfig?: any | any[] | undefined;
9795
9811
  autograph?: string | undefined;
9796
9812
  defined_error_msg?: string | undefined;
9797
9813
  extendKey?: string | undefined;
@@ -9817,6 +9833,8 @@ declare const _default: import("vue").DefineComponent<{
9817
9833
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
9818
9834
  is_allow_check_mid?: import("../../../../es/components/form-render").FormCommonState | undefined;
9819
9835
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
9836
+ prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
9837
+ suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
9820
9838
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
9821
9839
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
9822
9840
  lazyRequest?: boolean | undefined;
@@ -11500,6 +11518,7 @@ declare const _default: import("vue").DefineComponent<{
11500
11518
  })[] | undefined;
11501
11519
  } | undefined;
11502
11520
  suffixConfig?: any | any[] | undefined;
11521
+ prefixConfig?: any | any[] | undefined;
11503
11522
  autograph?: string | undefined;
11504
11523
  defined_error_msg?: string | undefined;
11505
11524
  extendKey?: string | undefined;
@@ -11525,6 +11544,8 @@ declare const _default: import("vue").DefineComponent<{
11525
11544
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
11526
11545
  is_allow_check_mid?: import("../../../../es/components/form-render").FormCommonState | undefined;
11527
11546
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
11547
+ prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
11548
+ suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
11528
11549
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
11529
11550
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
11530
11551
  lazyRequest?: boolean | undefined;
@@ -129,6 +129,7 @@ declare const _default: import("vue").DefineComponent<{
129
129
  })[] | undefined;
130
130
  } | undefined;
131
131
  suffixConfig?: any | any[] | undefined;
132
+ prefixConfig?: any | any[] | undefined;
132
133
  autograph?: string | undefined;
133
134
  defined_error_msg?: string | undefined;
134
135
  extendKey?: string | undefined;
@@ -154,6 +155,8 @@ declare const _default: import("vue").DefineComponent<{
154
155
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
155
156
  is_allow_check_mid?: import("../../../../../es/components/form-render").FormCommonState | undefined;
156
157
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
158
+ prefix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
159
+ suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
157
160
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
158
161
  content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
159
162
  lazyRequest?: boolean | undefined;
@@ -1864,6 +1867,7 @@ declare const _default: import("vue").DefineComponent<{
1864
1867
  })[] | undefined;
1865
1868
  } | undefined;
1866
1869
  suffixConfig?: any | any[] | undefined;
1870
+ prefixConfig?: any | any[] | undefined;
1867
1871
  autograph?: string | undefined;
1868
1872
  defined_error_msg?: string | undefined;
1869
1873
  extendKey?: string | undefined;
@@ -1889,6 +1893,8 @@ declare const _default: import("vue").DefineComponent<{
1889
1893
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
1890
1894
  is_allow_check_mid?: import("../../../../../es/components/form-render").FormCommonState | undefined;
1891
1895
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
1896
+ prefix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
1897
+ suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
1892
1898
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
1893
1899
  content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
1894
1900
  lazyRequest?: boolean | undefined;
@@ -3572,6 +3578,7 @@ declare const _default: import("vue").DefineComponent<{
3572
3578
  })[] | undefined;
3573
3579
  } | undefined;
3574
3580
  suffixConfig?: any | any[] | undefined;
3581
+ prefixConfig?: any | any[] | undefined;
3575
3582
  autograph?: string | undefined;
3576
3583
  defined_error_msg?: string | undefined;
3577
3584
  extendKey?: string | undefined;
@@ -3597,6 +3604,8 @@ declare const _default: import("vue").DefineComponent<{
3597
3604
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
3598
3605
  is_allow_check_mid?: import("../../../../../es/components/form-render").FormCommonState | undefined;
3599
3606
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
3607
+ prefix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
3608
+ suffix?: string | import("../../../../../es/shared/types").AnyObject | (() => any) | undefined;
3600
3609
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
3601
3610
  content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
3602
3611
  lazyRequest?: boolean | undefined;
@@ -1 +1 @@
1
- import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as a,watch as i,onUnmounted as s,onMounted as c,withModifiers as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as v,noop as h}from"lodash-es";import"../../index.js";import{InjectionFormUUID as y,InjectionBusinessCollector as g}from"../constants/index.js";import{useFieldListAdaptor as b}from"./useFieldListAdaptor.js";import{createObjSchema as F}from"../utils/schema.js";const x=e(new Map);function S(e,t,r=0){x.set(e,x.get(e)||{});x.get(e)[t+""]=r}function j(e,t,r=!0){const n=x.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function O(e,t){const r=x.get(e);r&&Reflect.deleteProperty(r,t+"")}function $(e){x.delete(e)}const k=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const l=o(y),d=o(g),v=p(),x=o(l+"_virtualParent",""),$=`${x?x+".":""}${v.value.address}`;function k(e){return`${$}.${e}`}a(l+"_virtualParent",$);const{schemaAdaptor:E}=b(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1,showLabel:!!t.title},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=t((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),F(t)}));i(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var t;S(l,k(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const _=m();function w(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}s((()=>{var e;w().forEach((e=>{e&&e.setDisplay("none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{O(l,k(e.name))}))})),c((()=>{w().forEach((e=>{e&&e.setDisplay("visible")}))}));const I=u(h,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=I,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,t)=>e+j(l,k(t.name))),0))}},A),[r(f,{basePath:".",schema:P.value},null)]);var e}}});function E(e,l){d();const o=t((()=>e.options.some((e=>v(e.childrenFields)&&e.childrenFields.length))));function a(e,t,r="value"){if(v(e)?e.includes(t[r]):e===t[r])return v(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:i="label",childFieldStrategy:s,renderLabel:c=!0,attrs:u}){return[c?t[i]:null,o.value&&("all"===s||a(e,t,l))?r(k,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:s},u),null):null]},valueRef:l,hasComplexOption:o}}function K(){return{getSpan:j,setSpan:S,deleteSpan:O,clearSpan:$}}export{E as useComplexOptions,K as useComplexOptionsSpan};
1
+ import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as a,watch as i,onUnmounted as s,onMounted as c,withModifiers as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as v,noop as h}from"lodash-es";import"../../index.js";import{InjectionFormUUID as y,InjectionBusinessCollector as g}from"../constants/index.js";import{useFieldListAdaptor as b}from"./useFieldListAdaptor.js";import{createObjSchema as F}from"../utils/schema.js";const x=e(new Map);function S(e,t,r=0){x.set(e,x.get(e)||{});x.get(e)[t+""]=r}function j(e,t,r=!0){const n=x.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function O(e,t){const r=x.get(e);r&&Reflect.deleteProperty(r,t+"")}function $(e){x.delete(e)}const k=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const l=o(y),d=o(g),v=p(),x=o(l+"_virtualParent",""),$=`${x?x+".":""}${v.value.address}`;function k(e){return`${$}.${e}`}a(l+"_virtualParent",$);const{schemaAdaptor:E}=b(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=t((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),F(t)}));i(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var t;S(l,k(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const _=m();function I(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}s((()=>{var e;I().forEach((e=>{e&&e.setDisplay("none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{O(l,k(e.name))}))})),c((()=>{I().forEach((e=>{e&&e.setDisplay("visible")}))}));const w=u(h,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=w,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,t)=>e+j(l,k(t.name))),0))}},A),[r(f,{basePath:".",schema:P.value},null)]);var e}}});function E(e,l){d();const o=t((()=>e.options.some((e=>v(e.childrenFields)&&e.childrenFields.length))));function a(e,t,r="value"){if(v(e)?e.includes(t[r]):e===t[r])return v(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:i="label",childFieldStrategy:s,renderLabel:c=!0,attrs:u}){return[c?t[i]:null,o.value&&("all"===s||a(e,t,l))?r(k,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:s},u),null):null]},valueRef:l,hasComplexOption:o}}function K(){return{getSpan:j,setSpan:S,deleteSpan:O,clearSpan:$}}export{E as useComplexOptions,K as useComplexOptionsSpan};
@@ -1 +1 @@
1
- import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:x}=l(),_=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=x(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},f=e=>{var o;const t=_(e);e.urlConfig?d(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,shouldSave:"1"===e.save_free_entry,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},h=e=>{const o=_(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=_(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},b=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",b],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=_(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=_(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=_(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",f],["REMOTE_SEARCH",f],["DATE",e=>{const o=_(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=_(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=_(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=_(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["SWITCH",e=>{const o=_(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=_(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=_(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?j(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),v=e=>{if(e.suffixConfig)return C(e);return(y.get(e.html_type)||g)(e)},C=o=>{if(!o.suffixConfig)return v(o);const t=e(o.suffixConfig),n=[{...o,is_show:"1",hide_title:"1",suffixConfig:void 0}].concat(t.map((e=>({...e,hide_title:"1",is_show:"1"})))),r=_(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:j(n)}),r},{FieldNormalizeWaterfallHook:O}=s();function j(o){let n=null;return o.reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(t(o))).validate)?void 0:a.obj_type;return p&&u&&u.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(b(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(v(o),s):(n=null,e[i(o)]=r(v(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:j}}export{u as useFieldListAdaptor};
1
+ import{arrayed as e,deepOmit as o}from"../../../../shared/utils/index.js";import{cloneDeep as t,pick as n}from"lodash-es";import"../../index.js";import{parseNumberFromMaybeString as r,formRenderLog as i}from"../utils/index.js";import{useFieldNormalize as s}from"./useFieldNormalize.js";import{fieldKeyEscape as a,createLinebarId as p}from"../utils/schema.js";import{useFormValidator as l}from"./useFormValidator.js";import{transformDateFormat as c}from"../utils/business.js";function m(e,o){Object.assign(e["x-component-props"],{...n(o,["wordbook","autograph"])})}function d(e,o){Object.assign(e["x-component-props"],{...n(o,["urlConfig","wordbook"])})}function u(u){const{createValidatorSchema:f}=l(),x=e=>{var o;const t={name:e.val_key,type:null!=(o=e.fieldType)?o:"string",title:e.alias||e.name,"x-component":e.html_type,default:e.default_val,"x-component-props":{placeholder:e.placeholder,clearable:"0"===e.is_empty,...e.componentProps||{}},"x-content":e.slots,"x-display":"0"===e.is_show?"hidden":"visible","x-pattern":"0"===e.is_edit?"disabled":"editable","x-compile-omitted":["title","x-component-props","x-decorator-props"]};e.reactions&&(t["x-reactions"]=e.reactions),e.noDecorator||Object.assign(t,{"x-decorator":"FORM_ITEM","x-decorator-props":{fieldItem:e,span:2*(e.elem_width||3),showLabel:"1"!==e.hide_title,remark:e.remark,propertyKey:e.val_key,annotation:e.annotation,...e.decoratorProps||{}}});const n=f(e);return n&&(t["x-validator"]=n),"0"===e.is_null&&(t.required=!0),t},_=e=>{var o;const t=x(e);e.urlConfig?d(t,e):e.autograph&&m(t,e);const i=!!e.__multiple;return Object.assign(t["x-component-props"],{multiple:i,options:e.option||(null==(o=e.componentProps)?void 0:o.options),allowCreate:"1"===e.free_entry||!!t["x-component-props"].allowCreate,shouldSave:"1"===e.save_free_entry,maxTagCount:r(e.multi_select_value),...n(e,["lazyRequest","requestCache"])}),i&&(t.type="array"),t},h=e=>{const o=x(e);return Object.assign(o["x-component-props"],{options:e.option,childFieldStrategy:e.childFieldStrategy,vertical:e.__vertical}),e.urlConfig?d(o,e):e.autograph&&m(o,e),o},g=e=>{const t=x(e);return Object.assign(t["x-component-props"],{fieldItem:o(e,["reactions"])}),t},b=e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINEBAR","x-display":"visible","x-component-props":{disabled:"1"===e.is_not_fold,id:p(e.val_key),show:"0"!==e.is_show,remark:e.remark}}),y=new Map([["LINEBAR",b],["LINE_BREAKS",e=>({name:e.val_key,type:"void",title:e.alias||e.name,"x-component":"LINE_BREAKS","x-display":"0"===e.is_show?"hidden":"visible"})],["INPUT",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["prefix","suffix"])}),o}],["TEXTAREA",e=>{const o=x(e);return Object.assign(o["x-component-props"],{rows:e.initialize_high||3}),o}],["INPUT_NUMBER",e=>{const o=x(e),{decimal_length:t,validate:n}=e;return Object.assign(o["x-component-props"],{precision:null!=t?t:null==n?void 0:n.decimal_length,prefix:e.prefix,suffix:e.suffix}),o}],["SELECT",_],["REMOTE_SEARCH",_],["DATE",e=>{const o=x(e);return Object.assign(o["x-component-props"],{valueFormat:e.date_format,type:c(e.date_format),validate:e.validate}),o}],["LEVEL_SEARCH_CASCADER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{...n(e,["wordbook","lazyRequest","autograph"])}),"1"===e.is_allow_check_mid&&e.allow_check_mid_level&&(o["x-component-props"].checkAbleLevel=+e.allow_check_mid_level),o}],["SEARCH_CASCADER",e=>{var o;const t=x(e);return Object.assign(t["x-component-props"],{urlConfig:e.urlConfig,depth:null==(o=e.wordbook)?void 0:o.level_num,options:e.option}),t}],["COMBINATION",e=>{const o=x(e);return o.type="array",!1!==e.jsonCombination&&(o["x-component"]="JSON_COMBINATION"),Object.assign(o["x-decorator-props"],{showLabel:!1,showFeedback:!1}),Object.assign(o["x-component-props"],{title:e.alias||e.name,maxGroupNum:e.maxGroupNum,properties:e.children||[],combinationItemDeletable:e.combinationItemDeletable}),o}],["RADIO",h],["CHECKBOX",h],["SWITCH",e=>{const o=x(e);return Object.assign(o["x-component-props"],{openDescription:e.open,closeDescription:e.close}),o}],["SLIDER",e=>{const o=x(e);return Object.assign(o["x-component-props"],{step:r(e.step_length),max:r(e.max_length),min:r(e.min_length),option:e.option}),o}],["COMPLEX",e=>{const o=x(e);Array.isArray(e.properties)&&i("COMPLEX控件的properties属性已经废弃, 请使用children作为替代, 在之后的版本中properties属性将不再支持");const t=Array.isArray(e.properties||e.children)?E(e.properties||e.children):{};return o.type=e.fieldType||"void",o.properties=t,Object.assign(o["x-decorator-props"],{showFeedback:!1}),Object.assign(o["x-component-props"],n(e,["wrapperStyle","display"])),o}]]),v=e=>{if(e.suffixConfig)return C(e);return(y.get(e.html_type)||g)(e)},C=o=>{if(!o.suffixConfig&&!o.prefixConfig)return v(o);const t=o.suffixConfig?e(o.suffixConfig):[],n=[...(o.prefixConfig?e(o.prefixConfig):[]).map((e=>({...e,hide_title:"1",is_show:"1"}))),{...o,is_show:"1",hide_title:"1",suffixConfig:void 0,prefixConfig:void 0},...t.map((e=>({...e,hide_title:"1",is_show:"1"})))],r=x(o);return Object.assign(r,{type:"void",name:a(n),title:o.alias||o.name,"x-component":"INPUT_GROUP","x-component-props":{span:2*(o.elem_width||3)},"x-decorator-props":{...r["x-decorator-props"],showFeedback:!1,suffixFields:n.map((e=>e.val_key))},properties:E(n)}),r},{FieldNormalizeWaterfallHook:O,FieldListNormalizeWaterfallHook:j}=s();function E(o){let n=null;return j.call(t(o)).reduce(((e,o,s)=>{var a;const p=null==(a=(o=O.call(o)).validate)?void 0:a.obj_type;return p&&u&&u.collect(p,t(o)),"LINEBAR"===o.html_type?(e[i(o)]=r(b(o),s),n=e[i(o)].properties={}):n?n[i(o)]=r(v(o),s):(n=null,e[i(o)]=r(v(o),s)),e}),{});function r(e,o){return e["x-index"]=o,e}function i(o){return o.suffixConfig?a([o,...e(o.suffixConfig)]):o.val_key}}return{schemaAdaptor:E}}export{u as useFieldListAdaptor};
@@ -2,4 +2,5 @@ import { SyncWaterfallHook } from '../../../../../es/shared/utils/tapable';
2
2
  import { FieldItem } from '../types';
3
3
  export declare function useFieldNormalize(): {
4
4
  FieldNormalizeWaterfallHook: SyncWaterfallHook<FieldItem, import("../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
5
+ FieldListNormalizeWaterfallHook: SyncWaterfallHook<[FieldItem[]], import("../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
5
6
  };
@@ -1 +1 @@
1
- import{arrayed as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../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";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";function a(){const a=new e(["fieldItem"]);a.tap("__block",(t=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(t.html_type)&&(t.__vertical=!0),t))),a.tap("__age",(e=>("AGE"===e.html_type&&(e.html_type="INPUT_NUMBER",e.reactions=e.reactions?t(e.reactions):[],e.reactions.push({target:e.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),e.suffixConfig=[{validate:{obj_type:l.AGE_UNIT},val_key:e.val_key_unit,html_type:"SELECT",option:e.option,urlConfig:e.urlConfig}]),e))),a.tap("__multiple_select",(t=>{const{html_type:e,multi_select:l,__multiple:a}=t;return t.__multiple="SEARCH"!==e&&("SEARCH_MORE"===e||("SELECT"===e?"0"===l:a)),t}));const s=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];a.tap("__normalize",(t=>(s.some((([e,l])=>(Array.isArray(e)?e.includes(t.html_type):e===t.html_type)&&(t.html_type=l))),t)));const o=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",t=>t.html_type=t.__multiple?"CHECKBOX":"RADIO"],["V_TILE",t=>{t.html_type=t.__multiple?"CHECKBOX":"RADIO",t.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",t=>t.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",t=>{t.__multiple=!0,t.html_type="SELECT"}]])]]);return a.tap({stage:9999,name:"__show_mode"},(e=>e.show_mode?([...o].some((([l,a])=>{if(!t(l).includes(e.html_type))return;const s=a.get(e.show_mode);return s&&s(e),!0})),e):e)),{FieldNormalizeWaterfallHook:a}}export{a as useFieldNormalize};
1
+ import{arrayed as e,traverse as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import l from"../../../../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";import{isString as i}from"lodash-es";import{FIELD_BUSINESS_TYPE as r}from"../constants/index.js";function o(){const o=new l(["fieldList"]),s=new l(["fieldItem"]);s.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),s.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:r.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),s.tap("__multiple_select",(e=>{const{html_type:t,multi_select:l,__multiple:i}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?"0"===l:i)),e}));const a=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];s.tap("__normalize",(e=>(a.some((([t,l])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=l))),e)));const p=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return s.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...p].some((([l,i])=>{if(!e(l).includes(t.html_type))return;const r=i.get(t.show_mode);return r&&r(t),!0})),t):t)),o.tap("__prefix/suffix",(e=>{const l=[];return t(e,(r=>{["prefix","suffix"].forEach((o=>{const s=r[o];if(!i(s))return;const a=s.match("#{(.+)}");if(!a)return;const p=i(a[1])&&function(l){let i=null;return t(e,((e,t)=>{e.val_key===l&&(i=e,t())}),["children","properties"]),i}(a[1].trim());p&&(Reflect.deleteProperty(r,o),r[`${o}Config`]=r[`${o}Config`]||[],r[`${o}Config`].push(p),l.push(p))}))}),["children","properties"]),l.length?function e(t){return t.reduce(((t,i)=>(l.includes(i)||(t.push(i),i.properties&&(i.properties=e(i.properties)),i.children&&(i.children=e(i.children))),t)),[])}(e):e})),{FieldNormalizeWaterfallHook:s,FieldListNormalizeWaterfallHook:o}}export{o as useFieldNormalize};
@@ -132,6 +132,7 @@ export declare type FieldItem = {
132
132
  step_length: string | number;
133
133
  urlConfig: UrlConfig;
134
134
  suffixConfig: ArrayAble<FieldItem>;
135
+ prefixConfig: ArrayAble<FieldItem>;
135
136
  autograph: string;
136
137
  defined_error_msg: string;
137
138
  extendKey: string;
@@ -144,6 +145,8 @@ export declare type FieldItem = {
144
145
  show_mode: ShowModeType;
145
146
  is_allow_check_mid: FormCommonState;
146
147
  allow_check_mid_level: '1' | '2' | '3' | '4';
148
+ prefix: string | AnyObject | (() => any);
149
+ suffix: string | AnyObject | (() => any);
147
150
  fieldType: SchemaTypes;
148
151
  content: string | FormRenderer | Record<string, FormRenderer>;
149
152
  lazyRequest: boolean;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as a,ref as t,watch as o,computed as l,onBeforeUnmount as u,onDeactivated as r,openBlock as n,createBlock as i,unref as s,withCtx as p,createElementVNode as d,withModifiers as v,normalizeStyle as c,toDisplayString as m,renderSlot as f,createVNode as h}from"vue";import{cloneDeep as b,isObject as w,isArray as y}from"lodash-es";import{NPopover as g,NInput as x}from"naive-ui";import{InjectionIhoTableHandler as k}from"../../../../constants/index.js";import{useIhoTableFormEvent as _}from"../../../../utils/index.js";const C=["onClick"];var j=e({__name:"editSeparate",props:{value:{},height:{type:Number,default:48},column:{type:Object,required:!0},row:{type:Object,required:!0},displayContent:{type:String,default:""},rowIndex:{type:Number,required:!0}},emits:["update:value","click"],setup(e,{emit:j}){const U=e,q=a(k),P=a("$xetable"),S=t(),T=t();function $(e){T.value=e}const I=t(!1);function N(e){I.value=e}function O(e){I.value=!I.value,j("click",e)}o(I,(function(e){e?async function(){var e;T.value=b(U.value),await new Promise((e=>setTimeout(e))),null==(e=S.value)||e.syncPosition()}():z()}));const{emitFormChangeWithParams:R}=_(l((()=>({...U,$table:P}))));async function z(){if(!w(T.value)&&!y(T.value)&&U.value===T.value)return;const e=U.value;j("update:value",T.value),R({oldValue:e}),q.updateTableDataRef()}const B=l((()=>({border:"1px solid #f5f5f5",height:U.height-16+"px",display:"flex",alignItems:"center",padding:"0",background:"white",wordBreak:"keep-all",boxSizing:"border-box","border-radius":"4px"})));return u(z),r(z),(a,t)=>(n(),i(s(g),{ref_key:"popoverRef",ref:S,trigger:"manual",show:I.value,"onUpdate:show":t[1]||(t[1]=e=>I.value=e),"show-arrow":!1},{trigger:p((()=>[d("div",{onClick:v(O,["stop"]),style:c(s(B)),class:"iho-table__separateText"},m(e.displayContent||" "),13,C)])),default:p((()=>[f(a.$slots,"menu",{value:T.value,"onUpdate:value":$,"onUpdate:show":N,col:e.column,row:e.row},(()=>[h(s(x),{value:T.value,"onUpdate:value":t[0]||(t[0]=e=>T.value=e),type:"textarea"},null,8,["value"])]))])),_:3},8,["show"]))}});export{j as default};
1
+ import{defineComponent as e,inject as a,ref as t,watch as o,computed as l,onDeactivated as u,openBlock as r,createBlock as n,unref as i,withCtx as s,createElementVNode as p,withModifiers as d,normalizeStyle as v,toDisplayString as c,renderSlot as m,createVNode as f}from"vue";import{cloneDeep as h,isObject as b,isArray as w}from"lodash-es";import{NPopover as y,NInput as g}from"naive-ui";import{InjectionIhoTableHandler as x}from"../../../../constants/index.js";import{useIhoTableFormEvent as k}from"../../../../utils/index.js";const _=["onClick"];var C=e({__name:"editSeparate",props:{value:{},height:{type:Number,default:48},column:{type:Object,required:!0},row:{type:Object,required:!0},displayContent:{type:String,default:""},rowIndex:{type:Number,required:!0}},emits:["update:value","click"],setup(e,{emit:C}){const j=e,U=a(x),q=a("$xetable"),P=t(),S=t();function T(e){S.value=e}const $=t(!1);function I(e){$.value=e}function N(e){$.value=!$.value,C("click",e)}o($,(function(e){e?async function(){var e;S.value=h(j.value),await new Promise((e=>setTimeout(e))),null==(e=P.value)||e.syncPosition()}():async function(){if(!b(S.value)&&!w(S.value)&&j.value===S.value)return;const e=j.value;C("update:value",S.value),O({oldValue:e}),U.updateTableDataRef()}()}));const{emitFormChangeWithParams:O}=k(l((()=>({...j,$table:q}))));const R=l((()=>({border:"1px solid #f5f5f5",height:j.height-16+"px",display:"flex",alignItems:"center",padding:"0",background:"white",wordBreak:"keep-all",boxSizing:"border-box","border-radius":"4px"})));return u((()=>I(!1))),(a,t)=>(r(),n(i(y),{ref_key:"popoverRef",ref:P,trigger:"manual",show:$.value,"onUpdate:show":t[1]||(t[1]=e=>$.value=e),"show-arrow":!1},{trigger:s((()=>[p("div",{onClick:d(N,["stop"]),style:v(i(R)),class:"iho-table__separateText"},c(e.displayContent||" "),13,_)])),default:s((()=>[m(a.$slots,"menu",{value:S.value,"onUpdate:value":T,"onUpdate:show":I,col:e.column,row:e.row},(()=>[f(i(g),{value:S.value,"onUpdate:value":t[0]||(t[0]=e=>S.value=e),type:"textarea"},null,8,["value"])]))])),_:3},8,["show"]))}});export{C as default};
@@ -142,6 +142,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
142
142
  })[] | undefined;
143
143
  } | undefined;
144
144
  suffixConfig?: any | any[] | undefined;
145
+ prefixConfig?: any | any[] | undefined;
145
146
  autograph?: string | undefined;
146
147
  defined_error_msg?: string | undefined;
147
148
  extendKey?: string | undefined;
@@ -167,6 +168,8 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
167
168
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
168
169
  is_allow_check_mid?: import("..").FormCommonState | undefined;
169
170
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
171
+ prefix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
172
+ suffix?: string | import("../../../es/shared/types").AnyObject | (() => any) | undefined;
170
173
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
171
174
  content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
172
175
  lazyRequest?: boolean | undefined;
@@ -144,6 +144,7 @@ declare const _default: import("vue").DefineComponent<{
144
144
  })[] | undefined;
145
145
  } | undefined;
146
146
  suffixConfig?: any | any[] | undefined;
147
+ prefixConfig?: any | any[] | undefined;
147
148
  autograph?: string | undefined;
148
149
  defined_error_msg?: string | undefined;
149
150
  extendKey?: string | undefined;
@@ -169,6 +170,8 @@ declare const _default: import("vue").DefineComponent<{
169
170
  show_mode?: ("DROPDOWN" | "H_TILE" | "V_TILE" | "TILE") | undefined;
170
171
  is_allow_check_mid?: import("../../../../es/components/form-render").FormCommonState | undefined;
171
172
  allow_check_mid_level?: "1" | "2" | "3" | "4" | undefined;
173
+ prefix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
174
+ suffix?: string | import("../../../../es/shared/types").AnyObject | (() => any) | undefined;
172
175
  fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
173
176
  content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
174
177
  lazyRequest?: boolean | undefined;
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",s="3.1.48-release.6",i="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.48-release.6",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,i as main,e as name,n as peerDependencies,s as version};
1
+ var e="@cnhis-design-vue/shared",i="3.1.48",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},d={"@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"},o={name:e,version:"3.1.48",private:!0,main:"index.ts",peerDependencies:n,dependencies:d};export{o as default,d 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.48-release.6",
3
+ "version": "3.1.48",
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": "6f4c2935ed70217eda4027f4cad1f6fcc6252ddc"
66
+ "gitHead": "a8f7d7cdca3113620c2a7b0dbaf062673dfc51cc"
67
67
  }