text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[4],{"+dfd":function(e,t,n){"use strict";(function(e){var a,r,i=n("jrin"),l=(n("4csm"),n("2Fwu")),c=(n("eE3J"),n("GSZB")),o=(n("9kbU"),n("vbHR")),u=n("k1fw"),f=(n("SePM"),n("PMX6")),s=(n("Ahcs"),n("k0dM")),d=(n("Dvpn"),n("myml")),m=(n("eNCU"),n("pjJH")),p=(n("QjdF"),n("U4Vl")),v=(n("6dnR"),n("CQJL")),b=(n("yavW"),n("WuMn")),h=(n("4X2C"),n("xvon")),y=(n("vmZS"),n("NjVP")),g=n("oBTY"),O=n("tJVT"),E=n("q1tI"),j=n.n(E),C=n("RsOY"),w=n.n(C),S=n("rfrl"),N=n("jfUH"),k=n("O/S9"),F=n("mmaM"),D=n("umGZ"),P=n("5jOq"),I=n.n(P),A=n("VW+w"),x=n("cPjh"),V=n("HrPU"),L=n("MxUj"),M=n("wiuW"),T=n("poQN"),K={group:"\u5206\u7ec4"};function W(t){return t&&(null===t||void 0===t?void 0:t.map((function(t){return e.isString(t)?{name:t}:t})))}function U(t){var n,a=t.modelName,r=t.detailValue,i=t.schemas,l=t.useLayout,c=void 0!==l&&l,o=t.style,u=void 0===o?"group":o,f=t.bsmSetting.staff_model,s=[],C=[];r&&(s=null!==(n=(e.cloneDeep(r.sections)||[]).map((function(e){var t=e;return t.fields=W(t.fields),t})))&&void 0!==n?n:[],C=W(e.cloneDeep(r.fields))||s.filter((function(t){return!e.isEmpty(t.fields)})).reduce((function(e,t){return e.concat(t.fields)}),[]));var w=Object(E["useState"])(s),P=Object(O["a"])(w,2),x=P[0],L=P[1],M=Object(E["useState"])(C),T=Object(O["a"])(M,2),U=T[0],G=T[1],J=Object(E["useState"])([]),R=Object(O["a"])(J,2),$=R[0],B=R[1];function q(t,n){var a=e.cloneDeep(x);a[t].title=n,L(a)}function _(t,n){var a=e.cloneDeep(x);a[t].fields=n.map((function(e){return U.find((function(t){return t.name===e}))})),L(a)}function z(t,n){var a=e.cloneDeep(x);a[t].style||(a[t].style={}),a[t].style.widget=n,L(a)}function X(){L(s),G(C)}function H(t){var n=e.cloneDeep(x);n.splice(t,1),L(n)}function Z(){G([].concat(Object(g["a"])(U),[{}]))}function Q(e){return{name:e}}function Y(t){var n=e.cloneDeep(U);n.splice(t,1);var a=(e.cloneDeep(x)||[]).map((function(e){var t,a=e;a.fields&&(a.fields=null===(t=a.fields)||void 0===t?void 0:t.filter((function(e){return n.map((function(e){return e.name})).includes(e.name)})));return a}));L(a),G(n)}function ee(t,n,a){var r=e.cloneDeep(U);r[t][a]=n,G(r)}function te(t){var n=e.cloneDeep(x),a=t-1,r=[n[t],n[a]];n[a]=r[0],n[t]=r[1],L(n)}function ne(t){var n=e.cloneDeep(x),a=t+1,r=[n[t],n[a]];n[a]=r[0],n[t]=r[1],L(n)}Object(E["useEffect"])((function(){var t,n,r=[],l=[];if(f){var c=[];i[a].fields.forEach((function(e){e.ref===f&&c.push(e)})),B(c)}var o=null===(t=e.cloneDeep(U))||void 0===t?void 0:t.filter((function(e){return Object(N["t"])(a,e.name)}));o.forEach((function(t,n){var i=t;i.showIf&&i.showIf.forEach((function(t,i){var c=t;if(e.isArray(c.value)){var o=Object(N["t"])(a,c.field),u=new Promise((function(e){Object(F["queryContent"])({model:o.ref,filters:[{field:Object(N["L"])(o.ref),operator:"in",value:c.value}]}).then((function(t){var a=t.list;r.push([n,i,a]),e()}))}));l.push(u)}}))}));var u=null===(n=e.cloneDeep(x))||void 0===n?void 0:n.map((function(e){var t=e;return t.fields&&(t.fields=t.fields.filter((function(e){return o.map((function(e){return e.name})).includes(e.name)}))),t}));Promise.all(l).then((function(){r.forEach((function(e){var t=Object(O["a"])(e,3),n=t[0],a=t[1],r=t[2];o[n].showIf[a].value=r}))})),G(o),L(u)}),[]);var ae=function(e,t){G(Object(S["a"])(U,(function(n){t?n[e].alias=t:delete n[e].alias})))},re={handleDisPlayName:ae,handleFieldChange:ee,deleteField:Y,addField:Z,reset:X,setFields:G,getField:Q};function ie(t){var n,l;if(void 0===t)return null;var c=U[t];return j.a.createElement(y["a"],{labelCol:{span:5},wrapperCol:{span:19}},j.a.createElement(y["a"].Item,{label:"\u5b57\u6bb5"},j.a.createElement(V["a"],{value:c.name,onChange:function(e){return ee(t,e,"name")},model:a,allowClear:!1})),j.a.createElement(y["a"].Item,{label:"\u663e\u793a\u540d"},j.a.createElement(h["a"],{allowClear:!0,value:c.alias,onChange:function(e){return ae(t,e.target.value)},placeholder:c.name&&Object(A["displayPreprocess"])([e.cloneDeep(c)],a,i)[0].alias})),j.a.createElement("div",{className:I.a.divider,style:{marginBottom:16}},"\u6743\u9650\u8bbe\u7f6e"),j.a.createElement(D["a"],{groupsValue:null!==(n=null===(l=c.groups)||void 0===l?void 0:l.filter((function(e){return!("number"===typeof e)})))&&void 0!==n?n:[],groupsOnChange:function(n){var a=e.cloneDeep(U);a[t].groups=n,G(Object(g["a"])(a))},userValue:c.userField,userOnChange:function(n){var a=e.cloneDeep(U);a[t].userField=n,G(Object(g["a"])(a))},staffModelFields:$,staffModel:f,defauldGroupValue:r.fields[t]}),j.a.createElement(y["a"].Item,{label:"\u6ee1\u8db3\u6761\u4ef6\u663e\u793a"},j.a.createElement(k["a"],{fields:i[a].fields,context:{model:a},onChange:function(e){return ee(t,e,"showIf")},value:c.showIf,disabledField:function(e){return c.showIf.filter((function(e){return e.field})).map((function(e){return e.field})).includes(e.name)}})))}var le=c&&j.a.createElement(y["a"],{layout:"inline"},"default"!==u&&j.a.createElement(j.a.Fragment,null,j.a.createElement(d["a"],{style:{marginTop:24},size:"middle",bordered:!0,dataSource:x,pagination:!1,columns:[{title:"".concat(K[u],"\u540d\u79f0"),key:"title",render:function(e,t,n){return j.a.createElement(h["a"],{value:e.title,onChange:function(e){return q(n,e.target.value)}})}},{title:"\u6240\u542b\u5b57\u6bb5",key:"fields",render:function(e,t,n){var r;return j.a.createElement(b["a"],{mode:"multiple",value:null===(r=e.fields)||void 0===r?void 0:r.map((function(e){return e.name})),onChange:function(e){_(n,e)}},U.filter((function(e){return e.name})).map((function(t){var n;return j.a.createElement(b["a"].Option,{value:t.name,key:t.name,disabled:x.map((function(e){var t;return null===(t=e.fields)||void 0===t?void 0:t.map((function(e){return e.name}))})).flat().includes(t.name)&&!(e.fields||[]).map((function(e){return e.name})).includes(t.name)},null===(n=i[a].fields.find((function(e){return e.name===t.name})))||void 0===n?void 0:n.displayName)})))}},{title:"\u663e\u793a\u98ce\u683c",key:"style.widget",render:function(e,t,n){return j.a.createElement(v["a"].Group,{value:e.style&&e.style.widget||"cell",onChange:function(e){return z(n,e.target.value)}},j.a.createElement(v["a"],{value:"cell"},"\u5217\u8868"),j.a.createElement(v["a"],{value:"table"},"\u8868\u683c"))}},{title:"\u64cd\u4f5c",key:"option",render:function(e,t,n){return j.a.createElement(j.a.Fragment,null,j.a.createElement("a",{onClick:function(){return H(n)}},"\u5220\u9664"),n>0&&j.a.createElement(j.a.Fragment,null,j.a.createElement(p["a"],{type:"vertical"}),j.a.createElement("a",{onClick:function(){return te(n)}},"\u4e0a\u79fb")),n<x.length-1&&j.a.createElement(j.a.Fragment,null,j.a.createElement(p["a"],{type:"vertical"}),j.a.createElement("a",{onClick:function(){return ne(n)}},"\u4e0b\u79fb")))}}],footer:function(){return j.a.createElement(m["a"],{onClick:function(){return L([].concat(Object(g["a"])(x),[{}]))}},"\u6dfb\u52a0",K[u])}})));return[ie,le,U,x,re]}function G(t){var n=t.modelName,a=t.adminConfig,r=t.schemas,i=t.bsmSetting,l="default";a[n].detail&&(l=a[n].detail.style||l);var c=Object(E["useState"])(l),o=Object(O["a"])(c,2),u=o[0],d=o[1],m=Object(E["useState"])(String(0)),b=Object(O["a"])(m,2),h=b[0],g=b[1],C=U({modelName:n,adminConfig:a,schemas:r,useLayout:!0,style:u,bsmSetting:i}),w=Object(O["a"])(C,5),S=w[0],N=w[1],k=w[2],F=w[3],D=w[4],P=D.deleteField,I=D.addField,A=D.check,x=D.detailReset;function V(){x(),d(l)}function L(){I(),g(String(k.length))}var M={style:u,sections:"default"!==u&&F,fields:"default"===u&&k},T=j.a.createElement(s["a"],{tabBarStyle:{minWidth:48},activeKey:h,tabPosition:"left",type:"editable-card",onChange:g,onEdit:function(e,t){var n={add:L,remove:function(){return P(e)}};n[t]()}},k.map((function(e,t){var a=r[n].fields.find((function(t){return t.name===e.name}));return j.a.createElement(s["a"].TabPane,{tab:(a||{}).displayName||"\u5b57\u6bb5".concat(t+1),key:t,closable:!a||!a.required||k.filter((function(t){return t.name===e.name})).length>=2},S(t))}))),W=j.a.createElement(j.a.Fragment,null,j.a.createElement(f["a"],{title:"\u8be6\u60c5\u5b57\u6bb5",type:"inner"},T),j.a.createElement(p["a"],null),j.a.createElement(y["a"],{layout:"inline"},j.a.createElement(y["a"].Item,{label:"\u6392\u5217\u65b9\u5f0f"},j.a.createElement(v["a"].Group,{value:u,onChange:function(e){return d(e.target.value)}},j.a.createElement(v["a"],{value:"default"},"\u9ed8\u8ba4"),e.map(K,(function(e,t){return j.a.createElement(v["a"],{value:t},e)}))))));return[W,N,M,V,A]}function J(t){var n,a,i=t.schemas,f=t.modelName,s=t.detailValue,d=t.bsmSetting,p=t.onChange,v=[],y=[],C=[];"default"===(null===s||void 0===s?void 0:s.style)||e.isEmpty(null===s||void 0===s?void 0:s.sections)?v=[(null===s||void 0===s||null===(n=s.fields)||void 0===n?void 0:n.length)||0]:null===s||void 0===s||null===(a=s.sections)||void 0===a||a.forEach((function(e){e.fields&&v.push(e.fields.length),y.push(e.title),C.push(e.style)}));var S=Object(E["useState"])(v),k=Object(O["a"])(S,2),F=k[0],D=k[1],P=Object(E["useState"])(y),I=Object(O["a"])(P,2),A=I[0],L=I[1],W=Object(E["useState"])(C),G=Object(O["a"])(W,2),J=G[0],R=G[1],$="group",B=U({modelName:f,detailValue:s,schemas:i,style:$,bsmSetting:d}),q=Object(O["a"])(B,5),_=q[0],z=q[2],X=q[4],H=X.deleteField,Z=X.setFields,Q=X.getField,Y=X.handleFieldChange;function ee(e){var t=0,n=e.length+F[r];F.forEach((function(e,n){n<=r&&(t+=e)}));var a=e.map(Q),i=w()(z,{$splice:[[t,0].concat(Object(g["a"])(a))]});Z(i),D(w()(F,{$splice:[[r,1,n]]}))}var te=Object(x["d"])({modelName:f,schemas:i,onOk:function(){return ee(re)},fieldDisabled:function(e){return z.map((function(e){return e.name})).includes(e.name)},expand:!0}),ne=Object(O["a"])(te,3),ae=ne[0],re=ne[1],ie=ne[2];function le(e,t){H(Object(x["c"])(e,t,F)),D(w()(F,{$splice:[[t,1,F[t]-1]]}))}function ce(e){var t=F.reduce((function(t,n,a){return a<e?t+n:t}),0);Z(w()(z,{$splice:[[t,F[e]]]})),D(w()(F,{$splice:[[e,1]]})),L(w()(A,{$splice:[[e,1]]})),R(w()(J,{$splice:[[e,1]]}))}function oe(e,t,n){Y(Object(x["c"])(e,t,F),n,"name")}function ue(e,t){L(w()(A,{$splice:[[e,1,t]]}))}function fe(t,n){if(n in M["c"]){var a=F.reduce((function(e,n,a){return a<t?e+n:e}),0),r=e.cloneDeep(F);r[t]=0,Z(w()(z,{$splice:[[a,F[t]]]})),D(r)}R(w()(J,{$splice:[[t,1,{widget:n}]]}))}function se(t,n){var a=e.cloneDeep(F);a.splice(t,0,0),D(a);var r=e.cloneDeep(J);r.splice(t,0,{widget:n}),R(r),L(w()(A,{$splice:[[t,0,null]]}))}var de=Object(N["cb"])(f),me=Object(u["a"])(Object(u["a"])({},s),{},{style:$,fields:"default"===$&&z});if(Object(E["useEffect"])((function(){p(me)}),[F,A,J,$,z]),"default"!==$){var pe=0;me.sections=[],F.forEach((function(e,t){me.sections.push({title:A[t],fields:z.slice(pe,pe+e),style:J[t]}),pe+=e}))}var ve=j.a.createElement(x["b"],{sectionStyle:J,style:$,sections:F,sectionTitles:A,setSections:D,bordered:!1,allData:z,setData:Z,modalView:ae,columns:[{title:"\u663e\u793a\u540d\u79f0",key:"alias",render:function(e){var t;return null!==(t=e.alias)&&void 0!==t?t:de(e.name)}},{title:"\u5b57\u6bb5",key:"name",render:function(e,t,n,a){return j.a.createElement(V["a"],{value:e.name,onChange:function(e){return oe(n,a,e)},model:f},j.a.createElement(T["a"],{fieldPath:e.name,modelName:f}))}},{title:"\u64cd\u4f5c",key:"operation",render:function(e,t,n,a){return j.a.createElement(j.a.Fragment,null,j.a.createElement("a",{onClick:function(){return le(n,a)}},"\u5220\u9664"))}}],footer:function(e){return j.a.createElement(m["a"],{onClick:function(){r=e,ie()}},"\u6dfb\u52a0\u5b57\u6bb5")},expandedRowRender:function(e,t,n,a,r){return _(Object(x["c"])(t,r,F))},addAndDeleteView:function(e){var t;return"default"!==$&&j.a.createElement("div",null,"\u5361\u7247\u7c7b\u578b\uff1a",j.a.createElement(b["a"],{value:(null===(t=J[e])||void 0===t?void 0:t.widget)||"cell",onChange:function(t){return fe(e,t)},style:{minWidth:120,maxWidth:200}},j.a.createElement(b["a"].Option,{value:"cell"},"\u5b57\u6bb5\u5217\u8868"),j.a.createElement(b["a"].Option,{value:"tiles"},"\u5b57\u6bb5\u5e73\u94fa"),j.a.createElement(b["a"].Option,{value:"table"},"\u5b57\u6bb5\u8868\u683c"),j.a.createElement(b["a"].Option,{value:"table-v"},"\u5782\u76f4\u5b57\u6bb5\u8868\u683c"),Object.keys(M["e"]).map((function(e){return M["e"][e].includes(f)&&j.a.createElement(b["a"].Option,{value:e},M["d"][e])}))),0!==e&&j.a.createElement(m["a"],{icon:"delete",onClick:function(){return ce(e)}},"\u5220\u9664"))},addAndWidget:function(e){return"default"!==$&&j.a.createElement("div",null,j.a.createElement(l["a"],{overlay:j.a.createElement(o["a"],{onClick:function(t){return se(e+1,t.key)}},j.a.createElement(o["a"].Item,{key:"cell"},"\u5b57\u6bb5\u5217\u8868"),j.a.createElement(o["a"].Item,{key:"tiles"},"\u5b57\u6bb5\u5e73\u94fa"),j.a.createElement(o["a"].Item,{key:"table"},"\u5b57\u6bb5\u8868\u683c"),j.a.createElement(o["a"].Item,{key:"table-v"},"\u5782\u76f4\u5b57\u6bb5\u8868\u683c"),Object.keys(M["e"]).map((function(e){return M["e"][e].includes(f)&&j.a.createElement(o["a"].Item,{key:e},M["d"][e])}))),trigger:["click"]},j.a.createElement(m["a"],{type:"dashed",block:!0},j.a.createElement(c["a"],{type:"plus"}))))},tableTitle:function(e){return"default"!==$&&j.a.createElement("div",null,"".concat(K[$],"\u540d\u79f0"),"\xa0\xa0",j.a.createElement(h["a"],{style:{width:100},value:A[e],onChange:function(t){return ue(e,t.target.value)},placeholder:"\u7b2c".concat(e+1,"\u7ec4")}))}});return ve}var R=(a={},Object(i["a"])(a,L["b"],G),Object(i["a"])(a,L["c"],J),a);t["a"]=R[L["a"]]}).call(this,n("LvDl"))},D27F:function(e,t,n){"use strict";n("SePM");var a=n("PMX6"),r=(n("vmZS"),n("NjVP")),i=(n("6dnR"),n("CQJL")),l=n("tJVT"),c=n("q1tI"),o=n.n(c),u=n("OTll");function f(e){var t=e.modelName,n=e.schemas,f=e.adminConfig,s=e.bsmSetting,d=Object(u["a"])({modelName:t,schemas:n,adminConfig:f,bsmSetting:s}),m=Object(l["a"])(d,6),p=m[0],v=m[1],b=m[2],h=m[3],y=m[4],g=m[5],O=Object(c["useState"])(f[t].modalForm),E=Object(l["a"])(O,2),j=E[0],C=E[1],w={formFields:v,formLayout:g,modalForm:j};function S(){var e=y();return w.formFields=e,w}function N(){b()}function k(){return h()}var F=o.a.createElement(o.a.Fragment,null,p,o.a.createElement(a["a"],{title:"\u57fa\u672c\u8bbe\u7f6e",type:"inner"},o.a.createElement(r["a"],{layout:"inline"},o.a.createElement(r["a"].Item,{label:"\u8868\u5355\u754c\u9762"},o.a.createElement(i["a"].Group,{value:j,onChange:function(e){return C(e.target.value)}},o.a.createElement(i["a"],{value:!0},"\u5f39\u7a97\u7f16\u8f91"),o.a.createElement(i["a"],{value:!1},"\u65b0\u9875\u9762\u7f16\u8f91"))))));return[F,w,N,S,k]}t["a"]=f},LK96:function(e,t,n){"use strict";n("SePM");var a=n("PMX6"),r=(n("vmZS"),n("NjVP")),i=(n("6dnR"),n("CQJL")),l=n("tJVT"),c=n("q1tI"),o=n.n(c),u=n("Ol5k");function f(e){var t=e.modelName,n=e.schemas,f=e.adminConfig,s=e.bsmSetting,d=Object(u["a"])({modelName:t,schemas:n,adminConfig:f,bsmSetting:s}),m=Object(l["a"])(d,5),p=m[0],v=m[1],b=m[2],h=m[3],y=m[4],g=Object(c["useState"])(f[t].modalDetail),O=Object(l["a"])(g,2),E=O[0],j=O[1],C={detail:void 0,details:b,modalDetail:E},w=function(){var e=y();return C.details=e,C};function S(){h()}var N=o.a.createElement(o.a.Fragment,null,p,o.a.createElement(a["a"],{title:"\u57fa\u672c\u8bbe\u7f6e",type:"inner"},o.a.createElement(r["a"],{layout:"inline"},o.a.createElement(r["a"].Item,{label:"\u8be6\u60c5\u754c\u9762"},o.a.createElement(i["a"].Group,{value:!!E,onChange:function(e){return j(e.target.value)}},o.a.createElement(i["a"],{value:!0},"\u5f39\u7a97"),o.a.createElement(i["a"],{value:!1},"\u65b0\u9875\u9762"))))),v);return[N,C,S,w]}t["a"]=f},MxUj:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return i}));var a="v1",r="v2",i=r},OTll:function(e,t,n){"use strict";(function(e){var a,r,i=n("jrin"),l=(n("4X2C"),n("xvon")),c=(n("eE3J"),n("GSZB")),o=(n("eNCU"),n("pjJH")),u=(n("QjdF"),n("U4Vl")),f=(n("SePM"),n("PMX6")),s=(n("Ahcs"),n("k0dM")),d=(n("vc6j"),n("Q9CN")),m=(n("UvA9"),n("u4G2")),p=(n("vmZS"),n("NjVP")),v=n("k1fw"),b=n("oBTY"),h=n("tJVT"),y=(n("OaEy"),n("2fM7")),g=n("q1tI"),O=n.n(g),E=n("4b23"),j=n.n(E),C=n("RsOY"),w=n.n(C),S=n("9Ndd"),N=n("HrPU"),k=n("VW+w"),F=n("O/S9"),D=n("jfUH"),P=n("mmaM"),I=n("umGZ"),A=n("cPjh"),x=n("hzhw"),V=n("MxUj"),L=n("5jOq"),M=n.n(L),T=function(e){var t=e.value,n=e.onChange,a=e.model,r=e.disabledField,i=e.bordered,l=void 0===i||i,c=e.dropdownMatchSelectWidth,o=e.showSearch,u=void 0===o||o,f=Object(D["tb"])(a)||[];return O.a.createElement(y["a"],{bordered:l,showArrow:l,dropdownMatchSelectWidth:c,value:t,onChange:n,showSearch:u,filterOption:function(e,t){var n=t.props,a=n.value,r=n.children,i=e.toLowerCase();return a.replace(/_/g,"").toLowerCase().includes(i)||r.toLowerCase().includes(i)}},f.map((function(e){return O.a.createElement(y["a"].Option,{value:e.name,disabled:r&&r(e)},e.displayName)})))},K={group:"\u5206\u7ec4",tab:"\u6807\u7b7e",step:"\u5206\u6b65"};function W(t){var n=t.schemas,a=t.modelName,r=t.adminConfig,i=t.bsmSetting.staff_model,l=Object(g["useState"])(e.cloneDeep(r[a].formFields)),c=Object(h["a"])(l,2),o=c[0],u=c[1],f=Object(g["useState"])([]),s=Object(h["a"])(f,2),E=s[0],C=s[1],w=Object(g["useState"])(!1),A=Object(h["a"])(w,2),x=A[0],V=A[1],L=n[a].fields,K=Object(S["h"])(),W=Object(S["g"])(),U={},G=function(t,n){var a=[],r=[];t.forEach((function(t,n){var i=t;i.showIf&&(e.isArray(i.showIf)?i.showIf:[i.showIf]).forEach((function(t,i){if(e.isObject(t.value)){var l=L.find((function(e){return e.name===t.field})),c=new Promise((function(e){Object(P["queryContent"])({model:l.ref,filters:[{field:Object(D["L"])(l.ref),operator:"in",value:t.value}]}).then((function(t){var r=t.list;a.push([n,i,r]),e()}))}));r.push(c)}}))}));var i=t;e.isEmpty(r)?n&&n(i):Promise.all(r).then((function(){a.forEach((function(e){var t=Object(h["a"])(e,3),n=t[0],a=t[1],r=t[2];i[n].showIf[a].value=r})),u(i),n&&n(i)}))},J=function(t,n){var r=[],i=[];t.forEach((function(t,n){t.choicesFilter&&t.choicesFilter.forEach((function(l,c){if(e.isArray(l.value)){var o=Object(D["t"])(a,"".concat(t.name,".").concat(l.field));i.push(Object(P["queryContent"])({model:o.ref,filters:[{field:Object(D["L"])(o.ref),operator:"in",value:l.value}]}).then((function(e){var t=e.list;r.push([n,c,t])})))}}))}));var l=e.cloneDeep(t);e.isEmpty(i)?n&&n(l):Promise.all(i).then((function(){r.forEach((function(e){var t=Object(h["a"])(e,3),n=t[0],a=t[1],r=t[2];l[n].choicesFilter[a].value=r})),u(l),n&&n(l)}))};function R(){u(r[a].formFields)}function $(){return!0}function B(){u([].concat(Object(b["a"])(o),[{params:{}}]))}function q(e){return{name:e,params:{}}}function _(e){var t=e.map(q);u([].concat(Object(b["a"])(o),Object(b["a"])(t)))}function z(t){var n=e.cloneDeep(o);n.splice(t,1),u(n)}function X(t,n){var a=e.cloneDeep(o);a[t]={name:n,params:{}},u(a)}function H(t,n,a){var r=e.cloneDeep(o);r[t][a]=n,u(r)}function Z(t,n,a){var r=e.cloneDeep(o);r[t].params[n]=a,u(r)}function Q(t,r){var i=e.cloneDeep(o);if(r){i[t].widget=r;var l=n[a].fields.find((function(e){return e.name===i[t].name}));if(["TreeSelect","Cascader"].includes(r)){var c=n[l.ref].fields.find((function(e){return Object(D["D"])(e)&&e.ref===l.ref}));c&&(i[t].params.parent=c.name)}if(["Gallery"].includes(r)){var f=n[l.ref].fields.find((function(e){return["string","text","image","file"].includes(e.type)}));f&&(i[t].params.urlField=f.name)}}else delete i[t].widget;u(i)}function Y(){var t=e.cloneDeep(o).filter((function(e){return e.name})).map((function(t){var n=t;return n.showIf&&(n.showIf=n.showIf.filter((function(e){return e.field&&e.operator&&void 0!==e.value})).map((function(t){var n=Object(v["a"])({},t);if(e.isObject(n.value)){var a=L.find((function(e){return e.name===t.field}));e.isArray(n.value)&&(n.value=n.value.map((function(e){return Object(D["K"])(e,a.ref)})))}return n})),n.choicesFilter&&(n.choicesFilter=n.choicesFilter.filter((function(e){return e.field&&e.operator&&void 0!==e.value})).map((function(n){var r=Object(v["a"])({},n);if(e.isObject(r.value)){var i=Object(D["t"])(a,"".concat(t.name,".").concat(n.field));e.isArray(r.value)&&(r.value=r.value.map((function(e){return Object(D["K"])(e,i.ref)})))}return r})))),e.isEmpty(t.groups)||(n.groups=n.groups.filter((function(e){return e})).map((function(e){return e.id||e}))),t.id||(n.id=j()(6)),n}));return t}Object(g["useEffect"])((function(){if(i){var e=[];n[a].fields.forEach((function(t){t.ref===i&&e.push(t)})),C(e)}G(o,(function(e){return J(e,(function(){return V(!0)}))}))}),[]);var ee={handleAdd:B,handleDelete:z,setFormFields:u,changeFieldName:X,addFields:_,getField:q};function te(t){var l,c;if(void 0===t)return null;var f=o[t];if(!f.name)return null;var s=L.find((function(e){return e.name===f.name})),v=f.name&&Object(k["formFieldsPreprocess"])([e.cloneDeep(f)],[e.cloneDeep(s)])[0].widget;return O.a.createElement(p["a"],{labelCol:{span:5},wrapperCol:{span:19}},O.a.createElement(p["a"].Item,{label:"\u5b57\u6bb5"},O.a.createElement(T,{value:f.name,onChange:function(e){return X(t,e)},model:a,disabledField:function(e){return o.map((function(e){return e.name})).includes(e.name)&&e.name!==f.name}})),f.name&&O.a.createElement(p["a"].Item,{label:"\u7ec4\u4ef6"},O.a.createElement(y["a"],{value:f.widget||null,onChange:function(e){return Q(t,e)}},O.a.createElement(y["a"].Option,{value:null},"\u9ed8\u8ba4\uff08",K[S["e"][s.type]]||S["e"][s.type],"\uff09"),e.uniq(W[s.type].concat(s.choices?["Select"]:[])).map((function(e){return O.a.createElement(y["a"].Option,{value:e,disabled:U[e]},K[e]||e)})))),["TreeSelect","Cascader"].includes(v)&&O.a.createElement(p["a"].Item,{label:"\u7236\u7ea7\u5b57\u6bb5",help:"\u8fd9\u4e2a\u5b57\u6bb5\u7528\u4e8e\u6307\u5411\u7236\u7ea7\u8bb0\u5f55"},O.a.createElement(y["a"],{value:f.params.parent,onChange:function(e){return Z(t,"parent",e)}},n[s.ref].fields.filter(D["D"]).filter((function(e){return e.ref===s.ref})).map((function(e){return O.a.createElement(y["a"].Option,{value:e.name},e.displayName)})))),["GroupCascader"].includes(v)&&O.a.createElement(p["a"].Item,{label:"\u5206\u7ec4\u5b57\u6bb5",required:!0},O.a.createElement(N["a"],{value:f.params.groupBy,model:s.ref,onChange:function(e){return Z(t,"groupBy",e)},fieldFilter:D["D"]})),["Gallery"].includes(v)&&O.a.createElement(p["a"].Item,{label:"\u56fe\u7247\u5730\u5740\u5b57\u6bb5",help:"\u8fd9\u4e2a\u5b57\u6bb5\u7528\u4e8e\u5b58\u653e\u56fe\u7247\u94fe\u63a5\u5730\u5740"},O.a.createElement(y["a"],{value:f.params.urlField,onChange:function(e){return Z(t,"urlField",e)}},n[s.ref].fields.filter((function(e){return["string","text","image","file"].includes(e.type)})).map((function(e){return O.a.createElement(y["a"].Option,{value:e.name},e.displayName)})))),[("InlineForm"===v||"InnerTable"===v||"Select"===v&&"mref"===s.type)&&O.a.createElement(p["a"].Item,{label:"\u5141\u8bb8\u65b0\u589e"},O.a.createElement(m["a"],{checked:f.params.canAdd,onChange:function(e){return Z(t,"canAdd",e.target.checked)}}))],"Select"===v&&(Object(D["C"])(s)||"mref"===s.type)&&O.a.createElement(p["a"].Item,{label:"\u9009\u9879\u4e2a\u6570",help:"\u4e0b\u62c9\u9009\u62e9\u6846\u9009\u62e9\u65f6\u663e\u793a\u7684\u4e2a\u6570"},O.a.createElement(d["a"],{min:1,placeholder:"\u9ed8\u8ba4\u4e3a7",value:f.params.optionSize,onChange:function(e){return Z(t,"optionSize",e)}})),O.a.createElement("div",{className:M.a.divider,style:{marginBottom:16}},"\u6743\u9650\u8bbe\u7f6e"),O.a.createElement(I["a"],{groupsValue:null!==(l=null===(c=f.groups)||void 0===c?void 0:c.filter((function(e){return!("number"===typeof e)})))&&void 0!==l?l:[],groupsOnChange:function(n){var a=e.cloneDeep(o);a[t].groups=n,u(Object(b["a"])(a))},userValue:f.userField,userOnChange:function(n){var a=e.cloneDeep(o);a[t].userField=n,u(Object(b["a"])(a))},staffModelFields:E,staffModel:i,defauldGroupValue:r[a].formFields[t]}),O.a.createElement(p["a"].Item,{label:"\u6ee1\u8db3\u6761\u4ef6\u663e\u793a"},O.a.createElement(F["a"],{fields:L,onChange:function(e){return H(t,e,"showIf")},value:f.showIf,disabledField:function(e){return f.showIf.filter((function(e){return e.field})).map((function(e){return e.field})).includes(e.name)},context:{model:a}})),[(!e.isEmpty(s)&&Object(D["D"])(s)||"mref"===s.type)&&O.a.createElement(p["a"].Item,{label:"\u8fc7\u6ee4\u6761\u4ef6\uff1a"},O.a.createElement(F["a"],{fields:n[s.ref].fields,onChange:function(e){return H(t,e,"choicesFilter")},value:f.choicesFilter,disabledFilte:f.choicesFilter,context:{model:a},valueTypes:["\u6307\u5b9a\u503c","\u53ef\u53d8\u503c"]}))])}return[te,o,R,$,Y,ee,x]}function U(e){var t=e.schemas,n=e.modelName,a=e.adminConfig,r=e.bsmSetting,i=Object(g["useState"])(String(0)),l=Object(h["a"])(i,2),c=l[0],o=l[1],d=W({schemas:t,modelName:n,adminConfig:a,bsmSetting:r}),m=Object(h["a"])(d,6),p=m[0],v=m[1],b=m[2],y=m[3],E=m[4],j=m[5],C=Object(x["a"])({modelName:n,schemas:t,adminConfig:a,formFields:v}),w=Object(h["a"])(C,3),S=w[0],N=w[1],k=w[2],F=j.handleAdd,D=j.handleDelete,P=t[n].fields;function I(){b(),k()}var A=O.a.createElement(O.a.Fragment,null,O.a.createElement(f["a"],{title:"\u8868\u5355\u5b57\u6bb5",type:"inner"},O.a.createElement(s["a"],{tabBarStyle:{minWidth:48},activeKey:c,tabPosition:"left",type:"editable-card",onChange:o,onEdit:function(e,t){switch(t){case"add":F(),o(String(v.length));break;case"remove":D(e);break;default:}}},v.map((function(e,t){var n=P.find((function(t){return t.name===e.name}));return O.a.createElement(s["a"].TabPane,{tab:(n||{}).displayName||"\u5b57\u6bb5".concat(t+1),key:t,closable:!n||!n.required||v.filter((function(t){return t.name===e.name})).length>=2},p(t))})))),O.a.createElement(u["a"],null),S);return[A,v,I,y,E,N]}function G(t){var n=t.modelName,a=t.adminConfig,i=t.schemas,u=t.bsmSetting,f=W({schemas:i,modelName:n,adminConfig:a,bsmSetting:u}),s=Object(h["a"])(f,7),d=s[0],m=s[1],p=s[2],v=s[3],y=s[4],E=s[5],j=s[6],C=Object(g["useState"])([m.length]),N=Object(h["a"])(C,2),k=N[0],F=N[1],D=Object(g["useState"])([]),P=Object(h["a"])(D,2),I=P[0],x=P[1],V=E.handleDelete,L=E.setFormFields,M=E.changeFieldName,U=E.getField;function G(e){var t=0,n=e.length+k[r];k.forEach((function(e,n){n<=r&&(t+=e)}));var a=e.map(U),i=w()(m,{$splice:[[t,0].concat(Object(b["a"])(a))]});L(i),F(w()(k,{$splice:[[r,1,n]]}))}var J,R=Object(A["d"])({modelName:n,schemas:i,onOk:function(){return G(q)},fieldDisabled:function(e){return m.map((function(e){return e.name})).includes(e.name)},expand:!1}),$=Object(h["a"])(R,3),B=$[0],q=$[1],_=$[2],z=a[n].formLayout,X=Object(g["useState"])((null===z||void 0===z?void 0:z.style)||"default"),H=Object(h["a"])(X,2),Z=H[0],Q=H[1];function Y(e,t){V(Object(A["c"])(e,t,k)),F(w()(k,{$splice:[[t,1,k[t]-1]]}))}function ee(e){var t=k.reduce((function(t,n,a){return a<e?t+n:t}),0);L(w()(m,{$splice:[[t,k[e]]]})),F(w()(k,{$splice:[[e,1]]})),x(w()(I,{$splice:[[e,1]]}))}function te(e,t,n){M(Object(A["c"])(e,t,k),n)}function ne(e,t){x(w()(I,{$splice:[[e,1,t]]}))}function ae(e){Q(e),"default"===e&&(F([m.length]),x([I[0]]))}function re(e){return 0!==e&&O.a.createElement(o["a"],{icon:"delete",onClick:function(){return ee(e)}},"\u5220\u9664")}function ie(t){var n=e.cloneDeep(k);n.splice(t,0,0),F(n),x(w()(I,{$splice:[[t,0,null]]}))}function le(){if(z&&"default"!==z.style&&!e.isEmpty(z.sections)){var t=[],n=[],a=[];z.sections.forEach((function(e){var r=[];e.fields.forEach((function(e){var t=m.find((function(t){return t.name===e}));t&&r.push(t)})),a.push.apply(a,r),n.push(r.length),e.title&&t.push(e.title)})),L(a),F(n),x(t)}}if(Object(g["useEffect"])((function(){j&&le()}),[j]),"default"!==Z){J={style:Z,sections:[]};var ce=0;k.forEach((function(e,t){e&&(J.sections.push({title:I[t],fields:m.slice(ce,ce+e).map((function(e){return e.name}))}),ce+=e)}))}else J=void 0;function oe(){p(),le()}var ue=O.a.createElement(A["b"],{sections:k,sectionTitles:I,setSections:F,allData:m,bordered:!1,setData:L,title:"\u8868\u5355\u5b57\u6bb5",modalView:B,columns:[{title:"\u5b57\u6bb5",key:"name",render:function(e,t,a,r){return O.a.createElement(T,{value:e.name,onChange:function(e){return te(a,r,e)},model:n,disabledField:function(t){return m.map((function(e){return e.name})).includes(t.name)&&t.name!==e.name},bordered:!1,dropdownMatchSelectWidth:!1,showSearch:!1})}},{title:"\u7ec4\u4ef6",key:"widget",render:function(e,t,a){var r=m[a],l=i[n].fields,c=l.find((function(e){return e.name===r.name}));return e.widget?S["a"][e.widget]||e.widget:"\u9ed8\u8ba4\uff08".concat(S["a"][S["e"][c.type]]||S["e"][c.type],"\uff09")}},{title:"\u64cd\u4f5c",key:"operation",render:function(e,t,n,a){return O.a.createElement("a",{onClick:function(){return Y(n,a)}},"\u5220\u9664")}}],footer:function(e){return O.a.createElement(o["a"],{onClick:function(){r=e,_()}},"\u6dfb\u52a0\u5b57\u6bb5")},expandedRowRender:function(e,t,n,a,r){return d(Object(A["c"])(t,r,k))},addAndDeleteView:"default"!==Z?re:null,addAndWidget:function(e){return"default"!==Z&&O.a.createElement("div",null,O.a.createElement(o["a"],{type:"dashed",onClick:function(){return ie(e+1)},block:!0},O.a.createElement(c["a"],{type:"plus"})))},styleView:function(){return O.a.createElement(A["a"],{onChange:ae,value:Z,layouts:K})},tableTitle:function(e){return"default"!==Z&&O.a.createElement("div",null,"".concat(K[Z],"\u540d\u79f0"),"\xa0\xa0",O.a.createElement(l["a"],{style:{width:100},value:I[e],onChange:function(t){return ne(e,t.target.value)},placeholder:"\u7b2c".concat(e+1,"\u7ec4")}))}});return[ue,m,oe,v,y,J]}var J=(a={},Object(i["a"])(a,V["b"],U),Object(i["a"])(a,V["c"],G),a);t["a"]=J[V["a"]]}).call(this,n("LvDl"))},Ol5k:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return j}));var a=n("k1fw"),r=(n("Ahcs"),n("k0dM")),i=(n("IzEo"),n("bx4M")),l=(n("52nx"),n("7bDm")),c=(n("4X2C"),n("xvon")),o=n("tJVT"),u=n("oBTY"),f=n("q1tI"),s=n.n(f),d=n("Ty5D"),m=n("4b23"),p=n.n(m),v=n("jfUH"),b=n("wiuW"),h=n("+dfd");function y(e,t){e(t)}function g(e,t,n,a){var r=Object(u["a"])(n);r[a].title=t,e(r)}var O=e.debounce(y,100),E=e.debounce(g,100);function j(t){var n,m=t.modelName,y=t.adminConfig,g=t.schemas,j=t.bsmSetting,C=Object(d["m"])(),w=C.params.key,S=function(){return Object(u["a"])(y[m].details||[])},N=Object(f["useState"])(S),k=Object(o["a"])(N,2),F=k[0],D=k[1],P=Object(f["useState"])(),I=Object(o["a"])(P,2),A=I[0],x=I[1],V=Object(f["useState"])(),L=Object(o["a"])(V,2),M=L[0],T=L[1],K=Object(f["useState"])(w||(null===(n=F[0])||void 0===n?void 0:n.key)),W=Object(o["a"])(K,2),U=W[0],G=W[1];Object(f["useEffect"])((function(){w&&G(w)}),[w]);var J=s.a.createElement("div",null,s.a.createElement(l["a"],{title:"\u6dfb\u52a0\u6807\u7b7e",visible:A,okButtonProps:{disabled:!M},destroyOnClose:!0,onOk:function(){var e=F,t=p()(6);e.push({key:t,sections:[],title:M,style:"group"}),D(e),G(t),x(!1)},onCancel:function(){return x(!1)}},s.a.createElement("span",null,"\u6807\u7b7e\u540d\u79f0\uff1a"),s.a.createElement(c["a"],{onChange:function(e){return O(T,e.target.value)},style:{width:300}})),s.a.createElement(r["a"],{type:"editable-card",activeKey:U,onChange:function(e){return G(e)},onEdit:function(e,t){if("add"===t&&x(!0),"remove"===t){var n,a,r=F.filter((function(t,n){return t.key!==e||(a=n-1,a<0&&(a=0),!1)}));e===U&&G(null===(n=r[a])||void 0===n?void 0:n.key),D(r)}}},F.map((function(e,t){return s.a.createElement(r["a"].TabPane,{tab:e.title||"\u8be6\u60c5".concat(t+1),key:e.key,closable:1!==F.length},s.a.createElement(i["a"],null,s.a.createElement("span",null,"\u6807\u7b7e\u540d\u79f0\uff1a"),s.a.createElement(c["a"],{onChange:function(e){return E(D,e.target.value,F,t)},style:{width:300},defaultValue:e.title||"\u8be6\u60c5".concat(t+1)})),s.a.createElement(h["a"],{modelName:m,schemas:g,detailValue:e,bsmSetting:j,onChange:function(e){var n=F;n[t]=e,D(n)}}))}))));function R(){D(S())}function $(t){var n=t;function r(t){return t.map((function(t){return e.isString(t)?{name:t}:t})).filter((function(e){return e.name})).map((function(t){var n=Object(a["a"])({},t);return n.showIf&&(n.showIf=Object(v["F"])(t.showIf,m)),e.isEmpty(t.groups)||(n.groups=n.groups.filter((function(e){return e})).map((function(e){return e.id||e}))),t.id||(n.id=p()(6)),n}))}return"default"!==t.style&&t.sections?n.sections=n.sections.filter((function(t){var n;return(null===(n=t.style)||void 0===n?void 0:n.widget)in b["c"]||!e.isEmpty(t.fields)})).map((function(e){var t,n=e;return(null===(t=e.style)||void 0===t?void 0:t.widget)in b["c"]?n.fields=[]:n.fields=r(n.fields),n})):n.fields=r(n.fields),n}function B(){return F.map((function(e){return $(e)}))}return[J,void 0,F,R,B]}}).call(this,n("LvDl"))},hzhw:function(e,t,n){"use strict";(function(e){n("Dvpn");var a=n("myml"),r=(n("eNCU"),n("pjJH")),i=n("oBTY"),l=(n("QjdF"),n("U4Vl")),c=(n("yavW"),n("WuMn")),o=(n("4X2C"),n("xvon")),u=(n("vmZS"),n("NjVP")),f=(n("6dnR"),n("CQJL")),s=n("tJVT"),d=n("q1tI"),m=n.n(d),p={group:"\u5206\u7ec4",tab:"\u6807\u7b7e",step:"\u5206\u6b65"};function v(t){var n=t.schemas,v=t.modelName,b=t.adminConfig,h=t.formFields,y="default",g=[];b[v].formLayout&&(y=b[v].formLayout.style||y,g=e.cloneDeep(b[v].formLayout.sections));var O=Object(d["useState"])(y),E=Object(s["a"])(O,2),j=E[0],C=E[1],w=Object(d["useState"])(g),S=Object(s["a"])(w,2),N=S[0],k=S[1];function F(t,n){var a=e.cloneDeep(N);a[t].title=n,k(a)}function D(t,n){var a=e.cloneDeep(N);a[t].fields=n,k(a)}function P(){C(y),k(g)}function I(t){var n=e.cloneDeep(N);n.splice(t,1),k(n)}function A(t){var n=e.cloneDeep(N),a=t-1,r=[n[t],n[a]];n[a]=r[0],n[t]=r[1],k(n)}function x(t){var n=e.cloneDeep(N),a=t+1,r=[n[t],n[a]];n[a]=r[0],n[t]=r[1],k(n)}var V=m.a.createElement(u["a"],{layout:"inline"},m.a.createElement(u["a"].Item,{label:"\u6392\u5217\u65b9\u5f0f"},m.a.createElement(f["a"].Group,{value:j,onChange:function(e){return C(e.target.value)}},m.a.createElement(f["a"],{value:"default"},"\u9ed8\u8ba4"),e.map(p,(function(e,t){return m.a.createElement(f["a"],{value:t},e)})))),"default"!==j&&m.a.createElement(m.a.Fragment,null,m.a.createElement(a["a"],{style:{marginTop:24},size:"middle",bordered:!0,dataSource:N,pagination:!1,columns:[{title:"".concat(p[j],"\u540d\u79f0"),key:"title",render:function(e,t,n){return m.a.createElement(o["a"],{value:e.title,onChange:function(e){return F(n,e.target.value)}})}},{title:"\u6240\u542b\u5b57\u6bb5",key:"fields",render:function(e,t,a){return m.a.createElement(c["a"],{mode:"multiple",value:e.fields,onChange:function(e){return D(a,e)}},h.filter((function(e){return e.name})).map((function(t){return m.a.createElement(c["a"].Option,{value:t.name,disabled:N.map((function(e){return e.fields})).flat().includes(t.name)&&!(e.fields||[]).includes(t.name)},n[v].fields.find((function(e){return e.name===t.name})).displayName)})))}},{title:"\u64cd\u4f5c",key:"option",render:function(e,t,n){return m.a.createElement(m.a.Fragment,null,m.a.createElement("a",{onClick:function(){return I(n)}},"\u5220\u9664"),n>0&&m.a.createElement(m.a.Fragment,null,m.a.createElement(l["a"],{type:"vertical"}),m.a.createElement("a",{onClick:function(){return A(n)}},"\u4e0a\u79fb")),n<N.length-1&&m.a.createElement(m.a.Fragment,null,m.a.createElement(l["a"],{type:"vertical"}),m.a.createElement("a",{onClick:function(){return x(n)}},"\u4e0b\u79fb")))}}],footer:function(){return m.a.createElement(r["a"],{onClick:function(){return k([].concat(Object(i["a"])(N),[{}]))}},"\u6dfb\u52a0",p[j])}}))),L={style:j,sections:N};return[V,"default"===j?void 0:L,P]}t["a"]=v}).call(this,n("LvDl"))},rfrl:function(e,t,n){"use strict";function a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(e){return!!e&&!!e[B]}function i(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return!t||t===Object.prototype}(e)||Array.isArray(e)||!!e[$]||!!e.constructor[$]||d(e)||m(e))}function l(e,t,n){void 0===n&&(n=!1),0===c(e)?(n?Object.keys:q)(e).forEach((function(a){n&&"symbol"==typeof a||t(a,e[a],e)})):e.forEach((function(n,a){return t(a,n,e)}))}function c(e){var t=e[B];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:d(e)?2:m(e)?3:0}function o(e,t){return 2===c(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return 2===c(e)?e.get(t):e[t]}function f(e,t,n){var a=c(e);2===a?e.set(t,n):3===a?(e.delete(t),e.add(n)):e[t]=n}function s(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){return U&&e instanceof Map}function m(e){return G&&e instanceof Set}function p(e){return e.o||e.t}function v(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=_(e);delete t[B];for(var n=q(t),a=0;a<n.length;a++){var r=n[a],i=t[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(Object.getPrototypeOf(e),t)}function b(e,t){y(e)||r(e)||!i(e)||(c(e)>1&&(e.set=e.add=e.clear=e.delete=h),Object.freeze(e),t&&l(e,(function(e,t){return b(t,!0)}),!0))}function h(){a(2)}function y(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function g(e){var t=z[e];return t||a(18,e),t}function O(){return K}function E(e,t){t&&(g("Patches"),e.u=[],e.s=[],e.v=t)}function j(e){C(e),e.p.forEach(S),e.p=null}function C(e){e===K&&(K=e.l)}function w(e){return K={p:[],l:K,h:e,m:!0,_:0}}function S(e){var t=e[B];0===t.i||1===t.i?t.j():t.g=!0}function N(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||g("ES5").S(t,e,r),r?(n[B].P&&(j(t),a(4)),i(e)&&(e=k(t,e),t.l||D(t,e)),t.u&&g("Patches").M(n[B],e,t.u,t.s)):e=k(t,n,[]),j(t),t.u&&t.v(t.u,t.s),e!==R?e:void 0}function k(e,t,n){if(y(t))return t;var a=t[B];if(!a)return l(t,(function(r,i){return F(e,a,t,r,i,n)}),!0),t;if(a.A!==e)return t;if(!a.P)return D(e,a.t,!0),a.t;if(!a.I){a.I=!0,a.A._--;var r=4===a.i||5===a.i?a.o=v(a.k):a.o;l(3===a.i?new Set(r):r,(function(t,i){return F(e,a,r,t,i,n)})),D(e,r,!1),n&&e.u&&g("Patches").R(a,n,e.u,e.s)}return a.o}function F(e,t,n,a,l,c){if(r(l)){var u=k(e,l,c&&t&&3!==t.i&&!o(t.D,a)?c.concat(a):void 0);if(f(n,a,u),!r(u))return;e.m=!1}if(i(l)&&!y(l)){if(!e.h.N&&e._<1)return;k(e,l),t&&t.A.l||D(e,l)}}function D(e,t,n){void 0===n&&(n=!1),e.h.N&&e.m&&b(t,n)}function P(e,t){var n=e[B];return(n?p(n):e)[t]}function I(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=Object.getPrototypeOf(n)}}function A(e){e.P||(e.P=!0,e.l&&A(e.l))}function x(e){e.o||(e.o=v(e.t))}function V(e,t,n){var a=d(t)?g("MapSet").T(t,n):m(t)?g("MapSet").F(t,n):e.O?function(e,t){var n=Array.isArray(e),a={i:n?1:0,A:t?t.A:O(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},r=a,i=X;n&&(r=[a],i=H);var l=Proxy.revocable(r,i),c=l.revoke,o=l.proxy;return a.k=o,a.j=c,o}(t,n):g("ES5").J(t,n);return(n?n.A:O()).p.push(a),a}function L(e){return r(e)||a(22,e),function e(t){if(!i(t))return t;var n,a=t[B],r=c(t);if(a){if(!a.P&&(a.i<4||!g("ES5").K(a)))return a.t;a.I=!0,n=M(t,r),a.I=!1}else n=M(t,r);return l(n,(function(t,r){a&&u(a.t,t)===r||f(n,t,e(r))})),3===r?new Set(n):n}(e)}function M(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return v(e)}var T,K,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),U="undefined"!=typeof Map,G="undefined"!=typeof Set,J="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,R=W?Symbol.for("immer-nothing"):((T={})["immer-nothing"]=!0,T),$=W?Symbol.for("immer-draftable"):"__$immer_draftable",B=W?Symbol.for("immer-state"):"__$immer_state",q=("undefined"!=typeof Symbol&&Symbol.iterator,"undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames),_=Object.getOwnPropertyDescriptors||function(e){var t={};return q(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},z={},X={get:function(e,t){if(t===B)return e;var n=p(e);if(!o(n,t))return function(e,t,n){var a,r=I(t,n);return r?"value"in r?r.value:null===(a=r.get)||void 0===a?void 0:a.call(e.k):void 0}(e,n,t);var a=n[t];return e.I||!i(a)?a:a===P(e.t,t)?(x(e),e.o[t]=V(e.A.h,a,e)):a},has:function(e,t){return t in p(e)},ownKeys:function(e){return Reflect.ownKeys(p(e))},set:function(e,t,n){var a=I(p(e),t);if(null==a?void 0:a.set)return a.set.call(e.k,n),!0;if(!e.P){var r=P(p(e),t),i=null==r?void 0:r[B];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(s(n,r)&&(void 0!==n||o(e.t,t)))return!0;x(e),A(e)}return e.o[t]=n,e.D[t]=!0,!0},deleteProperty:function(e,t){return void 0!==P(e.t,t)||t in e.t?(e.D[t]=!1,x(e),A(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=p(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:a.enumerable,value:n[t]}:a},defineProperty:function(){a(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){a(12)}},H={};l(X,(function(e,t){H[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),H.deleteProperty=function(e,t){return X.deleteProperty.call(this,e[0],t)},H.set=function(e,t,n){return X.set.call(this,e[0],t,n,e[0])};var Z=function(){function e(e){this.O=J,this.N=!1,"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),this.produce=this.produce.bind(this),this.produceWithPatches=this.produceWithPatches.bind(this)}var t=e.prototype;return t.produce=function(e,t,n){if("function"==typeof e&&"function"!=typeof t){var r=t;t=e;var l=this;return function(e){var n=this;void 0===e&&(e=r);for(var a=arguments.length,i=Array(a>1?a-1:0),c=1;c<a;c++)i[c-1]=arguments[c];return l.produce(e,(function(e){var a;return(a=t).call.apply(a,[n,e].concat(i))}))}}var c;if("function"!=typeof t&&a(6),void 0!==n&&"function"!=typeof n&&a(7),i(e)){var o=w(this),u=V(this,e,void 0),f=!0;try{c=t(u),f=!1}finally{f?j(o):C(o)}return"undefined"!=typeof Promise&&c instanceof Promise?c.then((function(e){return E(o,n),N(e,o)}),(function(e){throw j(o),e})):(E(o,n),N(c,o))}if(!e||"object"!=typeof e){if((c=t(e))===R)return;return void 0===c&&(c=e),this.N&&b(c,!0),c}a(21,e)},t.produceWithPatches=function(e,t){var n,a,r=this;return"function"==typeof e?function(t){for(var n=arguments.length,a=Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return r.produceWithPatches(t,(function(t){return e.apply(void 0,[t].concat(a))}))}:[this.produce(e,t,(function(e,t){n=e,a=t})),n,a]},t.createDraft=function(e){i(e)||a(8),r(e)&&(e=L(e));var t=w(this),n=V(this,e,void 0);return n[B].C=!0,C(t),n},t.finishDraft=function(e,t){var n=e&&e[B],a=n.A;return E(a,t),N(void 0,a)},t.setAutoFreeze=function(e){this.N=e},t.setUseProxies=function(e){e&&!J&&a(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var a=t[n];if(0===a.path.length&&"replace"===a.op){e=a.value;break}}var i=g("Patches").$;return r(e)?i(e,t):this.produce(e,(function(e){return i(e,t.slice(n+1))}))},e}(),Q=new Z,Y=Q.produce;Q.produceWithPatches.bind(Q),Q.setAutoFreeze.bind(Q),Q.setUseProxies.bind(Q),Q.applyPatches.bind(Q),Q.createDraft.bind(Q),Q.finishDraft.bind(Q);t["a"]=Y},uKwZ:function(e,t,n){"use strict";(function(e){n("SePM");var a=n("PMX6"),r=(n("UvA9"),n("u4G2")),i=(n("6dnR"),n("CQJL")),l=(n("vmZS"),n("NjVP")),c=(n("4X2C"),n("xvon")),o=(n("GPKB"),n("mFAc")),u=n("k1fw"),f=n("oBTY"),s=(n("c94q"),n("Y/eX")),d=n("tJVT"),m=n("q1tI"),p=n.n(m),v=n("LvDl"),b=n("jfUH"),h={version:"v2",name:"",file_type:"csv",merge_bref:!1,fields:[],collapseActiveKey:[]};function y(t){var n=t.modelName,y=t.adminConfig,g=t.schemas,O=Object(m["useState"])(e.cloneDeep(y[n].exportable)||h),E=Object(d["a"])(O,2),j=E[0],C=E[1],w=Object(m["useState"])("success"),S=Object(d["a"])(w,2),N=S[0],k=S[1],F=Object(m["useState"])(j.collapseActiveKey||[]),D=Object(d["a"])(F,2),P=D[0],I=D[1],A=Object(m["useState"])([]),x=Object(d["a"])(A,2),V=x[0],L=x[1],M=Object(m["useState"])([]),T=Object(d["a"])(M,2),K=T[0],W=T[1],U=Object(m["useState"])([]),G=Object(d["a"])(U,2),J=G[0],R=G[1],$=s["a"].Panel;function B(){C(y[n].exportable||h)}function q(e,t){var n=Object(f["a"])(j.fields||[]);t?n.includes(e)||n.push(e):n=n.filter((function(t){return t!==e})),C(Object(u["a"])(Object(u["a"])({},j),{},{fields:n}))}function _(e,t){var n=P||[];e.length>0?n.includes(t)||n.push(t):n=n.filter((function(e){return e!==t})),I(n)}function z(){return j.collapseActiveKey=P,C(j),!!Object(v["isEmpty"])(j.fields)||(!!j.name||(k("error"),o["a"].error("\u8bf7\u8f93\u5165\u5bfc\u51fa\u914d\u7f6e\u7684\u540d\u79f0"),!1))}Object(m["useEffect"])((function(){var e=[],t=[],a=[];g[n].fields.forEach((function(n){if(Object(b["D"])(n)){var r=n,i=[];g[n.ref].fields.forEach((function(e){Object(b["B"])(e)||i.push({displayName:e.displayName,name:e.name})})),t.push({parenField:r,fieldxs:i})}else if("bref"===n.type||"mref"===n.type){var l=n,c=[],o=[];g[n.ref]&&g[n.ref].fields.forEach((function(e){if(Object(b["B"])(e)){if(Object(b["D"])(e)){var t=e,n=[];g[e.ref].fields.forEach((function(e){Object(b["B"])(e)||n.push({displayName:e.displayName,name:e.name})})),o.push({shildParenField:t,shildDieldxs:n})}}else c.push({displayName:e.displayName,name:e.name})})),a.push({parenField:l,fieldxs:c,shildRefFiledsData:o})}else e.push({displayName:n.displayName,name:n.name})})),L(e),W(t),R(a)}),[]);var X={background:"white",border:0},H={labelCol:{xs:{span:18},sm:{span:4}},wrapperCol:{xs:{span:24},sm:{span:18}}},Z=p.a.createElement(l["a"],H,p.a.createElement(l["a"].Item,{label:"\u540d\u79f0\uff1a",required:!0,validateStatus:N},p.a.createElement(c["a"],{placeholder:"\u8bf7\u8f93\u5165\u5bfc\u51fa\u6309\u94ae\u7684\u540d\u79f0",onChange:function(e){var t=e.target.value;""===t&&k("error"),C(Object(u["a"])(Object(u["a"])({},j),{},{name:t}))},value:j.name})),p.a.createElement(l["a"].Item,{label:"\u683c\u5f0f\uff1a"},p.a.createElement(i["a"].Group,{value:j.file_type,onChange:function(e){var t=e.target.value;C(Object(u["a"])(Object(u["a"])({},j),{},{file_type:t}))}},p.a.createElement(i["a"],{value:"csv"},"CSV"),p.a.createElement(i["a"],{value:"excel"},"Excel"))),p.a.createElement(l["a"].Item,{label:"\u5408\u5e76\u5b50\u9879\uff1a"},p.a.createElement(i["a"].Group,{value:j.merge_bref||!1,onChange:function(e){var t=e.target.value;C(Object(u["a"])(Object(u["a"])({},j),{},{merge_bref:t}))}},p.a.createElement(i["a"],{value:!0},"\u662f"),p.a.createElement(i["a"],{value:!1},"\u5426")),p.a.createElement("br",null),"\u5408\u5e76\u5b50\u9879\u4f1a\u628a\u591a\u6761\u5b50\u9879\u7684\u6570\u636e\u62fc\u63a5\u6210\u4e00\u6761\u6765\u663e\u793a\u3002"),p.a.createElement(l["a"].Item,null,p.a.createElement(a["a"],{bordered:!1,title:"\u5bfc\u51fa\u5b57\u6bb5\uff1a",style:{marginLeft:50,width:800}},p.a.createElement("div",{style:{marginLeft:70}},p.a.createElement(r["a"].Group,{value:j.fields},V.map((function(e){return p.a.createElement(r["a"],{onChange:function(t){q(e.name,t.target.checked)},style:{marginLeft:8},value:e.name},e.displayName)}))),K.map((function(e){var t=e.parenField,n=e.fieldxs;return p.a.createElement(s["a"],{style:{border:0},defaultActiveKey:j.collapseActiveKey},p.a.createElement($,{header:"".concat(t.displayName,"(\u7236\u9879)"),key:t.displayName,style:X},p.a.createElement(r["a"].Group,{value:j.fields,onChange:function(e){_(e,t.displayName)}},n.map((function(e){return p.a.createElement(r["a"],{onChange:function(e){var t=e.target,n=t.value,a=t.checked;q(n,a)},value:"".concat(t.name,".").concat(e.name),style:{marginLeft:8}},"".concat(t.displayName,".").concat(e.displayName))})))))})),J&&J.map((function(e){var t=e.parenField,n=e.fieldxs,a=e.shildRefFiledsData;return p.a.createElement(s["a"],{style:{border:0},defaultActiveKey:j.collapseActiveKey},p.a.createElement($,{header:"".concat(t.displayName,"(\u5b50\u9879)"),key:t.displayName,style:X},p.a.createElement(r["a"].Group,{value:j.fields,onChange:function(e){_(e,t.displayName)}},n.map((function(e){return p.a.createElement(r["a"],{onChange:function(e){var t=e.target,n=t.value,a=t.checked;q(n,a)},value:"".concat(t.name,".").concat(e.name),style:{marginLeft:8}},"".concat(t.displayName,".").concat(e.displayName))}))),a&&a.map((function(e){var n=e.shildParenField,a=e.shildDieldxs;return p.a.createElement(s["a"],{style:{border:0,marginLeft:20},defaultActiveKey:j.collapseActiveKey},p.a.createElement($,{header:"".concat(t.displayName,".").concat(n.displayName,"(\u7236\u9879)"),key:"".concat(t.displayName,".").concat(n.displayName),style:X},p.a.createElement(r["a"].Group,{value:j.fields,onChange:function(e){_(e,"".concat(t.displayName,".").concat(n.displayName))}},a.map((function(e){return p.a.createElement(r["a"],{onChange:function(e){var t=e.target,n=t.value,a=t.checked;q(n,a)},value:"".concat(t.name,".").concat(n.name,".").concat(e.name),style:{marginLeft:8}},"".concat(t.displayName,".").concat(n.displayName,".").concat(e.displayName))})))))}))))}))))));return[Z,j,B,z]}t["a"]=y}).call(this,n("LvDl"))},yPhJ:function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"AdminEditorCard",(function(){return y})),n.d(t,"useAdminEditor",(function(){return g})),n.d(t,"AdminEditorButtons",(function(){return O}));n("eNCU");var a=n("pjJH"),r=n("9og8"),i=n("k1fw"),l=(n("SePM"),n("PMX6")),c=n("tJVT"),o=n("WmNS"),u=n.n(o),f=n("q1tI"),s=n.n(f),d=n("txBY"),m=n("jfUH"),p=n("uKwZ"),v=n("Evl9"),b=n("D27F"),h=n("LK96");function y(t){var n=t.actions,a=t.defaultTab,r=void 0===a?"list":a,i=t.tabs,o=Object(f["useState"])(r),u=Object(c["a"])(o,2),d=u[0],m=u[1];return s.a.createElement(l["a"],{activeTabKey:d,tabList:e.map(i,(function(e,t){var n=e.displayName;return{key:t,tab:n}})),onTabChange:m,actions:n},i[d].view)}function g(t){var n=t.modelName,a=Object(m["ub"])(),r=Object(m["U"])(),l=Object(m["W"])(),o=Object(v["b"])({modelName:n,schemas:a,adminConfig:r,bsmSetting:l}),u=Object(c["a"])(o,4),f=u[0],d=u[1],y=u[2],g=u[3],O=Object(b["a"])({modelName:n,schemas:a,adminConfig:r,bsmSetting:l}),E=Object(c["a"])(O,5),j=E[0],C=E[1],w=E[2],S=E[3],N=E[4],k=Object(h["a"])({modelName:n,schemas:a,adminConfig:r,bsmSetting:l}),F=Object(c["a"])(k,4),D=F[0],P=F[1],I=F[2],A=F[3],x=Object(p["a"])({modelName:n,schemas:a,adminConfig:r}),V=Object(c["a"])(x,4),L=V[0],M=V[1],T=V[2],K=V[3],W=Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])({},r[n]),{},{exportable:M},f),C),P),U=function(){return e.mapValues(y(),(function(e,t){W[t]=e})),e.mapValues(S(),(function(e,t){W[t]=e})),e.mapValues(A(),(function(e,t){W[t]=e})),W};function G(){T(),d(n,r),w(),I()}function J(){return N()&&K()}var R=s.a.createElement(v["a"],g),$={list:{view:R,displayName:"\u5217\u8868\u9875\u8bbe\u7f6e"},form:{view:j,displayName:"\u8868\u5355\u8bbe\u7f6e"},detail:{view:D,displayName:"\u8be6\u60c5\u9875\u8bbe\u7f6e"},export:{view:L,displayName:"\u5bfc\u51fa\u8bbe\u7f6e"}};return{check:U,reset:G,verifys:J,conf:W,tabs:$}}function O(t){var n=t.check,i=t.reset,l=t.verifys,o=t.conf,d=t.updateAdmin,m=t.afterSubmit,p=t.modelName,v=Object(f["useState"])(!1),b=Object(c["a"])(v,2),h=b[0],y=b[1];return s.a.createElement("div",{style:{textAlign:"left",marginTop:12,marginBottom:12}},s.a.createElement(a["a"],{loading:h,onClick:Object(r["a"])(u.a.mark((function t(){var a;return u.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!l()){t.next=11;break}return n(),a=e.cloneDeep(o),t.prev=3,y(!0),t.next=7,d({model:p,config:a});case 7:m&&m({model:p,config:a});case 8:return t.prev=8,y(!1),t.finish(8);case 11:case"end":return t.stop()}}),t,null,[[3,,8,11]])}))),type:"primary",style:{marginLeft:24}},"\u66f4\u65b0"),s.a.createElement(a["a"],{onClick:i,style:{marginLeft:24}},"\u91cd\u7f6e"))}function E(e){var t=e.modelName,n=e.updateAdmin,a=e.afterSubmit,r=e.defaultTab,i=void 0===r?"list":r,l=g({modelName:t}),c=l.check,o=l.reset,u=l.verifys,f=l.conf,d=l.tabs;return s.a.createElement(y,{actions:[s.a.createElement(O,{modelName:t,conf:f,check:c,reset:o,verifys:u,updateAdmin:n,afterSubmit:a})],defaultTab:i,tabs:d})}var j=Object(d["a"])(E);t["default"]=function(e){var t=e.modelName,n=Object(m["rb"])(t);return n?s.a.createElement(j,e):null}}.call(this,n("LvDl"))}}]);