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
23 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[178,12,14],{"8j3D":function(t,e,r){"use strict";r("2qtc");var n=r("kLXV"),a=(r("5NDa"),r("5rEg")),o=(r("miYZ"),r("tsqr")),i=r("k1fw"),c=r("9og8"),u=(r("y8nQ"),r("Vl3Y")),l=r("tJVT"),s=r("q1tI"),f=r.n(s),h=r("Ty5D"),p=r("9kvl"),v=r("KVXO"),d=r.n(v);function m(){m=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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(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:k(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=s;var h="suspendedStart",p="suspendedYield",v="executing",d="completed",y={};function g(){}function b(){}function w(){}var E={};l(E,i,(function(){return this}));var x=Object.getPrototypeOf,j=x&&x(x(P([])));j&&j!==r&&n.call(j,i)&&(E=j);var O=w.prototype=g.prototype=Object.create(E);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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 k(e,r,n){var a=h;return function(o,i){if(a===v)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 u=N(c,n);if(u){if(u===y)continue;return u}}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=v;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?d:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=d,n.method="throw",n.arg=l.arg)}}}function N(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,N(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;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,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}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 F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function P(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(O,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:b,configurable:!0}),b.displayName=l(w,u,"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,l(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(L.prototype),l(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new L(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(O),l(O,u,"Generator"),l(O,i,(function(){return this})),l(O,"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=P,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(F),!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 u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)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,y):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),y},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),F(r),y}},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;F(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}var y=function(t){var e=t.shixunsDetail,r=(t.globalSetting,t.loading,t.dispatch),p=t.title,v=t.pathList,y=void 0===v?[]:v,g=t.showInputPath,b=void 0!==g&&g,w=t.isMergeSelectFile,E=void 0!==w&&w,x=t.onFinish,j=void 0===x?function(){}:x,O=u["a"].useForm(),_=Object(l["a"])(O,1),L=_[0],k=Object(h["m"])(),N=Object(h["l"])(),S=Object(s["useRef"])(),F=Object(s["useState"])(""),T=Object(l["a"])(F,2),P=T[0],D=T[1],G=Object(s["useState"])(""),V=Object(l["a"])(G,2),I=V[0],C=V[1],B=Object(s["useState"])([]),R=Object(l["a"])(B,2),q=R[0],Y=R[1],A=Object(s["useState"])([]),M=Object(l["a"])(A,2),W=M[0],Z=M[1];Object(s["useEffect"])((function(){var t,e;S.current="repository"===(null===(t=N.pathname)||void 0===t||null===(e=t.split("/"))||void 0===e?void 0:e[3])}),[]),Object(s["useEffect"])((function(){if("Repository-SelectFilePath"===e.actionTabs.key){var t=y.join("/"),r=[];y.map((function(e,n){0===n?r.push({val:"\u6839\u76ee\u5f55",path:""},{val:"/".concat(e),path:t}):r.push({val:"/".concat(e),path:t})})),Y(r),D(t),C(t),J(t)}}),[e.actionTabs.key]);var J=function(){var t=Object(c["a"])(m().mark((function t(e){var n;return m().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r({type:S.current?"shixunsDetail/getRepository":"shixunsDetail/getSecretRepository",payload:{id:k.id,path:e}});case 2:n=t.sent,n&&Z(n.trees||[]);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),U=function(t){var e=P;"tree"===t.type&&(q.length?q.push({val:"/".concat(t.name),path:t.name}):q.push({val:"\u6839\u76ee\u5f55",path:""},{val:"/".concat(t.name),path:t.name}),Y(q),e=P?"".concat(P,"/").concat(t.name):t.name,D(e)),J(e)},X=function(t,e){var r=q.filter((function(t,r){return r<=e}));Y(r);var n=r.filter((function(t,e){return 0!==e})).map((function(t){return t.val})).join("").substr(1);D(n),J(n)},z=function(){var t=Object(c["a"])(m().mark((function t(){var e,n,a;return m().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e=null===L||void 0===L?void 0:L.getFieldsValue(),n=P?"".concat(P).concat((null===e||void 0===e?void 0:e.name)?"/".concat(null===e||void 0===e?void 0:e.name):""):null===e||void 0===e?void 0:e.name,!E){t.next=6;break}return j(n),Q(),t.abrupt("return");case 6:if(!b){t.next=16;break}return t.next=9,L.validateFields();case 9:return t.next=11,r({type:"shixunsDetail/uploadGitFolder",payload:Object(i["a"])(Object(i["a"])({},{id:k.id,path:n}),S.current?{}:{secret_repository:!0})});case 11:a=t.sent,j(I),0===a.status&&o["b"].info("\u65b0\u5efa\u6210\u529f"),t.next=18;break;case 16:j(n),o["b"].success("\u9009\u62e9\u6587\u4ef6\u76ee\u5f55\u6210\u529f");case 18:Q();case 19:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Q=function(){r({type:"shixunsDetail/setActionTabs",payload:{}}),L.resetFields()};return f.a.createElement(n["a"],{centered:!0,title:p||"\u65b0\u5efa\u6587\u4ef6\u5939",closable:!1,keyboard:!1,visible:"Repository-SelectFilePath"===e.actionTabs.key,onOk:z,onCancel:Q},f.a.createElement("div",{className:d.a.wrap},f.a.createElement("div",{className:d.a.content},f.a.createElement("div",{className:d.a.mainPathWrap},!!(null===q||void 0===q?void 0:q.length)&&q.map((function(t,e){return f.a.createElement("a",{key:e,onClick:function(){return X(t,e)}},t.val)}))),!!(null===W||void 0===W?void 0:W.length)&&W.map((function(t,e){return"tree"===t.type&&f.a.createElement("a",{key:e,onClick:function(){return U(t)}},f.a.createElement("i",{className:"iconfont icon-wenjianjia ".concat(d.a.colorBlue)}),t.name)}))),f.a.createElement("label",{className:"mt5"},"\u9009\u4e2d\u7684\u65b0\u5efa\u6587\u4ef6\u5939\u76ee\u5f55\uff1a"),f.a.createElement("div",{className:"mt5 mb5"},P),b&&f.a.createElement(u["a"],{form:L,scrollToFirstError:!0,className:"mt20"},f.a.createElement(u["a"].Item,{name:"name",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u540d\u79f0"},{whitespace:!0,message:"\u8bf7\u52ff\u8f93\u5165\u7a7a\u683c"}]},f.a.createElement(a["a"],{placeholder:"\u8bf7\u8f93\u5165\u65b0\u6587\u4ef6\u5939\u540d/\u5b50\u6587\u4ef6\u5939\u540d\u3002\uff08\u5982\uff1asrc/step1\uff09"})))))};e["a"]=Object(p["a"])((function(t){var e=t.shixunsDetail,r=t.loading,n=t.globalSetting;return{shixunsDetail:e,globalSetting:n,loading:r.models.index}}))(y)},"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"),u=r.n(c),l=r("TSYQ"),s=r.n(l),f=function(t){var e=t.cancelText,r=void 0===e?"\u53d6\u6d88":e,o=t.okText,c=void 0===o?"\u786e\u5b9a":o,l=t.loading,f=void 0!==l&&l,h=t.hasOkBtn,p=void 0===h||h,v=t.okButtonProps,d=void 0===v?{}:v,m=t.onCancel,y=void 0===m?function(){}:m,g=t.onOk,b=void 0===g?function(){}:g,w=t.className,E=void 0===w?"":w;return i.a.createElement("div",{className:s()(u.a.buttonFixed,E)},i.a.createElement("div",{className:u.a.buttonWrap},i.a.createElement(a["a"],{size:"large",className:"".concat(u.a.button," mr20"),onClick:y},r),p&&i.a.createElement(a["a"],Object(n["a"])({size:"large",type:"primary",className:"".concat(u.a.button," mr20"),loading:f,onClick:b},d),c)))}},EltS:function(t,e,r){t.exports={bg:"bg___1gNTl",wrap:"wrap___1HQ7F",title:"title___rglue",path:"path___1PX8G",colorBlue:"colorBlue___2CKCu"}},KVXO:function(t,e,r){t.exports={wrap:"wrap___1VfLE",content:"content___20B4M",mainPathWrap:"mainPathWrap___3qDeg",colorBlue:"colorBlue___2ZjUq"}},UUDw:function(t,e,r){t.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},wXW8:function(t,e,r){"use strict";r.r(e);r("5NDa");var n=r("5rEg"),a=r("k1fw"),o=r("9og8"),i=(r("miYZ"),r("tsqr")),c=(r("y8nQ"),r("Vl3Y")),u=r("tJVT"),l=r("PpiC"),s=(r("DZo9"),r("8z0m")),f=r("q1tI"),h=r.n(f),p=r("Ty5D"),v=r("9kvl"),d=r("m3rI"),m=r("9ZNV"),y=r("8j3D"),g=r("EltS"),b=r.n(g);function w(){w=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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:k(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=s;var h="suspendedStart",p="suspendedYield",v="executing",d="completed",m={};function y(){}function g(){}function b(){}var E={};l(E,i,(function(){return this}));var x=Object.getPrototypeOf,j=x&&x(x(P([])));j&&j!==r&&n.call(j,i)&&(E=j);var O=b.prototype=y.prototype=Object.create(E);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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 k(e,r,n){var a=h;return function(o,i){if(a===v)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 u=N(c,n);if(u){if(u===m)continue;return u}}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=v;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?d:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=d,n.method="throw",n.arg=l.arg)}}}function N(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,N(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;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,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}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 F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function P(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 g.prototype=b,a(O,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(L.prototype),l(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new L(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(O),l(O,u,"Generator"),l(O,i,(function(){return this})),l(O,"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=P,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(F),!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 u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)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,m):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),m},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),F(r),m}},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;F(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}var E=s["a"].Dragger,x=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(p["l"])()),s=Object(f["useState"])({}),g=Object(u["a"])(s,2),x=g[0],j=g[1],O=Object(f["useRef"])(),_=Object(f["useRef"])(),L=c["a"].useForm(),k=Object(u["a"])(L,1),N=k[0],S=Object(f["useState"])([]),F=Object(u["a"])(S,2),T=F[0],P=F[1],D=Object(f["useState"])(),G=Object(u["a"])(D,2),V=G[0],I=G[1];Object(f["useEffect"])((function(){return e({type:"globalSetting/footerToggle",payload:!1}),function(){e({type:"globalSetting/footerToggle",payload:!0})}}),[]),Object(f["useEffect"])((function(){var t,e,n,a;_.current=null===(t=r.pathname)||void 0===t||null===(e=t.split("/"))||void 0===e?void 0:e[2],O.current="repository"===(null===(n=r.pathname)||void 0===n||null===(a=n.split("/"))||void 0===a?void 0:a[3])}),[]),Object(f["useEffect"])((function(){var t=sessionStorage.getItem("pathArray");if(t){var e=t.split(",").join("/"),r=0===e.indexOf("/")?e.substr(1):e;I(r)}}),[]);var C=function(t){if("done"===t.file.status||"uploading"===t.file.status){var e,r,n;if(P(t.fileList),!t.file.response)return;if(0===(null===(e=t.file.response)||void 0===e?void 0:e.status))return void i["b"].success("\u4e0a\u4f20\u6210\u529f\uff01");P(T.filter((function(e){return e.uid!==t.file.uid}))),(null===(r=t.file.response)||void 0===r?void 0:r.message)&&i["b"].info(null===(n=t.file.response)||void 0===n?void 0:n.message)}},B=function(){var t=Object(o["a"])(w().mark((function t(r){var n;return w().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r.response){t.next=3;break}return i["b"].info("\u8fd8\u672a\u4e0a\u4f20\u5b8c\u6210\uff0c\u65e0\u6cd5\u8fdb\u884c\u5220\u9664\u64cd\u4f5c\uff01"),t.abrupt("return");case 3:if(N.getFieldValue("commitMessage")){t.next=6;break}return i["b"].info("\u5220\u9664\u6587\u4ef6\u8bf7\u5148\u586b\u5199\u63d0\u4ea4\u4fe1\u606f"),t.abrupt("return");case 6:return t.next=8,e({type:"shixunsDetail/deleteGitFile",payload:{id:_.current,path:V?"".concat(V,"/").concat(r.name):r.name,message:N.getFieldValue("commitMessage"),secret_repository:!O.current||null}});case 8:n=t.sent,0===n.status&&(P(T.filter((function(t){return t.uid!==r.uid}))),i["b"].info("\u5220\u9664\u6210\u529f"));case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),R={height:300,multiple:!0,withCredentials:!0,data:Object(a["a"])(Object(a["a"])({},{path:V||"",message:x.commitMessage}),O.current?{}:{secret_repository:!0}),fileList:T,method:"post",action:"".concat(d["a"].API_SERVER,"/api/shixuns/").concat(_.current,"/upload_git_file.json"),onChange:C,onRemove:B,beforeUpload:function(t){if(!N.getFieldValue("commitMessage"))return i["b"].info("\u4e0a\u4f20\u6587\u4ef6\u8bf7\u5148\u586b\u5199\u63d0\u4ea4\u4fe1\u606f"),!1}},q=function(t){Y()},Y=function(){var t,e;v["c"].push("/shixuns/".concat(_.current,"/").concat(null===(t=r.pathname)||void 0===t||null===(e=t.split("/"))||void 0===e?void 0:e[3]).concat(V?"/master/shixun_show/".concat(V):""))};return h.a.createElement("section",{className:b.a.bg},h.a.createElement("div",{className:b.a.wrap},h.a.createElement("div",{className:b.a.title},"\u4e0a\u4f20\u6587\u4ef6"),h.a.createElement("div",{className:b.a.path},"\u5f53\u524d\u76ee\u5f55\uff1a/",V,h.a.createElement("span",{className:"".concat(b.a.colorBlue," current ml5"),onClick:function(){e({type:"shixunsDetail/setActionTabs",payload:{key:"Repository-SelectFilePath"}})}},"\u9009\u62e9\u6587\u4ef6\u76ee\u5f55")),h.a.createElement(c["a"],{className:"mt10",form:N,scrollToFirstError:!0,layout:"vertical",onFinish:q,onValuesChange:function(){return j(Object(a["a"])({},N.getFieldsValue()))}},h.a.createElement(c["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"}]},h.a.createElement(n["a"],{placeholder:"\u5fc5\u586b\uff0c\u63cf\u8ff0\u4e3b\u8981\u4fee\u6539\u5185\u5bb9\uff08\u76f8\u5f53\u4e8eGit Commit message\u7684Header\uff09"})),h.a.createElement(c["a"].Item,{noStyle:!0},h.a.createElement(m["a"],{okButtonProps:{htmlType:"submit"},onCancel:Y}))),h.a.createElement(E,R,h.a.createElement("div",null,h.a.createElement("i",{className:"iconfont icon-shangchuan font50 ".concat(b.a.colorBlue)})),h.a.createElement("div",{className:"font14 mt30"},"\u62d6\u62fd\u6587\u4ef6\u6216",h.a.createElement("span",{className:"".concat(b.a.colorBlue," ml5")},"\u70b9\u51fb\u6b64\u5904\u4e0a\u4f20")))),h.a.createElement(y["a"],{onFinish:function(t){return I(t)}}))};e["default"]=Object(v["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}}))(x)}}]);