"use strict";(self.webpackChunknocode_component=self.webpackChunknocode_component||[]).push([[9516],{91616:function(e,n,t){t.d(n,{sB:function(){return c.s},uY:function(){return A},Ml:function(){return S},C3:function(){return o}});var u=t(65984),r=t(39756),o=function(e,n,t){var o=(0,u.useContext)(r.m).model,c=(0,u.useCallback)(t,[t]);(0,u.useEffect)((function(){var t=n.pageId,u=n.id,r=o.addControlAction(e,t,u,c);return function(){r&&r()}}),[])},c=t(46276),a=(t(87912),t(97308),t(13939)),l=t.n(a),i=t(34716),d=t.n(i),f=t(70696),s=t.n(f),v=t(4884),p=t.n(v),h=t(3464),b=t.n(h),C=t(51400),m=t.n(C),w=t(25028),y=t.n(w),g=t(30112),k=t(72048),E=t(67584),R=t.n(E),x=t(35084),I=t(27448);function T(e,n){var t=l()(e);if(d()){var u=d()(e);n&&(u=s()(u).call(u,(function(n){return p()(e,n).enumerable}))),t.push.apply(t,u)}return t}function q(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?T(Object(t),!0).forEach((function(n){(0,g.c)(e,n,t[n])})):b()?m()(e,b()(t)):T(Object(t)).forEach((function(n){y()(e,n,p()(t,n))}))}return e}var S=function(e,n){var t=n.value,r=n.disabled,o=n.isValidate,c=(0,u.useRef)();return(0,u.useEffect)((function(){R()((function(){var n;o&&!r&&(Array.isArray(t)?(null==t?void 0:t.length)>0:t)&&(null===(n=c.current)||void 0===n||n.validateFields(e,t))}))}),[c.current,t,r]),c},A=function(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"blur",o=(0,u.useContext)(r.m).model,a=(0,u.useContext)(x.q),l=a.state,i=a.dispatch,d=e.rowIndex,f=e.meta,s=e.value,v=e.record,p=(0,c.s)(f,e).readonly,h=(0,u.useState)(!0),b=(0,k.c)(h,2),C=b[0],m=b[1],w=(0,u.useState)(new Date),y=(0,k.c)(w,2)[1],E=f.pageId,R=f.dataIndex,T=f.editor,S=(f.id,f.gridId),A=(0,u.useRef)(null),D=(0,u.useRef)(s),M=(0,u.useCallback)((function(e){if(D.current!==s){var n={k:R,r:d,v:e||D.current};o.batchInvoke("updateValue",E,"",[],[{},[n]])}}),[s,R,d,E]),B=(0,u.useCallback)((function(e){D.current=e,"change"===t&&M(e)}),[t,M]),_=(0,u.useCallback)((function(){"blur"===t&&M()}),[s,t,M]),j=(0,u.useMemo)((function(){var e,n;return(null==v||null===(e=v.cprop)||void 0===e?void 0:e.canEditRow)||void 0===(null==v||null===(n=v.cprop)||void 0===n?void 0:n.canEditRow)}),[null==v||null===(n=v.cprop)||void 0===n?void 0:n.canEditRow]),F=(0,u.useCallback)((function(){if(!p&&j){var e={fieldKey:R,row:d,selRows:[d],isClientNewRow:!1,clientNewRows:"",selDatas:[]},n=[(0,g.c)({},S,e),[]];o.batchInvoke("entryRowClick",E,S,[d],n),i({type:I.cT,payload:[d,R]})}}),[s,p,j,d,R,S]);return(0,u.useEffect)((function(){A.current&&A.current.focus()}),[C]),(0,u.useEffect)((function(){D.current=s,y(new Date)}),[s]),(0,u.useEffect)((function(){l.focusTd;var e=l.focusTd[0]===d&&l.focusTd[1]===R;C!==!e&&m(!e)}),[l.focusTd,d,R,C,m]),l.focusTd,{ref:A,controlMeta:q(q({},T),{},{pageId:E,id:R,gridId:S,dataIndex:R,TitleArea:"hide"}),value:{v:D.current},disabled:C,setDisabled:m,onChange:B,onBlur:_,onTdClick:F}}},20024:function(e,n,t){var u=t(72048),r=t(760),o=t.n(r),c=t(70696),a=t.n(c),l=t(65984),i=t(91616),d=t(23832),f=t(38680),s=t(16428);n.c=function(e){var n=e.Status,t=e.mi,r=e.rules,c=void 0===r?[]:r,v=(0,l.useRef)(n),p=(0,d.cl)(v.current),h=p.disabled,b=p.readonly,C=p.hidden,m=(0,l.useState)(!!t),w=(0,u.c)(m,2),y=w[0],g=w[1],k=(0,l.useReducer)((function(e){return e+1}),0),E=(0,u.c)(k,2)[1],R=(0,l.useCallback)((function(e){var n=e.v;n<5?(v.current=n,(0,s.unstable_batchedUpdates)((function(){E()}))):"5"===n?g(!0):"6"===n&&g(!1)}),[]);return(0,l.useEffect)((function(){R({v:n})}),[n,R]),(0,l.useEffect)((function(){g(t)}),[t]),(0,i.C3)(f.oH,e,R),{disabled:h,readonly:b,hidden:C,rules:(0,l.useMemo)((function(){var n,t;return y?o()(n=a()(t=c).call(t,(function(e){return!0!==e.required}))).call(n,(0,d.y6)(e)):c}),[y]),required:!h&&!b&&y}}},46276:function(e,n,t){t.d(n,{s:function(){return a}});var u=t(65984),r=t(39756),o=t(23832),c=t(20024),a=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.emptytip,a=e.ShowClearButton,l=e.maxlength,i=e.pageId,d=(0,u.useContext)(r.m).model,f=d.getFormStatus(i),s=(0,o.y8)(f),v=(0,c.c)(e),p=v.disabled,h=v.readonly,b=v.hidden,C=v.required,m=v.rules,w=n.readonly||h||s;return e?{hidden:b,disabled:p,readonly:w,placeholder:d.getControlText(t)||"",allowClear:a,maxLength:l,required:C,rules:m}:{readonly:w}}},35084:function(e,n,t){t.d(n,{q:function(){return r}});var u=t(65984),r=t.n(u)().createContext(null)}}]);