Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.144.91.130
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/CreateTempCode-C0qO3Riu.js |
import{j as Qe,m as Xe,Y as Ie,k as Y,r as a,g as be,c as oe,Z as Ge,$ as je,a0 as Ee,a1 as Te,a2 as ee,C as gt,a3 as ht,a4 as bt,a5 as xt,a6 as yt,a7 as vt,a8 as Ct,a9 as $t,aa as St,ab as wt,ac as Ke,ad as se,ae as It,af as jt,ag as ge,ah as Ne,ai as Et,aj as Mt,I as Ye,a as Ue,ak as Ot,al as Ft,am as qt,an as Pt,ao as Tt,ap as Nt,aq as Rt,f as kt,ar as zt,as as Je,at as Dt,au as Lt,av as _t,aw as Vt,ax as Wt,ay as Ht,az as Bt,aA as At,aB as Qt,x as Ze,v as we,E as ae,t as i,aC as xe,F as z,B as ce,X as et,M as tt,y as Xt,Q as Gt,D as Re,L as ke}from"./index-D_3WEyIX.js";import{s as Kt,a as Yt}from"./TemplateCode-D5ch-Qll.js";import{F as nt}from"./Table-CWyPglVw.js";import{R as rt}from"./DeleteOutlined-CHl8blL-.js";import{S as pe}from"./index-BvbigfBp.js";import{R as Ut}from"./ArrowLeftOutlined-BolXx_DZ.js";import{R as Jt}from"./HomeOutlined-DuI9l8yy.js";import{g as Zt,T as en}from"./index-F4vCNHPI.js";import{C as at,R as tn}from"./row-Cf-GfLu-.js";import"./index-C7iNPYsc.js";import"./index-BmZJU0_T.js";import"./responsiveObserver-B-8Q9O9D.js";const ze=e=>typeof e=="object"&&e!=null&&e.nodeType===1,De=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",$e=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return De(n.overflowY,t)||De(n.overflowX,t)||(r=>{const o=(l=>{if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!o&&(o.clientHeight<r.scrollHeight||o.clientWidth<r.scrollWidth)})(e)}return!1},fe=(e,t,n,r,o,l,m,g)=>l<e&&m>t||l>e&&m<t?0:l<=e&&g<=n||m>=t&&g>=n?l-e-r:m>t&&g<n||l<e&&g>n?m-t+o:0,nn=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Le=(e,t)=>{var n,r,o,l;if(typeof document>"u")return[];const{scrollMode:m,block:g,inline:x,boundary:C,skipOverflowHiddenElements:M}=t,y=typeof C=="function"?C:h=>h!==C;if(!ze(e))throw new TypeError("Invalid target");const T=document.scrollingElement||document.documentElement,O=[];let S=e;for(;ze(S)&&y(S);){if(S=nn(S),S===T){O.push(S);break}S!=null&&S===document.body&&$e(S)&&!$e(document.documentElement)||S!=null&&$e(S,M)&&O.push(S)}const v=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,N=(l=(o=window.visualViewport)==null?void 0:o.height)!=null?l:innerHeight,{scrollX:$,scrollY:q}=window,{height:p,width:w,top:j,right:P,bottom:k,left:I}=e.getBoundingClientRect(),{top:L,right:V,bottom:W,left:U}=(h=>{const c=window.getComputedStyle(h);return{top:parseFloat(c.scrollMarginTop)||0,right:parseFloat(c.scrollMarginRight)||0,bottom:parseFloat(c.scrollMarginBottom)||0,left:parseFloat(c.scrollMarginLeft)||0}})(e);let d=g==="start"||g==="nearest"?j-L:g==="end"?k+W:j+p/2-L+W,f=x==="center"?I+w/2-U+V:x==="end"?P+V:I-U;const u=[];for(let h=0;h<O.length;h++){const c=O[h],{height:D,width:Q,top:G,right:B,bottom:X,left:A}=c.getBoundingClientRect();if(m==="if-needed"&&j>=0&&I>=0&&k<=N&&P<=v&&j>=G&&k<=X&&I>=A&&P<=B)return u;const Z=getComputedStyle(c),K=parseInt(Z.borderLeftWidth,10),J=parseInt(Z.borderTopWidth,10),E=parseInt(Z.borderRightWidth,10),s=parseInt(Z.borderBottomWidth,10);let b=0,F=0;const R="offsetWidth"in c?c.offsetWidth-c.clientWidth-K-E:0,ne="offsetHeight"in c?c.offsetHeight-c.clientHeight-J-s:0,ie="offsetWidth"in c?c.offsetWidth===0?0:Q/c.offsetWidth:0,le="offsetHeight"in c?c.offsetHeight===0?0:D/c.offsetHeight:0;if(T===c)b=g==="start"?d:g==="end"?d-N:g==="nearest"?fe(q,q+N,N,J,s,q+d,q+d+p,p):d-N/2,F=x==="start"?f:x==="center"?f-v/2:x==="end"?f-v:fe($,$+v,v,K,E,$+f,$+f+w,w),b=Math.max(0,b+q),F=Math.max(0,F+$);else{b=g==="start"?d-G-J:g==="end"?d-X+s+ne:g==="nearest"?fe(G,X,D,J,s+ne,d,d+p,p):d-(G+D/2)+ne/2,F=x==="start"?f-A-K:x==="center"?f-(A+Q/2)+R/2:x==="end"?f-B+E+R:fe(A,B,Q,K,E+R,f,f+w,w);const{scrollLeft:H,scrollTop:re}=c;b=le===0?0:Math.max(0,Math.min(re+b/le,c.scrollHeight-D/le+ne)),F=ie===0?0:Math.max(0,Math.min(H+F/ie,c.scrollWidth-Q/ie+R)),d+=re-b,f+=H-F}u.push({el:c,top:b,left:F})}return u},rn=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function an(e,t){if(!e.isConnected||!(o=>{let l=o;for(;l&&l.parentNode;){if(l.parentNode===document)return!0;l=l.parentNode instanceof ShadowRoot?l.parentNode.host:l.parentNode}return!1})(e))return;const n=(o=>{const l=window.getComputedStyle(o);return{top:parseFloat(l.scrollMarginTop)||0,right:parseFloat(l.scrollMarginRight)||0,bottom:parseFloat(l.scrollMarginBottom)||0,left:parseFloat(l.scrollMarginLeft)||0}})(e);if((o=>typeof o=="object"&&typeof o.behavior=="function")(t))return t.behavior(Le(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:o,top:l,left:m}of Le(e,rn(t))){const g=l-n.top+n.bottom,x=m-n.left+n.right;o.scroll({top:g,left:x,behavior:r})}}const on=e=>{const{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:o,textPaddingInline:l,orientationMargin:m,verticalMarginInline:g}=e;return{[t]:Object.assign(Object.assign({},Ie(e)),{borderBlockStart:`${Y(o)} solid ${r}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:g,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${Y(o)} solid ${r}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${Y(e.dividerHorizontalGutterMargin)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${Y(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${r}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${Y(o)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:`calc(${m} * 100%)`},"&::after":{width:`calc(100% - ${m} * 100%)`}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:`calc(100% - ${m} * 100%)`},"&::after":{width:`calc(${m} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:l},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:`${Y(o)} 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}},ln=e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),sn=Qe("Divider",e=>{const t=Xe(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[on(t)]},ln,{unitless:{orientationMargin:!0}});var cn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const dn=e=>{const{getPrefixCls:t,direction:n,divider:r}=a.useContext(be),{prefixCls:o,type:l="horizontal",orientation:m="center",orientationMargin:g,className:x,rootClassName:C,children:M,dashed:y,plain:T,style:O}=e,S=cn(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),v=t("divider",o),[N,$,q]=sn(v),p=!!M,w=m==="left"&&g!=null,j=m==="right"&&g!=null,P=oe(v,r==null?void 0:r.className,$,q,`${v}-${l}`,{[`${v}-with-text`]:p,[`${v}-with-text-${m}`]:p,[`${v}-dashed`]:!!y,[`${v}-plain`]:!!T,[`${v}-rtl`]:n==="rtl",[`${v}-no-default-orientation-margin-left`]:w,[`${v}-no-default-orientation-margin-right`]:j},x,C),k=a.useMemo(()=>typeof g=="number"?g:/^\d+$/.test(g)?Number(g):g,[g]),I=Object.assign(Object.assign({},w&&{marginLeft:k}),j&&{marginRight:k});return N(a.createElement("div",Object.assign({className:P,style:Object.assign(Object.assign({},r==null?void 0:r.style),O)},S,{role:"separator"}),M&&l!=="vertical"&&a.createElement("span",{className:`${v}-inner-text`,style:I},M)))};function he(e){const[t,n]=a.useState(e);return a.useEffect(()=>{const r=setTimeout(()=>{n(e)},e.length?0:10);return()=>{clearTimeout(r)}},[e]),t}const mn=e=>{const{componentCls:t}=e,n=`${t}-show-help`,r=`${t}-show-help-item`;return{[n]:{transition:`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:"hidden",transition:`height ${e.motionDurationSlow} ${e.motionEaseInOut},
opacity ${e.motionDurationSlow} ${e.motionEaseInOut},
transform ${e.motionDurationSlow} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${r}-leave-active`]:{transform:"translateY(-5px)"}}}}},un=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${Y(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${Y(e.controlOutlineWidth)} ${e.controlOutline}`},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),_e=(e,t)=>{const{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},pn=e=>{const{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},Ie(e)),un(e)),{[`${t}-text`]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},_e(e,e.controlHeightSM)),"&-large":Object.assign({},_e(e,e.controlHeightLG))})}},fn=e=>{const{formItemCls:t,iconCls:n,componentCls:r,rootPrefixCls:o,antCls:l,labelRequiredMarkColor:m,labelColor:g,labelFontSize:x,labelHeight:C,labelColonMarginInlineStart:M,labelColonMarginInlineEnd:y,itemMarginBottom:T}=e;return{[t]:Object.assign(Object.assign({},Ie(e)),{marginBottom:T,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden${l}-row`]:{display:"none"},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:e.lineHeight,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:C,color:g,fontSize:x,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:"top"},[`&${t}-required:not(${t}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:e.marginXXS,color:m,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${r}-hide-required-mark &`]:{display:"none"}},[`${t}-optional`]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`${r}-hide-required-mark &`]:{display:"none"}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:M,marginInlineEnd:y},[`&${t}-no-colon::after`]:{content:'"\\a0"'}}},[`${t}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${o}-col-'"]):not([class*="' ${o}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%",lineHeight:"100%"}}},[t]:{"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:"auto",opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:Ge,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},Ve=(e,t)=>{const{formItemCls:n}=e;return{[`${t}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:"1 1 0",minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:"unset"}}}}},gn=e=>{const{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{[`${t}-inline`]:{display:"flex",flexWrap:"wrap",[n]:{flex:"none",marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:"nowrap"},[`> ${n}-label,
> ${n}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${n}-label`]:{flex:"none"},[`${t}-text`]:{display:"inline-block"},[`${n}-has-feedback`]:{display:"inline-block"}}}}},te=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),ot=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${n} ${n}-label`]:te(e),[`${t}:not(${t}-inline)`]:{[n]:{flexWrap:"wrap",[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${r}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},hn=e=>{const{componentCls:t,formItemCls:n,antCls:r}=e;return{[`${t}-vertical`]:{[`${n}:not(${n}-horizontal)`]:{[`${n}-row`]:{flexDirection:"column"},[`${n}-label > label`]:{height:"auto"},[`${n}-control`]:{width:"100%"},[`${n}-label,
${r}-col-24${n}-label,
${r}-col-xl-24${n}-label`]:te(e)}},[`@media (max-width: ${Y(e.screenXSMax)})`]:[ot(e),{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-xs-24${n}-label`]:te(e)}}}],[`@media (max-width: ${Y(e.screenSMMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-sm-24${n}-label`]:te(e)}}},[`@media (max-width: ${Y(e.screenMDMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-md-24${n}-label`]:te(e)}}},[`@media (max-width: ${Y(e.screenLGMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-lg-24${n}-label`]:te(e)}}}}},bn=e=>{const{formItemCls:t,antCls:n}=e;return{[`${t}-vertical`]:{[`${t}-row`]:{flexDirection:"column"},[`${t}-label > label`]:{height:"auto"},[`${t}-control`]:{width:"100%"}},[`${t}-vertical ${t}-label,
${n}-col-24${t}-label,
${n}-col-xl-24${t}-label`]:te(e),[`@media (max-width: ${Y(e.screenXSMax)})`]:[ot(e),{[t]:{[`${n}-col-xs-24${t}-label`]:te(e)}}],[`@media (max-width: ${Y(e.screenSMMax)})`]:{[t]:{[`${n}-col-sm-24${t}-label`]:te(e)}},[`@media (max-width: ${Y(e.screenMDMax)})`]:{[t]:{[`${n}-col-md-24${t}-label`]:te(e)}},[`@media (max-width: ${Y(e.screenLGMax)})`]:{[t]:{[`${n}-col-lg-24${t}-label`]:te(e)}}}},xn=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),lt=(e,t)=>Xe(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),Me=Qe("Form",(e,t)=>{let{rootPrefixCls:n}=t;const r=lt(e,n);return[pn(r),fn(r),mn(r),Ve(r,r.componentCls),Ve(r,r.formItemCls),gn(r),hn(r),bn(r),Zt(r),Ge]},xn,{order:-1e3}),We=[];function Se(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof e=="string"?e:`${t}-${r}`,error:e,errorStatus:n}}const st=e=>{let{help:t,helpStatus:n,errors:r=We,warnings:o=We,className:l,fieldId:m,onVisibleChanged:g}=e;const{prefixCls:x}=a.useContext(je),C=`${x}-item-explain`,M=Ee(x),[y,T,O]=Me(x,M),S=a.useMemo(()=>Te(x),[x]),v=he(r),N=he(o),$=a.useMemo(()=>t!=null?[Se(t,"help",n)]:[].concat(ee(v.map((p,w)=>Se(p,"error","error",w))),ee(N.map((p,w)=>Se(p,"warning","warning",w)))),[t,n,v,N]),q={};return m&&(q.id=`${m}_help`),y(a.createElement(gt,{motionDeadline:S.motionDeadline,motionName:`${x}-show-help`,visible:!!$.length,onVisibleChanged:g},p=>{const{className:w,style:j}=p;return a.createElement("div",Object.assign({},q,{className:oe(C,w,O,M,l,T),style:j,role:"alert"}),a.createElement(ht,Object.assign({keys:$},Te(x),{motionName:`${x}-show-help-item`,component:!1}),P=>{const{key:k,error:I,errorStatus:L,className:V,style:W}=P;return a.createElement("div",{key:k,className:oe(V,{[`${C}-${L}`]:L}),style:W},I)}))}))},yn=["parentNode"],vn="form_item";function me(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function it(e,t){if(!e.length)return;const n=e.join("_");return t?`${t}_${n}`:yn.includes(n)?`${vn}_${n}`:n}function ct(e,t,n,r,o,l){let m=r;return l!==void 0?m=l:n.validating?m="validating":e.length?m="error":t.length?m="warning":(n.touched||o&&n.validated)&&(m="success"),m}function He(e){return me(e).join("_")}function Cn(e,t){const n=t.getFieldInstance(e),r=xt(n);if(r)return r;const o=it(me(e),t.__INTERNAL__.name);if(o)return document.getElementById(o)}function dt(e){const[t]=bt(),n=a.useRef({}),r=a.useMemo(()=>e??Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:o=>l=>{const m=He(o);l?n.current[m]=l:delete n.current[m]}},scrollToField:function(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const m=Cn(o,r);m&&an(m,Object.assign({scrollMode:"if-needed",block:"nearest"},l))},getFieldInstance:o=>{const l=He(o);return n.current[l]}}),[e,t]);return[r]}var $n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Sn=(e,t)=>{const n=a.useContext(yt),{getPrefixCls:r,direction:o,form:l}=a.useContext(be),{prefixCls:m,className:g,rootClassName:x,size:C,disabled:M=n,form:y,colon:T,labelAlign:O,labelWrap:S,labelCol:v,wrapperCol:N,hideRequiredMark:$,layout:q="horizontal",scrollToFirstError:p,requiredMark:w,onFinishFailed:j,name:P,style:k,feedbackIcons:I,variant:L}=e,V=$n(e,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),W=vt(C),U=a.useContext(Ct),d=a.useMemo(()=>w!==void 0?w:$?!1:l&&l.requiredMark!==void 0?l.requiredMark:!0,[$,w,l]),f=T??(l==null?void 0:l.colon),u=r("form",m),h=Ee(u),[c,D,Q]=Me(u,h),G=oe(u,`${u}-${q}`,{[`${u}-hide-required-mark`]:d===!1,[`${u}-rtl`]:o==="rtl",[`${u}-${W}`]:W},Q,h,D,l==null?void 0:l.className,g,x),[B]=dt(y),{__INTERNAL__:X}=B;X.name=P;const A=a.useMemo(()=>({name:P,labelAlign:O,labelCol:v,labelWrap:S,wrapperCol:N,vertical:q==="vertical",colon:f,requiredMark:d,itemRef:X.itemRef,form:B,feedbackIcons:I}),[P,O,v,N,q,f,d,B,I]),Z=a.useRef(null);a.useImperativeHandle(t,()=>{var E;return Object.assign(Object.assign({},B),{nativeElement:(E=Z.current)===null||E===void 0?void 0:E.nativeElement})});const K=(E,s)=>{if(E){let b={block:"nearest"};typeof E=="object"&&(b=E),B.scrollToField(s,b)}},J=E=>{if(j==null||j(E),E.errorFields.length){const s=E.errorFields[0].name;if(p!==void 0){K(p,s);return}l&&l.scrollToFirstError!==void 0&&K(l.scrollToFirstError,s)}};return c(a.createElement($t.Provider,{value:L},a.createElement(St,{disabled:M},a.createElement(wt.Provider,{value:W},a.createElement(Ke,{validateMessages:U},a.createElement(se.Provider,{value:A},a.createElement(It,Object.assign({id:P},V,{name:P,onFinishFailed:J,form:B,ref:Z,style:Object.assign(Object.assign({},l==null?void 0:l.style),k),className:G}))))))))},wn=a.forwardRef(Sn);function In(e){if(typeof e=="function")return e;const t=jt(e);return t.length<=1?t[0]:t}const mt=()=>{const{status:e,errors:t=[],warnings:n=[]}=a.useContext(ge);return{status:e,errors:t,warnings:n}};mt.Context=ge;function jn(e){const[t,n]=a.useState(e),r=a.useRef(null),o=a.useRef([]),l=a.useRef(!1);a.useEffect(()=>(l.current=!1,()=>{l.current=!0,Ne.cancel(r.current),r.current=null}),[]);function m(g){l.current||(r.current===null&&(o.current=[],r.current=Ne(()=>{r.current=null,n(x=>{let C=x;return o.current.forEach(M=>{C=M(C)}),C})})),o.current.push(g))}return[t,m]}function En(){const{itemRef:e}=a.useContext(se),t=a.useRef({});function n(r,o){const l=o&&typeof o=="object"&&o.ref,m=r.join("_");return(t.current.name!==m||t.current.originRef!==l)&&(t.current.name=m,t.current.originRef=l,t.current.ref=Et(e(r),l)),t.current.ref}return n}const Mn=e=>{const{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:"flex"}}}},On=Mt(["Form","item-item"],(e,t)=>{let{rootPrefixCls:n}=t;const r=lt(e,n);return[Mn(r)]}),Fn=e=>{const{prefixCls:t,status:n,wrapperCol:r,children:o,errors:l,warnings:m,_internalItemRender:g,extra:x,help:C,fieldId:M,marginBottom:y,onErrorVisibleChanged:T}=e,O=`${t}-item`,S=a.useContext(se),v=r||S.wrapperCol||{},N=oe(`${O}-control`,v.className),$=a.useMemo(()=>Object.assign({},S),[S]);delete $.labelCol,delete $.wrapperCol;const q=a.createElement("div",{className:`${O}-control-input`},a.createElement("div",{className:`${O}-control-input-content`},o)),p=a.useMemo(()=>({prefixCls:t,status:n}),[t,n]),w=y!==null||l.length||m.length?a.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},a.createElement(je.Provider,{value:p},a.createElement(st,{fieldId:M,errors:l,warnings:m,help:C,helpStatus:n,className:`${O}-explain-connected`,onVisibleChanged:T})),!!y&&a.createElement("div",{style:{width:0,height:y}})):null,j={};M&&(j.id=`${M}_extra`);const P=x?a.createElement("div",Object.assign({},j,{className:`${O}-extra`}),x):null,k=g&&g.mark==="pro_table_render"&&g.render?g.render(e,{input:q,errorList:w,extra:P}):a.createElement(a.Fragment,null,q,w,P);return a.createElement(se.Provider,{value:$},a.createElement(at,Object.assign({},v,{className:N}),k),a.createElement(On,{prefixCls:t}))};var qn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},Pn=function(t,n){return a.createElement(Ye,Ue({},t,{ref:n,icon:qn}))},Tn=a.forwardRef(Pn),Nn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function Rn(e){return e?typeof e=="object"&&!a.isValidElement(e)?e:{title:e}:null}const kn=e=>{let{prefixCls:t,label:n,htmlFor:r,labelCol:o,labelAlign:l,colon:m,required:g,requiredMark:x,tooltip:C,vertical:M}=e;var y;const[T]=Ot("Form"),{labelAlign:O,labelCol:S,labelWrap:v,colon:N}=a.useContext(se);if(!n)return null;const $=o||S||{},q=l||O,p=`${t}-item-label`,w=oe(p,q==="left"&&`${p}-left`,$.className,{[`${p}-wrap`]:!!v});let j=n;const P=m===!0||N!==!1&&m!==!1;P&&!M&&typeof n=="string"&&n.trim()!==""&&(j=n.replace(/[:|:]\s*$/,""));const I=Rn(C);if(I){const{icon:U=a.createElement(Tn,null)}=I,d=Nn(I,["icon"]),f=a.createElement(en,Object.assign({},d),a.cloneElement(U,{className:`${t}-item-tooltip`,title:"",onClick:u=>{u.preventDefault()},tabIndex:null}));j=a.createElement(a.Fragment,null,j,f)}const L=x==="optional",V=typeof x=="function";V?j=x(j,{required:!!g}):L&&!g&&(j=a.createElement(a.Fragment,null,j,a.createElement("span",{className:`${t}-item-optional`,title:""},(T==null?void 0:T.optional)||((y=Ft.Form)===null||y===void 0?void 0:y.optional))));const W=oe({[`${t}-item-required`]:g,[`${t}-item-required-mark-optional`]:L||V,[`${t}-item-no-colon`]:!P});return a.createElement(at,Object.assign({},$,{className:w}),a.createElement("label",{htmlFor:r,className:W,title:typeof n=="string"?n:""},j))},zn={success:qt,warning:Pt,error:Tt,validating:Nt};function ut(e){let{children:t,errors:n,warnings:r,hasFeedback:o,validateStatus:l,prefixCls:m,meta:g,noStyle:x}=e;const C=`${m}-item`,{feedbackIcons:M}=a.useContext(se),y=ct(n,r,g,null,!!o,l),{isFormItemInput:T,status:O,hasFeedback:S,feedbackIcon:v}=a.useContext(ge),N=a.useMemo(()=>{var $;let q;if(o){const w=o!==!0&&o.icons||M,j=y&&(($=w==null?void 0:w({status:y,errors:n,warnings:r}))===null||$===void 0?void 0:$[y]),P=y&&zn[y];q=j!==!1&&P?a.createElement("span",{className:oe(`${C}-feedback-icon`,`${C}-feedback-icon-${y}`)},j||a.createElement(P,null)):null}const p={status:y||"",errors:n,warnings:r,hasFeedback:!!o,feedbackIcon:q,isFormItemInput:!0};return x&&(p.status=(y??O)||"",p.isFormItemInput=T,p.hasFeedback=!!(o??S),p.feedbackIcon=o!==void 0?p.feedbackIcon:v),p},[y,o,x,T,O]);return a.createElement(ge.Provider,{value:N},t)}var Dn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function Ln(e){const{prefixCls:t,className:n,rootClassName:r,style:o,help:l,errors:m,warnings:g,validateStatus:x,meta:C,hasFeedback:M,hidden:y,children:T,fieldId:O,required:S,isRequired:v,onSubItemMetaChange:N,layout:$}=e,q=Dn(e,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange","layout"]),p=`${t}-item`,{requiredMark:w,vertical:j}=a.useContext(se),P=j||$==="vertical",k=a.useRef(null),I=he(m),L=he(g),V=l!=null,W=!!(V||m.length||g.length),U=!!k.current&&Rt(k.current),[d,f]=a.useState(null);kt(()=>{if(W&&k.current){const Q=getComputedStyle(k.current);f(parseInt(Q.marginBottom,10))}},[W,U]);const u=Q=>{Q||f(null)},c=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const G=Q?I:C.errors,B=Q?L:C.warnings;return ct(G,B,C,"",!!M,x)}(),D=oe(p,n,r,{[`${p}-with-help`]:V||I.length||L.length,[`${p}-has-feedback`]:c&&M,[`${p}-has-success`]:c==="success",[`${p}-has-warning`]:c==="warning",[`${p}-has-error`]:c==="error",[`${p}-is-validating`]:c==="validating",[`${p}-hidden`]:y,[`${p}-${$}`]:$});return a.createElement("div",{className:D,style:o,ref:k},a.createElement(tn,Object.assign({className:`${p}-row`},zt(q,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),a.createElement(kn,Object.assign({htmlFor:O},e,{requiredMark:w,required:S??v,prefixCls:t,vertical:P})),a.createElement(Fn,Object.assign({},e,C,{errors:I,warnings:L,prefixCls:t,status:c,help:l,marginBottom:d,onErrorVisibleChanged:u}),a.createElement(Je.Provider,{value:N},a.createElement(ut,{prefixCls:t,meta:C,errors:C.errors,warnings:C.warnings,hasFeedback:M,validateStatus:c},T)))),!!d&&a.createElement("div",{className:`${p}-margin-offset`,style:{marginBottom:-d}}))}const _n="__SPLIT__";function Vn(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(o=>{const l=e[o],m=t[o];return l===m||typeof l=="function"||typeof m=="function"})}const Wn=a.memo(e=>{let{children:t}=e;return t},(e,t)=>Vn(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((n,r)=>n===t.childProps[r]));function Be(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Hn(e){const{name:t,noStyle:n,className:r,dependencies:o,prefixCls:l,shouldUpdate:m,rules:g,children:x,required:C,label:M,messageVariables:y,trigger:T="onChange",validateTrigger:O,hidden:S,help:v,layout:N}=e,{getPrefixCls:$}=a.useContext(be),{name:q}=a.useContext(se),p=In(x),w=typeof p=="function",j=a.useContext(Je),{validateTrigger:P}=a.useContext(Dt),k=O!==void 0?O:P,I=t!=null,L=$("form",l),V=Ee(L),[W,U,d]=Me(L,V);Bt();const f=a.useContext(Lt),u=a.useRef(),[h,c]=jn({}),[D,Q]=_t(()=>Be()),G=E=>{const s=f==null?void 0:f.getKey(E.name);if(Q(E.destroy?Be():E,!0),n&&v!==!1&&j){let b=E.name;if(E.destroy)b=u.current||b;else if(s!==void 0){const[F,R]=s;b=[F].concat(ee(R)),u.current=b}j(E,b)}},B=(E,s)=>{c(b=>{const F=Object.assign({},b),ne=[].concat(ee(E.name.slice(0,-1)),ee(s)).join(_n);return E.destroy?delete F[ne]:F[ne]=E,F})},[X,A]=a.useMemo(()=>{const E=ee(D.errors),s=ee(D.warnings);return Object.values(h).forEach(b=>{E.push.apply(E,ee(b.errors||[])),s.push.apply(s,ee(b.warnings||[]))}),[E,s]},[h,D.errors,D.warnings]),Z=En();function K(E,s,b){return n&&!S?a.createElement(ut,{prefixCls:L,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:D,errors:X,warnings:A,noStyle:!0},E):a.createElement(Ln,Object.assign({key:"row"},e,{className:oe(r,d,V,U),prefixCls:L,fieldId:s,isRequired:b,errors:X,warnings:A,meta:D,onSubItemMetaChange:B,layout:N}),E)}if(!I&&!w&&!o)return W(K(p));let J={};return typeof M=="string"?J.label=M:t&&(J.label=String(t)),y&&(J=Object.assign(Object.assign({},J),y)),W(a.createElement(Vt,Object.assign({},e,{messageVariables:J,trigger:T,validateTrigger:k,onMetaChange:G}),(E,s,b)=>{const F=me(t).length&&s?s.name:[],R=it(F,q),ne=C!==void 0?C:!!(g!=null&&g.some(H=>{if(H&&typeof H=="object"&&H.required&&!H.warningOnly)return!0;if(typeof H=="function"){const re=H(b);return(re==null?void 0:re.required)&&!(re!=null&&re.warningOnly)}return!1})),ie=Object.assign({},E);let le=null;if(Array.isArray(p)&&I)le=p;else if(!(w&&(!(m||o)||I))){if(!(o&&!w&&!I))if(a.isValidElement(p)){const H=Object.assign(Object.assign({},p.props),ie);if(H.id||(H.id=R),v||X.length>0||A.length>0||e.extra){const de=[];(v||X.length>0)&&de.push(`${R}_help`),e.extra&&de.push(`${R}_extra`),H["aria-describedby"]=de.join(" ")}X.length>0&&(H["aria-invalid"]="true"),ne&&(H["aria-required"]="true"),Wt(p)&&(H.ref=Z(F,p)),new Set([].concat(ee(me(T)),ee(me(k)))).forEach(de=>{H[de]=function(){for(var Oe,Fe,ye,qe,ve,Pe=arguments.length,Ce=new Array(Pe),ue=0;ue<Pe;ue++)Ce[ue]=arguments[ue];(ye=ie[de])===null||ye===void 0||(Oe=ye).call.apply(Oe,[ie].concat(Ce)),(ve=(qe=p.props)[de])===null||ve===void 0||(Fe=ve).call.apply(Fe,[qe].concat(Ce))}});const ft=[H["aria-required"],H["aria-invalid"],H["aria-describedby"]];le=a.createElement(Wn,{control:ie,update:p,childProps:ft},Ht(p,H))}else w&&(m||o)&&!I?le=p(b):le=p}return K(le,R,ne)}))}const pt=Hn;pt.useStatus=mt;var Bn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const An=e=>{var{prefixCls:t,children:n}=e,r=Bn(e,["prefixCls","children"]);const{getPrefixCls:o}=a.useContext(be),l=o("form",t),m=a.useMemo(()=>({prefixCls:l,status:"error"}),[l]);return a.createElement(At,Object.assign({},r),(g,x,C)=>a.createElement(je.Provider,{value:m},n(g.map(M=>Object.assign(Object.assign({},M),{fieldKey:M.key})),x,{errors:C.errors,warnings:C.warnings})))};function Qn(){const{form:e}=a.useContext(se);return e}const _=wn;_.Item=pt;_.List=An;_.ErrorList=st;_.useForm=dt;_.useFormInstance=Qn;_.useWatch=Qt;_.Provider=Ke;_.create=()=>{};var Xn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-12-12-28.3-18.7-45.3-18.7H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 176h256v112H384V176zm128 554c-79.5 0-144-64.5-144-144s64.5-144 144-144 144 64.5 144 144-64.5 144-144 144zm0-224c-44.2 0-80 35.8-80 80s35.8 80 80 80 80-35.8 80-80-35.8-80-80-80z"}}]},name:"save",theme:"filled"},Gn=function(t,n){return a.createElement(Ye,Ue({},t,{ref:n,icon:Xn}))},Kn=a.forwardRef(Gn);const{TabPane:Yn}=xe,Un=e=>{const[t,n]=a.useState(localStorage.getItem("dbname")),[r,o]=a.useState(""),[l,m]=a.useState(""),[g,x]=a.useState(""),[C,M]=a.useState(""),[y,T]=a.useState([]),[O,S]=a.useState({}),[v,N]=a.useState(!1),[$,q]=a.useState(""),[p,w]=a.useState([]);a.useEffect(()=>{e.element&&j(e.element)},[e.element]),a.useEffect(()=>{y.length>0&&!$&&q(y[0].partcode)},[y]);const j=async d=>{try{N(!0);const u=(await we.get(`app.php?a=tempCodeDet&db=${t}&univcode=${e.funivcode}&ftempcode=${d}`)).data.data;o(u.ftempcode),m(u.ftempname),x(u.ftempdesc),M(u.ftempmax),T(u.sumarr);const h={};u.sumarr.forEach(c=>{h[c.partcode]=[]}),u.detlength!=="F"&&u.sumarrdet.forEach(c=>{const D={id:c.fqncode,qpcode:c.fqncode,qpno:c.fqnno,level:c.fqnlevel,parent:c.fqnparent,maxmarks:c.fmaxmarks,subqn:c.fsubqp,maxqn:c.fsubmaxqn,mandqp:c.fsubmandqn,order:c.fqnord};h[c.fpartcode].push(D)}),S(h),N(!1)}catch(f){N(!1),ae("error",f.message)}},P=(d,f)=>{const u={...O},h=u[d]||[];if(h!=""&&h.slice(-1)[0].id!==f.id)return;if(h.length>0&&h.slice(-1)[0].qpcode===""&&h.slice(-1)[0].qpno&&h.slice(-1)[0].level===""&&h.slice(-1)[0].parent&&h.slice(-1)[0].maxmarks===""&&h.slice(-1)[0].subqn&&h.slice(-1)[0].maxqn===""&&h.slice(-1)[0].mandqp&&h.slice(-1)[0].order===""){ae("error","Last row is empty..!");return}const c=h.slice(-1)[0],D=c?parseInt(c.order,10):0,Q=c?parseInt(c.qpcode,10):0;let G=[];if(c&&c.subqn==="T"){const B=parseInt(c.maxqn,10)||0,X=D+1,A=Q+1;G=Array.from({length:B},(Z,K)=>({id:`${c.qpcode}-${X+K}`,qpcode:(A+K).toString(),qpno:"",level:"1",parent:c.qpcode,maxmarks:"",subqn:"F",maxqn:"1",mandqp:"1",order:(X+K).toString().padStart(2,"0")}))}else{const B=(D+1).toString().padStart(2,"0");G=[{id:(c?parseInt(c.qpcode,10)+1:1).toString(),qpcode:(c?parseInt(c.qpcode,10)+1:1).toString(),qpno:"",level:"",parent:"",maxmarks:"",subqn:"",maxqn:"",mandqp:"",order:B}]}u[d]=[...h,...G],S(u)},k=(d,f)=>{tt.confirm({title:"Warning",content:"Do you want delete?",okButtonProps:{style:{backgroundColor:"#8231d3",borderColor:"#8231d3"}},onOk(){const u={...O},h=u[d][f];w(c=>[...c,{partcode:d,...h}]),u[d]=u[d].filter((c,D)=>D!==f),S(u),ae("success","Row deleted successfully")},onCancel(){console.log("Cancelled")}})},I=(d,f,u,h)=>{const c={...O};c[$][f][u]=h,S(c)},L=async()=>{const d=new FormData;d.append("sumdata",JSON.stringify(O)),d.append("delrows",JSON.stringify(p)),d.append("tempcode",r),e.saveTempDetPart(d)},V=[{title:"Sl. No.",render:(d,f,u)=>u+1,align:"center"},{title:"Qn. Code",dataIndex:"qpcode",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f,u,"qpcode",h.target.value),style:{width:"4rem"}}),align:"center"},{title:"Qn. No",dataIndex:"qpno",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f.partcode,u,"qpno",h.target.value),style:{width:"6rem"}}),align:"center"},{title:"Level",dataIndex:"level",key:"level",align:"center",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f.partcode,u,"level",h.target.value),style:{width:"3rem"}})},{title:"Parent",dataIndex:"parent",key:"parent",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f.partcode,u,"parent",h.target.value),style:{width:"4rem"}})},{title:"Max. Marks",dataIndex:"maxmarks",key:"maxmarks",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f.partcode,u,"maxmarks",h.target.value),style:{width:"4rem"}})},{title:"Sub Qn.",dataIndex:"subqn",key:"subqn",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f.partcode,u,"subqn",h.target.value),style:{width:"4rem"}})},{title:"Max. Qns",dataIndex:"maxqn",key:"maxqn",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f.partcode,u,"maxqn",h.target.value),style:{width:"4rem"}})},{title:"Mand. Qns",dataIndex:"mandqp",key:"mandqp",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f.partcode,u,"mandqp",h.target.value),style:{width:"4rem"}})},{title:"Order",dataIndex:"order",key:"order",render:(d,f,u)=>i.jsx(z,{value:d,onChange:h=>I(f.partcode,u,"order",h.target.value),style:{width:"4rem"}})},{title:"Action",render:(d,f,u)=>i.jsx(ce,{icon:i.jsx(rt,{}),onClick:()=>k($,u),style:{backgroundColor:"#db2828",color:"#fff"},onKeyDown:()=>P($,f)}),align:"center"}],W=y.map(d=>({key:d.partcode,tab:i.jsx("div",{style:{display:"flex",alignItems:"center"},children:d.partcode}),children:i.jsxs(i.Fragment,{children:[i.jsx(dn,{}),i.jsx(nt,{dataSource:O[d.partcode],columns:V,pagination:!1,scroll:{x:1300,y:300},rowKey:"id"})]})})),U={right:i.jsxs(i.Fragment,{children:[i.jsx(ce,{icon:i.jsx(et,{}),onClick:()=>P($),style:{marginLeft:"auto",marginRight:"10px"},children:"Add Row"}),i.jsx(ce,{icon:i.jsx(Kn,{}),onClick:L,type:"primary",loading:v,children:"Save"})]})};return i.jsx(xe,{activeKey:$,onChange:d=>{q(d)},tabBarExtraContent:U,children:W.map(d=>i.jsx(Yn,{tab:d.tab,children:d.children},d.key))})},Jn=e=>({funivcode:e.loginfo.userData.funivcode}),Zn=Ze(Jn,{saveTempDetPart:Kt})(Un),{TabPane:Ae}=xe,er=e=>{a.useState(""),Xt();const[t,n]=a.useState([]),[r,o]=a.useState("large"),[l,m]=a.useState(""),[g,x]=a.useState(""),[C,M]=a.useState(""),[y,T]=a.useState(""),[O,S]=a.useState(""),v=a.useRef(null),[N,$]=a.useState(""),[q,p]=a.useState(""),[w,j]=a.useState(""),[P,k]=a.useState(""),[I,L]=a.useState(""),[V,W]=a.useState(""),[U,d]=a.useState([]),[f,u]=a.useState(!1),{ftempcode:h,type:c}=Gt(),[D,Q]=a.useState(localStorage.getItem("dbname"));a.useEffect(()=>{h!=""&&c=="edit"&&G(h)},[]);const G=async s=>{we.get("app.php?a=tempCodeDet&db="+D+"&univcode="+e.funivcode+"&ftempcode="+s).then(b=>{if(typeof b.data!="object"){ae("Error","Something went wrong, Please try again later");return}else if(b.data.error_code==0){m(b.data.data.ftempcode),x(b.data.data.ftempname),M(b.data.data.ftempdesc),T(b.data.data.ftempmax),S(b.data.data.ftotmandqn),n(b.data.data.sumarr),u(!0);return}}).catch(b=>console.log(b))},B=async()=>{we.get("app.php?a=checkTempCode&db="+D+"&univcode="+e.funivcode+"&ftempcode="+l).then(s=>{if(typeof s.data!="object"){ae("Error","Something went wrong, Please try again later");return}else if(s.data.error_code==0){if(s.data.data.length>0){ae("Template Code already exists!"),m(""),v.current.focus();return}return}}).catch(s=>console.log(s))},X=[{title:"Sl. No.",dataIndex:"fslno",align:"center",render:(s,b,F)=>F+1},{title:"Part Code",dataIndex:"partcode",align:"center",key:"partcode",render:(s,b,F)=>i.jsx(z,{value:s,onChange:R=>A(F,"partcode",R.target.value),style:{width:"6rem"}})},{title:"Part Description",dataIndex:"partdescp",align:"center",key:"partdescp",render:(s,b,F)=>i.jsx(z,{value:s,onChange:R=>A(F,"partdescp",R.target.value),style:{width:"25rem"}})},{title:"Max. Qns.",dataIndex:"maxqns",align:"center",key:"maxqns",render:(s,b,F)=>i.jsx(z,{value:s,onChange:R=>A(F,"maxqns",R.target.value),style:{width:"6rem"}})},{title:"Mand. Qns.",dataIndex:"mandqns",align:"center",key:"mandqns",render:(s,b,F)=>i.jsx(z,{value:s,onChange:R=>A(F,"mandqns",R.target.value),style:{width:"6rem"}})},{title:"Max. Marks.",dataIndex:"maxmarks",align:"center",key:"maxmarks",render:(s,b,F)=>i.jsx(z,{value:s,onChange:R=>A(F,"maxmarks",R.target.value),style:{width:"6rem"}})},{title:"Min. Qns.",dataIndex:"minqns",align:"center",key:"minqns",render:(s,b,F)=>i.jsx(z,{value:s,onChange:R=>A(F,"minqns",R.target.value),style:{width:"6rem"}})},{title:"Delete",dataIndex:"fdelete",align:"center",render:(s,b)=>i.jsx(pe,{children:i.jsxs(ce,{size:"medium",style:{background:"#db2828",color:"#fff"},onClick:()=>Z(b.key),children:[i.jsx(rt,{})," Delete"]})})}],A=(s,b,F)=>{const R=[...t];R[s][b]=F,n(R)},Z=s=>{tt.confirm({title:"Warning",content:"Do you want delete?",okButtonProps:{style:{backgroundColor:"#8231d3",borderColor:"#8231d3"}},onOk(){const b=t.find(R=>R.key===s);if(!b){ae("Row not found");return}const F=t.filter(R=>R.key!==s);n(F),d([...U,b]),ae("success","Row deleted successfully")},onCancel(){console.log("Cancelled")}})},K=()=>{if(l==""){ae("error","Enter Template Info...!!!"),$(""),v.current.focus();return}},J=()=>{if(N==""&&q==""&&w==""&&P==""&&I==""&&V==""){ae("error","Enter Part Details!");return}const s={key:Date.now(),partcode:N,partdescp:q,maxqns:w,mandqns:P,maxmarks:I,minqns:V};n([...t,s]),$(""),p(""),k(""),j(""),L(""),W("")},E=async()=>{const s=new FormData;s.append("sumdata",JSON.stringify(t)),s.append("delrows",JSON.stringify(U)),s.append("tempcode",l),s.append("tempname",g),s.append("tempdesc",C),s.append("tempmaxmarks",y),s.append("tempmandqns",O),e.saveparthead(s),u(!0)};return i.jsxs(Re,{style:{margin:"6rem 10px 10px"},title:i.jsx("h6",{children:"Create Template"}),extra:i.jsxs(pe,{children:[i.jsx(ke,{to:"/qpsettings/crttemp",children:i.jsxs(ce,{type:"primary",style:{backgroundColor:"green"},children:[i.jsx(Ut,{}),"Back"]})}),i.jsx(ke,{to:"/dashboard",children:i.jsxs(ce,{type:"primary",danger:!0,children:[i.jsx(Jt,{}),"Exit"]})})]}),children:[i.jsx(_,{layout:"vertical",children:i.jsxs(pe,{children:[i.jsx(_.Item,{label:"Template Code",children:i.jsx(z,{ref:v,placeholder:"Template Code",name:"tempcode",value:l,onChange:s=>m(s.target.value.toUpperCase()),onBlur:B,disabled:f,style:{width:"8rem"}})}),i.jsx(_.Item,{label:"Template Name",children:i.jsx(z,{name:"tempname",placeholder:"Template Name",value:g,onChange:s=>x(s.target.value),disabled:f,style:{width:"15rem"}})}),i.jsx(_.Item,{label:"Template Description",children:i.jsx(z,{placeholder:"Template Description",name:"tempdesc",value:C,onChange:s=>M(s.target.value),disabled:f,style:{width:"25rem"}})}),i.jsx(_.Item,{label:"Max. Marks",children:i.jsx(z,{type:"number",placeholder:"Max. Marks",name:"tempmaxmarks",value:y,maxLength:3,onChange:s=>T(s.target.value),disabled:f})}),i.jsx(_.Item,{label:"Total Mand. Qns",children:i.jsx(z,{type:"number",placeholder:"Mand. Qns",name:"tempmandqns",value:O,maxLength:3,onChange:s=>S(s.target.value),disabled:f})})]})}),i.jsxs(xe,{defaultActiveKey:"1",type:"card",size:r,children:[i.jsx(Ae,{tab:"Summary",children:i.jsx("div",{children:i.jsx(Re,{children:i.jsxs(_,{children:[i.jsxs(pe,{children:[i.jsx(_.Item,{children:i.jsx(z,{placeholder:"Part Code",name:"partcode",value:N,onChange:s=>$(s.target.value.toUpperCase()),onBlur:K,style:{width:"8rem"}})}),i.jsx(_.Item,{children:i.jsx(z,{name:"partdesc",placeholder:"Part Description",value:q,onChange:s=>p(s.target.value),style:{width:"25rem"}})}),i.jsx(_.Item,{children:i.jsx(z,{type:"number",placeholder:"Max. Qns.",name:"maxqns",value:w,onChange:s=>j(s.target.value)})}),i.jsx(_.Item,{children:i.jsx(z,{type:"number",placeholder:"Mand. Qns.",name:"mandqns",value:P,onChange:s=>k(s.target.value)})}),i.jsx(_.Item,{children:i.jsx(z,{type:"number",placeholder:"Max. Marks",name:"maxmrks",value:I,maxLength:3,onChange:s=>L(s.target.value)})}),i.jsx(_.Item,{children:i.jsx(z,{type:"number",placeholder:"Min. Qns",name:"minqns",value:V,maxLength:3,onChange:s=>W(s.target.value)})}),i.jsx(_.Item,{children:i.jsxs(ce,{type:"primary",style:{backgroundColor:"#21ba45"},onClick:J,children:[i.jsx(et,{}),"Add"]})})]}),i.jsx(nt,{dataSource:t,columns:X,pagination:!1,scroll:{x:1300},rowKey:"key"}),t.length>0&&i.jsx(ce,{type:"primary",style:{marginTop:16,backgroundColor:"#21ba45"},onClick:E,children:"Save"})]})})})},"1"),i.jsx(Ae,{tab:"Details",children:i.jsx(Zn,{element:h})},"2")]})]})},tr=e=>({funivcode:e.loginfo.userData.funivcode,tempCode:e.tempCode}),fr=Ze(tr,{saveparthead:Yt})(er);export{fr as default};
|