lu-lowcode-package-form 0.11.85 → 0.11.86

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
@@ -427,7 +427,7 @@ Consider to rely on 'then' or 'done' mode instead.`);w&&(delete c[h],f[h]=S,u.em
427
427
  const __result = `.concat(e.join(""),`;
428
428
  return __result;
429
429
  })()
430
- `),t=new Function("Decimal",n)(ZN),typeof t=="object"&&t!==null||(t=t.toString())}catch(r){console.error("formula (".concat(n,") error"),r)}return t},{primitive:!0,max:1e3,maxAge:1e3*60*1}),Z_t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Dl=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=Z_t[n[e]&63];return t};var bJe={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 h=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],h]:l._events[g].push(h):(l._events[g]=h,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,h=f.length,g=new Array(h);d<h;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,h,g){var m=n?n+u:u;if(!this._events[m])return!1;var p=this._events[m],y=arguments.length,v,b;if(p.fn){switch(p.once&&this.removeListener(u,p.fn,void 0,!0),y){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,f),!0;case 4:return p.fn.call(p.context,c,f,d),!0;case 5:return p.fn.call(p.context,c,f,d,h),!0;case 6:return p.fn.call(p.context,c,f,d,h,g),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];p.fn.apply(p.context,v)}else{var E=p.length,S;for(b=0;b<E;b++)switch(p[b].once&&this.removeListener(u,p[b].fn,void 0,!0),y){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,c);break;case 3:p[b].fn.call(p[b].context,c,f);break;case 4:p[b].fn.call(p[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];p[b].fn.apply(p[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 h=n?n+u:u;if(!this._events[h])return this;if(!c)return a(this,h),this;var g=this._events[h];if(g.fn)g.fn===c&&(!d||g.once)&&(!f||g.context===f)&&a(this,h);else{for(var m=0,p=[],y=g.length;m<y;m++)(g[m].fn!==c||d&&!g[m].once||f&&g[m].context!==f)&&p.push(g[m]);p.length?this._events[h]=p.length===1?p[0]:p:a(this,h)}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})(bJe);var J_t=bJe.exports;const EJe=Ws(J_t),o3=new EJe,eHt=e=>{let{children:t,layout:n,onTableAddRow:r,onTableRemoveRow:o,form:i,initializeFormRender:a,recordFieldsChange:s,mode:l,getTableWithIds:u,removeLastFieldsValues:c,getDependencyMapItem:f,renderKey:d}=e;n=n||"1";const h=v=>{const b=v.split(",").map(Number),E=24;return b.map(S=>S/b.reduce((w,C)=>w+C)*E)},g=Q.useMemo(()=>h(n),[n]),m=v=>{if(typeof f=="function"){const b=f(v);if(b)return b==null?void 0:b.show}return!0},p=Q.useRef({}),y=Q.useMemo(()=>Q.Children.toArray(t).map((v,b)=>{var E,S;const w=v.props,C=(w==null?void 0:w.componentId)||(w==null?void 0:w.__id),x=C;var D=((E=v.type)===null||E===void 0?void 0:E.displayName)||((S=v.props)===null||S===void 0?void 0:S._componentName);x in p.current||(p.current[x]=Dl());const T=((w==null?void 0:w.calcHidden)||!m(x))&&l!="desgin",O=[];if(w!=null&&w.isRequired&&O.push({required:!0,message:"".concat(w.label,"必须填写")}),w!=null&&w.rules)if(Array.isArray(w.rules)){const R=w.rules.join("|");O.push({pattern:new RegExp(R),message:w.rulesFailMessage?w.rulesFailMessage:"".concat(w.label,"格式错误")})}else O.push({pattern:new RegExp(w.rules),message:w.rulesFailMessage?w.rulesFailMessage:"".concat(w.label,"格式错误")});const N=R=>{i.setFieldValue(x,R)};let M=null;return D=="Field.Table"?M=Q.cloneElement(v,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:C,initializeFormRender:a,mode:l,recordFieldsChange:s,getTableWithIds:u,removeLastFieldsValues:c,getDependencyMapItem:f,renderKey:d}):D==="Field.WithSingleSelect"||D==="Field.WithMultipleSelect"||D==="Show.WithTable"?M=He.jsx(bi.Item,{hidden:T,style:{margin:0},shouldUpdate:(R,F)=>{let B=!1;if(Array.isArray(w.filterRules)&&w.filterRules.length>0)for(let k of w.filterRules){if(k.valueType!="variable")continue;let H,z;if(H=R==null?void 0:R[k.value.field_key],z=F==null?void 0:F[k.value.field_key],H!==z){B=!0;break}}return B&&(p.current[x]=Dl()),B},children:R=>{let{getFieldsValue:F}=R;const B=F();let k=Q.cloneElement(v,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:x,onCustomChange:N,fieldsValue:B,initializeFormRender:a,recordFieldsChange:s,getTableWithIds:u,removeLastFieldsValues:c,shouldUpdateKey:p.current[x]});return D==="Show.WithTable"?He.jsx(He.Fragment,{children:k}):He.jsx(bi.Item,{style:{marginBottom:0},label:"",name:x,rules:O,children:k})}}):Q.isValidElement(v)?M=He.jsx(bi.Item,{style:{marginBottom:0},label:"",name:C,rules:O,hidden:T,children:Q.cloneElement(v,{form:i,fieldName:C,initializeFormRender:a,recordFieldsChange:s})},"".concat(C,"-form-item")):M=v,(g==null?void 0:g[b])&&He.jsx(nA,{span:g[b],children:M},b)}),[t,g,d]);return He.jsx(KN,{gutter:24,children:y})},tHt=e=>{let{title:t}=e;return t?He.jsx("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:He.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:t})}):null};function nHt(e,t,n){const r=[];let o=[];const i=(s,l)=>{const u=s-l.length;u>0&&l.push(...new Array(u).fill(Q.createElement("div")))};for(const s of e){var a;const{_componentName:l}=(s==null?void 0:s.props)||{},u=((a=s.type)===null||a===void 0?void 0:a.displayName)||l;u&&u.startsWith("Layout.")?(o.length>0&&(i(t,o),r.push(o),o=[]),r.push([s])):(o.push(s),o.filter(f=>{var d,h,g,m;const p=((d=f.props)===null||d===void 0?void 0:d.componentId)||((h=f.props)===null||h===void 0?void 0:h.__id);return(!n.has(p)||((g=n.get(p))===null||g===void 0?void 0:g.show))&&!(f!=null&&(m=f.props)!==null&&m!==void 0&&m.calcHidden)}).length===t&&(r.push(o),o=[]))}return o.length>0&&(i(t,o),r.push(o)),r}const vpe=Q.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view",denyEdit:i=!1}=e;const[a]=bi.useForm(),s=Q.useRef(null),[l,u]=Q.useState(null),c=Q.useRef(null),f=()=>{const Y=X();_f.isEqual(s.current,Y)||(s.current=Y,u(Y))},d=Q.useRef(0),h=Q.useRef({currentCycleId:0,updatePath:[],MAX_DEPTH:30,startNewCycle:function(){return this.currentCycleId++,this.updatePath=[],this.currentCycleId},addToPath:function(Y){if(this.updatePath.length>=this.MAX_DEPTH){console.warn("依赖路径深度超过限制(".concat(this.MAX_DEPTH,"),可能存在过深嵌套"));return}Y&&this.updatePath.push(Y)},hasCircularDependency:function(Y){return Y?this.updatePath.includes(Y):!1},getCurrentPath:function(){return[...this.updatePath]},finishField:function(){this.updatePath.length>0&&this.updatePath.pop()}});Q.useImperativeHandle(t,()=>({formRef:a,setFieldsValue:Y=>{d.current=1;let q={...Y,__id:Y==null?void 0:Y.id};for(let ne in Y)if(k.current[ne]={name:ne,value:Y[ne]},c.current.has(ne)&&c.current.get(ne).componentName=="Field.Table"&&Array.isArray(Y[ne]))for(let re=0;re<Y[ne].length;re++){const J=Y[ne][re];for(let ae in J)k.current[[ne,re,ae]]={name:[ne,re,ae],value:J[ae]}}a.setFieldsValue(q),i?_():z()},initializeFieldVisibility:Y=>{S(Y)}}),[i]);const g=Q.useCallback(_f.throttle(async()=>{await b(),console.log("initializeDependencyMap"),requestAnimationFrame(()=>{f()})},300),[r,n]);Q.useEffect(()=>(console.log("UseEffect throttledInitializeFormRender"),g(),()=>{g.cancel()}),[r,n]);const m=()=>{g()},p=Q.useRef(null),y=Y=>Array.isArray(Y)?Y.map(q=>typeof q=="string"?q:q.toString()).join("."):Y,v=Y=>{var q;return(q=p.current)===null||q===void 0?void 0:q[y(Y)]},b=async()=>{const Y=[];function q(re){var J,ae;let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;var he=((J=re.type)===null||J===void 0?void 0:J.displayName)||((ae=re.props)===null||ae===void 0?void 0:ae._componentName);const{props:ie}=re;if(he&&(he.startsWith("Field.")||he.startsWith("Layout."))){let fe=(ie==null?void 0:ie.componentId)||(ie==null?void 0:ie.__id),ge=[];if(pe&&pe!==null&&pe!==void 0&&pe.props){var de,me;fe="".concat((pe==null||(de=pe.props)===null||de===void 0?void 0:de.componentId)||(pe==null||(me=pe.props)===null||me===void 0?void 0:me.__id),".").concat(fe)}ie!=null&&ie.withId&&ge.push(ie==null?void 0:ie.withId),ie!=null&&ie.withIds&&(ge=[...ge,...ie==null?void 0:ie.withIds]),Y.push({identifier:fe,withIds:ge,component:re,componentName:he,fillRules:ie==null?void 0:ie.fillRules})}ie!=null&&ie.children&&Q.Children.toArray(ie==null?void 0:ie.children).forEach(ge=>q(ge,he&&he.startsWith("Field.")?re:null))}c.current=new Map,console.log(" fields",Y);const ne=Q.Children.toArray(r);for(let re=0;re<ne.length;re++){const J=ne[re];q(J)}Y.forEach(re=>{const{identifier:J}=re;c.current.set(J,{children:Y.filter(ae=>ae.withIds.some(pe=>pe==J)),show:!0,...re})}),await E()},E=async function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;console.log("initializeFieldVisibility *************************************");const q=a.getFieldsValue();await Promise.all(Array.from(c.current.keys()).map(async ne=>{await w(ne,q,!0)})),Y&&f()},S=_f.debounce(async function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;await E(Y)},100),w=async function(Y,q){let ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(o=="desgin")return console.log("设计模式下不进行字段级联计算"),!1;console.log("handleFieldsWith identifier",Y);let J=!1,ae=[];Array.isArray(Y)&&(ae=[...Y.slice(0,-1)],Y=Y.filter(he=>typeof he=="string").join("."));const pe=re||Y;if(h.current.hasCircularDependency(pe)){const he=h.current.getCurrentPath();return console.log("检测到循环依赖链路: ".concat([...he,pe].join(" -> "))),!1}h.current.addToPath(pe);try{if(console.log("dependencyMap.current",c.current),console.log("dependencyMap.current identifier",Y),c.current.has(Y)){const he=c.current.get(Y),ie=he.children;!ne&&he!==null&&he!==void 0&&he.fillRules&&Array.isArray(he==null?void 0:he.fillRules)&&(he==null?void 0:he.fillRules.length)>0&&O(Y,ae,q,he==null?void 0:he.fillRules);for(let de=0;de<ie.length;de++){const me=ie[de];if(me.component.props.withVisibleFunc&&typeof me.component.props.withVisibleFunc=="function"){let fe=N(q,me,ae);J=J||fe}if(me.component.props.withVisible){let fe=await M(q,me,ae,he==null?void 0:he.componentName);J=J||fe}!ne&&me.component.props.withFill&&await F(q,me,ae,he==null?void 0:he.componentName,pe)}}}finally{h.current.finishField()}return J},C=async function(Y,q){if(o=="desgin")return console.log("设计模式下不进行字段级联计算"),!1;console.log("handleFieldsWithVisibleOnly identifier",Y);let ne=!1,re=[];Array.isArray(Y)&&(re=[...Y.slice(0,-1)],Y=Y.filter(J=>typeof J=="string").join("."));try{if(c.current.has(Y)){const J=c.current.get(Y),ae=J.children;for(let pe=0;pe<ae.length;pe++){const he=ae[pe];if(he.component.props.withVisibleFunc&&typeof he.component.props.withVisibleFunc=="function"){let ie=N(q,he,re);ne=ne||ie}if(he.component.props.withVisible){let ie=await R(q,he,re,J==null?void 0:J.componentName);ne=ne||ie}}}}catch(J){console.log("handleFieldsWithVisibleOnly error",J)}return ne},x=function(Y){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(p.current)if(q){const ne=Object.keys(p.current);for(let re=0;re<ne.length;re++){const J=ne[re];J.includes("".concat(Y,","))&&delete p.current[y(J)]}}else delete p.current[y(Y)]},D=(Y,q)=>{k.current||(k.current={}),k.current[Y]=q},T=function(Y){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.log("recordFieldsChange",Y,q);var ne=Object.keys(Y);ne.length>0&&(ne.forEach(re=>{D(re,Y[re])}),q&&z())},O=(Y,q,ne,re)=>{let J=B("fieldsValue",Y,ne,null),ae={};Array.isArray(Y)&&Y.filter(fe=>typeof fe=="string").join(".");let pe=[];for(let fe=0;fe<re.length;fe++){const ge=re[fe];let{source:Fe,target:Se}=ge,$e=J==null?void 0:J[Fe],Ke=$e;if(Array.isArray(Y)&&Y.filter(Ve=>typeof Ve=="string").join("."),Array.isArray(Se)&&Se.filter(Ve=>typeof Ve=="string").join("."),(ge==null?void 0:ge.type)==1){if(c.current.has(Se)){var he,ie,de;let Me=(he=c.current.get(Se))===null||he===void 0||(ie=he.component)===null||ie===void 0||(de=ie.props)===null||de===void 0?void 0:de.children;Array.isArray(Me)&&Me.length>0&&pe.push(Me.map(Ze=>{var We,rt;return"".concat(Fe,".").concat((Ze==null||(We=Ze.props)===null||We===void 0?void 0:We.componentId)||(Ze==null||(rt=Ze.props)===null||rt===void 0?void 0:rt.__id))}))}if($e&&typeof $e=="string")try{$e=JSON.parse($e)}catch(Me){console.error("error end",Me)}if(!Array.isArray($e))return;Ke=$e.map((Me,Ze)=>{let We={};if(ge!=null&&ge.subRules&&Array.isArray(ge==null?void 0:ge.subRules)&&(ge==null?void 0:ge.subRules.length)>0)for(let rt=0;rt<(ge==null?void 0:ge.subRules.length);rt++){const{source:ze,target:Te}=ge==null?void 0:ge.subRules[rt];We[Te]=Me==null?void 0:Me[ze];let Ie={name:[Se,Ze,Te],value:Me==null?void 0:Me[ze]};ae[Ie.name]=Ie}return We}),x(Se,!0),o3.emit("reloadTable",Se)}else{let Ve=0;if(q&&Array.isArray(q)&&q.length>1&&(q.filter(Me=>typeof Me=="string").join("."),Ve=q[q.length-1],Se=[...q,Se],Array.isArray(J)&&J.length>Ve)){var me;Ke=(me=J[Ve])===null||me===void 0?void 0:me[Fe]}ae[Se]={name:Array.isArray(Se)?Se:[Se],value:Ke}}(ge==null?void 0:ge.type)==1&&(console.log("rule?.type == 1",Se),console.log("rule?.type == 1",Ke),console.log("rule?.type == 1 current_identifier",Y),a.setFieldValue(Se,void 0)),console.log("form.setFieldValue(target, setValue) "+Se,Ke),a.setFieldValue(Se,Ke)}setTimeout(()=>{T(ae,!0),pe.length>0&&pe.forEach(fe=>{Array.isArray(fe)&&fe.length>0&&W(fe)})},0)},N=(Y,q,ne)=>{var re,J;let ae=!1;const pe=q==null||(re=q.component)===null||re===void 0||(J=re.props)===null||J===void 0?void 0:J.withVisibleFunc(Y),he=q==null?void 0:q.identifier;if(c.current.has(he)){const ie=c.current.get(he);ie.show!==pe&&(ie.show=pe,c.current.set(he,ie),ae=!0)}return ae},M=async(Y,q,ne,re)=>{var J,ae;let pe=!1;const he=q==null||(J=q.component)===null||J===void 0?void 0:J.props.withVisible,ie=q==null||(ae=q.component)===null||ae===void 0?void 0:ae.props.withDataFetch;let de=0,me=q.identifier,fe=[];if(he!=null&&he.withData&&(he==null?void 0:he.withData.length)>0&&ie&&typeof ie=="function")for(let Se=0;Se<(he==null?void 0:he.withData.length);Se++){const $e=he==null?void 0:he.withData[Se];let Ke={};Ke.tableName=$e.withTable.table_name,Ke.filter={};for(let Me=0;Me<$e.withCondition.length;Me++){var ge;const{value:Ze,column:We}=$e.withCondition[Me];let rt=B(Ze.group_key,Ze.field_key,Y,fe);Array.isArray(rt)&&Array.isArray(me)&&rt.length>de&&(rt=rt[de]),re=="Field.WithSingleSelect"&&rt&&(ge=rt)!==null&&ge!==void 0&&ge.value&&(rt=rt.value),Ke.filter[We.column_name]=rt}const Ve=await ie(Ke);Ve.code===0&&Ve.data.list&&fe.push({id:$e.id,data:Ve.data.list})}let Fe;if(he.value&&he.value.length>0&&(Fe=he.value.map(Se=>{let $e="";const{insert:Ke,attributes:Ve}=Se;return typeof Ke!="string"?Ke!=null&&Ke.span&&Ve&&Ve.tagKey&&Ve.id&&($e=B(Ve.tagKey,Ve.id,Y,fe),Array.isArray($e)?(Array.isArray(me)&&$e.length>de&&($e=$e[de]),typeof $e=="object"&&$e!==null&&($e=JSON.stringify($e))):typeof $e=="object"&&$e!==null?$e=JSON.stringify($e):$e.length>0&&($e='"'.concat($e,'"'))):$e=Ke,$e})),c.current.has(me)){const Se=c.current.get(me);if(Fe&&Fe.length>0){const $e=aM(Fe)=="true";Se.show!=$e&&(Se.show=$e,c.current.set(me,Se),pe=!0)}}return pe},R=async(Y,q,ne,re)=>{var J;let ae=!1;const pe=q==null||(J=q.component)===null||J===void 0?void 0:J.props.withVisible;let he=0,ie=q.identifier,de=[],me;if(pe.value&&pe.value.length>0&&(me=pe.value.map(fe=>{let ge="";const{insert:Fe,attributes:Se}=fe;return typeof Fe!="string"?Fe!=null&&Fe.span&&Se&&Se.tagKey&&Se.id&&(ge=B(Se.tagKey,Se.id,Y,de),Array.isArray(ge)?(Array.isArray(ie)&&ge.length>he&&(ge=ge[he]),typeof ge=="object"&&ge!==null&&(ge=JSON.stringify(ge))):typeof ge=="object"&&ge!==null?ge=JSON.stringify(ge):ge.length>0&&(ge='"'.concat(ge,'"'))):ge=Fe,ge})),c.current.has(ie)){const fe=c.current.get(ie);if(me&&me.length>0){const ge=aM(me)=="true";console.log("".concat(ie," 只读模式计算公式:"),me),console.log("".concat(ie," 只读模式计算结果:"),ge),fe.show!=ge&&(fe.show=ge,c.current.set(ie,fe),ae=!0)}}return ae},F=async(Y,q,ne,re,J)=>{var ae,pe;console.log("handleFieldsWithFill componentName",re);const he=q==null||(ae=q.component)===null||ae===void 0?void 0:ae.props.withFill,ie=q==null||(pe=q.component)===null||pe===void 0?void 0:pe.props.withDataFetch;let de=0,me="",fe=q.identifier;if(ne&&Array.isArray(ne)&&ne.length>1)me=ne.filter(Se=>typeof Se=="string").join("."),de=ne[ne.length-1],fe.startsWith("".concat(me,"."))&&(fe=[...ne,fe.replace("".concat(me,"."),"")]);else if(fe.indexOf(".")>=0){fe=fe.split(".");let Se=B("fieldsValue",fe[0],Y,[]);if(Array.isArray(Se)&&Se.length>0)for(let $e=0;$e<Se.length;$e++)await F(Y,q,[fe[0],$e],re);return}const ge=Array.isArray(fe)?fe.join("."):fe;if(h.current.hasCircularDependency(ge)){const Se=h.current.getCurrentPath();console.log("检测到公式计算中的循环依赖链路: ".concat([...Se,ge].join(" -> ")));return}try{let Se=[];if(he!=null&&he.withData&&(he==null?void 0:he.withData.length)>0&&ie&&typeof ie=="function")for(let Ke=0;Ke<(he==null?void 0:he.withData.length);Ke++){const Ve=he==null?void 0:he.withData[Ke];let Me={};Me.tableName=Ve.withTable.table_name,Me.filter={};for(let We=0;We<Ve.withCondition.length;We++){var Fe;const{value:rt,column:ze}=Ve.withCondition[We];let Te=B(rt.group_key,rt.field_key,Y,Se);if(Array.isArray(Te)&&Array.isArray(fe)&&Te.length>de&&(Te=Te[de]),Te&&typeof Te=="string")try{Te=JSON.parse(Te)}catch{}(Fe=Te)!==null&&Fe!==void 0&&Fe.value&&(Te=Te.value),Me.filter[ze.column_name]=Te}const Ze=await ie(Me);Ze.code===0&&Ze.data.list&&Se.push({id:Ve.id,data:Ze.data.list})}let $e;if(he.value&&he.value.length>0&&($e=he.value.map(Ke=>{let Ve="";const{insert:Me,attributes:Ze}=Ke;return typeof Me!="string"?Me!=null&&Me.span&&Ze&&Ze.tagKey&&Ze.id&&(Ve=B(Ze.tagKey,Ze.id,Y,Se),Array.isArray(Ve)?(Array.isArray(fe)&&Ve.length>de&&(Ve=Ve[de]),typeof Ve=="object"&&Ve!==null&&(Ve=JSON.stringify(Ve))):typeof Ve=="object"&&Ve!==null?Ve=JSON.stringify(Ve):Ve.length>0&&(Ve='"'.concat(Ve,'"'))):Ve=Me,Ve})),$e&&$e.length>0){const Ke=aM($e);console.log("".concat(fe," 计算公式:"),$e),console.log("".concat(fe," 计算结果:"),Ke),a.setFieldValue(fe,Ke),await w(fe,a.getFieldsValue(),!1,ge)}}finally{}},B=(Y,q,ne,re)=>{let J="";if(Y=="fieldsValue"){var ae;if(q.indexOf(".")>=0){var pe;const[de,me]=q.split("."),fe=(ne==null?void 0:ne[de])||[];Array.isArray(fe)?J=fe.map(ge=>{var Fe;return(Fe=ge==null?void 0:ge[me])!==null&&Fe!==void 0?Fe:""}):J=(pe=fe==null?void 0:fe[me])!==null&&pe!==void 0?pe:""}else J=(ae=ne==null?void 0:ne[q])!==null&&ae!==void 0?ae:""}else{let de=re.find(me=>me.id===Y);if(de&&de.data&&de.data.length>0){var he,ie;J=(he=(ie=de.data[0])===null||ie===void 0?void 0:ie[q])!==null&&he!==void 0?he:""}}return J},k=Q.useRef({});Q.useRef({});const H=Q.useRef(null),z=Q.useCallback(()=>{H.current&&clearTimeout(H.current);const Y=d.current===1?500:100;H.current=setTimeout(async()=>{h.current.startNewCycle();const q={...k.current};k.current={};const ne=a.getFieldsValue(),re=d.current;d.current=0;let J=!1;p.current||(p.current={});const ae=new Set;for(let pe in q)try{let he=q[pe];if(!_f.isEqual(he.value||"",v(he.name)||"")){if(re!=1){const ie=Array.isArray(he.name)?he.name.map(me=>typeof me=="string"?me:me.toString()).join("."):he.name;if(ae.has(ie)){console.log("跳过已处理的字段 processedFields",ie);continue}ae.add(ie);let de=await w(he.name,ne,!1,ie);J=J||de}p.current[y(he.name)]=he.value}}catch(he){console.log("debounceHandleFieldsChange error",he)}J&&(console.log("needRefresh",J),f())},Y)},[i]),_=Q.useCallback(()=>{H.current&&clearTimeout(H.current);const Y=50;H.current=setTimeout(async()=>{const q={...k.current};k.current={};const ne=a.getFieldsValue();let re=!1;p.current||(p.current={});const J=new Set;for(let ae in q)try{let pe=q[ae];if(!_f.isEqual(pe.value||"",v(pe.name)||"")){const he=Array.isArray(pe.name)?pe.name.map(de=>typeof de=="string"?de:de.toString()).join("."):pe.name;if(J.has(he)){console.log("跳过已处理的字段 processedFields",he);continue}J.add(he);let ie=await C(pe.name,ne,!1,he);re=re||ie,p.current[y(pe.name)]=pe.value}}catch(pe){console.log("debounceHandleFieldsChange_ReadOnly error",pe)}re&&(console.log("needRefresh (ReadOnly mode)",re),f())},Y)},[i]),P=Q.useCallback(Y=>{},[]),L=Q.useCallback((Y,q)=>{console.log("handleValuesChange changedValues",JSON.stringify(Y));const ne=function(J){let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const pe=[];for(let he in J){const ie=J[he],de=[...ae,he];Array.isArray(ie)?ie.forEach((me,fe)=>{if(typeof me=="object"&&me!==null){const ge=ne(me,[...de,fe]);pe.push(...ge)}else pe.push({touched:!0,validating:!1,errors:[],warnings:[],name:[...de,fe],validated:!1,value:me})}):pe.push({touched:!0,validating:!1,errors:[],warnings:[],name:de,validated:!1,value:ie})}return pe},re=ne(Y);console.log("handleValuesChange converted to fields format",JSON.stringify(re)),re.length>0&&(re.forEach(J=>{J.name&&J.name.length>0&&(k.current[J.name]=J)}),console.log("handleValuesChange changedFieldsState",JSON.parse(JSON.stringify(k.current))),i?_():z())},[i]),j=Y=>{let q=[];return Y.forEach(ne=>{if(!c.current.has(ne))return;let re=c.current.get(ne);re.withIds.length<=0||q.push(...re.withIds.filter(J=>!q.includes(J)))}),q=q.filter(ne=>{var re=a.getFieldValue(ne);return!(typeof re!="number"&&!re)}),q},W=Y=>{let q=j(Y);const ne=a.getFieldsValue();setTimeout(async()=>{for(let re=0;re<q.length;re++){const J=q[re];await w(J,ne)}},0)},K=async Y=>{const q=a.getFieldsValue();setTimeout(async()=>{for(let ne=0;ne<Y.length;ne++){const re=Y[ne];await w(re,q)}},0)},U=Q.useRef({}),G=Y=>c.current&&c.current.has(Y)?c.current.get(Y):null,X=()=>(console.log("memoizedRenderChildren",c.current),c.current?Z():null),Z=()=>{console.log("renderChildren");const Y=Dl(),q=Q.Children.toArray(r);return console.log("childrenArray",q),nHt(q,n,c.current).map((re,J)=>He.jsx(KN,{gutter:[24,24],children:re.map((ae,pe)=>{var he,ie;const{componentId:de,__id:me,_componentName:fe,...ge}=ae.props,Fe=((he=ae.type)===null||he===void 0?void 0:he.displayName)||fe,Se=de||me;Se in U.current||(U.current[Se]=Dl());const $e=Fe&&Fe.startsWith("Layout."),Ke=Fe&&Fe=="Field.Table",Ve=!c.current.has(Se)||((ie=c.current.get(Se))===null||ie===void 0?void 0:ie.show),Me=(ge.calcHidden||!Ve)&&o!="desgin",Ze=[];if(ge.isRequired&&Ze.push({required:!0,message:"".concat(ge.label,"必须填写")}),ge.rules)if(Array.isArray(ge.rules)){const ze=ge.rules.join("|");Ze.push({pattern:new RegExp(ze),message:ge.rulesFailMessage?ge.rulesFailMessage:"".concat(ge.label,"格式错误")})}else Ze.push({pattern:new RegExp(ge.rules),message:ge.rulesFailMessage?ge.rulesFailMessage:"".concat(ge.label,"格式错误")});const We=ze=>{a.setFieldValue(Se,ze)};let rt;return Ke||$e?rt=Q.cloneElement(ae,{onTableAddRow:W,getTableWithIds:j,onTableRemoveRow:K,removeLastFieldsValues:x,form:a,fieldName:Se,onCustomChange:We,initializeFormRender:m,mode:o,recordFieldsChange:T,getDependencyMapItem:G,renderKey:Y}):Fe==="Field.WithSingleSelect"||Fe==="Field.WithMultipleSelect"||Fe==="Show.WithTable"?rt=He.jsx(bi.Item,{hidden:Me,style:{margin:0},shouldUpdate:(ze,Te)=>{let Ie=!1;if(Array.isArray(ge.filterRules)&&ge.filterRules.length>0)for(let Ye of ge.filterRules){if(Ye.valueType!="variable")continue;let Be,Ge;if(Be=ze==null?void 0:ze[Ye.value.field_key],Ge=Te==null?void 0:Te[Ye.value.field_key],Be!==Ge){Ie=!0;break}}return Ie&&(U.current[Se]=Dl(),console.log(Se,Dl())),Ie},children:ze=>{let{getFieldsValue:Te}=ze;const Ie=Te();let Ye=Q.cloneElement(ae,{onTableAddRow:W,onTableRemoveRow:K,removeLastFieldsValues:x,form:a,fieldName:Se,onCustomChange:We,fieldsValue:Ie,initializeFormRender:m,recordFieldsChange:T,shouldUpdateKey:U.current[Se]});return Fe==="show.WithTable"?He.jsx(He.Fragment,{children:Ye}):He.jsx(bi.Item,{style:{marginBottom:0},label:"",name:Se,rules:Ve?Ze:[],children:Ye})}}):rt=He.jsx(bi.Item,{hidden:Me,style:{marginBottom:0},label:"",name:Se,rules:Ve?Ze:[],children:Q.cloneElement(ae,{form:a,fieldName:Se,onCustomChange:We,initializeFormRender:m,recordFieldsChange:T,removeLastFieldsValues:x})}),He.jsx(nA,{span:Me?0:$e?24:24/n,style:{marginBottom:0},children:rt},Se||"col-".concat(pe))})},"row-".concat(J)))};return He.jsx(Od,{theme:{components:{Table:{rowHoverBg:"#ebebeb"}},token:{colorBgContainerDisabled:"rgba(0, 0, 0, 0.02)",colorTextDisabled:"#333"}},children:He.jsxs(bi,{form:a,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col "+(o=="desgin"?" fp-6":""),onFieldsChange:P,onValuesChange:L,children:[He.jsx(bi.Item,{name:"__id",hidden:!0,children:He.jsx("input",{type:"hidden"})}),l]})})});function rHt(e){return Q.forwardRef((t,n)=>He.jsx(e,{...t,ref:n,forwardedRef:n}))}class Clr extends Q.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return He.jsx(vpe,{...n,ref:t})}}const oHt=rHt(e=>{let{forwardedRef:t,...n}=e;return He.jsx(vpe,{...n,ref:t})});function iHt(e,t,n){const r=[];let o=[];const i=(a,s)=>{for(;s.length<a;)s.push(He.jsx("div",{},Dl()))};return e.forEach(a=>{var s,l;const u=((s=a.type)===null||s===void 0?void 0:s.displayName)||((l=a.props)===null||l===void 0?void 0:l._componentName);u&&u.startsWith("Layout.")?(o.length>0&&(i(t,o),r.push(o),o=[]),r.push([a])):(o.push(a),o.filter(f=>{var d,h,g,m;const p=((d=f.props)===null||d===void 0?void 0:d.componentId)||((h=f.props)===null||h===void 0?void 0:h.__id);return(!(n!=null&&n.has(p))||((g=n.get(p))===null||g===void 0?void 0:g.show))&&!((m=f.props)!==null&&m!==void 0&&m.calcHidden)}).length===t&&(r.push(o),o=[]))}),o.length>0&&(i(t,o),r.push(o)),r}const aHt=e=>{const t=new Map,n=[],r=function(o){var i,a;let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const l=((i=o.type)===null||i===void 0?void 0:i.displayName)||((a=o.props)===null||a===void 0?void 0:a._componentName),{props:u}=o;if(l&&(l.startsWith("Field.")||l.startsWith("Layout."))){let c=(u==null?void 0:u.componentId)||(u==null?void 0:u.__id);s&&(c="".concat(s,".").concat(c));const f=u.withId?[u.withId]:u.withIds?[...u.withIds]:[];n.push({identifier:c,withIds:f,compName:l,fillRules:u==null?void 0:u.fillRules,visibleFunc:u==null?void 0:u.withVisibleFunc})}u!=null&&u.children&&Q.Children.forEach(u.children,c=>{r(c,l&&l.startsWith("Field.")?(u==null?void 0:u.componentId)||(u==null?void 0:u.__id):"")})};return Q.Children.forEach(e,o=>r(o)),n.forEach(o=>{t.set(o.identifier,{...o,show:!0,children:n.filter(i=>i.withIds.includes(o.identifier))})}),t},sHt=function(e,t,n){if(!t.has(e))return!1;const r=t.get(e);if(r.visibleFunc&&typeof r.visibleFunc=="function"){const o=r.visibleFunc(n);if(r.show!==o)return r.show=o,!0}if(r.fillRules&&Array.isArray(r.fillRules)&&r.fillRules.length>0){const o=r.fillRules.map(a=>typeof a=="string"?a:""),i=aM(o)==="true";if(r.show!==i)return r.show=i,!0}return!1},lHt=Q.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=bi.useForm(),[a,s]=Q.useState(null),l=Q.useRef(new Map),u=Q.useRef({}),c=Q.useRef({}),f=Q.useCallback(()=>{l.current=aHt(r)},[r]),d=Q.useCallback(()=>{const p=i.getFieldsValue();let y=!1;l.current.forEach((v,b)=>{const E=sHt(b,l.current,p);y=y||E}),y&&s(m())},[i]),h=Q.useCallback(_f.debounce(()=>{const p=i.getFieldsValue();Object.keys(c.current).forEach(y=>{c.current[y]!==p[y]&&(u.current[y]=p[y])}),c.current={},d()},200),[i,d]),g=function(){for(var p=arguments.length,y=new Array(p),v=0;v<p;v++)y[v]=arguments[v];let[,b]=y;Object.assign(c.current,b),h()},m=Q.useCallback(()=>{const p=Q.Children.toArray(r);return iHt(p,n,l.current).map((v,b)=>He.jsx(KN,{gutter:[24,24],children:v.map((E,S)=>{var w,C;const{componentId:x,__id:D,_componentName:T,calcHidden:O,...N}=E.props,M=((w=E.type)===null||w===void 0?void 0:w.displayName)||T,R=x||D,F=Dl(),B=M&&M.startsWith("Layout."),k=!l.current.has(R)||((C=l.current.get(R))===null||C===void 0?void 0:C.show),H=(O||!k)&&o!=="desgin",z=[];if(N.isRequired&&z.push({required:!0,message:"".concat(N.label,"必须填写")}),N.rules){const P=Array.isArray(N.rules)&&N.rules.length>0?N.rules.join("|"):N.rules;z.push({pattern:new RegExp(P),message:N.rulesFailMessage||"".concat(N.label,"格式错误")})}let _=null;return B?_=Q.cloneElement(E,{form:i,fieldName:R,updateKey:F}):_=He.jsx(bi.Item,{hidden:H,label:N.label||"",name:R,rules:k?z:[],children:Q.cloneElement(E,{form:i,fieldName:R,updateKey:F})}),He.jsx(nA,{span:H?0:B?24:24/n,children:_},R||"col-".concat(S))})},"row-".concat(b)))},[r,n,i,o]);return Q.useEffect(()=>{f(),s(m())},[f,m]),Q.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:p=>{i.setFieldsValue(p),h()},refreshDependencies:()=>{f(),d()}})),He.jsxs(bi,{form:i,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col fgap-y-2".concat(o==="desgin"?" fp-6":""),onValuesChange:g,children:[He.jsx(bi.Item,{name:"__id",hidden:!0,children:He.jsx("input",{type:"hidden"})}),a]})}),uHt=e=>{let{request:t,value:n,onChange:r,callError:o,disabledValue:i,addRoot:a=!0,title:s,...l}=e;const[u,c]=Q.useState(!1),[f,d]=Q.useState([]);Q.useEffect(()=>{h()},[]),Q.useEffect(()=>{if(typeof n=="string")try{n=JSON.parse(n),r(n)}catch{}Array.isArray(n)&&y(n)},[n]);const h=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 O=jZe(((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&&(O=[{value:0,title:"根节点",children:O}]),l.treeData=O,console.log("treeData",O),d(O)}l.treeData&&d(l.treeData),c(!0)},[g,m]=Q.useState([]),[p,y]=Q.useState([]),[v,b]=Q.useState([]),[E,S]=Q.useState(!0),w=D=>{console.log("onExpand",D),m(D),S(!1)},C=D=>{console.log("onCheck",D),y(D),r(D)},x=(D,T)=>{console.log("onSelect",T),b(D)};return He.jsx(Bi,{...l,children:He.jsx(npe,{checkable:!0,onExpand:w,onCheck:C,onSelect:x,expandedKeys:g,autoExpandParent:E,checkedKeys:p,selectedKeys:v,treeData:f})})},cHt=e=>He.jsx(Bi,{...e,children:He.jsx(WN,{...e})}),fHt=e=>He.jsx(Bi,{...e,children:He.jsx(WN.Group,{...e})}),dHt=e=>He.jsx(Bi,{...e,children:He.jsx(v_.Group,{...e})}),SJe=e=>{let{value:t,maxCount:n,multiple:r,onChange:o,...i}=e;Q.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]=Q.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 He.jsx($_,{...i,listType:"text",multiple:r,onChange:l,maxCount:n,fileList:a,children:!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&a.length<n&&He.jsx(fu,{type:(i==null?void 0:i.type)||"default",icon:(i==null?void 0:i.icon)||He.jsx(kZe,{}),children:"点击上传文件"})})};SJe.displayName="UploadFile";const hHt=e=>He.jsx(Bi,{...e,children:He.jsx(SJe,{...e})}),wJe=e=>{let{maxCount:t,value:n,multiple:r,onChange:o,...i}=e;Q.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(x=>x.uid===C.uid);!E||(E.version||0)<(C.version||0)?S.push(C):S.push(E)}s(S)}},[n]),t=t||99,r=r||!0;const[a,s]=Q.useState([]),[l,u]=Q.useState(""),[c,f]=Q.useState(0),[d,h]=Q.useState(!1),g=Q.useRef([]),m=E=>new Promise((S,w)=>{const C=new FileReader;C.readAsDataURL(E),C.onload=()=>S(C.result),C.onerror=x=>w(x)}),p=async(E,S)=>{!E.url&&!E.preview&&(E.preview=await m(E.originFileObj)),u(E.url||E.preview),f(S),h(!0)},y=async(E,S)=>{i!=null&&i.disabled||s(a.filter((w,C)=>C!==S))},v=He.jsx(He.Fragment,{children:He.jsxs("div",{className:"fw-full fh-full fflex fflex-col fitems-center fjustify-center fborder fborder-dashed fcursor-pointer frounded",children:[He.jsx(BZe,{}),He.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 x=g.current.find(T=>T.uid===C.uid);console.log("oldfile",JSON.parse(JSON.stringify(x||{}))),x&&x.status!="uploading"?w.push(x):(C.status=="done"&&C.response&&(C.url=C.response),w.push(C))}g.current=w,s(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 He.jsxs(He.Fragment,{children:[He.jsx("div",{className:"fflex fgap-3 fflex-wrap",children:He.jsx($_,{...i,itemRender:(E,S,w)=>{console.log("file",S);let C=w.findIndex(x=>x.uid===S.uid);return He.jsx(He.Fragment,{children:He.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:[He.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"&&He.jsx(LZe,{onClick:()=>{p(S,C)},className:"hover:ftext-gray-200"}),!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&He.jsx(lpe,{onClick:()=>{y(S,C)},className:"hover:ftext-gray-200"})]}),S.status=="uploading"&&He.jsx("div",{className:" fw-full fh-full fflex fitems-center fjustify-center fabsolute ftop-0 fleft-0 ",children:He.jsx(xT,{})}),He.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:p,onChange:b,maxCount:t,children:a.length>=t||i!=null&&i.disabled||i!=null&&i.readonly?null:v})}),l&&He.jsx(G9.PreviewGroup,{preview:{visible:d,current:c,onVisibleChange:E=>h(E),onChange:E=>{f(E)}},children:a.map((E,S)=>He.jsx(He.Fragment,{children:He.jsx(G9,{wrapperStyle:{display:"none"},src:E.url})}))})]})};wJe.displayName="UploadImage";const pHt=e=>He.jsx(Bi,{...e,children:He.jsx(wJe,{...e})}),vHt=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)),He.jsx(Bi,{...i,children:He.jsx(Xhe,{...i,onChange:n,value:t})})};var gHt={exports:{}};(function(e,t){(function(n,r){e.exports=r(wYe)})(Er,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})})(gHt);var mHt={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 yHt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},CJe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},mHt),timePickerLocale:Object.assign({},yHt)};CJe.lang.ok="确定";var xJe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Er,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}}})})(xJe);var bHt=xJe.exports;const EHt=Ws(bHt);Ra.extend(EHt);Ra.extend(TYe);Ra.updateLocale("zh-cn",{weekStart:0});const SHt=e=>{let{datetype:t,value:n,defaultNow:r,onChange:o,...i}=e;t=t||"date";const[a,s]=Q.useState(i==null?void 0:i.picker),[l,u]=Q.useState(i==null?void 0:i.format),[c,f]=Q.useState(!1),[d,h]=Q.useState(!1),g=Q.useRef(!1);Q.useEffect(()=>{if(r&&!n){const p=Ra().format("YYYY-MM-DD HH:mm:ss");typeof o=="function"&&o(p);return}},[]);const m=(p,y)=>{g.current=!0,o(y)};return Q.useEffect(()=>{switch(s("date"),f(!1),t){case"date":s("date"),u("YYYY-MM-DD"),h(!1);break;case"datetime":f(!0),s("datetime"),u("YYYY-MM-DD HH:mm:ss"),h(!0);break;case"month":s("month"),h(!1);break;case"year":s("year"),h(!1);break}},[t]),He.jsx(Bi,{...i,children:He.jsx(rA,{locale:CJe,...i,picker:a,format:l,style:{width:"100%"},onChange:m,value:n&&Ra(n).isValid()?Ra(n):void 0,showTime:c,needConfirm:d})})};var gpe={exports:{}},JN={},L_={exports:{}},AJe={},Ure={exports:{}},sP={exports:{}},Io={};/** @license React v16.13.1
430
+ `),t=new Function("Decimal",n)(ZN),typeof t=="object"&&t!==null||(t=t.toString())}catch(r){console.error("formula (".concat(n,") error"),r)}return t},{primitive:!0,max:1e3,maxAge:1e3*60*1}),Z_t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Dl=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=Z_t[n[e]&63];return t};var bJe={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 h=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],h]:l._events[g].push(h):(l._events[g]=h,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,h=f.length,g=new Array(h);d<h;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,h,g){var m=n?n+u:u;if(!this._events[m])return!1;var p=this._events[m],y=arguments.length,v,b;if(p.fn){switch(p.once&&this.removeListener(u,p.fn,void 0,!0),y){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,f),!0;case 4:return p.fn.call(p.context,c,f,d),!0;case 5:return p.fn.call(p.context,c,f,d,h),!0;case 6:return p.fn.call(p.context,c,f,d,h,g),!0}for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];p.fn.apply(p.context,v)}else{var E=p.length,S;for(b=0;b<E;b++)switch(p[b].once&&this.removeListener(u,p[b].fn,void 0,!0),y){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,c);break;case 3:p[b].fn.call(p[b].context,c,f);break;case 4:p[b].fn.call(p[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];p[b].fn.apply(p[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 h=n?n+u:u;if(!this._events[h])return this;if(!c)return a(this,h),this;var g=this._events[h];if(g.fn)g.fn===c&&(!d||g.once)&&(!f||g.context===f)&&a(this,h);else{for(var m=0,p=[],y=g.length;m<y;m++)(g[m].fn!==c||d&&!g[m].once||f&&g[m].context!==f)&&p.push(g[m]);p.length?this._events[h]=p.length===1?p[0]:p:a(this,h)}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})(bJe);var J_t=bJe.exports;const EJe=Ws(J_t),o3=new EJe,eHt=e=>{let{children:t,layout:n,onTableAddRow:r,onTableRemoveRow:o,form:i,initializeFormRender:a,recordFieldsChange:s,mode:l,getTableWithIds:u,removeLastFieldsValues:c,getDependencyMapItem:f,renderKey:d}=e;n=n||"1";const h=v=>{const b=v.split(",").map(Number),E=24;return b.map(S=>S/b.reduce((w,C)=>w+C)*E)},g=Q.useMemo(()=>h(n),[n]),m=v=>{if(typeof f=="function"){const b=f(v);if(b)return b==null?void 0:b.show}return!0},p=Q.useRef({}),y=Q.useMemo(()=>Q.Children.toArray(t).map((v,b)=>{var E,S;const w=v.props,C=(w==null?void 0:w.componentId)||(w==null?void 0:w.__id),x=C;var D=((E=v.type)===null||E===void 0?void 0:E.displayName)||((S=v.props)===null||S===void 0?void 0:S._componentName);x in p.current||(p.current[x]=Dl());const T=((w==null?void 0:w.calcHidden)||!m(x))&&l!="desgin",O=[];if(w!=null&&w.isRequired&&O.push({required:!0,message:"".concat(w.label,"必须填写")}),w!=null&&w.rules)if(Array.isArray(w.rules)){const R=w.rules.join("|");O.push({pattern:new RegExp(R),message:w.rulesFailMessage?w.rulesFailMessage:"".concat(w.label,"格式错误")})}else O.push({pattern:new RegExp(w.rules),message:w.rulesFailMessage?w.rulesFailMessage:"".concat(w.label,"格式错误")});const N=R=>{i.setFieldValue(x,R)};let M=null;return D=="Field.Table"?M=Q.cloneElement(v,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:C,initializeFormRender:a,mode:l,recordFieldsChange:s,getTableWithIds:u,removeLastFieldsValues:c,getDependencyMapItem:f,renderKey:d}):D==="Field.WithSingleSelect"||D==="Field.WithMultipleSelect"||D==="Show.WithTable"?M=He.jsx(bi.Item,{hidden:T,style:{margin:0},shouldUpdate:(R,F)=>{let B=!1;if(Array.isArray(w.filterRules)&&w.filterRules.length>0)for(let k of w.filterRules){if(k.valueType!="variable")continue;let H,z;if(H=R==null?void 0:R[k.value.field_key],z=F==null?void 0:F[k.value.field_key],H!==z){B=!0;break}}return B&&(p.current[x]=Dl()),B},children:R=>{let{getFieldsValue:F}=R;const B=F();let k=Q.cloneElement(v,{onTableAddRow:r,onTableRemoveRow:o,form:i,fieldName:x,onCustomChange:N,fieldsValue:B,initializeFormRender:a,recordFieldsChange:s,getTableWithIds:u,removeLastFieldsValues:c,shouldUpdateKey:p.current[x]});return D==="Show.WithTable"?He.jsx(He.Fragment,{children:k}):He.jsx(bi.Item,{style:{marginBottom:0},label:"",name:x,rules:O,children:k})}}):Q.isValidElement(v)?M=He.jsx(bi.Item,{style:{marginBottom:0},label:"",name:C,rules:O,hidden:T,children:Q.cloneElement(v,{form:i,fieldName:C,initializeFormRender:a,recordFieldsChange:s})},"".concat(C,"-form-item")):M=v,(g==null?void 0:g[b])&&He.jsx(nA,{span:g[b],children:M},b)}),[t,g,d]);return He.jsx(KN,{gutter:24,children:y})},tHt=e=>{let{title:t}=e;return t?He.jsx("div",{className:"fh-11 fflex fitems-center ftext-lg ffont-medium ",children:He.jsx("span",{className:"fborder-l-4 fborder-slate-300 fpl-2 ",children:t})}):null};function nHt(e,t,n){const r=[];let o=[];const i=(s,l)=>{const u=s-l.length;u>0&&l.push(...new Array(u).fill(Q.createElement("div")))};for(const s of e){var a;const{_componentName:l}=(s==null?void 0:s.props)||{},u=((a=s.type)===null||a===void 0?void 0:a.displayName)||l;u&&u.startsWith("Layout.")?(o.length>0&&(i(t,o),r.push(o),o=[]),r.push([s])):(o.push(s),o.filter(f=>{var d,h,g,m;const p=((d=f.props)===null||d===void 0?void 0:d.componentId)||((h=f.props)===null||h===void 0?void 0:h.__id);return(!n.has(p)||((g=n.get(p))===null||g===void 0?void 0:g.show))&&!(f!=null&&(m=f.props)!==null&&m!==void 0&&m.calcHidden)}).length===t&&(r.push(o),o=[]))}return o.length>0&&(i(t,o),r.push(o)),r}const vpe=Q.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view",denyEdit:i=!1}=e;const[a]=bi.useForm(),s=Q.useRef(null),[l,u]=Q.useState(null),c=Q.useRef(null),f=()=>{const Y=X();_f.isEqual(s.current,Y)||(s.current=Y,u(Y))},d=Q.useRef(0),h=Q.useRef({currentCycleId:0,updatePath:[],MAX_DEPTH:30,startNewCycle:function(){return this.currentCycleId++,this.updatePath=[],this.currentCycleId},addToPath:function(Y){if(this.updatePath.length>=this.MAX_DEPTH){console.warn("依赖路径深度超过限制(".concat(this.MAX_DEPTH,"),可能存在过深嵌套"));return}Y&&this.updatePath.push(Y)},hasCircularDependency:function(Y){return Y?this.updatePath.includes(Y):!1},getCurrentPath:function(){return[...this.updatePath]},finishField:function(){this.updatePath.length>0&&this.updatePath.pop()}});Q.useImperativeHandle(t,()=>({formRef:a,setFieldsValue:Y=>{d.current=1;let q={...Y,__id:Y==null?void 0:Y.id};for(let ne in Y)if(k.current[ne]={name:ne,value:Y[ne]},c.current.has(ne)&&c.current.get(ne).componentName=="Field.Table"&&Array.isArray(Y[ne]))for(let re=0;re<Y[ne].length;re++){const J=Y[ne][re];for(let ae in J)k.current[[ne,re,ae]]={name:[ne,re,ae],value:J[ae]}}a.setFieldsValue(q),i?_():z()},initializeFieldVisibility:Y=>{S(Y)}}),[i]);const g=Q.useCallback(_f.throttle(async()=>{await b(),console.log("initializeDependencyMap"),requestAnimationFrame(()=>{f()})},300),[r,n]);Q.useEffect(()=>(console.log("UseEffect throttledInitializeFormRender"),g(),()=>{g.cancel()}),[r,n]);const m=()=>{g()},p=Q.useRef(null),y=Y=>Array.isArray(Y)?Y.map(q=>typeof q=="string"?q:q.toString()).join("."):Y,v=Y=>{var q;return(q=p.current)===null||q===void 0?void 0:q[y(Y)]},b=async()=>{const Y=[];function q(re){var J,ae;let pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;var he=((J=re.type)===null||J===void 0?void 0:J.displayName)||((ae=re.props)===null||ae===void 0?void 0:ae._componentName);const{props:ie}=re;if(he&&(he.startsWith("Field.")||he.startsWith("Layout."))){let fe=(ie==null?void 0:ie.componentId)||(ie==null?void 0:ie.__id),ge=[];if(pe&&pe!==null&&pe!==void 0&&pe.props){var de,me;fe="".concat((pe==null||(de=pe.props)===null||de===void 0?void 0:de.componentId)||(pe==null||(me=pe.props)===null||me===void 0?void 0:me.__id),".").concat(fe)}ie!=null&&ie.withId&&ge.push(ie==null?void 0:ie.withId),ie!=null&&ie.withIds&&(ge=[...ge,...ie==null?void 0:ie.withIds]),Y.push({identifier:fe,withIds:ge,component:re,componentName:he,fillRules:ie==null?void 0:ie.fillRules})}ie!=null&&ie.children&&Q.Children.toArray(ie==null?void 0:ie.children).forEach(ge=>q(ge,he&&he.startsWith("Field.")?re:null))}c.current=new Map,console.log(" fields",Y);const ne=Q.Children.toArray(r);for(let re=0;re<ne.length;re++){const J=ne[re];q(J)}Y.forEach(re=>{const{identifier:J}=re;c.current.set(J,{children:Y.filter(ae=>ae.withIds.some(pe=>pe==J)),show:!0,...re})}),await E()},E=async function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;console.log("initializeFieldVisibility *************************************");const q=a.getFieldsValue();await Promise.all(Array.from(c.current.keys()).map(async ne=>{await w(ne,q,!0)})),Y&&f()},S=_f.debounce(async function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;await E(Y)},100),w=async function(Y,q){let ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(o=="desgin")return console.log("设计模式下不进行字段级联计算"),!1;console.log("handleFieldsWith identifier",Y);let J=!1,ae=[];Array.isArray(Y)&&(ae=[...Y.slice(0,-1)],Y=Y.filter(he=>typeof he=="string").join("."));const pe=re||Y;if(h.current.hasCircularDependency(pe)){const he=h.current.getCurrentPath();return console.log("检测到循环依赖链路: ".concat([...he,pe].join(" -> "))),!1}h.current.addToPath(pe);try{if(console.log("dependencyMap.current",c.current),console.log("dependencyMap.current identifier",Y),c.current.has(Y)){const he=c.current.get(Y),ie=he.children;!ne&&he!==null&&he!==void 0&&he.fillRules&&Array.isArray(he==null?void 0:he.fillRules)&&(he==null?void 0:he.fillRules.length)>0&&O(Y,ae,q,he==null?void 0:he.fillRules);for(let de=0;de<ie.length;de++){const me=ie[de];if(me.component.props.withVisibleFunc&&typeof me.component.props.withVisibleFunc=="function"){let fe=N(q,me,ae);J=J||fe}if(me.component.props.withVisible){let fe=await M(q,me,ae,he==null?void 0:he.componentName);J=J||fe}!ne&&me.component.props.withFill&&await F(q,me,ae,he==null?void 0:he.componentName,pe)}}}finally{h.current.finishField()}return J},C=async function(Y,q){if(o=="desgin")return console.log("设计模式下不进行字段级联计算"),!1;console.log("handleFieldsWithVisibleOnly identifier",Y);let ne=!1,re=[];Array.isArray(Y)&&(re=[...Y.slice(0,-1)],Y=Y.filter(J=>typeof J=="string").join("."));try{if(c.current.has(Y)){const J=c.current.get(Y),ae=J.children;for(let pe=0;pe<ae.length;pe++){const he=ae[pe];if(he.component.props.withVisibleFunc&&typeof he.component.props.withVisibleFunc=="function"){let ie=N(q,he,re);ne=ne||ie}if(he.component.props.withVisible){let ie=await R(q,he,re,J==null?void 0:J.componentName);ne=ne||ie}}}}catch(J){console.log("handleFieldsWithVisibleOnly error",J)}return ne},x=function(Y){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(p.current)if(q){const ne=Object.keys(p.current);for(let re=0;re<ne.length;re++){const J=ne[re];J.includes("".concat(Y,","))&&delete p.current[y(J)]}}else delete p.current[y(Y)]},D=(Y,q)=>{k.current||(k.current={}),k.current[Y]=q},T=function(Y){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.log("recordFieldsChange",Y,q);var ne=Object.keys(Y);ne.length>0&&(ne.forEach(re=>{D(re,Y[re])}),q&&z())},O=(Y,q,ne,re)=>{let J=B("fieldsValue",Y,ne,null);console.log("handleFillRules current_value"+Y,J);let ae={};Array.isArray(Y)&&Y.filter(fe=>typeof fe=="string").join(".");let pe=[];for(let fe=0;fe<re.length;fe++){const ge=re[fe];let{source:Fe,target:Se}=ge,$e=J==null?void 0:J[Fe],Ke=$e;if(Array.isArray(Y)&&Y.filter(Ve=>typeof Ve=="string").join("."),Array.isArray(Se)&&Se.filter(Ve=>typeof Ve=="string").join("."),(ge==null?void 0:ge.type)==1){if(c.current.has(Se)){var he,ie,de;let Me=(he=c.current.get(Se))===null||he===void 0||(ie=he.component)===null||ie===void 0||(de=ie.props)===null||de===void 0?void 0:de.children;Array.isArray(Me)&&Me.length>0&&pe.push(Me.map(Ze=>{var We,rt;return"".concat(Fe,".").concat((Ze==null||(We=Ze.props)===null||We===void 0?void 0:We.componentId)||(Ze==null||(rt=Ze.props)===null||rt===void 0?void 0:rt.__id))}))}if($e&&typeof $e=="string")try{$e=JSON.parse($e)}catch(Me){console.error("error end",Me)}if(!Array.isArray($e))return;Ke=$e.map((Me,Ze)=>{let We={};if(ge!=null&&ge.subRules&&Array.isArray(ge==null?void 0:ge.subRules)&&(ge==null?void 0:ge.subRules.length)>0)for(let rt=0;rt<(ge==null?void 0:ge.subRules.length);rt++){const{source:ze,target:Te}=ge==null?void 0:ge.subRules[rt];We[Te]=Me==null?void 0:Me[ze];let Ie={name:[Se,Ze,Te],value:Me==null?void 0:Me[ze]};ae[Ie.name]=Ie}return We}),x(Se,!0),o3.emit("reloadTable",Se)}else{let Ve=0;if(q&&Array.isArray(q)&&q.length>1&&(q.filter(Me=>typeof Me=="string").join("."),Ve=q[q.length-1],Se=[...q,Se],Array.isArray(J)&&J.length>Ve)){var me;Ke=(me=J[Ve])===null||me===void 0?void 0:me[Fe]}ae[Se]={name:Array.isArray(Se)?Se:[Se],value:Ke}}(ge==null?void 0:ge.type)==1&&(console.log("rule?.type == 1",Se),console.log("rule?.type == 1",Ke),console.log("rule?.type == 1 current_identifier",Y),a.setFieldValue(Se,void 0)),console.log("form.setFieldValue(target, setValue) "+Se,Ke),a.setFieldValue(Se,Ke)}setTimeout(()=>{T(ae,!0),pe.length>0&&pe.forEach(fe=>{Array.isArray(fe)&&fe.length>0&&W(fe)})},0)},N=(Y,q,ne)=>{var re,J;let ae=!1;const pe=q==null||(re=q.component)===null||re===void 0||(J=re.props)===null||J===void 0?void 0:J.withVisibleFunc(Y),he=q==null?void 0:q.identifier;if(c.current.has(he)){const ie=c.current.get(he);ie.show!==pe&&(ie.show=pe,c.current.set(he,ie),ae=!0)}return ae},M=async(Y,q,ne,re)=>{var J,ae;let pe=!1;const he=q==null||(J=q.component)===null||J===void 0?void 0:J.props.withVisible,ie=q==null||(ae=q.component)===null||ae===void 0?void 0:ae.props.withDataFetch;let de=0,me=q.identifier,fe=[];if(he!=null&&he.withData&&(he==null?void 0:he.withData.length)>0&&ie&&typeof ie=="function")for(let Se=0;Se<(he==null?void 0:he.withData.length);Se++){const $e=he==null?void 0:he.withData[Se];let Ke={};Ke.tableName=$e.withTable.table_name,Ke.filter={};for(let Me=0;Me<$e.withCondition.length;Me++){var ge;const{value:Ze,column:We}=$e.withCondition[Me];let rt=B(Ze.group_key,Ze.field_key,Y,fe);Array.isArray(rt)&&Array.isArray(me)&&rt.length>de&&(rt=rt[de]),re=="Field.WithSingleSelect"&&rt&&(ge=rt)!==null&&ge!==void 0&&ge.value&&(rt=rt.value),Ke.filter[We.column_name]=rt}const Ve=await ie(Ke);Ve.code===0&&Ve.data.list&&fe.push({id:$e.id,data:Ve.data.list})}let Fe;if(he.value&&he.value.length>0&&(Fe=he.value.map(Se=>{let $e="";const{insert:Ke,attributes:Ve}=Se;return typeof Ke!="string"?Ke!=null&&Ke.span&&Ve&&Ve.tagKey&&Ve.id&&($e=B(Ve.tagKey,Ve.id,Y,fe),Array.isArray($e)?(Array.isArray(me)&&$e.length>de&&($e=$e[de]),typeof $e=="object"&&$e!==null&&($e=JSON.stringify($e))):typeof $e=="object"&&$e!==null?$e=JSON.stringify($e):$e.length>0&&($e='"'.concat($e,'"'))):$e=Ke,$e})),c.current.has(me)){const Se=c.current.get(me);if(Fe&&Fe.length>0){const $e=aM(Fe)=="true";Se.show!=$e&&(Se.show=$e,c.current.set(me,Se),pe=!0)}}return pe},R=async(Y,q,ne,re)=>{var J;let ae=!1;const pe=q==null||(J=q.component)===null||J===void 0?void 0:J.props.withVisible;let he=0,ie=q.identifier,de=[],me;if(pe.value&&pe.value.length>0&&(me=pe.value.map(fe=>{let ge="";const{insert:Fe,attributes:Se}=fe;return typeof Fe!="string"?Fe!=null&&Fe.span&&Se&&Se.tagKey&&Se.id&&(ge=B(Se.tagKey,Se.id,Y,de),Array.isArray(ge)?(Array.isArray(ie)&&ge.length>he&&(ge=ge[he]),typeof ge=="object"&&ge!==null&&(ge=JSON.stringify(ge))):typeof ge=="object"&&ge!==null?ge=JSON.stringify(ge):ge.length>0&&(ge='"'.concat(ge,'"'))):ge=Fe,ge})),c.current.has(ie)){const fe=c.current.get(ie);if(me&&me.length>0){const ge=aM(me)=="true";console.log("".concat(ie," 只读模式计算公式:"),me),console.log("".concat(ie," 只读模式计算结果:"),ge),fe.show!=ge&&(fe.show=ge,c.current.set(ie,fe),ae=!0)}}return ae},F=async(Y,q,ne,re,J)=>{var ae,pe;console.log("handleFieldsWithFill componentName",re);const he=q==null||(ae=q.component)===null||ae===void 0?void 0:ae.props.withFill,ie=q==null||(pe=q.component)===null||pe===void 0?void 0:pe.props.withDataFetch;let de=0,me="",fe=q.identifier;if(ne&&Array.isArray(ne)&&ne.length>1)me=ne.filter(Se=>typeof Se=="string").join("."),de=ne[ne.length-1],fe.startsWith("".concat(me,"."))&&(fe=[...ne,fe.replace("".concat(me,"."),"")]);else if(fe.indexOf(".")>=0){fe=fe.split(".");let Se=B("fieldsValue",fe[0],Y,[]);if(Array.isArray(Se)&&Se.length>0)for(let $e=0;$e<Se.length;$e++)await F(Y,q,[fe[0],$e],re);return}const ge=Array.isArray(fe)?fe.join("."):fe;if(h.current.hasCircularDependency(ge)){const Se=h.current.getCurrentPath();console.log("检测到公式计算中的循环依赖链路: ".concat([...Se,ge].join(" -> ")));return}try{let Se=[];if(he!=null&&he.withData&&(he==null?void 0:he.withData.length)>0&&ie&&typeof ie=="function")for(let Ke=0;Ke<(he==null?void 0:he.withData.length);Ke++){const Ve=he==null?void 0:he.withData[Ke];let Me={};Me.tableName=Ve.withTable.table_name,Me.filter={};for(let We=0;We<Ve.withCondition.length;We++){var Fe;const{value:rt,column:ze}=Ve.withCondition[We];let Te=B(rt.group_key,rt.field_key,Y,Se);if(Array.isArray(Te)&&Array.isArray(fe)&&Te.length>de&&(Te=Te[de]),Te&&typeof Te=="string")try{Te=JSON.parse(Te)}catch{}(Fe=Te)!==null&&Fe!==void 0&&Fe.value&&(Te=Te.value),Me.filter[ze.column_name]=Te}const Ze=await ie(Me);Ze.code===0&&Ze.data.list&&Se.push({id:Ve.id,data:Ze.data.list})}let $e;if(he.value&&he.value.length>0&&($e=he.value.map(Ke=>{let Ve="";const{insert:Me,attributes:Ze}=Ke;return typeof Me!="string"?Me!=null&&Me.span&&Ze&&Ze.tagKey&&Ze.id&&(Ve=B(Ze.tagKey,Ze.id,Y,Se),Array.isArray(Ve)?(Array.isArray(fe)&&Ve.length>de&&(Ve=Ve[de]),typeof Ve=="object"&&Ve!==null&&(Ve=JSON.stringify(Ve))):typeof Ve=="object"&&Ve!==null?Ve=JSON.stringify(Ve):Ve.length>0&&(Ve='"'.concat(Ve,'"'))):Ve=Me,Ve})),$e&&$e.length>0){const Ke=aM($e);console.log("".concat(fe," 计算公式:"),$e),console.log("".concat(fe," 计算结果:"),Ke),a.setFieldValue(fe,Ke),await w(fe,a.getFieldsValue(),!1,ge)}}finally{}},B=(Y,q,ne,re)=>{let J="";if(Y=="fieldsValue"){var ae;if(q.indexOf(".")>=0){var pe;const[de,me]=q.split("."),fe=(ne==null?void 0:ne[de])||[];Array.isArray(fe)?J=fe.map(ge=>{var Fe;return(Fe=ge==null?void 0:ge[me])!==null&&Fe!==void 0?Fe:""}):J=(pe=fe==null?void 0:fe[me])!==null&&pe!==void 0?pe:""}else J=(ae=ne==null?void 0:ne[q])!==null&&ae!==void 0?ae:""}else{let de=re.find(me=>me.id===Y);if(de&&de.data&&de.data.length>0){var he,ie;J=(he=(ie=de.data[0])===null||ie===void 0?void 0:ie[q])!==null&&he!==void 0?he:""}}return J},k=Q.useRef({});Q.useRef({});const H=Q.useRef(null),z=Q.useCallback(()=>{H.current&&clearTimeout(H.current);const Y=d.current===1?500:100;H.current=setTimeout(async()=>{h.current.startNewCycle();const q={...k.current};k.current={};const ne=a.getFieldsValue(),re=d.current;d.current=0;let J=!1;p.current||(p.current={});const ae=new Set;for(let pe in q)try{let he=q[pe];if(!_f.isEqual(he.value||"",v(he.name)||"")){if(re!=1){const ie=Array.isArray(he.name)?he.name.map(me=>typeof me=="string"?me:me.toString()).join("."):he.name;if(ae.has(ie)){console.log("跳过已处理的字段 processedFields",ie);continue}ae.add(ie);let de=await w(he.name,ne,!1,ie);J=J||de}p.current[y(he.name)]=he.value}}catch(he){console.log("debounceHandleFieldsChange error",he)}J&&(console.log("needRefresh",J),f())},Y)},[i]),_=Q.useCallback(()=>{H.current&&clearTimeout(H.current);const Y=50;H.current=setTimeout(async()=>{const q={...k.current};k.current={};const ne=a.getFieldsValue();let re=!1;p.current||(p.current={});const J=new Set;for(let ae in q)try{let pe=q[ae];if(!_f.isEqual(pe.value||"",v(pe.name)||"")){const he=Array.isArray(pe.name)?pe.name.map(de=>typeof de=="string"?de:de.toString()).join("."):pe.name;if(J.has(he)){console.log("跳过已处理的字段 processedFields",he);continue}J.add(he);let ie=await C(pe.name,ne,!1,he);re=re||ie,p.current[y(pe.name)]=pe.value}}catch(pe){console.log("debounceHandleFieldsChange_ReadOnly error",pe)}re&&(console.log("needRefresh (ReadOnly mode)",re),f())},Y)},[i]),P=Q.useCallback(Y=>{},[]),L=Q.useCallback((Y,q)=>{console.log("handleValuesChange changedValues",JSON.stringify(Y));const ne=function(J){let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const pe=[];for(let he in J){const ie=J[he],de=[...ae,he];Array.isArray(ie)?ie.forEach((me,fe)=>{if(typeof me=="object"&&me!==null){const ge=ne(me,[...de,fe]);pe.push(...ge)}else pe.push({touched:!0,validating:!1,errors:[],warnings:[],name:[...de,fe],validated:!1,value:me})}):pe.push({touched:!0,validating:!1,errors:[],warnings:[],name:de,validated:!1,value:ie})}return pe},re=ne(Y);console.log("handleValuesChange converted to fields format",JSON.stringify(re)),re.length>0&&(re.forEach(J=>{J.name&&J.name.length>0&&(k.current[J.name]=J)}),console.log("handleValuesChange changedFieldsState",JSON.parse(JSON.stringify(k.current))),i?_():z())},[i]),j=Y=>{let q=[];return Y.forEach(ne=>{if(!c.current.has(ne))return;let re=c.current.get(ne);re.withIds.length<=0||q.push(...re.withIds.filter(J=>!q.includes(J)))}),q=q.filter(ne=>{var re=a.getFieldValue(ne);return!(typeof re!="number"&&!re)}),q},W=Y=>{let q=j(Y);const ne=a.getFieldsValue();setTimeout(async()=>{for(let re=0;re<q.length;re++){const J=q[re];await w(J,ne)}},0)},K=async Y=>{const q=a.getFieldsValue();setTimeout(async()=>{for(let ne=0;ne<Y.length;ne++){const re=Y[ne];await w(re,q)}},0)},U=Q.useRef({}),G=Y=>c.current&&c.current.has(Y)?c.current.get(Y):null,X=()=>(console.log("memoizedRenderChildren",c.current),c.current?Z():null),Z=()=>{console.log("renderChildren");const Y=Dl(),q=Q.Children.toArray(r);return console.log("childrenArray",q),nHt(q,n,c.current).map((re,J)=>He.jsx(KN,{gutter:[24,24],children:re.map((ae,pe)=>{var he,ie;const{componentId:de,__id:me,_componentName:fe,...ge}=ae.props,Fe=((he=ae.type)===null||he===void 0?void 0:he.displayName)||fe,Se=de||me;Se in U.current||(U.current[Se]=Dl());const $e=Fe&&Fe.startsWith("Layout."),Ke=Fe&&Fe=="Field.Table",Ve=!c.current.has(Se)||((ie=c.current.get(Se))===null||ie===void 0?void 0:ie.show),Me=(ge.calcHidden||!Ve)&&o!="desgin",Ze=[];if(ge.isRequired&&Ze.push({required:!0,message:"".concat(ge.label,"必须填写")}),ge.rules)if(Array.isArray(ge.rules)){const ze=ge.rules.join("|");Ze.push({pattern:new RegExp(ze),message:ge.rulesFailMessage?ge.rulesFailMessage:"".concat(ge.label,"格式错误")})}else Ze.push({pattern:new RegExp(ge.rules),message:ge.rulesFailMessage?ge.rulesFailMessage:"".concat(ge.label,"格式错误")});const We=ze=>{a.setFieldValue(Se,ze)};let rt;return Ke||$e?rt=Q.cloneElement(ae,{onTableAddRow:W,getTableWithIds:j,onTableRemoveRow:K,removeLastFieldsValues:x,form:a,fieldName:Se,onCustomChange:We,initializeFormRender:m,mode:o,recordFieldsChange:T,getDependencyMapItem:G,renderKey:Y}):Fe==="Field.WithSingleSelect"||Fe==="Field.WithMultipleSelect"||Fe==="Show.WithTable"?rt=He.jsx(bi.Item,{hidden:Me,style:{margin:0},shouldUpdate:(ze,Te)=>{let Ie=!1;if(Array.isArray(ge.filterRules)&&ge.filterRules.length>0)for(let Ye of ge.filterRules){if(Ye.valueType!="variable")continue;let Be,Ge;if(Be=ze==null?void 0:ze[Ye.value.field_key],Ge=Te==null?void 0:Te[Ye.value.field_key],Be!==Ge){Ie=!0;break}}return Ie&&(U.current[Se]=Dl(),console.log(Se,Dl())),Ie},children:ze=>{let{getFieldsValue:Te}=ze;const Ie=Te();let Ye=Q.cloneElement(ae,{onTableAddRow:W,onTableRemoveRow:K,removeLastFieldsValues:x,form:a,fieldName:Se,onCustomChange:We,fieldsValue:Ie,initializeFormRender:m,recordFieldsChange:T,shouldUpdateKey:U.current[Se]});return Fe==="show.WithTable"?He.jsx(He.Fragment,{children:Ye}):He.jsx(bi.Item,{style:{marginBottom:0},label:"",name:Se,rules:Ve?Ze:[],children:Ye})}}):rt=He.jsx(bi.Item,{hidden:Me,style:{marginBottom:0},label:"",name:Se,rules:Ve?Ze:[],children:Q.cloneElement(ae,{form:a,fieldName:Se,onCustomChange:We,initializeFormRender:m,recordFieldsChange:T,removeLastFieldsValues:x})}),He.jsx(nA,{span:Me?0:$e?24:24/n,style:{marginBottom:0},children:rt},Se||"col-".concat(pe))})},"row-".concat(J)))};return He.jsx(Od,{theme:{components:{Table:{rowHoverBg:"#ebebeb"}},token:{colorBgContainerDisabled:"rgba(0, 0, 0, 0.02)",colorTextDisabled:"#333"}},children:He.jsxs(bi,{form:a,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col "+(o=="desgin"?" fp-6":""),onFieldsChange:P,onValuesChange:L,children:[He.jsx(bi.Item,{name:"__id",hidden:!0,children:He.jsx("input",{type:"hidden"})}),l]})})});function rHt(e){return Q.forwardRef((t,n)=>He.jsx(e,{...t,ref:n,forwardedRef:n}))}class Clr extends Q.PureComponent{render(){const{forwardedRef:t,...n}=this.props;return He.jsx(vpe,{...n,ref:t})}}const oHt=rHt(e=>{let{forwardedRef:t,...n}=e;return He.jsx(vpe,{...n,ref:t})});function iHt(e,t,n){const r=[];let o=[];const i=(a,s)=>{for(;s.length<a;)s.push(He.jsx("div",{},Dl()))};return e.forEach(a=>{var s,l;const u=((s=a.type)===null||s===void 0?void 0:s.displayName)||((l=a.props)===null||l===void 0?void 0:l._componentName);u&&u.startsWith("Layout.")?(o.length>0&&(i(t,o),r.push(o),o=[]),r.push([a])):(o.push(a),o.filter(f=>{var d,h,g,m;const p=((d=f.props)===null||d===void 0?void 0:d.componentId)||((h=f.props)===null||h===void 0?void 0:h.__id);return(!(n!=null&&n.has(p))||((g=n.get(p))===null||g===void 0?void 0:g.show))&&!((m=f.props)!==null&&m!==void 0&&m.calcHidden)}).length===t&&(r.push(o),o=[]))}),o.length>0&&(i(t,o),r.push(o)),r}const aHt=e=>{const t=new Map,n=[],r=function(o){var i,a;let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const l=((i=o.type)===null||i===void 0?void 0:i.displayName)||((a=o.props)===null||a===void 0?void 0:a._componentName),{props:u}=o;if(l&&(l.startsWith("Field.")||l.startsWith("Layout."))){let c=(u==null?void 0:u.componentId)||(u==null?void 0:u.__id);s&&(c="".concat(s,".").concat(c));const f=u.withId?[u.withId]:u.withIds?[...u.withIds]:[];n.push({identifier:c,withIds:f,compName:l,fillRules:u==null?void 0:u.fillRules,visibleFunc:u==null?void 0:u.withVisibleFunc})}u!=null&&u.children&&Q.Children.forEach(u.children,c=>{r(c,l&&l.startsWith("Field.")?(u==null?void 0:u.componentId)||(u==null?void 0:u.__id):"")})};return Q.Children.forEach(e,o=>r(o)),n.forEach(o=>{t.set(o.identifier,{...o,show:!0,children:n.filter(i=>i.withIds.includes(o.identifier))})}),t},sHt=function(e,t,n){if(!t.has(e))return!1;const r=t.get(e);if(r.visibleFunc&&typeof r.visibleFunc=="function"){const o=r.visibleFunc(n);if(r.show!==o)return r.show=o,!0}if(r.fillRules&&Array.isArray(r.fillRules)&&r.fillRules.length>0){const o=r.fillRules.map(a=>typeof a=="string"?a:""),i=aM(o)==="true";if(r.show!==i)return r.show=i,!0}return!1},lHt=Q.forwardRef((e,t)=>{let{cols:n=1,children:r,mode:o="view"}=e;const[i]=bi.useForm(),[a,s]=Q.useState(null),l=Q.useRef(new Map),u=Q.useRef({}),c=Q.useRef({}),f=Q.useCallback(()=>{l.current=aHt(r)},[r]),d=Q.useCallback(()=>{const p=i.getFieldsValue();let y=!1;l.current.forEach((v,b)=>{const E=sHt(b,l.current,p);y=y||E}),y&&s(m())},[i]),h=Q.useCallback(_f.debounce(()=>{const p=i.getFieldsValue();Object.keys(c.current).forEach(y=>{c.current[y]!==p[y]&&(u.current[y]=p[y])}),c.current={},d()},200),[i,d]),g=function(){for(var p=arguments.length,y=new Array(p),v=0;v<p;v++)y[v]=arguments[v];let[,b]=y;Object.assign(c.current,b),h()},m=Q.useCallback(()=>{const p=Q.Children.toArray(r);return iHt(p,n,l.current).map((v,b)=>He.jsx(KN,{gutter:[24,24],children:v.map((E,S)=>{var w,C;const{componentId:x,__id:D,_componentName:T,calcHidden:O,...N}=E.props,M=((w=E.type)===null||w===void 0?void 0:w.displayName)||T,R=x||D,F=Dl(),B=M&&M.startsWith("Layout."),k=!l.current.has(R)||((C=l.current.get(R))===null||C===void 0?void 0:C.show),H=(O||!k)&&o!=="desgin",z=[];if(N.isRequired&&z.push({required:!0,message:"".concat(N.label,"必须填写")}),N.rules){const P=Array.isArray(N.rules)&&N.rules.length>0?N.rules.join("|"):N.rules;z.push({pattern:new RegExp(P),message:N.rulesFailMessage||"".concat(N.label,"格式错误")})}let _=null;return B?_=Q.cloneElement(E,{form:i,fieldName:R,updateKey:F}):_=He.jsx(bi.Item,{hidden:H,label:N.label||"",name:R,rules:k?z:[],children:Q.cloneElement(E,{form:i,fieldName:R,updateKey:F})}),He.jsx(nA,{span:H?0:B?24:24/n,children:_},R||"col-".concat(S))})},"row-".concat(b)))},[r,n,i,o]);return Q.useEffect(()=>{f(),s(m())},[f,m]),Q.useImperativeHandle(t,()=>({formRef:i,setFieldsValue:p=>{i.setFieldsValue(p),h()},refreshDependencies:()=>{f(),d()}})),He.jsxs(bi,{form:i,className:"form-container fp-0 fw-full fh-full box-border fflex fflex-col fgap-y-2".concat(o==="desgin"?" fp-6":""),onValuesChange:g,children:[He.jsx(bi.Item,{name:"__id",hidden:!0,children:He.jsx("input",{type:"hidden"})}),a]})}),uHt=e=>{let{request:t,value:n,onChange:r,callError:o,disabledValue:i,addRoot:a=!0,title:s,...l}=e;const[u,c]=Q.useState(!1),[f,d]=Q.useState([]);Q.useEffect(()=>{h()},[]),Q.useEffect(()=>{if(typeof n=="string")try{n=JSON.parse(n),r(n)}catch{}Array.isArray(n)&&y(n)},[n]);const h=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 O=jZe(((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&&(O=[{value:0,title:"根节点",children:O}]),l.treeData=O,console.log("treeData",O),d(O)}l.treeData&&d(l.treeData),c(!0)},[g,m]=Q.useState([]),[p,y]=Q.useState([]),[v,b]=Q.useState([]),[E,S]=Q.useState(!0),w=D=>{console.log("onExpand",D),m(D),S(!1)},C=D=>{console.log("onCheck",D),y(D),r(D)},x=(D,T)=>{console.log("onSelect",T),b(D)};return He.jsx(Bi,{...l,children:He.jsx(npe,{checkable:!0,onExpand:w,onCheck:C,onSelect:x,expandedKeys:g,autoExpandParent:E,checkedKeys:p,selectedKeys:v,treeData:f})})},cHt=e=>He.jsx(Bi,{...e,children:He.jsx(WN,{...e})}),fHt=e=>He.jsx(Bi,{...e,children:He.jsx(WN.Group,{...e})}),dHt=e=>He.jsx(Bi,{...e,children:He.jsx(v_.Group,{...e})}),SJe=e=>{let{value:t,maxCount:n,multiple:r,onChange:o,...i}=e;Q.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]=Q.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 He.jsx($_,{...i,listType:"text",multiple:r,onChange:l,maxCount:n,fileList:a,children:!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&a.length<n&&He.jsx(fu,{type:(i==null?void 0:i.type)||"default",icon:(i==null?void 0:i.icon)||He.jsx(kZe,{}),children:"点击上传文件"})})};SJe.displayName="UploadFile";const hHt=e=>He.jsx(Bi,{...e,children:He.jsx(SJe,{...e})}),wJe=e=>{let{maxCount:t,value:n,multiple:r,onChange:o,...i}=e;Q.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(x=>x.uid===C.uid);!E||(E.version||0)<(C.version||0)?S.push(C):S.push(E)}s(S)}},[n]),t=t||99,r=r||!0;const[a,s]=Q.useState([]),[l,u]=Q.useState(""),[c,f]=Q.useState(0),[d,h]=Q.useState(!1),g=Q.useRef([]),m=E=>new Promise((S,w)=>{const C=new FileReader;C.readAsDataURL(E),C.onload=()=>S(C.result),C.onerror=x=>w(x)}),p=async(E,S)=>{!E.url&&!E.preview&&(E.preview=await m(E.originFileObj)),u(E.url||E.preview),f(S),h(!0)},y=async(E,S)=>{i!=null&&i.disabled||s(a.filter((w,C)=>C!==S))},v=He.jsx(He.Fragment,{children:He.jsxs("div",{className:"fw-full fh-full fflex fflex-col fitems-center fjustify-center fborder fborder-dashed fcursor-pointer frounded",children:[He.jsx(BZe,{}),He.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 x=g.current.find(T=>T.uid===C.uid);console.log("oldfile",JSON.parse(JSON.stringify(x||{}))),x&&x.status!="uploading"?w.push(x):(C.status=="done"&&C.response&&(C.url=C.response),w.push(C))}g.current=w,s(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 He.jsxs(He.Fragment,{children:[He.jsx("div",{className:"fflex fgap-3 fflex-wrap",children:He.jsx($_,{...i,itemRender:(E,S,w)=>{console.log("file",S);let C=w.findIndex(x=>x.uid===S.uid);return He.jsx(He.Fragment,{children:He.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:[He.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"&&He.jsx(LZe,{onClick:()=>{p(S,C)},className:"hover:ftext-gray-200"}),!(i!=null&&i.disabled)&&!(i!=null&&i.readonly)&&He.jsx(lpe,{onClick:()=>{y(S,C)},className:"hover:ftext-gray-200"})]}),S.status=="uploading"&&He.jsx("div",{className:" fw-full fh-full fflex fitems-center fjustify-center fabsolute ftop-0 fleft-0 ",children:He.jsx(xT,{})}),He.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:p,onChange:b,maxCount:t,children:a.length>=t||i!=null&&i.disabled||i!=null&&i.readonly?null:v})}),l&&He.jsx(G9.PreviewGroup,{preview:{visible:d,current:c,onVisibleChange:E=>h(E),onChange:E=>{f(E)}},children:a.map((E,S)=>He.jsx(He.Fragment,{children:He.jsx(G9,{wrapperStyle:{display:"none"},src:E.url})}))})]})};wJe.displayName="UploadImage";const pHt=e=>He.jsx(Bi,{...e,children:He.jsx(wJe,{...e})}),vHt=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)),He.jsx(Bi,{...i,children:He.jsx(Xhe,{...i,onChange:n,value:t})})};var gHt={exports:{}};(function(e,t){(function(n,r){e.exports=r(wYe)})(Er,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})})(gHt);var mHt={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 yHt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},CJe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},mHt),timePickerLocale:Object.assign({},yHt)};CJe.lang.ok="确定";var xJe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Er,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}}})})(xJe);var bHt=xJe.exports;const EHt=Ws(bHt);Ra.extend(EHt);Ra.extend(TYe);Ra.updateLocale("zh-cn",{weekStart:0});const SHt=e=>{let{datetype:t,value:n,defaultNow:r,onChange:o,...i}=e;t=t||"date";const[a,s]=Q.useState(i==null?void 0:i.picker),[l,u]=Q.useState(i==null?void 0:i.format),[c,f]=Q.useState(!1),[d,h]=Q.useState(!1),g=Q.useRef(!1);Q.useEffect(()=>{if(r&&!n){const p=Ra().format("YYYY-MM-DD HH:mm:ss");typeof o=="function"&&o(p);return}},[]);const m=(p,y)=>{g.current=!0,o(y)};return Q.useEffect(()=>{switch(s("date"),f(!1),t){case"date":s("date"),u("YYYY-MM-DD"),h(!1);break;case"datetime":f(!0),s("datetime"),u("YYYY-MM-DD HH:mm:ss"),h(!0);break;case"month":s("month"),h(!1);break;case"year":s("year"),h(!1);break}},[t]),He.jsx(Bi,{...i,children:He.jsx(rA,{locale:CJe,...i,picker:a,format:l,style:{width:"100%"},onChange:m,value:n&&Ra(n).isValid()?Ra(n):void 0,showTime:c,needConfirm:d})})};var gpe={exports:{}},JN={},L_={exports:{}},AJe={},Ure={exports:{}},sP={exports:{}},Io={};/** @license React v16.13.1
431
431
  * react-is.production.min.js
432
432
  *
433
433
  * Copyright (c) Facebook, Inc. and its affiliates.
package/dist/index.es.js CHANGED
@@ -47596,7 +47596,9 @@ const RJe = /* @__PURE__ */ Xs((e, t) => {
47596
47596
  D(ne, Y[ne]);
47597
47597
  }), q && z());
47598
47598
  }, O = (Y, q, te, ne) => {
47599
- let Z = B("fieldsValue", Y, te, null), ie = {};
47599
+ let Z = B("fieldsValue", Y, te, null);
47600
+ console.log("handleFillRules current_value" + Y, Z);
47601
+ let ie = {};
47600
47602
  Array.isArray(Y) && Y.filter((ce) => typeof ce == "string").join(".");
47601
47603
  let he = [];
47602
47604
  for (let ce = 0; ce < ne.length; ce++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.11.85",
3
+ "version": "0.11.86",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@dnd-kit/core": "^6.1.0",
@@ -403,6 +403,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view", denyEdit
403
403
  const handleFillRules = (current_identifier, parentIdentifier, fieldValues, fillRules) => {
404
404
  // 获取当前变更的字段数据
405
405
  let current_value = getParamValue("fieldsValue", current_identifier, fieldValues, null)
406
+ console.log("handleFillRules current_value" + current_identifier, current_value)
406
407
  let changedFields = {}
407
408
 
408
409
  // 将标识符标准化为字符串