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
13 KiB
2 lines
13 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{"0yVv":function(te,V,i){"use strict";i.r(V);var ve=i("miYZ"),re=i("tsqr"),G=i("k1fw"),Pe=i("+L6B"),ae=i("2/Rp"),ge=i("7Kak"),k=i("9yH6"),Oe=i("giR+"),ce=i("fyUT"),be=i("5NDa"),ne=i("5rEg"),De=i("6UJt"),de=i("DFOY"),Re=i("14J3"),me=i("BMrR"),Le=i("jCWc"),oe=i("kPKH"),xe=i("sPJy"),$=i("bE4q"),ie=i("9og8"),Me=i("y8nQ"),A=i("Vl3Y"),z=i("tJVT"),Ee=i("PpiC"),se=i("q1tI"),s=i.n(se),le=i("Ty5D"),H=i("9kvl"),_e=i("55Ip"),fe=i("Hkc5"),Q=i.n(fe),he=i("Uv5B"),ue=i("ErOA"),pe=i("1vsH");function N(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */N=function(){return _};var c,_={},M=Object.prototype,O=M.hasOwnProperty,C=Object.defineProperty||function(r,e,t){r[e]=t.value},T=typeof Symbol=="function"?Symbol:{},S=T.iterator||"@@iterator",Z=T.asyncIterator||"@@asyncIterator",U=T.toStringTag||"@@toStringTag";function g(r,e,t){return Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{g({},"")}catch(r){g=function(t,a,o){return t[a]=o}}function l(r,e,t,a){var o=e&&e.prototype instanceof F?e:F,n=Object.create(o.prototype),u=new q(a||[]);return C(n,"_invoke",{value:x(r,t,u)}),n}function J(r,e,t){try{return{type:"normal",arg:r.call(e,t)}}catch(a){return{type:"throw",arg:a}}}_.wrap=l;var j="suspendedStart",X="suspendedYield",Y="executing",b="completed",v={};function F(){}function D(){}function m(){}var f={};g(f,S,function(){return this});var L=Object.getPrototypeOf,P=L&&L(L(ee([])));P&&P!==M&&O.call(P,S)&&(f=P);var R=m.prototype=F.prototype=Object.create(f);function B(r){["next","throw","return"].forEach(function(e){g(r,e,function(t){return this._invoke(e,t)})})}function d(r,e){function t(o,n,u,E){var h=J(r[o],r,n);if(h.type!=="throw"){var w=h.arg,I=w.value;return I&&typeof I=="object"&&O.call(I,"__await")?e.resolve(I.__await).then(function(K){t("next",K,u,E)},function(K){t("throw",K,u,E)}):e.resolve(I).then(function(K){w.value=K,u(w)},function(K){return t("throw",K,u,E)})}E(h.arg)}var a;C(this,"_invoke",{value:function(n,u){function E(){return new e(function(h,w){t(n,u,h,w)})}return a=a?a.then(E,E):E()}})}function x(r,e,t){var a=j;return function(o,n){if(a===Y)throw new Error("Generator is already running");if(a===b){if(o==="throw")throw n;return{value:c,done:!0}}for(t.method=o,t.arg=n;;){var u=t.delegate;if(u){var E=W(u,t);if(E){if(E===v)continue;return E}}if(t.method==="next")t.sent=t._sent=t.arg;else if(t.method==="throw"){if(a===j)throw a=b,t.arg;t.dispatchException(t.arg)}else t.method==="return"&&t.abrupt("return",t.arg);a=Y;var h=J(r,e,t);if(h.type==="normal"){if(a=t.done?b:X,h.arg===v)continue;return{value:h.arg,done:t.done}}h.type==="throw"&&(a=b,t.method="throw",t.arg=h.arg)}}}function W(r,e){var t=e.method,a=r.iterator[t];if(a===c)return e.delegate=null,t==="throw"&&r.iterator.return&&(e.method="return",e.arg=c,W(r,e),e.method==="throw")||t!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+t+"' method")),v;var o=J(a,r.iterator,e.arg);if(o.type==="throw")return e.method="throw",e.arg=o.arg,e.delegate=null,v;var n=o.arg;return n?n.done?(e[r.resultName]=n.value,e.next=r.nextLoc,e.method!=="return"&&(e.method="next",e.arg=c),e.delegate=null,v):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function p(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function y(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function q(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(p,this),this.reset(!0)}function ee(r){if(r||r===""){var e=r[S];if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var t=-1,a=function o(){for(;++t<r.length;)if(O.call(r,t))return o.value=r[t],o.done=!1,o;return o.value=c,o.done=!0,o};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return D.prototype=m,C(R,"constructor",{value:m,configurable:!0}),C(m,"constructor",{value:D,configurable:!0}),D.displayName=g(m,U,"GeneratorFunction"),_.isGeneratorFunction=function(r){var e=typeof r=="function"&&r.constructor;return!!e&&(e===D||(e.displayName||e.name)==="GeneratorFunction")},_.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,m):(r.__proto__=m,g(r,U,"GeneratorFunction")),r.prototype=Object.create(R),r},_.awrap=function(r){return{__await:r}},B(d.prototype),g(d.prototype,Z,function(){return this}),_.AsyncIterator=d,_.async=function(r,e,t,a,o){o===void 0&&(o=Promise);var n=new d(l(r,e,t,a),o);return _.isGeneratorFunction(e)?n:n.next().then(function(u){return u.done?u.value:n.next()})},B(R),g(R,U,"Generator"),g(R,S,function(){return this}),g(R,"toString",function(){return"[object Generator]"}),_.keys=function(r){var e=Object(r),t=[];for(var a in e)t.push(a);return t.reverse(),function o(){for(;t.length;){var n=t.pop();if(n in e)return o.value=n,o.done=!1,o}return o.done=!0,o}},_.values=ee,q.prototype={constructor:q,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(y),!e)for(var t in this)t.charAt(0)==="t"&&O.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},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 t=this;function a(w,I){return u.type="throw",u.arg=e,t.next=w,I&&(t.method="next",t.arg=c),!!I}for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o],u=n.completion;if(n.tryLoc==="root")return a("end");if(n.tryLoc<=this.prev){var E=O.call(n,"catchLoc"),h=O.call(n,"finallyLoc");if(E&&h){if(this.prev<n.catchLoc)return a(n.catchLoc,!0);if(this.prev<n.finallyLoc)return a(n.finallyLoc)}else if(E){if(this.prev<n.catchLoc)return a(n.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return a(n.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&O.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}n&&(e==="break"||e==="continue")&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var u=n?n.completion:{};return u.type=e,u.arg=t,n?(this.method="next",this.next=n.finallyLoc,v):this.complete(u)},complete:function(e,t){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"&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),y(a),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var o=a.completion;if(o.type==="throw"){var n=o.arg;y(a)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:ee(e),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=c),v}},_}var ye=function(_){var M,O=_.classroomList,C=_.globalSetting,T=_.problemset,S=_.loading,Z=_.user,U=_.dispatch,g=Object(Ee.a)(_,["classroomList","globalSetting","problemset","loading","user","dispatch"]),l=Object(le.m)(),J=Object(le.l)(),j=Z.userInfo,X=A.a.useForm(),Y=Object(z.a)(X,1),b=Y[0];Object(se.useEffect)(function(){U({type:"problemset/getEditDisciplines",payload:{source:"question"}})},[]);function v(D){return F.apply(this,arguments)}function F(){return F=Object(ie.a)(N().mark(function D(m){var f,L,P,R,B,d,x,W;return N().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,b.validateFields();case 2:return f=b.getFieldValue(),L=f.courseid,P=Object(z.a)(L,2),R=P[0],B=P[1],f.sub_discipline_id=B,f.is_md=!0,y.next=9,U({type:"exercise/addExercise",payload:Object(G.a)(Object(G.a)({},f),l)});case 9:if(d=y.sent,!(d.status===0)){y.next=16;break}return y.next=13,Object(ue.a)("/api/courses/".concat(l==null?void 0:l.coursesId,"/exercises/notice_at.json"),{method:"POST",body:{course_id:l==null?void 0:l.coursesId,id:d==null||((x=d.data)===null||x===void 0)?void 0:x.exercise_id,time:m}});case 13:H.c.push("/classrooms/".concat(l.coursesId,"/exercise/").concat((W=d.data)===null||W===void 0?void 0:W.exercise_id,"/edit")),y.next=17;break;case 16:re.b.error(d.message);case 17:case"end":return y.stop()}},D)})),F.apply(this,arguments)}return s.a.createElement("section",{className:"edu-container"},s.a.createElement("section",{className:"animated fadeIn"},s.a.createElement("aside",{className:"mt10"},j&&s.a.createElement($.a,{separator:">"},s.a.createElement($.a.Item,null,s.a.createElement(_e.Link,{to:"/classrooms/".concat(l.coursesId,"/exercise")},j==null||((M=j.course)===null||M===void 0)?void 0:M.course_name)),s.a.createElement($.a.Item,null,s.a.createElement(_e.Link,{to:"/classrooms/".concat(l.coursesId,"/exercise")},"\u8BD5\u5377\u5217\u8868")),s.a.createElement($.a.Item,null,"\u65B0\u5EFA\u8BD5\u5377"))),s.a.createElement("aside",{className:[Q.a.title,"mt20"].join(" ")},s.a.createElement(me.a,{style:{width:"100%"}},s.a.createElement(oe.a,{flex:"1"},s.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u8BD5\u5377")),s.a.createElement(oe.a,null)))),s.a.createElement("section",{className:[Q.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},s.a.createElement(A.a,{layout:"vertical",form:b,className:Q.a.formWrap},s.a.createElement(A.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"courseid",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},s.a.createElement(de.a,{placeholder:"\u8BF7\u9009\u62E9...",options:T.courseOptions})),s.a.createElement(A.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},s.a.createElement(ne.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),s.a.createElement(A.a.Item,{name:"time",label:"\u8003\u8BD5\u65F6\u957F",style:{width:"300px"}},s.a.createElement("div",{style:{display:"flex"}},s.a.createElement(ce.a,{min:1,max:9999,maxLength:60,placeholder:"\u8BF7\u586B\u5199\u8003\u8BD5\u65F6\u957F"}),s.a.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"32px"}},"\u5206\u949F"))),s.a.createElement(A.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},s.a.createElement(k.a.Group,null,s.a.createElement(k.a.Button,{value:1},"\u7B80\u5355"),s.a.createElement(k.a.Button,{value:2},"\u9002\u4E2D"),s.a.createElement(k.a.Button,{value:3},"\u56F0\u96BE"))),s.a.createElement(A.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},s.a.createElement(ne.a.TextArea,{rows:6,maxLength:65535,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u523665535\u4E2A\u5B57\u7B26"})))),s.a.createElement("div",{className:["mt20","pb20","pt20"].join(" ")},s.a.createElement(ae.a,{style:{marginRight:"5px"},onClick:function(){H.c.push("/classrooms/".concat(l.coursesId,"/exercise"))}},"\u53D6\u6D88"),s.a.createElement(ae.a,{onClick:Object(ie.a)(N().mark(function D(){var m,f,L,P,R,B,d,x;return N().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,b.validateFields();case 2:return m=b.getFieldValue(),p.next=5,Object(ue.a)("/api/courses/".concat(l==null?void 0:l.coursesId,"/exercises/overload_alert.json"),{method:"get",params:{course_id:l==null?void 0:l.coursesId}});case 5:if(f=p.sent,!(f==null?void 0:f.alert)){p.next=10;break}U({type:"classroomList/setActionTabs",payload:{key:"\u9884\u7EA6\u5F39\u7A97"}}),p.next=18;break;case 10:return L=m.courseid,P=Object(z.a)(L,2),R=P[0],B=P[1],m.sub_discipline_id=B,m.is_md=!0,p.next=16,U({type:"exercise/addExercise",payload:Object(G.a)(Object(G.a)({},m),l)});case 16:d=p.sent,d.status===0?(Object(pe.R)(["\u6559\u5B66\u8BFE\u5802","\u8BD5\u5377","\u65B0\u5EFA\u8BD5\u5377"]),H.c.push("/classrooms/".concat(l.coursesId,"/exercise/").concat((x=d.data)===null||x===void 0?void 0:x.exercise_id,"/edit"))):re.b.error(d.message);case 18:case"end":return p.stop()}},D)})),type:"primary",style:{marginLeft:"5px"}},"\u786E\u5B9A")),s.a.createElement(he.a,{onModalOk:v}))};V.default=Object(H.a)(function(c){var _=c.classroomList,M=c.loading,O=c.user,C=c.problemset,T=c.globalSetting;return{classroomList:_,globalSetting:T,problemset:C,user:O,loading:M.effects}})(ye)},Hkc5:function(te,V,i){te.exports={flex_box_center:"flex_box_center___3KwMu",flex_space_between:"flex_space_between___1akH8",flex_box_vertical_center:"flex_box_vertical_center___7Jz-q",flex_box_center_end:"flex_box_center_end___3NYWv",flex_box_column:"flex_box_column___2ztEc",bg:"bg___1FDUF",title:"title___SV-0k",titleLeft:"titleLeft___2739d",titleRight:"titleRight___3sqsq",formWrap:"formWrap___1_b9c"}}}]);
|