实训审核全选控制调整

problem_set
杨树明 5 years ago
parent ffbc812709
commit 43744be289

@ -10,46 +10,144 @@ class Audit_situationComponent extends Component {
constructor(props) {
super(props)
this.state = {
datas:undefined,
value:undefined,
}
}
componentDidMount(){
componentDidMount() {
this.getdatas()
}
getdatas=()=>{
let url=`/shixuns/${this.props.match.params.shixunId}/review_newest_record.json`;
axios.get(url).then((response) => {
console.log(response)
if(response.data===undefined||JSON.stringify(response.data) == "{}"||response.data===null){
this.setState({
datas:[
{
name: '内容审核情况',
id:"Content",
},
{
name: '性能审核情况',
id:"Performance",
},
]
})
}else{
let newlist=[]
if(response.data.content_info!=undefined&&response.data.perference_info===undefined){
let arr=[
{
name: '内容审核情况',
id:"Content",
status:response.data.content_info.status,
username:response.data.content_info.username,
time:response.data.content_info.time,
},
{
name: '性能审核情况',
id:"Performance",
},
]
newlist=arr
}
if(response.data.content_info===undefined&&response.data.perference_info!=undefined){
let arr=[
{
name: '内容审核情况',
id:"Content",
},
{
name: '性能审核情况',
id:"Performance",
status:response.data.perference_info.status,
username:response.data.perference_info.username,
time:response.data.perference_info.time,
},
]
newlist=arr
}
if(response.data.content_info!=undefined&&response.data.perference_info!=undefined){
let arr=[
{
name: '内容审核情况',
id:"Content",
status:response.data.content_info.status,
username:response.data.content_info.username,
time:response.data.content_info.time,
},
{
name: '性能审核情况',
id:"Performance",
status:response.data.perference_info.status,
username:response.data.perference_info.username,
time:response.data.perference_info.time,
},
]
newlist=arr
}
this.setState({
datas:newlist
})
}
}).catch((error) => {
console.log(error)
});
}
showModal = () => {
showModal = (id,status) => {
debugger
this.setState({
visible: true,
editid:id,
value:status
});
};
handleOk = e => {
console.log(e);
handleOk=(id,editid)=>{
let url = `/shixuns/${this.props.match.params.shixunId}/review_shixun.json`;
axios.post(url, {
status: id===undefined?1:id,
review_type: editid,
}).then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message);
this.setState({
visible: false,
});
this.getdatas()
}
}).catch((error) => {
console.log(error)
});
};
handleCancel = e => {
console.log(e);
this.setState({
visible: false,
});
};
onChange = e => {
console.log('radio checked', e.target.value);
this.setState({
value: e.target.value,
});
};
render() {
const { tpmLoading, shixun, user, match } = this.props;
let {value,editid,datas}=this.state;
console.log(this.props)
return (
<React.Fragment>
@ -77,14 +175,14 @@ class Audit_situationComponent extends Component {
}
</style>
<Radio.Group onChange={this.onChange} value={this.state.value}>
<Radio.Group onChange={this.onChange} value={this.state.value===undefined?1:this.state.value}>
<Radio value={1}>已完成</Radio>
<Radio value={2}>未完成</Radio>
<Radio value={0}>未完成</Radio>
</Radio.Group>
<div className={"mt30"}>
<a className="pop_close task-btn mr20 margin-tp26" onClick={()=>this.handleCancel()}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" onClick={()=>this.handleOk()}>确定</a>
<a className="task-btn task-btn-orange margin-tp26" onClick={()=>this.handleOk(value,editid)}>确定</a>
</div>
</div>
@ -102,6 +200,7 @@ class Audit_situationComponent extends Component {
`
}
</style>
{ tpmLoading ? <div style={{ minHeight: '886px'}}></div> :
<div className="tpmComment educontent clearfix mt30 mb80">
@ -116,23 +215,14 @@ class Audit_situationComponent extends Component {
></TPMNav>
<div className="padding20 edu-back-white mt20" style={{minHeight: '640px'}}>
<List
dataSource={[
{
name: '内容审核情况',
id:1,
},
{
name: '性能审核情况',
id:2,
},
]}
{this.props.identity >2||this.props.identity===undefined?"":<List
dataSource={datas}
bordered
renderItem={(item,key) => (
<List.Item
key={item.id}
actions={[
<a onClick={()=>this.showModal(item.id)} key={key}>
<a onClick={()=>this.showModal(item.id,item.status)} key={key}>
<i className="iconfont icon-bianjidaibeijing font-22 color-green"></i>
</a>,
]}
@ -140,19 +230,18 @@ class Audit_situationComponent extends Component {
<List.Item.Meta
title={<div className={"font-16"}>
<div className={"Itemtitle"}>{item.name}</div>
<Tag color="#FF6800">已完成</Tag>
<Tag color="#bcbcbc">未完成</Tag>
{item.status===undefined?"":item.status===1?<Tag color="#FF6800">已完成</Tag>:<Tag color="#bcbcbc"></Tag>}
</div>}
description={
<div>
<span>审核时间: 2019-10-17 10:42</span>
<span className={"ml30"}>审核人 XXX</span>
{item.time===undefined?"":<span>审核时间: {item.time}</span>}
{item.username===undefined?"":<span className={"ml30"}>审核人: {item.username}</span>}
</div>
}
/>
</List.Item>
)}
/>
/>}
</div>
</div>

@ -28,11 +28,9 @@ class TPMNav extends Component {
>背景知识</Link>
}
<Link to={`/shixuns/${shixunId}/repository`}
style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}}
className={`${match.url.indexOf('/repository') != -1 ? 'active' : ''} fl mr40`}>版本库</Link>
{secret_repository && <Link to={`/shixuns/${shixunId}/secret_repository`}
style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}}
{ this.props.identity >4||this.props.identity===undefined ?"":<Link to={`/shixuns/${shixunId}/repository`}
className={`${match.url.indexOf('/repository') != -1 ? 'active' : ''} fl mr40`}>版本库</Link>}
{this.props.identity >4||this.props.identity===undefined ?"": secret_repository && <Link to={`/shixuns/${shixunId}/secret_repository`}
className={`${match.url.indexOf('secret_repository') != -1 ? 'active' : ''} fl mr40`}>私密版本库</Link>}
<Link to={`/shixuns/${shixunId}/collaborators`}
@ -44,8 +42,8 @@ class TPMNav extends Component {
<Link to={`/shixuns/${shixunId}/ranking_list`}
className={`${match.url.indexOf('ranking_list') != -1 ? 'active' : ''} fl mr40`}>排行榜</Link>
<Link to={`/shixuns/${shixunId}/audit_situation`}
className={`${match.url.indexOf('audit_situation') != -1 ? 'active' : ''} fl`}>审核情况</Link>
{this.props.identity >2||this.props.identity===undefined?"":<Link to={`/shixuns/${shixunId}/audit_situation`}
className={`${match.url.indexOf('audit_situation') != -1 ? 'active' : ''} fl`}>审核情况</Link>}
<a
href={`/shixuns/${shixunId}/settings`} className="edu-default-btn edu-blueline-btn ml20 fr"

Loading…
Cancel
Save