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