2 lines
6.0 KiB
JavaScript
2 lines
6.0 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4368],{52586:function(y,T,e){var d=e(88351),E=e(87841),_=e(93236),m=e(8263),v=e(62086),M=["fieldProps","proFieldProps"],O=function(D,g){var p=D.fieldProps,C=D.proFieldProps,o=(0,E.Z)(D,M);return(0,v.jsx)(m.Z,(0,d.Z)({ref:g,valueType:"textarea",fieldProps:p,proFieldProps:C},o))};T.Z=_.forwardRef(O)},61786:function(y,T,e){var d=e(88351),E=e(87841),_=e(93236),m=e(8263),v=e(62086),M=["fieldProps","proFieldProps"],O=["fieldProps","proFieldProps"],h="text",D=function(o){var F=o.fieldProps,I=o.proFieldProps,c=(0,E.Z)(o,M);return(0,v.jsx)(m.Z,(0,d.Z)({valueType:h,fieldProps:F,filedConfig:{valueType:h},proFieldProps:I},c))},g=function(o){var F=o.fieldProps,I=o.proFieldProps,c=(0,E.Z)(o,O);return(0,v.jsx)(m.Z,(0,d.Z)({valueType:"password",fieldProps:F,proFieldProps:I,filedConfig:{valueType:h}},c))},p=D;p.Password=g,p.displayName="ProFormComponent",T.Z=p},28931:function(y,T,e){e.d(T,{Y:function(){return w}});var d=e(99177),E=e(42700),_=e(88351),m=e(67654),v=e(87841),M=e(29320),O=e(50126),h=e(92750),D=e(72266),g=e.n(D),p=e(71639),C=e(24599),o=e(93236),F=e(19103),I=e(96630),c=e(62086),k=["children","trigger","onVisibleChange","onOpenChange","modalProps","onFinish","submitTimeout","title","width","visible","open"];function w(f){var S,V,H,Y,q=f.children,A=f.trigger,L=f.onVisibleChange,U=f.onOpenChange,r=f.modalProps,K=f.onFinish,x=f.submitTimeout,ee=f.title,oe=f.width,$=f.visible,G=f.open,s=(0,v.Z)(f,k);(0,C.ET)(!s.footer||!(r!=null&&r.footer),"ModalForm \u662F\u4E00\u4E2A ProForm \u7684\u7279\u6B8A\u5E03\u5C40\uFF0C\u5982\u679C\u60F3\u81EA\u5B9A\u4E49\u6309\u94AE\uFF0C\u8BF7\u4F7F\u7528 submit.render \u81EA\u5B9A\u4E49\u3002");var b=(0,o.useContext)(O.ZP.ConfigContext),re=(0,o.useState)([]),ne=(0,m.Z)(re,2),te=ne[1],le=(0,o.useState)(!1),J=(0,m.Z)(le,2),N=J[0],X=J[1],ae=(0,p.Z)(!!$,{value:G||$,onChange:U||L}),Q=(0,m.Z)(ae,2),B=Q[0],R=Q[1],j=(0,o.useRef)(null),ie=(0,o.useCallback)(function(l){j.current===null&&l&&te([]),j.current=l},[]),Z=(0,o.useRef)(),se=(0,o.useCallback)(function(){var l,n,t,a=(l=(n=s.form)!==null&&n!==void 0?n:(t=s.formRef)===null||t===void 0?void 0:t.current)!==null&&l!==void 0?l:Z.current;a&&r!==null&&r!==void 0&&r.destroyOnClose&&a.resetFields()},[r==null?void 0:r.destroyOnClose,s.form,s.formRef]);(0,o.useImperativeHandle)(s.formRef,function(){return Z.current},[Z.current]),(0,o.useEffect)(function(){B&&(G||$)&&(U==null||U(!0),L==null||L(!0))},[$,G,B]);var ue=(0,o.useMemo)(function(){return A?o.cloneElement(A,(0,_.Z)((0,_.Z)({key:"trigger"},A.props),{},{onClick:function(){var l=(0,E.Z)((0,d.Z)().mark(function t(a){var P,i;return(0,d.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:R(!B),(P=A.props)===null||P===void 0||(i=P.onClick)===null||i===void 0||i.call(P,a);case 2:case"end":return u.stop()}},t)}));function n(t){return l.apply(this,arguments)}return n}()})):null},[R,A,B]),de=(0,o.useMemo)(function(){var l,n,t,a,P,i,W,u;return s.submitter===!1?!1:g()({searchConfig:{submitText:(l=(n=r==null?void 0:r.okText)!==null&&n!==void 0?n:(t=b.locale)===null||t===void 0||(a=t.Modal)===null||a===void 0?void 0:a.okText)!==null&&l!==void 0?l:"\u786E\u8BA4",resetText:(P=(i=r==null?void 0:r.cancelText)!==null&&i!==void 0?i:(W=b.locale)===null||W===void 0||(u=W.Modal)===null||u===void 0?void 0:u.cancelText)!==null&&P!==void 0?P:"\u53D6\u6D88"},resetButtonProps:{preventDefault:!0,disabled:x?N:void 0,onClick:function(fe){var z;R(!1),r==null||(z=r.onCancel)===null||z===void 0||z.call(r,fe)}}},s.submitter)},[(S=b.locale)===null||S===void 0||(V=S.Modal)===null||V===void 0?void 0:V.cancelText,(H=b.locale)===null||H===void 0||(Y=H.Modal)===null||Y===void 0?void 0:Y.okText,r,s.submitter,R,N,x]),_e=(0,o.useCallback)(function(l,n){return(0,c.jsxs)(c.Fragment,{children:[l,j.current&&n?(0,c.jsx)(o.Fragment,{children:(0,F.createPortal)(n,j.current)},"submitter"):n]})},[]),ve=(0,o.useCallback)(function(){var l=(0,E.Z)((0,d.Z)().mark(function n(t){var a,P,i;return(0,d.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=K==null?void 0:K(t),x&&a instanceof Promise&&(X(!0),P=setTimeout(function(){return X(!1)},x),a.finally(function(){clearTimeout(P),X(!1)})),u.next=4,a;case 4:return i=u.sent,i&&R(!1),u.abrupt("return",i);case 7:case"end":return u.stop()}},n)}));return function(n){return l.apply(this,arguments)}}(),[K,R,x]),ce=(0,M.X)(B);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(h.Z,(0,_.Z)((0,_.Z)((0,_.Z)({title:ee,width:oe||800},r),ce),{},{onCancel:function(n){var t;x&&N||(R(!1),r==null||(t=r.onCancel)===null||t===void 0||t.call(r,n))},afterClose:function(){var n;se(),R(!1),r==null||(n=r.afterClose)===null||n===void 0||n.call(r)},footer:s.submitter!==!1?(0,c.jsx)("div",{ref:ie,style:{display:"flex",justifyContent:"flex-end"}}):null,children:(0,c.jsx)(I.I,(0,_.Z)((0,_.Z)({formComponentType:"ModalForm",layout:"vertical"},s),{},{onInit:function(n,t){var a;s.formRef&&(s.formRef.current=t),s==null||(a=s.onInit)===null||a===void 0||a.call(s,n,t),Z.current=t},formRef:Z,submitter:de,onFinish:function(){var l=(0,E.Z)((0,d.Z)().mark(function n(t){var a;return(0,d.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,ve(t);case 2:return a=i.sent,i.abrupt("return",a);case 4:case"end":return i.stop()}},n)}));return function(n){return l.apply(this,arguments)}}(),contentRender:_e,children:q}))})),ue]})}},24221:function(y,T,e){e.r(T);var d=e(28931),E=e(61786),_=e(52586),m=e(93236),v=e(62086);T.default=function(M){var O=M.values,h=M.modalOpenState,D=M.onModalOpenState,g=M.onSubmit,p=(0,m.useRef)();return(0,m.useEffect)(function(){var C;(C=p.current)===null||C===void 0||C.setFieldsValue(O)},[O]),(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(d.Y,{title:"\u63D0\u73B0-\u9A73\u56DE",formRef:p,submitter:{searchConfig:{resetText:"\u91CD\u7F6E"},resetButtonProps:{onClick:function(){var o;(o=p.current)===null||o===void 0||o.resetFields()}}},initialValues:O,onFinish:g,open:h,onOpenChange:D,children:[(0,v.jsx)(E.Z,{hidden:!0,width:"md",name:"id"}),(0,v.jsx)(_.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],name:"note",label:"\u9A73\u56DE\u539F\u56E0",placeholder:"\u8BF7\u8F93\u5165\u539F\u56E0"})]})})}}}]);
|