You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
20 KiB
1 line
20 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[35192,90282],{88996:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(1565),r=n(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{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"}}]},name:"plus-circle",theme:"outlined"},i=n(99194),l=function(e,t){return r.createElement(i.Z,(0,a.Z)({},e,{ref:t,icon:o}))};var s=r.forwardRef(l)},13281:function(e,t,n){n.d(t,{Z:function(){return d}});n(59301);var a="title___Ynb7w",r="time___dxFRB",o=n(92310),i=n.n(o),l=n(83274),s=n(99232),c=n.n(s),u=n(37712),d=function(e){var t=e.className,n=e.status,o=e.style,s=void 0===o?{}:o,d=e.startAt,f=e.endAt,m=e.title;return(0,u.jsxs)("div",{className:i()(a,t),style:s,children:[(0,u.jsx)("b",{children:m}),(0,u.jsx)(l.Z,{className:"ml10",status:n}),(0,u.jsxs)("span",{className:r,children:[(0,u.jsxs)("span",{children:["开启时间",(0,u.jsx)("span",{className:"ml10",children:d?c()(d).format("YYYY-MM-DD HH:mm"):"--"})]}),(0,u.jsxs)("span",{className:"ml30",children:["截止时间",(0,u.jsx)("span",{className:"ml10",children:f?c()(f).format("YYYY-MM-DD HH:mm"):"--"})]})]})]})}},83274:function(e,t,n){n.d(t,{Z:function(){return s}});var a=n(59301),r="tag___NEywM",o=n(92310),i=n.n(o),l=n(37712),s=function(e){var t=e.className,n=e.status;return(0,l.jsxs)(a.Fragment,{children:[0===n&&(0,l.jsx)("div",{className:i()(r,t),children:"未开始"}),1===n&&(0,l.jsx)("div",{className:i()(r,t),style:{background:"#19CB70"},children:"进行中"}),2===n&&(0,l.jsx)("div",{className:i()(r,t),style:{background:"#EE5D5D"},children:"已结束"})]})}},26123:function(e,t,n){n.d(t,{Z:function(){return $}});var a=n(82242),r=n.n(a),o=n(7557),i=n.n(o),l=n(41498),s=n.n(l),c=n(79800),u=n.n(c),d=n(59301),f="wrap____H2XH",m=n(7880),p=n(95237),g=n(52306),v=n(90963),h=n(13281),x=n(51136),b=n(38270),y=n(7406),S=n(6457),w=n(37712),$=(0,m.connect)((function(e){return{graduations:e.graduations}}))((function(e){var t,n,a,o=e.graduations,l=(e.dispatch,e.tags),c=e.tagsTitle,$=e.tagsTitleWidth,C=e.placeholder,j=e.columns,E=e.updateKey,z=e.inputWidth,N=void 0===z?214:z,k=(0,m.useParams)(),O=(0,m.useSearchParams)(),Z=u()(O,1)[0],H=(0,d.useState)(!1),M=u()(H,2),T=M[0],I=M[1],_=(0,d.useState)(0),D=u()(_,2),R=D[0],B=D[1],L=(0,d.useState)([]),F=u()(L,2),P=F[0],W=F[1],Y=(0,d.useState)(!1),A=u()(Y,2),G=A[0],X=A[1],K=o.menus,V=null===(t=location.pathname.split("/"))||void 0===t?void 0:t[3],q=K.find((function(e){return e.clazz===V}))||{},Q=K.find((function(e){return e.clazz===V}))||1,J=null!=Z&&Z.get("state")?Number(null==Z?void 0:Z.get("state")):"",U=(0,d.useState)({keyword:"",status:J,page:1,limit:20}),ee=u()(U,2),te=ee[0],ne=ee[1];(0,d.useEffect)((function(){null!=q&&q.id&&ae(te)}),[null==q?void 0:q.id,E]);var ae=function(){var e=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(!0),e.next=3,(0,x.ZP)("/api/graduations/".concat(k.id,"/graduation_stages/").concat(null==q?void 0:q.id,".json"),{method:"get",params:t});case 3:0===(n=e.sent).status&&(W((null==n?void 0:n.data)||[]),B(null==n?void 0:n.total_count)),I(!1);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),re=[{name:"任务书",key:"tasks",notStartText:"当前阶段还未开启"},{name:"开题报告",key:"opening_report",notStartText:"当前阶段还未开启"},{name:"中期检查",key:"midterm_report",notStartText:"当前阶段还未开启"},{name:"毕业论文",key:"thesis",notStartText:"当前阶段还未开启"},{name:"毕业答辩",key:"final_defense",notStartText:"当前阶段还未开启"},{name:"论文定稿",key:"final_thesis",notStartText:"当前阶段还未开启"}],oe=null==re||null===(n=re.find((function(e){return e.key===(null==q?void 0:q.clazz)})))||void 0===n?void 0:n.notStartText;return(0,w.jsxs)("div",{className:f,children:[(0,w.jsx)(h.Z,{title:null==q?void 0:q.name,className:"mb10",status:null==q?void 0:q.status,startAt:null==q?void 0:q.start_at,endAt:null==q?void 0:q.end_at}),(0,w.jsxs)(p.Z,{align:"middle",justify:"end",style:{height:66},children:[!(null==q||!q.status)&&(0,w.jsxs)(p.Z,{align:"middle",style:{flex:1},children:[(0,w.jsx)(v.qp,{title:c,value:te.status,onChange:function(e){te.status=e,te.page=1,ne(te),ae(te)},dataSource:l,className:"mt20",titleWidth:$}),(0,w.jsx)(v.t7,{style:{width:N,marginLeft:"auto"},placeholder:C,value:te.keyword,onChange:function(e){te.keyword=e,te.page=1,ne(te),ae(te)}})]}),(0,S.QB)(null==q?void 0:q.next_start_at)&&(0,w.jsxs)(v.op,{style:{marginLeft:15},onClick:function(){return X(!0)},children:[(0,w.jsx)("i",{className:"iconfont icon-anquanshezhi font14 mr5"}),null==q?void 0:q.name,"设置"]})]}),0===(null==q?void 0:q.status)&&(0,w.jsx)(y.Z,{customText:oe}),!(null==q||!q.status)&&(0,w.jsx)(g.Z,{columns:j,dataSource:P,loading:T,rowKey:"id",locale:{emptyText:(0,w.jsx)(y.Z,{})},pagination:{current:te.page,hideOnSinglePage:!R,showQuickJumper:!0,showSizeChanger:!0,pageSize:te.limit,pageSizeOptions:["10","20","50","100","200"],total:R,size:"default",showTotal:S.rU,onChange:function(e,t){te.page=e,te.limit=t,ne(te),ae(te)}}}),(0,w.jsx)(b.Z,{visible:G,data:r()(r()({},q),{},{disabled_time:null==K||null===(a=K[Q-1])||void 0===a?void 0:a.end_at}),onClose:function(){return X(!1)},onSuccess:function(){X(!1)}})]})}))},28103:function(e,t,n){n.d(t,{Z:function(){return m}});var a=n(92310),r=n.n(a),o=n(59301),i=n(36355),l=n(17313),s=n(83116),c=n(37613);const u=e=>{const{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:a,lineWidth:r,textPaddingInline:o,orientationMargin:i,verticalMarginInline:s}=e;return{[t]:Object.assign(Object.assign({},(0,l.Wf)(e)),{borderBlockStart:`${r}px solid ${a}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:s,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${a}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${a}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:100*i+"%"},"&::after":{width:100-100*i+"%"}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:100-100*i+"%"},"&::after":{width:100*i+"%"}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:o},"&-dashed":{background:"none",borderColor:a,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:r,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}}})}};var d=(0,s.Z)("Divider",(e=>{const t=(0,c.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[u(t)]}),(e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}))),f=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};var m=e=>{const{getPrefixCls:t,direction:n,divider:a}=o.useContext(i.E_),{prefixCls:l,type:s="horizontal",orientation:c="center",orientationMargin:u,className:m,rootClassName:p,children:g,dashed:v,plain:h,style:x}=e,b=f(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),y=t("divider",l),[S,w]=d(y),$=c.length>0?`-${c}`:c,C=!!g,j="left"===c&&null!=u,E="right"===c&&null!=u,z=r()(y,null==a?void 0:a.className,w,`${y}-${s}`,{[`${y}-with-text`]:C,[`${y}-with-text${$}`]:C,[`${y}-dashed`]:!!v,[`${y}-plain`]:!!h,[`${y}-rtl`]:"rtl"===n,[`${y}-no-default-orientation-margin-left`]:j,[`${y}-no-default-orientation-margin-right`]:E},m,p),N=o.useMemo((()=>"number"==typeof u?u:/^\d+$/.test(u)?Number(u):u),[u]),k=Object.assign(Object.assign({},j&&{marginLeft:N}),E&&{marginRight:N});return S(o.createElement("div",Object.assign({className:z,style:Object.assign(Object.assign({},null==a?void 0:a.style),x)},b,{role:"separator"}),g&&"vertical"!==s&&o.createElement("span",{className:`${y}-inner-text`,style:k},g)))}},41750:function(e,t,n){n.d(t,{Z:function(){return M}});var a=n(1565),r=n(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"},i=n(99194),l=function(e,t){return r.createElement(i.Z,(0,a.Z)({},e,{ref:t,icon:o}))};var s=r.forwardRef(l),c=n(92310),u=n.n(c),d=n(22386),f=n(88703),m=n(52167),p=n(290),g=n(81331),v=n(90339);function h(e,t){var n=e.disabled,a=e.prefixCls,o=e.character,i=e.characterRender,l=e.index,s=e.count,c=e.value,d=e.allowHalf,f=e.focused,m=e.onHover,p=e.onClick,v=l+1,h=new Set([a]);0===c&&0===l&&f?h.add("".concat(a,"-focused")):d&&c+.5>=v&&c<v?(h.add("".concat(a,"-half")),h.add("".concat(a,"-active")),f&&h.add("".concat(a,"-focused"))):(v<=c?h.add("".concat(a,"-full")):h.add("".concat(a,"-zero")),v===c&&f&&h.add("".concat(a,"-focused")));var x="function"==typeof o?o(e):o,b=r.createElement("li",{className:u()(Array.from(h)),ref:t},r.createElement("div",{onClick:n?null:function(e){p(e,l)},onKeyDown:n?null:function(e){e.keyCode===g.Z.ENTER&&p(e,l)},onMouseMove:n?null:function(e){m(e,l)},role:"radio","aria-checked":c>l?"true":"false","aria-posinset":l+1,"aria-setsize":s,tabIndex:n?-1:0},r.createElement("div",{className:"".concat(a,"-first")},x),r.createElement("div",{className:"".concat(a,"-second")},x)));return i&&(b=i(b,e)),b}var x=r.forwardRef(h);var b=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function y(e,t){var n,o,i=e.prefixCls,l=void 0===i?"rc-rate":i,s=e.className,c=e.defaultValue,h=e.value,y=e.count,S=void 0===y?5:y,w=e.allowHalf,$=void 0!==w&&w,C=e.allowClear,j=void 0===C||C,E=e.character,z=void 0===E?"★":E,N=e.characterRender,k=e.disabled,O=e.direction,Z=void 0===O?"ltr":O,H=e.tabIndex,M=void 0===H?0:H,T=e.autoFocus,I=e.onHoverChange,_=e.onChange,D=e.onFocus,R=e.onBlur,B=e.onKeyDown,L=e.onMouseLeave,F=(0,m.Z)(e,b),P=(o=r.useRef({}),[function(e){return o.current[e]},function(e){return function(t){o.current[e]=t}}]),W=(0,f.Z)(P,2),Y=W[0],A=W[1],G=r.useRef(null),X=function(){var e;k||(null===(e=G.current)||void 0===e||e.focus())};r.useImperativeHandle(t,(function(){return{focus:X,blur:function(){var e;k||(null===(e=G.current)||void 0===e||e.blur())}}}));var K=(0,p.Z)(c||0,{value:h}),V=(0,f.Z)(K,2),q=V[0],Q=V[1],J=(0,p.Z)(null),U=(0,f.Z)(J,2),ee=U[0],te=U[1],ne=function(e,t){var n,a,r,o,i="rtl"===Z,l=e+1;if($){var s=Y(e),c=(a=function(e){var t,n,a=e.ownerDocument,r=a.body,o=a&&a.documentElement,i=e.getBoundingClientRect();return t=i.left,n=i.top,{left:t-=o.clientLeft||r.clientLeft||0,top:n-=o.clientTop||r.clientTop||0}}(n=s),r=n.ownerDocument,o=r.defaultView||r.parentWindow,a.left+=function(e){var t=e.pageXOffset,n="scrollLeft";if("number"!=typeof t){var a=e.document;"number"!=typeof(t=a.documentElement[n])&&(t=a.body[n])}return t}(o),a.left),u=s.clientWidth;(i&&t-c>u/2||!i&&t-c<u/2)&&(l-=.5)}return l},ae=function(e){Q(e),null==_||_(e)},re=r.useState(!1),oe=(0,f.Z)(re,2),ie=oe[0],le=oe[1],se=r.useState(null),ce=(0,f.Z)(se,2),ue=ce[0],de=ce[1],fe=function(e,t){var n=ne(t,e.pageX);n!==ee&&(de(n),te(null)),null==I||I(n)},me=function(e){k||(de(null),te(null),null==I||I(void 0)),e&&(null==L||L(e))},pe=function(e,t){var n=ne(t,e.pageX),a=!1;j&&(a=n===q),me(),ae(a?0:n),te(a?n:null)};r.useEffect((function(){T&&!k&&X()}),[]);var ge=new Array(S).fill(0).map((function(e,t){return r.createElement(x,{ref:A(t),index:t,count:S,disabled:k,prefixCls:"".concat(l,"-star"),allowHalf:$,value:null===ue?q:ue,onClick:pe,onHover:fe,key:e||t,character:z,characterRender:N,focused:ie})})),ve=u()(l,s,(n={},(0,d.Z)(n,"".concat(l,"-disabled"),k),(0,d.Z)(n,"".concat(l,"-rtl"),"rtl"===Z),n));return r.createElement("ul",(0,a.Z)({className:ve,onMouseLeave:me,tabIndex:k?-1:M,onFocus:k?null:function(){le(!0),null==D||D()},onBlur:k?null:function(){le(!1),null==R||R()},onKeyDown:k?null:function(e){var t=e.keyCode,n="rtl"===Z,a=q;t===g.Z.RIGHT&&a<S&&!n?(ae(a+=$?.5:1),e.preventDefault()):t===g.Z.LEFT&&a>0&&!n||t===g.Z.RIGHT&&a>0&&n?(ae(a-=$?.5:1),e.preventDefault()):t===g.Z.LEFT&&a<S&&n&&(ae(a+=$?.5:1),e.preventDefault()),null==B||B(e)},ref:G,role:"radiogroup"},(0,v.Z)(F,{aria:!0,data:!0,attr:!0})),ge)}var S=r.forwardRef(y),w=n(36355),$=n(6848),C=n(17313),j=n(83116),E=n(37613);const z=e=>{const{componentCls:t}=e;return{[`${t}-star`]:{position:"relative",display:"inline-block",color:"inherit",cursor:"pointer","&:not(:last-child)":{marginInlineEnd:e.marginXS},"> div":{transition:`all ${e.motionDurationMid}, outline 0s`,"&:hover":{transform:e.starHoverScale},"&:focus":{outline:0},"&:focus-visible":{outline:`${e.lineWidth}px dashed ${e.starColor}`,transform:e.starHoverScale}},"&-first, &-second":{color:e.starBg,transition:`all ${e.motionDurationMid}`,userSelect:"none",[e.iconCls]:{verticalAlign:"middle"}},"&-first":{position:"absolute",top:0,insetInlineStart:0,width:"50%",height:"100%",overflow:"hidden",opacity:0},[`&-half ${t}-star-first, &-half ${t}-star-second`]:{opacity:1},[`&-half ${t}-star-first, &-full ${t}-star-second`]:{color:"inherit"}}}},N=e=>({[`&-rtl${e.componentCls}`]:{direction:"rtl"}}),k=e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,C.Wf)(e)),{display:"inline-block",margin:0,padding:0,color:e.starColor,fontSize:e.starSize,lineHeight:"unset",listStyle:"none",outline:"none",[`&-disabled${t} ${t}-star`]:{cursor:"default","> div:hover":{transform:"scale(1)"}}}),z(e)),{[`+ ${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,fontSize:e.fontSize}}),N(e))}};var O=(0,j.Z)("Rate",(e=>{const t=(0,E.TS)(e,{});return[k(t)]}),(e=>({starColor:e.yellow6,starSize:.5*e.controlHeightLG,starHoverScale:"scale(1.1)",starBg:e.colorFillContent}))),Z=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};const H=r.forwardRef(((e,t)=>{const{prefixCls:n,className:a,rootClassName:o,style:i,tooltips:l,character:c=r.createElement(s,null)}=e,d=Z(e,["prefixCls","className","rootClassName","style","tooltips","character"]),{getPrefixCls:f,direction:m,rate:p}=r.useContext(w.E_),g=f("rate",n),[v,h]=O(g),x=Object.assign(Object.assign({},null==p?void 0:p.style),i);return v(r.createElement(S,Object.assign({ref:t,character:c,characterRender:(e,t)=>{let{index:n}=t;return l?r.createElement($.Z,{title:l[n]},e):e}},d,{className:u()(a,o,h,null==p?void 0:p.className),style:x,prefixCls:g,direction:m})))}));var M=H},31797:function(e,t,n){n.d(t,{Z:function(){return S}});var a=n(59301),r=n(56762),o=n(92343),i=n(92310),l=n.n(i),s=n(36355),c=n(87876);var u=e=>{const{value:t,formatter:n,precision:r,decimalSeparator:o,groupSeparator:i="",prefixCls:l}=e;let s;if("function"==typeof n)s=n(t);else{const e=String(t),n=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(n&&"-"!==e){const e=n[1];let t=n[2]||"0",c=n[4]||"";t=t.replace(/\B(?=(\d{3})+(?!\d))/g,i),"number"==typeof r&&(c=c.padEnd(r,"0").slice(0,r>0?r:0)),c&&(c=`${o}${c}`),s=[a.createElement("span",{key:"int",className:`${l}-content-value-int`},e,t),c&&a.createElement("span",{key:"decimal",className:`${l}-content-value-decimal`},c)]}else s=e}return a.createElement("span",{className:`${l}-content-value`},s)},d=n(17313),f=n(83116),m=n(37613);const p=e=>{const{componentCls:t,marginXXS:n,padding:a,colorTextDescription:r,titleFontSize:o,colorTextHeading:i,contentFontSize:l,fontFamily:s}=e;return{[`${t}`]:Object.assign(Object.assign({},(0,d.Wf)(e)),{[`${t}-title`]:{marginBottom:n,color:r,fontSize:o},[`${t}-skeleton`]:{paddingTop:a},[`${t}-content`]:{color:i,fontSize:l,fontFamily:s,[`${t}-content-value`]:{display:"inline-block",direction:"ltr"},[`${t}-content-prefix, ${t}-content-suffix`]:{display:"inline-block"},[`${t}-content-prefix`]:{marginInlineEnd:n},[`${t}-content-suffix`]:{marginInlineStart:n}}})}};var g=(0,f.Z)("Statistic",(e=>{const t=(0,m.TS)(e,{});return[p(t)]}),(e=>{const{fontSizeHeading3:t,fontSize:n}=e;return{titleFontSize:n,contentFontSize:t}}));var v=e=>{const{prefixCls:t,className:n,rootClassName:r,style:o,valueStyle:i,value:d=0,title:f,valueRender:m,prefix:p,suffix:v,loading:h=!1,onMouseEnter:x,onMouseLeave:b,decimalSeparator:y=".",groupSeparator:S=","}=e,{getPrefixCls:w,direction:$,statistic:C}=a.useContext(s.E_),j=w("statistic",t),[E,z]=g(j),N=a.createElement(u,Object.assign({decimalSeparator:y,groupSeparator:S,prefixCls:j},e,{value:d})),k=l()(j,{[`${j}-rtl`]:"rtl"===$},null==C?void 0:C.className,n,r,z);return E(a.createElement("div",{className:k,style:Object.assign(Object.assign({},null==C?void 0:C.style),o),onMouseEnter:x,onMouseLeave:b},f&&a.createElement("div",{className:`${j}-title`},f),a.createElement(c.Z,{paragraph:!1,loading:h,className:`${j}-skeleton`},a.createElement("div",{style:i,className:`${j}-content`},p&&a.createElement("span",{className:`${j}-content-prefix`},p),m?m(N):N,v&&a.createElement("span",{className:`${j}-content-suffix`},v)))))};const h=[["Y",31536e6],["M",2592e6],["D",864e5],["H",36e5],["m",6e4],["s",1e3],["S",1]];function x(e,t){const{format:n=""}=t,a=new Date(e).getTime(),r=Date.now();return function(e,t){let n=e;const a=/\[[^\]]*]/g,r=(t.match(a)||[]).map((e=>e.slice(1,-1))),o=t.replace(a,"[]"),i=h.reduce(((e,t)=>{let[a,r]=t;if(e.includes(a)){const t=Math.floor(n/r);return n-=t*r,e.replace(new RegExp(`${a}+`,"g"),(e=>{const n=e.length;return t.toString().padStart(n,"0")}))}return e}),o);let l=0;return i.replace(a,(()=>{const e=r[l];return l+=1,e}))}(Math.max(a-r,0),n)}const b=e=>{const{value:t,format:n="HH:mm:ss",onChange:i,onFinish:l}=e,s=(0,r.Z)(),c=a.useRef(null),u=()=>{const e=function(e){return new Date(e).getTime()}(t);e>=Date.now()&&(c.current=setInterval((()=>{s(),null==i||i(e-Date.now()),e<Date.now()&&(null==l||l(),c.current&&(clearInterval(c.current),c.current=null))}),33.333333333333336))};a.useEffect((()=>(u(),()=>{c.current&&(clearInterval(c.current),c.current=null)})),[t]);return a.createElement(v,Object.assign({},e,{valueRender:e=>(0,o.Tm)(e,{title:void 0}),formatter:(e,t)=>x(e,Object.assign(Object.assign({},t),{format:n}))}))};var y=a.memo(b);v.Countdown=y;var S=v}}]); |