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

(window.webpackJsonp=window.webpackJsonp||[]).push([[182,14],{"8j3D":function(rt,z,c){"use strict";var pt=c("2qtc"),ft=c("kLXV"),ot=c("5NDa"),mt=c("5rEg"),lt=c("miYZ"),Z=c("tsqr"),nt=c("k1fw"),Q=c("9og8"),it=c("y8nQ"),ut=c("Vl3Y"),st=c("tJVT"),R=c("q1tI"),E=c.n(R),b=c("Ty5D"),ct=c("9kvl"),_t=c("KVXO"),H=c.n(_t);function q(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */q=function(){return D};var D={},y=Object.prototype,U=y.hasOwnProperty,x=Object.defineProperty||function(s,r,a){s[r]=a.value},at=typeof Symbol=="function"?Symbol:{},v=at.iterator||"@@iterator",C=at.asyncIterator||"@@asyncIterator",L=at.toStringTag||"@@toStringTag";function g(s,r,a){return Object.defineProperty(s,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),s[r]}try{g({},"")}catch(s){g=function(a,l,_){return a[l]=_}}function G(s,r,a,l){var _=r&&r.prototype instanceof J?r:J,t=Object.create(_.prototype),e=new W(l||[]);return x(t,"_invoke",{value:tt(s,a,e)}),t}function V(s,r,a){try{return{type:"normal",arg:s.call(r,a)}}catch(l){return{type:"throw",arg:l}}}D.wrap=G;var M={};function J(){}function P(){}function B(){}var $={};g($,v,function(){return this});var F=Object.getPrototypeOf,w=F&&F(F(Y([])));w&&w!==y&&U.call(w,v)&&($=w);var T=B.prototype=J.prototype=Object.create($);function S(s){["next","throw","return"].forEach(function(r){g(s,r,function(a){return this._invoke(r,a)})})}function A(s,r){function a(_,t,e,n){var i=V(s[_],s,t);if(i.type!=="throw"){var o=i.arg,u=o.value;return u&&typeof u=="object"&&U.call(u,"__await")?r.resolve(u.__await).then(function(h){a("next",h,e,n)},function(h){a("throw",h,e,n)}):r.resolve(u).then(function(h){o.value=h,e(o)},function(h){return a("throw",h,e,n)})}n(i.arg)}var l;x(this,"_invoke",{value:function(t,e){function n(){return new r(function(i,o){a(t,e,i,o)})}return l=l?l.then(n,n):n()}})}function tt(s,r,a){var l="suspendedStart";return function(_,t){if(l==="executing")throw new Error("Generator is already running");if(l==="completed"){if(_==="throw")throw t;return et()}for(a.method=_,a.arg=t;;){var e=a.delegate;if(e){var n=j(e,a);if(n){if(n===M)continue;return n}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(l==="suspendedStart")throw l="completed",a.arg;a.dispatchException(a.arg)}else a.method==="return"&&a.abrupt("return",a.arg);l="executing";var i=V(s,r,a);if(i.type==="normal"){if(l=a.done?"completed":"suspendedYield",i.arg===M)continue;return{value:i.arg,done:a.done}}i.type==="throw"&&(l="completed",a.method="throw",a.arg=i.arg)}}}function j(s,r){var a=r.method,l=s.iterator[a];if(l===void 0)return r.delegate=null,a==="throw"&&s.iterator.return&&(r.method="return",r.arg=void 0,j(s,r),r.method==="throw")||a!=="return"&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+a+"' method")),M;var _=V(l,s.iterator,r.arg);if(_.type==="throw")return r.method="throw",r.arg=_.arg,r.delegate=null,M;var t=_.arg;return t?t.done?(r[s.resultName]=t.value,r.next=s.nextLoc,r.method!=="return"&&(r.method="next",r.arg=void 0),r.delegate=null,M):t:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,M)}function I(s){var r={tryLoc:s[0]};1 in s&&(r.catchLoc=s[1]),2 in s&&(r.finallyLoc=s[2],r.afterLoc=s[3]),this.tryEntries.push(r)}function N(s){var r=s.completion||{};r.type="normal",delete r.arg,s.completion=r}function W(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(I,this),this.reset(!0)}function Y(s){if(s){var r=s[v];if(r)return r.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var a=-1,l=function _(){for(;++a<s.length;)if(U.call(s,a))return _.value=s[a],_.done=!1,_;return _.value=void 0,_.done=!0,_};return l.next=l}}return{next:et}}function et(){return{value:void 0,done:!0}}return P.prototype=B,x(T,"constructor",{value:B,configurable:!0}),x(B,"constructor",{value:P,configurable:!0}),P.displayName=g(B,L,"GeneratorFunction"),D.isGeneratorFunction=function(s){var r=typeof s=="function"&&s.constructor;return!!r&&(r===P||(r.displayName||r.name)==="GeneratorFunction")},D.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,B):(s.__proto__=B,g(s,L,"GeneratorFunction")),s.prototype=Object.create(T),s},D.awrap=function(s){return{__await:s}},S(A.prototype),g(A.prototype,C,function(){return this}),D.AsyncIterator=A,D.async=function(s,r,a,l,_){_===void 0&&(_=Promise);var t=new A(G(s,r,a,l),_);return D.isGeneratorFunction(r)?t:t.next().then(function(e){return e.done?e.value:t.next()})},S(T),g(T,L,"Generator"),g(T,v,function(){return this}),g(T,"toString",function(){return"[object Generator]"}),D.keys=function(s){var r=Object(s),a=[];for(var l in r)a.push(l);return a.reverse(),function _(){for(;a.length;){var t=a.pop();if(t in r)return _.value=t,_.done=!1,_}return _.done=!0,_}},D.values=Y,W.prototype={constructor:W,reset:function(r){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(N),!r)for(var a in this)a.charAt(0)==="t"&&U.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=void 0)},stop:function(){this.done=!0;var r=this.tryEntries[0].completion;if(r.type==="throw")throw r.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var a=this;function l(o,u){return e.type="throw",e.arg=r,a.next=o,u&&(a.method="next",a.arg=void 0),!!u}for(var _=this.tryEntries.length-1;_>=0;--_){var t=this.tryEntries[_],e=t.completion;if(t.tryLoc==="root")return l("end");if(t.tryLoc<=this.prev){var n=U.call(t,"catchLoc"),i=U.call(t,"finallyLoc");if(n&&i){if(this.prev<t.catchLoc)return l(t.catchLoc,!0);if(this.prev<t.finallyLoc)return l(t.finallyLoc)}else if(n){if(this.prev<t.catchLoc)return l(t.catchLoc,!0)}else{if(!i)throw new Error("try statement without catch or finally");if(this.prev<t.finallyLoc)return l(t.finallyLoc)}}}},abrupt:function(r,a){for(var l=this.tryEntries.length-1;l>=0;--l){var _=this.tryEntries[l];if(_.tryLoc<=this.prev&&U.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var t=_;break}}t&&(r==="break"||r==="continue")&&t.tryLoc<=a&&a<=t.finallyLoc&&(t=null);var e=t?t.completion:{};return e.type=r,e.arg=a,t?(this.method="next",this.next=t.finallyLoc,M):this.complete(e)},complete:function(r,a){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&a&&(this.next=a),M},finish:function(r){for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a];if(l.finallyLoc===r)return this.complete(l.completion,l.afterLoc),N(l),M}},catch:function(r){for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a];if(l.tryLoc===r){var _=l.completion;if(_.type==="throw"){var t=_.arg;N(l)}return t}}throw new Error("illegal catch attempt")},delegateYield:function(r,a,l){return this.delegate={iterator:Y(r),resultName:a,nextLoc:l},this.method==="next"&&(this.arg=void 0),M}},D}var ht=function(y){var U=y.shixunsDetail,x=y.globalSetting,at=y.loading,v=y.dispatch,C=y.title,L=y.pathList,g=L===void 0?[]:L,G=y.showInputPath,V=G===void 0?!1:G,M=y.isMergeSelectFile,J=M===void 0?!1:M,P=y.onFinish,B=P===void 0?function(){}:P,$=ut.a.useForm(),F=Object(st.a)($,1),w=F[0],T=Object(b.m)(),S=Object(b.l)(),A=Object(R.useRef)(),tt=Object(R.useState)(""),j=Object(st.a)(tt,2),I=j[0],N=j[1],W=Object(R.useState)(""),Y=Object(st.a)(W,2),et=Y[0],s=Y[1],r=Object(R.useState)([]),a=Object(st.a)(r,2),l=a[0],_=a[1],t=Object(R.useState)([]),e=Object(st.a)(t,2),n=e[0],i=e[1];Object(R.useEffect)(function(){var m,d;A.current=((m=S.pathname)===null||m===void 0||((d=m.split("/"))===null||d===void 0)?void 0:d[3])==="repository"},[]),Object(R.useEffect)(function(){if(U.actionTabs.key!=="Repository-SelectFilePath")return;var m=g.join("/"),d=[];g.map(function(f,k){k===0?d.push({val:"\u6839\u76EE\u5F55",path:""},{val:"/".concat(f),path:m}):d.push({val:"/".concat(f),path:m})}),_(d),N(m),s(m),o(m)},[U.actionTabs.key]);var o=function(){var m=Object(Q.a)(q().mark(function d(f){var k;return q().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,v({type:A.current?"shixunsDetail/getRepository":"shixunsDetail/getSecretRepository",payload:{id:T.id,path:f}});case 2:k=X.sent,k&&i(k.trees||[]);case 4:case"end":return X.stop()}},d)}));return function(f){return m.apply(this,arguments)}}(),u=function(d){var f=I;d.type==="tree"&&(l.length?l.push({val:"/".concat(d.name),path:d.name}):l.push({val:"\u6839\u76EE\u5F55",path:""},{val:"/".concat(d.name),path:d.name}),_(l),f=I?"".concat(I,"/").concat(d.name):d.name,N(f)),o(f)},h=function(d,f){var k=l.filter(function(X,K){return K<=f});_(k);var dt=k.filter(function(X,K){return K!==0}).map(function(X){return X.val}).join("").substr(1);N(dt),o(dt)},O=function(){var m=Object(Q.a)(q().mark(function d(){var f,k,dt;return q().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:if(f=w==null?void 0:w.getFieldsValue(),k=I?"".concat(I).concat((f==null?void 0:f.name)?"/".concat(f==null?void 0:f.name):""):f==null?void 0:f.name,!J){K.next=6;break}return B(k),p(),K.abrupt("return");case 6:if(!V){K.next=16;break}return K.next=9,w.validateFields();case 9:return K.next=11,v({type:"shixunsDetail/uploadGitFolder",payload:Object(nt.a)(Object(nt.a)({},{id:T.id,path:k}),A.current?{}:{secret_repository:!0})});case 11:dt=K.sent,B(et),dt.status===0&&Z.b.info("\u65B0\u5EFA\u6210\u529F"),K.next=18;break;case 16:B(k),Z.b.success("\u9009\u62E9\u6587\u4EF6\u76EE\u5F55\u6210\u529F");case 18:p();case 19:case"end":return K.stop()}},d)}));return function(){return m.apply(this,arguments)}}(),p=function(){v({type:"shixunsDetail/setActionTabs",payload:{}}),w.resetFields()};return E.a.createElement(ft.a,{centered:!0,title:C||"\u65B0\u5EFA\u6587\u4EF6\u5939",closable:!1,keyboard:!1,visible:U.actionTabs.key==="Repository-SelectFilePath",onOk:O,onCancel:p},E.a.createElement("div",{className:H.a.wrap},E.a.createElement("div",{className:H.a.content},E.a.createElement("div",{className:H.a.mainPathWrap},!!(l==null?void 0:l.length)&&l.map(function(m,d){return E.a.createElement("a",{key:d,onClick:function(){return h(m,d)}},m.val)})),!!(n==null?void 0:n.length)&&n.map(function(m,d){return m.type==="tree"&&E.a.createElement("a",{key:d,onClick:function(){return u(m)}},E.a.createElement("i",{className:"iconfont icon-wenjianjia ".concat(H.a.colorBlue)}),m.name)})),E.a.createElement("label",{className:"mt5"},"\u9009\u4E2D\u7684\u65B0\u5EFA\u6587\u4EF6\u5939\u76EE\u5F55\uFF1A"),E.a.createElement("div",{className:"mt5 mb5"},I),V&&E.a.createElement(ut.a,{form:w,scrollToFirstError:!0,className:"mt20"},E.a.createElement(ut.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},E.a.createElement(mt.a,{placeholder:"\u8BF7\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u540D/\u5B50\u6587\u4EF6\u5939\u540D\u3002\uFF08\u5982\uFF1Asrc/step1\uFF09"})))))};z.a=Object(ct.a)(function(D){var y=D.shixunsDetail,U=D.loading,x=D.globalSetting;return{shixunsDetail:y,globalSetting:x,loading:U.models.index}})(ht)},"9ZNV":function(rt,z,c){"use strict";c.d(z,"a",function(){return ut});var pt=c("0Owb"),ft=c("+L6B"),ot=c("2/Rp"),mt=c("q1tI"),lt=c.n(mt),Z=c("UUDw"),nt=c.n(Z),Q=c("TSYQ"),it=c.n(Q),ut=function(R){var E=R.cancelText,b=E===void 0?"\u53D6\u6D88":E,ct=R.okText,_t=ct===void 0?"\u786E\u5B9A":ct,H=R.loading,q=H===void 0?!1:H,ht=R.hasOkBtn,D=ht===void 0?!0:ht,y=R.okButtonProps,U=y===void 0?{}:y,x=R.onCancel,at=x===void 0?function(){}:x,v=R.onOk,C=v===void 0?function(){}:v,L=R.className,g=L===void 0?"":L;return lt.a.createElement("div",{className:it()(nt.a.buttonFixed,g)},lt.a.createElement("div",{className:nt.a.buttonWrap},lt.a.createElement(ot.a,{size:"large",className:"".concat(nt.a.button," mr20"),onClick:at},b),D&&lt.a.createElement(ot.a,Object(pt.a)({size:"large",type:"primary",className:"".concat(nt.a.button," mr20"),loading:q,onClick:C},U),_t)))}},EltS:function(rt,z,c){rt.exports={bg:"bg___1gNTl",wrap:"wrap___1HQ7F",title:"title___rglue",path:"path___1PX8G",colorBlue:"colorBlue___2CKCu"}},KVXO:function(rt,z,c){rt.exports={wrap:"wrap___1VfLE",content:"content___20B4M",mainPathWrap:"mainPathWrap___3qDeg",colorBlue:"colorBlue___2ZjUq"}},UUDw:function(rt,z,c){rt.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},wXW8:function(rt,z,c){"use strict";c.r(z);var pt=c("5NDa"),ft=c("5rEg"),ot=c("k1fw"),mt=c("9og8"),lt=c("miYZ"),Z=c("tsqr"),nt=c("y8nQ"),Q=c("Vl3Y"),it=c("tJVT"),ut=c("PpiC"),st=c("DZo9"),R=c("8z0m"),E=c("q1tI"),b=c.n(E),ct=c("Ty5D"),_t=c("9kvl"),H=c("m3rI"),q=c("9ZNV"),ht=c("8j3D"),D=c("EltS"),y=c.n(D);function U(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */U=function(){return v};var v={},C=Object.prototype,L=C.hasOwnProperty,g=Object.defineProperty||function(t,e,n){t[e]=n.value},G=typeof Symbol=="function"?Symbol:{},V=G.iterator||"@@iterator",M=G.asyncIterator||"@@asyncIterator",J=G.toStringTag||"@@toStringTag";function P(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{P({},"")}catch(t){P=function(n,i,o){return n[i]=o}}function B(t,e,n,i){var o=e&&e.prototype instanceof w?e:w,u=Object.create(o.prototype),h=new a(i||[]);return g(u,"_invoke",{value:Y(t,n,h)}),u}function $(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(i){return{type:"throw",arg:i}}}v.wrap=B;var F={};function w(){}function T(){}function S(){}var A={};P(A,V,function(){return this});var tt=Object.getPrototypeOf,j=tt&&tt(tt(l([])));j&&j!==C&&L.call(j,V)&&(A=j);var I=S.prototype=w.prototype=Object.create(A);function N(t){["next","throw","return"].forEach(function(e){P(t,e,function(n){return this._invoke(e,n)})})}function W(t,e){function n(o,u,h,O){var p=$(t[o],t,u);if(p.type!=="throw"){var m=p.arg,d=m.value;return d&&typeof d=="object"&&L.call(d,"__await")?e.resolve(d.__await).then(function(f){n("next",f,h,O)},function(f){n("throw",f,h,O)}):e.resolve(d).then(function(f){m.value=f,h(m)},function(f){return n("throw",f,h,O)})}O(p.arg)}var i;g(this,"_invoke",{value:function(u,h){function O(){return new e(function(p,m){n(u,h,p,m)})}return i=i?i.then(O,O):O()}})}function Y(t,e,n){var i="suspendedStart";return function(o,u){if(i==="executing")throw new Error("Generator is already running");if(i==="completed"){if(o==="throw")throw u;return _()}for(n.method=o,n.arg=u;;){var h=n.delegate;if(h){var O=et(h,n);if(O){if(O===F)continue;return O}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(i==="suspendedStart")throw i="completed",n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);i="executing";var p=$(t,e,n);if(p.type==="normal"){if(i=n.done?"completed":"suspendedYield",p.arg===F)continue;return{value:p.arg,done:n.done}}p.type==="throw"&&(i="completed",n.method="throw",n.arg=p.arg)}}}function et(t,e){var n=e.method,i=t.iterator[n];if(i===void 0)return e.delegate=null,n==="throw"&&t.iterator.return&&(e.method="return",e.arg=void 0,et(t,e),e.method==="throw")||n!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),F;var o=$(i,t.iterator,e.arg);if(o.type==="throw")return e.method="throw",e.arg=o.arg,e.delegate=null,F;var u=o.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,F):u:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,F)}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 r(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function a(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(s,this),this.reset(!0)}function l(t){if(t){var e=t[V];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var n=-1,i=function o(){for(;++n<t.length;)if(L.call(t,n))return o.value=t[n],o.done=!1,o;return o.value=void 0,o.done=!0,o};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return T.prototype=S,g(I,"constructor",{value:S,configurable:!0}),g(S,"constructor",{value:T,configurable:!0}),T.displayName=P(S,J,"GeneratorFunction"),v.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===T||(e.displayName||e.name)==="GeneratorFunction")},v.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,P(t,J,"GeneratorFunction")),t.prototype=Object.create(I),t},v.awrap=function(t){return{__await:t}},N(W.prototype),P(W.prototype,M,function(){return this}),v.AsyncIterator=W,v.async=function(t,e,n,i,o){o===void 0&&(o=Promise);var u=new W(B(t,e,n,i),o);return v.isGeneratorFunction(e)?u:u.next().then(function(h){return h.done?h.value:u.next()})},N(I),P(I,J,"Generator"),P(I,V,function(){return this}),P(I,"toString",function(){return"[object Generator]"}),v.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function o(){for(;n.length;){var u=n.pop();if(u in e)return o.value=u,o.done=!1,o}return o.done=!0,o}},v.values=l,a.prototype={constructor:a,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(r),!e)for(var n in this)n.charAt(0)==="t"&&L.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function i(m,d){return h.type="throw",h.arg=e,n.next=m,d&&(n.method="next",n.arg=void 0),!!d}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],h=u.completion;if(u.tryLoc==="root")return i("end");if(u.tryLoc<=this.prev){var O=L.call(u,"catchLoc"),p=L.call(u,"finallyLoc");if(O&&p){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(O){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,n){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&L.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var u=o;break}}u&&(e==="break"||e==="continue")&&u.tryLoc<=n&&n<=u.finallyLoc&&(u=null);var h=u?u.completion:{};return h.type=e,h.arg=n,u?(this.method="next",this.next=u.finallyLoc,F):this.complete(h)},complete:function(e,n){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"&&n&&(this.next=n),F},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),r(i),F}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc===e){var o=i.completion;if(o.type==="throw"){var u=o.arg;r(i)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:l(e),resultName:n,nextLoc:i},this.method==="next"&&(this.arg=void 0),F}},v}var x=R.a.Dragger,at=function(C){var L=C.shixunsDetail,g=C.globalSetting,G=C.loading,V=C.user,M=C.dispatch,J=Object(ut.a)(C,["shixunsDetail","globalSetting","loading","user","dispatch"]),P=Object(ct.l)(),B=Object(E.useState)({}),$=Object(it.a)(B,2),F=$[0],w=$[1],T=Object(E.useRef)(),S=Object(E.useRef)(),A=Q.a.useForm(),tt=Object(it.a)(A,1),j=tt[0],I=Object(E.useState)([]),N=Object(it.a)(I,2),W=N[0],Y=N[1],et=Object(E.useState)(),s=Object(it.a)(et,2),r=s[0],a=s[1];Object(E.useEffect)(function(){return M({type:"globalSetting/footerToggle",payload:!1}),function(){M({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(E.useEffect)(function(){var i,o,u,h;S.current=(i=P.pathname)===null||i===void 0||((o=i.split("/"))===null||o===void 0)?void 0:o[2],T.current=((u=P.pathname)===null||u===void 0||((h=u.split("/"))===null||h===void 0)?void 0:h[3])==="repository"},[]),Object(E.useEffect)(function(){var i=sessionStorage.getItem("pathArray");if(i){var o=i.split(",").join("/"),u=o.indexOf("/")===0?o.substr(1):o;a(u)}},[]);var l=function(o){if(o.file.status==="done"||o.file.status==="uploading"){var u,h,O;if(Y(o.fileList),!o.file.response)return;if(((u=o.file.response)===null||u===void 0?void 0:u.status)===0){Z.b.success("\u4E0A\u4F20\u6210\u529F\uFF01");return}Y(W.filter(function(p){return p.uid!==o.file.uid})),((h=o.file.response)===null||h===void 0?void 0:h.message)&&Z.b.info((O=o.file.response)===null||O===void 0?void 0:O.message)}},_=function(){var i=Object(mt.a)(U().mark(function o(u){var h;return U().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(u.response){p.next=3;break}return Z.b.info("\u8FD8\u672A\u4E0A\u4F20\u5B8C\u6210\uFF0C\u65E0\u6CD5\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF01"),p.abrupt("return");case 3:if(j.getFieldValue("commitMessage")){p.next=6;break}return Z.b.info("\u5220\u9664\u6587\u4EF6\u8BF7\u5148\u586B\u5199\u63D0\u4EA4\u4FE1\u606F"),p.abrupt("return");case 6:return p.next=8,M({type:"shixunsDetail/deleteGitFile",payload:{id:S.current,path:r?"".concat(r,"/").concat(u.name):u.name,message:j.getFieldValue("commitMessage"),secret_repository:T.current?null:!0}});case 8:h=p.sent,h.status===0&&(Y(W.filter(function(m){return m.uid!==u.uid})),Z.b.info("\u5220\u9664\u6210\u529F"));case 10:case"end":return p.stop()}},o)}));return function(u){return i.apply(this,arguments)}}(),t={height:300,multiple:!0,withCredentials:!0,data:Object(ot.a)(Object(ot.a)({},{path:r||"",message:F.commitMessage}),T.current?{}:{secret_repository:!0}),fileList:W,method:"post",action:"".concat(H.a.API_SERVER,"/api/shixuns/").concat(S.current,"/upload_git_file.json"),onChange:l,onRemove:_,beforeUpload:function(o){if(!j.getFieldValue("commitMessage"))return Z.b.info("\u4E0A\u4F20\u6587\u4EF6\u8BF7\u5148\u586B\u5199\u63D0\u4EA4\u4FE1\u606F"),!1}},e=function(o){n()},n=function(){var o,u;_t.c.push("/shixuns/".concat(S.current,"/").concat((o=P.pathname)===null||o===void 0||((u=o.split("/"))===null||u===void 0)?void 0:u[3]).concat(r?"/master/shixun_show/".concat(r):""))};return b.a.createElement("section",{className:y.a.bg},b.a.createElement("div",{className:y.a.wrap},b.a.createElement("div",{className:y.a.title},"\u4E0A\u4F20\u6587\u4EF6"),b.a.createElement("div",{className:y.a.path},"\u5F53\u524D\u76EE\u5F55\uFF1A/",r,b.a.createElement("span",{className:"".concat(y.a.colorBlue," current ml5"),onClick:function(){M({type:"shixunsDetail/setActionTabs",payload:{key:"Repository-SelectFilePath"}})}},"\u9009\u62E9\u6587\u4EF6\u76EE\u5F55")),b.a.createElement(Q.a,{className:"mt10",form:j,scrollToFirstError:!0,layout:"vertical",onFinish:e,onValuesChange:function(){return w(Object(ot.a)({},j.getFieldsValue()))}},b.a.createElement(Q.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"}]},b.a.createElement(ft.a,{placeholder:"\u5FC5\u586B\uFF0C\u63CF\u8FF0\u4E3B\u8981\u4FEE\u6539\u5185\u5BB9\uFF08\u76F8\u5F53\u4E8EGit Commit message\u7684Header\uFF09"})),b.a.createElement(Q.a.Item,{noStyle:!0},b.a.createElement(q.a,{okButtonProps:{htmlType:"submit"},onCancel:n}))),b.a.createElement(x,t,b.a.createElement("div",null,b.a.createElement("i",{className:"iconfont icon-shangchuan font50 ".concat(y.a.colorBlue)})),b.a.createElement("div",{className:"font14 mt30"},"\u62D6\u62FD\u6587\u4EF6\u6216",b.a.createElement("span",{className:"".concat(y.a.colorBlue," ml5")},"\u70B9\u51FB\u6B64\u5904\u4E0A\u4F20")))),b.a.createElement(ht.a,{onFinish:function(o){return a(o)}}))};z.default=Object(_t.a)(function(v){var C=v.shixunsDetail,L=v.loading,g=v.globalSetting,G=v.user;return{shixunsDetail:C,globalSetting:g,user:G,loading:L.models.index}})(at)}}]);