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.
1 line
24 KiB
1 line
24 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[173],{"8j3D":function(t,e,r){"use strict";r("2qtc");var n=r("kLXV"),o=(r("5NDa"),r("5rEg")),a=(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"),d=r("KVXO"),v=r.n(d);function m(){m=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var a=e&&e.prototype instanceof h?e:h,i=Object.create(a.prototype),c=new L(o||[]);return n(i,"_invoke",{value:E(t,r,c)}),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=l;var f={};function h(){}function p(){}function d(){}var v={};u(v,a,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(k([])));g&&g!==e&&r.call(g,a)&&(v=g);var b=d.prototype=h.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function o(n,a,i,c){var u=s(t[n],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,c)}),(function(t){o("throw",t,i,c)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return o("throw",t,i,c)}))}c(u.arg)}var a;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return N()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=j(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function j(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return p.prototype=d,n(b,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(x.prototype),u(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new x(l(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},w(b),u(b,c,"Generator"),u(b,a,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.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}},t.values=k,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(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):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),f},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),_(r),f}},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 o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var y=function(t){var e=t.shixunsDetail,r=(t.globalSetting,t.loading,t.dispatch),p=t.title,d=t.pathList,y=void 0===d?[]:d,g=t.showInputPath,b=void 0!==g&&g,w=t.isMergeSelectFile,x=void 0!==w&&w,E=t.onFinish,j=void 0===E?function(){}:E,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,o;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,!x){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:o=t.sent,j(I),0===o.status&&a["b"].info("\u65b0\u5efa\u6210\u529f"),t.next=18;break;case 16:j(n),a["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:v.a.wrap},f.a.createElement("div",{className:v.a.content},f.a.createElement("div",{className:v.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(v.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(o["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"),o=(r("+L6B"),r("2/Rp")),a=r("q1tI"),i=r.n(a),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,a=t.okText,c=void 0===a?"\u786e\u5b9a":a,l=t.loading,f=void 0!==l&&l,h=t.hasOkBtn,p=void 0===h||h,d=t.okButtonProps,v=void 0===d?{}:d,m=t.onCancel,y=void 0===m?function(){}:m,g=t.onOk,b=void 0===g?function(){}:g,w=t.className,x=void 0===w?"":w;return i.a.createElement("div",{className:s()(u.a.buttonFixed,x)},i.a.createElement("div",{className:u.a.buttonWrap},i.a.createElement(o["a"],{size:"large",className:"".concat(u.a.button," mr20"),onClick:y},r),p&&i.a.createElement(o["a"],Object(n["a"])({size:"large",type:"primary",className:"".concat(u.a.button," mr20"),loading:f,onClick:b},v),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"),o=r("k1fw"),a=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"),d=r("9kvl"),v=r("m3rI"),m=r("9ZNV"),y=r("8j3D"),g=r("EltS"),b=r.n(g);function w(){w=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(S){u=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var a=e&&e.prototype instanceof h?e:h,i=Object.create(a.prototype),c=new L(o||[]);return n(i,"_invoke",{value:E(t,r,c)}),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(S){return{type:"throw",arg:S}}}t.wrap=l;var f={};function h(){}function p(){}function d(){}var v={};u(v,a,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(k([])));y&&y!==e&&r.call(y,a)&&(v=y);var g=d.prototype=h.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function o(n,a,i,c){var u=s(t[n],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,c)}),(function(t){o("throw",t,i,c)})):e.resolve(f).then((function(t){l.value=t,i(l)}),(function(t){return o("throw",t,i,c)}))}c(u.arg)}var a;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return N()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var c=j(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function j(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function O(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return p.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(x.prototype),u(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new x(l(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},b(g),u(g,c,"Generator"),u(g,a,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.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}},t.values=k,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(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):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),f},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),_(r),f}},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 o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var x=s["a"].Dragger,E=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),E=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,o;_.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===(o=n.split("/"))||void 0===o?void 0:o[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(a["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(o["a"])(Object(o["a"])({},{path:V||"",message:E.commitMessage}),O.current?{}:{secret_repository:!0}),fileList:T,method:"post",action:"".concat(v["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;d["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(o["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(x,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(d["a"])((function(t){var e=t.shixunsDetail,r=t.loading,n=t.globalSetting,o=t.user;return{shixunsDetail:e,globalSetting:n,user:o,loading:r.models.index}}))(E)}}]); |