详情banner数量,显示开启中的数量,且执行关闭或者拒绝等修改状态的操作时要更新数量

This commit is contained in:
caishi 2021-06-16 15:51:47 +08:00
parent f4b3afde6a
commit d4e1b2f414
12 changed files with 80 additions and 45 deletions

View File

@ -425,7 +425,7 @@ class Detail extends Component {
<div> <div>
<div className="detailHeader-wrapper"> <div className="detailHeader-wrapper">
<div className="normal"> <div className="normal">
<FlexAJ style={{marginTop:"15px"}}> <FlexAJ style={{paddingTop:"15px"}}>
<AlignCenter> <AlignCenter>
<div className="projectallName"> <div className="projectallName">
{project && project.author && {project && project.author &&

View File

@ -102,19 +102,6 @@
} }
} }
} }
.projectallName{
display: flex;
align-items: center;
font-size: 22px;
font-weight: normal;
.projectN{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1;
max-width: 500px;
}
}
// coderDepot // coderDepot
.Panels{ .Panels{
max-width: 1200px; max-width: 1200px;

View File

@ -102,6 +102,8 @@ class MessageCount extends Component {
isSpin: false, isSpin: false,
pr_status: 2, pr_status: 2,
}); });
const { getDetail } = this.props;
getDetail && getDetail();
} else { } else {
this.setState({ this.setState({
isSpin: false, isSpin: false,
@ -138,6 +140,8 @@ class MessageCount extends Component {
SpinMerge: false, SpinMerge: false,
pr_status: 1, pr_status: 1,
}); });
const { getDetail } = this.props;
getDetail && getDetail();
} else { } else {
this.setState({ SpinMerge: false }); this.setState({ SpinMerge: false });
} }
@ -471,17 +475,16 @@ class MessageCount extends Component {
: !ismesrge ? "block" : "none", : !ismesrge ? "block" : "none",
}} }}
> >
<p className="mb15"> <Dropdown.Button
<Dropdown.Button overlay={menu}
overlay={menu} type="primary"
type="primary" onClick={this.submitmerge}
onClick={this.submitmerge} className="mb15"
icon={<Icon type="caret-down" />} icon={<Icon type="caret-down" />}
disabled={!pull_request || (pull_request && !pull_request.mergeable) } disabled={!pull_request || (pull_request && !pull_request.mergeable) }
> >
{this.state.mergename} {this.state.mergename}
</Dropdown.Button> </Dropdown.Button>
</p>
{pull_request && pull_request.mergeable {pull_request && pull_request.mergeable
? ?
<Alert <Alert

View File

@ -207,12 +207,10 @@ class merge extends Component {
paix: "排序", paix: "排序",
priority_ids: "优先级", priority_ids: "优先级",
}); });
this.state.select_params = { this.state.select_params.status_type = type;
status_type: type, this.state.select_params.page=1;
search: undefined, this.state.select_params.limit=15;
page: 1,
limit: 15,
};
this.getIssueList(); this.getIssueList();
}; };

View File

@ -89,8 +89,9 @@ class Milepost extends Component {
closeselect: status === "closed" ? current_user.user_id : undefined, closeselect: status === "closed" ? current_user.user_id : undefined,
openselect: status === "closed" ? undefined : current_user.user_id openselect: status === "closed" ? undefined : current_user.user_id
}) })
this.getList(1, status, 'desc');
this.getList(1, status, 'desc') const { getDetail } = this.props;
getDetail && getDetail();
} }
}).catch(error => { }).catch(error => {
console.log(error); console.log(error);
@ -228,8 +229,8 @@ class Milepost extends Component {
<Link to={`/projects/${owner}/${projectsId}/milestones/${item.id}/edit`} className="color-grey-9">编辑</Link> <Link to={`/projects/${owner}/${projectsId}/milestones/${item.id}/edit`} className="color-grey-9">编辑</Link>
</div> </div>
<div className="grid-item ml15 color-grey-9"> <div className="grid-item ml15 color-grey-9">
<i className="iconfont icon-yiguanbi1 font-14 mr5"></i> <i className={item.status === "closed" ? "iconfont icon-gouxuan font-14 mr5":"iconfont icon-yiguanbi1 font-14 mr5"}></i>
<a onClick={() => this.updatestatusemile(this.state.status === "closed" ? "open" : "closed", item)} className="color-grey-9">{this.state.status === "closed" ? "开启" : "关闭"}</a> <a onClick={() => this.updatestatusemile(item.status === "closed" ? "open" : "closed", item)} className="color-grey-9">{this.state.status === "closed" ? "开启" : "关闭"}</a>
</div> </div>
<div className="grid-item ml15 color-grey-9"> <div className="grid-item ml15 color-grey-9">
<i className="iconfont icon-lajitong font-14 mr5" ></i> <i className="iconfont icon-lajitong font-14 mr5" ></i>

View File

@ -69,6 +69,27 @@ class MilepostDetail extends Component {
}) })
} }
deletedetail = (id) => {
const { projectsId , owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/issues/${id}.json`;
axios.delete(url, {
data: {
project_id: projectsId,
id: id,
},
})
.then((result) => {
if (result) {
const { page } = this.state;
this.getIssueList(page);
const { getDetail } = this.props;
getDetail && getDetail();
}
})
.catch((error) => {
console.log(error);
});
};
// 获取列表数据 // 获取列表数据
getIssueList = ( page , item , value , update , updateValue , type ) => { getIssueList = ( page , item , value , update , updateValue , type ) => {
const { projectsId, meilid , owner } = this.props.match.params; const { projectsId, meilid , owner } = this.props.match.params;
@ -275,7 +296,15 @@ class MilepostDetail extends Component {
: :
issues && issues.length>0 && issues.map((item,key)=>{ issues && issues.length>0 && issues.map((item,key)=>{
return( return(
<OrderItem key={key} mile item={item} search_count={search_count} page={page} limit={limit} {...this.props} {...this.state}></OrderItem> <OrderItem
key={key} mile
item={item}
search_count={search_count}
page={page}
limit={limit}
{...this.props} {...this.state}
deletedetail={this.deletedetail}
></OrderItem>
) )
}) })
} }

View File

@ -92,12 +92,12 @@ class OrderItem extends Component {
<Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link> <Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link>
{ {
current_user && current_user.login ? current_user && current_user.login ?
<div style={{ display: this.state.orderid === item.id && this.state.isdisplay ? 'flex' : 'none' }}> <div id="hoverBox" style={{ display: this.state.orderid === item.id && this.state.isdisplay ? 'flex' : 'none' }}>
<div className="mr8 ml8 color-grey-9"> <div className="mr8 ml8 color-grey-9">
<Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/updatedetail`} className="color-grey-9"><i className="iconfont icon-bianji3 font-14 mr5"></i></Link> <Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/updatedetail`} className="color-grey-9"><i className="iconfont icon-bianji3 font-14 mr5"></i></Link>
</div> </div>
<div className="color-grey-9"> <div className="color-grey-9">
<Popconfirm placement="bottom" title={'您确定要删除吗'} okText="是" cancelText="否" onConfirm={() => this.deletedetail(item.id)}> <Popconfirm placement="bottom" overlayClassName="overlayBox" getPopupContainer={()=>document.getElementById("hoverBox")} title={'您确定要删除当前易修'} okText="是" cancelText="否" onConfirm={() => this.deletedetail(item.id)}>
<i className="iconfont icon-yiguanbi1 font-14"></i> <i className="iconfont icon-yiguanbi1 font-14"></i>
</Popconfirm> </Popconfirm>
</div> </div>

View File

@ -64,6 +64,8 @@ class NewMilepost extends Component {
if (result) { if (result) {
this.setState({ isSpin: false }) this.setState({ isSpin: false })
this.props.history.push(`/projects/${owner}/${projectsId}/milestones`); this.props.history.push(`/projects/${owner}/${projectsId}/milestones`);
const { getDetail } = this.props;
getDetail && getDetail();
} }
}).catch(error => { }).catch(error => {
this.setState({ isSpin: false }) this.setState({ isSpin: false })

View File

@ -17,7 +17,9 @@
line-height: 18px; line-height: 18px;
color: red; color: red;
} }
.overlayBox{
width: 230px;
}
.topmilepost { .topmilepost {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;

View File

@ -268,11 +268,8 @@ class order extends Component {
checkedValue:[], checkedValue:[],
all:undefined all:undefined
}); });
this.state.select_params = { this.state.select_params.page = 1;
search: undefined, this.state.select_params.limit = 15;
page: 1,
limit: 15,
};
this.getIssueList(type); this.getIssueList(type);
}; };
@ -337,6 +334,8 @@ class order extends Component {
const { status_type } = this.state; const { status_type } = this.state;
this.getIssueList(status_type); this.getIssueList(status_type);
const { getDetail } = this.props;
getDetail && getDetail();
} }
}) })
.catch((error) => { .catch((error) => {

View File

@ -193,13 +193,14 @@ class order_form extends Component {
if (result) { if (result) {
this.props.history.push(`/projects/${owner}/${projectsId}/issues/${orderId}/detail`); this.props.history.push(`/projects/${owner}/${projectsId}/issues/${orderId}/detail`);
this.props.showNotification("任务更新成功!"); this.props.showNotification("任务更新成功!");
const { getDetail } = this.props;
getDetail && getDetail();
} }
}) })
.catch((error) => { .catch((error) => {
this.setState({ this.setState({
isSpin: false, isSpin: false,
}); });
console.log(error);
}); });
} }
} }

View File

@ -7,6 +7,19 @@ ul,ol,dl{
.color-black{ .color-black{
color: #333; color: #333;
} }
.projectallName{
display: flex;
align-items: center;
font-size: 22px;
font-weight: normal;
.projectN{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex: 1;
max-width: 500px;
}
}
.main{ .main{
width: 1200px; width: 1200px;
padding:20px; padding:20px;