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/static/js/220.42e614c5.chunk.js

1 line
8.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(this.webpackJsonp=this.webpackJsonp||[]).push([[220],{fGws:function(e,t,n){"use strict";n.r(t);n("6rnn");var r=n("d6B9"),o=(n("rJH4"),n("nKmx")),a=(n("EYKc"),n("TGLo")),i=n("xwgP"),s=n.n(i),l=n("91MD"),c=n.n(l),f=n("sYIF"),u=n("A4uo"),p=n("3JZM");n("d/VC");function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function d(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return w(this,n)}}function w(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?E(e):t}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=a.a.Dragger,N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(l,e);var t,n,a,i=g(l);function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),S(E(t=i.call(this,e)),"handleChange",(function(e){if("done"===e.file.status||"uploading"===e.file.status){var n=d(e.fileList);if(e.file.response)return-1===e.file.response.status?void t.props.showNotification(e.file.response.message):void t.props.showNotification("上传成功!");n=(n=n.slice(-2)).map((function(e){return e.response&&e.response.status,e})),t.setState({fileList:n})}})),S(E(t),"onAttachmentRemove",(function(e){if(console.log(e),e.response){var n=t.props.match.params.shixunId,r=t.state,o=r.message,a=r.filspath;if(""===o||void 0===o)return void t.props.showNotification("删除文件请先填写提交信息");var i=t.props.match.path,s=void 0;i.indexOf("repository")>-1&&(s=void 0),i.indexOf("secret_repository")>-1&&(s=!0);var l=a;l=""===l?e.name:a+"/"+e.name;var f="/shixuns//".concat(n,"/delete_git_file.json");c.a.delete(f,{data:{path:l,message:o,secret_repository:s}}).then((function(n){if(0===n.data.status){var r=t.state.fileList.filter((function(t){return t.uid!==e.uid}));t.setState({fileList:r}),t.props.showNotification("删除成功")}})).catch((function(e){console.log(e)}))}else t.props.showNotification("还未上传完成,无法进行删除操作!")})),S(E(t),"FormInput",(function(e){t.setState({message:e.target.value})})),S(E(t),"Selectfiledirectory",(function(){t.setState({visibles:!0})})),S(E(t),"hideNewFolder",(function(){t.setState({visibles:!1})})),S(E(t),"selectupfilspath",(function(e){t.setState({filspath:e})})),t.state={filspath:"",visibles:!1,message:void 0,fileList:[]},t}return t=l,(n=[{key:"componentDidMount",value:function(){if(this.props.newathArray&&this.props.newathArray.length>0){var e="";this.props.newathArray.map((function(t,n){e=0===n?t:e+"/"+t})),this.setState({filspath:e})}}},{key:"render",value:function(){var e,t=this,n=this.props.form.getFieldDecorator,a=this.props.match.params.shixunId,i=this.props.match.path,l="";i.indexOf("repository")>-1&&(l="repository",e={path:this.state.filspath,message:this.state.message}),i.indexOf("secret_repository")>-1&&(l="secret_repository",e={path:this.state.filspath,message:this.state.message,secret_repository:!0});var c={height:300,multiple:!0,data:e,fileList:this.state.fileList,action:"".concat(Object(f.P)(a)),onChange:this.handleChange,onRemove:this.onAttachmentRemove,beforeUpload:function(e){var n=t.state.message;if(""===n||void 0===n)return t.props.showNotification("上传文件请先填写提交信息"),!1}};return s.a.createElement("div",null,!0===this.state.visibles?s.a.createElement(u.a,h({titles:"选择文件上传目录",evaluationvisible:this.state.visibles,hideNewFolder:this.hideNewFolder},this.state,this.props,{selectupfils:!0,selectupfilspath:function(e){return t.selectupfilspath(e)}})):"",s.a.createElement("div",{className:"educontent mt30"},s.a.createElement("style",null,"\n .formStyle .ant-form-item{\n margin-bottom:10px!important;\n }\n // .formStyle .ant-col.ant-form-item-label{\n // margin-left:-10px;\n // line-height:30px;\n // margin-bottom:10px;\n // }\n .breadcrumb .ant-breadcrumb-separator{\n margin:0px 2px;\n }\n .ant-upload ant-upload-drag{\n height: 300px;\n }\n // .backgroudwhite{\n // display:none;\n // }\n /*.filecode .CodeMirror.cm-s-railscasts{\n border:1px solid #E5E5E5;\n }\n .filecode .CodeMirror.cm-s-railscasts .CodeMirror-sizer,.filecode .CodeMirror-gutters,.filecode .CodeMirror-scroll{\n background:#fff;\n }\n .filecode .CodeMirror-linenumber{\n text-align:center\n }*/\n "),s.a.createElement(r.a,{className:"formStyle"},s.a.createElement("div",{className:"edu-back-white padding20-30 mb10"},s.a.createElement("p",{className:"ant-form-item-label"},s.a.createElement("div",{className:"font-20 color-black"},"上传文件")),s.a.createElement("div",null,s.a.createElement("p",{className:"ant-form-item-label"},s.a.createElement("div",{className:"color888 font-16"},"当前目录:",""===this.state.filspath?"/":"/"+this.state.filspath," ",s.a.createElement("span",{className:"color-blue pointer",onClick:this.Selectfiledirectory},"选择文件目录")))),s.a.createElement(x,c,s.a.createElement("p",{className:"ant-upload-drag-icon"},s.a.createElement("i",{className:"iconfont icon-shangchuan font-50 color-blue"})),s.a.createElement("p",{className:"ant-upload-hint mt30"},"拖拽文件或 ",s.a.createElement("span",{className:"color-blue"},"点击此处上传"))),s.a.createElement(r.a.Item,{label:"提交信息"},n("message",{rules:[{required:!0,message:"请输入提交信息"},{whitespace:!0,message:"请勿输入空格"}]})(s.a.createElement(o.a,{placeholder:"必填描述主要修改内容相当于Git Commit message的Header",onInput:this.FormInput,className:"winput-300-35 fl"})))))),s.a.createElement(p.a,h({},this.props,this.state,{url:"/shixuns/".concat(a,"/").concat(l).concat(""===this.state.filspath?"":"/master/shixun_show/"+this.state.filspath),bottomvalue:"确定"})))}}])&&b(t.prototype,n),a&&b(t,a),l}(i.Component),_=r.a.create({name:"RepositoryAddFileupload_files"})(N);t.default=_}}]);