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__Paths__New.f88bd2d9.asyn...

2 lines
16 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[155],{X8EC:function(me,se,l){"use strict";l.r(se);var Ue=l("DZo9"),ge=l("8z0m"),we=l("+L6B"),le=l("2/Rp"),Le=l("miYZ"),Ee=l("tsqr"),ye=l("oBTY"),Me=l("sRBo"),ue=l("kaz8"),Te=l("14J3"),Fe=l("BMrR"),Se=l("jCWc"),he=l("kPKH"),Ce=l("k1fw"),fe=l("9og8"),Ie=l("y8nQ"),U=l("Vl3Y"),w=l("tJVT"),Pe=l("PpiC"),je=l("5NDa"),_e=l("5rEg"),P=l("q1tI"),o=l.n(P),de=l("9kvl"),pe=l("Ot1p"),Oe=l("hxT0"),b=l.n(Oe),Ae=l("m3rI");function H(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */H=function(){return m};var m={},O=Object.prototype,v=O.hasOwnProperty,R=typeof Symbol=="function"?Symbol:{},W=R.iterator||"@@iterator",ve=R.asyncIterator||"@@asyncIterator",K=R.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(r,n,u){return r[n]=u}}function Z(t,e,r,n){var u=e&&e.prototype instanceof X?e:X,i=Object.create(u.prototype),d=new V(n||[]);return i._invoke=function(E,F,_){var c="suspendedStart";return function(y,ie){if(c==="executing")throw new Error("Generator is already running");if(c==="completed"){if(y==="throw")throw ie;return te()}for(_.method=y,_.arg=ie;;){var re=_.delegate;if(re){var G=oe(re,_);if(G){if(G===g)continue;return G}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(c==="suspendedStart")throw c="completed",_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);c="executing";var I=Q(E,F,_);if(I.type==="normal"){if(c=_.done?"completed":"suspendedYield",I.arg===g)continue;return{value:I.arg,done:_.done}}I.type==="throw"&&(c="completed",_.method="throw",_.arg=I.arg)}}}(t,r,d),i}function Q(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}m.wrap=Z;var g={};function X(){}function p(){}function B(){}var x={};f(x,W,function(){return this});var L=Object.getPrototypeOf,N=L&&L(L($([])));N&&N!==O&&v.call(N,W)&&(x=N);var M=B.prototype=X.prototype=Object.create(x);function q(t){["next","throw","return"].forEach(function(e){f(t,e,function(r){return this._invoke(e,r)})})}function T(t,e){function r(u,i,d,E){var F=Q(t[u],t,i);if(F.type!=="throw"){var _=F.arg,c=_.value;return c&&typeof c=="object"&&v.call(c,"__await")?e.resolve(c.__await).then(function(y){r("next",y,d,E)},function(y){r("throw",y,d,E)}):e.resolve(c).then(function(y){_.value=y,d(_)},function(y){return r("throw",y,d,E)})}E(F.arg)}var n;this._invoke=function(u,i){function d(){return new e(function(E,F){r(u,i,E,F)})}return n=n?n.then(d,d):d()}}function oe(t,e){var r=t.iterator[e.method];if(r===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,oe(t,e),e.method==="throw"))return g;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var n=Q(r,t.iterator,e.arg);if(n.type==="throw")return e.method="throw",e.arg=n.arg,e.delegate=null,g;var u=n.arg;return u?u.done?(e[t.resultName]=u.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,g):u:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}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 ee(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function V(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function $(t){if(t){var e=t[W];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var r=-1,n=function u(){for(;++r<t.length;)if(v.call(t,r))return u.value=t[r],u.done=!1,u;return u.value=void 0,u.done=!0,u};return n.next=n}}return{next:te}}function te(){return{value:void 0,done:!0}}return p.prototype=B,f(M,"constructor",B),f(B,"constructor",p),p.displayName=f(B,K,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===p||(e.displayName||e.name)==="GeneratorFunction")},m.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,B):(t.__proto__=B,f(t,K,"GeneratorFunction")),t.prototype=Object.create(M),t},m.awrap=function(t){return{__await:t}},q(T.prototype),f(T.prototype,ve,function(){return this}),m.AsyncIterator=T,m.async=function(t,e,r,n,u){u===void 0&&(u=Promise);var i=new T(Z(t,e,r,n),u);return m.isGeneratorFunction(e)?i:i.next().then(function(d){return d.done?d.value:i.next()})},q(M),f(M,K,"Generator"),f(M,W,function(){return this}),f(M,"toString",function(){return"[object Generator]"}),m.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function n(){for(;e.length;){var u=e.pop();if(u in t)return n.value=u,n.done=!1,n}return n.done=!0,n}},m.values=$,V.prototype={constructor:V,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(ee),!e)for(var r in this)r.charAt(0)==="t"&&v.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(_,c){return d.type="throw",d.arg=e,r.next=_,c&&(r.method="next",r.arg=void 0),!!c}for(var u=this.tryEntries.length-1;u>=0;--u){var i=this.tryEntries[u],d=i.completion;if(i.tryLoc==="root")return n("end");if(i.tryLoc<=this.prev){var E=v.call(i,"catchLoc"),F=v.call(i,"finallyLoc");if(E&&F){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(E){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!F)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var u=this.tryEntries[n];if(u.tryLoc<=this.prev&&v.call(u,"finallyLoc")&&this.prev<u.finallyLoc){var i=u;break}}i&&(e==="break"||e==="continue")&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var d=i?i.completion:{};return d.type=e,d.arg=r,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(d)},complete:function(e,r){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&r&&(this.next=r),g},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),ee(n),g}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var u=n.completion;if(u.type==="throw"){var i=u.arg;ee(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:$(e),resultName:r,nextLoc:n},this.method==="next"&&(this.arg=void 0),g}},m}var De=_e.a.TextArea,be=function(O){var v,R,W=O.user,ve=O.newCourse,K=O.globalSetting,f=O.loading,Z=O.dispatch,Q=Object(Pe.a)(O,["user","newCourse","globalSetting","loading","dispatch"]),g=U.a.useForm(),X=Object(w.a)(g,1),p=X[0],B=Object(P.useState)({}),x=Object(w.a)(B,2),L=x[0],N=x[1],M=Object(P.useState)(),q=Object(w.a)(M,2),T=q[0],oe=q[1],S=Object(P.useRef)(),ee=Object(P.useState)(!0),V=Object(w.a)(ee,2),$=V[0],te=V[1],t=Object(P.useState)(!1),e=Object(w.a)(t,2),r=e[0],n=e[1],u=Object(P.useState)(),i=Object(w.a)(u,2),d=i[0],E=i[1],F=Object(P.useState)(!0),_=Object(w.a)(F,2),c=_[0],y=_[1],ie=Object(P.useState)(!1),re=Object(w.a)(ie,2),G=re[0],I=re[1];Object(P.useEffect)(function(){var h,s;S.current=(h=Q.match.params)===null||h===void 0?void 0:h.pathId,oe(!!S.current),document.title=(K==null||((s=K.setting)===null||s===void 0)?void 0:s.name)||"\u5934\u6B4C\u5B9E\u8DF5\u6559\u5B66\u5E73\u53F0",p.setFieldsValue({learning_notes_title:"\u8BFE\u7A0B\u987B\u77E5"}),S.current&&Re()},[]);var Re=function(){var h=Object(fe.a)(H().mark(function s(){var a,C,A,D,k,J,z,Y;return H().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.next=2,Z({type:"newCourse/getEditCourseData",payload:{id:S.current}});case 2:a=j.sent,a&&(p.setFieldsValue({name:a.name}),p.setFieldsValue({name_en:a.name_en}),p.setFieldsValue({intro:a.description}),p.setFieldsValue({notice:a.learning_notes}),p.setFieldsValue({learning_notes_title:a.learning_notes_title||"\u8BFE\u7A0B\u987B\u77E5"}),te(a==null?void 0:a.cust_seq),n(a==null?void 0:a.show_spoc),I(a==null?void 0:a.show_history),y(a==null?void 0:a.show_tag),(a==null||((C=a.attachments)===null||C===void 0)?void 0:C.length)>0&&E([{uid:a==null||((A=a.attachments)===null||A===void 0||((D=A[0])===null||D===void 0))?void 0:D.id,name:a==null||((k=a.attachments)===null||k===void 0||((J=k[0])===null||J===void 0))?void 0:J.title,response:{id:a==null||((z=a.attachments)===null||z===void 0||((Y=z[0])===null||Y===void 0))?void 0:Y.id}}]),N({name:a.name,intro:a.description,notice:a.learning_notes}));case 4:case"end":return j.stop()}},s)}));return function(){return h.apply(this,arguments)}}();Object(P.useEffect)(function(){console.log("Filelists.useEffect:",d)},[d]);var Be=function(){var h=Object(fe.a)(H().mark(function s(a){var C,A,D,k,J,z,Y,ce,j,ne;return H().wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return D=a||{},k=D.name,J=D.intro,z=D.notice,Y=D.name_en,ce=D.learning_notes_title,j=T?"newCourse/editCourse":"newCourse/submitCourse",ae.next=4,Z({type:j,payload:{id:S.current,name:k,name_en:Y,description:J,learning_notes:z,cust_seq:$,show_spoc:r,show_tag:c,show_history:G,learning_notes_title:ce,attachment_ids:[d==null||((C=d[0])===null||C===void 0||((A=C.response)===null||A===void 0))?void 0:A.id]}});case 4:ne=ae.sent,(ne==null?void 0:ne.subject_id)&&de.c.push("/paths/".concat(ne.subject_id));case 6:case"end":return ae.stop()}},s)}));return function(a){return h.apply(this,arguments)}}();return o.a.createElement("section",{className:b.a.bg},o.a.createElement("div",{className:b.a.titleWrap},o.a.createElement("span",null,T?"\u7F16\u8F91":"\u521B\u5EFA","\u5B9E\u8DF5\u8BFE\u7A0B")),o.a.createElement(U.a,{form:p,className:b.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){console.log("onchange: ",p.getFieldsValue()),N(Object(Ce.a)({},p.getFieldsValue()))},onFinish:Be},o.a.createElement("div",{className:b.a.fieldWrap},o.a.createElement(U.a.Item,{extra:o.a.createElement("div",{className:"tr c-grey-333 font12 mt3"},"".concat(((v=L.name)===null||v===void 0?void 0:v.length)||0,"/60")),name:"name",label:"\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0"}]},o.a.createElement(De,{maxLength:60,placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"})),o.a.createElement(U.a.Item,{name:"name_en",label:"\u82F1\u6587\u8BFE\u7A0B\u540D\u79F0:",rules:[{message:"\u8BF7\u8F93\u5165\u82F1\u6587\u8BFE\u7A0B\u540D\u79F0"}]},o.a.createElement(_e.a,{maxLength:200,placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A",addonAfter:"".concat(((R=L.name_en)===null||R===void 0?void 0:R.length)||0,"/200")}))),o.a.createElement("div",{className:b.a.mdWrap},o.a.createElement(U.a.Item,{name:"intro",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u7B80\u4ECB"},{max:8e3,message:"\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u7B80\u4ECB\u6700\u5927\u9650\u52368000\u4E2A\u5B57\u7B26"}]},o.a.createElement(pe.a,{watch:!0,defaultValue:L.intro}))),o.a.createElement("div",{className:b.a.mdWrap},o.a.createElement(Fe.a,{align:"middle",className:"mb10 mt10"},o.a.createElement(he.a,null,o.a.createElement("span",{className:"c-red mr10"},"*")),o.a.createElement(he.a,{flex:"1"},o.a.createElement(U.a.Item,{name:"learning_notes_title",label:"",style:{marginBottom:0},rules:[{required:!0,message:"\u8BF7\u8F93\u8BFE\u7A0B\u987B\u77E5\u6807\u9898"},{max:15,message:"\u8BF7\u8F93\u8BFE\u7A0B\u987B\u77E5\u6807\u9898\u6700\u5927\u9650\u523615\u4E2A\u5B57\u7B26"}]},o.a.createElement(_e.a,{placeholder:"\u8BF7\u8F93\u5165"})))),o.a.createElement(U.a.Item,{name:"notice",label:"",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u987B\u77E5"},{max:1e4,message:"\u5B9E\u8DF5\u8BFE\u7A0B\u7684\u8BFE\u7A0B\u987B\u77E5\u6700\u5927\u9650\u523610000\u4E2A\u5B57\u7B26"}]},o.a.createElement(pe.a,{insertTemp:"1",watch:!0,defaultValue:L.notice})),o.a.createElement(ue.a,{checked:$,onChange:function(s){te(s==null?void 0:s.target.checked)}},"\u5C55\u793A\u9ED8\u8BA4\u7AE0\u8282\u5E8F\u53F7\uFF08\u9009\u4E2D\u5219\u6309\u5E8F\u5C55\u793A\u6240\u7AE0\u8282\u5E8F\u53F7\uFF0C\u4E0D\u9009\u4E2D\u5219\u9690\u85CF\u9ED8\u8BA4\u6392\u5E8F\uFF09"),o.a.createElement("br",null),o.a.createElement(ue.a,{style:{marginTop:"10px"},checked:r,onChange:function(s){return n(s==null?void 0:s.target.checked)}},"\u81EA\u9009\u5E76\u5C55\u793ASPOC\u8BFE\u5802\uFF08\u9009\u4E2D\u5219\u7ED9\u51FASPOC\u8BFE\u5802\u5C55\u793A\u533A\u57DF\uFF0C\u8BFE\u7A0B\u521B\u5EFA\u8005/\u5408\u4F5C\u8005\u53EF\u4EE5\u81EA\u4E3B\u6DFB\u52A0\u9700\u8981\u5C55\u793A\u7684\u8BFE\u5802\uFF09"),o.a.createElement("br",null),o.a.createElement(ue.a,{style:{marginTop:"10px"},checked:c,onChange:function(s){return y(s==null?void 0:s.target.checked)}},"\u5C55\u793A\u6280\u672F\u6807\u7B7E\u6A21\u5757\uFF08\u9009\u4E2D\u540E\uFF0C\u5C55\u793A\u8BFE\u7A0B\u7684\u6280\u80FD\u6807\u7B7E\uFF0C\u4E0D\u9009\u4E2D\u5219\u4E0D\u5C55\u793A\u8BE5\u6A21\u5757\uFF09"),o.a.createElement("br",null),o.a.createElement(ue.a,{style:{marginTop:"10px"},checked:G,onChange:function(s){return I(s==null?void 0:s.target.checked)}},"\u5C55\u793A\u5386\u53F2\u8BFE\u5802\u6A21\u5757\uFF08\u9009\u4E2D\u540E\uFF0C\u5C55\u793A\u8BFE\u7A0B\u7684\u5386\u53F2\u8BFE\u5802\uFF0C\u4E0D\u9009\u4E2D\u5219\u4E0D\u5C55\u793A\u8BE5\u6A21\u5757\uFF09"),o.a.createElement("br",null),o.a.createElement("div",{style:{display:"flex",marginTop:"10px"}},"\u81EA\u5B9A\u4E49\u9876\u90E8\u80CC\u666F\u56FE\uFF1A",o.a.createElement(ge.a,{action:Ae.a.API_SERVER+"/api/attachments.json",withCredentials:!0,fileList:d,onChange:function(s){var a,C=(s==null?void 0:s.file.size)/1024/1024<2;if(!((a=s.fileList)===null||a===void 0?void 0:a.length))return!1;if(!C)E(Object(ye.a)(d));else{var A;E(s==null||((A=s.fileList)===null||A===void 0)?void 0:A.slice(-1))}},beforeUpload:function(s){var a=s.type==="image/jpeg"||s.type==="image/png";if(!a)return Ee.b.error("\u53EA\u80FD\u4E0A\u4F20jpg \u6216\u8005png\u56FE\u7247"),!1;var C=s.size/1024/1024<2;return C?a&&C:(Ee.b.error("\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u5927\u4E8E2m"),!1)},onRemove:function(s){E([])}},o.a.createElement(le.a,null,"\u4E0A\u4F20\u56FE\u7247"),"\uFF08 \u672C\u9879\u975E\u5FC5\u9700\u3002\u5982\u4E0D\u4E0A\u4F20\uFF0C\u5219\u4F7F\u7528\u7CFB\u7EDF\u9ED8\u8BA4\u56FE\u7247\uFF1B\u5982\u4E0A\u4F20\uFF0C\u8BF7\u9009\u62E9jpg\u3001png\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC72M\uFF0C\u5EFA\u8BAE\u5C3A\u5BF81920*240\u50CF\u7D20\uFF09"))),o.a.createElement("div",{className:b.a.backgroundFa},o.a.createElement("div",{className:"pt40 mb30"},o.a.createElement(U.a.Item,null,o.a.createElement(le.a,{size:"large",type:"primary",className:"".concat(b.a.button," mr20"),htmlType:"submit",loading:f["newCourse/editCourse"]||f["newCourse/submitCourse"]},"\u63D0\u4EA4"),o.a.createElement(le.a,{size:"large",type:"primary",ghost:!0,className:b.a.button,onClick:function(){return de.c.push(T?"/paths/".concat(S.current):"/paths")}},"\u53D6\u6D88"))))))};se.default=Object(de.a)(function(m){var O=m.user,v=m.newCourse,R=m.loading,W=m.globalSetting;return{user:O,newCourse:v,globalSetting:W,loading:R.effects}})(be)},hxT0:function(me,se,l){me.exports={bg:"bg___2samk",flexRow:"flexRow___2Ocys",flexJustifyCenter:"flexJustifyCenter___14s6l",flexAlignEnd:"flexAlignEnd___1lHt8",flexAlignCenter:"flexAlignCenter___2PtCV",flexColumn:"flexColumn___2Ssa4",formWrap:"formWrap___3Fcg8",titleWrap:"titleWrap___3U2TN",fieldWrap:"fieldWrap___3K6pg",mdWrap:"mdWrap___3o_rf",backgroundFa:"backgroundFa___3dwFi",button:"button___1vOOT"}}}]);