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.
2 lines
17 KiB
2 lines
17 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[198],{"4NWD":function(w,F,i){w.exports=i.p+"static/Certificate.80413b23.png"},Lmeb:function(w,F,i){},Oe6r:function(w,F,i){"use strict";i.r(F);var Se=i("+L6B"),ce=i("2/Rp"),Ae=i("DjyN"),se=i("NUBc"),Te=i("g9YV"),oe=i("wCAj"),We=i("2qtc"),ie=i("kLXV"),_e=i("9og8"),I=i("tJVT"),de=i("PpiC"),Fe=i("OaEy"),me=i("2fM7"),Ke=i("aHsQ"),fe=i("sGsY"),R=i("q1tI"),r=i.n(R),pe=i("Ty5D"),Ee=i("9kvl"),he=i("Lmeb"),ke=i.n(he),ve=i("1n7x"),ge=i.n(ve),ye=i("1vsH"),Pe=i("2BaD"),ue=i("ErOA"),Oe=i("sWZa"),K=i.n(Oe),Re=i("4NWD"),Ue=i.n(Re),De=i("xRCK"),Le=i.n(De),xe=i("wd/R"),H=i.n(xe);function S(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */S=function(){return v};var v={},U=Object.prototype,D=U.hasOwnProperty,k=typeof Symbol=="function"?Symbol:{},A=k.iterator||"@@iterator",N=k.asyncIterator||"@@asyncIterator",q=k.toStringTag||"@@toStringTag";function y(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{y({},"")}catch(t){y=function(n,a,o){return n[a]=o}}function ee(t,e,n,a){var o=e&&e.prototype instanceof z?e:z,l=Object.create(o.prototype),d=new ae(a||[]);return l._invoke=function(g,O,u){var E="suspendedStart";return function(P,s){if(E==="executing")throw new Error("Generator is already running");if(E==="completed"){if(P==="throw")throw s;return X()}for(u.method=P,u.arg=s;;){var re=u.delegate;if(re){var $=te(re,u);if($){if($===p)continue;return $}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(E==="suspendedStart")throw E="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);E="executing";var T=G(g,O,u);if(T.type==="normal"){if(E=u.done?"completed":"suspendedYield",T.arg===p)continue;return{value:T.arg,done:u.done}}T.type==="throw"&&(E="completed",u.method="throw",u.arg=T.arg)}}}(t,n,d),l}function G(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(a){return{type:"throw",arg:a}}}v.wrap=ee;var p={};function z(){}function Y(){}function L(){}var c={};y(c,A,function(){return this});var V=Object.getPrototypeOf,J=V&&V(V(Z([])));J&&J!==U&&D.call(J,A)&&(c=J);var b=L.prototype=z.prototype=Object.create(c);function C(t){["next","throw","return"].forEach(function(e){y(t,e,function(n){return this._invoke(e,n)})})}function M(t,e){function n(o,l,d,g){var O=G(t[o],t,l);if(O.type!=="throw"){var u=O.arg,E=u.value;return E&&typeof E=="object"&&D.call(E,"__await")?e.resolve(E.__await).then(function(P){n("next",P,d,g)},function(P){n("throw",P,d,g)}):e.resolve(E).then(function(P){u.value=P,d(u)},function(P){return n("throw",P,d,g)})}g(O.arg)}var a;this._invoke=function(o,l){function d(){return new e(function(g,O){n(o,l,g,O)})}return a=a?a.then(d,d):d()}}function te(t,e){var n=t.iterator[e.method];if(n===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,te(t,e),e.method==="throw"))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var a=G(n,t.iterator,e.arg);if(a.type==="throw")return e.method="throw",e.arg=a.arg,e.delegate=null,p;var o=a.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function ne(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function ae(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(ne,this),this.reset(!0)}function Z(t){if(t){var e=t[A];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var n=-1,a=function o(){for(;++n<t.length;)if(D.call(t,n))return o.value=t[n],o.done=!1,o;return o.value=void 0,o.done=!0,o};return a.next=a}}return{next:X}}function X(){return{value:void 0,done:!0}}return Y.prototype=L,y(b,"constructor",L),y(L,"constructor",Y),Y.displayName=y(L,q,"GeneratorFunction"),v.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===Y||(e.displayName||e.name)==="GeneratorFunction")},v.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,L):(t.__proto__=L,y(t,q,"GeneratorFunction")),t.prototype=Object.create(b),t},v.awrap=function(t){return{__await:t}},C(M.prototype),y(M.prototype,N,function(){return this}),v.AsyncIterator=M,v.async=function(t,e,n,a,o){o===void 0&&(o=Promise);var l=new M(ee(t,e,n,a),o);return v.isGeneratorFunction(e)?l:l.next().then(function(d){return d.done?d.value:l.next()})},C(b),y(b,q,"Generator"),y(b,A,function(){return this}),y(b,"toString",function(){return"[object Generator]"}),v.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function a(){for(;e.length;){var o=e.pop();if(o in t)return a.value=o,a.done=!1,a}return a.done=!0,a}},v.values=Z,ae.prototype={constructor:ae,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(B),!e)for(var n in this)n.charAt(0)==="t"&&D.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(u,E){return d.type="throw",d.arg=e,n.next=u,E&&(n.method="next",n.arg=void 0),!!E}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],d=l.completion;if(l.tryLoc==="root")return a("end");if(l.tryLoc<=this.prev){var g=D.call(l,"catchLoc"),O=D.call(l,"finallyLoc");if(g&&O){if(this.prev<l.catchLoc)return a(l.catchLoc,!0);if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else if(g){if(this.prev<l.catchLoc)return a(l.catchLoc,!0)}else{if(!O)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return a(l.finallyLoc)}}}},abrupt:function(e,n){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&D.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&(e==="break"||e==="continue")&&l.tryLoc<=n&&n<=l.finallyLoc&&(l=null);var d=l?l.completion:{};return d.type=e,d.arg=n,l?(this.method="next",this.next=l.finallyLoc,p):this.complete(d)},complete:function(e,n){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&n&&(this.next=n),p},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),B(a),p}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc===e){var o=a.completion;if(o.type==="throw"){var l=o.arg;B(a)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,a){return this.delegate={iterator:Z(e),resultName:n,nextLoc:a},this.method==="next"&&(this.arg=void 0),p}},v}var Ne=fe.a.Countdown,Ge=me.a.Option;H.a.locale("ZH-cn");var be=function(U){var D=U.classroomList,k=U.globalSetting,A=U.loading,N=U.user,q=U.dispatch,y=Object(de.a)(U,["classroomList","globalSetting","loading","user","dispatch"]),ee=Object(R.useState)("manage_certificates"),G=Object(I.a)(ee,2),p=G[0],z=G[1],Y=Object(R.useState)(),L=Object(I.a)(Y,2),c=L[0],V=L[1],J=Object(R.useState)(1),b=Object(I.a)(J,2),C=b[0],M=b[1],te=Object(R.useState)(15),ne=Object(I.a)(te,2),B=ne[0],ae=ne[1],Z=Object(R.useState)(!1),X=Object(I.a)(Z,2),t=X[0],e=X[1],n=Object(R.useState)([]),a=Object(I.a)(n,2),o=a[0],l=a[1],d=Object(R.useState)(!1),g=Object(I.a)(d,2),O=g[0],u=g[1],E=Object(R.useState)(),P=Object(I.a)(E,2),s=P[0],re=P[1],$=Object(R.useRef)(),T={"1":"January","2":"February","3":"March","4":"April","5":"May","6":"June","7":"July","8":"August","9":"September","10":"October","11":"November","12":"December"},ze=Object(pe.m)();Object(R.useEffect)(function(){Ce(p)},[p,C]);function Ce(f){return le.apply(this,arguments)}function le(){return le=Object(_e.a)(S().mark(function f(m){var _,h;return S().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,Object(ue.a)("/api/users/".concat(N==null||((_=N.userInfo)===null||_===void 0)?void 0:_.login,"/subjects/").concat(m,".json"),{method:"get",params:{page:C,limit:B}});case 2:h=x.sent,h&&V(h);case 4:case"end":return x.stop()}},f)})),le.apply(this,arguments)}var Me=function(){var f=Object(_e.a)(S().mark(function m(){var _,h,W;return S().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return document.body.scrollIntoView(),_={margin:[0,0,0,0],filename:"11.pdf",enableLinks:!1,html2canvas:{scale:5,allowTaint:!1,useCORS:!0},jsPDF:{format:[1412,1e3],orientation:"landscape",unit:"px"},image:{type:"jpeg",quality:1}},h=ge()().set(_).from($.current).toPdf(),j.next=5,h.get("pdf");case 5:return h=j.sent,j.next=8,h.output("bloburl");case 8:W=j.sent,Object(ye.r)("".concat(s.school_name,"-").concat(s.user_name,".pdf"),W);case 10:case"end":return j.stop()}},m)}));return function(){return f.apply(this,arguments)}}(),Be=[{title:"\u5E8F\u53F7",dataIndex:"name",align:"center",key:"name",ellipsis:!0,width:50,render:function(m,_,h){return r.a.createElement("span",null,h+1)}},{title:"\u8BFE\u7A0B\u540D\u79F0",dataIndex:"subject_name",align:"center",key:"subject_name"},{title:"\u7533\u8BF7\u4EBA",dataIndex:"user_name",align:"center",key:"user_name"},{title:"\u7533\u8BF7\u65F6\u95F4",dataIndex:"created_at",align:"center",key:"created_at"},{title:"\u8BC1\u4E66\u7F16\u53F7",dataIndex:"code",align:"center",key:"code"}],Ie=[{title:"\u5E8F\u53F7",dataIndex:"name",align:"center",key:"name",ellipsis:!0,width:50,render:function(m,_,h){return r.a.createElement("span",null,B*(C-1)+h+1)}},{title:"\u8BFE\u7A0B\u540D\u79F0",dataIndex:"name",align:"center",key:"name"},{title:"\u5F00\u8BFE\u4EBA",dataIndex:"subject_user_name",align:"center",key:"subject_user_name"},{title:"\u5B9E\u8BAD\u6570",dataIndex:"shixuns_count",align:"center",key:"shixuns_count"},{title:"\u7533\u8BF7\u4EBA\u6570",dataIndex:"certificates_count",align:"center",key:"certificates_count",render:function(m,_,h){return r.a.createElement("span",null,m||"--")}},{title:"\u7533\u8BF7\u65F6\u95F4",dataIndex:"created_at",align:"center",key:"created_at",ellipsis:!0,render:function(m,_,h){return r.a.createElement("span",null,m||"--")}},{title:"\u64CD\u4F5C",dataIndex:"remark",align:"center",key:"remark",ellipsis:!0,render:function(m,_,h){return r.a.createElement("span",{onClick:Object(_e.a)(S().mark(function W(){var x;return S().wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(ue.a)("/api/users/".concat(N.userInfo.login,"/subjects/certificate_users.json"),{method:"get",params:{page:1,limit:1e4,subject_id:_==null?void 0:_.id}});case 2:x=Q.sent,x&&(l(x),e(!0));case 4:case"end":return Q.stop()}},W)})),style:{cursor:"pointer",color:"#1890FF"}},"\u67E5\u770B\u7533\u8BF7\u4EBA")}}],je=function(m){ie.a.info({title:"\u62D2\u7EDD\u539F\u56E0",icon:null,className:"custom-modal-divider",centered:!0,width:400,content:r.a.createElement("div",null,m==null?void 0:m.content),okText:"\u786E\u5B9A"})},we=[{title:"\u5E8F\u53F7",dataIndex:"name",align:"center",key:"name",ellipsis:!0,width:50,render:function(m,_,h){return r.a.createElement("span",null,B*(C-1)+h+1)}},{title:"\u8BFE\u7A0B\u540D\u79F0",dataIndex:"subject_name",align:"center",key:"subject_name"},{title:"\u5F00\u8BFE\u4EBA",dataIndex:"subject_user_name",align:"center",key:"subject_user_name"},{title:"\u5B9E\u8BAD\u6570",dataIndex:"shixuns_count",align:"center",key:"shixuns_count"},{title:"\u7533\u8BF7\u65F6\u95F4",dataIndex:"created_at",align:"center",key:"created_at"},{title:"\u7533\u8BF7\u72B6\u6001",dataIndex:"state",key:"state",render:function(m,_){return r.a.createElement(r.a.Fragment,null,(_==null?void 0:_.state)==="drafted"&&r.a.createElement("span",null,"\u7533\u8BF7\u4E2D"),(_==null?void 0:_.state)==="rejected"&&r.a.createElement("span",{style:{color:"#E53333"}},"\u672A\u901A\u8FC7"),(_==null?void 0:_.state)==="passed"&&r.a.createElement("span",{style:{color:"#2FA34F"}},"\u901A\u8FC7"))}},{title:"\u64CD\u4F5C",dataIndex:"code",align:"center",key:"code",render:function(m,_,h){return r.a.createElement("div",{style:{display:"flex",justifyContent:"space-evenly"}},(_==null?void 0:_.state)==="passed"&&r.a.createElement("span",{style:{cursor:"pointer",color:"#1890FF"},onClick:function(){re(_),u(!0)}},"\u67E5\u770B\u8BC1\u4E66"),(_==null?void 0:_.state)==="drafted"&&r.a.createElement("span",{style:{cursor:"not-allowed",color:"#7F7F7F"}},"\u67E5\u770B"),(_==null?void 0:_.state)==="rejected"&&r.a.createElement("span",{onClick:function(){return je(_)},style:{cursor:"pointer",color:"#1890FF"}},"\u67E5\u770B\u62D2\u7EDD\u7406\u7531"))}}];return r.a.createElement("div",{className:"edu-container minH500",style:{width:"1200px",marginTop:"40px",marginBottom:"20px"}},r.a.createElement("div",{className:K.a.searchBar},r.a.createElement("li",{className:"".concat(K.a.firstLi," ").concat(p==="manage_certificates"&&K.a.active)},r.a.createElement("a",{onClick:function(){M(1),z("manage_certificates")}},"\u6211\u7BA1\u7406\u7684")),r.a.createElement("li",{className:"".concat(K.a.otherLi," ").concat(p==="my_certificates"&&K.a.active)},r.a.createElement("a",{onClick:function(){M(1),z("my_certificates")}},"\u6211\u83B7\u5F97\u7684"))),p==="manage_certificates"&&r.a.createElement("div",null,r.a.createElement(oe.a,{columns:Ie,dataSource:c==null?void 0:c.subjects,pagination:!1}),r.a.createElement("div",{style:{marginTop:"15px"}},"\u5171",c==null?void 0:c.total_count,"\u4E2A\u8BFE\u7A0B\u53EF\u7533\u8BF7\u8BC1\u4E66"),r.a.createElement(se.a,{hideOnSinglePage:!0,style:{textAlign:"center",marginTop:"10px"},pageSize:B,current:C,onChange:function(m,_){M(m)},total:c==null?void 0:c.total_count})),p==="my_certificates"&&r.a.createElement("div",null,r.a.createElement(oe.a,{columns:we,dataSource:c==null?void 0:c.certificates,pagination:!1}),r.a.createElement("div",{style:{marginTop:"15px"}},"\u5171",c==null?void 0:c.total_count,"\u4E2A\u8BFE\u7A0B\u53EF\u7533\u8BF7\u8BC1\u4E66"),r.a.createElement(se.a,{hideOnSinglePage:!0,style:{textAlign:"center",marginTop:"10px"},pageSize:B,current:C,onChange:function(m,_){M(m)},total:c==null?void 0:c.total_count})),r.a.createElement(ie.a,{title:"\u67E5\u770B\u7533\u8BF7\u4EBA",visible:t,width:800,footer:null,onCancel:function(){return e(!1)}},r.a.createElement(oe.a,{dataSource:o==null?void 0:o.certificates,pagination:!1,columns:Be})),r.a.createElement(ie.a,{visible:O,title:null,footer:r.a.createElement("div",null,r.a.createElement(ce.a,{type:"primary",onClick:Me},"\u4E0B\u8F7D\u8BC1\u4E66")),style:{background:"transparen",height:"740px"},centered:!0,width:1052,className:K.a.advertisementModal,maskClosable:!1,closeIcon:r.a.createElement(Pe.a,{onClick:function(){u(!1)},style:{fontSize:"25px",color:"#fff",marginLeft:"100px"}})},r.a.createElement("div",{ref:$},r.a.createElement("div",{style:{backgroundImage:"url(".concat(Ue.a,")"),height:"740px",width:"1052px",padding:"1px 100px"}},r.a.createElement("div",{style:{color:"#EB5E00",fontSize:"36px",marginTop:"239px",width:"100%",textAlign:"center"}},s==null?void 0:s.school_name," ",s==null?void 0:s.user_name),r.a.createElement("div",{style:{color:"#0D3580",fontSize:"24px",marginTop:"30px",width:"100%",textAlign:"center"}},"\u4E8E",H()(s==null?void 0:s.created_at).format("YYYY\u5E74MM\u6708DD\u65E5"),"\u5B8C\u6210\u4E86EduCoder\u5E73\u53F0\u300A",s==null?void 0:s.subject_name,"\u300B\u8BFE\u7A0B\u5B66\u4E60\u3002"),r.a.createElement("div",{style:{color:"#0D3580",fontSize:"30px",marginTop:"50px",width:"100%",textAlign:"center",fontWeight:"900"}},"\u7279\u6B64\u8BC1\u660E"),r.a.createElement("div",{style:{color:"#0D3580",fontSize:"14px",marginTop:"30px",width:"100%",textAlign:"center"}},"On ",T[H()(s==null?void 0:s.created_at).format("M")]," ",H()(s==null?void 0:s.created_at).format("DD"),"\uFF0C",H()(s==null?void 0:s.created_at).format("YYYY"),"\uFF0C completed the \u300A",s==null?void 0:s.subject_name_en,"\u300B course on EduCoder."),r.a.createElement("img",{src:Le.a,style:{position:"absolute",left:"820px",bottom:"130px"}}),r.a.createElement("div",{style:{color:"#0D3580",fontSize:"12px",width:"100%",display:"flex",paddingRight:"200px",position:"absolute",bottom:"150px"}},r.a.createElement("span",null,"\u8BC1\u4E66\u7F16\u53F7\uFF1A",s==null?void 0:s.code),r.a.createElement("span",{style:{marginLeft:"560px"}},"\u4E91\u8111\u5728\u7EBF\u7F16\u7A0B\u5B66\u9662"))))))};F.default=Object(Ee.a)(function(v){var U=v.classroomList,D=v.loading,k=v.globalSetting,A=v.user;return{classroomList:U,globalSetting:k,loading:D.models.classroomList,user:A}})(be)},sWZa:function(w,F,i){w.exports={flex_box_center:"flex_box_center___3DUz1",flex_space_between:"flex_space_between___2iqct",flex_box_vertical_center:"flex_box_vertical_center___1mD_h",flex_box_center_end:"flex_box_center_end___9Y2-v",flex_box_column:"flex_box_column___1p-jL",searchBar:"searchBar___2qgqU",active:"active___2wfij",searchBarBorder:"searchBarBorder___Iv594",firstLi:"firstLi___3Mj0_",otherLi:"otherLi___2pp1z",advertisementModal:"advertisementModal___3c8WX",closex:"closex___3dUBZ"}},xRCK:function(w,F,i){w.exports=i.p+"static/yz.688d901a.png"}}]);
|