Files
houyi-admin/dist/src__pages__device__device__components__SetinfoFormModal.b724e43d.async.js
PC-202306242200\Administrator 23dc139a31 first commit
2026-03-28 23:25:01 +08:00

2 lines
6.3 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6106],{52586:function(y,h,e){var u=e(88351),p=e(87841),d=e(93236),E=e(8263),_=e(62086),M=["fieldProps","proFieldProps"],O=function(D,F){var P=D.fieldProps,C=D.proFieldProps,o=(0,p.Z)(D,M);return(0,_.jsx)(E.Z,(0,u.Z)({ref:F,valueType:"textarea",fieldProps:P,proFieldProps:C},o))};h.Z=d.forwardRef(O)},61786:function(y,h,e){var u=e(88351),p=e(87841),d=e(93236),E=e(8263),_=e(62086),M=["fieldProps","proFieldProps"],O=["fieldProps","proFieldProps"],T="text",D=function(o){var x=o.fieldProps,B=o.proFieldProps,c=(0,p.Z)(o,M);return(0,_.jsx)(E.Z,(0,u.Z)({valueType:T,fieldProps:x,filedConfig:{valueType:T},proFieldProps:B},c))},F=function(o){var x=o.fieldProps,B=o.proFieldProps,c=(0,p.Z)(o,O);return(0,_.jsx)(E.Z,(0,u.Z)({valueType:"password",fieldProps:x,proFieldProps:B,filedConfig:{valueType:T}},c))},P=D;P.Password=F,P.displayName="ProFormComponent",h.Z=P},28931:function(y,h,e){e.d(h,{Y:function(){return w}});var u=e(99177),p=e(42700),d=e(88351),E=e(67654),_=e(87841),M=e(29320),O=e(50126),T=e(92750),D=e(72266),F=e.n(D),P=e(71639),C=e(24599),o=e(93236),x=e(19103),B=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,Z=f.trigger,L=f.onVisibleChange,U=f.onOpenChange,r=f.modalProps,K=f.onFinish,g=f.submitTimeout,ee=f.title,oe=f.width,b=f.visible,G=f.open,s=(0,_.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 $=(0,o.useContext)(O.ZP.ConfigContext),re=(0,o.useState)([]),ne=(0,E.Z)(re,2),le=ne[1],te=(0,o.useState)(!1),J=(0,E.Z)(te,2),N=J[0],X=J[1],ae=(0,P.Z)(!!b,{value:G||b,onChange:U||L}),Q=(0,E.Z)(ae,2),I=Q[0],R=Q[1],j=(0,o.useRef)(null),ie=(0,o.useCallback)(function(t){j.current===null&&t&&le([]),j.current=t},[]),A=(0,o.useRef)(),se=(0,o.useCallback)(function(){var t,n,l,a=(t=(n=s.form)!==null&&n!==void 0?n:(l=s.formRef)===null||l===void 0?void 0:l.current)!==null&&t!==void 0?t:A.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 A.current},[A.current]),(0,o.useEffect)(function(){I&&(G||b)&&(U==null||U(!0),L==null||L(!0))},[b,G,I]);var ue=(0,o.useMemo)(function(){return Z?o.cloneElement(Z,(0,d.Z)((0,d.Z)({key:"trigger"},Z.props),{},{onClick:function(){var t=(0,p.Z)((0,u.Z)().mark(function l(a){var m,i;return(0,u.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:R(!I),(m=Z.props)===null||m===void 0||(i=m.onClick)===null||i===void 0||i.call(m,a);case 2:case"end":return v.stop()}},l)}));function n(l){return t.apply(this,arguments)}return n}()})):null},[R,Z,I]),de=(0,o.useMemo)(function(){var t,n,l,a,m,i,W,v;return s.submitter===!1?!1:F()({searchConfig:{submitText:(t=(n=r==null?void 0:r.okText)!==null&&n!==void 0?n:(l=$.locale)===null||l===void 0||(a=l.Modal)===null||a===void 0?void 0:a.okText)!==null&&t!==void 0?t:"\u786E\u8BA4",resetText:(m=(i=r==null?void 0:r.cancelText)!==null&&i!==void 0?i:(W=$.locale)===null||W===void 0||(v=W.Modal)===null||v===void 0?void 0:v.cancelText)!==null&&m!==void 0?m:"\u53D6\u6D88"},resetButtonProps:{preventDefault:!0,disabled:g?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=$.locale)===null||S===void 0||(V=S.Modal)===null||V===void 0?void 0:V.cancelText,(H=$.locale)===null||H===void 0||(Y=H.Modal)===null||Y===void 0?void 0:Y.okText,r,s.submitter,R,N,g]),_e=(0,o.useCallback)(function(t,n){return(0,c.jsxs)(c.Fragment,{children:[t,j.current&&n?(0,c.jsx)(o.Fragment,{children:(0,x.createPortal)(n,j.current)},"submitter"):n]})},[]),ve=(0,o.useCallback)(function(){var t=(0,p.Z)((0,u.Z)().mark(function n(l){var a,m,i;return(0,u.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return a=K==null?void 0:K(l),g&&a instanceof Promise&&(X(!0),m=setTimeout(function(){return X(!1)},g),a.finally(function(){clearTimeout(m),X(!1)})),v.next=4,a;case 4:return i=v.sent,i&&R(!1),v.abrupt("return",i);case 7:case"end":return v.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),[K,R,g]),ce=(0,M.X)(I);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(T.Z,(0,d.Z)((0,d.Z)((0,d.Z)({title:ee,width:oe||800},r),ce),{},{onCancel:function(n){var l;g&&N||(R(!1),r==null||(l=r.onCancel)===null||l===void 0||l.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)(B.I,(0,d.Z)((0,d.Z)({formComponentType:"ModalForm",layout:"vertical"},s),{},{onInit:function(n,l){var a;s.formRef&&(s.formRef.current=l),s==null||(a=s.onInit)===null||a===void 0||a.call(s,n,l),A.current=l},formRef:A,submitter:de,onFinish:function(){var t=(0,p.Z)((0,u.Z)().mark(function n(l){var a;return(0,u.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,ve(l);case 2:return a=i.sent,i.abrupt("return",a);case 4:case"end":return i.stop()}},n)}));return function(n){return t.apply(this,arguments)}}(),contentRender:_e,children:q}))})),ue]})}},60695:function(y,h,e){e.r(h);var u=e(93236),p=e(28931),d=e(61786),E=e(52586),_=e(62086);h.default=function(M){var O=M.values,T=M.modalOpenState,D=M.onModalOpenState,F=M.onSubmit,P=(0,u.useRef)();return(0,u.useEffect)(function(){var C;(C=P.current)===null||C===void 0||C.setFieldsValue(O)},[O]),(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(p.Y,{title:"\u5145\u7535\u6869-\u8BBE\u7F6E\u5730\u5740",formRef:P,submitter:{searchConfig:{resetText:"\u91CD\u7F6E"},resetButtonProps:{onClick:function(){var o;(o=P.current)===null||o===void 0||o.resetFields()}}},initialValues:O,onFinish:F,open:T,onOpenChange:D,children:[(0,_.jsx)(d.Z,{hidden:!0,width:"md",name:"id"}),(0,_.jsx)(d.Z,{width:"md",label:"\u8BBE\u5907\u53F7",name:"device_no",placeholder:"\u8BF7\u8F93\u5165"}),(0,_.jsx)(d.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],name:"site_name",label:"\u7535\u7AD9\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165"}),(0,_.jsx)(E.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],name:"address",label:"\u8BE6\u7EC6\u5730\u5740",placeholder:"\u8BF7\u8F93\u5165"})]})})}}}]);