cnhis-design-vue 3.1.48-release.5 → 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.
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/form-config/index.d.ts +21 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +21 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +9 -0
- package/es/components/form-render/src/components/renderer/remoteSearch.d.ts +9 -0
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +9 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +1 -0
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +2 -0
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +3 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +4 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue2.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +3 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +3 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -26,6 +26,10 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
26
26
|
type: PropType<UrlConfig>;
|
|
27
27
|
};
|
|
28
28
|
onChange: {};
|
|
29
|
+
useLoading: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
29
33
|
}, () => 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<{
|
|
30
34
|
value: {
|
|
31
35
|
type: PropType<String | null>;
|
|
@@ -51,6 +55,10 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
51
55
|
type: PropType<UrlConfig>;
|
|
52
56
|
};
|
|
53
57
|
onChange: {};
|
|
58
|
+
useLoading: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
54
62
|
}>> & {
|
|
55
63
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
56
64
|
}, {
|
|
@@ -59,4 +67,5 @@ export declare const REMOTE_SEARCH: import("vue").DefineComponent<{
|
|
|
59
67
|
valueField: string;
|
|
60
68
|
requestCache: boolean;
|
|
61
69
|
allowCreate: boolean;
|
|
70
|
+
useLoading: boolean;
|
|
62
71
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as a,inject as u,watch as o,createVNode as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as a,inject as u,watch as o,createVNode as n}from"vue";import{connect as t,mapProps as r}from"@formily/vue";import{useVModel as i,useDebounceFn as v}from"@vueuse/core";import{isString as s,isArray as p,cloneDeep as m,isEqual as d}from"lodash-es";import{NSelect as f,NSpin as c,NEmpty as y}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as g,InjectionChangeContextCollector as C,InjectionFormItemDepsCollector as h}from"../../constants/index.js";import{createUrlConfigParams as j,formRenderLog as F}from"../../utils/index.js";import{useCommonInjection as x,useSelectOptionProps as b}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as w,assignClearBindVisited as K,createVisitedSetter as S}from"../../utils/schema.js";import{useFormField as k}from"../../hooks/useFormField.js";const B=t(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},allowCreate:Boolean,labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},urlConfig:{type:Object},onChange:{},useLoading:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{slots:t,emit:r}){const w=i(e,"value",r),{field:K,fieldKey:B}=k(),V=l(null),q=a((()=>{var l,a,u;return null!=(u=null!=(a=null==(l=e.urlConfig)?void 0:l.nameKey)?a:e.labelField)?u:"text"})),A=a((()=>{var l,a,u;return null!=(u=null!=(a=null==(l=e.urlConfig)?void 0:l.valueKey)?a:e.valueField)?u:"value"})),L=u(g),O=l(""),P=l(!1),U=v((async(l="",a="label")=>{if(O.value=l,!e.urlConfig)return V.value=null;try{P.value=!0,V.value=[],V.value=await L.addAsync(await j({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===a?A.value:"keyword"]:l}},cache:e.requestCache,field:K.value}))}catch(e){s(e)&&F(e)}finally{P.value=!1}})),D=a((()=>p(V.value)?V.value:p(e.options)?e.options:[])),{injectValueValidate:I,injectValueBindKey:R}=x();I(w);const z=R(w);o(w,(e=>{if(e&&!D.value.find((l=>l[A.value]===e)))return U(e,"value")}));u(C).setContext(B.value,(e=>{return{currentOption:m((l=e,D.value.find((e=>e[A.value]===l))))};var l}));const E=u(h);o((()=>e.urlConfig),((e,l)=>{d(e,l)||(V.value=null,e&&(E.setDeps(B.value,e.dependKey||[],(async()=>{V.value=null,w.value=null})),w.value&&U(w.value,"value")))}),{immediate:!0});const{menuProps:G,nodeProps:H}=b(),J=a((()=>D.value.length||!e.allowCreate?D.value:O.value?[{[q.value]:O.value,[A.value]:O.value},...D.value]:D.value));async function M(e){P.value=e,e&&U()}return()=>n(f,{remote:!0,filterable:!0,key:z.value,value:w.value,"onUpdate:value":e=>w.value=e,labelField:q.value,valueField:A.value,"menu-props":G,"node-props":H,onSearch:U,"onUpdate:show":M,options:J.value,onFocus:S(K)},{empty:()=>e.useLoading&&P.value?n(c,null,null):n(y,{description:"无数据"},null),...t})}}),r(w,K));export{B as REMOTE_SEARCH};
|
|
@@ -86,6 +86,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
86
86
|
type: BooleanConstructor;
|
|
87
87
|
default: boolean;
|
|
88
88
|
};
|
|
89
|
+
useLoading: {
|
|
90
|
+
type: BooleanConstructor;
|
|
91
|
+
default: boolean;
|
|
92
|
+
};
|
|
89
93
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "postRecommend")[], "update:value" | "postRecommend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
90
94
|
value: {
|
|
91
95
|
type: PropType<ArrayAble<string | number> | null>;
|
|
@@ -169,6 +173,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
169
173
|
type: BooleanConstructor;
|
|
170
174
|
default: boolean;
|
|
171
175
|
};
|
|
176
|
+
useLoading: {
|
|
177
|
+
type: BooleanConstructor;
|
|
178
|
+
default: boolean;
|
|
179
|
+
};
|
|
172
180
|
}>> & {
|
|
173
181
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
174
182
|
onPostRecommend?: ((...args: any[]) => any) | undefined;
|
|
@@ -183,5 +191,6 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
183
191
|
commonNum: number;
|
|
184
192
|
recentNum: number;
|
|
185
193
|
allowCreate: boolean;
|
|
194
|
+
useLoading: boolean;
|
|
186
195
|
shouldSave: boolean;
|
|
187
196
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as o,inject as t,useAttrs as l,
|
|
1
|
+
import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as n,toRaw as s}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as i,isArray as p,isString as m,isObject as d,omit as c}from"lodash-es";import{useCommonInjection as v,useSelectOptionProps as f}from"../../hooks/useCommonInjection.js";import{useComplexOptions as y,useComplexOptionsSpan as h}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as j,InjectionFormUUID as b}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as S,assignClearBindVisited as k,createVisitedSetter as C}from"../../utils/schema.js";import{useFormField as g}from"../../hooks/useFormField.js";import{NSelect as F}from"naive-ui";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";import"../../hooks/useFormValidator.js";import{connect as x,mapProps as B}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as O,useAutographOptions as A,useRecommendOptions as H,searchContentMatcher as w}from"../../hooks/useFormRenderOptions.js";const L=x(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,shouldSave:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0}},emits:["update:value","postRecommend"],setup(e,{slots:S,emit:k}){const x=o({get:()=>e.value,async set(e){k("update:value",e),E(e)}}),{labelKey:B,valueKey:L,fetchData:K,searchContent:P,fullOptions:R,filterOptions:V,remoteOptions:_,loading:N}=e.urlConfig?O(e,x):A(e,x),{renderComplexOption:I,hasComplexOption:W}=y(e,x),{getRecommend:q,postRecommend:E,sortedOptions:U}=H(e,V,k,B,L),{field:z,fieldKey:D}=g();t(j).setContext(D.value,(e=>({currentOption:i(function(e){const o=$(R.value);return p(e)?function(e){const t=o.reduce(((e,o)=>(e[o[L.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[L.value]===t)));var t}(e))})));const G=async(e="")=>(P.value=e,Promise.allSettled([K(e),q(e)])),{injectValueValidate:J,injectValueWatchFromEmpty:M,injectValueBindKey:Q}=v();M(x,G),J(x);const T=Q(x),{menuProps:X,nodeProps:Y}=f();function Z(e){const o=e[B.value];if(!o||!m(o))return"";const t=P.value?w(P.value,o):null;return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}function $(o){return e.allowCreate&&P.value&&!o.some((e=>e[B.value]===P.value))?[...o,{[B.value]:P.value,[L.value]:P.value,created:!0,shouldSave:e.shouldSave}]:o}const ee=o((()=>$(U.value))),oe=l(),te=o((()=>{if(e.allowCreate)return x.value;const o=oe.multiple&&p(x.value);return R.value.find((e=>o?x.value.includes(e[L.value]):e[L.value]===x.value))?x.value:null})),le=a(!1);async function ae(e){e&&await G(),le.value=e}function re(e,o){x.value=e,_.value&&o&&u(o).forEach((e=>{if(!d(e))return;const o=e;o.created&&o.shouldSave&&_.value.push(c(s(o),["created","shouldSave"]))}))}const ne=t(b),{getSpan:se}=h();function ue(e){return r(F,n({key:T.value,remote:!0,filterable:!0,loading:N.value,value:te.value,onUpdateValue:re,"menu-props":X,"node-props":Y,labelField:B.value,valueField:L.value,options:ee.value,onSearch:G,show:le.value,"onUpdate:show":ae,onFocus:C(z),renderLabel:Z},e,oe),S)}return()=>{var e,o;if(!W.value)return ue();const t=null!=(o=null==(e=z.value.decoratorProps)?void 0:e.span)?o:6,l=se(ne,z.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[ue({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),R.value.map((e=>I({option:e,value:x.value,valueKey:L.value,labelKey:B.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),B({dataSource:"options"},S,k));export{L as SELECT};
|
|
@@ -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
|
|
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:
|
|
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
|
|
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};
|
|
@@ -25,6 +25,7 @@ export declare function useUrlConfigOptions(props: {
|
|
|
25
25
|
lazyRequest: boolean;
|
|
26
26
|
}, valueRef: Ref): {
|
|
27
27
|
labelKey: import("vue").ComputedRef<string>;
|
|
28
|
+
loading: Ref<boolean>;
|
|
28
29
|
valueKey: import("vue").ComputedRef<string>;
|
|
29
30
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
30
31
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|
|
@@ -42,6 +43,7 @@ export declare function useAutographOptions(props: Partial<{
|
|
|
42
43
|
options: AnyObject[];
|
|
43
44
|
}>, valueRef: Ref): {
|
|
44
45
|
labelKey: import("vue").ComputedRef<string>;
|
|
46
|
+
loading: Ref<boolean>;
|
|
45
47
|
remoteOptions: Ref<AnyObject[] | null>;
|
|
46
48
|
valueKey: import("vue").ComputedRef<string>;
|
|
47
49
|
filterOptions: import("vue").ComputedRef<AnyObject[]>;
|