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([[117],{"3TLj":function(D,y,o){D.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(D,y,o){"use strict";o.r(y);var X=o("5NDa"),B=o("5rEg"),R=o("2qtc"),g=o("kLXV"),L=o("9og8"),M=o("k1fw"),S=o("y8nQ"),U=o("Vl3Y"),I=o("tJVT"),Q=o("PpiC"),he=o("Znn+"),v=o("ZTPi"),C=o("q1tI"),c=o.n(C),F=o("9kvl"),ie=o("Ot1p"),q=o("HBuW"),ue=o("3TLj"),A=o.n(ue),le=o("UqFu"),ee=o("9ZNV"),_e=o("nuEh");function K(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */K=function(){return l};var l={},f=Object.prototype,m=f.hasOwnProperty,T=typeof Symbol=="function"?Symbol:{},h=T.iterator||"@@iterator",N=T.asyncIterator||"@@asyncIterator",b=T.toStringTag||"@@toStringTag";function E(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{E({},"")}catch(t){E=function(n,r,a){return n[r]=a}}function ne(t,e,n,r){var a=e&&e.prototype instanceof J?e:J,s=Object.create(a.prototype),u=new G(r||[]);return s._invoke=function(_,P,i){var d="suspendedStart";return function(x,me){if(d==="executing")throw new Error("Generator is already running");if(d==="completed"){if(x==="throw")throw me;return se()}for(i.method=x,i.arg=me;;){var pe=i.delegate;if(pe){var ce=re(pe,i);if(ce){if(ce===p)continue;return ce}}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(d==="suspendedStart")throw d="completed",i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);d="executing";var H=k(_,P,i);if(H.type==="normal"){if(d=i.done?"completed":"suspendedYield",H.arg===p)continue;return{value:H.arg,done:i.done}}H.type==="throw"&&(d="completed",i.method="throw",i.arg=H.arg)}}}(t,n,u),s}function k(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}l.wrap=ne;var p={};function J(){}function w(){}function O(){}var Y={};E(Y,h,function(){return this});var V=Object.getPrototypeOf,W=V&&V(V(z([])));W&&W!==f&&m.call(W,h)&&(Y=W);var j=O.prototype=J.prototype=Object.create(Y);function ae(t){["next","throw","return"].forEach(function(e){E(t,e,function(n){return this._invoke(e,n)})})}function $(t,e){function n(a,s,u,_){var P=k(t[a],t,s);if(P.type!=="throw"){var i=P.arg,d=i.value;return d&&typeof d=="object"&&m.call(d,"__await")?e.resolve(d.__await).then(function(x){n("next",x,u,_)},function(x){n("throw",x,u,_)}):e.resolve(d).then(function(x){i.value=x,u(i)},function(x){return n("throw",x,u,_)})}_(P.arg)}var r;this._invoke=function(a,s){function u(){return new e(function(_,P){n(a,s,_,P)})}return r=r?r.then(u,u):u()}}function re(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,re(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 r=k(n,t.iterator,e.arg);if(r.type==="throw")return e.method="throw",e.arg=r.arg,e.delegate=null,p;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function oe(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 Z(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(oe,this),this.reset(!0)}function z(t){if(t){var e=t[h];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var n=-1,r=function a(){for(;++n<t.length;)if(m.call(t,n))return a.value=t[n],a.done=!1,a;return a.value=void 0,a.done=!0,a};return r.next=r}}return{next:se}}function se(){return{value:void 0,done:!0}}return w.prototype=O,E(j,"constructor",O),E(O,"constructor",w),w.displayName=E(O,b,"GeneratorFunction"),l.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===w||(e.displayName||e.name)==="GeneratorFunction")},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,E(t,b,"GeneratorFunction")),t.prototype=Object.create(j),t},l.awrap=function(t){return{__await:t}},ae($.prototype),E($.prototype,N,function(){return this}),l.AsyncIterator=$,l.async=function(t,e,n,r,a){a===void 0&&(a=Promise);var s=new $(ne(t,e,n,r),a);return l.isGeneratorFunction(e)?s:s.next().then(function(u){return u.done?u.value:s.next()})},ae(j),E(j,b,"Generator"),E(j,h,function(){return this}),E(j,"toString",function(){return"[object Generator]"}),l.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var a=e.pop();if(a in t)return r.value=a,r.done=!1,r}return r.done=!0,r}},l.values=z,G.prototype={constructor:G,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(Z),!e)for(var n in this)n.charAt(0)==="t"&&m.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 r(i,d){return u.type="throw",u.arg=e,n.next=i,d&&(n.method="next",n.arg=void 0),!!d}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],u=s.completion;if(s.tryLoc==="root")return r("end");if(s.tryLoc<=this.prev){var _=m.call(s,"catchLoc"),P=m.call(s,"finallyLoc");if(_&&P){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(_){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!P)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&m.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var s=a;break}}s&&(e==="break"||e==="continue")&&s.tryLoc<=n&&n<=s.finallyLoc&&(s=null);var u=s?s.completion:{};return u.type=e,u.arg=n,s?(this.method="next",this.next=s.finallyLoc,p):this.complete(u)},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 r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),Z(r),p}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var a=r.completion;if(a.type==="throw"){var s=a.arg;Z(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:z(e),resultName:n,nextLoc:r},this.method==="next"&&(this.arg=void 0),p}},l}var de=v.a.TabPane,te=function(f){var m,T=f.shixunsDetail,h=f.dispatch,N=f.match,b=f.practiceSetting,E=Object(Q.a)(f,["shixunsDetail","dispatch","match","practiceSetting"]),ne=U.a.useForm(),k=Object(I.a)(ne,1),p=k[0],J=Object(C.useState)({}),w=Object(I.a)(J,2),O=w[0],Y=w[1],V=T.challengesNew,W=Object(C.useRef)(null),j=b.selectQuestionParams,ae=b.id,$=b.newQuestion,re=Object(C.useState)(!0),oe=Object(I.a)(re,2),Z=oe[0],G=oe[1];Object(C.useEffect)(function(){G(!0),h({type:"shixunsDetail/getChallengesNew",payload:Object(M.a)({},N.params)}),G(!1)},[N.params]);var z=function(){var r=Object(L.a)(K().mark(function a(s){var u,_;return K().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return u=Object(M.a)({},O),u.identifier=N.params.id,u.st=1,i.next=5,Object(q.b)(Object(M.a)({},u));case 5:_=i.sent,_.status===1&&(F.c.replace("/shixuns/".concat(N.params.id,"/edit/").concat(_.challenge_id,"/editquestion?tab=2")),setTimeout(function(){h({type:"practiceSetting/setParams",payload:{newQuestion:null}}),h({type:"practiceSetting/setUpdateIndex"})},200));case 7:case"end":return i.stop()}},a)}));return function(s){return r.apply(this,arguments)}}(),se=function(){n()},t=function(a){clearTimeout(W.current),W.current=setTimeout(function(){"subject"in a&&$&&h({type:"practiceSetting/setParams",payload:{newQuestion:{st:1,name:a==null?void 0:a.subject}}});var s=p.getFieldsValue(),u=s.subject,_=s.task_pass;u!==""||_!==Object(le.a)(V.task_pass_default)?h({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):h({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},500)},e=function(a){Y(Object(M.a)({},p.getFieldsValue())),t(a)},n=function(){var a,s=function(){F.c.push("/shixuns/".concat(ae,"/challenges")),h({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};(b==null||((a=b.sideBar)===null||a===void 0)?void 0:a.confirmLeave)?g.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(){s()}}):s()};return c.a.createElement("section",{className:A.a.bg},c.a.createElement(v.a,{activeKey:"1"},c.a.createElement(de,{tab:"\u672C\u5173\u4EFB\u52A1",key:"1"},c.a.createElement(U.a,{form:p,className:A.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:e,onFinish:z},c.a.createElement("div",{className:A.a.fieldWrap},c.a.createElement(U.a.Item,{initialValue:"",name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},c.a.createElement(B.a,{bordered:!1,maxLength:60,suffix:"".concat(((m=O.subject)===null||m===void 0?void 0:m.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),c.a.createElement("div",{className:A.a.mdWrap},c.a.createElement(U.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(ie.a,{watch:!0,defaultValue:V.task_pass_default}))),c.a.createElement(U.a.Item,{noStyle:!0},c.a.createElement(ee.a,{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:se}))))),c.a.createElement(_e.a,{loading:Z}))};y.default=Object(F.a)(function(l){var f=l.shixunsDetail,m=l.practiceSetting;return{shixunsDetail:f,practiceSetting:m}})(te)},"9ZNV":function(D,y,o){"use strict";o.d(y,"a",function(){return Q});var X=o("+L6B"),B=o("2/Rp"),R=o("0Owb"),g=o("q1tI"),L=o.n(g),M=o("UUDw"),S=o.n(M),U=o("TSYQ"),I=o.n(U),Q=function(v){var C=v.cancelText,c=C===void 0?"\u53D6\u6D88":C,F=v.okText,ie=F===void 0?"\u786E\u5B9A":F,q=v.loading,ue=q===void 0?!1:q,A=v.hasOkBtn,le=A===void 0?!0:A,ee=v.okButtonProps,_e=ee===void 0?{}:ee,K=v.cancelButtonProps,de=K===void 0?{}:K,te=v.onCancel,l=te===void 0?function(){}:te,f=v.onOk,m=f===void 0?function(){}:f,T=v.className,h=T===void 0?"":T;return L.a.createElement("div",{className:I()(S.a.buttonFixed,h)},L.a.createElement("div",{className:S.a.buttonWrap},L.a.createElement(B.a,Object(R.a)({size:"large",className:"".concat(S.a.button," mr20"),onClick:l},de),c),le&&L.a.createElement(B.a,Object(R.a)({size:"large",type:"primary",className:"".concat(S.a.button," mr20"),loading:ue,onClick:m},_e),ie)))}},F8wB:function(D,y,o){D.exports={loading:"loading___1SIOG"}},UUDw:function(D,y,o){D.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(D,y,o){"use strict";o.d(y,"a",function(){return X});var X=function(R){var g=document.createElement("textarea");return g.value=R,g.value}},nuEh:function(D,y,o){"use strict";var X=o("T2oS"),B=o("W9HT"),R=o("q1tI"),g=o.n(R),L=o("F8wB"),M=o.n(L),S=function(I){var Q=I.loading;return Q?g.a.createElement("div",{className:M.a.loading},g.a.createElement(B.a,null)):g.a.createElement(g.a.Fragment,null)};y.a=S}}]);