From efc96cfc8c1526362b1cf92384d0bbec79784d8b Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 28 Jul 2020 10:01:49 +0800 Subject: [PATCH] status_type --- src/forge/Order/MilepostDetail.js | 69 ++++++++++++------------------- 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/src/forge/Order/MilepostDetail.js b/src/forge/Order/MilepostDetail.js index be4ea87e..095a047e 100644 --- a/src/forge/Order/MilepostDetail.js +++ b/src/forge/Order/MilepostDetail.js @@ -38,8 +38,6 @@ class MilepostDetail extends Component { issue_type: undefined, status_type: '1', //设置选择高亮 - openselect: 1, - closeselect: undefined, issue_tag_ids: '标签', tracker_ids: '类型', author_ids: '发布人', @@ -71,16 +69,19 @@ class MilepostDetail extends Component { } // 获取列表数据 - getIssueList = ( page , item , value , update , updateValue ) => { + getIssueList = ( page , item , value , update , updateValue , type ) => { const { projectsId, meilid } = this.props.match.params; - const { limit , order_name , order_type , issue_tag_id , author_id , assigned_to_id , tracker_id , status_id , done_ratio} = this.state; + const { limit , order_name , order_type , issue_tag_id , author_id , assigned_to_id , tracker_id , status_id , done_ratio , status_type } = this.state; + const url = `/projects/${projectsId}/versions/${meilid}.json`; let params = update ? { page, limit , order_name:value , order_type:updateValue , issue_tag_id , author_id , assigned_to_id , tracker_id , status_id , done_ratio, + status_type:type || status_type, }:{ page, limit , order_name , order_type , issue_tag_id , author_id , assigned_to_id , tracker_id , status_id , done_ratio, + status_type:type || status_type, [item]:value } axios.get(url, { @@ -100,7 +101,6 @@ class MilepostDetail extends Component { } getOption = (e, id, name) => { - console.log(e.key); if (e.key === "created_on") { if (e.item.props.value === "desc") { this.setState({ @@ -159,49 +159,34 @@ class MilepostDetail extends Component { page, isSpin: true }) - const { limit, status_type, author_id, assigned_to_id } = this.state; this.getIssueList(page); } openorder = (type) => { - if (type) { - const { current_user } = this.props; - if (type === 1) { - this.setState({ - status_type: '1', - openselect: current_user.user_id, - closeselect: undefined, - issue_tag_ids: '标签', - tracker_ids: '类型', - author_ids: '发布人', - assigned_to_ids: '负责人', - status_ids: "状态", - done_ratios: '完成度', - paix: '排序' - }) - this.getIssueList(1); - - } else { - this.setState({ - status_type: '2', - openselect: undefined, - closeselect: current_user.user_id, - issue_tag_ids: '标签', - tracker_ids: '类型', - author_ids: '发布人', - assigned_to_ids: '负责人', - status_ids: "状态", - done_ratios: '完成度', - paix: '排序' - }) - this.getIssueList(1); - } - } + this.setState({ + status_type: type, + issue_tag_id : undefined, + author_id : undefined, + tracker_id : undefined, + done_ratio : undefined, + status_id: undefined, + assigned_to_id: undefined, + issue_tag_ids: '标签', + tracker_ids: '类型', + author_ids: '发布人', + assigned_to_ids: '负责人', + status_ids: "状态", + done_ratios: '完成度', + paix: '排序' + },() => { + this.getIssueList(1,undefined,undefined,undefined,undefined,type); + }); + } render() { - const { issue_chosen, issues, limit, page, search_count, data, isSpin, openselect, closeselect } = this.state; + const { issue_chosen, issues, limit, page, search_count, data, isSpin , status_type } = this.state; const { projectsId, meilid } = this.props.match.params; const menu = ( @@ -242,8 +227,8 @@ class MilepostDetail extends Component {