caicai8 5 years ago
parent 21db3e16df
commit 7f87917d98

@ -16,15 +16,15 @@ class New extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
branch_name:"-1", branch_name:"",
issue_tag_ids:"-1", issue_tag_ids:"",
fixed_version_id:"-1", fixed_version_id:"",
tracker_id:"-1", tracker_id:"",
issue_type:"-1", issue_type:"",
status_id:'-1', status_id:'',
assigned_to_id:"-1", assigned_to_id:"",
priority_id:"-1", priority_id:"",
done_ratio:"-1", done_ratio:"",
issue_chosen:undefined, issue_chosen:undefined,
branches:undefined, branches:undefined,
fileList:undefined fileList:undefined
@ -78,17 +78,7 @@ class New extends Component{
const { fileList } = this.state; const { fileList } = this.state;
const url = `/projects/${projectsId}/issues.json`; const url = `/projects/${projectsId}/issues.json`;
axios.post(url,{ axios.post(url,{
subject:values.subject, ...values,
description:values.description,
branch_name:values.branch_name,
issue_tag_ids:values.issue_tag_ids > -1 ? values.issue_tag_ids : undefined,
fixed_version_id:values.fixed_version_id > -1 ? values.fixed_version_id : undefined,
tracker_id:values.tracker_id > -1 ? values.tracker_id : undefined,
issue_type:values.issue_type > -1 ? values.issue_type : undefined,
status_id:values.status_id > -1 ? values.status_id : undefined,
assigned_to_id:values.assigned_to_id > -1 ? values.assigned_to_id : undefined,
priority_id:values.priority_id > -1 ? values.priority_id : undefined,
done_ratio:values.done_ratio > -1 ? values.done_ratio : undefined,
attachment_ids:fileList attachment_ids:fileList
}).then(result=>{ }).then(result=>{
if(result){ if(result){
@ -153,7 +143,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={branch_name}> <Select value={branch_name}>
<Option value={'-1'}>分支未指定</Option> <Option value={''}>分支未指定</Option>
{ {
branches && branches.length >0 && branches.map((item,key)=>{ branches && branches.length >0 && branches.map((item,key)=>{
return( return(
@ -171,7 +161,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={issue_tag_ids}> <Select value={issue_tag_ids}>
<Option value={"-1"}>未选择标签</Option> <Option value={""}>未选择标签</Option>
{ this.renderSelect(issue_chosen && issue_chosen.issue_tag) } { this.renderSelect(issue_chosen && issue_chosen.issue_tag) }
</Select> </Select>
)} )}
@ -183,7 +173,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={fixed_version_id}> <Select value={fixed_version_id}>
<Option value={"-1"}>未选择里程碑</Option> <Option value={""}>未选择里程碑</Option>
{ this.renderSelect(issue_chosen && issue_chosen.issue_version) } { this.renderSelect(issue_chosen && issue_chosen.issue_version) }
</Select> </Select>
)} )}
@ -195,7 +185,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={status_id}> <Select value={status_id}>
<Option value={"-1"}>未选择完成状态</Option> <Option value={""}>未选择完成状态</Option>
{ this.renderSelect(issue_chosen && issue_chosen.issue_status) } { this.renderSelect(issue_chosen && issue_chosen.issue_status) }
</Select> </Select>
)} )}
@ -207,7 +197,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={issue_type}> <Select value={issue_type}>
<Option value={"-1"}>未选择类型</Option> <Option value={""}>未选择类型</Option>
{ this.renderSelect(issue_chosen && issue_chosen.issue_type) } { this.renderSelect(issue_chosen && issue_chosen.issue_type) }
</Select> </Select>
)} )}
@ -219,7 +209,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={tracker_id}> <Select value={tracker_id}>
<Option value={"-1"}>未选择分类</Option> <Option value={""}>未选择分类</Option>
{ this.renderSelect(issue_chosen && issue_chosen.tracker) } { this.renderSelect(issue_chosen && issue_chosen.tracker) }
</Select> </Select>
)} )}
@ -231,7 +221,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={assigned_to_id}> <Select value={assigned_to_id}>
<Option value={"-1"}>未指派成员</Option> <Option value={""}>未指派成员</Option>
{ this.renderSelect(issue_chosen && issue_chosen.assign_user) } { this.renderSelect(issue_chosen && issue_chosen.assign_user) }
</Select> </Select>
)} )}
@ -243,7 +233,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={priority_id}> <Select value={priority_id}>
<Option value={"-1"}>未选择优先度</Option> <Option value={""}>未选择优先度</Option>
{ this.renderSelect(issue_chosen && issue_chosen.priority) } { this.renderSelect(issue_chosen && issue_chosen.priority) }
</Select> </Select>
)} )}
@ -255,7 +245,7 @@ class New extends Component{
rules: [], rules: [],
})( })(
<Select value={done_ratio}> <Select value={done_ratio}>
<Option value={"-1"}>未选择完成度</Option> <Option value={""}>未选择完成度</Option>
{ this.renderSelect(issue_chosen && issue_chosen.done_ratio) } { this.renderSelect(issue_chosen && issue_chosen.done_ratio) }
</Select> </Select>
)} )}

Loading…
Cancel
Save