webpackJsonp([240],{4074:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(66),o=(a.n(n),a(67)),r=a.n(o),i=a(0),c=a.n(i),s=a(5),l=a(45),p=a(12),d=a.n(p),m=function(e,t,a){return t&&u(e.prototype,t),a&&u(e,a),e};function u(e,t){for(var a=0;a
',testIcon1:'
'},saveHTMLToTextarea:!0,dialogMaskOpacity:.6,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:o,onload:function(){var e=this.id,t=this;h("#"+e+' [type="latex"]').bind("click",function(){t.cm.replaceSelection("```latex"),t.cm.replaceSelection("\n"),t.cm.replaceSelection("\n"),t.cm.replaceSelection("```");var e=t.cm.getDoc().getCursor();t.cm.setCursor(e.line-1,0)}),h("#"+e+' [type="inline"]').bind("click",function(){t.cm.replaceSelection("`$$$$`");var e=t.cm.getDoc().getCursor();t.cm.setCursor(e.line,e.ch-3),t.cm.focus()}),h('[type="inline"]').attr("title","行内公式"),h('[type="latex"]').attr("title","多行公式"),r&&r()}})}var b=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(v,i.Component),m(v,[{key:"componentDidMount",value:function(){var n=this;d.a.get("/paths/new.json").then(function(e){console.log(e)}).catch(function(e){console.log(e)});var e=this.props.match.params.pathId;if(e){this.isEditPage=!0;var t="/paths/"+e+"/edit.json";d.a.get(t).then(function(e){if(e.data.name){n.setState({pathName:e.data.name});var t=g("shixun_introduction","100%","490px","请在此输入实践课程的简介,最大限制8000个字符","/api/attachments.json",e.data.description,"");n.Des_editMD=t;var a=g("shixun_propaedeutics","100%","260px","请在此输入实践课程的学习须知,最大限制2000个字符","/api/attachments.json",e.data.learning_notes,"");n.Point_editMD=a}}).catch(function(e){console.log(e)})}else{this.isEditPage=!1;var a=g("shixun_introduction","100%","490px","请在此输入实践课程的简介,最大限制8000个字符","/api/attachments.json","","");this.Des_editMD=a;var o=g("shixun_propaedeutics","100%","260px","请在此输入实践课程的学习须知,最大限制2000个字符","/api/attachments.json","","");this.Point_editMD=o}}},{key:"render",value:function(){var e=this.props.match.params.pathId,t=this.state,a=t.pathName,n=t.description,o=t.point,i=t.flag_name;return c.a.createElement("div",{className:"newContainer"},c.a.createElement("div",{className:"newMain clearfix"},c.a.createElement("div",{className:"educontent mt10 mb50"},c.a.createElement("div",{className:"mb10 edu-back-white"},c.a.createElement("p",{className:"padding20 bor-bottom-greyE font-18 color-grey-3"},e?"编辑":"创建","实践课程"),c.a.createElement("div",{className:"padding30-20",id:"part_Name"},c.a.createElement("p",{className:"color-grey-6 font-16 mb15"},"实践课程名称"),c.a.createElement("div",{className:"df"},c.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),c.a.createElement("div",{className:"flex1 mr20"},c.a.createElement(r.a,{className:!0===i?"input-100-45 greyInput":"input-100-45 greyInput bor-red",maxLength:"60",placeholder:"例如:从Python程序设计-入门精通",value:a,onInput:this.InputName}))))),c.a.createElement("div",{className:"mb10 edu-back-white padding30-20",id:"part_Des"},c.a.createElement("p",{className:"color-grey-6 font-16 mb15"},"简介"),c.a.createElement("div",{className:"df"},c.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),c.a.createElement("div",{className:"flex1 mr20"},c.a.createElement("div",{id:"shixun_introduction",className:"new_li editormd editormd-vertical"},c.a.createElement("textarea",{className:"input-100-45",name:"description",placeholder:"请在此输入实践课程的简介",value:n})),c.a.createElement("p",{id:"e_tip_shixun_introduction",className:"edu-txt-right color-grey-cd font-12"}),c.a.createElement("p",{id:"e_tips_shixun_introduction",className:"edu-txt-right color-grey-cd font-12"})))),c.a.createElement("div",{className:"mb10 edu-back-white padding30-20",id:"part_point"},c.a.createElement("p",{className:"color-grey-6 font-16 mb15",id:"learning_notes"},"学习须知"),c.a.createElement("div",{className:"df"},c.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),c.a.createElement("div",{className:"flex1 mr20"},c.a.createElement("div",{id:"shixun_propaedeutics",className:"new_li editormd editormd-vertical"},c.a.createElement("textarea",{name:"learning_notes",placeholder:"请在此输入实践课程的学习须知",value:o})),c.a.createElement("p",{id:"e_tip_shixun_propaedeutics",className:"edu-txt-right color-grey-cd font-12"}),c.a.createElement("p",{id:"e_tips_shixun_propaedeutics",className:"edu-txt-right color-grey-cd font-12"})))),c.a.createElement("div",{className:"clearfix mb30 mt30"},c.a.createElement("button",{className:"defalutSubmitbtn fl mr20",loading:this.state.bottonloading,onClick:this.submitNewPath},"提交"),this.isEditPage?c.a.createElement(l.b,{to:"/paths/"+this.props.match.params.pathId,className:"defalutCancelbtn fl"},"取消"):c.a.createElement(l.b,{to:"/paths",className:"defalutCancelbtn fl"},"取消")))))}}]),v);function v(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,e));return o.submitNewPath=function(){var e=o.state.pathName;if(""===e)return o.props.showSnackbar("请输入实践课程名称"),window.location.href="#part_Name",void o.setState({flag_name:!1});var t=o.Des_editMD.getValue();if(""===t)return o.props.showSnackbar("请输入实践课程的简介"),void(window.location.href="#part_Des");if(8e3