|
|
@ -8,8 +8,6 @@ class Setting extends Component{
|
|
|
|
constructor(props){
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.state={
|
|
|
|
this.state={
|
|
|
|
Language:"1",
|
|
|
|
|
|
|
|
Category:"1",
|
|
|
|
|
|
|
|
CategoryList:undefined,
|
|
|
|
CategoryList:undefined,
|
|
|
|
LanguageList:undefined,
|
|
|
|
LanguageList:undefined,
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -78,13 +76,33 @@ class Setting extends Component{
|
|
|
|
const { projectsId } = this.props.match.params;
|
|
|
|
const { projectsId } = this.props.match.params;
|
|
|
|
const url = `/projects/${projectsId}.json`;
|
|
|
|
const url = `/projects/${projectsId}.json`;
|
|
|
|
axios.patch(url,{
|
|
|
|
axios.patch(url,{
|
|
|
|
|
|
|
|
params:{
|
|
|
|
name:values.project_name,
|
|
|
|
name:values.project_name,
|
|
|
|
description:values.project_description,
|
|
|
|
description:values.project_description,
|
|
|
|
...values
|
|
|
|
...values
|
|
|
|
|
|
|
|
}
|
|
|
|
}).then(result=>{
|
|
|
|
}).then(result=>{
|
|
|
|
if(result){
|
|
|
|
if(result){
|
|
|
|
this.props.showNotification(`仓库信息修改成功!`)
|
|
|
|
this.props.showNotification(`仓库信息修改成功!`);
|
|
|
|
|
|
|
|
const { getDetail } = this.props;
|
|
|
|
|
|
|
|
getDetail && getDetail();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch(error=>{
|
|
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 删除本仓库
|
|
|
|
|
|
|
|
deleteProject=()=>{
|
|
|
|
|
|
|
|
this.props.confirm({
|
|
|
|
|
|
|
|
content:"删除后无法恢复,是否确认删除本仓库?",
|
|
|
|
|
|
|
|
onOk:()=>{
|
|
|
|
|
|
|
|
const url = ``;
|
|
|
|
|
|
|
|
axios.delete(url).then(result=>{
|
|
|
|
|
|
|
|
this.props.showNotification("仓库删除成功!");
|
|
|
|
|
|
|
|
this.props.history.push("/projects");
|
|
|
|
}).catch(error=>{
|
|
|
|
}).catch(error=>{
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -95,8 +113,9 @@ class Setting extends Component{
|
|
|
|
render(){
|
|
|
|
render(){
|
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
|
|
|
|
|
|
|
|
|
const { Category , Language , CategoryList , LanguageList } = this.state;
|
|
|
|
const { CategoryList , LanguageList } = this.state;
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<div className="normalBox">
|
|
|
|
<div className="normalBox">
|
|
|
|
<div className="normalBox-title font-16">
|
|
|
|
<div className="normalBox-title font-16">
|
|
|
|
基本设置
|
|
|
|
基本设置
|
|
|
@ -165,6 +184,17 @@ class Setting extends Component{
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
</Form>
|
|
|
|
</Form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="dangerousBox">
|
|
|
|
|
|
|
|
<div className="dangerousTitle">危险操作区</div>
|
|
|
|
|
|
|
|
<div className="flex-a-center padding15-10">
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<p className="font-bd font-16">删除本仓库</p>
|
|
|
|
|
|
|
|
<p className="mt10">删除仓库是永久性的, 无法撤消</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<a onClick={this.deleteProject} className="red_deleteBtn">删除本仓库</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|