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
2.9 KiB
1 line
2.9 KiB
5 years ago
|
webpackJsonp([236],{3724:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(0),r=a.n(n),s=(a(45),a(12)),o=a.n(s),c=a(298),i=(a(5),function(e,t,a){return t&&u(e.prototype,t),a&&u(e,a),e});function u(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 l=(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)}(f,n.Component),i(f,[{key:"componentDidMount",value:function(){var t=this,a=this.props.match.params.shixunId,e="/shixuns/"+a+"/propaedeutics.json";o.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){console.log(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 pt30 pl20 pr20 pb40 bor-bottom-greyE clearfix"},r.a.createElement("span",{className:"fl"},"背景知识"),r.a.createElement("a",{href:"/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("a",{href:"/shixuns/"+e+"/propaedeutics",className:"defalutCancelbtn fl"},"取消"))))}}]),f);function f(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f);var a=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,(f.__proto__||Object.getPrototypeOf(f)).call(this,e));return a.updatepropaedeuticsvalue=function(){var e="/shixuns/"+a.props.match.params.shixunId+"/update_propaedeutics.json",t=a.neweditanswerRef.current.getValue().trim();o.a.post(e,{content:t}).then(function(e){403===e.data.status||401===e.data.status||500===e.data.status||a.props.showSnackbar(e.data.message)}).catch(function(e){console.log(e)})},a.neweditanswerRef=r.a.createRef(),a.state={shixunId:void 0},a}t.default=l}});
|