var_createClass=function(){functiondefineProperties(target,props){for(vari=0;i<props.length;i++){vardescriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"indescriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}returnfunction(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);returnConstructor;};}();function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}function_possibleConstructorReturn(self,call){if(!self){thrownewReferenceError("this hasn't been initialised - super() hasn't been called");}returncall&&(typeofcall==="object"||typeofcall==="function")?call:self;}function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}varCoderRootCommit=function(_Component){_inherits(CoderRootCommit,_Component);functionCoderRootCommit(props){_classCallCheck(this,CoderRootCommit);var_this=_possibleConstructorReturn(this,(CoderRootCommit.__proto__||Object.getPrototypeOf(CoderRootCommit)).call(this,props));_this.componentDidMount=function(){var_this$state=_this.state,branch=_this$state.branch,page=_this$state.page,limit=_this$state.limit;_this.setState({isSpin:true});_this.getCommitList(branch,page,limit);};_this.getCommitList=function(branch,page,limit){varlogin=_this.props.current_user.login;varprojectsId=_this.props.match.params.projectsId;varurl='/'+login+'/'+projectsId+'/commits.json';__WEBPACK_IMPORTED_MODULE_8_axios___default.a.get(url,{params:{sha:branch,page:page,limit:limit}}).then(function(result){if(result){vararray=[];result.data&&result.data.commits.length>0&&result.data.commits.map(function(item,key){array.push({name:item.author&&item.author.name,image_url:item.author&&item.author.image_url,sha:item.sha,time_from_now:item.time_from_now,message:item.message});});_this.setState({data:array,dataCount:result.data.total_count,isSpin:false});}}).catch(function(error){console.log(error);});};_this.changeBranch=function(value){varbranchList=_this.props.branchList;varbranchLastCommit=branchList[parseInt(value.key)];var_this$state2=_this.state,page=_this$state2.page,limit=_this$state2.limit;_this.setState({isSpin:true,branch:branchLastCommit.name});_this.getCommitList(branchLastCommit.name,page,limit);};_this.ChangePage=function(page){var_this$state3=_this.state,branch=_this$state3.branch,limit=_this$state3.limit;_this.getCommitList(branch,page,limit);};_this.state={branch:"master",data:undefined,dataCount:undefined,limit:50,page:1,isSpin:false};return_this;}// 切换分支
var_createClass=function(){functiondefineProperties(target,props){for(vari=0;i<props.length;i++){vardescriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"indescriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}returnfunction(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);returnConstructor;};}();function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}function_possibleConstructorReturn(self,call){if(!self){thrownewReferenceError("this hasn't been initialised - super() hasn't been called");}returncall&&(typeofcall==="object"||typeofcall==="function")?call:self;}function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}varCoderRootCommit=function(_Component){_inherits(CoderRootCommit,_Component);functionCoderRootCommit(props){_classCallCheck(this,CoderRootCommit);var_this=_possibleConstructorReturn(this,(CoderRootCommit.__proto__||Object.getPrototypeOf(CoderRootCommit)).call(this,props));_this.componentDidMount=function(){var_this$state=_this.state,branch=_this$state.branch,page=_this$state.page,limit=_this$state.limit;_this.setState({isSpin:true});_this.getCommitList(branch,page,limit);};_this.getCommitList=function(branch,page,limit){varlogin=_this.props.current_user.login;varprojectsId=_this.props.match.params.projectsId;varurl='/'+login+'/'+projectsId+'/commits.json';__WEBPACK_IMPORTED_MODULE_8_axios___default.a.get(url,{params:{sha:branch,page:page,limit:limit}}).then(function(result){if(result){vararray=[];result.data&&result.data.commits.length>0&&result.data.commits.map(function(item,key){array.push({name:item.author&&item.author.name,image_url:item.author&&item.author.image_url,sha:item.sha,time_from_now:item.time_from_now,message:item.message});});_this.setState({data:array,dataCount:result.data.total_count,isSpin:false});}}).catch(function(error){console.log(error);});};_this.changeBranch=function(value){varbranchList=_this.props.branchList;varbranchLastCommit=branchList[parseInt(value.key)];var_this$state2=_this.state,page=_this$state2.page,limit=_this$state2.limit;_this.setState({isSpin:true,branch:branchLastCommit.name});_this.getCommitList(branchLastCommit.name,page,limit);};_this.ChangePage=function(page){var_this$state3=_this.state,branch=_this$state3.branch,limit=_this$state3.limit;_this.getCommitList(branch,page,limit);};_this.state={branch:"master",data:undefined,dataCount:undefined,limit:20,page:1,isSpin:false};return_this;}// 切换分支