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.
NewEduCoderBuild/p__Shixuns__Edit__body__Lev...

2 lines
12 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[190],{"3TLj":function(x,E,r){x.exports={flex_box_center:"flex_box_center____TbjK",flex_space_between:"flex_space_between___2coRZ",flex_box_vertical_center:"flex_box_vertical_center___3NVFE",flex_box_center_end:"flex_box_center_end___3GKhy",flex_box_column:"flex_box_column___2SLfn",bg:"bg___3oKWe",formWrap:"formWrap___2Y1wq"}},"5v/u":function(x,E,r){"use strict";r.r(E);var Y=r("5NDa"),Z=r("5rEg"),A=r("2qtc"),v=r("kLXV"),T=r("9og8"),U=r("k1fw"),W=r("y8nQ"),C=r("Vl3Y"),j=r("tJVT"),z=r("PpiC"),Et=r("Znn+"),y=r("ZTPi"),R=r("q1tI"),c=r.n(R),N=r("9kvl"),lt=r("Ot1p"),et=r("HBuW"),ut=r("3TLj"),w=r.n(ut),ct=r("UqFu"),at=r("9ZNV"),mt=r("nuEh");function V(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */V=function(){return s};var u,s={},O=Object.prototype,b=O.hasOwnProperty,f=Object.defineProperty||function(e,t,a){e[t]=a.value},B=typeof Symbol=="function"?Symbol:{},g=B.iterator||"@@iterator",pt=B.asyncIterator||"@@asyncIterator",H=B.toStringTag||"@@toStringTag";function p(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(e){p=function(a,n,i){return a[n]=i}}function k(e,t,a,n){var i=t&&t.prototype instanceof it?t:it,o=Object.create(i.prototype),_=new l(n||[]);return f(o,"_invoke",{value:ht(e,a,_)}),o}function X(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(n){return{type:"throw",arg:n}}}s.wrap=k;var q="suspendedStart",rt="suspendedYield",ot="executing",F="completed",h={};function it(){}function $(){}function D(){}var tt={};p(tt,g,function(){return this});var G=Object.getPrototypeOf,Q=G&&G(G(P([])));Q&&Q!==O&&b.call(Q,g)&&(tt=Q);var L=D.prototype=it.prototype=Object.create(tt);function st(e){["next","throw","return"].forEach(function(t){p(e,t,function(a){return this._invoke(t,a)})})}function J(e,t){function a(i,o,_,m){var d=X(e[i],e,o);if(d.type!=="throw"){var K=d.arg,I=K.value;return I&&typeof I=="object"&&b.call(I,"__await")?t.resolve(I.__await).then(function(S){a("next",S,_,m)},function(S){a("throw",S,_,m)}):t.resolve(I).then(function(S){K.value=S,_(K)},function(S){return a("throw",S,_,m)})}m(d.arg)}var n;f(this,"_invoke",{value:function(o,_){function m(){return new t(function(d,K){a(o,_,d,K)})}return n=n?n.then(m,m):m()}})}function ht(e,t,a){var n=q;return function(i,o){if(n===ot)throw new Error("Generator is already running");if(n===F){if(i==="throw")throw o;return{value:u,done:!0}}for(a.method=i,a.arg=o;;){var _=a.delegate;if(_){var m=_t(_,a);if(m){if(m===h)continue;return m}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(n===q)throw n=F,a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);n=ot;var d=X(e,t,a);if(d.type==="normal"){if(n=a.done?F:rt,d.arg===h)continue;return{value:d.arg,done:a.done}}d.type==="throw"&&(n=F,a.method="throw",a.arg=d.arg)}}}function _t(e,t){var a=t.method,n=e.iterator[a];if(n===u)return t.delegate=null,a==="throw"&&e.iterator.return&&(t.method="return",t.arg=u,_t(e,t),t.method==="throw")||a!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+a+"' method")),h;var i=X(n,e.iterator,t.arg);if(i.type==="throw")return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=u),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function ft(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function l(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(ft,this),this.reset(!0)}function P(e){if(e||e===""){var t=e[g];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var a=-1,n=function i(){for(;++a<e.length;)if(b.call(e,a))return i.value=e[a],i.done=!1,i;return i.value=u,i.done=!0,i};return n.next=n}}throw new TypeError(typeof e+" is not iterable")}return $.prototype=D,f(L,"constructor",{value:D,configurable:!0}),f(D,"constructor",{value:$,configurable:!0}),$.displayName=p(D,H,"GeneratorFunction"),s.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return!!t&&(t===$||(t.displayName||t.name)==="GeneratorFunction")},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,D):(e.__proto__=D,p(e,H,"GeneratorFunction")),e.prototype=Object.create(L),e},s.awrap=function(e){return{__await:e}},st(J.prototype),p(J.prototype,pt,function(){return this}),s.AsyncIterator=J,s.async=function(e,t,a,n,i){i===void 0&&(i=Promise);var o=new J(k(e,t,a,n),i);return s.isGeneratorFunction(t)?o:o.next().then(function(_){return _.done?_.value:o.next()})},st(L),p(L,H,"Generator"),p(L,g,function(){return this}),p(L,"toString",function(){return"[object Generator]"}),s.keys=function(e){var t=Object(e),a=[];for(var n in t)a.push(n);return a.reverse(),function i(){for(;a.length;){var o=a.pop();if(o in t)return i.value=o,i.done=!1,i}return i.done=!0,i}},s.values=P,l.prototype={constructor:l,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(M),!t)for(var a in this)a.charAt(0)==="t"&&b.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var a=this;function n(K,I){return _.type="throw",_.arg=t,a.next=K,I&&(a.method="next",a.arg=u),!!I}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],_=o.completion;if(o.tryLoc==="root")return n("end");if(o.tryLoc<=this.prev){var m=b.call(o,"catchLoc"),d=b.call(o,"finallyLoc");if(m&&d){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(m){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,a){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&b.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&(t==="break"||t==="continue")&&o.tryLoc<=a&&a<=o.finallyLoc&&(o=null);var _=o?o.completion:{};return _.type=t,_.arg=a,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(_)},complete:function(t,a){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&a&&(this.next=a),h},finish:function(t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),h}},catch:function(t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc===t){var i=n.completion;if(i.type==="throw"){var o=i.arg;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,a,n){return this.delegate={iterator:P(t),resultName:a,nextLoc:n},this.method==="next"&&(this.arg=u),h}},s}var dt=y.a.TabPane,nt=function(s){var O,b=s.shixunsDetail,f=s.dispatch,B=s.match,g=s.practiceSetting,pt=Object(z.a)(s,["shixunsDetail","dispatch","match","practiceSetting"]),H=C.a.useForm(),p=Object(j.a)(H,1),k=p[0],X=Object(R.useState)({}),q=Object(j.a)(X,2),rt=q[0],ot=q[1],F=b.challengesNew,h=Object(R.useRef)(null),it=g.selectQuestionParams,$=g.id,D=g.newQuestion,tt=Object(R.useState)(!0),G=Object(j.a)(tt,2),Q=G[0],L=G[1];Object(R.useEffect)(function(){L(!0),f({type:"shixunsDetail/getChallengesNew",payload:Object(U.a)({},B.params)}),L(!1)},[B.params]);var st=function(){var M=Object(T.a)(V().mark(function l(P){var e,t;return V().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e=Object(U.a)({},rt),e.identifier=B.params.id,e.st=1,n.next=5,Object(et.b)(Object(U.a)({},e));case 5:t=n.sent,t.status===1&&(N.c.replace("/shixuns/".concat(B.params.id,"/edit/").concat(t.challenge_id,"/editquestion?tab=2")),setTimeout(function(){f({type:"practiceSetting/setParams",payload:{newQuestion:null}}),f({type:"practiceSetting/setUpdateIndex"})},200));case 7:case"end":return n.stop()}},l)}));return function(P){return M.apply(this,arguments)}}(),J=function(){ft()},ht=function(l){clearTimeout(h.current),h.current=setTimeout(function(){"subject"in l&&D&&f({type:"practiceSetting/setParams",payload:{newQuestion:{st:1,name:l==null?void 0:l.subject}}});var P=k.getFieldsValue(),e=P.subject,t=P.task_pass;e!==""||t!==Object(ct.a)(F.task_pass_default)?f({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):f({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},500)},_t=function(l){ot(Object(U.a)({},k.getFieldsValue())),ht(l)},ft=function(){var l,P=function(){N.c.push("/shixuns/".concat($,"/challenges")),f({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};(g==null||((l=g.sideBar)===null||l===void 0)?void 0:l.confirmLeave)?v.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){P()}}):P()};return c.a.createElement("section",{className:w.a.bg},c.a.createElement(y.a,{activeKey:"1"},c.a.createElement(dt,{tab:"\u672C\u5173\u4EFB\u52A1",key:"1"},c.a.createElement(C.a,{form:k,className:w.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:_t,onFinish:st},c.a.createElement("div",{className:w.a.fieldWrap},c.a.createElement(C.a.Item,{initialValue:"",name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},c.a.createElement(Z.a,{bordered:!1,maxLength:60,suffix:"".concat(((O=rt.subject)===null||O===void 0?void 0:O.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),c.a.createElement("div",{className:w.a.mdWrap},c.a.createElement(C.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u6700\u5927\u9650\u523635000\u4E2A\u5B57\u7B26"}]},c.a.createElement(lt.a,{watch:!0,defaultValue:F.task_pass_default}))),c.a.createElement(C.a.Item,{noStyle:!0},c.a.createElement(at.a,{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:J}))))),c.a.createElement(mt.a,{loading:Q}))};E.default=Object(N.a)(function(u){var s=u.shixunsDetail,O=u.practiceSetting;return{shixunsDetail:s,practiceSetting:O}})(nt)},"9ZNV":function(x,E,r){"use strict";r.d(E,"a",function(){return z});var Y=r("0Owb"),Z=r("+L6B"),A=r("2/Rp"),v=r("q1tI"),T=r.n(v),U=r("UUDw"),W=r.n(U),C=r("TSYQ"),j=r.n(C),z=function(y){var R=y.cancelText,c=R===void 0?"\u53D6\u6D88":R,N=y.okText,lt=N===void 0?"\u786E\u5B9A":N,et=y.loading,ut=et===void 0?!1:et,w=y.hasOkBtn,ct=w===void 0?!0:w,at=y.okButtonProps,mt=at===void 0?{}:at,V=y.onCancel,dt=V===void 0?function(){}:V,nt=y.onOk,u=nt===void 0?function(){}:nt,s=y.className,O=s===void 0?"":s;return T.a.createElement("div",{className:j()(W.a.buttonFixed,O)},T.a.createElement("div",{className:W.a.buttonWrap},T.a.createElement(A.a,{size:"large",className:"".concat(W.a.button," mr20"),onClick:dt},c),ct&&T.a.createElement(A.a,Object(Y.a)({size:"large",type:"primary",className:"".concat(W.a.button," mr20"),loading:ut,onClick:u},mt),lt)))}},F8wB:function(x,E,r){x.exports={loading:"loading___1SIOG"}},UUDw:function(x,E,r){x.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(x,E,r){"use strict";r.d(E,"a",function(){return Y});var Y=function(A){var v=document.createElement("textarea");return v.value=A,v.value}},nuEh:function(x,E,r){"use strict";var Y=r("T2oS"),Z=r("W9HT"),A=r("q1tI"),v=r.n(A),T=r("F8wB"),U=r.n(T),W=function(j){var z=j.loading;return z?v.a.createElement("div",{className:U.a.loading},v.a.createElement(Z.a,null)):v.a.createElement(v.a.Fragment,null)};E.a=W}}]);