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...

1 line
12 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[187],{"3TLj":function(t,e,n){t.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(t,e,n){"use strict";n.r(e);n("5NDa");var r=n("5rEg"),a=(n("2qtc"),n("kLXV")),o=n("9og8"),i=n("k1fw"),c=(n("y8nQ"),n("Vl3Y")),u=n("tJVT"),l=n("PpiC"),s=(n("Znn+"),n("ZTPi")),f=n("q1tI"),h=n.n(f),p=n("9kvl"),d=n("Ot1p"),m=n("HBuW"),v=n("3TLj"),y=n.n(v),g=n("UqFu"),b=n("9ZNV"),_=n("nuEh");function w(){w=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),c=new F(r||[]);return a(i,"_invoke",{value:k(t,n,c)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",v={};function y(){}function g(){}function b(){}var _={};l(_,i,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(P([])));E&&E!==n&&r.call(E,i)&&(_=E);var L=b.prototype=y.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function k(e,n,r){var a=h;return function(o,i){if(a===d)throw new Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:t,done:!0}}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var u=T(c,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===h)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=d;var l=f(e,n,r);if("normal"===l.type){if(a=r.done?m:p,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(a=m,r.method="throw",r.arg=l.arg)}}}function T(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(a,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function S(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 N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function P(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=b,a(L,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new O(s(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(L),l(L,u,"Generator"),l(L,i,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=P,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return c.type="throw",c.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;N(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}var x=s["a"].TabPane,E=function(t){var e,n=t.shixunsDetail,v=t.dispatch,E=t.match,L=t.practiceSetting,j=(Object(l["a"])(t,["shixunsDetail","dispatch","match","practiceSetting"]),c["a"].useForm()),O=Object(u["a"])(j,1),k=O[0],T=Object(f["useState"])({}),S=Object(u["a"])(T,2),N=S[0],F=S[1],P=n.challengesNew,B=Object(f["useRef"])(null),V=(L.selectQuestionParams,L.id),I=L.newQuestion,W=Object(f["useState"])(!0),q=Object(u["a"])(W,2),G=q[0],D=q[1];Object(f["useEffect"])((function(){D(!0),v({type:"shixunsDetail/getChallengesNew",payload:Object(i["a"])({},E.params)}),D(!1)}),[E.params]);var C=function(){var t=Object(o["a"])(w().mark((function t(e){var n,r;return w().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=Object(i["a"])({},N),n["identifier"]=E.params.id,n["st"]=1,t.next=5,Object(m["b"])(Object(i["a"])({},n));case 5:r=t.sent,1===r.status&&(p["c"].replace("/shixuns/".concat(E.params.id,"/edit/").concat(r.challenge_id,"/editquestion?tab=2")),setTimeout((function(){v({type:"practiceSetting/setParams",payload:{newQuestion:null}}),v({type:"practiceSetting/setUpdateIndex"})}),200));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),U=function(){J()},Q=function(t){clearTimeout(B.current),B.current=setTimeout((function(){"subject"in t&&I&&v({type:"practiceSetting/setParams",payload:{newQuestion:{st:1,name:null===t||void 0===t?void 0:t.subject}}});var e=k.getFieldsValue(),n=e.subject,r=e.task_pass;""!==n||r!==Object(g["a"])(P.task_pass_default)?v({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):v({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})}),500)},Z=function(t){F(Object(i["a"])({},k.getFieldsValue())),Q(t)},J=function(){var t,e=function(){p["c"].push("/shixuns/".concat(V,"/challenges")),v({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};(null===L||void 0===L||null===(t=L.sideBar)||void 0===t?void 0:t.confirmLeave)?a["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(){e()}}):e()};return h.a.createElement("section",{className:y.a.bg},h.a.createElement(s["a"],{activeKey:"1"},h.a.createElement(x,{tab:"\u672c\u5173\u4efb\u52a1",key:"1"},h.a.createElement(c["a"],{form:k,className:y.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Z,onFinish:C},h.a.createElement("div",{className:y.a.fieldWrap},h.a.createElement(c["a"].Item,{initialValue:"",name:"subject",label:"\u4efb\u52a1\u540d\u79f0:",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u4efb\u52a1\u540d\u79f0"}]},h.a.createElement(r["a"],{bordered:!1,maxLength:60,suffix:"".concat((null===(e=N.subject)||void 0===e?void 0:e.length)||0,"/60"),placeholder:"\u4f8b\u5982\uff1a\u4ecePython\u7a0b\u5e8f\u8bbe\u8ba1-\u5165\u95e8\u7cbe\u901a"}))),h.a.createElement("div",{className:y.a.mdWrap},h.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"}]},h.a.createElement(d["a"],{watch:!0,defaultValue:P.task_pass_default}))),h.a.createElement(c["a"].Item,{noStyle:!0},h.a.createElement(b["a"],{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:U}))))),h.a.createElement(_["a"],{loading:G}))};e["default"]=Object(p["a"])((function(t){var e=t.shixunsDetail,n=t.practiceSetting;return{shixunsDetail:e,practiceSetting:n}}))(E)},"9ZNV":function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n("0Owb"),a=(n("+L6B"),n("2/Rp")),o=n("q1tI"),i=n.n(o),c=n("UUDw"),u=n.n(c),l=n("TSYQ"),s=n.n(l),f=function(t){var e=t.cancelText,n=void 0===e?"\u53d6\u6d88":e,o=t.okText,c=void 0===o?"\u786e\u5b9a":o,l=t.loading,f=void 0!==l&&l,h=t.hasOkBtn,p=void 0===h||h,d=t.okButtonProps,m=void 0===d?{}:d,v=t.onCancel,y=void 0===v?function(){}:v,g=t.onOk,b=void 0===g?function(){}:g,_=t.className,w=void 0===_?"":_;return i.a.createElement("div",{className:s()(u.a.buttonFixed,w)},i.a.createElement("div",{className:u.a.buttonWrap},i.a.createElement(a["a"],{size:"large",className:"".concat(u.a.button," mr20"),onClick:y},n),p&&i.a.createElement(a["a"],Object(r["a"])({size:"large",type:"primary",className:"".concat(u.a.button," mr20"),loading:f,onClick:b},m),c)))}},F8wB:function(t,e,n){t.exports={loading:"loading___1SIOG"}},UUDw:function(t,e,n){t.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){var e=document.createElement("textarea");return e.value=t,e.value}},nuEh:function(t,e,n){"use strict";n("T2oS");var r=n("W9HT"),a=n("q1tI"),o=n.n(a),i=n("F8wB"),c=n.n(i),u=function(t){var e=t.loading;return e?o.a.createElement("div",{className:c.a.loading},o.a.createElement(r["a"],null)):o.a.createElement(o.a.Fragment,null)};e["a"]=u}}]);