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;}varTextArea=__WEBPACK_IMPORTED_MODULE_7_antd_lib_input___default.a.TextArea;varOption=__WEBPACK_IMPORTED_MODULE_5_antd_lib_select___default.a.Option;varSetting=function(_Component){_inherits(Setting,_Component);functionSetting(props){_classCallCheck(this,Setting);var_this=_possibleConstructorReturn(this,(Setting.__proto__||Object.getPrototypeOf(Setting)).call(this,props));_this.componentDidMount=function(){_this.getCategory();_this.getLanguage();_this.getInfo();};_this.getLanguage=function(){varurl='/project_languages.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.get(url).then(function(result){if(result){varLanguageList=_this.setOptionsList(result.data.project_languages);_this.setState({LanguageList:LanguageList});}}).catch(function(error){});};_this.getInfo=function(){varcurrent_user=_this.props.current_user;varprojectsId=_this.props.match.params.projectsId;varurl='/'+current_user.login+'/'+projectsId+'/edit.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.get(url).then(function(result){if(result){_this.props.form.setFieldsValue(Object.assign({},result.data));}}).catch(function(error){console.log(error);});};_this.getCategory=function(){varurl='/project_categories.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.get(url).then(function(result){if(result){varCategoryList=_this.setOptionsList(result.data.project_categories);_this.setState({CategoryList:CategoryList});}}).catch(function(error){});};_this.setOptionsList=function(data){varlist=undefined;if(data&&data.length>0){list=data.map(function(item,key){return__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(Option,{key:item.id,value:item.id},item.name);});}returnlist;};_this.resetSetting=function(){_this.props.form.validateFields(function(err,values){if(!err){varproject_id=_this.props.project_id;var url='/projects/'+project_id+'.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.put(url,Object.assign({name:values.project_name,description:values.project_description},values)).then(function(result){if(result){_this.props.showNotification('\u4ED3\u5E93\u4FE1\u606F\u4FEE\u6539\u6210\u529F\uFF01');vargetDetail=_this.props.getDetail;getDetail&&getDetail();}}).catch(function(error){console.log(error);});}});};_this.deleteProject=function(){_this.props.confirm({content:"删除后无法恢复,是否确认删除本仓库?",onOk:functiononOk(){var url='';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.delete(url).then(function(result){_this.props.showNotification("仓库删除成功!");_this.props.history.push("/projects");}).catch(function(error){console.log(error);});}});};_this.state={CategoryList:undefined,LanguageList:undefined};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;}varTextArea=__WEBPACK_IMPORTED_MODULE_7_antd_lib_input___default.a.TextArea;varOption=__WEBPACK_IMPORTED_MODULE_5_antd_lib_select___default.a.Option;varSetting=function(_Component){_inherits(Setting,_Component);functionSetting(props){_classCallCheck(this,Setting);var_this=_possibleConstructorReturn(this,(Setting.__proto__||Object.getPrototypeOf(Setting)).call(this,props));_this.componentDidMount=function(){_this.getCategory();_this.getLanguage();_this.getInfo();};_this.getLanguage=function(){varurl='/project_languages.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.get(url).then(function(result){if(result){varLanguageList=_this.setOptionsList(result.data.project_languages);_this.setState({LanguageList:LanguageList});}}).catch(function(error){});};_this.getInfo=function(){varcurrent_user=_this.props.current_user;varprojectsId=_this.props.match.params.projectsId;varurl='/'+current_user.login+'/'+projectsId+'/edit.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.get(url).then(function(result){if(result){_this.props.form.setFieldsValue(Object.assign({},result.data));_this.setState({private_check:result.data.private});}}).catch(function(error){console.log(error);});};_this.getCategory=function(){varurl='/project_categories.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.get(url).then(function(result){if(result){varCategoryList=_this.setOptionsList(result.data.project_categories);_this.setState({CategoryList:CategoryList});}}).catch(function(error){});};_this.setOptionsList=function(data){varlist=undefined;if(data&&data.length>0){list=data.map(function(item,key){return__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(Option,{key:item.id,value:item.id},item.name);});}returnlist;};_this.resetSetting=function(){_this.props.form.validateFields(function(err,values){if(!err){varproject_id=_this.props.project_id;varprivate_check=_this.state.private_check;varurl='/projects/'+project_id+'.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.put(url,Object.assign({name:values.project_name,description:values.project_description,private:private_check},values)).then(function(result){if(result){_this.props.showNotification('\u4ED3\u5E93\u4FE1\u606F\u4FEE\u6539\u6210\u529F\uFF01');vargetDetail=_this.props.getDetail;getDetail&&getDetail();}}).catch(function(error){console.log(error);});}});};_this.deleteProject=function(){_this.props.confirm({content:"删除后无法恢复,是否确认删除本仓库?",onOk:functiononOk(){varproject_id=_this.props.project_id;varurl='/projects/'+project_id+'.json';__WEBPACK_IMPORTED_MODULE_9_axios___default.a.delete(url).then(function(result){_this.props.showNotification("仓库删除成功!");_this.props.history.push("/projects");}).catch(function(error){console.log(error);});}});};_this.changePrivate=function(e){console.log(e);_this.setState({private_check:e.target.checked});};_this.state={CategoryList:undefined,LanguageList:undefined,private_check:undefined};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;}varOption=__WEBPACK_IMPORTED_MODULE_9_antd_lib_auto_complete___default.a.Option;varMENU_LIST=[{id:"Manager",name:'管理员'},{id:"Developer",name:'开发人员'},{id:"Reporter",name:'报告人员'}];varLIMIT=15;varCollaborator=function(_Component){_inherits(Collaborator,_Component);functionCollaborator(props){_classCallCheck(this,Collaborator);var_this=_possibleConstructorReturn(this,(Collaborator.__proto__||Object.getPrototypeOf(Collaborator)).call(this,props));_this.componentDidMount=function(){if(_this.props.project_id){_this.getMember(_this.props.project_id);}};_this.componentDidUpdate=function(prevState){if(_this.props.project_id&&_this.props.project_id!==prevState.project_id){_this.getMember(_this.props.project_id);}};_this.getMember=function(project_id){varpage=_this.state.page;varurl='/projects/'+project_id+'/members.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.get(url,{params:{page:page,limit:LIMIT}}).then(function(result){if(result){_this.setState({listData:result.data.members,isSpin:false});}}).catch(function(error){console.log(error);});};_this.changeInputUser=function(e){console.log(e);_this.setState({user:e});_this.getUserList(e);};_this.changeUser=function(e){console.log("click",e);_this.setState({user_id:e});};_this.serachUser=function(e){console.log("select",e);_this.setState({user:e.item.props.children});};_this.getUserList=function(e){varurl='/users/list.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.get(url,{params:{search:e}}).then(function(result){if(result){_this.setState({userDataSource:result.data.users});}}).catch(function(error){console.log(error);});};_this.changeOperaiton=function(e,id){varproject_id=_this.props.project_id;_this.setState({isSpin:true});varurl='/projects/'+project_id+'/members/change_role.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.put(url,{user_id:id,role:e.key}).then(function(result){if(result){_this.props.showNotification('权限修改成功!');_this.getMember(project_id);_this.setState({isSpin:false});}}).catch(function(error){console.log(error);});};_this.addCollaborator=function(){varprojectsId=_this.props.match.params.projectsId;varproject_id=_this.props.project_id;varuser_id=_this.state.user_id;varurl='/projects/'+projectsId+'/members.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.post(url,{user_id:user_id}).then(function(result){if(result){_this.getMember(project_id);}}).catch(function(error){console.log(error);});};_this.state={listData:undefined,user:undefined,user_id:undefined,userDataSource:undefined,page:1,isSpin:true};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;}varOption=__WEBPACK_IMPORTED_MODULE_9_antd_lib_auto_complete___default.a.Option;varMENU_LIST=[{id:"Manager",name:'管理员'},{id:"Developer",name:'开发人员'},{id:"Reporter",name:'报告人员'}];varLIMIT=15;varCollaborator=function(_Component){_inherits(Collaborator,_Component);functionCollaborator(props){_classCallCheck(this,Collaborator);var_this=_possibleConstructorReturn(this,(Collaborator.__proto__||Object.getPrototypeOf(Collaborator)).call(this,props));_this.componentDidMount=function(){if(_this.props.project_id){_this.getMember(_this.props.project_id);}};_this.componentDidUpdate=function(prevState){if(_this.props.project_id&&_this.props.project_id!==prevState.project_id){_this.getMember(_this.props.project_id);}};_this.getMember=function(project_id){varpage=_this.state.page;varurl='/projects/'+project_id+'/members.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.get(url,{params:{page:page,limit:LIMIT}}).then(function(result){if(result){_this.setState({listData:result.data.members,isSpin:false});}}).catch(function(error){console.log(error);});};_this.changeInputUser=function(e){_this.getUserList(e);};_this.selectInputUser=function(e,option){_this.setState({user_id:e});_this.getUserList(option.props.children);};_this.getUserList=function(e){varurl='/users/list.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.get(url,{params:{search:e}}).then(function(result){if(result){_this.setState({userDataSource:result.data.users});}}).catch(function(error){console.log(error);});};_this.addCollaborator=function(){varproject_id=_this.props.project_id;varuser_id=_this.state.user_id;varurl='/projects/'+project_id+'/members.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.post(url,{user_id:user_id}).then(function(result){if(result){_this.setState({isSpin:true});_this.getMember(project_id);}}).catch(function(error){console.log(error);});};_this.changeOperaiton=function(e,id){varproject_id=_this.props.project_id;_this.setState({isSpin:true});varurl='/projects/'+project_id+'/members/change_role.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.put(url,{user_id:id,role:e.key}).then(function(result){if(result){_this.setState({isSpin:true});_this.props.showNotification('权限修改成功!');_this.getMember(project_id);}}).catch(function(error){console.log(error);});};_this.deleteUser=function(id){_this.props.confirm({content:"确认将此成员从项目中移除?",onOk:functiononOk(){varproject_id=_this.props.project_id;varurl='/projects/'+project_id+'/members/remove.json';__WEBPACK_IMPORTED_MODULE_12_axios___default.a.delete(url,{user_id:id}).then(function(result){if(result){_this.setState({isSpin:true});_this.props.showNotification("成员删除成功!");_this.getMember(project_id);}}).catch(function(error){console.log(error);});}});};_this.state={listData:undefined,user:undefined,user_id:undefined,userDataSource:undefined,page:1,isSpin:true};return_this;}// 获取项目协作者
// 输入用户
// 选择用户
// 修改权限
// 增加协作者
_createClass(Collaborator,[{key:'render',value:functionrender(){var_this2=this;var_state=this.state,user=_state.user,userDataSource=_state.userDataSource,listData=_state.listData,isSpin=_state.isSpin;varmenu=functionmenu(id){return__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_menu___default.a,null,MENU_LIST.map(function(item,key){return__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_menu___default.a.Item,{key:item.id,value:item.id,onClick:functiononClick(e){return_this2.changeOperaiton(e,id);}},item.name);}));};varsource=userDataSource&&userDataSource.map(function(item,key){return__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(Option,{key:key,value:''+item.user_id,onClick:_this2.serachUser},item.username);});return__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'normalBox'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'normalBox-title font-16'},'\u534F\u4F5C\u8005'),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_spin___default.a,{spinning:isSpin},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'collaboratorList'},listData&&listData.map(function(item,key){varoperation=MENU_LIST.filter(function(i){returni.id===item.role;});return__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'collaboratorItem'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('span',null,__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11_react_router_dom__["b"/* Link */],{to:'',className:'color-blue'},item.name)),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('span',null,__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_dropdown___default.a,{overlay:menu(''+item.id),placement:"bottomCenter"},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('span',null,operation&&operation[0].name,__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_icon___default.a,{type:'down'})))),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('span',{style:{justifyContent:"center"}},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('a',{className:'red_btn'},'\u5220\u9664')));}))),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('div',{className:'addPanel'},__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9_antd_lib_auto_complete___default.a,{value:user,dataSource:source,style:{width:200},onChange:this.changeInputUser,placeholder:'\u641C\u7D22\u7528\u6237',onSelect:this.changeUser}),__WEBPACK_IMPORTED_MODULE_10_react___default.a.createElement('a',{className:'small_submitBtn ml20',onClick:this.addCollaborator},'\u589E\u52A0\u534F\u4F5C\u8005'))));}}]);returnCollaborator;}(__WEBPACK_IMPORTED_MODULE_10_react__["Component"]);/* harmony default export */__webpack_exports__["default"]=(Collaborator);
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;}varOption=__WEBPACK_IMPORTED_MODULE_1_antd_lib_select___default.a.Option;varBranch=function(_Component){_inherits(Branch,_Component);functionBranch(props){_classCallCheck(this,Branch);var_this=_possibleConstructorReturn(this,(Branch.__proto__||Object.getPrototypeOf(Branch)).call(this,props));_this.resetSetting=function(){};_this.state={userDataSource:undefined};return_this;}// 更新仓库设置