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

1 line
15 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[176],{"7ahc":function(t,e,r){"use strict";r.d(e,"a",(function(){return v}));var n=r("k1fw"),a=r("0Owb"),o=(r("+L6B"),r("2/Rp")),i=(r("y8nQ"),r("Vl3Y")),c=r("tJVT"),l=(r("OaEy"),r("2fM7")),s=r("q1tI"),u=r.n(s),f=r("VrN/"),h=r.n(f),p=(r("p77/"),r("c5Ni"),l["a"].Option),m={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};function v(t){var e=t.value,r=t.onChange,a=t.mode,o=t.options,i=void 0===o?{}:o,l=Object(s["useRef"])(),f=Object(s["useState"])(),p=Object(c["a"])(f,2),m=p[0],d=p[1];return Object(s["useEffect"])((function(){if(m){var t=function(t){var e=t.getValue();r&&r(e)};return m.on("change",t),function(){m.off("change",t)}}}),[m,r]),Object(s["useEffect"])((function(){m&&m.setOption("mode",a)}),[m,a]),Object(s["useEffect"])((function(){m&&(e===m.getValue()&&""!==e||setTimeout((function(){m.setValue(e||" ")}),300))}),[m,e]),Object(s["useEffect"])((function(){if(l.current&&!m){var t=h.a.fromTextArea(l.current,Object(n["a"])({mode:a,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},i));d(t)}}),[l.current,m]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}e["b"]=function(t){var e=t.callback,r=t.onCancel,n=Object(s["useState"])("python"),f=Object(c["a"])(n,2),h=f[0],y=f[1];function g(t){y(d[t][1])}function b(t){e(t)}return u.a.createElement(i["a"],Object(a["a"])({},m,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),u.a.createElement(i["a"].Item,{label:"\u4ee3\u7801\u8bed\u8a00",name:"language"},u.a.createElement(l["a"],{onChange:g},Object.keys(d).map((function(t){return u.a.createElement(p,{key:t,value:t},d[t][0])})))),u.a.createElement(i["a"].Item,{label:"\u4ee3\u7801\u5185\u5bb9",name:"content",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u4ee3\u7801\u5185\u5bb9"}]},u.a.createElement(v,{mode:h})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(o["a"],{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786e\u5b9a"),u.a.createElement(o["a"],{type:"ghost",onClick:r},"\u53d6\u6d88")))}},"9ZNV":function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r("0Owb"),a=(r("+L6B"),r("2/Rp")),o=r("q1tI"),i=r.n(o),c=r("UUDw"),l=r.n(c),s=r("TSYQ"),u=r.n(s),f=function(t){var e=t.cancelText,r=void 0===e?"\u53d6\u6d88":e,o=t.okText,c=void 0===o?"\u786e\u5b9a":o,s=t.loading,f=void 0!==s&&s,h=t.hasOkBtn,p=void 0===h||h,m=t.okButtonProps,d=void 0===m?{}:m,v=t.onCancel,y=void 0===v?function(){}:v,g=t.onOk,b=void 0===g?function(){}:g,w=t.className,E=void 0===w?"":w;return i.a.createElement("div",{className:u()(l.a.buttonFixed,E)},i.a.createElement("div",{className:l.a.buttonWrap},i.a.createElement(a["a"],{size:"large",className:"".concat(l.a.button," mr20"),onClick:y},r),p&&i.a.createElement(a["a"],Object(n["a"])({size:"large",type:"primary",className:"".concat(l.a.button," mr20"),loading:f,onClick:b},d),c)))}},UUDw:function(t,e,r){t.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},baNF:function(t,e,r){"use strict";r.r(e);r("5NDa");var n=r("5rEg"),a=r("k1fw"),o=r("9og8"),i=(r("y8nQ"),r("Vl3Y")),c=r("tJVT"),l=r("PpiC"),s=r("q1tI"),u=r.n(s),f=r("Ty5D"),h=r("9kvl"),p=r("7ahc"),m=r("9ZNV"),d=r("y37m"),v=r.n(d);function y(){y=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:L(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",p="suspendedYield",m="executing",d="completed",v={};function g(){}function b(){}function w(){}var E={};s(E,i,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(F([])));O&&O!==r&&n.call(O,i)&&(E=O);var j=w.prototype=g.prototype=Object.create(E);function _(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(a,o,i,c){var l=f(t[a],t,o);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(u).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function L(e,r,n){var a=h;return function(o,i){if(a===m)throw new Error("Generator is already running");if(a===d){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var l=S(c,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var s=f(e,r,n);if("normal"===s.type){if(a=n.done?d:p,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=d,n.method="throw",n.arg=s.arg)}}}function S(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function N(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=w,a(j,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:b,configurable:!0}),b.displayName=s(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,s(t,l,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(k.prototype),s(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new k(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),s(j,l,"Generator"),s(j,i,(function(){return this})),s(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=F,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}var g=function(t){t.shixunsDetail,t.globalSetting,t.loading,t.user;var e=t.dispatch,r=(Object(l["a"])(t,["shixunsDetail","globalSetting","loading","user","dispatch"]),Object(f["l"])()),d=Object(s["useState"])({}),g=Object(c["a"])(d,2),b=(g[0],g[1]),w=Object(s["useRef"])(),E=Object(s["useRef"])(),x=i["a"].useForm(),O=Object(c["a"])(x,1),j=O[0],_=Object(s["useState"])(""),k=Object(c["a"])(_,2),L=k[0],S=k[1];Object(s["useEffect"])((function(){return e({type:"globalSetting/footerToggle",payload:!1}),function(){e({type:"globalSetting/footerToggle",payload:!0})}}),[]),Object(s["useEffect"])((function(){var t=sessionStorage.getItem("pathArray");if(t){var e=t.split(",").join("/"),r=0===e.indexOf("/")?e.substr(1):e;S(r)}}),[]),Object(s["useEffect"])((function(){var t,e,n,a;E.current=null===(t=r.pathname)||void 0===t||null===(e=t.split("/"))||void 0===e?void 0:e[2],w.current="repository"===(null===(n=r.pathname)||void 0===n||null===(a=n.split("/"))||void 0===a?void 0:a[3])}),[]);var N=function(){var t=Object(o["a"])(y().mark((function t(){var r,n,a,o=arguments;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,e({type:"shixunsDetail/addRepositoryFile",payload:{id:E.current,message:r.commitMessage,content:r.codeMirror,path:"".concat(L?"".concat(L,"/"):"").concat(r.path||""),secret_repository:!w.current||void 0}});case 3:n=t.sent,n&&(a=w.current?"/shixuns/".concat(E.current,"/repository").concat(L?"/master/shixun_show/".concat(L):""):"/shixuns/".concat(E.current,"/secret_repository"),h["c"].replace(a));case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),C=function(){var t,e;h["c"].push("/shixuns/".concat(E.current,"/").concat(null===(t=r.pathname)||void 0===t||null===(e=t.split("/"))||void 0===e?void 0:e[3]).concat(L?"/master/shixun_show/".concat(L):""))};return u.a.createElement("section",{className:v.a.bg},u.a.createElement("div",{className:v.a.wrap},u.a.createElement("div",{className:v.a.title},"\u65b0\u5efa\u6587\u4ef6"),u.a.createElement(i["a"],{className:"mt10",form:j,scrollToFirstError:!0,layout:"vertical",onFinish:N,onValuesChange:function(){return b(Object(a["a"])({},j.getFieldsValue()))}},u.a.createElement(i["a"].Item,{label:"\u6587\u4ef6\u540d\u79f0\u6216\u6587\u4ef6\u8def\u5f84\uff1a"},u.a.createElement(i["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"},L?"".concat(L,"/"):""),u.a.createElement(n["a"],{className:v.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(i["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(n["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(i["a"].Item,{name:"codeMirror",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u6587\u4ef6\u5185\u5bb9"}]},u.a.createElement(p["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(i["a"].Item,{noStyle:!0},u.a.createElement(m["a"],{okButtonProps:{htmlType:"submit"},onCancel:C})))))};e["default"]=Object(h["a"])((function(t){var e=t.shixunsDetail,r=t.loading,n=t.globalSetting,a=t.user;return{shixunsDetail:e,globalSetting:n,user:a,loading:r.models.index}}))(g)},y37m:function(t,e,r){t.exports={bg:"bg___3LF6r",wrap:"wrap___2G3Cw",title:"title___1RMLx",path:"path___25SE5",colorBlue:"colorBlue___1sALU",width240:"width240___3YXUs"}}}]);