Files
shz-admin/shihezi/2878.e457a29b.async.js

2 lines
7.6 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2878,7476,3703],{37476:function(te,$,e){e.d($,{Y:function(){return X}});var P=e(55850),A=e(15861),h=e(1413),j=e(97685),G=e(91),Z=e(73177),k=e(21532),R=e(17788),W=e(21770),H=e(8880),Y=e(80334),i=e(67294),L=e(73935),N=e(78733),l=e(85893),ee=["children","trigger","onVisibleChange","onOpenChange","modalProps","onFinish","submitTimeout","title","width","visible","open"];function X(d){var _,f,J=d.children,c=d.trigger,x=d.onVisibleChange,F=d.onOpenChange,n=d.modalProps,p=d.onFinish,D=d.submitTimeout,V=d.title,g=d.width,T=d.visible,U=d.open,s=(0,G.Z)(d,ee);(0,Y.ET)(!s.footer||!(n!=null&&n.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,i.useContext)(k.ZP.ConfigContext),Q=(0,i.useState)([]),M=(0,j.Z)(Q,2),C=M[1],I=(0,i.useState)(!1),B=(0,j.Z)(I,2),E=B[0],K=B[1],le=(0,W.Z)(!!T,{value:U||T,onChange:F||x}),ne=(0,j.Z)(le,2),w=ne[0],O=ne[1],z=(0,i.useRef)(null),re=(0,i.useCallback)(function(o){z.current===null&&o&&C([]),z.current=o},[]),y=(0,i.useRef)(),oe=(0,i.useCallback)(function(){var o,t,r,a=(o=(t=s.form)!==null&&t!==void 0?t:(r=s.formRef)===null||r===void 0?void 0:r.current)!==null&&o!==void 0?o:y.current;a&&n!==null&&n!==void 0&&n.destroyOnClose&&a.resetFields()},[n==null?void 0:n.destroyOnClose,s.form,s.formRef]);(0,i.useImperativeHandle)(s.formRef,function(){return y.current},[y.current]),(0,i.useEffect)(function(){(U||T)&&(F==null||F(!0),x==null||x(!0))},[T,U]);var ue=(0,i.useMemo)(function(){return c?i.cloneElement(c,(0,h.Z)((0,h.Z)({key:"trigger"},c.props),{},{onClick:function(){var o=(0,A.Z)((0,P.Z)().mark(function r(a){var m,u;return(0,P.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:O(!w),(m=c.props)===null||m===void 0||(u=m.onClick)===null||u===void 0||u.call(m,a);case 2:case"end":return v.stop()}},r)}));function t(r){return o.apply(this,arguments)}return t}()})):null},[O,c,w]),ae=(0,i.useMemo)(function(){var o,t,r,a,m,u,S;return s.submitter===!1?!1:(0,H.T)({searchConfig:{submitText:(o=(t=n==null?void 0:n.okText)!==null&&t!==void 0?t:(r=b.locale)===null||r===void 0||(r=r.Modal)===null||r===void 0?void 0:r.okText)!==null&&o!==void 0?o:"\u786E\u8BA4",resetText:(a=(m=n==null?void 0:n.cancelText)!==null&&m!==void 0?m:(u=b.locale)===null||u===void 0||(u=u.Modal)===null||u===void 0?void 0:u.cancelText)!==null&&a!==void 0?a:"\u53D6\u6D88"},resetButtonProps:{preventDefault:!0,disabled:D?E:void 0,onClick:function(de){var q;O(!1),n==null||(q=n.onCancel)===null||q===void 0||q.call(n,de)}}},(S=s.submitter)!==null&&S!==void 0?S:{})},[(_=b.locale)===null||_===void 0||(_=_.Modal)===null||_===void 0?void 0:_.cancelText,(f=b.locale)===null||f===void 0||(f=f.Modal)===null||f===void 0?void 0:f.okText,n,s.submitter,O,E,D]),se=(0,i.useCallback)(function(o,t){return(0,l.jsxs)(l.Fragment,{children:[o,z.current&&t?(0,l.jsx)(i.Fragment,{children:(0,L.createPortal)(t,z.current)},"submitter"):t]})},[]),ie=(0,i.useCallback)(function(){var o=(0,A.Z)((0,P.Z)().mark(function t(r){var a,m,u;return(0,P.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return a=p==null?void 0:p(r),D&&a instanceof Promise&&(K(!0),m=setTimeout(function(){return K(!1)},D),a.finally(function(){clearTimeout(m),K(!1)})),v.next=4,a;case 4:return u=v.sent,u&&O(!1),v.abrupt("return",u);case 7:case"end":return v.stop()}},t)}));return function(t){return o.apply(this,arguments)}}(),[p,O,D]),_e=(0,Z.X)(w);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(R.Z,(0,h.Z)((0,h.Z)((0,h.Z)({title:V,width:g||800},n),_e),{},{onCancel:function(t){var r;D&&E||(O(!1),n==null||(r=n.onCancel)===null||r===void 0||r.call(n,t))},afterClose:function(){var t;oe(),w&&O(!1),n==null||(t=n.afterClose)===null||t===void 0||t.call(n)},footer:s.submitter!==!1?(0,l.jsx)("div",{ref:re,style:{display:"flex",justifyContent:"flex-end"}}):null,children:(0,l.jsx)(N.I,(0,h.Z)((0,h.Z)({formComponentType:"ModalForm",layout:"vertical"},s),{},{onInit:function(