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__Shixuns__Detail__Reposit...

2 lines
15 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[180],{"7ahc":function(V,S,a){"use strict";a.d(S,"a",function(){return f});var et=a("k1fw"),H=a("0Owb"),Q=a("+L6B"),G=a("2/Rp"),J=a("y8nQ"),R=a("Vl3Y"),A=a("tJVT"),rt=a("OaEy"),U=a("2fM7"),u=a("q1tI"),P=a.n(u),O=a("VrN/"),Y=a.n(O),Z=a("p77/"),X=a.n(Z),W=a("c5Ni"),N=a.n(W),q=U.a.Option,_={labelCol:{span:4},wrapperCol:{span:20}},p={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"]};S.b=function(E){var v=E.callback,C=E.onCancel,b=Object(u.useState)("python"),F=Object(A.a)(b,2),l=F[0],L=F[1];function T(s){L(p[s][1])}function y(s){v(s)}return P.a.createElement(R.a,Object(H.a)({},_,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:y}),P.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},P.a.createElement(U.a,{onChange:T},Object.keys(p).map(function(s){return P.a.createElement(q,{key:s,value:s},p[s][0])}))),P.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},P.a.createElement(f,{mode:l})),P.a.createElement("div",{className:"flex-container flex-end"},P.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),P.a.createElement(G.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function f(E){var v=E.value,C=E.onChange,b=E.mode,F=E.options,l=F===void 0?{}:F,L=Object(u.useRef)(),T=Object(u.useState)(),y=Object(A.a)(T,2),s=y[0],I=y[1];return Object(u.useEffect)(function(){if(s){var m=function(w){var j=w.getValue();C&&C(j)};return s.on("change",m),function(){s.off("change",m)}}},[s,C]),Object(u.useEffect)(function(){s&&s.setOption("mode",b)},[s,b]),Object(u.useEffect)(function(){s&&((v!==s.getValue()||v==="")&&setTimeout(function(){s.setValue(v||" ")},300))},[s,v]),Object(u.useEffect)(function(){if(L.current&&!s){var m=Y.a.fromTextArea(L.current,Object(et.a)({mode:b,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));I(m)}},[L.current,s]),P.a.createElement("div",{className:"my-codemirror-container"},P.a.createElement("textarea",{ref:L}))}},"9ZNV":function(V,S,a){"use strict";a.d(S,"a",function(){return u});var et=a("0Owb"),H=a("+L6B"),Q=a("2/Rp"),G=a("q1tI"),J=a.n(G),R=a("UUDw"),A=a.n(R),rt=a("TSYQ"),U=a.n(rt),u=function(O){var Y=O.cancelText,Z=Y===void 0?"\u53D6\u6D88":Y,X=O.okText,W=X===void 0?"\u786E\u5B9A":X,N=O.loading,q=N===void 0?!1:N,_=O.hasOkBtn,p=_===void 0?!0:_,f=O.okButtonProps,E=f===void 0?{}:f,v=O.onCancel,C=v===void 0?function(){}:v,b=O.onOk,F=b===void 0?function(){}:b,l=O.className,L=l===void 0?"":l;return J.a.createElement("div",{className:U()(A.a.buttonFixed,L)},J.a.createElement("div",{className:A.a.buttonWrap},J.a.createElement(Q.a,{size:"large",className:"".concat(A.a.button," mr20"),onClick:C},Z),p&&J.a.createElement(Q.a,Object(et.a)({size:"large",type:"primary",className:"".concat(A.a.button," mr20"),loading:q,onClick:F},E),W)))}},UUDw:function(V,S,a){V.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},baNF:function(V,S,a){"use strict";a.r(S);var et=a("5NDa"),H=a("5rEg"),Q=a("k1fw"),G=a("9og8"),J=a("y8nQ"),R=a("Vl3Y"),A=a("tJVT"),rt=a("PpiC"),U=a("q1tI"),u=a.n(U),P=a("Ty5D"),O=a("9kvl"),Y=a("7ahc"),Z=a("9ZNV"),X=a("y37m"),W=a.n(X);function N(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */N=function(){return _};var _={},p=Object.prototype,f=p.hasOwnProperty,E=Object.defineProperty||function(r,t,e){r[t]=e.value},v=typeof Symbol=="function"?Symbol:{},C=v.iterator||"@@iterator",b=v.asyncIterator||"@@asyncIterator",F=v.toStringTag||"@@toStringTag";function l(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{l({},"")}catch(r){l=function(e,n,o){return e[n]=o}}function L(r,t,e,n){var o=t&&t.prototype instanceof s?t:s,i=Object.create(o.prototype),c=new d(n||[]);return E(i,"_invoke",{value:nt(r,e,c)}),i}function T(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(n){return{type:"throw",arg:n}}}_.wrap=L;var y={};function s(){}function I(){}function m(){}var z={};l(z,C,function(){return this});var w=Object.getPrototypeOf,j=w&&w(w(h([])));j&&j!==p&&f.call(j,C)&&(z=j);var x=m.prototype=s.prototype=Object.create(z);function tt(r){["next","throw","return"].forEach(function(t){l(r,t,function(e){return this._invoke(t,e)})})}function B(r,t){function e(o,i,c,g){var M=T(r[o],r,i);if(M.type!=="throw"){var $=M.arg,K=$.value;return K&&typeof K=="object"&&f.call(K,"__await")?t.resolve(K.__await).then(function(k){e("next",k,c,g)},function(k){e("throw",k,c,g)}):t.resolve(K).then(function(k){$.value=k,c($)},function(k){return e("throw",k,c,g)})}g(M.arg)}var n;E(this,"_invoke",{value:function(i,c){function g(){return new t(function(M,$){e(i,c,M,$)})}return n=n?n.then(g,g):g()}})}function nt(r,t,e){var n="suspendedStart";return function(o,i){if(n==="executing")throw new Error("Generator is already running");if(n==="completed"){if(o==="throw")throw i;return{value:void 0,done:!0}}for(e.method=o,e.arg=i;;){var c=e.delegate;if(c){var g=at(c,e);if(g){if(g===y)continue;return g}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(n==="suspendedStart")throw n="completed",e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);n="executing";var M=T(r,t,e);if(M.type==="normal"){if(n=e.done?"completed":"suspendedYield",M.arg===y)continue;return{value:M.arg,done:e.done}}M.type==="throw"&&(n="completed",e.method="throw",e.arg=M.arg)}}}function at(r,t){var e=t.method,n=r.iterator[e];if(n===void 0)return t.delegate=null,e==="throw"&&r.iterator.return&&(t.method="return",t.arg=void 0,at(r,t),t.method==="throw")||e!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+e+"' method")),y;var o=T(n,r.iterator,t.arg);if(o.type==="throw")return t.method="throw",t.arg=o.arg,t.delegate=null,y;var i=o.arg;return i?i.done?(t[r.resultName]=i.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=void 0),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function ot(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function D(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function d(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(ot,this),this.reset(!0)}function h(r){if(r||r===""){var t=r[C];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var e=-1,n=function o(){for(;++e<r.length;)if(f.call(r,e))return o.value=r[e],o.done=!1,o;return o.value=void 0,o.done=!0,o};return n.next=n}}throw new TypeError(typeof r+" is not iterable")}return I.prototype=m,E(x,"constructor",{value:m,configurable:!0}),E(m,"constructor",{value:I,configurable:!0}),I.displayName=l(m,F,"GeneratorFunction"),_.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return!!t&&(t===I||(t.displayName||t.name)==="GeneratorFunction")},_.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,m):(r.__proto__=m,l(r,F,"GeneratorFunction")),r.prototype=Object.create(x),r},_.awrap=function(r){return{__await:r}},tt(B.prototype),l(B.prototype,b,function(){return this}),_.AsyncIterator=B,_.async=function(r,t,e,n,o){o===void 0&&(o=Promise);var i=new B(L(r,t,e,n),o);return _.isGeneratorFunction(t)?i:i.next().then(function(c){return c.done?c.value:i.next()})},tt(x),l(x,F,"Generator"),l(x,C,function(){return this}),l(x,"toString",function(){return"[object Generator]"}),_.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function o(){for(;e.length;){var i=e.pop();if(i in t)return o.value=i,o.done=!1,o}return o.done=!0,o}},_.values=h,d.prototype={constructor:d,reset:function(t){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(D),!t)for(var e in this)e.charAt(0)==="t"&&f.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n($,K){return c.type="throw",c.arg=t,e.next=$,K&&(e.method="next",e.arg=void 0),!!K}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if(i.tryLoc==="root")return n("end");if(i.tryLoc<=this.prev){var g=f.call(i,"catchLoc"),M=f.call(i,"finallyLoc");if(g&&M){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(g){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&f.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(c)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),D(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if(o.type==="throw"){var i=o.arg;D(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:h(t),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=void 0),y}},_}var q=function(p){var f=p.shixunsDetail,E=p.globalSetting,v=p.loading,C=p.user,b=p.dispatch,F=Object(rt.a)(p,["shixunsDetail","globalSetting","loading","user","dispatch"]),l=Object(P.l)(),L=Object(U.useState)({}),T=Object(A.a)(L,2),y=T[0],s=T[1],I=Object(U.useRef)(),m=Object(U.useRef)(),z=R.a.useForm(),w=Object(A.a)(z,1),j=w[0],x=Object(U.useState)(""),tt=Object(A.a)(x,2),B=tt[0],nt=tt[1];Object(U.useEffect)(function(){return b({type:"globalSetting/footerToggle",payload:!1}),function(){b({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(U.useEffect)(function(){var D=sessionStorage.getItem("pathArray");if(D){var d=D.split(",").join("/"),h=d.indexOf("/")===0?d.substr(1):d;nt(h)}},[]),Object(U.useEffect)(function(){var D,d,h,r;m.current=(D=l.pathname)===null||D===void 0||((d=D.split("/"))===null||d===void 0)?void 0:d[2],I.current=((h=l.pathname)===null||h===void 0||((r=h.split("/"))===null||r===void 0)?void 0:r[3])==="repository"},[]);var at=function(){var D=Object(G.a)(N().mark(function d(){var h,r,t,e=arguments;return N().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return h=e.length>0&&e[0]!==void 0?e[0]:{},o.next=3,b({type:"shixunsDetail/addRepositoryFile",payload:{id:m.current,message:h.commitMessage,content:h.codeMirror,path:"".concat(B?"".concat(B,"/"):"").concat(h.path||""),secret_repository:I.current?void 0:!0}});case 3:r=o.sent,r&&(t=I.current?"/shixuns/".concat(m.current,"/repository").concat(B?"/master/shixun_show/".concat(B):""):"/shixuns/".concat(m.current,"/secret_repository"),O.c.replace(t));case 5:case"end":return o.stop()}},d)}));return function(){return D.apply(this,arguments)}}(),ot=function(){var d,h;O.c.push("/shixuns/".concat(m.current,"/").concat((d=l.pathname)===null||d===void 0||((h=d.split("/"))===null||h===void 0)?void 0:h[3]).concat(B?"/master/shixun_show/".concat(B):""))};return u.a.createElement("section",{className:W.a.bg},u.a.createElement("div",{className:W.a.wrap},u.a.createElement("div",{className:W.a.title},"\u65B0\u5EFA\u6587\u4EF6"),u.a.createElement(R.a,{className:"mt10",form:j,scrollToFirstError:!0,layout:"vertical",onFinish:at,onValuesChange:function(){return s(Object(Q.a)({},j.getFieldsValue()))}},u.a.createElement(R.a.Item,{label:"\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84\uFF1A"},u.a.createElement(R.a.Item,{name:"path",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}],noStyle:!0},u.a.createElement("span",null,u.a.createElement("span",{className:"mr5"},B?"".concat(B,"/"):""),u.a.createElement(H.a,{className:W.a.width240,placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"}))),u.a.createElement("span",{className:"ml5"},"\u63D0\u793A\uFF1A1.\u8F93\u5165\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u4E00\u4E2A\u65B0\u6587\u4EF6\uFF1B2.\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u540D/\u65B0\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u65B0\u6587\u4EF6\u5939\u548C\u65B0\u6587\u4EF6\u3002\uFF08\u5982\uFF1Astep1/HelloWorld.java\uFF09")),u.a.createElement(R.a.Item,{label:"\u63D0\u4EA4\u4FE1\u606F\uFF1A",name:"commitMessage",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63D0\u4EA4\u4FE1\u606F"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},u.a.createElement(H.a,{placeholder:"\u8BF7\u8F93\u5165\u672C\u6B21\u63D0\u4EA4\u7684\u4E3B\u8981\u4FE1\u606F\uFF0C\u5408\u7406\u7684\u63CF\u8FF0\u4FE1\u606F\u6709\u5229\u4E8E\u4EE3\u7801\u5386\u53F2\u8BB0\u5F55\u7684\u7BA1\u7406"})),u.a.createElement("div",{className:"mt10 mb20"},u.a.createElement(R.a.Item,{name:"codeMirror",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5185\u5BB9"}]},u.a.createElement(Y.a,{options:{modal:"javascript",lineNumbers:!0,theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:{"Alt-/":"autocomplete"},autofocus:!0,styleActiveLine:!0,lint:!0,linkurl:"",gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}}))),u.a.createElement(R.a.Item,{noStyle:!0},u.a.createElement(Z.a,{okButtonProps:{htmlType:"submit"},onCancel:ot})))))};S.default=Object(O.a)(function(_){var p=_.shixunsDetail,f=_.loading,E=_.globalSetting,v=_.user;return{shixunsDetail:p,globalSetting:E,user:v,loading:f.models.index}})(q)},y37m:function(V,S,a){V.exports={bg:"bg___3LF6r",wrap:"wrap___2G3Cw",title:"title___1RMLx",path:"path___25SE5",colorBlue:"colorBlue___1sALU",width240:"width240___3YXUs"}}}]);