lu-lowcode-package-form 0.10.71 → 0.10.73
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/dist/index.cjs.js
CHANGED
@@ -332,7 +332,7 @@ html body {
|
|
332
332
|
${n}-eye,
|
333
333
|
${n}-download,
|
334
334
|
${n}-delete
|
335
|
-
`]:{zIndex:10,width:r,margin:`0 ${Te(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${s}-name`]:{display:"none",textAlign:"center"},[`${s}-file + ${s}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${Te(i(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${Te(i(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},D3t=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},T3t=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},co(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},I3t=e=>({actionsColor:e.colorTextDescription}),P3t=Ho("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:r,controlHeightLG:o,calc:i}=e,a=Cr(e,{uploadThumbnailSize:i(t).mul(2).equal(),uploadProgressOffset:i(i(n).div(2)).add(r).equal(),uploadPicCardSize:i(o).mul(2.55).equal()});return[T3t(a),w3t(a),$3t(a),O3t(a),x3t(a),A3t(a),D3t(a),dse(a)]},I3t);var N3t={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:n}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},R3t=function(t,n){return O.createElement(mr,ot({},t,{ref:n,icon:N3t}))},EVe=O.forwardRef(R3t);process.env.NODE_ENV!=="production"&&(EVe.displayName="FileTwoTone");var M3t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},F3t=function(t,n){return O.createElement(mr,ot({},t,{ref:n,icon:M3t}))},SVe=O.forwardRef(F3t);process.env.NODE_ENV!=="production"&&(SVe.displayName="PaperClipOutlined");var B3t={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:n}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:n}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:n}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},k3t=function(t,n){return O.createElement(mr,ot({},t,{ref:n,icon:B3t}))},CVe=O.forwardRef(k3t);process.env.NODE_ENV!=="production"&&(CVe.displayName="PictureTwoTone");function nP(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function rP(e,t){const n=ht(t),r=n.findIndex(o=>{let{uid:i}=o;return i===e.uid});return r===-1?n.push(e):n[r]=e,n}function PH(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(r=>r[n]===e[n])[0]}function L3t(e,t){const n=e.uid!==void 0?"uid":"name",r=t.filter(o=>o[n]!==e[n]);return r.length===t.length?null:r}const j3t=function(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},wVe=e=>e.indexOf("image/")===0,_3t=e=>{if(e.type&&!e.thumbUrl)return wVe(e.type);const t=e.thumbUrl||e.url||"",n=j3t(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(t)||n)},Ph=200;function H3t(e){return new Promise(t=>{if(!e.type||!wVe(e.type)){t("");return}const n=document.createElement("canvas");n.width=Ph,n.height=Ph,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${Ph}px; height: ${Ph}px; z-index: 9999; display: none;`,document.body.appendChild(n);const r=n.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:i,height:a}=o;let s=Ph,l=Ph,u=0,c=0;i>a?(l=a*(Ph/i),c=-(l-s)/2):(s=i*(Ph/a),u=-(s-l)/2),r.drawImage(o,u,c,s,l);const f=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(o.src),t(f)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const i=new FileReader;i.onload=()=>{i.result&&typeof i.result=="string"&&(o.src=i.result)},i.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const i=new FileReader;i.onload=()=>{i.result&&t(i.result)},i.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var z3t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},V3t=function(t,n){return O.createElement(mr,ot({},t,{ref:n,icon:z3t}))},xVe=O.forwardRef(V3t);process.env.NODE_ENV!=="production"&&(xVe.displayName="DownloadOutlined");const U3t=O.forwardRef((e,t)=>{let{prefixCls:n,className:r,style:o,locale:i,listType:a,file:s,items:l,progress:u,iconRender:c,actionIconRender:f,itemRender:d,isImgUrl:p,showPreviewIcon:g,showRemoveIcon:m,showDownloadIcon:h,previewIcon:y,removeIcon:v,downloadIcon:b,onPreview:E,onDownload:S,onClose:C}=e;var w,A;const{status:D}=s,[T,$]=O.useState(D);O.useEffect(()=>{D!=="removed"&&$(D)},[D]);const[I,M]=O.useState(!1);O.useEffect(()=>{const Q=setTimeout(()=>{M(!0)},300);return()=>{clearTimeout(Q)}},[]);const R=c(s);let F=O.createElement("div",{className:`${n}-icon`},R);if(a==="picture"||a==="picture-card"||a==="picture-circle")if(T==="uploading"||!s.thumbUrl&&!s.url){const Q=$e(`${n}-list-item-thumbnail`,{[`${n}-list-item-file`]:T!=="uploading"});F=O.createElement("div",{className:Q},R)}else{const Q=p!=null&&p(s)?O.createElement("img",{src:s.thumbUrl||s.url,alt:s.name,className:`${n}-list-item-image`,crossOrigin:s.crossOrigin}):R,X=$e(`${n}-list-item-thumbnail`,{[`${n}-list-item-file`]:p&&!p(s)});F=O.createElement("a",{className:X,onClick:ne=>E(s,ne),href:s.url||s.thumbUrl,target:"_blank",rel:"noopener noreferrer"},Q)}const k=$e(`${n}-list-item`,`${n}-list-item-${T}`),L=typeof s.linkProps=="string"?JSON.parse(s.linkProps):s.linkProps,H=m?f((typeof v=="function"?v(s):v)||O.createElement(pVe,null),()=>C(s),n,i.removeFile,!0):null,z=h&&T==="done"?f((typeof b=="function"?b(s):b)||O.createElement(xVe,null),()=>S(s),n,i.downloadFile):null,_=a!=="picture-card"&&a!=="picture-circle"&&O.createElement("span",{key:"download-delete",className:$e(`${n}-list-item-actions`,{picture:a==="picture"})},z,H),P=$e(`${n}-list-item-name`),B=s.url?[O.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:P,title:s.name},L,{href:s.url,onClick:Q=>E(s,Q)}),s.name),_]:[O.createElement("span",{key:"view",className:P,onClick:Q=>E(s,Q),title:s.name},s.name),_],j=g&&(s.url||s.thumbUrl)?O.createElement("a",{href:s.url||s.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:Q=>E(s,Q),title:i.previewFile},typeof y=="function"?y(s):y||O.createElement(QB,null)):null,W=(a==="picture-card"||a==="picture-circle")&&T!=="uploading"&&O.createElement("span",{className:`${n}-list-item-actions`},j,T==="done"&&z,H),{getPrefixCls:K}=O.useContext(Sn),U=K(),G=O.createElement("div",{className:k},F,B,W,I&&O.createElement(Tl,{motionName:`${U}-fade`,visible:T==="uploading",motionDeadline:2e3},Q=>{let{className:X}=Q;const ne="percent"in s?O.createElement(qze,Object.assign({},u,{type:"line",percent:s.percent,"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"]})):null;return O.createElement("div",{className:$e(`${n}-list-item-progress`,X)},ne)})),Y=s.response&&typeof s.response=="string"?s.response:((w=s.error)===null||w===void 0?void 0:w.statusText)||((A=s.error)===null||A===void 0?void 0:A.message)||i.uploadError,q=T==="error"?O.createElement(NC,{title:Y,getPopupContainer:Q=>Q.parentNode},G):G;return O.createElement("div",{className:$e(`${n}-list-item-container`,r),style:o,ref:t},d?d(q,s,l,{download:S.bind(null,s),preview:E.bind(null,s),remove:C.bind(null,s)}):q)}),W3t=(e,t)=>{const{listType:n="text",previewFile:r=H3t,onPreview:o,onDownload:i,onRemove:a,locale:s,iconRender:l,isImageUrl:u=_3t,prefixCls:c,items:f=[],showPreviewIcon:d=!0,showRemoveIcon:p=!0,showDownloadIcon:g=!1,removeIcon:m,previewIcon:h,downloadIcon:y,progress:v={size:[-1,2],showInfo:!1},appendAction:b,appendActionVisible:E=!0,itemRender:S,disabled:C}=e,w=n2t(),[A,D]=O.useState(!1);O.useEffect(()=>{n!=="picture"&&n!=="picture-card"&&n!=="picture-circle"||(f||[]).forEach(j=>{typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(j.originFileObj instanceof File||j.originFileObj)||j.thumbUrl!==void 0||r&&r(j.originFileObj).then(W=>{j.thumbUrl=W||"",w()})})},[n,f,r]),O.useEffect(()=>{D(!0)},[]);const T=(j,W)=>{if(o)return W==null||W.preventDefault(),o(j)},$=j=>{typeof i=="function"?i(j):j.url&&window.open(j.url)},I=j=>{a==null||a(j)},M=j=>{if(l)return l(j,n);const W=j.status==="uploading",K=u&&u(j)?O.createElement(CVe,null):O.createElement(EVe,null);let U=W?O.createElement(Rg,null):O.createElement(SVe,null);return n==="picture"?U=W?O.createElement(Rg,null):K:(n==="picture-card"||n==="picture-circle")&&(U=W?s.uploading:K),U},R=(j,W,K,U,G)=>{const Y={type:"text",size:"small",title:U,onClick:q=>{var Q,X;W(),O.isValidElement(j)&&((X=(Q=j.props).onClick)===null||X===void 0||X.call(Q,q))},className:`${K}-list-item-action`};if(G&&(Y.disabled=C),O.isValidElement(j)){const q=qu(j,Object.assign(Object.assign({},j.props),{onClick:()=>{}}));return O.createElement(Sl,Object.assign({},Y,{icon:q}))}return O.createElement(Sl,Object.assign({},Y),O.createElement("span",null,j))};O.useImperativeHandle(t,()=>({handlePreview:T,handleDownload:$}));const{getPrefixCls:F}=O.useContext(Sn),k=F("upload",c),L=F(),H=$e(`${k}-list`,`${k}-list-${n}`),z=ht(f.map(j=>({key:j.uid,file:j})));let P={motionDeadline:2e3,motionName:`${k}-${n==="picture-card"||n==="picture-circle"?"animate-inline":"animate"}`,keys:z,motionAppear:A};const B=O.useMemo(()=>{const j=Object.assign({},bR(L));return delete j.onAppearEnd,delete j.onEnterEnd,delete j.onLeaveEnd,j},[L]);return n!=="picture-card"&&n!=="picture-circle"&&(P=Object.assign(Object.assign({},B),P)),O.createElement("div",{className:H},O.createElement(_Le,Object.assign({},P,{component:!1}),j=>{let{key:W,file:K,className:U,style:G}=j;return O.createElement(U3t,{key:W,locale:s,prefixCls:k,className:U,style:G,file:K,items:f,progress:v,listType:n,isImgUrl:u,showPreviewIcon:d,showRemoveIcon:p,showDownloadIcon:g,removeIcon:m,previewIcon:h,downloadIcon:y,iconRender:M,actionIconRender:R,itemRender:S,onPreview:T,onDownload:$,onClose:I})}),b&&O.createElement(Tl,Object.assign({},P,{visible:E,forceRender:!0}),j=>{let{className:W,style:K}=j;return qu(b,U=>({className:$e(U.className,W),style:Object.assign(Object.assign(Object.assign({},K),{pointerEvents:W?"none":void 0}),U.style)}))}))},AVe=O.forwardRef(W3t);process.env.NODE_ENV!=="production"&&(AVe.displayName="UploadList");var K3t=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(c){try{u(r.next(c))}catch(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?i(c.value):o(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})};const q$=`__LIST_IGNORE_${Date.now()}__`,G3t=(e,t)=>{const{fileList:n,defaultFileList:r,onRemove:o,showUploadList:i=!0,listType:a="text",onPreview:s,onDownload:l,onChange:u,onDrop:c,previewFile:f,disabled:d,locale:p,iconRender:g,isImageUrl:m,progress:h,prefixCls:y,className:v,type:b="select",children:E,style:S,itemRender:C,maxCount:w,data:A={},multiple:D=!1,hasControlInside:T=!0,action:$="",accept:I="",supportServerRender:M=!0,rootClassName:R}=e,F=O.useContext($s),k=d??F,[L,H]=Wr(r||[],{value:n,postState:Me=>Me??[]}),[z,_]=O.useState("drop"),P=O.useRef(null),B=O.useRef(null);if(process.env.NODE_ENV!=="production"){const Me=Gr("Upload");process.env.NODE_ENV!=="production"&&Me("fileList"in e||!("value"in e),"usage","`value` is not a valid prop, do you mean `fileList`?"),Me.deprecated(!("transformFile"in e),"transformFile","beforeUpload")}O.useMemo(()=>{const Me=Date.now();(n||[]).forEach((Pe,Ye)=>{!Pe.uid&&!Object.isFrozen(Pe)&&(Pe.uid=`__AUTO__${Me}_${Ye}__`)})},[n]);const j=(Me,Pe,Ye)=>{let Re=ht(Pe),Ve=!1;w===1?Re=Re.slice(-1):w&&(Ve=Re.length>w,Re=Re.slice(0,w)),Jl.flushSync(()=>{H(Re)});const it={file:Me,fileList:Re};Ye&&(it.event=Ye),(!Ve||Me.status==="removed"||Re.some(At=>At.uid===Me.uid))&&Jl.flushSync(()=>{u==null||u(it)})},W=(Me,Pe)=>K3t(void 0,void 0,void 0,function*(){const{beforeUpload:Ye,transformFile:Re}=e;let Ve=Me;if(Ye){const it=yield Ye(Me,Pe);if(it===!1)return!1;if(delete Me[q$],it===q$)return Object.defineProperty(Me,q$,{value:!0,configurable:!0}),!1;typeof it=="object"&&it&&(Ve=it)}return Re&&(Ve=yield Re(Ve)),Ve}),K=Me=>{const Pe=Me.filter(Ve=>!Ve.file[q$]);if(!Pe.length)return;const Ye=Pe.map(Ve=>nP(Ve.file));let Re=ht(L);Ye.forEach(Ve=>{Re=rP(Ve,Re)}),Ye.forEach((Ve,it)=>{let At=Ve;if(Pe[it].parsedFile)Ve.status="uploading";else{const{originFileObj:vt}=Ve;let mt;try{mt=new File([vt],vt.name,{type:vt.type})}catch{mt=new Blob([vt],{type:vt.type}),mt.name=vt.name,mt.lastModifiedDate=new Date,mt.lastModified=new Date().getTime()}mt.uid=Ve.uid,At=mt}j(At,Re)})},U=(Me,Pe,Ye)=>{try{typeof Me=="string"&&(Me=JSON.parse(Me))}catch{}if(!PH(Pe,L))return;const Re=nP(Pe);Re.status="done",Re.percent=100,Re.response=Me,Re.xhr=Ye;const Ve=rP(Re,L);j(Re,Ve)},G=(Me,Pe)=>{if(!PH(Pe,L))return;const Ye=nP(Pe);Ye.status="uploading",Ye.percent=Me.percent;const Re=rP(Ye,L);j(Ye,Re,Me)},Y=(Me,Pe,Ye)=>{if(!PH(Ye,L))return;const Re=nP(Ye);Re.error=Me,Re.response=Pe,Re.status="error";const Ve=rP(Re,L);j(Re,Ve)},q=Me=>{let Pe;Promise.resolve(typeof o=="function"?o(Me):o).then(Ye=>{var Re;if(Ye===!1)return;const Ve=L3t(Me,L);Ve&&(Pe=Object.assign(Object.assign({},Me),{status:"removed"}),L==null||L.forEach(it=>{const At=Pe.uid!==void 0?"uid":"name";it[At]===Pe[At]&&!Object.isFrozen(it)&&(it.status="removed")}),(Re=P.current)===null||Re===void 0||Re.abort(Pe),j(Pe,Ve))})},Q=Me=>{_(Me.type),Me.type==="drop"&&(c==null||c(Me))};O.useImperativeHandle(t,()=>({onBatchStart:K,onSuccess:U,onProgress:G,onError:Y,fileList:L,upload:P.current,nativeElement:B.current}));const{getPrefixCls:X,direction:ne,upload:se}=O.useContext(Sn),ee=X("upload",y),le=Object.assign(Object.assign({onBatchStart:K,onError:Y,onProgress:G,onSuccess:U},e),{data:A,multiple:D,action:$,accept:I,supportServerRender:M,prefixCls:ee,disabled:k,beforeUpload:W,onChange:void 0,hasControlInside:T});delete le.className,delete le.style,(!E||k)&&delete le.id;const me=`${ee}-wrapper`,[we,ce,ue]=P3t(ee,me),[ge]=ih("Upload",Xu.Upload),{showRemoveIcon:pe,showPreviewIcon:Se,showDownloadIcon:je,removeIcon:Ae,previewIcon:ke,downloadIcon:Xe}=typeof i=="boolean"?{}:i,st=typeof pe>"u"?!k:!!pe,Ue=(Me,Pe)=>i?O.createElement(AVe,{prefixCls:ee,listType:a,items:L,previewFile:f,onPreview:s,onDownload:l,onRemove:q,showRemoveIcon:st,showPreviewIcon:Se,showDownloadIcon:je,removeIcon:Ae,previewIcon:ke,downloadIcon:Xe,iconRender:g,locale:Object.assign(Object.assign({},ge),p),isImageUrl:m,progress:h,appendAction:Me,appendActionVisible:Pe,itemRender:C,disabled:k}):Me,at=$e(me,v,R,ce,ue,se==null?void 0:se.className,{[`${ee}-rtl`]:ne==="rtl",[`${ee}-picture-card-wrapper`]:a==="picture-card",[`${ee}-picture-circle-wrapper`]:a==="picture-circle"}),Ke=Object.assign(Object.assign({},se==null?void 0:se.style),S);if(b==="drag"){const Me=$e(ce,ee,`${ee}-drag`,{[`${ee}-drag-uploading`]:L.some(Pe=>Pe.status==="uploading"),[`${ee}-drag-hover`]:z==="dragover",[`${ee}-disabled`]:k,[`${ee}-rtl`]:ne==="rtl"});return we(O.createElement("span",{className:at,ref:B},O.createElement("div",{className:Me,style:Ke,onDrop:Q,onDragOver:Q,onDragLeave:Q},O.createElement(PZ,Object.assign({},le,{ref:P,className:`${ee}-btn`}),O.createElement("div",{className:`${ee}-drag-container`},E))),Ue()))}const ut=$e(ee,`${ee}-select`,{[`${ee}-disabled`]:k}),_e=O.createElement("div",{className:ut,style:E?void 0:{display:"none"}},O.createElement(PZ,Object.assign({},le,{ref:P})));return we(a==="picture-card"||a==="picture-circle"?O.createElement("span",{className:at,ref:B},Ue(_e,!!E)):O.createElement("span",{className:at,ref:B},_e,Ue()))},xle=O.forwardRef(G3t);process.env.NODE_ENV!=="production"&&(xle.displayName="Upload");var Y3t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const $Ve=O.forwardRef((e,t)=>{var{style:n,height:r,hasControlInside:o=!1}=e,i=Y3t(e,["style","height","hasControlInside"]);return O.createElement(xle,Object.assign({ref:t,hasControlInside:o},i,{type:"drag",style:Object.assign(Object.assign({},n),{height:r})}))});process.env.NODE_ENV!=="production"&&($Ve.displayName="Dragger");const nk=xle;nk.Dragger=$Ve;nk.LIST_IGNORE=q$;const ui=e=>{var t;let{label:n,higLabel:r=!1,children:o,prompt:i,subTable:a,subTableHead:s=!1,subTableContent:l=!0,hidePrompt:u=!1,subTableIndex:c,addWrapper:f=!0,calcHidden:d=!1,defaultValue:p,value:g,onChange:m,readonly:h,isRequired:y,initializeFormRender:v,...b}=e;const E=J.useRef(!1);if(J.useEffect(()=>{E.current!=d&&(typeof v=="function"&&v(),E.current=d)},[d]),J.useEffect(()=>{p&&typeof m=="function"&&!g&&m(p)},[]),!f)return o;["UploadImage","UploadFile","Table","WithMultipleSelect","WithSingleSelect"].includes(o==null||(t=o.type)===null||t===void 0?void 0:t.displayName)&&h&&(h=!1);const C=Le.jsxs("div",{className:"frelative fw-full",children:[n&&Le.jsxs(Le.Fragment,{children:[!r&&Le.jsxs("div",{className:"fh-8 ftext-gray-500 ftext-sm fflex fitems-center ".concat(r?" ftext-xl fmy-2 ftext-black":""),children:[n,y&&Le.jsx("span",{className:"ftext-red-500 ffont-bold",children:"*"})]}),r&&Le.jsxs("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:[Le.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:n}),y&&Le.jsx("span",{className:"ftext-red-500 ffont-bold",children:"*"})]})]}),Le.jsxs("div",{className:"fw-full fflex fitems-stretch ftext-gray-900 frelative",children:[h&&Le.jsx("div",{className:"fw-full fh-full fbg-gray-100 fopacity-5 fcursor-not-allowed fabsolute fleft-0 ftop-0 fz-10"}),o]}),!u&&i&&Le.jsx("div",{className:"ftext-xs ftext-gray-500 fmin-h-5 fflex fitems-center",children:i})]});return a?Le.jsxs("div",{className:"frelative fw-full",children:[s&&n&&Le.jsx("div",{className:"fh-12 ffont-semibold fbg-[#fafafa] ftext-sm fflex fitems-center fborder-b fpl-2 f-mx-1",children:Le.jsxs("div",{className:"fw-full fborder-r fborder-r-[#e9e9e9]",children:[n,y&&Le.jsx("span",{className:"ftext-red-500",children:"*"})]})}),l&&Le.jsxs("div",{className:"fw-full fflex fitems-stretch frelative fpy-2",children:[h&&Le.jsx("div",{className:"fw-full fh-full fbg-gray-50 fopacity-5 fcursor-not-allowed fabsolute fleft-0 ftop-0 fz-10"}),o]})]}):C};var MR={exports:{}};/**
|
335
|
+
`]:{zIndex:10,width:r,margin:`0 ${Te(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${s}-name`]:{display:"none",textAlign:"center"},[`${s}-file + ${s}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${Te(i(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${Te(i(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},D3t=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},T3t=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},co(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},I3t=e=>({actionsColor:e.colorTextDescription}),P3t=Ho("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:r,controlHeightLG:o,calc:i}=e,a=Cr(e,{uploadThumbnailSize:i(t).mul(2).equal(),uploadProgressOffset:i(i(n).div(2)).add(r).equal(),uploadPicCardSize:i(o).mul(2.55).equal()});return[T3t(a),w3t(a),$3t(a),O3t(a),x3t(a),A3t(a),D3t(a),dse(a)]},I3t);var N3t={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:n}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},R3t=function(t,n){return O.createElement(mr,ot({},t,{ref:n,icon:N3t}))},EVe=O.forwardRef(R3t);process.env.NODE_ENV!=="production"&&(EVe.displayName="FileTwoTone");var M3t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},F3t=function(t,n){return O.createElement(mr,ot({},t,{ref:n,icon:M3t}))},SVe=O.forwardRef(F3t);process.env.NODE_ENV!=="production"&&(SVe.displayName="PaperClipOutlined");var B3t={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:n}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:n}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:n}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},k3t=function(t,n){return O.createElement(mr,ot({},t,{ref:n,icon:B3t}))},CVe=O.forwardRef(k3t);process.env.NODE_ENV!=="production"&&(CVe.displayName="PictureTwoTone");function nP(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function rP(e,t){const n=ht(t),r=n.findIndex(o=>{let{uid:i}=o;return i===e.uid});return r===-1?n.push(e):n[r]=e,n}function PH(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(r=>r[n]===e[n])[0]}function L3t(e,t){const n=e.uid!==void 0?"uid":"name",r=t.filter(o=>o[n]!==e[n]);return r.length===t.length?null:r}const j3t=function(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},wVe=e=>e.indexOf("image/")===0,_3t=e=>{if(e.type&&!e.thumbUrl)return wVe(e.type);const t=e.thumbUrl||e.url||"",n=j3t(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(t)||n)},Ph=200;function H3t(e){return new Promise(t=>{if(!e.type||!wVe(e.type)){t("");return}const n=document.createElement("canvas");n.width=Ph,n.height=Ph,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${Ph}px; height: ${Ph}px; z-index: 9999; display: none;`,document.body.appendChild(n);const r=n.getContext("2d"),o=new Image;if(o.onload=()=>{const{width:i,height:a}=o;let s=Ph,l=Ph,u=0,c=0;i>a?(l=a*(Ph/i),c=-(l-s)/2):(s=i*(Ph/a),u=-(s-l)/2),r.drawImage(o,u,c,s,l);const f=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(o.src),t(f)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const i=new FileReader;i.onload=()=>{i.result&&typeof i.result=="string"&&(o.src=i.result)},i.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const i=new FileReader;i.onload=()=>{i.result&&t(i.result)},i.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var z3t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},V3t=function(t,n){return O.createElement(mr,ot({},t,{ref:n,icon:z3t}))},xVe=O.forwardRef(V3t);process.env.NODE_ENV!=="production"&&(xVe.displayName="DownloadOutlined");const U3t=O.forwardRef((e,t)=>{let{prefixCls:n,className:r,style:o,locale:i,listType:a,file:s,items:l,progress:u,iconRender:c,actionIconRender:f,itemRender:d,isImgUrl:p,showPreviewIcon:g,showRemoveIcon:m,showDownloadIcon:h,previewIcon:y,removeIcon:v,downloadIcon:b,onPreview:E,onDownload:S,onClose:C}=e;var w,A;const{status:D}=s,[T,$]=O.useState(D);O.useEffect(()=>{D!=="removed"&&$(D)},[D]);const[I,M]=O.useState(!1);O.useEffect(()=>{const Q=setTimeout(()=>{M(!0)},300);return()=>{clearTimeout(Q)}},[]);const R=c(s);let F=O.createElement("div",{className:`${n}-icon`},R);if(a==="picture"||a==="picture-card"||a==="picture-circle")if(T==="uploading"||!s.thumbUrl&&!s.url){const Q=$e(`${n}-list-item-thumbnail`,{[`${n}-list-item-file`]:T!=="uploading"});F=O.createElement("div",{className:Q},R)}else{const Q=p!=null&&p(s)?O.createElement("img",{src:s.thumbUrl||s.url,alt:s.name,className:`${n}-list-item-image`,crossOrigin:s.crossOrigin}):R,X=$e(`${n}-list-item-thumbnail`,{[`${n}-list-item-file`]:p&&!p(s)});F=O.createElement("a",{className:X,onClick:ne=>E(s,ne),href:s.url||s.thumbUrl,target:"_blank",rel:"noopener noreferrer"},Q)}const k=$e(`${n}-list-item`,`${n}-list-item-${T}`),L=typeof s.linkProps=="string"?JSON.parse(s.linkProps):s.linkProps,H=m?f((typeof v=="function"?v(s):v)||O.createElement(pVe,null),()=>C(s),n,i.removeFile,!0):null,z=h&&T==="done"?f((typeof b=="function"?b(s):b)||O.createElement(xVe,null),()=>S(s),n,i.downloadFile):null,_=a!=="picture-card"&&a!=="picture-circle"&&O.createElement("span",{key:"download-delete",className:$e(`${n}-list-item-actions`,{picture:a==="picture"})},z,H),P=$e(`${n}-list-item-name`),B=s.url?[O.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:P,title:s.name},L,{href:s.url,onClick:Q=>E(s,Q)}),s.name),_]:[O.createElement("span",{key:"view",className:P,onClick:Q=>E(s,Q),title:s.name},s.name),_],j=g&&(s.url||s.thumbUrl)?O.createElement("a",{href:s.url||s.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:Q=>E(s,Q),title:i.previewFile},typeof y=="function"?y(s):y||O.createElement(QB,null)):null,W=(a==="picture-card"||a==="picture-circle")&&T!=="uploading"&&O.createElement("span",{className:`${n}-list-item-actions`},j,T==="done"&&z,H),{getPrefixCls:K}=O.useContext(Sn),U=K(),G=O.createElement("div",{className:k},F,B,W,I&&O.createElement(Tl,{motionName:`${U}-fade`,visible:T==="uploading",motionDeadline:2e3},Q=>{let{className:X}=Q;const ne="percent"in s?O.createElement(qze,Object.assign({},u,{type:"line",percent:s.percent,"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"]})):null;return O.createElement("div",{className:$e(`${n}-list-item-progress`,X)},ne)})),Y=s.response&&typeof s.response=="string"?s.response:((w=s.error)===null||w===void 0?void 0:w.statusText)||((A=s.error)===null||A===void 0?void 0:A.message)||i.uploadError,q=T==="error"?O.createElement(NC,{title:Y,getPopupContainer:Q=>Q.parentNode},G):G;return O.createElement("div",{className:$e(`${n}-list-item-container`,r),style:o,ref:t},d?d(q,s,l,{download:S.bind(null,s),preview:E.bind(null,s),remove:C.bind(null,s)}):q)}),W3t=(e,t)=>{const{listType:n="text",previewFile:r=H3t,onPreview:o,onDownload:i,onRemove:a,locale:s,iconRender:l,isImageUrl:u=_3t,prefixCls:c,items:f=[],showPreviewIcon:d=!0,showRemoveIcon:p=!0,showDownloadIcon:g=!1,removeIcon:m,previewIcon:h,downloadIcon:y,progress:v={size:[-1,2],showInfo:!1},appendAction:b,appendActionVisible:E=!0,itemRender:S,disabled:C}=e,w=n2t(),[A,D]=O.useState(!1);O.useEffect(()=>{n!=="picture"&&n!=="picture-card"&&n!=="picture-circle"||(f||[]).forEach(j=>{typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(j.originFileObj instanceof File||j.originFileObj)||j.thumbUrl!==void 0||r&&r(j.originFileObj).then(W=>{j.thumbUrl=W||"",w()})})},[n,f,r]),O.useEffect(()=>{D(!0)},[]);const T=(j,W)=>{if(o)return W==null||W.preventDefault(),o(j)},$=j=>{typeof i=="function"?i(j):j.url&&window.open(j.url)},I=j=>{a==null||a(j)},M=j=>{if(l)return l(j,n);const W=j.status==="uploading",K=u&&u(j)?O.createElement(CVe,null):O.createElement(EVe,null);let U=W?O.createElement(Rg,null):O.createElement(SVe,null);return n==="picture"?U=W?O.createElement(Rg,null):K:(n==="picture-card"||n==="picture-circle")&&(U=W?s.uploading:K),U},R=(j,W,K,U,G)=>{const Y={type:"text",size:"small",title:U,onClick:q=>{var Q,X;W(),O.isValidElement(j)&&((X=(Q=j.props).onClick)===null||X===void 0||X.call(Q,q))},className:`${K}-list-item-action`};if(G&&(Y.disabled=C),O.isValidElement(j)){const q=qu(j,Object.assign(Object.assign({},j.props),{onClick:()=>{}}));return O.createElement(Sl,Object.assign({},Y,{icon:q}))}return O.createElement(Sl,Object.assign({},Y),O.createElement("span",null,j))};O.useImperativeHandle(t,()=>({handlePreview:T,handleDownload:$}));const{getPrefixCls:F}=O.useContext(Sn),k=F("upload",c),L=F(),H=$e(`${k}-list`,`${k}-list-${n}`),z=ht(f.map(j=>({key:j.uid,file:j})));let P={motionDeadline:2e3,motionName:`${k}-${n==="picture-card"||n==="picture-circle"?"animate-inline":"animate"}`,keys:z,motionAppear:A};const B=O.useMemo(()=>{const j=Object.assign({},bR(L));return delete j.onAppearEnd,delete j.onEnterEnd,delete j.onLeaveEnd,j},[L]);return n!=="picture-card"&&n!=="picture-circle"&&(P=Object.assign(Object.assign({},B),P)),O.createElement("div",{className:H},O.createElement(_Le,Object.assign({},P,{component:!1}),j=>{let{key:W,file:K,className:U,style:G}=j;return O.createElement(U3t,{key:W,locale:s,prefixCls:k,className:U,style:G,file:K,items:f,progress:v,listType:n,isImgUrl:u,showPreviewIcon:d,showRemoveIcon:p,showDownloadIcon:g,removeIcon:m,previewIcon:h,downloadIcon:y,iconRender:M,actionIconRender:R,itemRender:S,onPreview:T,onDownload:$,onClose:I})}),b&&O.createElement(Tl,Object.assign({},P,{visible:E,forceRender:!0}),j=>{let{className:W,style:K}=j;return qu(b,U=>({className:$e(U.className,W),style:Object.assign(Object.assign(Object.assign({},K),{pointerEvents:W?"none":void 0}),U.style)}))}))},AVe=O.forwardRef(W3t);process.env.NODE_ENV!=="production"&&(AVe.displayName="UploadList");var K3t=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(c){try{u(r.next(c))}catch(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?i(c.value):o(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})};const q$=`__LIST_IGNORE_${Date.now()}__`,G3t=(e,t)=>{const{fileList:n,defaultFileList:r,onRemove:o,showUploadList:i=!0,listType:a="text",onPreview:s,onDownload:l,onChange:u,onDrop:c,previewFile:f,disabled:d,locale:p,iconRender:g,isImageUrl:m,progress:h,prefixCls:y,className:v,type:b="select",children:E,style:S,itemRender:C,maxCount:w,data:A={},multiple:D=!1,hasControlInside:T=!0,action:$="",accept:I="",supportServerRender:M=!0,rootClassName:R}=e,F=O.useContext($s),k=d??F,[L,H]=Wr(r||[],{value:n,postState:Me=>Me??[]}),[z,_]=O.useState("drop"),P=O.useRef(null),B=O.useRef(null);if(process.env.NODE_ENV!=="production"){const Me=Gr("Upload");process.env.NODE_ENV!=="production"&&Me("fileList"in e||!("value"in e),"usage","`value` is not a valid prop, do you mean `fileList`?"),Me.deprecated(!("transformFile"in e),"transformFile","beforeUpload")}O.useMemo(()=>{const Me=Date.now();(n||[]).forEach((Pe,Ye)=>{!Pe.uid&&!Object.isFrozen(Pe)&&(Pe.uid=`__AUTO__${Me}_${Ye}__`)})},[n]);const j=(Me,Pe,Ye)=>{let Re=ht(Pe),Ve=!1;w===1?Re=Re.slice(-1):w&&(Ve=Re.length>w,Re=Re.slice(0,w)),Jl.flushSync(()=>{H(Re)});const it={file:Me,fileList:Re};Ye&&(it.event=Ye),(!Ve||Me.status==="removed"||Re.some(At=>At.uid===Me.uid))&&Jl.flushSync(()=>{u==null||u(it)})},W=(Me,Pe)=>K3t(void 0,void 0,void 0,function*(){const{beforeUpload:Ye,transformFile:Re}=e;let Ve=Me;if(Ye){const it=yield Ye(Me,Pe);if(it===!1)return!1;if(delete Me[q$],it===q$)return Object.defineProperty(Me,q$,{value:!0,configurable:!0}),!1;typeof it=="object"&&it&&(Ve=it)}return Re&&(Ve=yield Re(Ve)),Ve}),K=Me=>{const Pe=Me.filter(Ve=>!Ve.file[q$]);if(!Pe.length)return;const Ye=Pe.map(Ve=>nP(Ve.file));let Re=ht(L);Ye.forEach(Ve=>{Re=rP(Ve,Re)}),Ye.forEach((Ve,it)=>{let At=Ve;if(Pe[it].parsedFile)Ve.status="uploading";else{const{originFileObj:vt}=Ve;let mt;try{mt=new File([vt],vt.name,{type:vt.type})}catch{mt=new Blob([vt],{type:vt.type}),mt.name=vt.name,mt.lastModifiedDate=new Date,mt.lastModified=new Date().getTime()}mt.uid=Ve.uid,At=mt}j(At,Re)})},U=(Me,Pe,Ye)=>{try{typeof Me=="string"&&(Me=JSON.parse(Me))}catch{}if(!PH(Pe,L))return;const Re=nP(Pe);Re.status="done",Re.percent=100,Re.response=Me,Re.xhr=Ye;const Ve=rP(Re,L);j(Re,Ve)},G=(Me,Pe)=>{if(!PH(Pe,L))return;const Ye=nP(Pe);Ye.status="uploading",Ye.percent=Me.percent;const Re=rP(Ye,L);j(Ye,Re,Me)},Y=(Me,Pe,Ye)=>{if(!PH(Ye,L))return;const Re=nP(Ye);Re.error=Me,Re.response=Pe,Re.status="error";const Ve=rP(Re,L);j(Re,Ve)},q=Me=>{let Pe;Promise.resolve(typeof o=="function"?o(Me):o).then(Ye=>{var Re;if(Ye===!1)return;const Ve=L3t(Me,L);Ve&&(Pe=Object.assign(Object.assign({},Me),{status:"removed"}),L==null||L.forEach(it=>{const At=Pe.uid!==void 0?"uid":"name";it[At]===Pe[At]&&!Object.isFrozen(it)&&(it.status="removed")}),(Re=P.current)===null||Re===void 0||Re.abort(Pe),j(Pe,Ve))})},Q=Me=>{_(Me.type),Me.type==="drop"&&(c==null||c(Me))};O.useImperativeHandle(t,()=>({onBatchStart:K,onSuccess:U,onProgress:G,onError:Y,fileList:L,upload:P.current,nativeElement:B.current}));const{getPrefixCls:X,direction:ne,upload:se}=O.useContext(Sn),ee=X("upload",y),le=Object.assign(Object.assign({onBatchStart:K,onError:Y,onProgress:G,onSuccess:U},e),{data:A,multiple:D,action:$,accept:I,supportServerRender:M,prefixCls:ee,disabled:k,beforeUpload:W,onChange:void 0,hasControlInside:T});delete le.className,delete le.style,(!E||k)&&delete le.id;const me=`${ee}-wrapper`,[we,ce,ue]=P3t(ee,me),[ge]=ih("Upload",Xu.Upload),{showRemoveIcon:pe,showPreviewIcon:Se,showDownloadIcon:je,removeIcon:Ae,previewIcon:ke,downloadIcon:Xe}=typeof i=="boolean"?{}:i,st=typeof pe>"u"?!k:!!pe,Ue=(Me,Pe)=>i?O.createElement(AVe,{prefixCls:ee,listType:a,items:L,previewFile:f,onPreview:s,onDownload:l,onRemove:q,showRemoveIcon:st,showPreviewIcon:Se,showDownloadIcon:je,removeIcon:Ae,previewIcon:ke,downloadIcon:Xe,iconRender:g,locale:Object.assign(Object.assign({},ge),p),isImageUrl:m,progress:h,appendAction:Me,appendActionVisible:Pe,itemRender:C,disabled:k}):Me,at=$e(me,v,R,ce,ue,se==null?void 0:se.className,{[`${ee}-rtl`]:ne==="rtl",[`${ee}-picture-card-wrapper`]:a==="picture-card",[`${ee}-picture-circle-wrapper`]:a==="picture-circle"}),Ke=Object.assign(Object.assign({},se==null?void 0:se.style),S);if(b==="drag"){const Me=$e(ce,ee,`${ee}-drag`,{[`${ee}-drag-uploading`]:L.some(Pe=>Pe.status==="uploading"),[`${ee}-drag-hover`]:z==="dragover",[`${ee}-disabled`]:k,[`${ee}-rtl`]:ne==="rtl"});return we(O.createElement("span",{className:at,ref:B},O.createElement("div",{className:Me,style:Ke,onDrop:Q,onDragOver:Q,onDragLeave:Q},O.createElement(PZ,Object.assign({},le,{ref:P,className:`${ee}-btn`}),O.createElement("div",{className:`${ee}-drag-container`},E))),Ue()))}const ut=$e(ee,`${ee}-select`,{[`${ee}-disabled`]:k}),_e=O.createElement("div",{className:ut,style:E?void 0:{display:"none"}},O.createElement(PZ,Object.assign({},le,{ref:P})));return we(a==="picture-card"||a==="picture-circle"?O.createElement("span",{className:at,ref:B},Ue(_e,!!E)):O.createElement("span",{className:at,ref:B},_e,Ue()))},xle=O.forwardRef(G3t);process.env.NODE_ENV!=="production"&&(xle.displayName="Upload");var Y3t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const $Ve=O.forwardRef((e,t)=>{var{style:n,height:r,hasControlInside:o=!1}=e,i=Y3t(e,["style","height","hasControlInside"]);return O.createElement(xle,Object.assign({ref:t,hasControlInside:o},i,{type:"drag",style:Object.assign(Object.assign({},n),{height:r})}))});process.env.NODE_ENV!=="production"&&($Ve.displayName="Dragger");const nk=xle;nk.Dragger=$Ve;nk.LIST_IGNORE=q$;const ui=e=>{var t;let{label:n,higLabel:r=!1,children:o,prompt:i,subTable:a,subTableHead:s=!1,subTableContent:l=!0,hidePrompt:u=!1,subTableIndex:c,addWrapper:f=!0,calcHidden:d=!1,defaultValue:p,value:g,onChange:m,readonly:h,isRequired:y,initializeFormRender:v,...b}=e;const E=J.useRef(!1);if(J.useEffect(()=>{E.current!=d&&(console.log(n+" calcHiddenRef.current",E.current),console.log(n+" calcHiddenRef.current",d),typeof v=="function"&&v(),E.current=d)},[d]),J.useEffect(()=>{p&&typeof m=="function"&&!g&&m(p)},[]),!f)return o;["UploadImage","UploadFile","Table","WithMultipleSelect","WithSingleSelect"].includes(o==null||(t=o.type)===null||t===void 0?void 0:t.displayName)&&h&&(h=!1);const C=Le.jsxs("div",{className:"frelative fw-full",children:[n&&Le.jsxs(Le.Fragment,{children:[!r&&Le.jsxs("div",{className:"fh-8 ftext-gray-500 ftext-sm fflex fitems-center ".concat(r?" ftext-xl fmy-2 ftext-black":""),children:[n,y&&Le.jsx("span",{className:"ftext-red-500 ffont-bold",children:"*"})]}),r&&Le.jsxs("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:[Le.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:n}),y&&Le.jsx("span",{className:"ftext-red-500 ffont-bold",children:"*"})]})]}),Le.jsxs("div",{className:"fw-full fflex fitems-stretch ftext-gray-900 frelative",children:[h&&Le.jsx("div",{className:"fw-full fh-full fbg-gray-100 fopacity-5 fcursor-not-allowed fabsolute fleft-0 ftop-0 fz-10"}),o]}),!u&&i&&Le.jsx("div",{className:"ftext-xs ftext-gray-500 fmin-h-5 fflex fitems-center",children:i})]});return a?Le.jsxs("div",{className:"frelative fw-full",children:[s&&n&&Le.jsx("div",{className:"fh-12 ffont-semibold fbg-[#fafafa] ftext-sm fflex fitems-center fborder-b fpl-2 f-mx-1",children:Le.jsxs("div",{className:"fw-full fborder-r fborder-r-[#e9e9e9]",children:[n,y&&Le.jsx("span",{className:"ftext-red-500",children:"*"})]})}),l&&Le.jsxs("div",{className:"fw-full fflex fitems-stretch frelative fpy-2",children:[h&&Le.jsx("div",{className:"fw-full fh-full fbg-gray-50 fopacity-5 fcursor-not-allowed fabsolute fleft-0 ftop-0 fz-10"}),o]})]}):C};var MR={exports:{}};/**
|
336
336
|
* @license
|
337
337
|
* Lodash <https://lodash.com/>
|
338
338
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
@@ -413,7 +413,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
413
413
|
transform: rotate(360deg);
|
414
414
|
}
|
415
415
|
}
|
416
|
-
`,tPt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ePt,n=J.useContext(OVe),r=n.csp;J.useEffect(function(){qf(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},nPt=["icon","className","onClick","style","primaryColor","secondaryColor"],TO={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function rPt(e){var t=e.primaryColor,n=e.secondaryColor;TO.primaryColor=t,TO.secondaryColor=n||JVe(t),TO.calculated=!!n}function oPt(){return he({},TO)}var BC=function(t){var n=t.icon,r=t.className,o=t.onClick,i=t.style,a=t.primaryColor,s=t.secondaryColor,l=vn(t,nPt),u=TO;if(a&&(u={primaryColor:a,secondaryColor:s||JVe(a)}),tPt(),JIt(aSe(n),"icon should be icon definiton, but got ".concat(n)),!aSe(n))return null;var c=n;return c&&typeof c.icon=="function"&&(c=he(he({},c),{},{icon:c.icon(u.primaryColor,u.secondaryColor)})),FZ(c.icon,"svg-".concat(c.name),he({className:r,onClick:o,style:i,"data-icon":c.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};BC.displayName="IconReact";BC.getTwoToneColors=oPt;BC.setTwoToneColors=rPt;function tUe(e){var t=eUe(e),n=be(t,2),r=n[0],o=n[1];return BC.setTwoToneColors({primaryColor:r,secondaryColor:o})}function iPt(){var e=BC.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var aPt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];tUe("#1890ff");var pm=O.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,i=e.rotate,a=e.tabIndex,s=e.onClick,l=e.twoToneColor,u=vn(e,aPt),c=O.useContext(OVe),f=c.prefixCls,d=f===void 0?"anticon":f,p=c.rootClassName,g=$e(p,d,ie(ie({},"".concat(d,"-").concat(r.name),!!r.name),"".concat(d,"-spin"),!!o||r.name==="loading"),n),m=a;m===void 0&&s&&(m=-1);var h=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,y=eUe(l),v=be(y,2),b=v[0],E=v[1];return O.createElement("span",he(he({role:"img","aria-label":r.name},u),{},{ref:t,tabIndex:m,onClick:s,className:g}),O.createElement(BC,{icon:r,primaryColor:b,secondaryColor:E,style:h}))});pm.displayName="AntdIcon";pm.getTwoToneColor=iPt;pm.setTwoToneColor=tUe;var sPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:h3t}))},nUe=O.forwardRef(sPt);process.env.NODE_ENV!=="production"&&(nUe.displayName="CopyOutlined");var lPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:dVe}))},Ale=O.forwardRef(lPt);process.env.NODE_ENV!=="production"&&(Ale.displayName="DeleteOutlined");var uPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:hze}))},rUe=O.forwardRef(uPt);process.env.NODE_ENV!=="production"&&(rUe.displayName="EyeOutlined");var cPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:VHe}))},oUe=O.forwardRef(cPt);process.env.NODE_ENV!=="production"&&(oUe.displayName="PlusOutlined");var fPt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},dPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:fPt}))},iUe=O.forwardRef(dPt);process.env.NODE_ENV!=="production"&&(iUe.displayName="UploadOutlined");function aUe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"id",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"title",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"parentId",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"children",i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0;return pPt(e,t,n,r,o,i,s=>({value:s[t],title:s[n],key:s[t],disabled:s[t]===a}))}function pPt(e,t,n,r,o,i,a){if(!Array.isArray(e)||e.length===0)return[];const s=e.map(l=>({...l,...a(l)}));return s.filter(l=>{const u=s.filter(c=>l[t]===c[r]);return l[o]=u.length>0?u:[],l[r]===i})}const sUe=e=>{let{request:t,title:n,disabledValue:r,callError:o,...i}=e;const[a,s]=J.useState(!1),[l,u]=J.useState([]);J.useEffect(()=>{c()},[]);const c=async()=>{if(t&&typeof t=="function"){var f;const d=await t();if(d.code>0){o&&typeof o=="function"&&o(d.message);return}let p=aUe(((f=d.data)===null||f===void 0?void 0:f.list)||d.data||[],"id",n||"title",i.parentId||"parentId","children",0,r);p=[{value:0,title:"根节点",children:p}],i.treeData=p,u(p)}i.treeData&&u(i.treeData),s(!0)};return Le.jsx(ui,{...i,children:a&&Le.jsx(dm,{...i,treeData:l,treeDefaultExpandAll:!0,style:{width:"100%"}})})},$le=J.forwardRef((e,t)=>{let{addWrapper:n=!0,form:r,fieldName:o,fieldsValue:i,shouldUpdateKey:a,value:s,type:l,defaultValue:u,onChange:c,option_label:f,option_value:d,option_search:p,options:g,request:m,requestParams:h,callError:y,subRequest:v,sub_option_label:b="label",mode:E="single",sub_option_value:S="id",rightIconRender:C,rightIcon:w,rightIconClick:A,recordFieldsChange:D,...T}=e;const[$,I]=J.useState([]),[M,R]=J.useState(!1),F=J.useRef(1),k=10,L=J.useRef(!1),H=J.useRef(!1);J.useEffect(()=>{if(s){let q=null;Array.isArray($)&&$.length>0&&(q=$.find(Q=>Q.value==(s==null?void 0:s.value)||Q.value==s),q&&!xp.isEqual(q,s)&&(console.log("new value /////",q),typeof c=="function"&&c(q))),q||z()}},[s]),J.useEffect(()=>{console.log("SearchSelect useEffect shouldUpdateKey",a),console.log("SearchSelect useEffect requestParams",h),_(h)},[a,h]);const z=async()=>{m&&d&&B({...h,[d]:s==null?void 0:s.value},null,q=>{if(console.log("loadSelectOptions selectOptions",q),q&&q.length>0){let Q=q.find(X=>X.value==(s==null?void 0:s.value)||X.value==s);console.log("loadSelectOptions item",Q),Q&&!xp.isEqual(Q,s)&&(console.log("new value /////",Q),typeof c=="function"&&c(Q))}})},_=async q=>{const Q={};F.current=1,L.current=!1,m&&typeof m=="function"&&B(q,Q),g&&g.length>0&&I(g)},P=async q=>{const Q={...h};Q[p]=q,await B(Q)},B=J.useCallback(xp.debounce((q,Q,X)=>{K(q,Q).then(ne=>{typeof X=="function"&&X(ne)})},200),[]),j=async(q,Q)=>{let X=[];if(!(Q&&Object.values(Q).some(se=>se==="##norequest##"))){var ne;R(!0);const se=await m({...q,ruleParams:Q},r,o);R(!1),se.code>0?y&&typeof y=="function"&&y(se.message):X=((ne=se.data)===null||ne===void 0?void 0:ne.list)||se.data}return X},W=async q=>{if(Array.isArray(q)){for(let Q=0;Q<q.length;Q++){const X=q[Q];if(typeof v=="function"){let ne=[];const{data:se}=await v(X);se!=null&&se.list&&Array.isArray(se.list)&&(ne=se.list.map(ee=>({label:"".concat(X[f],"-").concat(ee[b]),value:"".concat(X[d],"-").concat(ee[S])}))),q[Q]={...X,label:X[f],title:X[f],options:ne}}q[Q]={...X,label:X[f],value:X[d]}}$.length>0&&!xp.isEqual($,q)&&typeof c=="function"&&c(void 0)}return q},K=async(q,Q)=>{try{let X=await j(q,Q);return X=await W(X),I(Array.isArray(X)?X:[]),X}catch(X){console.error("fetchOptions",X),R(!1)}finally{}},U=q=>{Array.isArray(q)?c(q.map(Q=>$.find(X=>X.value===Q))):c($.find(Q=>Q.value===q))},G=q=>{const{target:Q}=q;Q.scrollTop+Q.clientHeight>=Q.scrollHeight-50&&Y()},Y=async()=>{if(!(L.current||H.current)){H.current=!0;try{const q={...h,page:F.current+1,pageSize:k};let Q=await j(q,null);Q=await W(Q),Array.isArray(Q)&&Q.length>0?I(X=>{const ne=new Set(X.map(ee=>ee.value)),se=Q.filter(ee=>!ne.has(ee.value));return[...X,...se]}):L.current=!0,F.current+=1}catch(q){console.error("加载更多选项时出错",q)}finally{H.current=!1}}};return n?Le.jsxs(ui,{...T,children:[Le.jsx(ud,{ref:t,notFoundContent:M?Le.jsx(WD,{size:"small"}):null,value:s,...T,filterOption:!1,showSearch:!!(m&&p),onSearch:m&&p?P:null,onChange:U,style:{width:"100%",flex:1},options:$,onPopupScroll:typeof m=="function"?G:null,mode:E}),!(T!=null&&T.disabled)&&w,!(T!=null&&T.disabled)&&typeof C=="function"&&C({value:s,onChange:c,form:r,fieldName:o,recordFieldsChange:D})]}):Le.jsxs(Le.Fragment,{children:[Le.jsx(ud,{ref:t,notFoundContent:M?Le.jsx(WD,{size:"small"}):null,value:s,...T,filterOption:!1,showSearch:!!(m&&p),onSearch:m&&p?P:null,onChange:U,style:{width:"100%"},options:$,onPopupScroll:typeof m=="function"?G:null,mode:E}),!(T!=null&&T.disabled)&&w,!(T!=null&&T.disabled)&&typeof C=="function"&&C({value:s,onChange:c,form:r,fieldName:o,recordFieldsChange:D})]})}),Ole=e=>{let{request:t,option_label:n="label",option_value:r="id",disabledValue:o,callError:i,options:a,addWrapper:s=!0,...l}=e;const[u,c]=J.useState([]);J.useEffect(()=>{f()},[]);const f=async()=>{if(t&&typeof t=="function"){var d;const p=await t();if(p.code>0){i&&typeof i=="function"&&i(p.message);return}let g=((d=p.data)===null||d===void 0?void 0:d.list)||p.data;Array.isArray(g)&&g.length>0&&c(g.map(m=>({label:m[n],value:m[r]})))}a&&a.length>0&&c(a)};return s?Le.jsx(ui,{...l,children:Le.jsx(ud,{...l,options:u,style:{width:"100%"}})}):Le.jsx(ud,{...l,options:u,style:{width:"100%"}})},hPt=e=>{let{...t}=e;return Le.jsx(Ole,{...t,mode:"single"})},vPt=e=>{let{onChange:t,value:n,...r}=e;const[o,i]=J.useState([]);return J.useEffect(()=>{if(n&&typeof n=="string")try{n=JSON.parse(n),t(n)}catch{}n&&i(n)},[n]),Le.jsx(Ole,{...r,onChange:t,mode:"multiple",value:o})},lUe=e=>{var t,n;let{readItemRender:r,readonly:o,onChange:i,onCustomChange:a,value:s,form:l,fieldName:u,...c}=e;return J.useEffect(()=>{if(s&&typeof s=="string")try{s=JSON.parse(s),l==null||l.setFieldValue(u,s),console.log("WithSingleSelect useEffect onChange////// form",l),console.log("WithSingleSelect useEffect onChange////// fieldName",u),console.log("WithSingleSelect useEffect onChange////// value",s)}catch(f){console.log("WithSingleSelect useEffect error",f)}},[s]),o?Le.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:s&&s.label&&Le.jsx(Le.Fragment,{children:r&&typeof r=="function"?r(s):Le.jsx("span",{children:(t=s)===null||t===void 0?void 0:t.label},"btn_".concat((n=s)===null||n===void 0?void 0:n.value))})}):Le.jsx($le,{addWrapper:!1,form:l,fieldName:u,...c,onChange:i,value:s,mode:"single",className:" fflex-1 foverflow-hidden"})},uUe=e=>{let{readItemRender:t,readonly:n,onChange:r,value:o,form:i,fieldName:a,...s}=e;return J.useEffect(()=>{if(o&&typeof o=="string")try{o=JSON.parse(o),r(o)}catch{}},[o]),n?Le.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:Array.isArray(o)&&o.map((l,u)=>Le.jsxs(Le.Fragment,{children:[" ",t&&typeof t=="function"?t(l):Le.jsx("span",{children:l==null?void 0:l.label},"btn_".concat(l==null?void 0:l.value)),u<o.length-1?Le.jsx("span",{className:" ftext-gray-400",children:","}):null]}))}):Le.jsx($le,{addWrapper:!1,form:i,fieldName:a,...s,onChange:r,value:o,mode:"multiple",className:" fflex-1 foverflow-hidden"})},gPt=e=>{let{customComponent:t,...n}=e;return t?Le.jsx(ui,{...n,children:Le.jsx(t,{...n})}):Le.jsx(ui,{...n,children:Le.jsx(ah,{...n})})},cUe=e=>{let{onChange:t,value:n,multiple:r,...o}=e;const[i,a]=J.useState();J.useEffect(()=>{if(n&&typeof n=="string")try{n=JSON.parse(n),t(n);return}catch{}r?Array.isArray(n)&&a(n):(Array.isArray(n)&&(n=n[0]),a(n))},[n]);const s=l=>{Array.isArray(l)||(l=[l]),t&&typeof t=="function"&&t(l)};return Le.jsx(sUe,{...o,onChange:s,value:i,multiple:r})},mPt=e=>{let{FetchDeptList:t,...n}=e;return Le.jsx(cUe,{...n,title:"deptName",request:t})},yPt=e=>{let{FetchPostList:t,...n}=e;return Le.jsx(cUe,{...n,title:"postName",request:t})};lUe.displayName="WithSingleSelect";uUe.displayName="WithMultipleSelect";const bPt=J.forwardRef((e,t)=>(J.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),Le.jsx(ui,{...e,children:Le.jsx(lUe,{...e})}))),EPt=J.forwardRef((e,t)=>(J.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),Le.jsx(ui,{...e,children:Le.jsx(uUe,{...e})}))),SPt=J.forwardRef((e,t)=>{let{value:n,onChange:r,...o}=e;const i=J.useRef(0),a=()=>{i.current++,r(i.current)};return Le.jsxs(ui,{...o,children:[Le.jsxs("div",{ref:t,children:["form-set-value:",n]}),Le.jsx(Sl,{onClick:a,children:"test"})]})}),CPt=e=>{let t="",n="";try{n="return ".concat(e.join("")),t=new Function(n)(),t=t.toString()}catch(r){console.error("formula (".concat(n,") error"),r)}return t},wPt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Mf=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=wPt[n[e]&63];return t};var fUe={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function i(l,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new o(c,f||l,d),g=n?n+u:u;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],p]:l._events[g].push(p):(l._events[g]=p,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)t.call(c,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=n?n+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,p=f.length,g=new Array(p);d<p;d++)g[d]=f[d].fn;return g},s.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},s.prototype.emit=function(u,c,f,d,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var h=this._events[m],y=arguments.length,v,b;if(h.fn){switch(h.once&&this.removeListener(u,h.fn,void 0,!0),y){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,c),!0;case 3:return h.fn.call(h.context,c,f),!0;case 4:return h.fn.call(h.context,c,f,d),!0;case 5:return h.fn.call(h.context,c,f,d,p),!0;case 6:return h.fn.call(h.context,c,f,d,p,g),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];h.fn.apply(h.context,v)}else{var E=h.length,S;for(b=0;b<E;b++)switch(h[b].once&&this.removeListener(u,h[b].fn,void 0,!0),y){case 1:h[b].fn.call(h[b].context);break;case 2:h[b].fn.call(h[b].context,c);break;case 3:h[b].fn.call(h[b].context,c,f);break;case 4:h[b].fn.call(h[b].context,c,f,d);break;default:if(!v)for(S=1,v=new Array(y-1);S<y;S++)v[S-1]=arguments[S];h[b].fn.apply(h[b].context,v)}}return!0},s.prototype.on=function(u,c,f){return i(this,u,c,f,!1)},s.prototype.once=function(u,c,f){return i(this,u,c,f,!0)},s.prototype.removeListener=function(u,c,f,d){var p=n?n+u:u;if(!this._events[p])return this;if(!c)return a(this,p),this;var g=this._events[p];if(g.fn)g.fn===c&&(!d||g.once)&&(!f||g.context===f)&&a(this,p);else{for(var m=0,h=[],y=g.length;m<y;m++)(g[m].fn!==c||d&&!g[m].once||f&&g[m].context!==f)&&h.push(g[m]);h.length?this._events[p]=h.length===1?h[0]:h:a(this,p)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&a(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(fUe);var xPt=fUe.exports;const APt=Gs(xPt),BZ=new APt,$Pt=e=>{let{children:t,layout:n,onTableAddRow:r,onTableRemoveRow:o,form:i,initializeFormRender:a,recordFieldsChange:s,mode:l}=e;n=n||"1";const u=p=>{const g=p.split(",").map(Number),m=24;return g.map(h=>h/g.reduce((y,v)=>y+v)*m)},c=J.useMemo(()=>u(n),[n]),f=J.useRef({}),d=J.useMemo(()=>J.Children.toArray(t).map((p,g)=>{var m,h;const y=p.props,v=(y==null?void 0:y.componentId)||(y==null?void 0:y.__id),b=v;var E=((m=p.type)===null||m===void 0?void 0:m.displayName)||((h=p.props)===null||h===void 0?void 0:h._componentName);b in f.current||(f.current[b]=Mf());const S=(y==null?void 0:y.calcHidden)&&l!="desgin",C=[];if(y!=null&&y.isRequired&&C.push({required:!0,message:"".concat(y.label,"必须填写")}),y!=null&&y.rules)if(Array.isArray(y.rules)){const D=y.rules.join("|");C.push({pattern:new RegExp(D),message:y.rulesFailMessage?y.rulesFailMessage:"".concat(y.label,"格式错误")})}else C.push({pattern:new RegExp(y.rules),message:y.rulesFailMessage?y.rulesFailMessage:"".concat(y.label,"格式错误")});const w=D=>{i.setFieldValue(b,D)};let A=null;return E=="Field.Table"?A=J.cloneElement(p,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:v,initializeFormRender:a,mode:l,recordFieldsChange:s}):E==="Field.WithSingleSelect"||E==="Field.WithMultipleSelect"||E==="Show.WithTable"?A=Le.jsx(sa.Item,{hidden:S,style:{margin:0},shouldUpdate:(D,T)=>{let $=!1;if(Array.isArray(y.filterRules)&&y.filterRules.length>0)for(let I of y.filterRules){if(I.valueType!="variable")continue;let M,R;if(M=D==null?void 0:D[I.value.field_key],R=T==null?void 0:T[I.value.field_key],M!==R){$=!0;break}}return $&&(f.current[b]=Mf()),$},children:D=>{let{getFieldsValue:T}=D;const $=T();let I=J.cloneElement(p,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:b,onCustomChange:w,fieldsValue:$,initializeFormRender:a,recordFieldsChange:s,shouldUpdateKey:f.current[b]});return E==="Show.WithTable"?Le.jsx(Le.Fragment,{children:I}):Le.jsx(sa.Item,{style:{marginBottom:0},label:"",name:b,rules:C,children:I})}}):J.isValidElement(p)?A=Le.jsx(sa.Item,{style:{marginBottom:0},label:"",name:v,rules:C,children:J.cloneElement(p,{form:i,fieldName:v,initializeFormRender:a,recordFieldsChange:s})},"".concat(v,"-form-item")):A=p,(c==null?void 0:c[g])&&Le.jsx(oT,{span:c[g],children:A},g)}),[t,c]);return Le.jsx(XB,{gutter:24,children:d})},OPt=e=>{let{title:t}=e;return t?Le.jsx("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:Le.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:t})}):null};function DPt(e,t){const n=[];let r=[];const o=(a,s)=>{const l=a-s.length;l>0&&s.push(...new Array(l).fill(J.createElement("div")))};for(const a of e){var i;const{_componentName:s}=(a==null?void 0:a.props)||{},l=((i=a.type)===null||i===void 0?void 0:i.displayName)||s;l&&l.startsWith("Layout.")?(r.length>0&&(o(t,r),n.push(r),r=[]),n.push([a])):(r.push(a),r.filter(c=>{var f;return!(c!=null&&(f=c.props)!==null&&f!==void 0&&f.calcHidden)}).length===t&&(n.push(r),r=[]))}return r.length>0&&(o(t,r),n.push(r)),n}const Dle=J.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=sa.useForm(),[a,s]=J.useState(null),l=J.useRef(null),u=J.useRef(0);J.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:F=>{u.current=1;let k={...F,__id:F==null?void 0:F.id};for(let L in F)if(A.current[L]={name:L,value:F[L]},l.current.has(L)&&l.current.get(L).componentName=="Field.Table"&&Array.isArray(F[L]))for(let H=0;H<F[L].length;H++){const z=F[L][H];for(let _ in z)A.current[[L,H,_]]={name:[L,H,_],value:z[L]}}console.log("changedFieldsState",A.current),i.setFieldsValue(k),setTimeout(()=>{D()},0)},initializeFieldVisibility:m}),[]);const c=J.useCallback(xp.throttle(()=>{g(),s(R())},300),[r,n]);J.useEffect(()=>(console.log("children",r),c(),()=>{c.cancel()}),[r,n]);const f=()=>{c()},d=J.useRef(null),p=F=>{var k;return(k=d.current)===null||k===void 0?void 0:k[F]},g=()=>{const F=[];function k(H){var z,_;let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;var B=((z=H.type)===null||z===void 0?void 0:z.displayName)||((_=H.props)===null||_===void 0?void 0:_._componentName);const{props:j}=H;if(B&&(B.startsWith("Field.")||B.startsWith("Layout."))){let U=(j==null?void 0:j.componentId)||(j==null?void 0:j.__id),G=[];if(P&&P!==null&&P!==void 0&&P.props){var W,K;U="".concat((P==null||(W=P.props)===null||W===void 0?void 0:W.componentId)||(P==null||(K=P.props)===null||K===void 0?void 0:K.__id),".").concat(U)}j!=null&&j.withId&&G.push(j==null?void 0:j.withId),j!=null&&j.withIds&&(G=[...G,...j==null?void 0:j.withIds]),F.push({identifier:U,withIds:G,component:H,componentName:B,fillRules:j==null?void 0:j.fillRules})}j!=null&&j.children&&J.Children.toArray(j==null?void 0:j.children).forEach(G=>k(G,B&&B.startsWith("Field.")?H:null))}l.current=new Map,console.log(" fields",F);const L=J.Children.toArray(r);for(let H=0;H<L.length;H++){const z=L[H];k(z)}F.forEach(H=>{const{identifier:z}=H;l.current.set(z,{children:F.filter(_=>_.withIds.some(P=>P==z)),show:!0,...H})}),console.log("dependencyMap.current",l.current),m()},m=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const k=i.getFieldsValue();for(let L of l.current.keys())h(L,k,!0);F&&s(R())},h=function(F,k){let L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,H=!1,z=[];if(Array.isArray(F)&&(z=[...F.slice(0,-1)],F=F.filter(_=>typeof _=="string").join(".")),l.current.has(F)){const _=l.current.get(F),P=_.children;!L&&_!==null&&_!==void 0&&_.fillRules&&Array.isArray(_==null?void 0:_.fillRules)&&(_==null?void 0:_.fillRules.length)>0&&E(F,z,k,_==null?void 0:_.fillRules),P.forEach(B=>{B.component.props.withFunc&&typeof B.component.props.withFunc=="function"&&(H=S(k,B)),!L&&B.component.props.withFill&&C(k,B,z,_==null?void 0:_.componentName)})}return H},y=function(F){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(d.current)if(k){const L=Object.keys(d.current);for(let H=0;H<L.length;H++){const z=L[H];z.includes("".concat(F,","))&&delete d.current[z]}}else delete d.current[F]},v=(F,k)=>{A.current||(A.current={}),A.current[F]=k},b=function(F){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var L=Object.keys(F);L.length>0&&(L.forEach(H=>{v(H,F[H])}),k&&D())},E=(F,k,L,H)=>{let z=w("fieldsValue",F,L,null),_={},P=[];for(let U=0;U<H.length;U++){const G=H[U];let{source:Y,target:q}=G,Q=z==null?void 0:z[Y],X=Q;if((G==null?void 0:G.type)==1){if(l.current.has(q)){var B,j,W;let se=(B=l.current.get(q))===null||B===void 0||(j=B.component)===null||j===void 0||(W=j.props)===null||W===void 0?void 0:W.children;Array.isArray(se)&&se.length>0&&P.push(se.map(ee=>{var le,me;return"".concat(Y,".").concat((ee==null||(le=ee.props)===null||le===void 0?void 0:le.componentId)||(ee==null||(me=ee.props)===null||me===void 0?void 0:me.__id))}))}if(Q&&typeof Q=="string")try{Q=JSON.parse(Q)}catch(se){console.error("error end",se)}if(!Array.isArray(Q))return;X=Q.map((se,ee)=>{let le={};if(G!=null&&G.subRules&&Array.isArray(G==null?void 0:G.subRules)&&(G==null?void 0:G.subRules.length)>0)for(let me=0;me<(G==null?void 0:G.subRules.length);me++){const{source:we,target:ce}=G==null?void 0:G.subRules[me];le[ce]=se==null?void 0:se[we];let ue={name:[q,ee,ce],value:se==null?void 0:se[we]};_[ue.name]=ue}return le}),y(q,!0),BZ.emit("reloadTable",q)}else{let ne=0;if(k&&Array.isArray(k)&&k.length>1&&(k.filter(se=>typeof se=="string").join("."),ne=k[k.length-1],q=[...k,q],Array.isArray(z)&&z.length>ne)){var K;X=(K=z[ne])===null||K===void 0?void 0:K[Y]}_[q]={name:Array.isArray(q)?q:[q],value:X}}(G==null?void 0:G.type)==1&&i.setFieldValue(q,void 0),i.setFieldValue(q,X)}setTimeout(()=>{b(_,!0),P.length>0&&P.forEach(U=>{Array.isArray(U)&&U.length>0&&$(U)})},0)},S=(F,k,L)=>{var H,z;let _=!1;const P=k==null||(H=k.component)===null||H===void 0||(z=H.props)===null||z===void 0?void 0:z.withFunc(F),B=k==null?void 0:k.identifier;if(l.current.has(B)){const j=l.current.get(B);j.show!==P&&(j.show=P,l.current.set(B,j),_=!0)}return _},C=async(F,k,L,H)=>{var z,_;const P=k==null||(z=k.component)===null||z===void 0?void 0:z.props.withFill,B=k==null||(_=k.component)===null||_===void 0?void 0:_.props.withDataFetch;let j=0,W="",K=k.identifier;if(L&&Array.isArray(L)&&L.length>1)W=L.filter(q=>typeof q=="string").join("."),j=L[L.length-1],K.startsWith("".concat(W,"."))&&(K=[...L,K.replace("".concat(W,"."),"")]);else if(K.indexOf(".")>=0){K=K.split(".");let q=w("fieldsValue",K[0],F,[]);if(Array.isArray(q)&&q.length>0)for(let Q=0;Q<q.length;Q++)await C(F,k,[K[0],Q],H);return}let U=[];if(P!=null&&P.withData&&(P==null?void 0:P.withData.length)>0&&B&&typeof B=="function")for(let q=0;q<(P==null?void 0:P.withData.length);q++){const Q=P==null?void 0:P.withData[q];let X={};X.tableName=Q.withTable.table_name,X.filter={};for(let se=0;se<Q.withCondition.length;se++){var G;const{value:ee,column:le}=Q.withCondition[se];let me=w(ee.group_key,ee.field_key,F,U);Array.isArray(me)&&Array.isArray(K)&&me.length>j&&(me=me[j]),H=="Field.WithSingleSelect"&&me&&(G=me)!==null&&G!==void 0&&G.value&&(me=me.value),X.filter[le.column_name]=me}const ne=await B(X);ne.code===0&&ne.data.list&&U.push({id:Q.id,data:ne.data.list})}let Y;if(P.value&&P.value.length>0&&(Y=P.value.map(q=>{let Q="";const{insert:X,attributes:ne}=q;return typeof X!="string"?X!=null&&X.span&&ne&&ne.tagKey&&ne.id&&(Q=w(ne.tagKey,ne.id,F,U),Array.isArray(Q)?Array.isArray(K)&&Q.length>j?Q=Q[j]:Q=JSON.stringify(Q):Q.length>0&&(Q='"'.concat(Q,'"'))):Q=X,Q})),Y&&Y.length>0){const q=CPt(Y);i.setFieldValue(K,q),h(K,i.getFieldsValue())}},w=(F,k,L,H)=>{let z="";if(F=="fieldsValue"){var _;if(k.indexOf(".")>=0){var P;const[W,K]=k.split("."),U=(L==null?void 0:L[W])||[];Array.isArray(U)?z=U.map(G=>{var Y;return(Y=G==null?void 0:G[K])!==null&&Y!==void 0?Y:""}):z=(P=U==null?void 0:U[K])!==null&&P!==void 0?P:""}else z=(_=L==null?void 0:L[k])!==null&&_!==void 0?_:""}else{let W=H.find(K=>K.id===F);if(W&&W.data&&W.data.length>0){var B,j;z=(B=(j=W.data[0])===null||j===void 0?void 0:j[k])!==null&&B!==void 0?B:""}}return z},A=J.useRef({}),D=xp.debounce(()=>{console.log("debounceHandleFieldsChange");const F=i.getFieldsValue(),k=u.current;u.current=0;let L=!1;d.current||(d.current={});for(let H in A.current){let z=A.current[H];xp.isEqual(z.value||"",p(z.name)||"")||(console.log("!isEqual field.name",z.name),console.log("field.value",z.value),console.log("getLastFieldValue(field.name)",p(z.name)),k!=1&&(L=h(z.name,F)),d.current[z.name]=z.value)}L&&(console.log("needRefresh",L),s(R())),A.current={}},100),T=F=>{console.log("changedFields",F),F.filter(k=>{k.name&&k.name.length>0&&(A.current[k.name]=k)}),D()},$=F=>{let k=[];F.forEach(H=>{if(!l.current.has(H))return;let z=l.current.get(H);z.withIds.length<=0||k.push(...z.withIds.filter(_=>!k.includes(_)))}),k=k.filter(H=>{var z=i.getFieldValue(H);return!(typeof z!="number"&&!z)});const L=i.getFieldsValue();setTimeout(()=>{k.forEach(H=>{h(H,L)})},0)},I=F=>{const k=i.getFieldsValue();setTimeout(()=>{F.forEach(L=>{h(L,k)})},0)},M=J.useRef({}),R=()=>{console.log("renderChildren");const F=J.Children.toArray(r);return DPt(F.filter(L=>{var H;const z=L.props.componentId||L.props.__id;return!l.current.has(z)||((H=l.current.get(z))===null||H===void 0?void 0:H.show)}),n).map((L,H)=>Le.jsx(XB,{gutter:[24,24],children:L.map((z,_)=>{var P;const{componentId:B,__id:j,_componentName:W,...K}=z.props,U=((P=z.type)===null||P===void 0?void 0:P.displayName)||W,G=B||j;G in M.current||(M.current[G]=Mf());const Y=U&&U.startsWith("Layout."),q=U&&U=="Field.Table",Q=K.calcHidden&&o!="desgin",X=[];if(K.isRequired&&X.push({required:!0,message:"".concat(K.label,"必须填写")}),K.rules)if(Array.isArray(K.rules)){const ee=K.rules.join("|");X.push({pattern:new RegExp(ee),message:K.rulesFailMessage?K.rulesFailMessage:"".concat(K.label,"格式错误")})}else X.push({pattern:new RegExp(K.rules),message:K.rulesFailMessage?K.rulesFailMessage:"".concat(K.label,"格式错误")});const ne=ee=>{i.setFieldValue(G,ee)};let se;return q||Y?se=J.cloneElement(z,{onTableAddRow:$,onTableRemoveRow:I,form:i,fieldName:G,onCustomChange:ne,initializeFormRender:f,mode:o,recordFieldsChange:b}):U==="Field.WithSingleSelect"||U==="Field.WithMultipleSelect"||U==="Show.WithTable"?se=Le.jsx(sa.Item,{hidden:Q,style:{margin:0},shouldUpdate:(ee,le)=>{let me=!1;if(Array.isArray(K.filterRules)&&K.filterRules.length>0)for(let we of K.filterRules){if(we.valueType!="variable")continue;let ce,ue;if(ce=ee==null?void 0:ee[we.value.field_key],ue=le==null?void 0:le[we.value.field_key],ce!==ue){me=!0;break}}return me&&(M.current[G]=Mf(),console.log(G,Mf())),me},children:ee=>{let{getFieldsValue:le}=ee;const me=le();let we=J.cloneElement(z,{onTableAddRow:$,onTableRemoveRow:I,form:i,fieldName:G,onCustomChange:ne,fieldsValue:me,initializeFormRender:f,recordFieldsChange:b,shouldUpdateKey:M.current[G]});return U==="show.WithTable"?Le.jsx(Le.Fragment,{children:we}):Le.jsx(sa.Item,{style:{marginBottom:0},label:"",name:G,rules:X,children:we})}}):se=Le.jsx(sa.Item,{hidden:Q,style:{marginBottom:0},label:"",name:G,rules:X,children:J.cloneElement(z,{form:i,fieldName:G,onCustomChange:ne,initializeFormRender:f,recordFieldsChange:b})}),Le.jsx(oT,{span:K.calcHidden?0:Y?24:24/n,style:{marginBottom:0},children:se},G||"col-".concat(_))})},"row-".concat(H)))};return Le.jsxs(sa,{form:i,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col fgap-y-2"+(o=="desgin"?" fp-6":""),onFieldsChange:T,children:[Le.jsx(sa.Item,{name:"__id",hidden:!0,children:Le.jsx("input",{type:"hidden"})}),a]})});function TPt(e){return J.forwardRef((t,n)=>Le.jsx(e,{...t,ref:n,forwardedRef:n}))}class N_n extends J.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return Le.jsx(Dle,{...n,ref:t})}}const IPt=TPt(e=>{let{forwardedRef:t,...n}=e;return Le.jsx(Dle,{...n,ref:t})}),PPt=e=>{let{request:t,value:n,onChange:r,callError:o,disabledValue:i,addRoot:a=!0,title:s,...l}=e;const[u,c]=J.useState(!1),[f,d]=J.useState([]);J.useEffect(()=>{p()},[]),J.useEffect(()=>{if(typeof n=="string")try{n=JSON.parse(n),r(n)}catch{}Array.isArray(n)&&y(n)},[n]);const p=async()=>{if(t&&typeof t=="function"){var D;const T=await t();if(T.code>0){o&&typeof o=="function"&&o(T.message);return}let $=aUe(((D=T.data)===null||D===void 0?void 0:D.list)||T.data||[],"id",s||"title",(l==null?void 0:l.parentId)||"parentId","children",0,i);a&&($=[{value:0,title:"根节点",children:$}]),l.treeData=$,console.log("treeData",$),d($)}l.treeData&&d(l.treeData),c(!0)},[g,m]=J.useState([]),[h,y]=J.useState([]),[v,b]=J.useState([]),[E,S]=J.useState(!0),C=D=>{console.log("onExpand",D),m(D),S(!1)},w=D=>{console.log("onCheck",D),y(D),r(D)},A=(D,T)=>{console.log("onSelect",T),b(D)};return Le.jsx(ui,{...l,children:Le.jsx(Ele,{checkable:!0,onExpand:C,onCheck:w,onSelect:A,expandedKeys:g,autoExpandParent:E,checkedKeys:h,selectedKeys:v,treeData:f})})},NPt=e=>Le.jsx(ui,{...e,children:Le.jsx(rT,{...e})}),RPt=e=>Le.jsx(ui,{...e,children:Le.jsx(rT.Group,{...e})}),MPt=e=>Le.jsx(ui,{...e,children:Le.jsx(VB.Group,{...e})}),dUe=e=>{let{value:t,maxCount:n,multiple:r,onChange:o,...i}=e;J.useEffect(()=>{if(t){if(typeof t=="string")try{t=JSON.parse(t),o(t)}catch{}console.log("value",t),Array.isArray(t)&&s(t)}},[t]),n=n||99,r=r||!0;const[a,s]=J.useState([]),l=u=>{let{fileList:c}=u;console.log("newFileList",c),c=c.map(f=>(f.status=="done"&&f.response&&(f.url=f.response),f)),o(c.map(f=>({uid:f.uid,name:f.name,status:f.status,url:f.url||f.response||"",error:f.error}))),s(c)};return Le.jsx(nk,{...i,listType:"text",multiple:r,onChange:l,maxCount:n,fileList:a,children:!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&a.length<n&&Le.jsx(Sl,{type:(i==null?void 0:i.type)||"default",icon:(i==null?void 0:i.icon)||Le.jsx(iUe,{}),children:"点击上传文件"})})};dUe.displayName="UploadFile";const FPt=e=>Le.jsx(ui,{...e,children:Le.jsx(dUe,{...e})}),pUe=e=>{let{maxCount:t,value:n,multiple:r,onChange:o,...i}=e;J.useEffect(()=>{if(n){if(console.log("value",n),typeof n=="string")try{n=JSON.parse(n),o(n)}catch{}let S=[];if(Array.isArray(n))for(let C=0;C<n.length;C++){let w=n[C];var E=g.current.find(A=>A.uid===w.uid);!E||(E.version||0)<(w.version||0)?S.push(w):S.push(E)}s(S)}},[n]),t=t||99,r=r||!0;const[a,s]=J.useState([]),[l,u]=J.useState(""),[c,f]=J.useState(0),[d,p]=J.useState(!1),g=J.useRef([]),m=E=>new Promise((S,C)=>{const w=new FileReader;w.readAsDataURL(E),w.onload=()=>S(w.result),w.onerror=A=>C(A)}),h=async(E,S)=>{!E.url&&!E.preview&&(E.preview=await m(E.originFileObj)),u(E.url||E.preview),f(S),p(!0)},y=async(E,S)=>{i!=null&&i.disabled||s(a.filter((C,w)=>w!==S))},v=Le.jsx(Le.Fragment,{children:Le.jsxs("div",{className:"fw-full fh-full fflex fflex-col fitems-center fjustify-center fborder fborder-dashed fcursor-pointer frounded",children:[Le.jsx(oUe,{}),Le.jsx("div",{className:"fmt-2",children:"点击上传"})]})}),b=E=>{let{fileList:S}=E,C=[];for(let D=0;D<S.length;D++){var w=S[D];w.version=new Date().getTime();var A=g.current.find(T=>T.uid===w.uid);console.log("oldfile",JSON.parse(JSON.stringify(A||{}))),A&&A.status!="uploading"?C.push(A):(w.status=="done"&&w.response&&(w.url=w.response),C.push(w))}g.current=C,s(C),o(C.map(D=>({uid:D.uid,name:D.name,status:D.status,url:D.url||D.response||"",error:D.error,version:D.version||0})))};return Le.jsxs(Le.Fragment,{children:[Le.jsx("div",{className:"fflex fgap-3 fflex-wrap",children:Le.jsx(nk,{...i,itemRender:(E,S,C)=>{console.log("file",S);let w=C.findIndex(A=>A.uid===S.uid);return Le.jsx(Le.Fragment,{children:Le.jsxs("div",{className:"fgroup fw-full fh-full fbg-transparent fborder frounded fflex fitems-center fjustify-center foverflow-hidden fcursor-pointer frelative"+(S.status=="error"?" fborder-red-500":""),children:[Le.jsxs("div",{className:" fhidden fabsolute fw-full fh-full fbg-gray-900 fbg-opacity-50 fitems-center fjustify-center fz-10 group-hover:fflex ftext-white ftext-lg fgap-2",children:[S.status=="done"&&Le.jsx(rUe,{onClick:()=>{h(S,w)},className:"hover:ftext-gray-200"}),!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&Le.jsx(Ale,{onClick:()=>{y(S,w)},className:"hover:ftext-gray-200"})]}),S.status=="uploading"&&Le.jsx("div",{className:" fw-full fh-full fflex fitems-center fjustify-center fabsolute ftop-0 fleft-0 ",children:Le.jsx(WD,{})}),Le.jsx("img",{src:S.url||S.thumbUrl,alt:"Example Image",className:"fmax-w-full fmax-h-full fobject-contain "})]},"file-".concat(S.uid))})},listType:"picture-card",fileList:a,multiple:r,onPreview:h,onChange:b,maxCount:t,children:a.length>=t||i!=null&&i.disabled||i!=null&&i.readonly?null:v})}),l&&Le.jsx(PR.PreviewGroup,{preview:{visible:d,current:c,onVisibleChange:E=>p(E),onChange:E=>{f(E)}},children:a.map((E,S)=>Le.jsx(Le.Fragment,{children:Le.jsx(PR,{wrapperStyle:{display:"none"},src:E.url})}))})]})};pUe.displayName="UploadImage";const BPt=e=>Le.jsx(ui,{...e,children:Le.jsx(pUe,{...e})}),kPt=e=>{let{value:t,onChange:n,form:r,fieldName:o,...i}=e,a=!1;return typeof t=="boolean"?a=t:typeof t=="string"?a=t=="1"||t=="true":typeof t=="number"&&(a=t==1),t!==a&&(r==null||r.setFieldValue(o,a)),Le.jsx(ui,{...i,children:Le.jsx(hle,{...i,onChange:n,value:t})})};var LPt={exports:{}};(function(e,t){(function(n,r){e.exports=r(V_e)})(Ir,function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var o=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a,s){return s==="W"?a+"周":a+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(a,s){var l=100*a+s;return l<600?"凌晨":l<900?"早上":l<1100?"上午":l<1300?"中午":l<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(LPt);var jPt={locale:"zh_CN",yearFormat:"YYYY年",cellDateFormat:"D",cellMeridiemFormat:"A",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"};const _Pt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},hUe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},jPt),timePickerLocale:Object.assign({},_Pt)};hUe.lang.ok="确定";var vUe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ir,function(){return function(n,r,o){o.updateLocale=function(i,a){var s=o.Ls[i];if(s)return(a?Object.keys(a):[]).forEach(function(l){s[l]=a[l]}),s}}})})(vUe);var HPt=vUe.exports;const zPt=Gs(HPt);ra.extend(zPt);ra.extend(q_e);ra.updateLocale("zh-cn",{weekStart:0});const VPt=e=>{let{datetype:t,value:n,defaultNow:r,onChange:o,...i}=e;t=t||"date";const[a,s]=J.useState(i==null?void 0:i.picker),[l,u]=J.useState(i==null?void 0:i.format),[c,f]=J.useState(!1),[d,p]=J.useState(!1),g=J.useRef(!1);J.useEffect(()=>{if(r&&!n){const h=ra().format("YYYY-MM-DD HH:mm:ss");typeof o=="function"&&o(h);return}},[]);const m=(h,y)=>{g.current=!0,o(y)};return J.useEffect(()=>{switch(s("date"),f(!1),t){case"date":s("date"),u("YYYY-MM-DD"),p(!1);break;case"datetime":f(!0),s("datetime"),u("YYYY-MM-DD HH:mm:ss"),p(!0);break;case"month":s("month"),p(!1);break;case"year":s("year"),p(!1);break}},[t]),Le.jsx(ui,{...i,children:Le.jsx(FC,{locale:hUe,...i,picker:a,format:l,style:{width:"100%"},onChange:m,value:n&&ra(n).isValid()?ra(n):void 0,showTime:c,needConfirm:d})})},UPt=e=>{var t;let{customComponent:n,form:r,fieldsValue:o,...i}=e;const[a,s]=J.useState();return J.useEffect(()=>{s(JSON.stringify(o))},[o]),n?Le.jsx(n,{...i,form:r,fieldsValue:o}):Le.jsx(YB,{type:"inner",title:(t=i==null?void 0:i.label)!==null&&t!==void 0?t:"关联子表",children:Le.jsx("div",{className:"fh-20 fw-full fflex fjustify-center fitems-center",children:"子表内容在设计阶段暂不显示"})})},lSe=e=>{let{label:t,subTableIndex:n,children:r,subTableHead:o=!1,...i}=e;return Le.jsx("div",{className:"fsticky fright-0 fbg-white fborder-b ",style:{boxShadow:"-6px 0 6px -6px rgba(50,50,50,0.15)",flex:"0 0 50px",width:"50px"},children:Le.jsxs("div",{className:"frelative fw-full fh-full fflex fflex-col foverflow-hidden",children:[t&&o&&Le.jsx("div",{className:"fh-12 ffont-semibold fbg-[#fafafa] ftext-sm fflex fflex-nowrap ftext-nowrap fjustify-between fitems-center fpx-2 fborder-b",children:t}),Le.jsx("div",{className:"fw-full fflex-1 fflex fitems-center fjustify-center fp-2 fbox-border fgap-2",children:r})]})})},kZ=e=>{let{children:t,width:n,hidden:r,...o}=e;const[i,a]=J.useState(0);return J.useEffect(()=>{a(n)},[n]),r?t:Le.jsx("div",{className:"fflex-1 fpx-1 fborder-b",style:{minWidth:"".concat(i,"px")},...o,children:t})},gUe=e=>{let{children:t,onTableAddRow:n,disabled:r,readonly:o,onTableRemoveRow:i,form:a,fieldName:s,initializeFormRender:l,recordFieldsChange:u,mode:c,isAllowCopy:f=!1,isAllowAdd:d=!0,...p}=e;J.useEffect(()=>{},[a]);const g=J.useRef(J.Children.map(t,()=>Mf())),[m,h]=J.useState(!1),y=p.componentId||p.__id,v=J.Children.map(t,A=>"".concat(y,".").concat(A.props.componentId||A.props.__id)),b=[],E=()=>{m||h(!0),a==null||a.setFieldValue(s,[{}])},[S,C]=J.useState(),w=A=>{s==A&&C(Mf())};return J.useEffect(()=>(C(Mf()),BZ.on("reloadTable",w),()=>{BZ.off("reloadTable",w)}),[]),p.isRequired&&b.push({required:!0,message:"子表[".concat(p.label,"]必须填写")}),Le.jsx(sa.List,{name:y,rules:b,children:(A,D)=>{let{add:T,remove:$}=D;return A.length===0&&!m&&E(),Le.jsxs("div",{className:"fw-full ",children:[Le.jsxs("div",{className:"fw-full frelative fmin-h-20 foverflow-x-auto",style:{position:"relative"},children:[A.length===0&&Le.jsxs("div",{className:"fborder-b fflex flex-nowrap fmin-w-full ",children:[J.Children.map(t,(I,M)=>{var R;const F=I==null||(R=I.props)===null||R===void 0?void 0:R.calcHidden;return Le.jsx(kZ,{width:150,hidden:F,children:F?null:J.cloneElement(I,{key:"row_".concat(0,"_child_",M),subTable:!0,subTableHead:!0,subTableContent:!1})},"row_".concat(0,"_col_",M))}),r!=!0&&o!=!0&&Le.jsx(lSe,{subTableHead:!0,subTable:!0,subTableIndex:0,label:"操作"},"row_".concat(0,"_action"))]},"tableHead"),A.map((I,M)=>Le.jsxs("div",{className:" fflex flex-nowrap fmin-w-full ",children:[J.Children.map(t,(R,F)=>{var k,L,H;let{props:z}=R;const _=(R==null||(k=R.props)===null||k===void 0?void 0:k.componentId)||(R==null||(L=R.props)===null||L===void 0?void 0:L.__id)||F,P=[];if(z.isRequired&&P.push({required:!0,message:"".concat(z.label,"必须填写")}),z.rules)if(Array.isArray(z.rules)){const Y=z.rules.join("|");P.push({pattern:new RegExp(Y),message:z.rulesFailMessage?z.rulesFailMessage:"".concat(z.label,"格式错误")})}else P.push({pattern:new RegExp(z.rules),message:z.rulesFailMessage?z.rulesFailMessage:"".concat(z.label,"格式错误")});const{componentId:B,__id:j,_componentName:W,...K}=R.props,U=((H=R.type)===null||H===void 0?void 0:H.displayName)||W,G=z.calcHidden&&c!="desgin";return Le.jsx(kZ,{width:150,hidden:G,children:Le.jsx(sa.Item,{style:{margin:0},hidden:G,shouldUpdate:(Y,q)=>{let Q=!1;if((U==="Field.WithSingleSelect"||U==="Field.WithMultipleSelect")&&Array.isArray(K.filterRules)&&K.filterRules.length>0)for(let ue of K.filterRules){let ge,pe;if(ue.valueType=="variable"){if("parent"in(ue==null?void 0:ue.value)&&ue.value.parent!=""){var X,ne,se,ee,le,me,we,ce;ge=Y==null||(X=Y[ue==null||(se=ue.value)===null||se===void 0?void 0:se.parent])===null||X===void 0||(ne=X[I.name])===null||ne===void 0?void 0:ne[ue==null||(ee=ue.value)===null||ee===void 0?void 0:ee.field_key],pe=q==null||(le=q[ue==null||(we=ue.value)===null||we===void 0?void 0:we.parent])===null||le===void 0||(me=le[I.name])===null||me===void 0?void 0:me[ue==null||(ce=ue.value)===null||ce===void 0?void 0:ce.field_key]}else ge=Y==null?void 0:Y[ue.value.field_key],pe=q==null?void 0:q[ue.value.field_key];if(ge!==pe){Q=!0;break}}}return Q&&(g.current[F]=Mf()),Q},children:Y=>{let{getFieldsValue:q}=Y;const Q=q();return Le.jsx(sa.Item,{label:"",style:{marginBottom:0},name:[I.name,_],rules:P,children:J.cloneElement(R,{key:"row_".concat(I.key,"_child_").concat(F),subTable:!0,subTableIndex:M,subTableHead:M===0,form:a,shouldUpdateKey:g.current[F],fieldName:[s,I.name,_],fieldsValue:Q,initializeFormRender:l,recordFieldsChange:u})})}})},"row_".concat(I.key,"_col_").concat(F))}),r!=!0&&o!=!0&&Le.jsxs(lSe,{subTableHead:M==0,subTable:!0,subTableIndex:M,label:"操作",children:[f&&Le.jsx(nUe,{className:"fcursor-pointer",onClick:()=>{let R=a.getFieldValue(s);const F={...R[M]};R.splice(M+1,0,F),a==null||a.setFieldValue(s,R);let k={},L=s;for(let H=M+1;H<R.length;H++){let z=R[H];for(let _ in z){let P=[L,H,_];k[P]={name:P,value:z[_]}}}typeof u=="function"&&u(k,!0)}}),Le.jsx(ple,{title:"删除确认",description:"确定要删除这一行吗?",onConfirm:()=>{$(M),typeof i=="function"&&i(v)},okText:"确定",cancelText:"取消",children:Le.jsx(Ale,{className:"fcursor-pointer ftext-red-500"})})]},"row_".concat(M,"_action"))]},"".concat(S,".").concat(I.key)))]}),r!=!0&&o!=!0&&d&&Le.jsx(Sl,{onClick:()=>{T({key:Mf()}),typeof n=="function"&&n(v)},className:"fmy-2",children:"新增一行"})]})}})};gUe.displayName="Table";const mUe=e=>Le.jsx(ui,{...e,higLabel:!0,children:Le.jsx(gUe,{...e})});mUe.displayName="Table";const WPt=e=>Le.jsx("div",{children:"sdfsdfsdf"});function KPt(){this.__data__=[],this.size=0}var GPt=KPt;function YPt(e,t){return e===t||e!==e&&t!==t}var yUe=YPt,XPt=yUe;function qPt(e,t){for(var n=e.length;n--;)if(XPt(e[n][0],t))return n;return-1}var ak=qPt,QPt=ak,ZPt=Array.prototype,JPt=ZPt.splice;function eNt(e){var t=this.__data__,n=QPt(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():JPt.call(t,n,1),--this.size,!0}var tNt=eNt,nNt=ak;function rNt(e){var t=this.__data__,n=nNt(t,e);return n<0?void 0:t[n][1]}var oNt=rNt,iNt=ak;function aNt(e){return iNt(this.__data__,e)>-1}var sNt=aNt,lNt=ak;function uNt(e,t){var n=this.__data__,r=lNt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var cNt=uNt,fNt=GPt,dNt=tNt,pNt=oNt,hNt=sNt,vNt=cNt;function kC(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kC.prototype.clear=fNt;kC.prototype.delete=dNt;kC.prototype.get=pNt;kC.prototype.has=hNt;kC.prototype.set=vNt;var sk=kC,gNt=sk;function mNt(){this.__data__=new gNt,this.size=0}var yNt=mNt;function bNt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var ENt=bNt;function SNt(e){return this.__data__.get(e)}var CNt=SNt;function wNt(e){return this.__data__.has(e)}var xNt=wNt;function ANt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var bUe=ANt,$Nt=lT,ONt=bUe,DNt="[object AsyncFunction]",TNt="[object Function]",INt="[object GeneratorFunction]",PNt="[object Proxy]";function NNt(e){if(!ONt(e))return!1;var t=$Nt(e);return t==TNt||t==INt||t==DNt||t==PNt}var EUe=NNt,RNt=sh,MNt=RNt["__core-js_shared__"],FNt=MNt,FH=FNt,uSe=function(){var e=/[^.]+$/.exec(FH&&FH.keys&&FH.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function BNt(e){return!!uSe&&uSe in e}var kNt=BNt,LNt=Function.prototype,jNt=LNt.toString;function _Nt(e){if(e!=null){try{return jNt.call(e)}catch{}try{return e+""}catch{}}return""}var SUe=_Nt,HNt=EUe,zNt=kNt,VNt=bUe,UNt=SUe,WNt=/[\\^$.*+?()[\]{}|]/g,KNt=/^\[object .+?Constructor\]$/,GNt=Function.prototype,YNt=Object.prototype,XNt=GNt.toString,qNt=YNt.hasOwnProperty,QNt=RegExp("^"+XNt.call(qNt).replace(WNt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ZNt(e){if(!VNt(e)||zNt(e))return!1;var t=HNt(e)?QNt:KNt;return t.test(UNt(e))}var JNt=ZNt;function e5t(e,t){return e==null?void 0:e[t]}var t5t=e5t,n5t=JNt,r5t=t5t;function o5t(e,t){var n=r5t(e,t);return n5t(n)?n:void 0}var LC=o5t,i5t=LC,a5t=sh,s5t=i5t(a5t,"Map"),Tle=s5t,l5t=LC,u5t=l5t(Object,"create"),lk=u5t,cSe=lk;function c5t(){this.__data__=cSe?cSe(null):{},this.size=0}var f5t=c5t;function d5t(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var p5t=d5t,h5t=lk,v5t="__lodash_hash_undefined__",g5t=Object.prototype,m5t=g5t.hasOwnProperty;function y5t(e){var t=this.__data__;if(h5t){var n=t[e];return n===v5t?void 0:n}return m5t.call(t,e)?t[e]:void 0}var b5t=y5t,E5t=lk,S5t=Object.prototype,C5t=S5t.hasOwnProperty;function w5t(e){var t=this.__data__;return E5t?t[e]!==void 0:C5t.call(t,e)}var x5t=w5t,A5t=lk,$5t="__lodash_hash_undefined__";function O5t(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=A5t&&t===void 0?$5t:t,this}var D5t=O5t,T5t=f5t,I5t=p5t,P5t=b5t,N5t=x5t,R5t=D5t;function jC(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jC.prototype.clear=T5t;jC.prototype.delete=I5t;jC.prototype.get=P5t;jC.prototype.has=N5t;jC.prototype.set=R5t;var M5t=jC,fSe=M5t,F5t=sk,B5t=Tle;function k5t(){this.size=0,this.__data__={hash:new fSe,map:new(B5t||F5t),string:new fSe}}var L5t=k5t;function j5t(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var _5t=j5t,H5t=_5t;function z5t(e,t){var n=e.__data__;return H5t(t)?n[typeof t=="string"?"string":"hash"]:n.map}var uk=z5t,V5t=uk;function U5t(e){var t=V5t(this,e).delete(e);return this.size-=t?1:0,t}var W5t=U5t,K5t=uk;function G5t(e){return K5t(this,e).get(e)}var Y5t=G5t,X5t=uk;function q5t(e){return X5t(this,e).has(e)}var Q5t=q5t,Z5t=uk;function J5t(e,t){var n=Z5t(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var e8t=J5t,t8t=L5t,n8t=W5t,r8t=Y5t,o8t=Q5t,i8t=e8t;function _C(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_C.prototype.clear=t8t;_C.prototype.delete=n8t;_C.prototype.get=r8t;_C.prototype.has=o8t;_C.prototype.set=i8t;var CUe=_C,a8t=sk,s8t=Tle,l8t=CUe,u8t=200;function c8t(e,t){var n=this.__data__;if(n instanceof a8t){var r=n.__data__;if(!s8t||r.length<u8t-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new l8t(r)}return n.set(e,t),this.size=n.size,this}var f8t=c8t,d8t=sk,p8t=yNt,h8t=ENt,v8t=CNt,g8t=xNt,m8t=f8t;function HC(e){var t=this.__data__=new d8t(e);this.size=t.size}HC.prototype.clear=p8t;HC.prototype.delete=h8t;HC.prototype.get=v8t;HC.prototype.has=g8t;HC.prototype.set=m8t;var y8t=HC,b8t="__lodash_hash_undefined__";function E8t(e){return this.__data__.set(e,b8t),this}var S8t=E8t;function C8t(e){return this.__data__.has(e)}var w8t=C8t,x8t=CUe,A8t=S8t,$8t=w8t;function FR(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new x8t;++t<n;)this.add(e[t])}FR.prototype.add=FR.prototype.push=A8t;FR.prototype.has=$8t;var O8t=FR;function D8t(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var T8t=D8t;function I8t(e,t){return e.has(t)}var P8t=I8t,N8t=O8t,R8t=T8t,M8t=P8t,F8t=1,B8t=2;function k8t(e,t,n,r,o,i){var a=n&F8t,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var f=-1,d=!0,p=n&B8t?new N8t:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var g=e[f],m=t[f];if(r)var h=a?r(m,g,f,t,e,i):r(g,m,f,e,t,i);if(h!==void 0){if(h)continue;d=!1;break}if(p){if(!R8t(t,function(y,v){if(!M8t(p,v)&&(g===y||o(g,y,n,r,i)))return p.push(v)})){d=!1;break}}else if(!(g===m||o(g,m,n,r,i))){d=!1;break}}return i.delete(e),i.delete(t),d}var wUe=k8t,L8t=sh,j8t=L8t.Uint8Array,_8t=j8t;function H8t(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}var z8t=H8t;function V8t(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var U8t=V8t,dSe=rk,pSe=_8t,W8t=yUe,K8t=wUe,G8t=z8t,Y8t=U8t,X8t=1,q8t=2,Q8t="[object Boolean]",Z8t="[object Date]",J8t="[object Error]",eRt="[object Map]",tRt="[object Number]",nRt="[object RegExp]",rRt="[object Set]",oRt="[object String]",iRt="[object Symbol]",aRt="[object ArrayBuffer]",sRt="[object DataView]",hSe=dSe?dSe.prototype:void 0,BH=hSe?hSe.valueOf:void 0;function lRt(e,t,n,r,o,i,a){switch(n){case sRt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case aRt:return!(e.byteLength!=t.byteLength||!i(new pSe(e),new pSe(t)));case Q8t:case Z8t:case tRt:return W8t(+e,+t);case J8t:return e.name==t.name&&e.message==t.message;case nRt:case oRt:return e==t+"";case eRt:var s=G8t;case rRt:var l=r&X8t;if(s||(s=Y8t),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=q8t,a.set(e,t);var c=K8t(s(e),s(t),r,o,i,a);return a.delete(e),c;case iRt:if(BH)return BH.call(e)==BH.call(t)}return!1}var uRt=lRt;function cRt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var fRt=cRt,dRt=fRt,pRt=ok;function hRt(e,t,n){var r=t(e);return pRt(e)?r:dRt(r,n(e))}var vRt=hRt;function gRt(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}var mRt=gRt;function yRt(){return[]}var bRt=yRt,ERt=mRt,SRt=bRt,CRt=Object.prototype,wRt=CRt.propertyIsEnumerable,vSe=Object.getOwnPropertySymbols,xRt=vSe?function(e){return e==null?[]:(e=Object(e),ERt(vSe(e),function(t){return wRt.call(e,t)}))}:SRt,ARt=xRt;function $Rt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ORt=$Rt,DRt=lT,TRt=uT,IRt="[object Arguments]";function PRt(e){return TRt(e)&&DRt(e)==IRt}var NRt=PRt,gSe=NRt,RRt=uT,xUe=Object.prototype,MRt=xUe.hasOwnProperty,FRt=xUe.propertyIsEnumerable,BRt=gSe(function(){return arguments}())?gSe:function(e){return RRt(e)&&MRt.call(e,"callee")&&!FRt.call(e,"callee")},kRt=BRt,BR={exports:{}};function LRt(){return!1}var jRt=LRt;BR.exports;(function(e,t){var n=sh,r=jRt,o=t&&!t.nodeType&&t,i=o&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===o,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;e.exports=u})(BR,BR.exports);var AUe=BR.exports,_Rt=9007199254740991,HRt=/^(?:0|[1-9]\d*)$/;function zRt(e,t){var n=typeof e;return t=t??_Rt,!!t&&(n=="number"||n!="symbol"&&HRt.test(e))&&e>-1&&e%1==0&&e<t}var VRt=zRt,URt=9007199254740991;function WRt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=URt}var $Ue=WRt,KRt=lT,GRt=$Ue,YRt=uT,XRt="[object Arguments]",qRt="[object Array]",QRt="[object Boolean]",ZRt="[object Date]",JRt="[object Error]",eMt="[object Function]",tMt="[object Map]",nMt="[object Number]",rMt="[object Object]",oMt="[object RegExp]",iMt="[object Set]",aMt="[object String]",sMt="[object WeakMap]",lMt="[object ArrayBuffer]",uMt="[object DataView]",cMt="[object Float32Array]",fMt="[object Float64Array]",dMt="[object Int8Array]",pMt="[object Int16Array]",hMt="[object Int32Array]",vMt="[object Uint8Array]",gMt="[object Uint8ClampedArray]",mMt="[object Uint16Array]",yMt="[object Uint32Array]",Wo={};Wo[cMt]=Wo[fMt]=Wo[dMt]=Wo[pMt]=Wo[hMt]=Wo[vMt]=Wo[gMt]=Wo[mMt]=Wo[yMt]=!0;Wo[XRt]=Wo[qRt]=Wo[lMt]=Wo[QRt]=Wo[uMt]=Wo[ZRt]=Wo[JRt]=Wo[eMt]=Wo[tMt]=Wo[nMt]=Wo[rMt]=Wo[oMt]=Wo[iMt]=Wo[aMt]=Wo[sMt]=!1;function bMt(e){return YRt(e)&&GRt(e.length)&&!!Wo[KRt(e)]}var EMt=bMt;function SMt(e){return function(t){return e(t)}}var CMt=SMt,kR={exports:{}};kR.exports;(function(e,t){var n=IVe,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,a=i&&n.process,s=function(){try{var l=o&&o.require&&o.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(kR,kR.exports);var wMt=kR.exports,xMt=EMt,AMt=CMt,mSe=wMt,ySe=mSe&&mSe.isTypedArray,$Mt=ySe?AMt(ySe):xMt,OUe=$Mt,OMt=ORt,DMt=kRt,TMt=ok,IMt=AUe,PMt=VRt,NMt=OUe,RMt=Object.prototype,MMt=RMt.hasOwnProperty;function FMt(e,t){var n=TMt(e),r=!n&&DMt(e),o=!n&&!r&&IMt(e),i=!n&&!r&&!o&&NMt(e),a=n||r||o||i,s=a?OMt(e.length,String):[],l=s.length;for(var u in e)(t||MMt.call(e,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||PMt(u,l)))&&s.push(u);return s}var BMt=FMt,kMt=Object.prototype;function LMt(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||kMt;return e===n}var jMt=LMt;function _Mt(e,t){return function(n){return e(t(n))}}var HMt=_Mt,zMt=HMt,VMt=zMt(Object.keys,Object),UMt=VMt,WMt=jMt,KMt=UMt,GMt=Object.prototype,YMt=GMt.hasOwnProperty;function XMt(e){if(!WMt(e))return KMt(e);var t=[];for(var n in Object(e))YMt.call(e,n)&&n!="constructor"&&t.push(n);return t}var qMt=XMt,QMt=EUe,ZMt=$Ue;function JMt(e){return e!=null&&ZMt(e.length)&&!QMt(e)}var e7t=JMt,t7t=BMt,n7t=qMt,r7t=e7t;function o7t(e){return r7t(e)?t7t(e):n7t(e)}var i7t=o7t,a7t=vRt,s7t=ARt,l7t=i7t;function u7t(e){return a7t(e,l7t,s7t)}var c7t=u7t,bSe=c7t,f7t=1,d7t=Object.prototype,p7t=d7t.hasOwnProperty;function h7t(e,t,n,r,o,i){var a=n&f7t,s=bSe(e),l=s.length,u=bSe(t),c=u.length;if(l!=c&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in t:p7t.call(t,d)))return!1}var p=i.get(e),g=i.get(t);if(p&&g)return p==t&&g==e;var m=!0;i.set(e,t),i.set(t,e);for(var h=a;++f<l;){d=s[f];var y=e[d],v=t[d];if(r)var b=a?r(v,y,d,t,e,i):r(y,v,d,e,t,i);if(!(b===void 0?y===v||o(y,v,n,r,i):b)){m=!1;break}h||(h=d=="constructor")}if(m&&!h){var E=e.constructor,S=t.constructor;E!=S&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof S=="function"&&S instanceof S)&&(m=!1)}return i.delete(e),i.delete(t),m}var v7t=h7t,g7t=LC,m7t=sh,y7t=g7t(m7t,"DataView"),b7t=y7t,E7t=LC,S7t=sh,C7t=E7t(S7t,"Promise"),w7t=C7t,x7t=LC,A7t=sh,$7t=x7t(A7t,"Set"),O7t=$7t,D7t=LC,T7t=sh,I7t=D7t(T7t,"WeakMap"),P7t=I7t,LZ=b7t,jZ=Tle,_Z=w7t,HZ=O7t,zZ=P7t,DUe=lT,zC=SUe,ESe="[object Map]",N7t="[object Object]",SSe="[object Promise]",CSe="[object Set]",wSe="[object WeakMap]",xSe="[object DataView]",R7t=zC(LZ),M7t=zC(jZ),F7t=zC(_Z),B7t=zC(HZ),k7t=zC(zZ),g0=DUe;(LZ&&g0(new LZ(new ArrayBuffer(1)))!=xSe||jZ&&g0(new jZ)!=ESe||_Z&&g0(_Z.resolve())!=SSe||HZ&&g0(new HZ)!=CSe||zZ&&g0(new zZ)!=wSe)&&(g0=function(e){var t=DUe(e),n=t==N7t?e.constructor:void 0,r=n?zC(n):"";if(r)switch(r){case R7t:return xSe;case M7t:return ESe;case F7t:return SSe;case B7t:return CSe;case k7t:return wSe}return t});var L7t=g0,kH=y8t,j7t=wUe,_7t=uRt,H7t=v7t,ASe=L7t,$Se=ok,OSe=AUe,z7t=OUe,V7t=1,DSe="[object Arguments]",TSe="[object Array]",aP="[object Object]",U7t=Object.prototype,ISe=U7t.hasOwnProperty;function W7t(e,t,n,r,o,i){var a=$Se(e),s=$Se(t),l=a?TSe:ASe(e),u=s?TSe:ASe(t);l=l==DSe?aP:l,u=u==DSe?aP:u;var c=l==aP,f=u==aP,d=l==u;if(d&&OSe(e)){if(!OSe(t))return!1;a=!0,c=!1}if(d&&!c)return i||(i=new kH),a||z7t(e)?j7t(e,t,n,r,o,i):_7t(e,t,l,n,r,o,i);if(!(n&V7t)){var p=c&&ISe.call(e,"__wrapped__"),g=f&&ISe.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,h=g?t.value():t;return i||(i=new kH),o(m,h,n,r,i)}}return d?(i||(i=new kH),H7t(e,t,n,r,o,i)):!1}var K7t=W7t,G7t=K7t,PSe=uT;function TUe(e,t,n,r,o){return e===t?!0:e==null||t==null||!PSe(e)&&!PSe(t)?e!==e&&t!==t:G7t(e,t,n,r,TUe,o)}var Y7t=TUe,X7t=Y7t;function q7t(e,t){return X7t(e,t)}var Q7t=q7t,IUe={exports:{}};/*!
|
416
|
+
`,tPt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ePt,n=J.useContext(OVe),r=n.csp;J.useEffect(function(){qf(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},nPt=["icon","className","onClick","style","primaryColor","secondaryColor"],TO={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function rPt(e){var t=e.primaryColor,n=e.secondaryColor;TO.primaryColor=t,TO.secondaryColor=n||JVe(t),TO.calculated=!!n}function oPt(){return he({},TO)}var BC=function(t){var n=t.icon,r=t.className,o=t.onClick,i=t.style,a=t.primaryColor,s=t.secondaryColor,l=vn(t,nPt),u=TO;if(a&&(u={primaryColor:a,secondaryColor:s||JVe(a)}),tPt(),JIt(aSe(n),"icon should be icon definiton, but got ".concat(n)),!aSe(n))return null;var c=n;return c&&typeof c.icon=="function"&&(c=he(he({},c),{},{icon:c.icon(u.primaryColor,u.secondaryColor)})),FZ(c.icon,"svg-".concat(c.name),he({className:r,onClick:o,style:i,"data-icon":c.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};BC.displayName="IconReact";BC.getTwoToneColors=oPt;BC.setTwoToneColors=rPt;function tUe(e){var t=eUe(e),n=be(t,2),r=n[0],o=n[1];return BC.setTwoToneColors({primaryColor:r,secondaryColor:o})}function iPt(){var e=BC.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var aPt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];tUe("#1890ff");var pm=O.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,i=e.rotate,a=e.tabIndex,s=e.onClick,l=e.twoToneColor,u=vn(e,aPt),c=O.useContext(OVe),f=c.prefixCls,d=f===void 0?"anticon":f,p=c.rootClassName,g=$e(p,d,ie(ie({},"".concat(d,"-").concat(r.name),!!r.name),"".concat(d,"-spin"),!!o||r.name==="loading"),n),m=a;m===void 0&&s&&(m=-1);var h=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,y=eUe(l),v=be(y,2),b=v[0],E=v[1];return O.createElement("span",he(he({role:"img","aria-label":r.name},u),{},{ref:t,tabIndex:m,onClick:s,className:g}),O.createElement(BC,{icon:r,primaryColor:b,secondaryColor:E,style:h}))});pm.displayName="AntdIcon";pm.getTwoToneColor=iPt;pm.setTwoToneColor=tUe;var sPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:h3t}))},nUe=O.forwardRef(sPt);process.env.NODE_ENV!=="production"&&(nUe.displayName="CopyOutlined");var lPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:dVe}))},Ale=O.forwardRef(lPt);process.env.NODE_ENV!=="production"&&(Ale.displayName="DeleteOutlined");var uPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:hze}))},rUe=O.forwardRef(uPt);process.env.NODE_ENV!=="production"&&(rUe.displayName="EyeOutlined");var cPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:VHe}))},oUe=O.forwardRef(cPt);process.env.NODE_ENV!=="production"&&(oUe.displayName="PlusOutlined");var fPt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},dPt=function(t,n){return O.createElement(pm,he(he({},t),{},{ref:n,icon:fPt}))},iUe=O.forwardRef(dPt);process.env.NODE_ENV!=="production"&&(iUe.displayName="UploadOutlined");function aUe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"id",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"title",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"parentId",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"children",i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0;return pPt(e,t,n,r,o,i,s=>({value:s[t],title:s[n],key:s[t],disabled:s[t]===a}))}function pPt(e,t,n,r,o,i,a){if(!Array.isArray(e)||e.length===0)return[];const s=e.map(l=>({...l,...a(l)}));return s.filter(l=>{const u=s.filter(c=>l[t]===c[r]);return l[o]=u.length>0?u:[],l[r]===i})}const sUe=e=>{let{request:t,title:n,disabledValue:r,callError:o,...i}=e;const[a,s]=J.useState(!1),[l,u]=J.useState([]);J.useEffect(()=>{c()},[]);const c=async()=>{if(t&&typeof t=="function"){var f;const d=await t();if(d.code>0){o&&typeof o=="function"&&o(d.message);return}let p=aUe(((f=d.data)===null||f===void 0?void 0:f.list)||d.data||[],"id",n||"title",i.parentId||"parentId","children",0,r);p=[{value:0,title:"根节点",children:p}],i.treeData=p,u(p)}i.treeData&&u(i.treeData),s(!0)};return Le.jsx(ui,{...i,children:a&&Le.jsx(dm,{...i,treeData:l,treeDefaultExpandAll:!0,style:{width:"100%"}})})},$le=J.forwardRef((e,t)=>{let{addWrapper:n=!0,form:r,fieldName:o,fieldsValue:i,shouldUpdateKey:a,value:s,type:l,defaultValue:u,onChange:c,option_label:f,option_value:d,option_search:p,options:g,request:m,requestParams:h,callError:y,subRequest:v,sub_option_label:b="label",mode:E="single",sub_option_value:S="id",rightIconRender:C,rightIcon:w,rightIconClick:A,recordFieldsChange:D,...T}=e;const[$,I]=J.useState([]),[M,R]=J.useState(!1),F=J.useRef(1),k=10,L=J.useRef(!1),H=J.useRef(!1);J.useEffect(()=>{if(s){let q=null;Array.isArray($)&&$.length>0&&(q=$.find(Q=>Q.value==(s==null?void 0:s.value)||Q.value==s),q&&!xp.isEqual(q,s)&&(console.log("new value /////",q),typeof c=="function"&&c(q))),q||z()}},[s]),J.useEffect(()=>{console.log("SearchSelect useEffect shouldUpdateKey",a),console.log("SearchSelect useEffect requestParams",h),_(h)},[a,h]);const z=async()=>{m&&d&&B({...h,[d]:s==null?void 0:s.value},null,q=>{if(console.log("loadSelectOptions selectOptions",q),q&&q.length>0){let Q=q.find(X=>X.value==(s==null?void 0:s.value)||X.value==s);console.log("loadSelectOptions item",Q),Q&&!xp.isEqual(Q,s)&&(console.log("new value /////",Q),typeof c=="function"&&c(Q))}})},_=async q=>{const Q={};F.current=1,L.current=!1,m&&typeof m=="function"&&B(q,Q),g&&g.length>0&&I(g)},P=async q=>{const Q={...h};Q[p]=q,await B(Q)},B=J.useCallback(xp.debounce((q,Q,X)=>{K(q,Q).then(ne=>{typeof X=="function"&&X(ne)})},200),[]),j=async(q,Q)=>{let X=[];if(!(Q&&Object.values(Q).some(se=>se==="##norequest##"))){var ne;R(!0);const se=await m({...q,ruleParams:Q},r,o);R(!1),se.code>0?y&&typeof y=="function"&&y(se.message):X=((ne=se.data)===null||ne===void 0?void 0:ne.list)||se.data}return X},W=async q=>{if(Array.isArray(q)){for(let Q=0;Q<q.length;Q++){const X=q[Q];if(typeof v=="function"){let ne=[];const{data:se}=await v(X);se!=null&&se.list&&Array.isArray(se.list)&&(ne=se.list.map(ee=>({label:"".concat(X[f],"-").concat(ee[b]),value:"".concat(X[d],"-").concat(ee[S])}))),q[Q]={...X,label:X[f],title:X[f],options:ne}}q[Q]={...X,label:X[f],value:X[d]}}$.length>0&&!xp.isEqual($,q)&&typeof c=="function"&&c(void 0)}return q},K=async(q,Q)=>{try{let X=await j(q,Q);return X=await W(X),I(Array.isArray(X)?X:[]),X}catch(X){console.error("fetchOptions",X),R(!1)}finally{}},U=q=>{Array.isArray(q)?c(q.map(Q=>$.find(X=>X.value===Q))):c($.find(Q=>Q.value===q))},G=q=>{const{target:Q}=q;Q.scrollTop+Q.clientHeight>=Q.scrollHeight-50&&Y()},Y=async()=>{if(!(L.current||H.current)){H.current=!0;try{const q={...h,page:F.current+1,pageSize:k};let Q=await j(q,null);Q=await W(Q),Array.isArray(Q)&&Q.length>0?I(X=>{const ne=new Set(X.map(ee=>ee.value)),se=Q.filter(ee=>!ne.has(ee.value));return[...X,...se]}):L.current=!0,F.current+=1}catch(q){console.error("加载更多选项时出错",q)}finally{H.current=!1}}};return n?Le.jsxs(ui,{...T,children:[Le.jsx(ud,{ref:t,notFoundContent:M?Le.jsx(WD,{size:"small"}):null,value:s,...T,filterOption:!1,showSearch:!!(m&&p),onSearch:m&&p?P:null,onChange:U,style:{width:"100%",flex:1},options:$,onPopupScroll:typeof m=="function"?G:null,mode:E}),!(T!=null&&T.disabled)&&w,!(T!=null&&T.disabled)&&typeof C=="function"&&C({value:s,onChange:c,form:r,fieldName:o,recordFieldsChange:D})]}):Le.jsxs(Le.Fragment,{children:[Le.jsx(ud,{ref:t,notFoundContent:M?Le.jsx(WD,{size:"small"}):null,value:s,...T,filterOption:!1,showSearch:!!(m&&p),onSearch:m&&p?P:null,onChange:U,style:{width:"100%"},options:$,onPopupScroll:typeof m=="function"?G:null,mode:E}),!(T!=null&&T.disabled)&&w,!(T!=null&&T.disabled)&&typeof C=="function"&&C({value:s,onChange:c,form:r,fieldName:o,recordFieldsChange:D})]})}),Ole=e=>{let{request:t,option_label:n="label",option_value:r="id",disabledValue:o,callError:i,options:a,addWrapper:s=!0,...l}=e;const[u,c]=J.useState([]);J.useEffect(()=>{f()},[]);const f=async()=>{if(t&&typeof t=="function"){var d;const p=await t();if(p.code>0){i&&typeof i=="function"&&i(p.message);return}let g=((d=p.data)===null||d===void 0?void 0:d.list)||p.data;Array.isArray(g)&&g.length>0&&c(g.map(m=>({label:m[n],value:m[r]})))}a&&a.length>0&&c(a)};return s?Le.jsx(ui,{...l,children:Le.jsx(ud,{...l,options:u,style:{width:"100%"}})}):Le.jsx(ud,{...l,options:u,style:{width:"100%"}})},hPt=e=>{let{...t}=e;return Le.jsx(Ole,{...t,mode:"single"})},vPt=e=>{let{onChange:t,value:n,...r}=e;const[o,i]=J.useState([]);return J.useEffect(()=>{if(n&&typeof n=="string")try{n=JSON.parse(n),t(n)}catch{}n&&i(n)},[n]),Le.jsx(Ole,{...r,onChange:t,mode:"multiple",value:o})},lUe=e=>{var t,n;let{readItemRender:r,readonly:o,onChange:i,onCustomChange:a,value:s,form:l,fieldName:u,...c}=e;return J.useEffect(()=>{if(s&&typeof s=="string")try{s=JSON.parse(s),l==null||l.setFieldValue(u,s),console.log("WithSingleSelect useEffect onChange////// form",l),console.log("WithSingleSelect useEffect onChange////// fieldName",u),console.log("WithSingleSelect useEffect onChange////// value",s)}catch(f){console.log("WithSingleSelect useEffect error",f)}},[s]),o?Le.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:s&&s.label&&Le.jsx(Le.Fragment,{children:r&&typeof r=="function"?r(s):Le.jsx("span",{children:(t=s)===null||t===void 0?void 0:t.label},"btn_".concat((n=s)===null||n===void 0?void 0:n.value))})}):Le.jsx($le,{addWrapper:!1,form:l,fieldName:u,...c,onChange:i,value:s,mode:"single",className:" fflex-1 foverflow-hidden"})},uUe=e=>{let{readItemRender:t,readonly:n,onChange:r,value:o,form:i,fieldName:a,...s}=e;return J.useEffect(()=>{if(o&&typeof o=="string")try{o=JSON.parse(o),r(o)}catch{}},[o]),n?Le.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:Array.isArray(o)&&o.map((l,u)=>Le.jsxs(Le.Fragment,{children:[" ",t&&typeof t=="function"?t(l):Le.jsx("span",{children:l==null?void 0:l.label},"btn_".concat(l==null?void 0:l.value)),u<o.length-1?Le.jsx("span",{className:" ftext-gray-400",children:","}):null]}))}):Le.jsx($le,{addWrapper:!1,form:i,fieldName:a,...s,onChange:r,value:o,mode:"multiple",className:" fflex-1 foverflow-hidden"})},gPt=e=>{let{customComponent:t,...n}=e;return t?Le.jsx(ui,{...n,children:Le.jsx(t,{...n})}):Le.jsx(ui,{...n,children:Le.jsx(ah,{...n})})},cUe=e=>{let{onChange:t,value:n,multiple:r,...o}=e;const[i,a]=J.useState();J.useEffect(()=>{if(n&&typeof n=="string")try{n=JSON.parse(n),t(n);return}catch{}r?Array.isArray(n)&&a(n):(Array.isArray(n)&&(n=n[0]),a(n))},[n]);const s=l=>{Array.isArray(l)||(l=[l]),t&&typeof t=="function"&&t(l)};return Le.jsx(sUe,{...o,onChange:s,value:i,multiple:r})},mPt=e=>{let{FetchDeptList:t,...n}=e;return Le.jsx(cUe,{...n,title:"deptName",request:t})},yPt=e=>{let{FetchPostList:t,...n}=e;return Le.jsx(cUe,{...n,title:"postName",request:t})};lUe.displayName="WithSingleSelect";uUe.displayName="WithMultipleSelect";const bPt=J.forwardRef((e,t)=>(J.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),Le.jsx(ui,{...e,children:Le.jsx(lUe,{...e})}))),EPt=J.forwardRef((e,t)=>(J.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),Le.jsx(ui,{...e,children:Le.jsx(uUe,{...e})}))),SPt=J.forwardRef((e,t)=>{let{value:n,onChange:r,...o}=e;const i=J.useRef(0),a=()=>{i.current++,r(i.current)};return Le.jsxs(ui,{...o,children:[Le.jsxs("div",{ref:t,children:["form-set-value:",n]}),Le.jsx(Sl,{onClick:a,children:"test"})]})}),CPt=e=>{let t="",n="";try{n="return ".concat(e.join("")),t=new Function(n)(),t=t.toString()}catch(r){console.error("formula (".concat(n,") error"),r)}return t},wPt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Mf=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=wPt[n[e]&63];return t};var fUe={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function i(l,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new o(c,f||l,d),g=n?n+u:u;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],p]:l._events[g].push(p):(l._events[g]=p,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)t.call(c,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=n?n+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,p=f.length,g=new Array(p);d<p;d++)g[d]=f[d].fn;return g},s.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},s.prototype.emit=function(u,c,f,d,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var h=this._events[m],y=arguments.length,v,b;if(h.fn){switch(h.once&&this.removeListener(u,h.fn,void 0,!0),y){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,c),!0;case 3:return h.fn.call(h.context,c,f),!0;case 4:return h.fn.call(h.context,c,f,d),!0;case 5:return h.fn.call(h.context,c,f,d,p),!0;case 6:return h.fn.call(h.context,c,f,d,p,g),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];h.fn.apply(h.context,v)}else{var E=h.length,S;for(b=0;b<E;b++)switch(h[b].once&&this.removeListener(u,h[b].fn,void 0,!0),y){case 1:h[b].fn.call(h[b].context);break;case 2:h[b].fn.call(h[b].context,c);break;case 3:h[b].fn.call(h[b].context,c,f);break;case 4:h[b].fn.call(h[b].context,c,f,d);break;default:if(!v)for(S=1,v=new Array(y-1);S<y;S++)v[S-1]=arguments[S];h[b].fn.apply(h[b].context,v)}}return!0},s.prototype.on=function(u,c,f){return i(this,u,c,f,!1)},s.prototype.once=function(u,c,f){return i(this,u,c,f,!0)},s.prototype.removeListener=function(u,c,f,d){var p=n?n+u:u;if(!this._events[p])return this;if(!c)return a(this,p),this;var g=this._events[p];if(g.fn)g.fn===c&&(!d||g.once)&&(!f||g.context===f)&&a(this,p);else{for(var m=0,h=[],y=g.length;m<y;m++)(g[m].fn!==c||d&&!g[m].once||f&&g[m].context!==f)&&h.push(g[m]);h.length?this._events[p]=h.length===1?h[0]:h:a(this,p)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&a(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(fUe);var xPt=fUe.exports;const APt=Gs(xPt),BZ=new APt,$Pt=e=>{let{children:t,layout:n,onTableAddRow:r,onTableRemoveRow:o,form:i,initializeFormRender:a,recordFieldsChange:s,mode:l}=e;n=n||"1";const u=p=>{const g=p.split(",").map(Number),m=24;return g.map(h=>h/g.reduce((y,v)=>y+v)*m)},c=J.useMemo(()=>u(n),[n]),f=J.useRef({}),d=J.useMemo(()=>J.Children.toArray(t).map((p,g)=>{var m,h;const y=p.props,v=(y==null?void 0:y.componentId)||(y==null?void 0:y.__id),b=v;var E=((m=p.type)===null||m===void 0?void 0:m.displayName)||((h=p.props)===null||h===void 0?void 0:h._componentName);b in f.current||(f.current[b]=Mf());const S=(y==null?void 0:y.calcHidden)&&l!="desgin",C=[];if(y!=null&&y.isRequired&&C.push({required:!0,message:"".concat(y.label,"必须填写")}),y!=null&&y.rules)if(Array.isArray(y.rules)){const D=y.rules.join("|");C.push({pattern:new RegExp(D),message:y.rulesFailMessage?y.rulesFailMessage:"".concat(y.label,"格式错误")})}else C.push({pattern:new RegExp(y.rules),message:y.rulesFailMessage?y.rulesFailMessage:"".concat(y.label,"格式错误")});const w=D=>{i.setFieldValue(b,D)};let A=null;return E=="Field.Table"?A=J.cloneElement(p,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:v,initializeFormRender:a,mode:l,recordFieldsChange:s}):E==="Field.WithSingleSelect"||E==="Field.WithMultipleSelect"||E==="Show.WithTable"?A=Le.jsx(sa.Item,{hidden:S,style:{margin:0},shouldUpdate:(D,T)=>{let $=!1;if(Array.isArray(y.filterRules)&&y.filterRules.length>0)for(let I of y.filterRules){if(I.valueType!="variable")continue;let M,R;if(M=D==null?void 0:D[I.value.field_key],R=T==null?void 0:T[I.value.field_key],M!==R){$=!0;break}}return $&&(f.current[b]=Mf()),$},children:D=>{let{getFieldsValue:T}=D;const $=T();let I=J.cloneElement(p,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:b,onCustomChange:w,fieldsValue:$,initializeFormRender:a,recordFieldsChange:s,shouldUpdateKey:f.current[b]});return E==="Show.WithTable"?Le.jsx(Le.Fragment,{children:I}):Le.jsx(sa.Item,{style:{marginBottom:0},label:"",name:b,rules:C,children:I})}}):J.isValidElement(p)?A=Le.jsx(sa.Item,{style:{marginBottom:0},label:"",name:v,rules:C,children:J.cloneElement(p,{form:i,fieldName:v,initializeFormRender:a,recordFieldsChange:s})},"".concat(v,"-form-item")):A=p,(c==null?void 0:c[g])&&Le.jsx(oT,{span:c[g],children:A},g)}),[t,c]);return Le.jsx(XB,{gutter:24,children:d})},OPt=e=>{let{title:t}=e;return t?Le.jsx("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:Le.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:t})}):null};function DPt(e,t){const n=[];let r=[];const o=(a,s)=>{const l=a-s.length;l>0&&s.push(...new Array(l).fill(J.createElement("div")))};for(const a of e){var i;const{_componentName:s}=(a==null?void 0:a.props)||{},l=((i=a.type)===null||i===void 0?void 0:i.displayName)||s;l&&l.startsWith("Layout.")?(r.length>0&&(o(t,r),n.push(r),r=[]),n.push([a])):(r.push(a),r.filter(c=>{var f;return!(c!=null&&(f=c.props)!==null&&f!==void 0&&f.calcHidden)}).length===t&&(n.push(r),r=[]))}return r.length>0&&(o(t,r),n.push(r)),n}const Dle=J.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=sa.useForm(),[a,s]=J.useState(null),l=J.useRef(null),u=J.useRef(0);J.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:F=>{u.current=1,setTimeout(()=>{u.current=0},1e3);let k={...F,__id:F==null?void 0:F.id};for(let L in F)if(A.current[L]={name:L,value:F[L]},l.current.has(L)&&l.current.get(L).componentName=="Field.Table"&&Array.isArray(F[L]))for(let H=0;H<F[L].length;H++){const z=F[L][H];for(let _ in z)A.current[[L,H,_]]={name:[L,H,_],value:z[_]}}i.setFieldsValue(k)},initializeFieldVisibility:m}),[]);const c=J.useCallback(xp.throttle(()=>{g(),s(R())},300),[r,n]);J.useEffect(()=>(console.log("children",r),c(),()=>{c.cancel()}),[r,n]);const f=()=>{c()},d=J.useRef(null),p=F=>{var k;return(k=d.current)===null||k===void 0?void 0:k[F]},g=()=>{const F=[];function k(H){var z,_;let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;var B=((z=H.type)===null||z===void 0?void 0:z.displayName)||((_=H.props)===null||_===void 0?void 0:_._componentName);const{props:j}=H;if(B&&(B.startsWith("Field.")||B.startsWith("Layout."))){let U=(j==null?void 0:j.componentId)||(j==null?void 0:j.__id),G=[];if(P&&P!==null&&P!==void 0&&P.props){var W,K;U="".concat((P==null||(W=P.props)===null||W===void 0?void 0:W.componentId)||(P==null||(K=P.props)===null||K===void 0?void 0:K.__id),".").concat(U)}j!=null&&j.withId&&G.push(j==null?void 0:j.withId),j!=null&&j.withIds&&(G=[...G,...j==null?void 0:j.withIds]),F.push({identifier:U,withIds:G,component:H,componentName:B,fillRules:j==null?void 0:j.fillRules})}j!=null&&j.children&&J.Children.toArray(j==null?void 0:j.children).forEach(G=>k(G,B&&B.startsWith("Field.")?H:null))}l.current=new Map,console.log(" fields",F);const L=J.Children.toArray(r);for(let H=0;H<L.length;H++){const z=L[H];k(z)}F.forEach(H=>{const{identifier:z}=H;l.current.set(z,{children:F.filter(_=>_.withIds.some(P=>P==z)),show:!0,...H})}),console.log("dependencyMap.current",l.current),m()},m=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const k=i.getFieldsValue();for(let L of l.current.keys())h(L,k,!0);F&&s(R())},h=function(F,k){let L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,H=!1,z=[];if(Array.isArray(F)&&(z=[...F.slice(0,-1)],F=F.filter(_=>typeof _=="string").join(".")),l.current.has(F)){const _=l.current.get(F),P=_.children;!L&&_!==null&&_!==void 0&&_.fillRules&&Array.isArray(_==null?void 0:_.fillRules)&&(_==null?void 0:_.fillRules.length)>0&&E(F,z,k,_==null?void 0:_.fillRules),P.forEach(B=>{B.component.props.withFunc&&typeof B.component.props.withFunc=="function"&&(H=S(k,B)),!L&&B.component.props.withFill&&C(k,B,z,_==null?void 0:_.componentName)})}return H},y=function(F){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(d.current)if(k){const L=Object.keys(d.current);for(let H=0;H<L.length;H++){const z=L[H];z.includes("".concat(F,","))&&delete d.current[z]}}else delete d.current[F]},v=(F,k)=>{A.current||(A.current={}),A.current[F]=k},b=function(F){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var L=Object.keys(F);L.length>0&&(L.forEach(H=>{v(H,F[H])}),k&&D())},E=(F,k,L,H)=>{let z=w("fieldsValue",F,L,null),_={},P=[];for(let U=0;U<H.length;U++){const G=H[U];let{source:Y,target:q}=G,Q=z==null?void 0:z[Y],X=Q;if((G==null?void 0:G.type)==1){if(l.current.has(q)){var B,j,W;let se=(B=l.current.get(q))===null||B===void 0||(j=B.component)===null||j===void 0||(W=j.props)===null||W===void 0?void 0:W.children;Array.isArray(se)&&se.length>0&&P.push(se.map(ee=>{var le,me;return"".concat(Y,".").concat((ee==null||(le=ee.props)===null||le===void 0?void 0:le.componentId)||(ee==null||(me=ee.props)===null||me===void 0?void 0:me.__id))}))}if(Q&&typeof Q=="string")try{Q=JSON.parse(Q)}catch(se){console.error("error end",se)}if(!Array.isArray(Q))return;X=Q.map((se,ee)=>{let le={};if(G!=null&&G.subRules&&Array.isArray(G==null?void 0:G.subRules)&&(G==null?void 0:G.subRules.length)>0)for(let me=0;me<(G==null?void 0:G.subRules.length);me++){const{source:we,target:ce}=G==null?void 0:G.subRules[me];le[ce]=se==null?void 0:se[we];let ue={name:[q,ee,ce],value:se==null?void 0:se[we]};_[ue.name]=ue}return le}),y(q,!0),BZ.emit("reloadTable",q)}else{let ne=0;if(k&&Array.isArray(k)&&k.length>1&&(k.filter(se=>typeof se=="string").join("."),ne=k[k.length-1],q=[...k,q],Array.isArray(z)&&z.length>ne)){var K;X=(K=z[ne])===null||K===void 0?void 0:K[Y]}_[q]={name:Array.isArray(q)?q:[q],value:X}}(G==null?void 0:G.type)==1&&i.setFieldValue(q,void 0),i.setFieldValue(q,X)}setTimeout(()=>{b(_,!0),P.length>0&&P.forEach(U=>{Array.isArray(U)&&U.length>0&&$(U)})},0)},S=(F,k,L)=>{var H,z;let _=!1;const P=k==null||(H=k.component)===null||H===void 0||(z=H.props)===null||z===void 0?void 0:z.withFunc(F),B=k==null?void 0:k.identifier;if(l.current.has(B)){const j=l.current.get(B);j.show!==P&&(j.show=P,l.current.set(B,j),_=!0)}return _},C=async(F,k,L,H)=>{var z,_;const P=k==null||(z=k.component)===null||z===void 0?void 0:z.props.withFill,B=k==null||(_=k.component)===null||_===void 0?void 0:_.props.withDataFetch;let j=0,W="",K=k.identifier;if(L&&Array.isArray(L)&&L.length>1)W=L.filter(q=>typeof q=="string").join("."),j=L[L.length-1],K.startsWith("".concat(W,"."))&&(K=[...L,K.replace("".concat(W,"."),"")]);else if(K.indexOf(".")>=0){K=K.split(".");let q=w("fieldsValue",K[0],F,[]);if(Array.isArray(q)&&q.length>0)for(let Q=0;Q<q.length;Q++)await C(F,k,[K[0],Q],H);return}let U=[];if(P!=null&&P.withData&&(P==null?void 0:P.withData.length)>0&&B&&typeof B=="function")for(let q=0;q<(P==null?void 0:P.withData.length);q++){const Q=P==null?void 0:P.withData[q];let X={};X.tableName=Q.withTable.table_name,X.filter={};for(let se=0;se<Q.withCondition.length;se++){var G;const{value:ee,column:le}=Q.withCondition[se];let me=w(ee.group_key,ee.field_key,F,U);Array.isArray(me)&&Array.isArray(K)&&me.length>j&&(me=me[j]),H=="Field.WithSingleSelect"&&me&&(G=me)!==null&&G!==void 0&&G.value&&(me=me.value),X.filter[le.column_name]=me}const ne=await B(X);ne.code===0&&ne.data.list&&U.push({id:Q.id,data:ne.data.list})}let Y;if(P.value&&P.value.length>0&&(Y=P.value.map(q=>{let Q="";const{insert:X,attributes:ne}=q;return typeof X!="string"?X!=null&&X.span&&ne&&ne.tagKey&&ne.id&&(Q=w(ne.tagKey,ne.id,F,U),Array.isArray(Q)?Array.isArray(K)&&Q.length>j?Q=Q[j]:Q=JSON.stringify(Q):Q.length>0&&(Q='"'.concat(Q,'"'))):Q=X,Q})),Y&&Y.length>0){const q=CPt(Y);i.setFieldValue(K,q),h(K,i.getFieldsValue())}},w=(F,k,L,H)=>{let z="";if(F=="fieldsValue"){var _;if(k.indexOf(".")>=0){var P;const[W,K]=k.split("."),U=(L==null?void 0:L[W])||[];Array.isArray(U)?z=U.map(G=>{var Y;return(Y=G==null?void 0:G[K])!==null&&Y!==void 0?Y:""}):z=(P=U==null?void 0:U[K])!==null&&P!==void 0?P:""}else z=(_=L==null?void 0:L[k])!==null&&_!==void 0?_:""}else{let W=H.find(K=>K.id===F);if(W&&W.data&&W.data.length>0){var B,j;z=(B=(j=W.data[0])===null||j===void 0?void 0:j[k])!==null&&B!==void 0?B:""}}return z},A=J.useRef({}),D=xp.debounce(()=>{console.log("debounceHandleFieldsChange");const F=i.getFieldsValue(),k=u.current;let L=!1;d.current||(d.current={});for(let H in A.current){let z=A.current[H];xp.isEqual(z.value||"",p(z.name)||"")||(console.log("!isEqual field.name",z.name),console.log("field.value",z.value),console.log("getLastFieldValue(field.name)",p(z.name)),console.log("lockStatus_",k),k!=1&&(L=h(z.name,F)),d.current[z.name]=z.value)}L&&(console.log("needRefresh",L),s(R())),A.current={}},200),T=F=>{console.log("changedFields",F),F.filter(k=>{k.name&&k.name.length>0&&(A.current[k.name]=k)}),D()},$=F=>{let k=[];F.forEach(H=>{if(!l.current.has(H))return;let z=l.current.get(H);z.withIds.length<=0||k.push(...z.withIds.filter(_=>!k.includes(_)))}),k=k.filter(H=>{var z=i.getFieldValue(H);return!(typeof z!="number"&&!z)});const L=i.getFieldsValue();setTimeout(()=>{k.forEach(H=>{h(H,L)})},0)},I=F=>{const k=i.getFieldsValue();setTimeout(()=>{F.forEach(L=>{h(L,k)})},0)},M=J.useRef({}),R=()=>{console.log("renderChildren");const F=J.Children.toArray(r);return DPt(F.filter(L=>{var H;const z=L.props.componentId||L.props.__id;return!l.current.has(z)||((H=l.current.get(z))===null||H===void 0?void 0:H.show)}),n).map((L,H)=>Le.jsx(XB,{gutter:[24,24],children:L.map((z,_)=>{var P;const{componentId:B,__id:j,_componentName:W,...K}=z.props,U=((P=z.type)===null||P===void 0?void 0:P.displayName)||W,G=B||j;G in M.current||(M.current[G]=Mf());const Y=U&&U.startsWith("Layout."),q=U&&U=="Field.Table",Q=K.calcHidden&&o!="desgin",X=[];if(K.isRequired&&X.push({required:!0,message:"".concat(K.label,"必须填写")}),K.rules)if(Array.isArray(K.rules)){const ee=K.rules.join("|");X.push({pattern:new RegExp(ee),message:K.rulesFailMessage?K.rulesFailMessage:"".concat(K.label,"格式错误")})}else X.push({pattern:new RegExp(K.rules),message:K.rulesFailMessage?K.rulesFailMessage:"".concat(K.label,"格式错误")});const ne=ee=>{i.setFieldValue(G,ee)};let se;return q||Y?se=J.cloneElement(z,{onTableAddRow:$,onTableRemoveRow:I,form:i,fieldName:G,onCustomChange:ne,initializeFormRender:f,mode:o,recordFieldsChange:b}):U==="Field.WithSingleSelect"||U==="Field.WithMultipleSelect"||U==="Show.WithTable"?se=Le.jsx(sa.Item,{hidden:Q,style:{margin:0},shouldUpdate:(ee,le)=>{let me=!1;if(Array.isArray(K.filterRules)&&K.filterRules.length>0)for(let we of K.filterRules){if(we.valueType!="variable")continue;let ce,ue;if(ce=ee==null?void 0:ee[we.value.field_key],ue=le==null?void 0:le[we.value.field_key],ce!==ue){me=!0;break}}return me&&(M.current[G]=Mf(),console.log(G,Mf())),me},children:ee=>{let{getFieldsValue:le}=ee;const me=le();let we=J.cloneElement(z,{onTableAddRow:$,onTableRemoveRow:I,form:i,fieldName:G,onCustomChange:ne,fieldsValue:me,initializeFormRender:f,recordFieldsChange:b,shouldUpdateKey:M.current[G]});return U==="show.WithTable"?Le.jsx(Le.Fragment,{children:we}):Le.jsx(sa.Item,{style:{marginBottom:0},label:"",name:G,rules:X,children:we})}}):se=Le.jsx(sa.Item,{hidden:Q,style:{marginBottom:0},label:"",name:G,rules:X,children:J.cloneElement(z,{form:i,fieldName:G,onCustomChange:ne,initializeFormRender:f,recordFieldsChange:b})}),Le.jsx(oT,{span:K.calcHidden?0:Y?24:24/n,style:{marginBottom:0},children:se},G||"col-".concat(_))})},"row-".concat(H)))};return Le.jsxs(sa,{form:i,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col fgap-y-2"+(o=="desgin"?" fp-6":""),onFieldsChange:T,children:[Le.jsx(sa.Item,{name:"__id",hidden:!0,children:Le.jsx("input",{type:"hidden"})}),a]})});function TPt(e){return J.forwardRef((t,n)=>Le.jsx(e,{...t,ref:n,forwardedRef:n}))}class N_n extends J.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return Le.jsx(Dle,{...n,ref:t})}}const IPt=TPt(e=>{let{forwardedRef:t,...n}=e;return Le.jsx(Dle,{...n,ref:t})}),PPt=e=>{let{request:t,value:n,onChange:r,callError:o,disabledValue:i,addRoot:a=!0,title:s,...l}=e;const[u,c]=J.useState(!1),[f,d]=J.useState([]);J.useEffect(()=>{p()},[]),J.useEffect(()=>{if(typeof n=="string")try{n=JSON.parse(n),r(n)}catch{}Array.isArray(n)&&y(n)},[n]);const p=async()=>{if(t&&typeof t=="function"){var D;const T=await t();if(T.code>0){o&&typeof o=="function"&&o(T.message);return}let $=aUe(((D=T.data)===null||D===void 0?void 0:D.list)||T.data||[],"id",s||"title",(l==null?void 0:l.parentId)||"parentId","children",0,i);a&&($=[{value:0,title:"根节点",children:$}]),l.treeData=$,console.log("treeData",$),d($)}l.treeData&&d(l.treeData),c(!0)},[g,m]=J.useState([]),[h,y]=J.useState([]),[v,b]=J.useState([]),[E,S]=J.useState(!0),C=D=>{console.log("onExpand",D),m(D),S(!1)},w=D=>{console.log("onCheck",D),y(D),r(D)},A=(D,T)=>{console.log("onSelect",T),b(D)};return Le.jsx(ui,{...l,children:Le.jsx(Ele,{checkable:!0,onExpand:C,onCheck:w,onSelect:A,expandedKeys:g,autoExpandParent:E,checkedKeys:h,selectedKeys:v,treeData:f})})},NPt=e=>Le.jsx(ui,{...e,children:Le.jsx(rT,{...e})}),RPt=e=>Le.jsx(ui,{...e,children:Le.jsx(rT.Group,{...e})}),MPt=e=>Le.jsx(ui,{...e,children:Le.jsx(VB.Group,{...e})}),dUe=e=>{let{value:t,maxCount:n,multiple:r,onChange:o,...i}=e;J.useEffect(()=>{if(t){if(typeof t=="string")try{t=JSON.parse(t),o(t)}catch{}console.log("value",t),Array.isArray(t)&&s(t)}},[t]),n=n||99,r=r||!0;const[a,s]=J.useState([]),l=u=>{let{fileList:c}=u;console.log("newFileList",c),c=c.map(f=>(f.status=="done"&&f.response&&(f.url=f.response),f)),o(c.map(f=>({uid:f.uid,name:f.name,status:f.status,url:f.url||f.response||"",error:f.error}))),s(c)};return Le.jsx(nk,{...i,listType:"text",multiple:r,onChange:l,maxCount:n,fileList:a,children:!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&a.length<n&&Le.jsx(Sl,{type:(i==null?void 0:i.type)||"default",icon:(i==null?void 0:i.icon)||Le.jsx(iUe,{}),children:"点击上传文件"})})};dUe.displayName="UploadFile";const FPt=e=>Le.jsx(ui,{...e,children:Le.jsx(dUe,{...e})}),pUe=e=>{let{maxCount:t,value:n,multiple:r,onChange:o,...i}=e;J.useEffect(()=>{if(n){if(console.log("value",n),typeof n=="string")try{n=JSON.parse(n),o(n)}catch{}let S=[];if(Array.isArray(n))for(let C=0;C<n.length;C++){let w=n[C];var E=g.current.find(A=>A.uid===w.uid);!E||(E.version||0)<(w.version||0)?S.push(w):S.push(E)}s(S)}},[n]),t=t||99,r=r||!0;const[a,s]=J.useState([]),[l,u]=J.useState(""),[c,f]=J.useState(0),[d,p]=J.useState(!1),g=J.useRef([]),m=E=>new Promise((S,C)=>{const w=new FileReader;w.readAsDataURL(E),w.onload=()=>S(w.result),w.onerror=A=>C(A)}),h=async(E,S)=>{!E.url&&!E.preview&&(E.preview=await m(E.originFileObj)),u(E.url||E.preview),f(S),p(!0)},y=async(E,S)=>{i!=null&&i.disabled||s(a.filter((C,w)=>w!==S))},v=Le.jsx(Le.Fragment,{children:Le.jsxs("div",{className:"fw-full fh-full fflex fflex-col fitems-center fjustify-center fborder fborder-dashed fcursor-pointer frounded",children:[Le.jsx(oUe,{}),Le.jsx("div",{className:"fmt-2",children:"点击上传"})]})}),b=E=>{let{fileList:S}=E,C=[];for(let D=0;D<S.length;D++){var w=S[D];w.version=new Date().getTime();var A=g.current.find(T=>T.uid===w.uid);console.log("oldfile",JSON.parse(JSON.stringify(A||{}))),A&&A.status!="uploading"?C.push(A):(w.status=="done"&&w.response&&(w.url=w.response),C.push(w))}g.current=C,s(C),o(C.map(D=>({uid:D.uid,name:D.name,status:D.status,url:D.url||D.response||"",error:D.error,version:D.version||0})))};return Le.jsxs(Le.Fragment,{children:[Le.jsx("div",{className:"fflex fgap-3 fflex-wrap",children:Le.jsx(nk,{...i,itemRender:(E,S,C)=>{console.log("file",S);let w=C.findIndex(A=>A.uid===S.uid);return Le.jsx(Le.Fragment,{children:Le.jsxs("div",{className:"fgroup fw-full fh-full fbg-transparent fborder frounded fflex fitems-center fjustify-center foverflow-hidden fcursor-pointer frelative"+(S.status=="error"?" fborder-red-500":""),children:[Le.jsxs("div",{className:" fhidden fabsolute fw-full fh-full fbg-gray-900 fbg-opacity-50 fitems-center fjustify-center fz-10 group-hover:fflex ftext-white ftext-lg fgap-2",children:[S.status=="done"&&Le.jsx(rUe,{onClick:()=>{h(S,w)},className:"hover:ftext-gray-200"}),!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&Le.jsx(Ale,{onClick:()=>{y(S,w)},className:"hover:ftext-gray-200"})]}),S.status=="uploading"&&Le.jsx("div",{className:" fw-full fh-full fflex fitems-center fjustify-center fabsolute ftop-0 fleft-0 ",children:Le.jsx(WD,{})}),Le.jsx("img",{src:S.url||S.thumbUrl,alt:"Example Image",className:"fmax-w-full fmax-h-full fobject-contain "})]},"file-".concat(S.uid))})},listType:"picture-card",fileList:a,multiple:r,onPreview:h,onChange:b,maxCount:t,children:a.length>=t||i!=null&&i.disabled||i!=null&&i.readonly?null:v})}),l&&Le.jsx(PR.PreviewGroup,{preview:{visible:d,current:c,onVisibleChange:E=>p(E),onChange:E=>{f(E)}},children:a.map((E,S)=>Le.jsx(Le.Fragment,{children:Le.jsx(PR,{wrapperStyle:{display:"none"},src:E.url})}))})]})};pUe.displayName="UploadImage";const BPt=e=>Le.jsx(ui,{...e,children:Le.jsx(pUe,{...e})}),kPt=e=>{let{value:t,onChange:n,form:r,fieldName:o,...i}=e,a=!1;return typeof t=="boolean"?a=t:typeof t=="string"?a=t=="1"||t=="true":typeof t=="number"&&(a=t==1),t!==a&&(r==null||r.setFieldValue(o,a)),Le.jsx(ui,{...i,children:Le.jsx(hle,{...i,onChange:n,value:t})})};var LPt={exports:{}};(function(e,t){(function(n,r){e.exports=r(V_e)})(Ir,function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var o=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a,s){return s==="W"?a+"周":a+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(a,s){var l=100*a+s;return l<600?"凌晨":l<900?"早上":l<1100?"上午":l<1300?"中午":l<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(LPt);var jPt={locale:"zh_CN",yearFormat:"YYYY年",cellDateFormat:"D",cellMeridiemFormat:"A",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"};const _Pt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},hUe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},jPt),timePickerLocale:Object.assign({},_Pt)};hUe.lang.ok="确定";var vUe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ir,function(){return function(n,r,o){o.updateLocale=function(i,a){var s=o.Ls[i];if(s)return(a?Object.keys(a):[]).forEach(function(l){s[l]=a[l]}),s}}})})(vUe);var HPt=vUe.exports;const zPt=Gs(HPt);ra.extend(zPt);ra.extend(q_e);ra.updateLocale("zh-cn",{weekStart:0});const VPt=e=>{let{datetype:t,value:n,defaultNow:r,onChange:o,...i}=e;t=t||"date";const[a,s]=J.useState(i==null?void 0:i.picker),[l,u]=J.useState(i==null?void 0:i.format),[c,f]=J.useState(!1),[d,p]=J.useState(!1),g=J.useRef(!1);J.useEffect(()=>{if(r&&!n){const h=ra().format("YYYY-MM-DD HH:mm:ss");typeof o=="function"&&o(h);return}},[]);const m=(h,y)=>{g.current=!0,o(y)};return J.useEffect(()=>{switch(s("date"),f(!1),t){case"date":s("date"),u("YYYY-MM-DD"),p(!1);break;case"datetime":f(!0),s("datetime"),u("YYYY-MM-DD HH:mm:ss"),p(!0);break;case"month":s("month"),p(!1);break;case"year":s("year"),p(!1);break}},[t]),Le.jsx(ui,{...i,children:Le.jsx(FC,{locale:hUe,...i,picker:a,format:l,style:{width:"100%"},onChange:m,value:n&&ra(n).isValid()?ra(n):void 0,showTime:c,needConfirm:d})})},UPt=e=>{var t;let{customComponent:n,form:r,fieldsValue:o,...i}=e;const[a,s]=J.useState();return J.useEffect(()=>{s(JSON.stringify(o))},[o]),n?Le.jsx(n,{...i,form:r,fieldsValue:o}):Le.jsx(YB,{type:"inner",title:(t=i==null?void 0:i.label)!==null&&t!==void 0?t:"关联子表",children:Le.jsx("div",{className:"fh-20 fw-full fflex fjustify-center fitems-center",children:"子表内容在设计阶段暂不显示"})})},lSe=e=>{let{label:t,subTableIndex:n,children:r,subTableHead:o=!1,...i}=e;return Le.jsx("div",{className:"fsticky fright-0 fbg-white fborder-b ",style:{boxShadow:"-6px 0 6px -6px rgba(50,50,50,0.15)",flex:"0 0 50px",width:"50px"},children:Le.jsxs("div",{className:"frelative fw-full fh-full fflex fflex-col foverflow-hidden",children:[t&&o&&Le.jsx("div",{className:"fh-12 ffont-semibold fbg-[#fafafa] ftext-sm fflex fflex-nowrap ftext-nowrap fjustify-between fitems-center fpx-2 fborder-b",children:t}),Le.jsx("div",{className:"fw-full fflex-1 fflex fitems-center fjustify-center fp-2 fbox-border fgap-2",children:r})]})})},kZ=e=>{let{children:t,width:n,hidden:r,...o}=e;const[i,a]=J.useState(0);return J.useEffect(()=>{a(n)},[n]),r?t:Le.jsx("div",{className:"fflex-1 fpx-1 fborder-b",style:{minWidth:"".concat(i,"px")},...o,children:t})},gUe=e=>{let{children:t,onTableAddRow:n,disabled:r,readonly:o,onTableRemoveRow:i,form:a,fieldName:s,initializeFormRender:l,recordFieldsChange:u,mode:c,isAllowCopy:f=!1,isAllowAdd:d=!0,...p}=e;J.useEffect(()=>{},[a]);const g=J.useRef(J.Children.map(t,()=>Mf())),[m,h]=J.useState(!1),y=p.componentId||p.__id,v=J.Children.map(t,A=>"".concat(y,".").concat(A.props.componentId||A.props.__id)),b=[],E=()=>{m||h(!0),a==null||a.setFieldValue(s,[{}])},[S,C]=J.useState(),w=A=>{s==A&&C(Mf())};return J.useEffect(()=>(C(Mf()),BZ.on("reloadTable",w),()=>{BZ.off("reloadTable",w)}),[]),p.isRequired&&b.push({required:!0,message:"子表[".concat(p.label,"]必须填写")}),Le.jsx(sa.List,{name:y,rules:b,children:(A,D)=>{let{add:T,remove:$}=D;return A.length===0&&!m&&E(),Le.jsxs("div",{className:"fw-full ",children:[Le.jsxs("div",{className:"fw-full frelative fmin-h-20 foverflow-x-auto",style:{position:"relative"},children:[A.length===0&&Le.jsxs("div",{className:"fborder-b fflex flex-nowrap fmin-w-full ",children:[J.Children.map(t,(I,M)=>{var R;const F=I==null||(R=I.props)===null||R===void 0?void 0:R.calcHidden;return Le.jsx(kZ,{width:150,hidden:F,children:F?null:J.cloneElement(I,{key:"row_".concat(0,"_child_",M),subTable:!0,subTableHead:!0,subTableContent:!1})},"row_".concat(0,"_col_",M))}),r!=!0&&o!=!0&&Le.jsx(lSe,{subTableHead:!0,subTable:!0,subTableIndex:0,label:"操作"},"row_".concat(0,"_action"))]},"tableHead"),A.map((I,M)=>Le.jsxs("div",{className:" fflex flex-nowrap fmin-w-full ",children:[J.Children.map(t,(R,F)=>{var k,L,H;let{props:z}=R;const _=(R==null||(k=R.props)===null||k===void 0?void 0:k.componentId)||(R==null||(L=R.props)===null||L===void 0?void 0:L.__id)||F,P=[];if(z.isRequired&&P.push({required:!0,message:"".concat(z.label,"必须填写")}),z.rules)if(Array.isArray(z.rules)){const Y=z.rules.join("|");P.push({pattern:new RegExp(Y),message:z.rulesFailMessage?z.rulesFailMessage:"".concat(z.label,"格式错误")})}else P.push({pattern:new RegExp(z.rules),message:z.rulesFailMessage?z.rulesFailMessage:"".concat(z.label,"格式错误")});const{componentId:B,__id:j,_componentName:W,...K}=R.props,U=((H=R.type)===null||H===void 0?void 0:H.displayName)||W,G=z.calcHidden&&c!="desgin";return Le.jsx(kZ,{width:150,hidden:G,children:Le.jsx(sa.Item,{style:{margin:0},hidden:G,shouldUpdate:(Y,q)=>{let Q=!1;if((U==="Field.WithSingleSelect"||U==="Field.WithMultipleSelect")&&Array.isArray(K.filterRules)&&K.filterRules.length>0)for(let ue of K.filterRules){let ge,pe;if(ue.valueType=="variable"){if("parent"in(ue==null?void 0:ue.value)&&ue.value.parent!=""){var X,ne,se,ee,le,me,we,ce;ge=Y==null||(X=Y[ue==null||(se=ue.value)===null||se===void 0?void 0:se.parent])===null||X===void 0||(ne=X[I.name])===null||ne===void 0?void 0:ne[ue==null||(ee=ue.value)===null||ee===void 0?void 0:ee.field_key],pe=q==null||(le=q[ue==null||(we=ue.value)===null||we===void 0?void 0:we.parent])===null||le===void 0||(me=le[I.name])===null||me===void 0?void 0:me[ue==null||(ce=ue.value)===null||ce===void 0?void 0:ce.field_key]}else ge=Y==null?void 0:Y[ue.value.field_key],pe=q==null?void 0:q[ue.value.field_key];if(ge!==pe){Q=!0;break}}}return Q&&(g.current[F]=Mf()),Q},children:Y=>{let{getFieldsValue:q}=Y;const Q=q();return Le.jsx(sa.Item,{label:"",style:{marginBottom:0},name:[I.name,_],rules:P,children:J.cloneElement(R,{key:"row_".concat(I.key,"_child_").concat(F),subTable:!0,subTableIndex:M,subTableHead:M===0,form:a,shouldUpdateKey:g.current[F],fieldName:[s,I.name,_],fieldsValue:Q,initializeFormRender:l,recordFieldsChange:u})})}})},"row_".concat(I.key,"_col_").concat(F))}),r!=!0&&o!=!0&&Le.jsxs(lSe,{subTableHead:M==0,subTable:!0,subTableIndex:M,label:"操作",children:[f&&Le.jsx(nUe,{className:"fcursor-pointer",onClick:()=>{let R=a.getFieldValue(s);const F={...R[M]};R.splice(M+1,0,F),a==null||a.setFieldValue(s,R);let k={},L=s;for(let H=M+1;H<R.length;H++){let z=R[H];for(let _ in z){let P=[L,H,_];k[P]={name:P,value:z[_]}}}typeof u=="function"&&u(k,!0)}}),Le.jsx(ple,{title:"删除确认",description:"确定要删除这一行吗?",onConfirm:()=>{$(M),typeof i=="function"&&i(v)},okText:"确定",cancelText:"取消",children:Le.jsx(Ale,{className:"fcursor-pointer ftext-red-500"})})]},"row_".concat(M,"_action"))]},"".concat(S,".").concat(I.key)))]}),r!=!0&&o!=!0&&d&&Le.jsx(Sl,{onClick:()=>{T({key:Mf()}),typeof n=="function"&&n(v)},className:"fmy-2",children:"新增一行"})]})}})};gUe.displayName="Table";const mUe=e=>Le.jsx(ui,{...e,higLabel:!0,children:Le.jsx(gUe,{...e})});mUe.displayName="Table";const WPt=e=>Le.jsx("div",{children:"sdfsdfsdf"});function KPt(){this.__data__=[],this.size=0}var GPt=KPt;function YPt(e,t){return e===t||e!==e&&t!==t}var yUe=YPt,XPt=yUe;function qPt(e,t){for(var n=e.length;n--;)if(XPt(e[n][0],t))return n;return-1}var ak=qPt,QPt=ak,ZPt=Array.prototype,JPt=ZPt.splice;function eNt(e){var t=this.__data__,n=QPt(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():JPt.call(t,n,1),--this.size,!0}var tNt=eNt,nNt=ak;function rNt(e){var t=this.__data__,n=nNt(t,e);return n<0?void 0:t[n][1]}var oNt=rNt,iNt=ak;function aNt(e){return iNt(this.__data__,e)>-1}var sNt=aNt,lNt=ak;function uNt(e,t){var n=this.__data__,r=lNt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var cNt=uNt,fNt=GPt,dNt=tNt,pNt=oNt,hNt=sNt,vNt=cNt;function kC(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kC.prototype.clear=fNt;kC.prototype.delete=dNt;kC.prototype.get=pNt;kC.prototype.has=hNt;kC.prototype.set=vNt;var sk=kC,gNt=sk;function mNt(){this.__data__=new gNt,this.size=0}var yNt=mNt;function bNt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var ENt=bNt;function SNt(e){return this.__data__.get(e)}var CNt=SNt;function wNt(e){return this.__data__.has(e)}var xNt=wNt;function ANt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var bUe=ANt,$Nt=lT,ONt=bUe,DNt="[object AsyncFunction]",TNt="[object Function]",INt="[object GeneratorFunction]",PNt="[object Proxy]";function NNt(e){if(!ONt(e))return!1;var t=$Nt(e);return t==TNt||t==INt||t==DNt||t==PNt}var EUe=NNt,RNt=sh,MNt=RNt["__core-js_shared__"],FNt=MNt,FH=FNt,uSe=function(){var e=/[^.]+$/.exec(FH&&FH.keys&&FH.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function BNt(e){return!!uSe&&uSe in e}var kNt=BNt,LNt=Function.prototype,jNt=LNt.toString;function _Nt(e){if(e!=null){try{return jNt.call(e)}catch{}try{return e+""}catch{}}return""}var SUe=_Nt,HNt=EUe,zNt=kNt,VNt=bUe,UNt=SUe,WNt=/[\\^$.*+?()[\]{}|]/g,KNt=/^\[object .+?Constructor\]$/,GNt=Function.prototype,YNt=Object.prototype,XNt=GNt.toString,qNt=YNt.hasOwnProperty,QNt=RegExp("^"+XNt.call(qNt).replace(WNt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ZNt(e){if(!VNt(e)||zNt(e))return!1;var t=HNt(e)?QNt:KNt;return t.test(UNt(e))}var JNt=ZNt;function e5t(e,t){return e==null?void 0:e[t]}var t5t=e5t,n5t=JNt,r5t=t5t;function o5t(e,t){var n=r5t(e,t);return n5t(n)?n:void 0}var LC=o5t,i5t=LC,a5t=sh,s5t=i5t(a5t,"Map"),Tle=s5t,l5t=LC,u5t=l5t(Object,"create"),lk=u5t,cSe=lk;function c5t(){this.__data__=cSe?cSe(null):{},this.size=0}var f5t=c5t;function d5t(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var p5t=d5t,h5t=lk,v5t="__lodash_hash_undefined__",g5t=Object.prototype,m5t=g5t.hasOwnProperty;function y5t(e){var t=this.__data__;if(h5t){var n=t[e];return n===v5t?void 0:n}return m5t.call(t,e)?t[e]:void 0}var b5t=y5t,E5t=lk,S5t=Object.prototype,C5t=S5t.hasOwnProperty;function w5t(e){var t=this.__data__;return E5t?t[e]!==void 0:C5t.call(t,e)}var x5t=w5t,A5t=lk,$5t="__lodash_hash_undefined__";function O5t(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=A5t&&t===void 0?$5t:t,this}var D5t=O5t,T5t=f5t,I5t=p5t,P5t=b5t,N5t=x5t,R5t=D5t;function jC(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jC.prototype.clear=T5t;jC.prototype.delete=I5t;jC.prototype.get=P5t;jC.prototype.has=N5t;jC.prototype.set=R5t;var M5t=jC,fSe=M5t,F5t=sk,B5t=Tle;function k5t(){this.size=0,this.__data__={hash:new fSe,map:new(B5t||F5t),string:new fSe}}var L5t=k5t;function j5t(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var _5t=j5t,H5t=_5t;function z5t(e,t){var n=e.__data__;return H5t(t)?n[typeof t=="string"?"string":"hash"]:n.map}var uk=z5t,V5t=uk;function U5t(e){var t=V5t(this,e).delete(e);return this.size-=t?1:0,t}var W5t=U5t,K5t=uk;function G5t(e){return K5t(this,e).get(e)}var Y5t=G5t,X5t=uk;function q5t(e){return X5t(this,e).has(e)}var Q5t=q5t,Z5t=uk;function J5t(e,t){var n=Z5t(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var e8t=J5t,t8t=L5t,n8t=W5t,r8t=Y5t,o8t=Q5t,i8t=e8t;function _C(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_C.prototype.clear=t8t;_C.prototype.delete=n8t;_C.prototype.get=r8t;_C.prototype.has=o8t;_C.prototype.set=i8t;var CUe=_C,a8t=sk,s8t=Tle,l8t=CUe,u8t=200;function c8t(e,t){var n=this.__data__;if(n instanceof a8t){var r=n.__data__;if(!s8t||r.length<u8t-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new l8t(r)}return n.set(e,t),this.size=n.size,this}var f8t=c8t,d8t=sk,p8t=yNt,h8t=ENt,v8t=CNt,g8t=xNt,m8t=f8t;function HC(e){var t=this.__data__=new d8t(e);this.size=t.size}HC.prototype.clear=p8t;HC.prototype.delete=h8t;HC.prototype.get=v8t;HC.prototype.has=g8t;HC.prototype.set=m8t;var y8t=HC,b8t="__lodash_hash_undefined__";function E8t(e){return this.__data__.set(e,b8t),this}var S8t=E8t;function C8t(e){return this.__data__.has(e)}var w8t=C8t,x8t=CUe,A8t=S8t,$8t=w8t;function FR(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new x8t;++t<n;)this.add(e[t])}FR.prototype.add=FR.prototype.push=A8t;FR.prototype.has=$8t;var O8t=FR;function D8t(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var T8t=D8t;function I8t(e,t){return e.has(t)}var P8t=I8t,N8t=O8t,R8t=T8t,M8t=P8t,F8t=1,B8t=2;function k8t(e,t,n,r,o,i){var a=n&F8t,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var f=-1,d=!0,p=n&B8t?new N8t:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var g=e[f],m=t[f];if(r)var h=a?r(m,g,f,t,e,i):r(g,m,f,e,t,i);if(h!==void 0){if(h)continue;d=!1;break}if(p){if(!R8t(t,function(y,v){if(!M8t(p,v)&&(g===y||o(g,y,n,r,i)))return p.push(v)})){d=!1;break}}else if(!(g===m||o(g,m,n,r,i))){d=!1;break}}return i.delete(e),i.delete(t),d}var wUe=k8t,L8t=sh,j8t=L8t.Uint8Array,_8t=j8t;function H8t(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}var z8t=H8t;function V8t(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var U8t=V8t,dSe=rk,pSe=_8t,W8t=yUe,K8t=wUe,G8t=z8t,Y8t=U8t,X8t=1,q8t=2,Q8t="[object Boolean]",Z8t="[object Date]",J8t="[object Error]",eRt="[object Map]",tRt="[object Number]",nRt="[object RegExp]",rRt="[object Set]",oRt="[object String]",iRt="[object Symbol]",aRt="[object ArrayBuffer]",sRt="[object DataView]",hSe=dSe?dSe.prototype:void 0,BH=hSe?hSe.valueOf:void 0;function lRt(e,t,n,r,o,i,a){switch(n){case sRt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case aRt:return!(e.byteLength!=t.byteLength||!i(new pSe(e),new pSe(t)));case Q8t:case Z8t:case tRt:return W8t(+e,+t);case J8t:return e.name==t.name&&e.message==t.message;case nRt:case oRt:return e==t+"";case eRt:var s=G8t;case rRt:var l=r&X8t;if(s||(s=Y8t),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=q8t,a.set(e,t);var c=K8t(s(e),s(t),r,o,i,a);return a.delete(e),c;case iRt:if(BH)return BH.call(e)==BH.call(t)}return!1}var uRt=lRt;function cRt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var fRt=cRt,dRt=fRt,pRt=ok;function hRt(e,t,n){var r=t(e);return pRt(e)?r:dRt(r,n(e))}var vRt=hRt;function gRt(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}var mRt=gRt;function yRt(){return[]}var bRt=yRt,ERt=mRt,SRt=bRt,CRt=Object.prototype,wRt=CRt.propertyIsEnumerable,vSe=Object.getOwnPropertySymbols,xRt=vSe?function(e){return e==null?[]:(e=Object(e),ERt(vSe(e),function(t){return wRt.call(e,t)}))}:SRt,ARt=xRt;function $Rt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ORt=$Rt,DRt=lT,TRt=uT,IRt="[object Arguments]";function PRt(e){return TRt(e)&&DRt(e)==IRt}var NRt=PRt,gSe=NRt,RRt=uT,xUe=Object.prototype,MRt=xUe.hasOwnProperty,FRt=xUe.propertyIsEnumerable,BRt=gSe(function(){return arguments}())?gSe:function(e){return RRt(e)&&MRt.call(e,"callee")&&!FRt.call(e,"callee")},kRt=BRt,BR={exports:{}};function LRt(){return!1}var jRt=LRt;BR.exports;(function(e,t){var n=sh,r=jRt,o=t&&!t.nodeType&&t,i=o&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===o,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;e.exports=u})(BR,BR.exports);var AUe=BR.exports,_Rt=9007199254740991,HRt=/^(?:0|[1-9]\d*)$/;function zRt(e,t){var n=typeof e;return t=t??_Rt,!!t&&(n=="number"||n!="symbol"&&HRt.test(e))&&e>-1&&e%1==0&&e<t}var VRt=zRt,URt=9007199254740991;function WRt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=URt}var $Ue=WRt,KRt=lT,GRt=$Ue,YRt=uT,XRt="[object Arguments]",qRt="[object Array]",QRt="[object Boolean]",ZRt="[object Date]",JRt="[object Error]",eMt="[object Function]",tMt="[object Map]",nMt="[object Number]",rMt="[object Object]",oMt="[object RegExp]",iMt="[object Set]",aMt="[object String]",sMt="[object WeakMap]",lMt="[object ArrayBuffer]",uMt="[object DataView]",cMt="[object Float32Array]",fMt="[object Float64Array]",dMt="[object Int8Array]",pMt="[object Int16Array]",hMt="[object Int32Array]",vMt="[object Uint8Array]",gMt="[object Uint8ClampedArray]",mMt="[object Uint16Array]",yMt="[object Uint32Array]",Wo={};Wo[cMt]=Wo[fMt]=Wo[dMt]=Wo[pMt]=Wo[hMt]=Wo[vMt]=Wo[gMt]=Wo[mMt]=Wo[yMt]=!0;Wo[XRt]=Wo[qRt]=Wo[lMt]=Wo[QRt]=Wo[uMt]=Wo[ZRt]=Wo[JRt]=Wo[eMt]=Wo[tMt]=Wo[nMt]=Wo[rMt]=Wo[oMt]=Wo[iMt]=Wo[aMt]=Wo[sMt]=!1;function bMt(e){return YRt(e)&&GRt(e.length)&&!!Wo[KRt(e)]}var EMt=bMt;function SMt(e){return function(t){return e(t)}}var CMt=SMt,kR={exports:{}};kR.exports;(function(e,t){var n=IVe,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,a=i&&n.process,s=function(){try{var l=o&&o.require&&o.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(kR,kR.exports);var wMt=kR.exports,xMt=EMt,AMt=CMt,mSe=wMt,ySe=mSe&&mSe.isTypedArray,$Mt=ySe?AMt(ySe):xMt,OUe=$Mt,OMt=ORt,DMt=kRt,TMt=ok,IMt=AUe,PMt=VRt,NMt=OUe,RMt=Object.prototype,MMt=RMt.hasOwnProperty;function FMt(e,t){var n=TMt(e),r=!n&&DMt(e),o=!n&&!r&&IMt(e),i=!n&&!r&&!o&&NMt(e),a=n||r||o||i,s=a?OMt(e.length,String):[],l=s.length;for(var u in e)(t||MMt.call(e,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||PMt(u,l)))&&s.push(u);return s}var BMt=FMt,kMt=Object.prototype;function LMt(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||kMt;return e===n}var jMt=LMt;function _Mt(e,t){return function(n){return e(t(n))}}var HMt=_Mt,zMt=HMt,VMt=zMt(Object.keys,Object),UMt=VMt,WMt=jMt,KMt=UMt,GMt=Object.prototype,YMt=GMt.hasOwnProperty;function XMt(e){if(!WMt(e))return KMt(e);var t=[];for(var n in Object(e))YMt.call(e,n)&&n!="constructor"&&t.push(n);return t}var qMt=XMt,QMt=EUe,ZMt=$Ue;function JMt(e){return e!=null&&ZMt(e.length)&&!QMt(e)}var e7t=JMt,t7t=BMt,n7t=qMt,r7t=e7t;function o7t(e){return r7t(e)?t7t(e):n7t(e)}var i7t=o7t,a7t=vRt,s7t=ARt,l7t=i7t;function u7t(e){return a7t(e,l7t,s7t)}var c7t=u7t,bSe=c7t,f7t=1,d7t=Object.prototype,p7t=d7t.hasOwnProperty;function h7t(e,t,n,r,o,i){var a=n&f7t,s=bSe(e),l=s.length,u=bSe(t),c=u.length;if(l!=c&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in t:p7t.call(t,d)))return!1}var p=i.get(e),g=i.get(t);if(p&&g)return p==t&&g==e;var m=!0;i.set(e,t),i.set(t,e);for(var h=a;++f<l;){d=s[f];var y=e[d],v=t[d];if(r)var b=a?r(v,y,d,t,e,i):r(y,v,d,e,t,i);if(!(b===void 0?y===v||o(y,v,n,r,i):b)){m=!1;break}h||(h=d=="constructor")}if(m&&!h){var E=e.constructor,S=t.constructor;E!=S&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof S=="function"&&S instanceof S)&&(m=!1)}return i.delete(e),i.delete(t),m}var v7t=h7t,g7t=LC,m7t=sh,y7t=g7t(m7t,"DataView"),b7t=y7t,E7t=LC,S7t=sh,C7t=E7t(S7t,"Promise"),w7t=C7t,x7t=LC,A7t=sh,$7t=x7t(A7t,"Set"),O7t=$7t,D7t=LC,T7t=sh,I7t=D7t(T7t,"WeakMap"),P7t=I7t,LZ=b7t,jZ=Tle,_Z=w7t,HZ=O7t,zZ=P7t,DUe=lT,zC=SUe,ESe="[object Map]",N7t="[object Object]",SSe="[object Promise]",CSe="[object Set]",wSe="[object WeakMap]",xSe="[object DataView]",R7t=zC(LZ),M7t=zC(jZ),F7t=zC(_Z),B7t=zC(HZ),k7t=zC(zZ),g0=DUe;(LZ&&g0(new LZ(new ArrayBuffer(1)))!=xSe||jZ&&g0(new jZ)!=ESe||_Z&&g0(_Z.resolve())!=SSe||HZ&&g0(new HZ)!=CSe||zZ&&g0(new zZ)!=wSe)&&(g0=function(e){var t=DUe(e),n=t==N7t?e.constructor:void 0,r=n?zC(n):"";if(r)switch(r){case R7t:return xSe;case M7t:return ESe;case F7t:return SSe;case B7t:return CSe;case k7t:return wSe}return t});var L7t=g0,kH=y8t,j7t=wUe,_7t=uRt,H7t=v7t,ASe=L7t,$Se=ok,OSe=AUe,z7t=OUe,V7t=1,DSe="[object Arguments]",TSe="[object Array]",aP="[object Object]",U7t=Object.prototype,ISe=U7t.hasOwnProperty;function W7t(e,t,n,r,o,i){var a=$Se(e),s=$Se(t),l=a?TSe:ASe(e),u=s?TSe:ASe(t);l=l==DSe?aP:l,u=u==DSe?aP:u;var c=l==aP,f=u==aP,d=l==u;if(d&&OSe(e)){if(!OSe(t))return!1;a=!0,c=!1}if(d&&!c)return i||(i=new kH),a||z7t(e)?j7t(e,t,n,r,o,i):_7t(e,t,l,n,r,o,i);if(!(n&V7t)){var p=c&&ISe.call(e,"__wrapped__"),g=f&&ISe.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,h=g?t.value():t;return i||(i=new kH),o(m,h,n,r,i)}}return d?(i||(i=new kH),H7t(e,t,n,r,o,i)):!1}var K7t=W7t,G7t=K7t,PSe=uT;function TUe(e,t,n,r,o){return e===t?!0:e==null||t==null||!PSe(e)&&!PSe(t)?e!==e&&t!==t:G7t(e,t,n,r,TUe,o)}var Y7t=TUe,X7t=Y7t;function q7t(e,t){return X7t(e,t)}var Q7t=q7t,IUe={exports:{}};/*!
|
417
417
|
* Quill Editor v1.3.7
|
418
418
|
* https://quilljs.com/
|
419
419
|
* Copyright (c) 2014, Jason Chen
|
package/dist/index.es.js
CHANGED
@@ -39770,7 +39770,7 @@ const hi = (e) => {
|
|
39770
39770
|
} = e;
|
39771
39771
|
const E = Nt(!1);
|
39772
39772
|
if (sn(() => {
|
39773
|
-
E.current != d && (typeof v == "function" && v(), E.current = d);
|
39773
|
+
E.current != d && (console.log(n + " calcHiddenRef.current", E.current), console.log(n + " calcHiddenRef.current", d), typeof v == "function" && v(), E.current = d);
|
39774
39774
|
}, [d]), sn(() => {
|
39775
39775
|
p && typeof m == "function" && !g && m(p);
|
39776
39776
|
}, []), !f) return o;
|
@@ -45019,7 +45019,9 @@ const xUe = /* @__PURE__ */ _s((e, t) => {
|
|
45019
45019
|
Fe.useImperativeHandle(t, () => ({
|
45020
45020
|
formRef: i,
|
45021
45021
|
setFieldsValue: (F) => {
|
45022
|
-
u.current = 1
|
45022
|
+
u.current = 1, setTimeout(() => {
|
45023
|
+
u.current = 0;
|
45024
|
+
}, 1e3);
|
45023
45025
|
let k = {
|
45024
45026
|
...F,
|
45025
45027
|
__id: F == null ? void 0 : F.id
|
@@ -45034,12 +45036,10 @@ const xUe = /* @__PURE__ */ _s((e, t) => {
|
|
45034
45036
|
for (let _ in z)
|
45035
45037
|
A.current[[L, H, _]] = {
|
45036
45038
|
name: [L, H, _],
|
45037
|
-
value: z[
|
45039
|
+
value: z[_]
|
45038
45040
|
};
|
45039
45041
|
}
|
45040
|
-
|
45041
|
-
D();
|
45042
|
-
}, 0);
|
45042
|
+
i.setFieldsValue(k);
|
45043
45043
|
},
|
45044
45044
|
initializeFieldVisibility: m
|
45045
45045
|
}), []);
|
@@ -45267,15 +45267,14 @@ const xUe = /* @__PURE__ */ _s((e, t) => {
|
|
45267
45267
|
}, A = Fe.useRef({}), D = Ip.debounce(() => {
|
45268
45268
|
console.log("debounceHandleFieldsChange");
|
45269
45269
|
const F = i.getFieldsValue(), k = u.current;
|
45270
|
-
u.current = 0;
|
45271
45270
|
let L = !1;
|
45272
45271
|
d.current || (d.current = {});
|
45273
45272
|
for (let H in A.current) {
|
45274
45273
|
let z = A.current[H];
|
45275
|
-
Ip.isEqual(z.value || "", p(z.name) || "") || (console.log("!isEqual field.name", z.name), console.log("field.value", z.value), console.log("getLastFieldValue(field.name)", p(z.name)), k != 1 && (L = h(z.name, F)), d.current[z.name] = z.value);
|
45274
|
+
Ip.isEqual(z.value || "", p(z.name) || "") || (console.log("!isEqual field.name", z.name), console.log("field.value", z.value), console.log("getLastFieldValue(field.name)", p(z.name)), console.log("lockStatus_", k), k != 1 && (L = h(z.name, F)), d.current[z.name] = z.value);
|
45276
45275
|
}
|
45277
45276
|
L && (console.log("needRefresh", L), s(R())), A.current = {};
|
45278
|
-
},
|
45277
|
+
}, 200), T = (F) => {
|
45279
45278
|
console.log("changedFields", F), F.filter((k) => {
|
45280
45279
|
k.name && k.name.length > 0 && (A.current[k.name] = k);
|
45281
45280
|
}), D();
|
package/package.json
CHANGED
@@ -37,6 +37,8 @@ export const BaseWrapper = ({
|
|
37
37
|
useEffect(()=>{
|
38
38
|
if (calcHiddenRef.current != calcHidden)
|
39
39
|
{
|
40
|
+
console.log(label+" calcHiddenRef.current", calcHiddenRef.current)
|
41
|
+
console.log(label+" calcHiddenRef.current", calcHidden)
|
40
42
|
typeof initializeFormRender == "function" && initializeFormRender();
|
41
43
|
calcHiddenRef.current = calcHidden;
|
42
44
|
}
|
@@ -64,7 +64,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
|
|
64
64
|
const loadSelectOptions = async () => {
|
65
65
|
if (request && option_value) {
|
66
66
|
debounceFetchOptions({ ...requestParams, [option_value]: value?.value }, null, (selectOptions) => {
|
67
|
-
console.log("loadSelectOptions selectOptions", selectOptions)
|
67
|
+
console.log("loadSelectOptions selectOptions", selectOptions)
|
68
68
|
if (selectOptions && selectOptions.length > 0) {
|
69
69
|
let item = selectOptions.find(item => item.value == value?.value || item.value == value)
|
70
70
|
console.log("loadSelectOptions item", item)
|
@@ -57,6 +57,9 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
57
57
|
formRef: form,
|
58
58
|
setFieldsValue: (values) => {
|
59
59
|
lockStatus.current = 1;
|
60
|
+
setTimeout(() => {
|
61
|
+
lockStatus.current = 0
|
62
|
+
}, 1000);
|
60
63
|
let formData = { ...values, __id: values?.id }
|
61
64
|
for (let key in values) {
|
62
65
|
changedFieldsState.current[key] = { name: key, value: values[key] }
|
@@ -64,14 +67,13 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
64
67
|
for (let index = 0; index < values[key].length; index++) {
|
65
68
|
const element = values[key][index];
|
66
69
|
for (let elem_key in element) {
|
67
|
-
changedFieldsState.current[[key,index,elem_key]] = { name: [key,index,elem_key], value: element[
|
70
|
+
changedFieldsState.current[[key,index,elem_key]] = { name: [key,index,elem_key], value: element[elem_key] }
|
68
71
|
}
|
69
72
|
}
|
70
73
|
}
|
71
74
|
}
|
72
|
-
console.log("changedFieldsState", changedFieldsState.current)
|
73
75
|
form.setFieldsValue(formData)
|
74
|
-
setTimeout(()=>{debounceHandleFieldsChange()},0)
|
76
|
+
// setTimeout(()=>{debounceHandleFieldsChange()},0)
|
75
77
|
},
|
76
78
|
initializeFieldVisibility,
|
77
79
|
}), []);
|
@@ -440,7 +442,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
440
442
|
console.log("debounceHandleFieldsChange")
|
441
443
|
const fieldValues = form.getFieldsValue();
|
442
444
|
const lockStatus_ = lockStatus.current;
|
443
|
-
lockStatus.current = 0
|
445
|
+
// lockStatus.current = 0
|
444
446
|
let needRefresh = false;
|
445
447
|
if (!lastFormValues.current) lastFormValues.current = {}
|
446
448
|
|
@@ -450,6 +452,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
450
452
|
console.log("!isEqual field.name", field.name)
|
451
453
|
console.log("field.value", field.value)
|
452
454
|
console.log("getLastFieldValue(field.name)", getLastFieldValue(field.name))
|
455
|
+
console.log("lockStatus_",lockStatus_)
|
453
456
|
if (lockStatus_ != 1) {
|
454
457
|
needRefresh = handleFieldsWith(field.name, fieldValues);
|
455
458
|
}
|
@@ -462,7 +465,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
462
465
|
}
|
463
466
|
// lastFormValues.current = form.getFieldsValue();
|
464
467
|
changedFieldsState.current = {};
|
465
|
-
},
|
468
|
+
}, 200);
|
466
469
|
|
467
470
|
const handleFieldsChange = (changedFields) => {
|
468
471
|
console.log("changedFields", changedFields)
|