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.
1 line
3.0 KiB
1 line
3.0 KiB
webpackJsonp([242],{4107:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(0),r=a.n(n),s=a(45),o=a(12),i=a.n(o),c=a(308),u=(a(5),function(e,t,a){return t&&l(e.prototype,t),a&&l(e,a),e});function l(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var p=(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)}(d,n.Component),u(d,[{key:"componentDidMount",value:function(){var t=this,a=this.props.match.params.shixunId,e="/shixuns/"+a+"/propaedeutics.json";i.a.get(e).then(function(e){403===e.data.status||401===e.data.status||500===e.data.status||(t.setState({shixunId:a}),null!=e.data.content[0]?(t.setState({editanswersRefval:e.data.content}),t.neweditanswerRef.current.setValue(e.data.content)):(t.setState({editanswersRefval:""}),t.neweditanswerRef.current.setValue("")))}).catch(function(e){})}},{key:"render",value:function(){var e=this.state.shixunId;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"educontent"},r.a.createElement("div",{className:"edu-back-white mt30"},r.a.createElement("div",{className:"font-16 pt20 pl20 pr20 pb20 bor-bottom-greyE clearfix"},r.a.createElement("span",{className:"fl"},"背景知识"),r.a.createElement(s.b,{to:"/shixuns/"+e+"/propaedeutics",className:"color-grey-9 fr"},"返回")),r.a.createElement("div",{className:"padding40-20"},r.a.createElement(c.a,{ref:this.neweditanswerRef,placeholder:"请输入选择题的题干内容",mdID:"editquestioMDid",refreshTimeout:1500,needRecreate:!0,watch:!0,className:"courseMessageMD",initValue:this.neweditanswerRefval}))),r.a.createElement("div",{className:"clearfix mb30 mt30"},r.a.createElement("a",{className:"defalutSubmitbtn fl mr20",onClick:this.updatepropaedeuticsvalue},"保存"),r.a.createElement(s.b,{to:"/shixuns/"+e+"/propaedeutics",className:"defalutCancelbtn fl"},"取消"))))}}]),d);function d(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);var s=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,(d.__proto__||Object.getPrototypeOf(d)).call(this,e));return s.updatepropaedeuticsvalue=function(){var e=s.props.match.params.shixunId,t=s.state.shixunId,a="/shixuns/"+e+"/update_propaedeutics.json",n=s.neweditanswerRef.current.getValue().trim();i.a.post(a,{content:n}).then(function(e){403===e.data.status||401===e.data.status||500===e.data.status||(s.props.showNotification(e.data.message),1===e.data.status&&s.props.history.replace("/shixuns/"+t+"/propaedeutics"))}).catch(function(e){})},s.neweditanswerRef=r.a.createRef(),s.state={shixunId:void 0},s}t.default=p}}); |