|
|
|
@ -8,8 +8,6 @@ class Setting extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
|
super(props);
|
|
|
|
|
this.state={
|
|
|
|
|
Language:"1",
|
|
|
|
|
Category:"1",
|
|
|
|
|
CategoryList:undefined,
|
|
|
|
|
LanguageList:undefined,
|
|
|
|
|
}
|
|
|
|
@ -78,12 +76,16 @@ class Setting extends Component{
|
|
|
|
|
const { projectsId } = this.props.match.params;
|
|
|
|
|
const url = `/projects/${projectsId}.json`;
|
|
|
|
|
axios.patch(url,{
|
|
|
|
|
name:values.project_name,
|
|
|
|
|
description:values.project_description,
|
|
|
|
|
...values
|
|
|
|
|
params:{
|
|
|
|
|
name:values.project_name,
|
|
|
|
|
description:values.project_description,
|
|
|
|
|
...values
|
|
|
|
|
}
|
|
|
|
|
}).then(result=>{
|
|
|
|
|
if(result){
|
|
|
|
|
this.props.showNotification(`仓库信息修改成功!`)
|
|
|
|
|
this.props.showNotification(`仓库信息修改成功!`);
|
|
|
|
|
const { getDetail } = this.props;
|
|
|
|
|
getDetail && getDetail();
|
|
|
|
|
}
|
|
|
|
|
}).catch(error=>{
|
|
|
|
|
console.log(error);
|
|
|
|
@ -92,78 +94,106 @@ class Setting extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除本仓库
|
|
|
|
|
deleteProject=()=>{
|
|
|
|
|
this.props.confirm({
|
|
|
|
|
content:"删除后无法恢复,是否确认删除本仓库?",
|
|
|
|
|
onOk:()=>{
|
|
|
|
|
const url = ``;
|
|
|
|
|
axios.delete(url).then(result=>{
|
|
|
|
|
this.props.showNotification("仓库删除成功!");
|
|
|
|
|
this.props.history.push("/projects");
|
|
|
|
|
}).catch(error=>{
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
const { getFieldDecorator } = this.props.form;
|
|
|
|
|
|
|
|
|
|
const { Category , Language , CategoryList , LanguageList } = this.state;
|
|
|
|
|
const { CategoryList , LanguageList } = this.state;
|
|
|
|
|
return(
|
|
|
|
|
<div className="normalBox">
|
|
|
|
|
<div className="normalBox-title font-16">
|
|
|
|
|
基本设置
|
|
|
|
|
</div>
|
|
|
|
|
<Form className="baseForm">
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="项目名称"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('project_name', {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true, message: '请输入项目名称'
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<Input placeholder="请输入项目名称"/>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item >
|
|
|
|
|
<div className="df" style={{alignItems:"center"}}>
|
|
|
|
|
<span className="mr20 mb15 font-16">可见性</span>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label=""
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('private', {
|
|
|
|
|
rules: [],
|
|
|
|
|
})(
|
|
|
|
|
<Checkbox >将仓库设为私有</Checkbox>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item >
|
|
|
|
|
<div>
|
|
|
|
|
<div className="normalBox">
|
|
|
|
|
<div className="normalBox-title font-16">
|
|
|
|
|
基本设置
|
|
|
|
|
</div>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="仓库描述"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('project_description', {
|
|
|
|
|
rules: [],
|
|
|
|
|
})(
|
|
|
|
|
<TextArea placeholder="请输入仓库描述" style={{height:"80px"}}/>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item >
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="项目类别"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('project_category_id', {
|
|
|
|
|
<Form className="baseForm">
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="项目名称"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('project_name', {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true, message: '请选择大类别'
|
|
|
|
|
required: true, message: '请输入项目名称'
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<Select>
|
|
|
|
|
{CategoryList}
|
|
|
|
|
</Select>
|
|
|
|
|
<Input placeholder="请输入项目名称"/>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="项目语言"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('project_language_id', {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true, message: '请选择项目语言'
|
|
|
|
|
}],
|
|
|
|
|
</Form.Item >
|
|
|
|
|
<div className="df" style={{alignItems:"center"}}>
|
|
|
|
|
<span className="mr20 mb15 font-16">可见性</span>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label=""
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('private', {
|
|
|
|
|
rules: [],
|
|
|
|
|
})(
|
|
|
|
|
<Checkbox >将仓库设为私有</Checkbox>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item >
|
|
|
|
|
</div>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="仓库描述"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('project_description', {
|
|
|
|
|
rules: [],
|
|
|
|
|
})(
|
|
|
|
|
<Select>
|
|
|
|
|
{LanguageList}
|
|
|
|
|
</Select>
|
|
|
|
|
<TextArea placeholder="请输入仓库描述" style={{height:"80px"}}/>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<p className="clearfix">
|
|
|
|
|
<a className="submitBtn" onClick={this.resetSetting}>更新仓库设置</a>
|
|
|
|
|
</p>
|
|
|
|
|
</Form>
|
|
|
|
|
</Form.Item >
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="项目类别"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('project_category_id', {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true, message: '请选择大类别'
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<Select>
|
|
|
|
|
{CategoryList}
|
|
|
|
|
</Select>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item
|
|
|
|
|
label="项目语言"
|
|
|
|
|
>
|
|
|
|
|
{getFieldDecorator('project_language_id', {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true, message: '请选择项目语言'
|
|
|
|
|
}],
|
|
|
|
|
})(
|
|
|
|
|
<Select>
|
|
|
|
|
{LanguageList}
|
|
|
|
|
</Select>
|
|
|
|
|
)}
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<p className="clearfix">
|
|
|
|
|
<a className="submitBtn" onClick={this.resetSetting}>更新仓库设置</a>
|
|
|
|
|
</p>
|
|
|
|
|
</Form>
|
|
|
|
|
</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>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|