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