lu-lowcode-package-form 0.10.28 → 0.10.29
Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.cjs.js
CHANGED
@@ -402,7 +402,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
402
402
|
transform: rotate(360deg);
|
403
403
|
}
|
404
404
|
}
|
405
|
-
`,yLt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mLt,n=J.useContext(oJe),r=n.csp;J.useEffect(function(){Cd(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},bLt=["icon","className","onClick","style","primaryColor","secondaryColor"],dT={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function ELt(e){var t=e.primaryColor,n=e.secondaryColor;dT.primaryColor=t,dT.secondaryColor=n||PJe(t),dT.calculated=!!n}function SLt(){return he({},dT)}var dx=function(t){var n=t.icon,r=t.className,o=t.onClick,i=t.style,a=t.primaryColor,l=t.secondaryColor,s=Nn(t,bLt),u=dT;if(a&&(u={primaryColor:a,secondaryColor:l||PJe(a)}),yLt(),gLt(q$e(n),"icon should be icon definiton, but got ".concat(n)),!q$e(n))return null;var c=n;return c&&typeof c.icon=="function"&&(c=he(he({},c),{},{icon:c.icon(u.primaryColor,u.secondaryColor)})),eie(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"},s))};dx.displayName="IconReact";dx.getTwoToneColors=SLt;dx.setTwoToneColors=ELt;function IJe(e){var t=RJe(e),n=Ce(t,2),r=n[0],o=n[1];return dx.setTwoToneColors({primaryColor:r,secondaryColor:o})}function wLt(){var e=dx.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var CLt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];IJe("#1890ff");var tE=T.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,i=e.rotate,a=e.tabIndex,l=e.onClick,s=e.twoToneColor,u=Nn(e,CLt),c=T.useContext(oJe),f=c.prefixCls,d=f===void 0?"anticon":f,p=c.rootClassName,g=Ne(p,d,ae(ae({},"".concat(d,"-").concat(r.name),!!r.name),"".concat(d,"-spin"),!!o||r.name==="loading"),n),m=a;m===void 0&&l&&(m=-1);var v=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,y=RJe(s),h=Ce(y,2),b=h[0],E=h[1];return T.createElement("span",he(he({role:"img","aria-label":r.name},u),{},{ref:t,tabIndex:m,onClick:l,className:g}),T.createElement(dx,{icon:r,primaryColor:b,secondaryColor:E,style:v}))});tE.displayName="AntdIcon";tE.getTwoToneColor=wLt;tE.setTwoToneColor=IJe;var xLt=function(t,n){return T.createElement(tE,he(he({},t),{},{ref:n,icon:VZe}))},Ahe=T.forwardRef(xLt);process.env.NODE_ENV!=="production"&&(Ahe.displayName="DeleteOutlined");var ALt=function(t,n){return T.createElement(tE,he(he({},t),{},{ref:n,icon:KQe}))},NJe=T.forwardRef(ALt);process.env.NODE_ENV!=="production"&&(NJe.displayName="EyeOutlined");var OLt=function(t,n){return T.createElement(tE,he(he({},t),{},{ref:n,icon:CNt}))},MJe=T.forwardRef(OLt);process.env.NODE_ENV!=="production"&&(MJe.displayName="PlusOutlined");var $Lt={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"},DLt=function(t,n){return T.createElement(tE,he(he({},t),{},{ref:n,icon:$Lt}))},FJe=T.forwardRef(DLt);process.env.NODE_ENV!=="production"&&(FJe.displayName="UploadOutlined");function BJe(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 TLt(e,t,n,r,o,i,l=>({value:l[t],title:l[n],key:l[t],disabled:l[t]===a}))}function TLt(e,t,n,r,o,i,a){if(!Array.isArray(e)||e.length===0)return[];const l=e.map(s=>({...s,...a(s)}));return l.filter(s=>{const u=l.filter(c=>s[t]===c[r]);return s[o]=u.length>0?u:[],s[r]===i})}const kJe=e=>{let{request:t,title:n,disabledValue:r,callError:o,...i}=e;const[a,l]=J.useState(!1),[s,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=BJe(((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),l(!0)};return ze.jsx(vi,{...i,children:a&&ze.jsx(u0,{...i,treeData:s,treeDefaultExpandAll:!0,style:{width:"100%"}})})},Ohe=J.forwardRef((e,t)=>{let{addWrapper:n=!0,form:r,fieldName:o,fieldsValue:i,value:a,type:l,defaultValue:s,onChange:u,option_label:c,option_value:f,option_search:d,options:p,request:g,requestParams:m,callError:v,subRequest:y,sub_option_label:h="label",mode:b="single",sub_option_value:E="id",rightIconRender:S,rightIcon:w,rightIconClick:C,...O}=e;const[D,x]=J.useState([]),[$,P]=J.useState(!1);J.useEffect(()=>{if(console.log("SearchSelect ".concat(o," value"),a),a&&D.length>0){let z=D.find(j=>j.value==(a==null?void 0:a.value)||j.value==a);z&&!Dg.isEqual(z,a)&&(console.log("new value /////",z),typeof u=="function"&&u(z)),z||N()}},[a]),J.useEffect(()=>{console.log("SearchSelect useEffect requestParams",m),M(m)},[m]);const N=async()=>{g&&f&&k({...m,[f]:a==null?void 0:a.value},null,z=>{if(console.log("loadSelectOptions selectOptions",z),z&&z.length>0){let j=z.find(I=>I.value==(a==null?void 0:a.value)||I.value==a);console.log("loadSelectOptions item",j),j&&!Dg.isEqual(j,a)&&(console.log("new value /////",j),typeof u=="function"&&u(j))}})},M=async z=>{const j={};if(Array.isArray(O==null?void 0:O.filterRules))for(let G of O==null?void 0:O.filterRules){var I,F,_,W;let U;G.value.parent===""?U=i==null?void 0:i[G.value.field_key]:U=i==null||(I=i[G.value.parent])===null||I===void 0||(F=I[o==null?void 0:o[1]])===null||F===void 0?void 0:F[G.value.field_key],U&&(_=U)!==null&&_!==void 0&&_.value&&(U=U.value),j[G.column.column_name]=(W=U)!==null&&W!==void 0?W:"##norequest##"}g&&typeof g=="function"&&k(z,j),p&&p.length>0&&x(p)},B=async z=>{const j={...m};j[d]=z,await k(j)},k=J.useCallback(Dg.debounce((z,j,I)=>{L(z,j).then(F=>{typeof I=="function"&&I(F)})},200),[]),L=async(z,j)=>{try{let F=[];if(!(j&&Object.values(j).some(_=>_==="##norequest##"))){var I;P(!0);const _=await g({...z,ruleParams:j});P(!1),_.code>0?v&&typeof v=="function"&&v(_.message):F=((I=_.data)===null||I===void 0?void 0:I.list)||_.data}if(Array.isArray(F)){for(let _=0;_<F.length;_++){const W=F[_];if(typeof y=="function"){let G=[];const{data:U}=await y(W);U!=null&&U.list&&Array.isArray(U.list)&&(G=U.list.map(K=>({label:"".concat(W[c],"-").concat(K[h]),value:"".concat(W[f],"-").concat(K[E])}))),F[_]={...W,label:W[c],title:W[c],options:G}}F[_]={...W,label:W[c],value:W[f]}}D.length>0&&!Dg.isEqual(D,F)&&typeof u=="function"&&u(void 0),x(F)}else x([]);return F}catch(F){console.error("fetchOptions",F),P(!1)}finally{}},H=z=>{Array.isArray(z)?u(z.map(j=>D.find(I=>I.value===j))):u(D.find(j=>j.value===z))};return n?ze.jsxs(vi,{...O,children:[ze.jsx(Bd,{ref:t,notFoundContent:$?ze.jsx(P4,{size:"small"}):null,value:a,...O,filterOption:!1,showSearch:!!(g&&d),onSearch:g&&d?B:null,onChange:H,style:{width:"100%",flex:1},options:D,mode:b}),!(O!=null&&O.disabled)&&w,!(O!=null&&O.disabled)&&typeof S=="function"&&S({value:a,onChange:u,form:r,fieldName:o})]}):ze.jsxs(ze.Fragment,{children:[ze.jsx(Bd,{ref:t,notFoundContent:$?ze.jsx(P4,{size:"small"}):null,value:a,...O,filterOption:!1,showSearch:!!(g&&d),onSearch:g&&d?B:null,onChange:H,style:{width:"100%"},options:D,mode:b}),!(O!=null&&O.disabled)&&w,!(O!=null&&O.disabled)&&typeof S=="function"&&S({value:a,onChange:u,form:r,fieldName:o})]})}),$he=e=>{let{request:t,option_label:n="label",option_value:r="id",disabledValue:o,callError:i,options:a,addWrapper:l=!0,...s}=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 l?ze.jsx(vi,{...s,children:ze.jsx(Bd,{...s,options:u,style:{width:"100%"}})}):ze.jsx(Bd,{...s,options:u,style:{width:"100%"}})},PLt=e=>{let{...t}=e;return ze.jsx($he,{...t,mode:"single"})},RLt=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]),ze.jsx($he,{...r,onChange:t,mode:"multiple",value:o})},LJe=e=>{var t,n;let{readItemRender:r,readonly:o,onChange:i,onCustomChange:a,value:l,form:s,fieldName:u,...c}=e;return J.useEffect(()=>{if(l&&typeof l=="string")try{l=JSON.parse(l),s==null||s.setFieldValue(u,l),console.log("WithSingleSelect useEffect onChange////// form",s),console.log("WithSingleSelect useEffect onChange////// fieldName",u),console.log("WithSingleSelect useEffect onChange////// value",l)}catch(f){console.log("WithSingleSelect useEffect error",f)}},[l]),o?ze.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:l&&l.label&&ze.jsx(ze.Fragment,{children:r&&typeof r=="function"?r(l):ze.jsx("span",{children:(t=l)===null||t===void 0?void 0:t.label},"btn_".concat((n=l)===null||n===void 0?void 0:n.value))})}):ze.jsx(Ohe,{addWrapper:!1,form:s,fieldName:u,...c,onChange:i,value:l,mode:"single",className:" fflex-1 foverflow-hidden"})},jJe=e=>{let{readItemRender:t,readonly:n,onChange:r,value:o,form:i,fieldName:a,...l}=e;return J.useEffect(()=>{if(o&&typeof o=="string")try{o=JSON.parse(o),r(o)}catch{}},[o]),n?ze.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:Array.isArray(o)&&o.map((s,u)=>ze.jsxs(ze.Fragment,{children:[" ",t&&typeof t=="function"?t(s):ze.jsx("span",{children:s==null?void 0:s.label},"btn_".concat(s==null?void 0:s.value)),u<o.length-1?ze.jsx("span",{className:" ftext-gray-400",children:","}):null]}))}):ze.jsx(Ohe,{addWrapper:!1,form:i,fieldName:a,...l,onChange:r,value:o,mode:"multiple",className:" fflex-1 foverflow-hidden"})},ILt=e=>{let{customComponent:t,...n}=e;return t?ze.jsx(vi,{...n,children:ze.jsx(t,{...n})}):ze.jsx(vi,{...n,children:ze.jsx(Lv,{...n})})},_Je=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 l=s=>{Array.isArray(s)||(s=[s]),t&&typeof t=="function"&&t(s)};return ze.jsx(kJe,{...o,onChange:l,value:i,multiple:r})},NLt=e=>{let{FetchDeptList:t,...n}=e;return ze.jsx(_Je,{...n,title:"deptName",request:t})},MLt=e=>{let{FetchPostList:t,...n}=e;return ze.jsx(_Je,{...n,title:"postName",request:t})};LJe.displayName="WithSingleSelect";jJe.displayName="WithMultipleSelect";const FLt=J.forwardRef((e,t)=>(J.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),ze.jsx(vi,{...e,children:ze.jsx(LJe,{...e})}))),BLt=J.forwardRef((e,t)=>(J.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),ze.jsx(vi,{...e,children:ze.jsx(jJe,{...e})}))),kLt=J.forwardRef((e,t)=>{let{value:n,onChange:r,...o}=e;const i=J.useRef(0),a=()=>{i.current++,r(i.current)};return ze.jsxs(vi,{...o,children:[ze.jsxs("div",{ref:t,children:["form-set-value:",n]}),ze.jsx(du,{onClick:a,children:"test"})]})}),LLt=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},jLt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let FA=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=jLt[n[e]&63];return t};var HJe={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(s,u,c){this.fn=s,this.context=u,this.once=c||!1}function i(s,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new o(c,f||s,d),g=n?n+u:u;return s._events[g]?s._events[g].fn?s._events[g]=[s._events[g],p]:s._events[g].push(p):(s._events[g]=p,s._eventsCount++),s}function a(s,u){--s._eventsCount===0?s._events=new r:delete s._events[u]}function l(){this._events=new r,this._eventsCount=0}l.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},l.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},l.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,c,f,d,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var v=this._events[m],y=arguments.length,h,b;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,c),!0;case 3:return v.fn.call(v.context,c,f),!0;case 4:return v.fn.call(v.context,c,f,d),!0;case 5:return v.fn.call(v.context,c,f,d,p),!0;case 6:return v.fn.call(v.context,c,f,d,p,g),!0}for(b=1,h=new Array(y-1);b<y;b++)h[b-1]=arguments[b];v.fn.apply(v.context,h)}else{var E=v.length,S;for(b=0;b<E;b++)switch(v[b].once&&this.removeListener(u,v[b].fn,void 0,!0),y){case 1:v[b].fn.call(v[b].context);break;case 2:v[b].fn.call(v[b].context,c);break;case 3:v[b].fn.call(v[b].context,c,f);break;case 4:v[b].fn.call(v[b].context,c,f,d);break;default:if(!h)for(S=1,h=new Array(y-1);S<y;S++)h[S-1]=arguments[S];v[b].fn.apply(v[b].context,h)}}return!0},l.prototype.on=function(u,c,f){return i(this,u,c,f,!1)},l.prototype.once=function(u,c,f){return i(this,u,c,f,!0)},l.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,v=[],y=g.length;m<y;m++)(g[m].fn!==c||d&&!g[m].once||f&&g[m].context!==f)&&v.push(g[m]);v.length?this._events[p]=v.length===1?v[0]:v:a(this,p)}return this},l.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},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(HJe);var _Lt=HJe.exports;const HLt=ql(_Lt),tie=new HLt,zLt=e=>{let{children:t,layout:n,onTableAddRow:r,onTableRemoveRow:o,form:i,initializeFormRender:a,mode:l}=e;n=n||"1";const s=f=>{const d=f.split(",").map(Number),p=24;return d.map(g=>g/d.reduce((m,v)=>m+v)*p)},u=J.useMemo(()=>s(n),[n]),c=J.useMemo(()=>J.Children.toArray(t).map((f,d)=>{var p,g;const m=f.props,v=(m==null?void 0:m.componentId)||(m==null?void 0:m.__id);var y=((p=f.type)===null||p===void 0?void 0:p.displayName)||((g=f.props)===null||g===void 0?void 0:g._componentName);let h=null;if(y=="Field.Table"?h=J.cloneElement(f,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:v,initializeFormRender:a,mode:l}):J.isValidElement(f)?h=J.cloneElement(f,{form:i,fieldName:v,initializeFormRender:a}):h=f,v){const b=[];if(m.isRequired&&b.push({required:!0,message:"".concat(m.label,"必须填写")}),m.rules)if(Array.isArray(m.rules)){const E=m.rules.join("|");b.push({pattern:new RegExp(E),message:m.rulesFailMessage?m.rulesFailMessage:"".concat(m.label,"格式错误")})}else b.push({pattern:new RegExp(m.rules),message:m.rulesFailMessage?m.rulesFailMessage:"".concat(m.label,"格式错误")});return(u==null?void 0:u[d])&&ze.jsx(_C,{span:u[d],children:ze.jsx(cl.Item,{style:{marginBottom:0},label:"",name:v,rules:b,children:h},"".concat(v,"-form-item"))},d)}else return(u==null?void 0:u[d])&&ze.jsx(_C,{span:u[d],children:h},d)}),[t,u]);return ze.jsx(Tj,{gutter:24,children:c})},VLt=e=>{let{title:t}=e;return t?ze.jsx("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:ze.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:t})}):null};function ULt(e,t){const n=[];let r=[];const o=(a,l)=>{const s=a-l.length;s>0&&l.push(...new Array(s).fill(J.createElement("div")))};for(const a of e){var i;const{_componentName:l}=(a==null?void 0:a.props)||{},s=((i=a.type)===null||i===void 0?void 0:i.displayName)||l;s&&s.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 Dhe=J.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=cl.useForm(),[a,l]=J.useState(null),s=J.useRef(null),u=J.useRef(0);J.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:x=>{u.current=1,i.setFieldsValue(x)},initializeFieldVisibility:g}),[]),J.useEffect(()=>{c()},[r,n]);const c=()=>{p(),l(D())},f=J.useRef(null),d=x=>{var $;return($=f.current)===null||$===void 0?void 0:$[x]},p=()=>{const x=[];function $(N){var M,B;let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;var L=((M=N.type)===null||M===void 0?void 0:M.displayName)||((B=N.props)===null||B===void 0?void 0:B._componentName);const{props:H}=N;if(L&&(L.startsWith("Field.")||L.startsWith("Layout."))){let I=(H==null?void 0:H.componentId)||(H==null?void 0:H.__id),F=[];if(k&&k!==null&&k!==void 0&&k.props){var z,j;I="".concat((k==null||(z=k.props)===null||z===void 0?void 0:z.componentId)||(k==null||(j=k.props)===null||j===void 0?void 0:j.__id),".").concat(I)}H!=null&&H.withId&&F.push(H==null?void 0:H.withId),H!=null&&H.withIds&&(F=[...F,...H==null?void 0:H.withIds]),x.push({identifier:I,withIds:F,component:N,componentName:L,fillRules:H==null?void 0:H.fillRules})}H!=null&&H.children&&J.Children.toArray(H==null?void 0:H.children).forEach(F=>$(F,L&&L.startsWith("Field.")?N:null))}s.current=new Map,console.log(" fields",x);const P=J.Children.toArray(r);for(let N=0;N<P.length;N++){const M=P[N];$(M)}x.forEach(N=>{const{identifier:M}=N;s.current.set(M,{children:x.filter(B=>B.withIds.some(k=>k==M)),show:!0,...N})}),console.log(" dependencyMap.current",s.current),g()},g=function(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const $=i.getFieldsValue();for(let P of s.current.keys())m(P,$,!0);x&&l(D())},m=function(x,$){let P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,N=!1,M=[];if(Array.isArray(x)&&(M=[...x.slice(0,-1)],x=x.filter(B=>typeof B=="string").join(".")),s.current.has(x)){const B=s.current.get(x),k=B.children;!P&&B!==null&&B!==void 0&&B.fillRules&&Array.isArray(B==null?void 0:B.fillRules)&&(B==null?void 0:B.fillRules.length)>0&&v(x,M,$,B==null?void 0:B.fillRules),k.forEach(L=>{L.component.props.withFunc&&typeof L.component.props.withFunc=="function"&&(N=y($,L)),!P&&L.component.props.withFill&&h($,L,M,B==null?void 0:B.componentName)})}return N},v=(x,$,P,N)=>{let M=b("fieldsValue",x,P,null),B={},k=[];for(let I=0;I<N.length;I++){const F=N[I];let{source:_,target:W}=F,G=M==null?void 0:M[_],U=G;if((F==null?void 0:F.type)==1){if(s.current.has(W)){var L,H,z;let Y=(L=s.current.get(W))===null||L===void 0||(H=L.component)===null||H===void 0||(z=H.props)===null||z===void 0?void 0:z.children;Array.isArray(Y)&&Y.length>0&&k.push(Y.map(Q=>{var Z,q;return"".concat(_,".").concat((Q==null||(Z=Q.props)===null||Z===void 0?void 0:Z.componentId)||(Q==null||(q=Q.props)===null||q===void 0?void 0:q.__id))}))}if(G&&typeof G=="string")try{G=JSON.parse(G)}catch(Y){console.error("error end",Y)}if(!Array.isArray(G))return;U=G.map((Y,Q)=>{let Z={};if(F!=null&&F.subRules&&Array.isArray(F==null?void 0:F.subRules)&&(F==null?void 0:F.subRules.length)>0)for(let q=0;q<(F==null?void 0:F.subRules.length);q++){const{source:te,target:le}=F==null?void 0:F.subRules[q];Z[le]=Y==null?void 0:Y[te];let ne={name:[W,Q,le],value:Y==null?void 0:Y[te]};B[ne.name]=ne}return Z}),tie.emit("reloadTable",W)}else{let K=0;if($&&Array.isArray($)&&$.length>1&&($.filter(Y=>typeof Y=="string").join("."),K=$[$.length-1],W=[...$,W],Array.isArray(M)&&M.length>K)){var j;U=(j=M[K])===null||j===void 0?void 0:j[_]}B[W]={name:[W],value:U}}(F==null?void 0:F.type)==1&&i.setFieldValue(W,void 0),i.setFieldValue(W,U)}setTimeout(()=>{var I=Object.keys(B);I.length>0&&(I.forEach(F=>{E.current[F]=B[F]}),S()),k.length>0&&k.forEach(F=>{Array.isArray(F)&&F.length>0&&C(F)})},0)},y=(x,$,P)=>{var N,M;let B=!1;const k=$==null||(N=$.component)===null||N===void 0||(M=N.props)===null||M===void 0?void 0:M.withFunc(x),L=$==null?void 0:$.identifier;if(s.current.has(L)){const H=s.current.get(L);H.show!==k&&(H.show=k,s.current.set(L,H),B=!0)}return B},h=async(x,$,P,N)=>{var M,B;const k=$==null||(M=$.component)===null||M===void 0?void 0:M.props.withFill,L=$==null||(B=$.component)===null||B===void 0?void 0:B.props.withDataFetch;let H=0,z="",j=$.identifier;if(P&&Array.isArray(P)&&P.length>1)z=P.filter(W=>typeof W=="string").join("."),H=P[P.length-1],j.startsWith("".concat(z,"."))&&(j=[...P,j.replace("".concat(z,"."),"")]);else if(j.indexOf(".")>=0){j=j.split(".");let W=b("fieldsValue",j[0],x,[]);if(Array.isArray(W)&&W.length>0)for(let G=0;G<W.length;G++)await h(x,$,[j[0],G],N);return}let I=[];if(k!=null&&k.withData&&(k==null?void 0:k.withData.length)>0&&L&&typeof L=="function")for(let W=0;W<(k==null?void 0:k.withData.length);W++){const G=k==null?void 0:k.withData[W];let U={};U.tableName=G.withTable.table_name,U.filter={};for(let Y=0;Y<G.withCondition.length;Y++){var F;const{value:Q,column:Z}=G.withCondition[Y];let q=b(Q.group_key,Q.field_key,x,I);Array.isArray(q)&&Array.isArray(j)&&q.length>H&&(q=q[H]),N=="Field.WithSingleSelect"&&q&&(F=q)!==null&&F!==void 0&&F.value&&(q=q.value),U.filter[Z.column_name]=q}const K=await L(U);K.code===0&&K.data.list&&I.push({id:G.id,data:K.data.list})}let _;if(k.value&&k.value.length>0&&(_=k.value.map(W=>{let G="";const{insert:U,attributes:K}=W;return typeof U!="string"?U!=null&&U.span&&K&&K.tagKey&&K.id&&(G=b(K.tagKey,K.id,x,I),Array.isArray(G)?Array.isArray(j)&&G.length>H?G=G[H]:G=JSON.stringify(G):G.length>0&&(G='"'.concat(G,'"'))):G=U,G})),_&&_.length>0){const W=LLt(_);i.setFieldValue(j,W),m(j,i.getFieldsValue())}},b=(x,$,P,N)=>{let M="";if(x=="fieldsValue"){var B;if($.indexOf(".")>=0){var k;const[z,j]=$.split("."),I=(P==null?void 0:P[z])||[];Array.isArray(I)?M=I.map(F=>{var _;return(_=F==null?void 0:F[j])!==null&&_!==void 0?_:""}):M=(k=I==null?void 0:I[j])!==null&&k!==void 0?k:""}else M=(B=P==null?void 0:P[$])!==null&&B!==void 0?B:""}else{let z=N.find(j=>j.id===x);if(z&&z.data&&z.data.length>0){var L,H;M=(L=(H=z.data[0])===null||H===void 0?void 0:H[$])!==null&&L!==void 0?L:""}}return M},E=J.useRef({}),S=Dg.debounce(()=>{const x=i.getFieldsValue(),$=u.current;u.current=0;let P=!1;f.current||(f.current={});for(let N in E.current){let M=E.current[N];Dg.isEqual(M.value,d(M.name))||($!=1&&(P=m(M.name,x)),f.current[M.name]=M.value)}P&&l(D()),E.current={}},100),w=x=>{x.filter($=>{$.name&&$.name.length>0&&(E.current[$.name]=$)}),S()},C=x=>{let $=[];x.forEach(N=>{if(!s.current.has(N))return;let M=s.current.get(N);M.withIds.length<=0||$.push(...M.withIds.filter(B=>!$.includes(B)))}),$=$.filter(N=>{var M=i.getFieldValue(N);return!(typeof M!="number"&&!M)});const P=i.getFieldsValue();setTimeout(()=>{$.forEach(N=>{m(N,P)})},0)},O=x=>{const $=i.getFieldsValue();setTimeout(()=>{x.forEach(P=>{m(P,$)})},0)},D=()=>{const x=J.Children.toArray(r);return ULt(x.filter(P=>{var N;const M=P.props.componentId||P.props.__id;return!s.current.has(M)||((N=s.current.get(M))===null||N===void 0?void 0:N.show)}),n).map((P,N)=>ze.jsx(Tj,{gutter:[24,24],children:P.map((M,B)=>{var k;const{componentId:L,__id:H,_componentName:z,...j}=M.props,I=((k=M.type)===null||k===void 0?void 0:k.displayName)||z,F=L||H,_=I&&I.startsWith("Layout."),W=I&&I=="Field.Table",G=j.calcHidden&&o!="desgin",U=[];if(j.isRequired&&U.push({required:!0,message:"".concat(j.label,"必须填写")}),j.rules)if(Array.isArray(j.rules)){const Q=j.rules.join("|");U.push({pattern:new RegExp(Q),message:j.rulesFailMessage?j.rulesFailMessage:"".concat(j.label,"格式错误")})}else U.push({pattern:new RegExp(j.rules),message:j.rulesFailMessage?j.rulesFailMessage:"".concat(j.label,"格式错误")});const K=Q=>{i.setFieldValue(F,Q)};let Y;return W||_?Y=J.cloneElement(M,{onTableAddRow:C,onTableRemoveRow:O,form:i,fieldName:F,onCustomChange:K,initializeFormRender:c,mode:o}):I==="Field.WithSingleSelect"||I==="Field.WithMultipleSelect"?Y=ze.jsx(cl.Item,{hidden:G,style:{margin:0},shouldUpdate:(Q,Z)=>{let q=!1;if(Array.isArray(j.filterRules)&&j.filterRules.length>0)for(let te of j.filterRules){if(te.value.parent!="")continue;let le,ne;if(le=Q==null?void 0:Q[te.value.field_key],ne=Z==null?void 0:Z[te.value.field_key],le!==ne){q=!0;break}}return q},children:Q=>{let{getFieldsValue:Z}=Q;const q=Z();return ze.jsx(cl.Item,{style:{marginBottom:0},label:"",name:F,rules:U,children:J.cloneElement(M,{onTableAddRow:C,onTableRemoveRow:O,form:i,fieldName:F,onCustomChange:K,fieldsValue:q,initializeFormRender:c})})}}):Y=ze.jsx(cl.Item,{hidden:G,style:{marginBottom:0},label:"",name:F,rules:U,children:J.cloneElement(M,{form:i,fieldName:F,onCustomChange:K,initializeFormRender:c})}),ze.jsx(_C,{span:j.calcHidden?0:_?24:24/n,style:{marginBottom:0},children:Y},F||"col-".concat(B))})},"row-".concat(N)))};return ze.jsx(cl,{form:i,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col fgap-y-2"+(o=="desgin"?" fp-6":""),onValuesChange:(x,$)=>{},onFieldsChange:w,children:a})});function WLt(e){return J.forwardRef((t,n)=>ze.jsx(e,{...t,ref:n,forwardedRef:n}))}class Qgr extends J.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return ze.jsx(Dhe,{...n,ref:t})}}const GLt=WLt(e=>{let{forwardedRef:t,...n}=e;return ze.jsx(Dhe,{...n,ref:t})}),KLt=e=>{let{request:t,value:n,onChange:r,callError:o,disabledValue:i,addRoot:a=!0,title:l,...s}=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 x=await t();if(x.code>0){o&&typeof o=="function"&&o(x.message);return}let $=BJe(((D=x.data)===null||D===void 0?void 0:D.list)||x.data||[],"id",l||"title",(s==null?void 0:s.parentId)||"parentId","children",0,i);a&&($=[{value:0,title:"根节点",children:$}]),s.treeData=$,console.log("treeData",$),d($)}s.treeData&&d(s.treeData),c(!0)},[g,m]=J.useState([]),[v,y]=J.useState([]),[h,b]=J.useState([]),[E,S]=J.useState(!0),w=D=>{console.log("onExpand",D),m(D),S(!1)},C=D=>{console.log("onCheck",D),y(D),r(D)},O=(D,x)=>{console.log("onSelect",x),b(D)};return ze.jsx(vi,{...s,children:ze.jsx(Ehe,{checkable:!0,onExpand:w,onCheck:C,onSelect:O,expandedKeys:g,autoExpandParent:E,checkedKeys:v,selectedKeys:h,treeData:f})})},qLt=e=>ze.jsx(vi,{...e,children:ze.jsx(K3,{...e})}),YLt=e=>ze.jsx(vi,{...e,children:ze.jsx(K3.Group,{...e})}),XLt=e=>ze.jsx(vi,{...e,children:ze.jsx(Aj.Group,{...e})}),zJe=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)&&l(t)}},[t]),n=n||99,r=r||!0;const[a,l]=J.useState([]),s=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}))),l(c)};return ze.jsx(Bj,{...i,listType:"text",multiple:r,onChange:s,maxCount:n,fileList:a,children:!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&a.length<n&&ze.jsx(du,{type:(i==null?void 0:i.type)||"default",icon:(i==null?void 0:i.icon)||ze.jsx(FJe,{}),children:"点击上传文件"})})};zJe.displayName="UploadFile";const QLt=e=>ze.jsx(vi,{...e,children:ze.jsx(zJe,{...e})}),VJe=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 w=0;w<n.length;w++){let C=n[w];var E=g.current.find(O=>O.uid===C.uid);!E||(E.version||0)<(C.version||0)?S.push(C):S.push(E)}l(S)}},[n]),t=t||99,r=r||!0,console.log("maxCount",t);const[a,l]=J.useState([]),[s,u]=J.useState(""),[c,f]=J.useState(0),[d,p]=J.useState(!1),g=J.useRef([]),m=E=>new Promise((S,w)=>{const C=new FileReader;C.readAsDataURL(E),C.onload=()=>S(C.result),C.onerror=O=>w(O)}),v=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||l(a.filter((w,C)=>C!==S))},h=ze.jsx(ze.Fragment,{children:ze.jsxs("div",{className:"fw-full fh-full fflex fflex-col fitems-center fjustify-center fborder fborder-dashed fcursor-pointer frounded",children:[ze.jsx(MJe,{}),ze.jsx("div",{className:"fmt-2",children:"点击上传"})]})}),b=E=>{let{fileList:S}=E,w=[];for(let D=0;D<S.length;D++){var C=S[D];C.version=new Date().getTime();var O=g.current.find(x=>x.uid===C.uid);console.log("oldfile",JSON.parse(JSON.stringify(O||{}))),O&&O.status!="uploading"?w.push(O):(C.status=="done"&&C.response&&(C.url=C.response),w.push(C))}g.current=w,l(w),o(w.map(D=>({uid:D.uid,name:D.name,status:D.status,url:D.url||D.response||"",error:D.error,version:D.version||0})))};return ze.jsxs(ze.Fragment,{children:[ze.jsx("div",{className:"fflex fgap-3 fflex-wrap",children:ze.jsx(Bj,{...i,itemRender:(E,S,w)=>{console.log("file",S);let C=w.findIndex(O=>O.uid===S.uid);return ze.jsx(ze.Fragment,{children:ze.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:[ze.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"&&ze.jsx(NJe,{onClick:()=>{v(S,C)},className:"hover:ftext-gray-200"}),!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&ze.jsx(Ahe,{onClick:()=>{y(S,C)},className:"hover:ftext-gray-200"})]}),S.status=="uploading"&&ze.jsx("div",{className:" fw-full fh-full fflex fitems-center fjustify-center fabsolute ftop-0 fleft-0 ",children:ze.jsx(P4,{})}),ze.jsx("img",{src:S.url||S.thumbUrl,alt:"Example Image",class:"fmax-w-full fmax-h-full fobject-contain "})]},"file-".concat(S.uid))})},listType:"picture-card",fileList:a,multiple:r,onPreview:v,onChange:b,maxCount:t,children:a.length>=t||i!=null&&i.disabled||i!=null&&i.readonly?null:h})}),s&&ze.jsx(qF.PreviewGroup,{preview:{visible:d,current:c,onVisibleChange:E=>p(E),onChange:E=>{f(E)}},children:a.map((E,S)=>ze.jsx(ze.Fragment,{children:ze.jsx(qF,{wrapperStyle:{display:"none"},src:E.url})}))})]})};VJe.displayName="UploadImage";const ZLt=e=>ze.jsx(vi,{...e,children:ze.jsx(VJe,{...e})}),JLt=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)),ze.jsx(vi,{...i,children:ze.jsx(vhe,{...i,onChange:n,value:t})})};var ejt={exports:{}};(function(e,t){(function(n,r){e.exports=r(IXe())})(vr,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,l){return l==="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,l){var s=100*a+l;return s<600?"凌晨":s<900?"早上":s<1100?"上午":s<1300?"中午":s<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(ejt);var tjt={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 njt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},UJe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},tjt),timePickerLocale:Object.assign({},njt)};UJe.lang.ok="确定";var WJe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vr,function(){return function(n,r,o){o.updateLocale=function(i,a){var l=o.Ls[i];if(l)return(a?Object.keys(a):[]).forEach(function(s){l[s]=a[s]}),l}}})})(WJe);var rjt=WJe.exports;const ojt=ql(rjt);fa.extend(ojt);fa.extend(jXe);fa.updateLocale("zh-cn",{weekStart:0});const ijt=e=>{let{datetype:t,value:n,defaultNow:r,onChange:o,...i}=e;t=t||"date";const[a,l]=J.useState(i==null?void 0:i.picker),[s,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 v=fa().format("YYYY-MM-DD HH:mm:ss");typeof o=="function"&&o(v);return}},[]);const m=(v,y)=>{g.current=!0,o(y)};return J.useEffect(()=>{switch(l("date"),f(!1),t){case"date":l("date"),u("YYYY-MM-DD"),p(!1);break;case"datetime":f(!0),l("datetime"),u("YYYY-MM-DD HH:mm:ss"),p(!0);break;case"month":l("month"),p(!1);break;case"year":l("year"),p(!1);break}},[t]),ze.jsx(vi,{...i,children:ze.jsx(fx,{locale:UJe,...i,picker:a,format:s,style:{width:"100%"},onChange:m,value:n&&fa(n).isValid()?fa(n):void 0,showTime:c,needConfirm:d})})};var GJe={},Av={},The={exports:{}};The.exports;(function(e){const n=(i=0)=>a=>`\x1B[${38+i};5;${a}m`,r=(i=0)=>(a,l,s)=>`\x1B[${38+i};2;${a};${l};${s}m`;function o(){const i=new Map,a={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};a.color.gray=a.color.blackBright,a.bgColor.bgGray=a.bgColor.bgBlackBright,a.color.grey=a.color.blackBright,a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(const[l,s]of Object.entries(a)){for(const[u,c]of Object.entries(s))a[u]={open:`\x1B[${c[0]}m`,close:`\x1B[${c[1]}m`},s[u]=a[u],i.set(c[0],c[1]);Object.defineProperty(a,l,{value:s,enumerable:!1})}return Object.defineProperty(a,"codes",{value:i,enumerable:!1}),a.color.close="\x1B[39m",a.bgColor.close="\x1B[49m",a.color.ansi256=n(),a.color.ansi16m=r(),a.bgColor.ansi256=n(10),a.bgColor.ansi16m=r(10),Object.defineProperties(a,{rgbToAnsi256:{value:(l,s,u)=>l===s&&s===u?l<8?16:l>248?231:Math.round((l-8)/247*24)+232:16+36*Math.round(l/255*5)+6*Math.round(s/255*5)+Math.round(u/255*5),enumerable:!1},hexToRgb:{value:l=>{const s=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(l.toString(16));if(!s)return[0,0,0];let{colorString:u}=s.groups;u.length===3&&(u=u.split("").map(f=>f+f).join(""));const c=Number.parseInt(u,16);return[c>>16&255,c>>8&255,c&255]},enumerable:!1},hexToAnsi256:{value:l=>a.rgbToAnsi256(...a.hexToRgb(l)),enumerable:!1}}),a}Object.defineProperty(e,"exports",{enumerable:!0,get:o})})(The);var KJe=The.exports,_v={};Object.defineProperty(_v,"__esModule",{value:!0});_v.printIteratorEntries=ljt;_v.printIteratorValues=sjt;_v.printListItems=ujt;_v.printObjectProperties=cjt;const ajt=(e,t)=>{const n=Object.keys(e).sort(t);return Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r=>{Object.getOwnPropertyDescriptor(e,r).enumerable&&n.push(r)}),n};function ljt(e,t,n,r,o,i,a=": "){let l="",s=e.next();if(!s.done){l+=t.spacingOuter;const u=n+t.indent;for(;!s.done;){const c=i(s.value[0],t,u,r,o),f=i(s.value[1],t,u,r,o);l+=u+c+a+f,s=e.next(),s.done?t.min||(l+=","):l+=","+t.spacingInner}l+=t.spacingOuter+n}return l}function sjt(e,t,n,r,o,i){let a="",l=e.next();if(!l.done){a+=t.spacingOuter;const s=n+t.indent;for(;!l.done;)a+=s+i(l.value,t,s,r,o),l=e.next(),l.done?t.min||(a+=","):a+=","+t.spacingInner;a+=t.spacingOuter+n}return a}function ujt(e,t,n,r,o,i){let a="";if(e.length){a+=t.spacingOuter;const l=n+t.indent;for(let s=0;s<e.length;s++)a+=l,s in e&&(a+=i(e[s],t,l,r,o)),s<e.length-1?a+=","+t.spacingInner:t.min||(a+=",");a+=t.spacingOuter+n}return a}function cjt(e,t,n,r,o,i){let a="";const l=ajt(e,t.compareKeys);if(l.length){a+=t.spacingOuter;const s=n+t.indent;for(let u=0;u<l.length;u++){const c=l[u],f=i(c,t,s,r,o),d=i(e[c],t,s,r,o);a+=s+f+": "+d,u<l.length-1?a+=","+t.spacingInner:t.min||(a+=",")}a+=t.spacingOuter+n}return a}var _g={};Object.defineProperty(_g,"__esModule",{value:!0});_g.test=_g.serialize=_g.default=void 0;var X$e=_v,ZF=function(){return typeof globalThis<"u"?globalThis:typeof ZF<"u"?ZF:typeof self<"u"?self:typeof window<"u"?window:Function("return this")()}(),SK=ZF["jest-symbol-do-not-touch"]||ZF.Symbol;const fjt=typeof SK=="function"&&SK.for?SK.for("jest.asymmetricMatcher"):1267621,oN=" ",qJe=(e,t,n,r,o,i)=>{const a=e.toString();return a==="ArrayContaining"||a==="ArrayNotContaining"?++r>t.maxDepth?"["+a+"]":a+oN+"["+(0,X$e.printListItems)(e.sample,t,n,r,o,i)+"]":a==="ObjectContaining"||a==="ObjectNotContaining"?++r>t.maxDepth?"["+a+"]":a+oN+"{"+(0,X$e.printObjectProperties)(e.sample,t,n,r,o,i)+"}":a==="StringMatching"||a==="StringNotMatching"||a==="StringContaining"||a==="StringNotContaining"?a+oN+i(e.sample,t,n,r,o):e.toAsymmetricMatcher()};_g.serialize=qJe;const YJe=e=>e&&e.$$typeof===fjt;_g.test=YJe;const djt={serialize:qJe,test:YJe};var pjt=djt;_g.default=pjt;var Hg={},vjt=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")};Object.defineProperty(Hg,"__esModule",{value:!0});Hg.test=Hg.serialize=Hg.default=void 0;var XJe=QJe(vjt),jo=QJe(KJe);function QJe(e){return e&&e.__esModule?e:{default:e}}const hjt=e=>e.replace((0,XJe.default)(),t=>{switch(t){case jo.default.red.close:case jo.default.green.close:case jo.default.cyan.close:case jo.default.gray.close:case jo.default.white.close:case jo.default.yellow.close:case jo.default.bgRed.close:case jo.default.bgGreen.close:case jo.default.bgYellow.close:case jo.default.inverse.close:case jo.default.dim.close:case jo.default.bold.close:case jo.default.reset.open:case jo.default.reset.close:return"</>";case jo.default.red.open:return"<red>";case jo.default.green.open:return"<green>";case jo.default.cyan.open:return"<cyan>";case jo.default.gray.open:return"<gray>";case jo.default.white.open:return"<white>";case jo.default.yellow.open:return"<yellow>";case jo.default.bgRed.open:return"<bgRed>";case jo.default.bgGreen.open:return"<bgGreen>";case jo.default.bgYellow.open:return"<bgYellow>";case jo.default.inverse.open:return"<inverse>";case jo.default.dim.open:return"<dim>";case jo.default.bold.open:return"<bold>";default:return""}}),ZJe=e=>typeof e=="string"&&!!e.match((0,XJe.default)());Hg.test=ZJe;const JJe=(e,t,n,r,o,i)=>i(hjt(e),t,n,r,o);Hg.serialize=JJe;const gjt={serialize:JJe,test:ZJe};var mjt=gjt;Hg.default=mjt;var zg={};Object.defineProperty(zg,"__esModule",{value:!0});zg.test=zg.serialize=zg.default=void 0;var Q$e=_v;const yjt=" ",eet=["DOMStringMap","NamedNodeMap"],bjt=/^(HTML\w*Collection|NodeList)$/,Ejt=e=>eet.indexOf(e)!==-1||bjt.test(e),tet=e=>e&&e.constructor&&!!e.constructor.name&&Ejt(e.constructor.name);zg.test=tet;const Sjt=e=>e.constructor.name==="NamedNodeMap",net=(e,t,n,r,o,i)=>{const a=e.constructor.name;return++r>t.maxDepth?"["+a+"]":(t.min?"":a+yjt)+(eet.indexOf(a)!==-1?"{"+(0,Q$e.printObjectProperties)(Sjt(e)?Array.from(e).reduce((l,s)=>(l[s.name]=s.value,l),{}):{...e},t,n,r,o,i)+"}":"["+(0,Q$e.printListItems)(Array.from(e),t,n,r,o,i)+"]")};zg.serialize=net;const wjt={serialize:net,test:tet};var Cjt=wjt;zg.default=Cjt;var Vg={},Rl={},Phe={};Object.defineProperty(Phe,"__esModule",{value:!0});Phe.default=xjt;function xjt(e){return e.replace(/</g,"<").replace(/>/g,">")}Object.defineProperty(Rl,"__esModule",{value:!0});Rl.printText=Rl.printProps=Rl.printElementAsLeaf=Rl.printElement=Rl.printComment=Rl.printChildren=void 0;var ret=Ajt(Phe);function Ajt(e){return e&&e.__esModule?e:{default:e}}const Ojt=(e,t,n,r,o,i,a)=>{const l=r+n.indent,s=n.colors;return e.map(u=>{const c=t[u];let f=a(c,n,l,o,i);return typeof c!="string"&&(f.indexOf(`
|
405
|
+
`,yLt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mLt,n=J.useContext(oJe),r=n.csp;J.useEffect(function(){Cd(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},bLt=["icon","className","onClick","style","primaryColor","secondaryColor"],dT={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function ELt(e){var t=e.primaryColor,n=e.secondaryColor;dT.primaryColor=t,dT.secondaryColor=n||PJe(t),dT.calculated=!!n}function SLt(){return he({},dT)}var dx=function(t){var n=t.icon,r=t.className,o=t.onClick,i=t.style,a=t.primaryColor,l=t.secondaryColor,s=Nn(t,bLt),u=dT;if(a&&(u={primaryColor:a,secondaryColor:l||PJe(a)}),yLt(),gLt(q$e(n),"icon should be icon definiton, but got ".concat(n)),!q$e(n))return null;var c=n;return c&&typeof c.icon=="function"&&(c=he(he({},c),{},{icon:c.icon(u.primaryColor,u.secondaryColor)})),eie(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"},s))};dx.displayName="IconReact";dx.getTwoToneColors=SLt;dx.setTwoToneColors=ELt;function IJe(e){var t=RJe(e),n=Ce(t,2),r=n[0],o=n[1];return dx.setTwoToneColors({primaryColor:r,secondaryColor:o})}function wLt(){var e=dx.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var CLt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];IJe("#1890ff");var tE=T.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,i=e.rotate,a=e.tabIndex,l=e.onClick,s=e.twoToneColor,u=Nn(e,CLt),c=T.useContext(oJe),f=c.prefixCls,d=f===void 0?"anticon":f,p=c.rootClassName,g=Ne(p,d,ae(ae({},"".concat(d,"-").concat(r.name),!!r.name),"".concat(d,"-spin"),!!o||r.name==="loading"),n),m=a;m===void 0&&l&&(m=-1);var v=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,y=RJe(s),h=Ce(y,2),b=h[0],E=h[1];return T.createElement("span",he(he({role:"img","aria-label":r.name},u),{},{ref:t,tabIndex:m,onClick:l,className:g}),T.createElement(dx,{icon:r,primaryColor:b,secondaryColor:E,style:v}))});tE.displayName="AntdIcon";tE.getTwoToneColor=wLt;tE.setTwoToneColor=IJe;var xLt=function(t,n){return T.createElement(tE,he(he({},t),{},{ref:n,icon:VZe}))},Ahe=T.forwardRef(xLt);process.env.NODE_ENV!=="production"&&(Ahe.displayName="DeleteOutlined");var ALt=function(t,n){return T.createElement(tE,he(he({},t),{},{ref:n,icon:KQe}))},NJe=T.forwardRef(ALt);process.env.NODE_ENV!=="production"&&(NJe.displayName="EyeOutlined");var OLt=function(t,n){return T.createElement(tE,he(he({},t),{},{ref:n,icon:CNt}))},MJe=T.forwardRef(OLt);process.env.NODE_ENV!=="production"&&(MJe.displayName="PlusOutlined");var $Lt={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"},DLt=function(t,n){return T.createElement(tE,he(he({},t),{},{ref:n,icon:$Lt}))},FJe=T.forwardRef(DLt);process.env.NODE_ENV!=="production"&&(FJe.displayName="UploadOutlined");function BJe(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 TLt(e,t,n,r,o,i,l=>({value:l[t],title:l[n],key:l[t],disabled:l[t]===a}))}function TLt(e,t,n,r,o,i,a){if(!Array.isArray(e)||e.length===0)return[];const l=e.map(s=>({...s,...a(s)}));return l.filter(s=>{const u=l.filter(c=>s[t]===c[r]);return s[o]=u.length>0?u:[],s[r]===i})}const kJe=e=>{let{request:t,title:n,disabledValue:r,callError:o,...i}=e;const[a,l]=J.useState(!1),[s,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=BJe(((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),l(!0)};return ze.jsx(vi,{...i,children:a&&ze.jsx(u0,{...i,treeData:s,treeDefaultExpandAll:!0,style:{width:"100%"}})})},Ohe=J.forwardRef((e,t)=>{let{addWrapper:n=!0,form:r,fieldName:o,fieldsValue:i,value:a,type:l,defaultValue:s,onChange:u,option_label:c,option_value:f,option_search:d,options:p,request:g,requestParams:m,callError:v,subRequest:y,sub_option_label:h="label",mode:b="single",sub_option_value:E="id",rightIconRender:S,rightIcon:w,rightIconClick:C,...O}=e;const[D,x]=J.useState([]),[$,P]=J.useState(!1);J.useEffect(()=>{if(console.log("SearchSelect ".concat(o," value"),a),a){let z=null;Array.isArray(D)&&D.length>0&&(z=D.find(j=>j.value==(a==null?void 0:a.value)||j.value==a),z&&!Dg.isEqual(z,a)&&(console.log("new value /////",z),typeof u=="function"&&u(z))),z||N()}},[a]),J.useEffect(()=>{console.log("SearchSelect useEffect requestParams",m),M(m)},[m]);const N=async()=>{g&&f&&k({...m,[f]:a==null?void 0:a.value},null,z=>{if(console.log("loadSelectOptions selectOptions",z),z&&z.length>0){let j=z.find(I=>I.value==(a==null?void 0:a.value)||I.value==a);console.log("loadSelectOptions item",j),j&&!Dg.isEqual(j,a)&&(console.log("new value /////",j),typeof u=="function"&&u(j))}})},M=async z=>{const j={};if(Array.isArray(O==null?void 0:O.filterRules))for(let G of O==null?void 0:O.filterRules){var I,F,_,W;let U;G.value.parent===""?U=i==null?void 0:i[G.value.field_key]:U=i==null||(I=i[G.value.parent])===null||I===void 0||(F=I[o==null?void 0:o[1]])===null||F===void 0?void 0:F[G.value.field_key],U&&(_=U)!==null&&_!==void 0&&_.value&&(U=U.value),j[G.column.column_name]=(W=U)!==null&&W!==void 0?W:"##norequest##"}g&&typeof g=="function"&&k(z,j),p&&p.length>0&&x(p)},B=async z=>{const j={...m};j[d]=z,await k(j)},k=J.useCallback(Dg.debounce((z,j,I)=>{L(z,j).then(F=>{typeof I=="function"&&I(F)})},200),[]),L=async(z,j)=>{try{let F=[];if(!(j&&Object.values(j).some(_=>_==="##norequest##"))){var I;P(!0);const _=await g({...z,ruleParams:j});P(!1),_.code>0?v&&typeof v=="function"&&v(_.message):F=((I=_.data)===null||I===void 0?void 0:I.list)||_.data}if(Array.isArray(F)){for(let _=0;_<F.length;_++){const W=F[_];if(typeof y=="function"){let G=[];const{data:U}=await y(W);U!=null&&U.list&&Array.isArray(U.list)&&(G=U.list.map(K=>({label:"".concat(W[c],"-").concat(K[h]),value:"".concat(W[f],"-").concat(K[E])}))),F[_]={...W,label:W[c],title:W[c],options:G}}F[_]={...W,label:W[c],value:W[f]}}D.length>0&&!Dg.isEqual(D,F)&&typeof u=="function"&&u(void 0),x(F)}else x([]);return F}catch(F){console.error("fetchOptions",F),P(!1)}finally{}},H=z=>{Array.isArray(z)?u(z.map(j=>D.find(I=>I.value===j))):u(D.find(j=>j.value===z))};return n?ze.jsxs(vi,{...O,children:[ze.jsx(Bd,{ref:t,notFoundContent:$?ze.jsx(P4,{size:"small"}):null,value:a,...O,filterOption:!1,showSearch:!!(g&&d),onSearch:g&&d?B:null,onChange:H,style:{width:"100%",flex:1},options:D,mode:b}),!(O!=null&&O.disabled)&&w,!(O!=null&&O.disabled)&&typeof S=="function"&&S({value:a,onChange:u,form:r,fieldName:o})]}):ze.jsxs(ze.Fragment,{children:[ze.jsx(Bd,{ref:t,notFoundContent:$?ze.jsx(P4,{size:"small"}):null,value:a,...O,filterOption:!1,showSearch:!!(g&&d),onSearch:g&&d?B:null,onChange:H,style:{width:"100%"},options:D,mode:b}),!(O!=null&&O.disabled)&&w,!(O!=null&&O.disabled)&&typeof S=="function"&&S({value:a,onChange:u,form:r,fieldName:o})]})}),$he=e=>{let{request:t,option_label:n="label",option_value:r="id",disabledValue:o,callError:i,options:a,addWrapper:l=!0,...s}=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 l?ze.jsx(vi,{...s,children:ze.jsx(Bd,{...s,options:u,style:{width:"100%"}})}):ze.jsx(Bd,{...s,options:u,style:{width:"100%"}})},PLt=e=>{let{...t}=e;return ze.jsx($he,{...t,mode:"single"})},RLt=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]),ze.jsx($he,{...r,onChange:t,mode:"multiple",value:o})},LJe=e=>{var t,n;let{readItemRender:r,readonly:o,onChange:i,onCustomChange:a,value:l,form:s,fieldName:u,...c}=e;return J.useEffect(()=>{if(l&&typeof l=="string")try{l=JSON.parse(l),s==null||s.setFieldValue(u,l),console.log("WithSingleSelect useEffect onChange////// form",s),console.log("WithSingleSelect useEffect onChange////// fieldName",u),console.log("WithSingleSelect useEffect onChange////// value",l)}catch(f){console.log("WithSingleSelect useEffect error",f)}},[l]),o?ze.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:l&&l.label&&ze.jsx(ze.Fragment,{children:r&&typeof r=="function"?r(l):ze.jsx("span",{children:(t=l)===null||t===void 0?void 0:t.label},"btn_".concat((n=l)===null||n===void 0?void 0:n.value))})}):ze.jsx(Ohe,{addWrapper:!1,form:s,fieldName:u,...c,onChange:i,value:l,mode:"single",className:" fflex-1 foverflow-hidden"})},jJe=e=>{let{readItemRender:t,readonly:n,onChange:r,value:o,form:i,fieldName:a,...l}=e;return J.useEffect(()=>{if(o&&typeof o=="string")try{o=JSON.parse(o),r(o)}catch{}},[o]),n?ze.jsx("div",{className:" fh-8 fflex fitems-center fgap-2",children:Array.isArray(o)&&o.map((s,u)=>ze.jsxs(ze.Fragment,{children:[" ",t&&typeof t=="function"?t(s):ze.jsx("span",{children:s==null?void 0:s.label},"btn_".concat(s==null?void 0:s.value)),u<o.length-1?ze.jsx("span",{className:" ftext-gray-400",children:","}):null]}))}):ze.jsx(Ohe,{addWrapper:!1,form:i,fieldName:a,...l,onChange:r,value:o,mode:"multiple",className:" fflex-1 foverflow-hidden"})},ILt=e=>{let{customComponent:t,...n}=e;return t?ze.jsx(vi,{...n,children:ze.jsx(t,{...n})}):ze.jsx(vi,{...n,children:ze.jsx(Lv,{...n})})},_Je=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 l=s=>{Array.isArray(s)||(s=[s]),t&&typeof t=="function"&&t(s)};return ze.jsx(kJe,{...o,onChange:l,value:i,multiple:r})},NLt=e=>{let{FetchDeptList:t,...n}=e;return ze.jsx(_Je,{...n,title:"deptName",request:t})},MLt=e=>{let{FetchPostList:t,...n}=e;return ze.jsx(_Je,{...n,title:"postName",request:t})};LJe.displayName="WithSingleSelect";jJe.displayName="WithMultipleSelect";const FLt=J.forwardRef((e,t)=>(J.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),ze.jsx(vi,{...e,children:ze.jsx(LJe,{...e})}))),BLt=J.forwardRef((e,t)=>(J.useImperativeHandle(t,()=>({handleChange:n=>{e==null||e.onChange(n)}}),[]),ze.jsx(vi,{...e,children:ze.jsx(jJe,{...e})}))),kLt=J.forwardRef((e,t)=>{let{value:n,onChange:r,...o}=e;const i=J.useRef(0),a=()=>{i.current++,r(i.current)};return ze.jsxs(vi,{...o,children:[ze.jsxs("div",{ref:t,children:["form-set-value:",n]}),ze.jsx(du,{onClick:a,children:"test"})]})}),LLt=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},jLt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let FA=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=jLt[n[e]&63];return t};var HJe={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(s,u,c){this.fn=s,this.context=u,this.once=c||!1}function i(s,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new o(c,f||s,d),g=n?n+u:u;return s._events[g]?s._events[g].fn?s._events[g]=[s._events[g],p]:s._events[g].push(p):(s._events[g]=p,s._eventsCount++),s}function a(s,u){--s._eventsCount===0?s._events=new r:delete s._events[u]}function l(){this._events=new r,this._eventsCount=0}l.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},l.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},l.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,c,f,d,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var v=this._events[m],y=arguments.length,h,b;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,c),!0;case 3:return v.fn.call(v.context,c,f),!0;case 4:return v.fn.call(v.context,c,f,d),!0;case 5:return v.fn.call(v.context,c,f,d,p),!0;case 6:return v.fn.call(v.context,c,f,d,p,g),!0}for(b=1,h=new Array(y-1);b<y;b++)h[b-1]=arguments[b];v.fn.apply(v.context,h)}else{var E=v.length,S;for(b=0;b<E;b++)switch(v[b].once&&this.removeListener(u,v[b].fn,void 0,!0),y){case 1:v[b].fn.call(v[b].context);break;case 2:v[b].fn.call(v[b].context,c);break;case 3:v[b].fn.call(v[b].context,c,f);break;case 4:v[b].fn.call(v[b].context,c,f,d);break;default:if(!h)for(S=1,h=new Array(y-1);S<y;S++)h[S-1]=arguments[S];v[b].fn.apply(v[b].context,h)}}return!0},l.prototype.on=function(u,c,f){return i(this,u,c,f,!1)},l.prototype.once=function(u,c,f){return i(this,u,c,f,!0)},l.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,v=[],y=g.length;m<y;m++)(g[m].fn!==c||d&&!g[m].once||f&&g[m].context!==f)&&v.push(g[m]);v.length?this._events[p]=v.length===1?v[0]:v:a(this,p)}return this},l.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},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(HJe);var _Lt=HJe.exports;const HLt=ql(_Lt),tie=new HLt,zLt=e=>{let{children:t,layout:n,onTableAddRow:r,onTableRemoveRow:o,form:i,initializeFormRender:a,mode:l}=e;n=n||"1";const s=f=>{const d=f.split(",").map(Number),p=24;return d.map(g=>g/d.reduce((m,v)=>m+v)*p)},u=J.useMemo(()=>s(n),[n]),c=J.useMemo(()=>J.Children.toArray(t).map((f,d)=>{var p,g;const m=f.props,v=(m==null?void 0:m.componentId)||(m==null?void 0:m.__id);var y=((p=f.type)===null||p===void 0?void 0:p.displayName)||((g=f.props)===null||g===void 0?void 0:g._componentName);let h=null;if(y=="Field.Table"?h=J.cloneElement(f,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:v,initializeFormRender:a,mode:l}):J.isValidElement(f)?h=J.cloneElement(f,{form:i,fieldName:v,initializeFormRender:a}):h=f,v){const b=[];if(m.isRequired&&b.push({required:!0,message:"".concat(m.label,"必须填写")}),m.rules)if(Array.isArray(m.rules)){const E=m.rules.join("|");b.push({pattern:new RegExp(E),message:m.rulesFailMessage?m.rulesFailMessage:"".concat(m.label,"格式错误")})}else b.push({pattern:new RegExp(m.rules),message:m.rulesFailMessage?m.rulesFailMessage:"".concat(m.label,"格式错误")});return(u==null?void 0:u[d])&&ze.jsx(_C,{span:u[d],children:ze.jsx(cl.Item,{style:{marginBottom:0},label:"",name:v,rules:b,children:h},"".concat(v,"-form-item"))},d)}else return(u==null?void 0:u[d])&&ze.jsx(_C,{span:u[d],children:h},d)}),[t,u]);return ze.jsx(Tj,{gutter:24,children:c})},VLt=e=>{let{title:t}=e;return t?ze.jsx("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:ze.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:t})}):null};function ULt(e,t){const n=[];let r=[];const o=(a,l)=>{const s=a-l.length;s>0&&l.push(...new Array(s).fill(J.createElement("div")))};for(const a of e){var i;const{_componentName:l}=(a==null?void 0:a.props)||{},s=((i=a.type)===null||i===void 0?void 0:i.displayName)||l;s&&s.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 Dhe=J.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=cl.useForm(),[a,l]=J.useState(null),s=J.useRef(null),u=J.useRef(0);J.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:x=>{u.current=1,i.setFieldsValue(x)},initializeFieldVisibility:g}),[]),J.useEffect(()=>{c()},[r,n]);const c=()=>{p(),l(D())},f=J.useRef(null),d=x=>{var $;return($=f.current)===null||$===void 0?void 0:$[x]},p=()=>{const x=[];function $(N){var M,B;let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;var L=((M=N.type)===null||M===void 0?void 0:M.displayName)||((B=N.props)===null||B===void 0?void 0:B._componentName);const{props:H}=N;if(L&&(L.startsWith("Field.")||L.startsWith("Layout."))){let I=(H==null?void 0:H.componentId)||(H==null?void 0:H.__id),F=[];if(k&&k!==null&&k!==void 0&&k.props){var z,j;I="".concat((k==null||(z=k.props)===null||z===void 0?void 0:z.componentId)||(k==null||(j=k.props)===null||j===void 0?void 0:j.__id),".").concat(I)}H!=null&&H.withId&&F.push(H==null?void 0:H.withId),H!=null&&H.withIds&&(F=[...F,...H==null?void 0:H.withIds]),x.push({identifier:I,withIds:F,component:N,componentName:L,fillRules:H==null?void 0:H.fillRules})}H!=null&&H.children&&J.Children.toArray(H==null?void 0:H.children).forEach(F=>$(F,L&&L.startsWith("Field.")?N:null))}s.current=new Map,console.log(" fields",x);const P=J.Children.toArray(r);for(let N=0;N<P.length;N++){const M=P[N];$(M)}x.forEach(N=>{const{identifier:M}=N;s.current.set(M,{children:x.filter(B=>B.withIds.some(k=>k==M)),show:!0,...N})}),console.log(" dependencyMap.current",s.current),g()},g=function(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const $=i.getFieldsValue();for(let P of s.current.keys())m(P,$,!0);x&&l(D())},m=function(x,$){let P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,N=!1,M=[];if(Array.isArray(x)&&(M=[...x.slice(0,-1)],x=x.filter(B=>typeof B=="string").join(".")),s.current.has(x)){const B=s.current.get(x),k=B.children;!P&&B!==null&&B!==void 0&&B.fillRules&&Array.isArray(B==null?void 0:B.fillRules)&&(B==null?void 0:B.fillRules.length)>0&&v(x,M,$,B==null?void 0:B.fillRules),k.forEach(L=>{L.component.props.withFunc&&typeof L.component.props.withFunc=="function"&&(N=y($,L)),!P&&L.component.props.withFill&&h($,L,M,B==null?void 0:B.componentName)})}return N},v=(x,$,P,N)=>{let M=b("fieldsValue",x,P,null),B={},k=[];for(let I=0;I<N.length;I++){const F=N[I];let{source:_,target:W}=F,G=M==null?void 0:M[_],U=G;if((F==null?void 0:F.type)==1){if(s.current.has(W)){var L,H,z;let Y=(L=s.current.get(W))===null||L===void 0||(H=L.component)===null||H===void 0||(z=H.props)===null||z===void 0?void 0:z.children;Array.isArray(Y)&&Y.length>0&&k.push(Y.map(Q=>{var Z,q;return"".concat(_,".").concat((Q==null||(Z=Q.props)===null||Z===void 0?void 0:Z.componentId)||(Q==null||(q=Q.props)===null||q===void 0?void 0:q.__id))}))}if(G&&typeof G=="string")try{G=JSON.parse(G)}catch(Y){console.error("error end",Y)}if(!Array.isArray(G))return;U=G.map((Y,Q)=>{let Z={};if(F!=null&&F.subRules&&Array.isArray(F==null?void 0:F.subRules)&&(F==null?void 0:F.subRules.length)>0)for(let q=0;q<(F==null?void 0:F.subRules.length);q++){const{source:te,target:le}=F==null?void 0:F.subRules[q];Z[le]=Y==null?void 0:Y[te];let ne={name:[W,Q,le],value:Y==null?void 0:Y[te]};B[ne.name]=ne}return Z}),tie.emit("reloadTable",W)}else{let K=0;if($&&Array.isArray($)&&$.length>1&&($.filter(Y=>typeof Y=="string").join("."),K=$[$.length-1],W=[...$,W],Array.isArray(M)&&M.length>K)){var j;U=(j=M[K])===null||j===void 0?void 0:j[_]}B[W]={name:[W],value:U}}(F==null?void 0:F.type)==1&&i.setFieldValue(W,void 0),i.setFieldValue(W,U)}setTimeout(()=>{var I=Object.keys(B);I.length>0&&(I.forEach(F=>{E.current[F]=B[F]}),S()),k.length>0&&k.forEach(F=>{Array.isArray(F)&&F.length>0&&C(F)})},0)},y=(x,$,P)=>{var N,M;let B=!1;const k=$==null||(N=$.component)===null||N===void 0||(M=N.props)===null||M===void 0?void 0:M.withFunc(x),L=$==null?void 0:$.identifier;if(s.current.has(L)){const H=s.current.get(L);H.show!==k&&(H.show=k,s.current.set(L,H),B=!0)}return B},h=async(x,$,P,N)=>{var M,B;const k=$==null||(M=$.component)===null||M===void 0?void 0:M.props.withFill,L=$==null||(B=$.component)===null||B===void 0?void 0:B.props.withDataFetch;let H=0,z="",j=$.identifier;if(P&&Array.isArray(P)&&P.length>1)z=P.filter(W=>typeof W=="string").join("."),H=P[P.length-1],j.startsWith("".concat(z,"."))&&(j=[...P,j.replace("".concat(z,"."),"")]);else if(j.indexOf(".")>=0){j=j.split(".");let W=b("fieldsValue",j[0],x,[]);if(Array.isArray(W)&&W.length>0)for(let G=0;G<W.length;G++)await h(x,$,[j[0],G],N);return}let I=[];if(k!=null&&k.withData&&(k==null?void 0:k.withData.length)>0&&L&&typeof L=="function")for(let W=0;W<(k==null?void 0:k.withData.length);W++){const G=k==null?void 0:k.withData[W];let U={};U.tableName=G.withTable.table_name,U.filter={};for(let Y=0;Y<G.withCondition.length;Y++){var F;const{value:Q,column:Z}=G.withCondition[Y];let q=b(Q.group_key,Q.field_key,x,I);Array.isArray(q)&&Array.isArray(j)&&q.length>H&&(q=q[H]),N=="Field.WithSingleSelect"&&q&&(F=q)!==null&&F!==void 0&&F.value&&(q=q.value),U.filter[Z.column_name]=q}const K=await L(U);K.code===0&&K.data.list&&I.push({id:G.id,data:K.data.list})}let _;if(k.value&&k.value.length>0&&(_=k.value.map(W=>{let G="";const{insert:U,attributes:K}=W;return typeof U!="string"?U!=null&&U.span&&K&&K.tagKey&&K.id&&(G=b(K.tagKey,K.id,x,I),Array.isArray(G)?Array.isArray(j)&&G.length>H?G=G[H]:G=JSON.stringify(G):G.length>0&&(G='"'.concat(G,'"'))):G=U,G})),_&&_.length>0){const W=LLt(_);i.setFieldValue(j,W),m(j,i.getFieldsValue())}},b=(x,$,P,N)=>{let M="";if(x=="fieldsValue"){var B;if($.indexOf(".")>=0){var k;const[z,j]=$.split("."),I=(P==null?void 0:P[z])||[];Array.isArray(I)?M=I.map(F=>{var _;return(_=F==null?void 0:F[j])!==null&&_!==void 0?_:""}):M=(k=I==null?void 0:I[j])!==null&&k!==void 0?k:""}else M=(B=P==null?void 0:P[$])!==null&&B!==void 0?B:""}else{let z=N.find(j=>j.id===x);if(z&&z.data&&z.data.length>0){var L,H;M=(L=(H=z.data[0])===null||H===void 0?void 0:H[$])!==null&&L!==void 0?L:""}}return M},E=J.useRef({}),S=Dg.debounce(()=>{const x=i.getFieldsValue(),$=u.current;u.current=0;let P=!1;f.current||(f.current={});for(let N in E.current){let M=E.current[N];Dg.isEqual(M.value,d(M.name))||($!=1&&(P=m(M.name,x)),f.current[M.name]=M.value)}P&&l(D()),E.current={}},100),w=x=>{x.filter($=>{$.name&&$.name.length>0&&(E.current[$.name]=$)}),S()},C=x=>{let $=[];x.forEach(N=>{if(!s.current.has(N))return;let M=s.current.get(N);M.withIds.length<=0||$.push(...M.withIds.filter(B=>!$.includes(B)))}),$=$.filter(N=>{var M=i.getFieldValue(N);return!(typeof M!="number"&&!M)});const P=i.getFieldsValue();setTimeout(()=>{$.forEach(N=>{m(N,P)})},0)},O=x=>{const $=i.getFieldsValue();setTimeout(()=>{x.forEach(P=>{m(P,$)})},0)},D=()=>{const x=J.Children.toArray(r);return ULt(x.filter(P=>{var N;const M=P.props.componentId||P.props.__id;return!s.current.has(M)||((N=s.current.get(M))===null||N===void 0?void 0:N.show)}),n).map((P,N)=>ze.jsx(Tj,{gutter:[24,24],children:P.map((M,B)=>{var k;const{componentId:L,__id:H,_componentName:z,...j}=M.props,I=((k=M.type)===null||k===void 0?void 0:k.displayName)||z,F=L||H,_=I&&I.startsWith("Layout."),W=I&&I=="Field.Table",G=j.calcHidden&&o!="desgin",U=[];if(j.isRequired&&U.push({required:!0,message:"".concat(j.label,"必须填写")}),j.rules)if(Array.isArray(j.rules)){const Q=j.rules.join("|");U.push({pattern:new RegExp(Q),message:j.rulesFailMessage?j.rulesFailMessage:"".concat(j.label,"格式错误")})}else U.push({pattern:new RegExp(j.rules),message:j.rulesFailMessage?j.rulesFailMessage:"".concat(j.label,"格式错误")});const K=Q=>{i.setFieldValue(F,Q)};let Y;return W||_?Y=J.cloneElement(M,{onTableAddRow:C,onTableRemoveRow:O,form:i,fieldName:F,onCustomChange:K,initializeFormRender:c,mode:o}):I==="Field.WithSingleSelect"||I==="Field.WithMultipleSelect"?Y=ze.jsx(cl.Item,{hidden:G,style:{margin:0},shouldUpdate:(Q,Z)=>{let q=!1;if(Array.isArray(j.filterRules)&&j.filterRules.length>0)for(let te of j.filterRules){if(te.value.parent!="")continue;let le,ne;if(le=Q==null?void 0:Q[te.value.field_key],ne=Z==null?void 0:Z[te.value.field_key],le!==ne){q=!0;break}}return q},children:Q=>{let{getFieldsValue:Z}=Q;const q=Z();return ze.jsx(cl.Item,{style:{marginBottom:0},label:"",name:F,rules:U,children:J.cloneElement(M,{onTableAddRow:C,onTableRemoveRow:O,form:i,fieldName:F,onCustomChange:K,fieldsValue:q,initializeFormRender:c})})}}):Y=ze.jsx(cl.Item,{hidden:G,style:{marginBottom:0},label:"",name:F,rules:U,children:J.cloneElement(M,{form:i,fieldName:F,onCustomChange:K,initializeFormRender:c})}),ze.jsx(_C,{span:j.calcHidden?0:_?24:24/n,style:{marginBottom:0},children:Y},F||"col-".concat(B))})},"row-".concat(N)))};return ze.jsx(cl,{form:i,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col fgap-y-2"+(o=="desgin"?" fp-6":""),onValuesChange:(x,$)=>{},onFieldsChange:w,children:a})});function WLt(e){return J.forwardRef((t,n)=>ze.jsx(e,{...t,ref:n,forwardedRef:n}))}class Qgr extends J.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return ze.jsx(Dhe,{...n,ref:t})}}const GLt=WLt(e=>{let{forwardedRef:t,...n}=e;return ze.jsx(Dhe,{...n,ref:t})}),KLt=e=>{let{request:t,value:n,onChange:r,callError:o,disabledValue:i,addRoot:a=!0,title:l,...s}=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 x=await t();if(x.code>0){o&&typeof o=="function"&&o(x.message);return}let $=BJe(((D=x.data)===null||D===void 0?void 0:D.list)||x.data||[],"id",l||"title",(s==null?void 0:s.parentId)||"parentId","children",0,i);a&&($=[{value:0,title:"根节点",children:$}]),s.treeData=$,console.log("treeData",$),d($)}s.treeData&&d(s.treeData),c(!0)},[g,m]=J.useState([]),[v,y]=J.useState([]),[h,b]=J.useState([]),[E,S]=J.useState(!0),w=D=>{console.log("onExpand",D),m(D),S(!1)},C=D=>{console.log("onCheck",D),y(D),r(D)},O=(D,x)=>{console.log("onSelect",x),b(D)};return ze.jsx(vi,{...s,children:ze.jsx(Ehe,{checkable:!0,onExpand:w,onCheck:C,onSelect:O,expandedKeys:g,autoExpandParent:E,checkedKeys:v,selectedKeys:h,treeData:f})})},qLt=e=>ze.jsx(vi,{...e,children:ze.jsx(K3,{...e})}),YLt=e=>ze.jsx(vi,{...e,children:ze.jsx(K3.Group,{...e})}),XLt=e=>ze.jsx(vi,{...e,children:ze.jsx(Aj.Group,{...e})}),zJe=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)&&l(t)}},[t]),n=n||99,r=r||!0;const[a,l]=J.useState([]),s=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}))),l(c)};return ze.jsx(Bj,{...i,listType:"text",multiple:r,onChange:s,maxCount:n,fileList:a,children:!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&a.length<n&&ze.jsx(du,{type:(i==null?void 0:i.type)||"default",icon:(i==null?void 0:i.icon)||ze.jsx(FJe,{}),children:"点击上传文件"})})};zJe.displayName="UploadFile";const QLt=e=>ze.jsx(vi,{...e,children:ze.jsx(zJe,{...e})}),VJe=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 w=0;w<n.length;w++){let C=n[w];var E=g.current.find(O=>O.uid===C.uid);!E||(E.version||0)<(C.version||0)?S.push(C):S.push(E)}l(S)}},[n]),t=t||99,r=r||!0,console.log("maxCount",t);const[a,l]=J.useState([]),[s,u]=J.useState(""),[c,f]=J.useState(0),[d,p]=J.useState(!1),g=J.useRef([]),m=E=>new Promise((S,w)=>{const C=new FileReader;C.readAsDataURL(E),C.onload=()=>S(C.result),C.onerror=O=>w(O)}),v=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||l(a.filter((w,C)=>C!==S))},h=ze.jsx(ze.Fragment,{children:ze.jsxs("div",{className:"fw-full fh-full fflex fflex-col fitems-center fjustify-center fborder fborder-dashed fcursor-pointer frounded",children:[ze.jsx(MJe,{}),ze.jsx("div",{className:"fmt-2",children:"点击上传"})]})}),b=E=>{let{fileList:S}=E,w=[];for(let D=0;D<S.length;D++){var C=S[D];C.version=new Date().getTime();var O=g.current.find(x=>x.uid===C.uid);console.log("oldfile",JSON.parse(JSON.stringify(O||{}))),O&&O.status!="uploading"?w.push(O):(C.status=="done"&&C.response&&(C.url=C.response),w.push(C))}g.current=w,l(w),o(w.map(D=>({uid:D.uid,name:D.name,status:D.status,url:D.url||D.response||"",error:D.error,version:D.version||0})))};return ze.jsxs(ze.Fragment,{children:[ze.jsx("div",{className:"fflex fgap-3 fflex-wrap",children:ze.jsx(Bj,{...i,itemRender:(E,S,w)=>{console.log("file",S);let C=w.findIndex(O=>O.uid===S.uid);return ze.jsx(ze.Fragment,{children:ze.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:[ze.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"&&ze.jsx(NJe,{onClick:()=>{v(S,C)},className:"hover:ftext-gray-200"}),!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&ze.jsx(Ahe,{onClick:()=>{y(S,C)},className:"hover:ftext-gray-200"})]}),S.status=="uploading"&&ze.jsx("div",{className:" fw-full fh-full fflex fitems-center fjustify-center fabsolute ftop-0 fleft-0 ",children:ze.jsx(P4,{})}),ze.jsx("img",{src:S.url||S.thumbUrl,alt:"Example Image",class:"fmax-w-full fmax-h-full fobject-contain "})]},"file-".concat(S.uid))})},listType:"picture-card",fileList:a,multiple:r,onPreview:v,onChange:b,maxCount:t,children:a.length>=t||i!=null&&i.disabled||i!=null&&i.readonly?null:h})}),s&&ze.jsx(qF.PreviewGroup,{preview:{visible:d,current:c,onVisibleChange:E=>p(E),onChange:E=>{f(E)}},children:a.map((E,S)=>ze.jsx(ze.Fragment,{children:ze.jsx(qF,{wrapperStyle:{display:"none"},src:E.url})}))})]})};VJe.displayName="UploadImage";const ZLt=e=>ze.jsx(vi,{...e,children:ze.jsx(VJe,{...e})}),JLt=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)),ze.jsx(vi,{...i,children:ze.jsx(vhe,{...i,onChange:n,value:t})})};var ejt={exports:{}};(function(e,t){(function(n,r){e.exports=r(IXe())})(vr,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,l){return l==="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,l){var s=100*a+l;return s<600?"凌晨":s<900?"早上":s<1100?"上午":s<1300?"中午":s<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(ejt);var tjt={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 njt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},UJe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},tjt),timePickerLocale:Object.assign({},njt)};UJe.lang.ok="确定";var WJe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(vr,function(){return function(n,r,o){o.updateLocale=function(i,a){var l=o.Ls[i];if(l)return(a?Object.keys(a):[]).forEach(function(s){l[s]=a[s]}),l}}})})(WJe);var rjt=WJe.exports;const ojt=ql(rjt);fa.extend(ojt);fa.extend(jXe);fa.updateLocale("zh-cn",{weekStart:0});const ijt=e=>{let{datetype:t,value:n,defaultNow:r,onChange:o,...i}=e;t=t||"date";const[a,l]=J.useState(i==null?void 0:i.picker),[s,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 v=fa().format("YYYY-MM-DD HH:mm:ss");typeof o=="function"&&o(v);return}},[]);const m=(v,y)=>{g.current=!0,o(y)};return J.useEffect(()=>{switch(l("date"),f(!1),t){case"date":l("date"),u("YYYY-MM-DD"),p(!1);break;case"datetime":f(!0),l("datetime"),u("YYYY-MM-DD HH:mm:ss"),p(!0);break;case"month":l("month"),p(!1);break;case"year":l("year"),p(!1);break}},[t]),ze.jsx(vi,{...i,children:ze.jsx(fx,{locale:UJe,...i,picker:a,format:s,style:{width:"100%"},onChange:m,value:n&&fa(n).isValid()?fa(n):void 0,showTime:c,needConfirm:d})})};var GJe={},Av={},The={exports:{}};The.exports;(function(e){const n=(i=0)=>a=>`\x1B[${38+i};5;${a}m`,r=(i=0)=>(a,l,s)=>`\x1B[${38+i};2;${a};${l};${s}m`;function o(){const i=new Map,a={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};a.color.gray=a.color.blackBright,a.bgColor.bgGray=a.bgColor.bgBlackBright,a.color.grey=a.color.blackBright,a.bgColor.bgGrey=a.bgColor.bgBlackBright;for(const[l,s]of Object.entries(a)){for(const[u,c]of Object.entries(s))a[u]={open:`\x1B[${c[0]}m`,close:`\x1B[${c[1]}m`},s[u]=a[u],i.set(c[0],c[1]);Object.defineProperty(a,l,{value:s,enumerable:!1})}return Object.defineProperty(a,"codes",{value:i,enumerable:!1}),a.color.close="\x1B[39m",a.bgColor.close="\x1B[49m",a.color.ansi256=n(),a.color.ansi16m=r(),a.bgColor.ansi256=n(10),a.bgColor.ansi16m=r(10),Object.defineProperties(a,{rgbToAnsi256:{value:(l,s,u)=>l===s&&s===u?l<8?16:l>248?231:Math.round((l-8)/247*24)+232:16+36*Math.round(l/255*5)+6*Math.round(s/255*5)+Math.round(u/255*5),enumerable:!1},hexToRgb:{value:l=>{const s=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(l.toString(16));if(!s)return[0,0,0];let{colorString:u}=s.groups;u.length===3&&(u=u.split("").map(f=>f+f).join(""));const c=Number.parseInt(u,16);return[c>>16&255,c>>8&255,c&255]},enumerable:!1},hexToAnsi256:{value:l=>a.rgbToAnsi256(...a.hexToRgb(l)),enumerable:!1}}),a}Object.defineProperty(e,"exports",{enumerable:!0,get:o})})(The);var KJe=The.exports,_v={};Object.defineProperty(_v,"__esModule",{value:!0});_v.printIteratorEntries=ljt;_v.printIteratorValues=sjt;_v.printListItems=ujt;_v.printObjectProperties=cjt;const ajt=(e,t)=>{const n=Object.keys(e).sort(t);return Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r=>{Object.getOwnPropertyDescriptor(e,r).enumerable&&n.push(r)}),n};function ljt(e,t,n,r,o,i,a=": "){let l="",s=e.next();if(!s.done){l+=t.spacingOuter;const u=n+t.indent;for(;!s.done;){const c=i(s.value[0],t,u,r,o),f=i(s.value[1],t,u,r,o);l+=u+c+a+f,s=e.next(),s.done?t.min||(l+=","):l+=","+t.spacingInner}l+=t.spacingOuter+n}return l}function sjt(e,t,n,r,o,i){let a="",l=e.next();if(!l.done){a+=t.spacingOuter;const s=n+t.indent;for(;!l.done;)a+=s+i(l.value,t,s,r,o),l=e.next(),l.done?t.min||(a+=","):a+=","+t.spacingInner;a+=t.spacingOuter+n}return a}function ujt(e,t,n,r,o,i){let a="";if(e.length){a+=t.spacingOuter;const l=n+t.indent;for(let s=0;s<e.length;s++)a+=l,s in e&&(a+=i(e[s],t,l,r,o)),s<e.length-1?a+=","+t.spacingInner:t.min||(a+=",");a+=t.spacingOuter+n}return a}function cjt(e,t,n,r,o,i){let a="";const l=ajt(e,t.compareKeys);if(l.length){a+=t.spacingOuter;const s=n+t.indent;for(let u=0;u<l.length;u++){const c=l[u],f=i(c,t,s,r,o),d=i(e[c],t,s,r,o);a+=s+f+": "+d,u<l.length-1?a+=","+t.spacingInner:t.min||(a+=",")}a+=t.spacingOuter+n}return a}var _g={};Object.defineProperty(_g,"__esModule",{value:!0});_g.test=_g.serialize=_g.default=void 0;var X$e=_v,ZF=function(){return typeof globalThis<"u"?globalThis:typeof ZF<"u"?ZF:typeof self<"u"?self:typeof window<"u"?window:Function("return this")()}(),SK=ZF["jest-symbol-do-not-touch"]||ZF.Symbol;const fjt=typeof SK=="function"&&SK.for?SK.for("jest.asymmetricMatcher"):1267621,oN=" ",qJe=(e,t,n,r,o,i)=>{const a=e.toString();return a==="ArrayContaining"||a==="ArrayNotContaining"?++r>t.maxDepth?"["+a+"]":a+oN+"["+(0,X$e.printListItems)(e.sample,t,n,r,o,i)+"]":a==="ObjectContaining"||a==="ObjectNotContaining"?++r>t.maxDepth?"["+a+"]":a+oN+"{"+(0,X$e.printObjectProperties)(e.sample,t,n,r,o,i)+"}":a==="StringMatching"||a==="StringNotMatching"||a==="StringContaining"||a==="StringNotContaining"?a+oN+i(e.sample,t,n,r,o):e.toAsymmetricMatcher()};_g.serialize=qJe;const YJe=e=>e&&e.$$typeof===fjt;_g.test=YJe;const djt={serialize:qJe,test:YJe};var pjt=djt;_g.default=pjt;var Hg={},vjt=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")};Object.defineProperty(Hg,"__esModule",{value:!0});Hg.test=Hg.serialize=Hg.default=void 0;var XJe=QJe(vjt),jo=QJe(KJe);function QJe(e){return e&&e.__esModule?e:{default:e}}const hjt=e=>e.replace((0,XJe.default)(),t=>{switch(t){case jo.default.red.close:case jo.default.green.close:case jo.default.cyan.close:case jo.default.gray.close:case jo.default.white.close:case jo.default.yellow.close:case jo.default.bgRed.close:case jo.default.bgGreen.close:case jo.default.bgYellow.close:case jo.default.inverse.close:case jo.default.dim.close:case jo.default.bold.close:case jo.default.reset.open:case jo.default.reset.close:return"</>";case jo.default.red.open:return"<red>";case jo.default.green.open:return"<green>";case jo.default.cyan.open:return"<cyan>";case jo.default.gray.open:return"<gray>";case jo.default.white.open:return"<white>";case jo.default.yellow.open:return"<yellow>";case jo.default.bgRed.open:return"<bgRed>";case jo.default.bgGreen.open:return"<bgGreen>";case jo.default.bgYellow.open:return"<bgYellow>";case jo.default.inverse.open:return"<inverse>";case jo.default.dim.open:return"<dim>";case jo.default.bold.open:return"<bold>";default:return""}}),ZJe=e=>typeof e=="string"&&!!e.match((0,XJe.default)());Hg.test=ZJe;const JJe=(e,t,n,r,o,i)=>i(hjt(e),t,n,r,o);Hg.serialize=JJe;const gjt={serialize:JJe,test:ZJe};var mjt=gjt;Hg.default=mjt;var zg={};Object.defineProperty(zg,"__esModule",{value:!0});zg.test=zg.serialize=zg.default=void 0;var Q$e=_v;const yjt=" ",eet=["DOMStringMap","NamedNodeMap"],bjt=/^(HTML\w*Collection|NodeList)$/,Ejt=e=>eet.indexOf(e)!==-1||bjt.test(e),tet=e=>e&&e.constructor&&!!e.constructor.name&&Ejt(e.constructor.name);zg.test=tet;const Sjt=e=>e.constructor.name==="NamedNodeMap",net=(e,t,n,r,o,i)=>{const a=e.constructor.name;return++r>t.maxDepth?"["+a+"]":(t.min?"":a+yjt)+(eet.indexOf(a)!==-1?"{"+(0,Q$e.printObjectProperties)(Sjt(e)?Array.from(e).reduce((l,s)=>(l[s.name]=s.value,l),{}):{...e},t,n,r,o,i)+"}":"["+(0,Q$e.printListItems)(Array.from(e),t,n,r,o,i)+"]")};zg.serialize=net;const wjt={serialize:net,test:tet};var Cjt=wjt;zg.default=Cjt;var Vg={},Rl={},Phe={};Object.defineProperty(Phe,"__esModule",{value:!0});Phe.default=xjt;function xjt(e){return e.replace(/</g,"<").replace(/>/g,">")}Object.defineProperty(Rl,"__esModule",{value:!0});Rl.printText=Rl.printProps=Rl.printElementAsLeaf=Rl.printElement=Rl.printComment=Rl.printChildren=void 0;var ret=Ajt(Phe);function Ajt(e){return e&&e.__esModule?e:{default:e}}const Ojt=(e,t,n,r,o,i,a)=>{const l=r+n.indent,s=n.colors;return e.map(u=>{const c=t[u];let f=a(c,n,l,o,i);return typeof c!="string"&&(f.indexOf(`
|
406
406
|
`)!==-1&&(f=n.spacingOuter+l+f+n.spacingOuter+r),f="{"+f+"}"),n.spacingInner+r+s.prop.open+u+s.prop.close+"="+s.value.open+f+s.value.close}).join("")};Rl.printProps=Ojt;const $jt=(e,t,n,r,o,i)=>e.map(a=>t.spacingOuter+n+(typeof a=="string"?oet(a,t):i(a,t,n,r,o))).join("");Rl.printChildren=$jt;const oet=(e,t)=>{const n=t.colors.content;return n.open+(0,ret.default)(e)+n.close};Rl.printText=oet;const Djt=(e,t)=>{const n=t.colors.comment;return n.open+"<!--"+(0,ret.default)(e)+"-->"+n.close};Rl.printComment=Djt;const Tjt=(e,t,n,r,o)=>{const i=r.colors.tag;return i.open+"<"+e+(t&&i.close+t+r.spacingOuter+o+i.open)+(n?">"+i.close+n+r.spacingOuter+o+i.open+"</"+e:(t&&!r.min?"":" ")+"/")+">"+i.close};Rl.printElement=Tjt;const Pjt=(e,t)=>{const n=t.colors.tag;return n.open+"<"+e+n.close+" …"+n.open+" />"+n.close};Rl.printElementAsLeaf=Pjt;Object.defineProperty(Vg,"__esModule",{value:!0});Vg.test=Vg.serialize=Vg.default=void 0;var tS=Rl;const Rjt=1,iet=3,aet=8,set=11,Ijt=/^((HTML|SVG)\w*)?Element$/,Njt=e=>{try{return typeof e.hasAttribute=="function"&&e.hasAttribute("is")}catch{return!1}},Mjt=e=>{const t=e.constructor.name,{nodeType:n,tagName:r}=e,o=typeof r=="string"&&r.includes("-")||Njt(e);return n===Rjt&&(Ijt.test(t)||o)||n===iet&&t==="Text"||n===aet&&t==="Comment"||n===set&&t==="DocumentFragment"},uet=e=>{var t;return(e==null||(t=e.constructor)===null||t===void 0?void 0:t.name)&&Mjt(e)};Vg.test=uet;function Fjt(e){return e.nodeType===iet}function Bjt(e){return e.nodeType===aet}function wK(e){return e.nodeType===set}const cet=(e,t,n,r,o,i)=>{if(Fjt(e))return(0,tS.printText)(e.data,t);if(Bjt(e))return(0,tS.printComment)(e.data,t);const a=wK(e)?"DocumentFragment":e.tagName.toLowerCase();return++r>t.maxDepth?(0,tS.printElementAsLeaf)(a,t):(0,tS.printElement)(a,(0,tS.printProps)(wK(e)?[]:Array.from(e.attributes).map(l=>l.name).sort(),wK(e)?{}:Array.from(e.attributes).reduce((l,s)=>(l[s.name]=s.value,l),{}),t,n+t.indent,r,o,i),(0,tS.printChildren)(Array.prototype.slice.call(e.childNodes||e.children),t,n+t.indent,r,o,i),t,n)};Vg.serialize=cet;const kjt={serialize:cet,test:uet};var Ljt=kjt;Vg.default=Ljt;var Ug={};Object.defineProperty(Ug,"__esModule",{value:!0});Ug.test=Ug.serialize=Ug.default=void 0;var R4=_v;const jjt="@@__IMMUTABLE_ITERABLE__@@",_jt="@@__IMMUTABLE_LIST__@@",Hjt="@@__IMMUTABLE_KEYED__@@",zjt="@@__IMMUTABLE_MAP__@@",Z$e="@@__IMMUTABLE_ORDERED__@@",Vjt="@@__IMMUTABLE_RECORD__@@",Ujt="@@__IMMUTABLE_SEQ__@@",Wjt="@@__IMMUTABLE_SET__@@",Gjt="@@__IMMUTABLE_STACK__@@",zC=e=>"Immutable."+e,_j=e=>"["+e+"]",I4=" ",J$e="…",Kjt=(e,t,n,r,o,i,a)=>++r>t.maxDepth?_j(zC(a)):zC(a)+I4+"{"+(0,R4.printIteratorEntries)(e.entries(),t,n,r,o,i)+"}";function qjt(e){let t=0;return{next(){if(t<e._keys.length){const n=e._keys[t++];return{done:!1,value:[n,e.get(n)]}}return{done:!0,value:void 0}}}}const Yjt=(e,t,n,r,o,i)=>{const a=zC(e._name||"Record");return++r>t.maxDepth?_j(a):a+I4+"{"+(0,R4.printIteratorEntries)(qjt(e),t,n,r,o,i)+"}"},Xjt=(e,t,n,r,o,i)=>{const a=zC("Seq");return++r>t.maxDepth?_j(a):e[Hjt]?a+I4+"{"+(e._iter||e._object?(0,R4.printIteratorEntries)(e.entries(),t,n,r,o,i):J$e)+"}":a+I4+"["+(e._iter||e._array||e._collection||e._iterable?(0,R4.printIteratorValues)(e.values(),t,n,r,o,i):J$e)+"]"},CK=(e,t,n,r,o,i,a)=>++r>t.maxDepth?_j(zC(a)):zC(a)+I4+"["+(0,R4.printIteratorValues)(e.values(),t,n,r,o,i)+"]",fet=(e,t,n,r,o,i)=>e[zjt]?Kjt(e,t,n,r,o,i,e[Z$e]?"OrderedMap":"Map"):e[_jt]?CK(e,t,n,r,o,i,"List"):e[Wjt]?CK(e,t,n,r,o,i,e[Z$e]?"OrderedSet":"Set"):e[Gjt]?CK(e,t,n,r,o,i,"Stack"):e[Ujt]?Xjt(e,t,n,r,o,i):Yjt(e,t,n,r,o,i);Ug.serialize=fet;const det=e=>e&&(e[jjt]===!0||e[Vjt]===!0);Ug.test=det;const Qjt={serialize:fet,test:det};var Zjt=Qjt;Ug.default=Zjt;var Wg={},nie={exports:{}},Eo={};/** @license React v17.0.2
|
407
407
|
* react-is.production.min.js
|
408
408
|
*
|
package/dist/index.es.js
CHANGED
@@ -40555,9 +40555,9 @@ const YJe = (e) => {
|
|
40555
40555
|
} = e;
|
40556
40556
|
const [D, x] = ke.useState([]), [$, P] = Rn(!1);
|
40557
40557
|
gn(() => {
|
40558
|
-
if (console.log("SearchSelect ".concat(o, " value"), a), a
|
40559
|
-
let z =
|
40560
|
-
z && !Ng.isEqual(z, a) && (console.log("new value /////", z), typeof u == "function" && u(z)), z || N();
|
40558
|
+
if (console.log("SearchSelect ".concat(o, " value"), a), a) {
|
40559
|
+
let z = null;
|
40560
|
+
Array.isArray(D) && D.length > 0 && (z = D.find((j) => j.value == (a == null ? void 0 : a.value) || j.value == a), z && !Ng.isEqual(z, a) && (console.log("new value /////", z), typeof u == "function" && u(z))), z || N();
|
40561
40561
|
}
|
40562
40562
|
}, [a]), gn(() => {
|
40563
40563
|
console.log("SearchSelect useEffect requestParams", m), M(m);
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
import { Input, Select as OriginalSelect, Spin } from 'antd';
|
4
|
-
import React, { useEffect, useState, forwardRef
|
4
|
+
import React, { useEffect, useState, forwardRef, useCallback } from 'react';
|
5
5
|
import { BaseWrapper } from "../base"
|
6
6
|
import { debounce, isEqual } from 'lodash';
|
7
7
|
|
@@ -12,13 +12,15 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
|
|
12
12
|
useEffect(() => {
|
13
13
|
// console.log("SearchSelect useEffect props", props)
|
14
14
|
console.log(`SearchSelect ${fieldName} value`, value)
|
15
|
-
if (value
|
16
|
-
let item =
|
17
|
-
if (
|
18
|
-
|
19
|
-
|
15
|
+
if (value) {
|
16
|
+
let item = null
|
17
|
+
if (Array.isArray(nOptions) && nOptions.length > 0) {
|
18
|
+
item = nOptions.find(item => item.value == value?.value || item.value == value)
|
19
|
+
if (item && !isEqual(item, value)) {
|
20
|
+
console.log("new value /////", item)
|
21
|
+
typeof onChange === 'function' && onChange(item)
|
22
|
+
}
|
20
23
|
}
|
21
|
-
|
22
24
|
// 没有找到与value相等的选项,说明该项数据可能尚未加载,此时需要重新加载数据
|
23
25
|
if (!item) loadSelectOptions()
|
24
26
|
}
|
@@ -51,7 +53,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
|
|
51
53
|
|
52
54
|
const loadSelectOptions = async () => {
|
53
55
|
if (request && option_value) {
|
54
|
-
|
56
|
+
debounceFetchOptions({ ...requestParams, [option_value]: value?.value }, null, (selectOptions) => {
|
55
57
|
console.log("loadSelectOptions selectOptions", selectOptions)
|
56
58
|
if (selectOptions && selectOptions.length > 0) {
|
57
59
|
let item = selectOptions.find(item => item.value == value?.value || item.value == value)
|
@@ -62,7 +64,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
|
|
62
64
|
}
|
63
65
|
}
|
64
66
|
})
|
65
|
-
|
67
|
+
|
66
68
|
}
|
67
69
|
}
|
68
70
|
const initData = async (params) => {
|
@@ -125,7 +127,7 @@ const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsVal
|
|
125
127
|
callback(result);
|
126
128
|
}
|
127
129
|
});
|
128
|
-
}, 200),[])
|
130
|
+
}, 200), [])
|
129
131
|
|
130
132
|
const fetchOptions = async (params, ruleParams) => {
|
131
133
|
try {
|