(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[202,6],{"7ahc":function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var a=n("k1fw"),r=n("0Owb"),c=(n("+L6B"),n("2/Rp")),o=(n("y8nQ"),n("Vl3Y")),i=n("tJVT"),l=(n("OaEy"),n("2fM7")),u=n("q1tI"),s=n.n(u),f=n("VrN/"),m=n.n(f),d=(n("p77/"),n("c5Ni"),l["a"].Option),p={labelCol:{span:4},wrapperCol:{span:20}},h={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var t=e.value,n=e.onChange,r=e.mode,c=e.options,o=void 0===c?{}:c,l=Object(u["useRef"])(),f=Object(u["useState"])(),d=Object(i["a"])(f,2),p=d[0],h=d[1];return Object(u["useEffect"])((function(){if(p){var e=function(e){var t=e.getValue();n&&n(t)};return p.on("change",e),function(){p.off("change",e)}}}),[p,n]),Object(u["useEffect"])((function(){p&&p.setOption("mode",r)}),[p,r]),Object(u["useEffect"])((function(){p&&(t===p.getValue()&&""!==t||setTimeout((function(){p.setValue(t||" ")}),300))}),[p,t]),Object(u["useEffect"])((function(){if(l.current&&!p){var e=m.a.fromTextArea(l.current,Object(a["a"])({mode:r,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},o));h(e)}}),[l.current,p]),s.a.createElement("div",{className:"my-codemirror-container"},s.a.createElement("textarea",{ref:l}))}t["b"]=function(e){var t=e.callback,n=e.onCancel,a=Object(u["useState"])("python"),f=Object(i["a"])(a,2),m=f[0],g=f[1];function b(e){g(h[e][1])}function E(e){t(e)}return s.a.createElement(o["a"],Object(r["a"])({},p,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),s.a.createElement(o["a"].Item,{label:"\u4ee3\u7801\u8bed\u8a00",name:"language"},s.a.createElement(l["a"],{onChange:b},Object.keys(h).map((function(e){return s.a.createElement(d,{key:e,value:e},h[e][0])})))),s.a.createElement(o["a"].Item,{label:"\u4ee3\u7801\u5185\u5bb9",name:"content",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u4ee3\u7801\u5185\u5bb9"}]},s.a.createElement(v,{mode:m})),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(c["a"],{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786e\u5b9a"),s.a.createElement(c["a"],{type:"ghost",onClick:n},"\u53d6\u6d88")))}},"9Bee":function(e,t,n){"use strict";var a=n("q1tI"),r=n.n(a),c=(n("vg9a"),n("tJVT")),o=n("DlQD"),i=n.n(o),l=n("rUJ1");function u(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var a=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);if(null===t)return e;var n=Object(c["a"])(t,1),r=n[0];return r.length>=a.length?e.slice(a.length):e})).join("\n")}var s=[],f=["
".concat(e,"
"):'').concat(n?e:Object(l["escape"])(e,!0),"\n"):''+(n?e:Object(l["escape"])(e,!0))+""},m.heading=function(e,t,n){var a=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:a,level:t,text:e}),"]*>/g;function R(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}t["a"]=function(e){var t=e.value,n=void 0===t?"":t,c=e.className,o=e.style,i=void 0===o?{}:o,l=String(n),u=Object(a["useMemo"])((function(){try{var e=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,t=/\"\/api\/attachments\/|\"\/attachments\/download\//g,n=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;l=l.replace(e,"("+C["a"].API_SERVER+"/api/attachments/").replace(t,'"'+C["a"].API_SERVER+"/api/attachments/").replace(n,'"'+C["a"].API_SERVER+"/files/uploads/")}catch(c){}l=V()(l);var a=S(l),r=j();return l.match(/\[TOC\]/)&&(a=a.replace("[TOC]
",v()),p()),a=a.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var n=r[t],a=n.type,c=n.expression;return Object(L["renderToString"])(R(c)||"",{displayMode:"block"===a,throwOnError:!1,output:"html"})})),a=a.replace(/\u2581/g,"\u2581\u2581\u2581"),O(),a}),[l]),s=Object(a["useRef"])();function f(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.startsWith("#")){e.preventDefault();var a=document.getElementById(n.replace("#",""));a&&a.scrollIntoView(!0)}}}return Object(a["useEffect"])((function(){if(s.current&&u&&u.match(T)&&window.PR.prettyPrint(),s.current)return s.current.addEventListener("click",f),function(){s.current.removeEventListener("click",f),O(),p()}}),[u,s.current,f]),r.a.createElement("div",{ref:s,style:i,className:"".concat(c||""," markdown-body"),dangerouslySetInnerHTML:{__html:u}})}},"9VGf":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n("q1tI");function r(e,t){var n=Object(a["useRef"])();Object(a["useEffect"])((function(){n.current=e})),Object(a["useEffect"])((function(){function e(){n.current()}if(null!==t){var a=setInterval(e,t);return function(){return clearInterval(a)}}}),[t])}},BjJ7:function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return l}));var a=n("m3rI");function r(e){var t=!0;if(e.length>0){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=[],a=0;a=0,Q=U?"Cmd":"Ctrl",$=(I={},Object(o["a"])(I,Q+"-B","bold"),Object(o["a"])(I,Q+"-I","italic"),I),K=(V={},Object(o["a"])(V,P,"\u6dfb\u52a0\u94fe\u63a5"),Object(o["a"])(V,q,"\u6dfb\u52a0\u4ee3\u7801\u5757"),Object(o["a"])(V,M,"\u6dfb\u52a0\u56fe\u7247"),Object(o["a"])(V,D,"\u6dfb\u52a0\u8868\u683c"),V);t["a"]=function(e){var t=e.defaultValue,n=void 0===t?"":t,u=e.onChange,d=e.width,p=void 0===d?"100%":d,h=e.height,b=void 0===h?400:h,E=e.miniToolbar,y=void 0!==E&&E,w=e.isFocus,k=void 0!==w&&w,x=e.watch,_=e.id,N=void 0===_?"markdown-editor-id":_,C=e.showResizeBar,I=void 0!==C&&C,V=e.noStorage,T=void 0!==V&&V,R=e.showNullButton,F=void 0!==R&&R,B=e.fullScreen,J=void 0!==B&&B,U=e.onBlur,Q=e.onCMBeforeChange,X=e.className,Z=void 0===X?"":X,ee=e.placeholder,te=void 0===ee?"":ee,ne=e.values,ae=void 0===ne?"":ne,re=Object(i["useState"])(null),ce=Object(c["a"])(re,2),oe=ce[0],ie=ce[1],le=Object(i["useState"])(n),ue=Object(c["a"])(le,2),se=ue[0],fe=ue[1],me=Object(i["useState"])(x),de=Object(c["a"])(me,2),pe=de[0],he=de[1],ve=Object(i["useState"])(J),ge=Object(c["a"])(ve,2),be=ge[0],Ee=ge[1],ye=Object(i["useState"])(""),we=Object(c["a"])(ye,2),je=we[0],Oe=we[1],ke=Object(i["useState"])(0),xe=Object(c["a"])(ke,2),_e=xe[0],Ne=xe[1],Se=Object(i["useState"])(b),Ce=Object(c["a"])(Se,2),Le=Ce[0],Ie=Ce[1],Ve=Object(i["useState"])(!1),Te=Object(c["a"])(Ve,2),Re=(Te[0],Te[1]),Fe=Object(i["useRef"])(),Be=Object(i["useRef"])(),Ae=Object(i["useRef"])(),Pe=Object(i["useRef"])();Object(i["useEffect"])((function(){fe(ae),null===oe||void 0===oe||oe.setValue(ae)}),[ae]),Object(i["useEffect"])((function(){if(Fe.current){var e=function(e,n){var a=n.clipboardData;if(a){var r=a.types.toString(),c=a.items;if("text/html,Files"!==r&&"Files"!==r)return!0;var o=c[1];"Files"===r&&(o=c[0]),"file"===o.kind&&o.type.match(/^image\//i)&&L(o.getAsFile(),(function(e){e.id?t.replaceSelection("")):401===(null===e||void 0===e?void 0:e.status)&&(document.location.href="/user/login")}))}return!0},t=s.a.fromTextArea(Fe.current,{mode:"markdown",inputStyle:"contenteditable",lineNumbers:!y,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("paste",e),ie(t),function(){t.off("paste",e)}}}),[]);var Me=Object(i["useCallback"])((function(){if(Be.current)try{var e=Be.current.getElementsByClassName("markdown-toolbar-container")[0].offsetHeight,t=Be.current.getElementsByClassName("markdown-editor-body")[0];t.style.height=be?"calc(100vh - ".concat(e,"px)"):"".concat(Le-e,"px")}catch(n){console.log(n,"---- to set md editor body height")}}),[Le,Be,be]);Object(i["useEffect"])((function(){function e(){var e=new f["default"]((function(e){var t,n=Object(r["a"])(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;(a.target.offsetHeight>0||a.target.offsetWidth>0)&&(Me(),oe.setSize("100%","100%"),oe.refresh())}}catch(c){n.e(c)}finally{n.f()}}));return e.observe(Fe.current.parentElement),e}if(oe){var t=e();return function(){t.unobserve(Fe.current.parentElement)}}}),[oe,Me]),Object(i["useEffect"])((function(){if(oe){for(var e=[],t=function(){var t=a[n];r=Object(c["a"])(t,2);var i=r[0],l=r[1],u=Object(o["a"])({},i,(function(){qe(l)}));e.push(u),oe.addKeyMap(u)},n=0,a=Object.entries($);n0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(N);e>=_e+G&&(!t||t!==se)&&(window.sessionStorage.setItem(N,se),Re(!0))}}),G),Object(i["useEffect"])((function(){he(x)}),[oe,x]),Object(i["useEffect"])((function(){oe&&k&&oe.focus()}),[oe,k]),Object(i["useEffect"])((function(){if(pe&&oe){var e=function(e){var t=e.target;if(Pe.current){var n=t.scrollTop/t.scrollHeight;Pe.current.scrollTop=Pe.current.scrollHeight*n}},t=oe.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[oe,pe]),Object(i["useEffect"])((function(){if(oe&&Q){var e=function(e,t){Q(e,t)};return oe.on("beforeChange",e),function(){oe.off("beforeChange",e)}}}),[oe,Q]),Object(i["useEffect"])((function(){if(oe&&U){var e=function(){U(oe.getValue())};return oe.on("blur",e),function(){oe.off("blur",e)}}}),[oe,U]),Object(i["useEffect"])((function(){if(oe){var e=function(e){var t=e.getValue();fe(t),Ne((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),u&&u(t)};return oe.on("change",e),function(){oe.off("change",e)}}}),[oe,u]),Object(i["useEffect"])((function(){oe&&(null===n||void 0===n?(oe.setValue(""),fe("")):n!==oe.getValue()&&(oe.setValue(n),fe(n)))}),[oe,n]);var qe=Object(i["useCallback"])((function(e){var t=oe.getCursor(),n=oe.getSelection(),a=n.split("\n");switch(e){case"bold":return oe.replaceSelection("**"+n+"**"),""===n&&oe.setCursor(t.line,t.ch+2),oe.focus();case"italic":return oe.replaceSelection("*"+n+"*"),""===n&&oe.setCursor(t.line,t.ch+1),oe.focus();case"code":return oe.replaceSelection("`"+n+"`"),""===n&&oe.setCursor(t.line,t.ch+1),oe.focus();case"inline-latex":return oe.replaceSelection("`$$"+n+"$$`"),""===n&&oe.setCursor(t.line,t.ch+3),oe.focus();case"latex":return oe.replaceSelection("```latex\n"+n+"\n```"),oe.setCursor(t.line+1,n.length+1),oe.focus();case"line-break":return oe.replaceSelection("
\n"),oe.focus();case"list-ul":return""===n?oe.replaceSelection("- "+n):oe.replaceSelection(a.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),oe.focus();case"list-ol":return""===n?oe.replaceSelection("1. "+n):oe.replaceSelection(a.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),oe.focus();case"add-null-ch":return""===n&&oe.setCursor(t.line,t.ch+1),oe.replaceSelection(Y),oe.focus();case"eraser":return oe.setValue(""),oe.focus();case"trigger-watch":return he(!pe),oe.focus();case"trigger-full-screen":return Ee(!be),oe.focus();case P:return void Oe(P);case q:return void Oe(q);case M:return void Oe(M);case D:return void Oe(D);default:throw new Error}}),[oe,pe,be]),De=Object(i["useCallback"])((function(e){switch(Oe(""),je){case P:var t=e.title,n=e.link;return oe.replaceSelection("[".concat(t,"](").concat(n,")")),oe.focus();case q:var a=e.language,r=e.content;return oe.replaceSelection(["```"+a,r,"```"].join("\n")),oe.focus();case M:var c=e.src,o=e.alt;return oe.replaceSelection(".concat(c,' "').concat(o,'" )')),oe.focus();case D:for(var i=e.row,l=e.col,u=e.align,s="\n",f=0;f300&&(t=300);var n=b+t+"px";Ie(n)}},a=Ae.current,r=!1,c=0;return a.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){a.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[oe,Ae]),Object(i["useEffect"])((function(){Ie(b)}),[b]);var He=z(p),Ge=z(Le),Ye={width:He,height:Ge};Object(i["useMemo"])((function(){if(_e){var e=new Date(_e),t=e.getHours(),n=e.getMinutes(),a=e.getSeconds();return t=t<10?"0"+t:t,n=n<10?"0"+n:n,a=a<10?"0"+a:a,"".concat(t,":").concat(n,":").concat(a)}return 0}),[_e]);return l.a.createElement(i["Fragment"],null,l.a.createElement("div",{className:"markdown-editor-wrapper",ref:Be},l.a.createElement("div",{className:"markdown-editor-container ".concat(Z," ").concat(pe?"on-preview":""," ").concat(y?"mini":""," ").concat(be?"full-screen":""),style:Ye},l.a.createElement(v,{watch:pe,fullScreen:be,showNullButton:F,onActionCallback:qe}),l.a.createElement("div",{className:"markdown-editor-body"},l.a.createElement("div",{className:"codemirror-container"},l.a.createElement("textarea",{ref:Fe,placeholder:te})),pe?l.a.createElement("div",{ref:Pe,className:"preview-container"},l.a.createElement(m["a"],{value:se})):null))),I?l.a.createElement("a",{ref:Ae,className:"editor-resize"}):null,l.a.createElement(g["a"],null,K[je]?l.a.createElement(a["a"],{centered:!0,title:K[je],visible:!0,onCancel:We,footer:null},Je):null))}},R7cW:function(e,t,n){"use strict";n.r(t);n("+L6B");var a=n("2/Rp"),r=(n("DZo9"),n("8z0m")),c=n("0Owb"),o=(n("5NDa"),n("5rEg")),i=(n("sPJy"),n("bE4q")),l=n("k1fw"),u=n("oBTY"),s=n("9og8"),f=(n("miYZ"),n("tsqr")),m=(n("y8nQ"),n("Vl3Y")),d=n("tJVT"),p=n("q1tI"),h=n.n(p),v=n("Ty5D"),g=n("9kvl"),b=n("55Ip"),E=n("Ot1p"),y=n("XYT7"),w=n("m3rI"),j=n("YiJy"),O=n.n(j);function k(){k=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},c=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(C){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var c=t&&t.prototype instanceof m?t:m,o=Object.create(c.prototype),i=new _(r||[]);return a(o,"_invoke",{value:w(e,n,i)}),o}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(C){return{type:"throw",arg:C}}}e.wrap=u;var f={};function m(){}function d(){}function p(){}var h={};l(h,c,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(N([])));g&&g!==t&&n.call(g,c)&&(h=g);var b=p.prototype=m.prototype=Object.create(h);function E(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function r(a,c,o,i){var l=s(e[a],e,c);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,o,i)}),(function(e){r("throw",e,o,i)})):t.resolve(f).then((function(e){u.value=e,o(u)}),(function(e){return r("throw",e,o,i)}))}i(l.arg)}var c;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){r(e,n,t,a)}))}return c=c?c.then(a,a):a()}})}function w(e,t,n){var a="suspendedStart";return function(r,c){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===r)throw c;return S()}for(n.method=r,n.arg=c;;){var o=n.delegate;if(o){var i=j(o,n);if(i){if(i===f)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var l=s(e,t,n);if("normal"===l.type){if(a=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a="completed",n.method="throw",n.arg=l.arg)}}}function j(e,t){var n=t.method,a=e.iterator[n];if(void 0===a)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,j(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var r=s(a,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var c=r.arg;return c?c.done?(t[e.resultName]=c.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):c:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function N(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,r=function t(){for(;++a=0;--r){var c=this.tryEntries[r],o=c.completion;if("root"===c.tryLoc)return a("end");if(c.tryLoc<=this.prev){var i=n.call(c,"catchLoc"),l=n.call(c,"finallyLoc");if(i&&l){if(this.prev=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if("throw"===a.type){var r=a.arg;x(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}var x=function(e){var t,n=e.shixunHomeworks,j=(e.newCourse,e.globalSetting,e.loading,e.dispatch),x=(e.match,Object(v["m"])()),_=m["a"].useForm(),N=Object(d["a"])(_,1),S=N[0],C=Object(p["useState"])({}),L=Object(d["a"])(C,2),I=L[0],V=L[1],T=Object(p["useState"])(!1),R=Object(d["a"])(T,2),F=R[0],B=R[1],A=Object(p["useState"])([]),P=Object(d["a"])(A,2),M=P[0],q=P[1],D=Object(p["useState"])([]),J=Object(d["a"])(D,2),W=J[0],H=J[1],G=n.commonHomeWorkEditDefaultData,Y={name:"file",multiple:!0,action:w["a"].API_SERVER+"/api/attachments.json",data:function(e){return e.newfilename=encodeURIComponent(e.name),e},defaultFileList:M,onChange:function(e){var t=e.file.status;"done"===t?f["b"].success("".concat(e.file.name," \u6587\u4ef6\u4e0a\u4f20\u6210\u529f")):"error"===t&&f["b"].error("".concat(e.file.name," \u6587\u4ef6\u4e0a\u4f20\u5931\u8d25"))}};Object(p["useEffect"])((function(){U()}),[x.topicId]);var z=function(e){return null===e||void 0===e?void 0:e.map((function(e){return{uid:e.id,response:{id:e.id},name:e.title,status:"done",url:e.url}}))},U=function(){var e=Object(s["a"])(k().mark((function e(){var t;return k().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,j({type:"shixunHomeworks/editCommonHomeWorkDefaultBankData",payload:{id:x.topicId}});case 2:t=e.sent,t&&(S.setFieldsValue({name:t.name}),S.setFieldsValue({description:t.description}),S.setFieldsValue({reference_answer:t.reference_answer}),q(Object(u["a"])(z(t.attachments))),H(Object(u["a"])(z(t.reference_attachments))),B(!0));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var e=Object(s["a"])(k().mark((function e(t){var n,a,r,c;return k().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=Object(l["a"])({},I),n.attachment_ids&&(n.attachment_ids=null===n||void 0===n||null===(a=n.attachment_ids["fileList"])||void 0===a?void 0:a.map((function(e){var t;return null===(t=e.response)||void 0===t?void 0:t.id}))),n.reference_attachment_ids&&(n.reference_attachment_ids=null===n||void 0===n||null===(r=n.reference_attachment_ids["fileList"])||void 0===r?void 0:r.map((function(e){var t;return null===(t=e.response)||void 0===t?void 0:t.id}))),e.next=5,Object(y["n"])(Object(l["a"])(Object(l["a"])({id:x.topicId},n),{},{base_on_project:null,type:1}));case 5:c=e.sent,c&&g["c"].push("/users/".concat(x.username,"/topics/").concat(x.topicId,"/").concat(x.topictype,"/normal/detail"));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return h.a.createElement("section",{className:O.a.bg},h.a.createElement("section",{className:"animated fadeIn"},h.a.createElement("aside",{className:"mt10"},h.a.createElement(i["a"],{separator:">"},h.a.createElement(i["a"].Item,null,h.a.createElement(b["Link"],{to:"/users/".concat(x.username,"/").concat("personal"===x.topictype?"topics":"topicbank","/").concat(x.topictype)},"personal"===x.topictype?"\u6211\u7684\u8bfe\u5802\u8d44\u6e90":"\u516c\u5171\u9898\u5e93")),h.a.createElement(i["a"].Item,null,h.a.createElement(b["Link"],{to:"/users/".concat(x.username,"/topics/").concat(x.topicId,"/").concat(x.topictype,"/normal/detail")},"\u8be6\u60c5")),h.a.createElement(i["a"].Item,null,"\u7f16\u8f91")))),h.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u7f16\u8f91"),h.a.createElement(m["a"],{form:S,className:O.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){V(Object(l["a"])({},S.getFieldsValue()))},onFinish:Q},h.a.createElement("div",{className:O.a.fieldWrap},h.a.createElement(m["a"].Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u6807\u9898"}]},h.a.createElement(o["a"],{maxLength:60,suffix:"".concat((null===(t=I.name)||void 0===t?void 0:t.length)||0,"/60"),placeholder:"\u4f8b\u5982\uff1a\u4ecePython\u7a0b\u5e8f\u8bbe\u8ba1-\u5165\u95e8\u7cbe\u901a"}))),h.a.createElement("div",{className:O.a.mdWrap},h.a.createElement(m["a"].Item,{name:"description",label:"\u7b80\u4ecb:",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u4f5c\u4e1a\u7684\u7b80\u4ecb"},{max:5e3,message:"\u4f5c\u4e1a\u7b80\u4ecb\u6700\u5927\u9650\u52365000\u4e2a\u5b57\u7b26"}]},h.a.createElement(E["a"],{id:"topic-normal-description",watch:!0,defaultValue:G.description})),h.a.createElement("div",null,h.a.createElement(m["a"].Item,{name:"attachment_ids"},F&&h.a.createElement(r["a"],Object(c["a"])({defaultFileList:M},Y),h.a.createElement("span",{className:"c-blue"},"\u4e0a\u4f20\u9644\u4ef6")," \uff08\u5355\u4e2a\u6587\u4ef6150MB\u4ee5\u5185\uff09")))),h.a.createElement("div",{className:O.a.mdWrap},h.a.createElement(m["a"].Item,{name:"reference_answer",label:"\u53c2\u8003\u7b54\u6848:"},h.a.createElement(E["a"],{id:"topic-normal-reference_answer",defaultValue:G.reference_answer,watch:!0})),h.a.createElement("div",null,h.a.createElement(m["a"].Item,{name:"reference_attachment_ids"},F&&h.a.createElement(r["a"],Object(c["a"])({},Y,{defaultFileList:W}),h.a.createElement("span",{className:"c-blue"},"\u4e0a\u4f20\u9644\u4ef6")," \uff08\u5355\u4e2a\u6587\u4ef6150MB\u4ee5\u5185\uff09")))),h.a.createElement("div",{className:O.a.backgroundFa},h.a.createElement("div",{className:"pt40 mb30"},h.a.createElement(m["a"].Item,null,h.a.createElement(a["a"],{size:"large",type:"primary",className:"".concat(O.a.button," mr20"),htmlType:"submit"},"\u63d0\u4ea4"),h.a.createElement(a["a"],{size:"large",type:"primary",ghost:!0,className:O.a.button,onClick:function(){return g["c"].push("/users/".concat(x.username,"/topics/").concat(x.topicId,"/").concat(x.topictype,"/normal/detail"))}},"\u53d6\u6d88"))))))};t["default"]=Object(g["a"])((function(e){var t=e.shixunHomeworks,n=e.newCourse,a=e.loading,r=e.globalSetting;return{shixunHomeworks:t,newCourse:n,globalSetting:r,loading:a.effects}}))(x)},YiJy:function(e,t,n){e.exports={bg:"bg___2xkgh",flexRow:"flexRow___3_RB8",flexJustifyCenter:"flexJustifyCenter___3Rbeo",flexAlignEnd:"flexAlignEnd___Up4h1",flexAlignCenter:"flexAlignCenter___hv6Pr",flexColumn:"flexColumn___kNPED",formWrap:"formWrap___2LY7l",titleWrap:"titleWrap___1TXK0",fieldWrap:"fieldWrap___2Bk37",mdWrap:"mdWrap___3VsOd",backgroundFa:"backgroundFa___13msX",button:"button___2BNet"}},dejd:function(e,t,n){},kSUc:function(e,t,n){}}]);