集群突击竞赛添加作品提交列表

This commit is contained in:
谢思 2023-09-06 14:38:33 +08:00
parent 6f37f5505e
commit 4e82b0a566
3 changed files with 86 additions and 47 deletions

View File

@ -170,3 +170,12 @@ export function matchReplay(data) {
data: data
});
}
// 报名列表-获取用户模拟成绩
export function getScoreList(data) {
return fetch({
url: '/api/match/simulated_match_team_list',
method: 'post',
data: data
});
}

View File

@ -2,7 +2,7 @@
width: 1200px;
margin: 35px auto 0;
background: #fff;
padding-bottom: 20px;
padding-bottom: 100px;
.qz_manage_head{
color: #181818;
padding: 12px 0 13px 30px;

View File

@ -4,7 +4,9 @@ import { Select, Button, Tooltip, Input, Popconfirm, message } from 'antd';
import { current_main_site_url } from '../fetch';
import PaginationTable from "../../components/paginationTable";
import { getEnrollList, getProList, updateEnroll, createUser, encryptionuserId } from "../api.js";
import { getEnrollList, updateEnroll, createUser, encryptionuserId, getScoreList } from "../api.js";
import moment from "moment";
import Nodata from "src/forge/Nodata";
const Option = Select.Option;
const { Search } = Input;
@ -20,6 +22,8 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
const [keyword, setKeyword] = useState(undefined);
const [reload, setReload] = useState(undefined);
const [searchValue, setSearchValue] = useState(undefined);
const [scoreList, setScoreList] = useState({});
const [loadingBut, setLoadingBut] = useState(false);
useEffect(() => {
setKeyword(undefined);
@ -34,30 +38,17 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
page: curPage,
limit: 10,
keyword,
status
}
if (type === "applys") {
//
getEnrollList(params, competitionId).then(response => {
if (response && response.status === 200) {
setTotal(response.data.count);
setDataList(response.data.data);
}
}).finally(() => {
setLoading(false);
})
} else {
//
delete params.status;
getProList(params, competitionId).then(response => {
if (response && response.status === 200) {
setTotal(response.data.count);
setDataList(response.data.data);
}
}).finally(() => {
setLoading(false);
})
status: type === "applys" ? status : '2'
}
//
getEnrollList(params, competitionId).then(response => {
if (response && response.status === 200) {
setTotal(response.data.count);
setDataList(response.data.data);
}
}).finally(() => {
setLoading(false);
})
}, [type, curPage, keyword, status, reload])
//
@ -169,24 +160,9 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
return <Tooltip title={text} placement="topLeft">{text}</Tooltip>;
}
},
{
title: '作品',
dataIndex: 'attachments',
render: (text, record) => {
return <Tooltip title={text[0] && text[0].title} placement="topLeft"><a href={current_main_site_url + (text[0] && text[0].url)} className="attachments_a">{text[0] && text[0].title}</a></Tooltip>;
}
},
{
title: '操作',
dataIndex: "status",
align: "center",
render: (text, record) => {
return text === 2 ? <Button size="small" disabled>已驳回</Button> : <Popconfirm
title="您确定驳回此用户的作品信息?"
icon={<i className="iconfont icon-shanchu_tc_icon mr3 font-15" style={{ float: 'left', color: "red" }}></i>}
onConfirm={() => { reject(record.user_id, 2) }}
><Button size="small">驳回</Button></Popconfirm>
}
align: "center"
}
];
}, [qzDetail]);
@ -252,6 +228,26 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
</div>
}
const expandRow1 = (record) => {
const score = scoreList[record.user_id];
return score && score.length ? <div className="expandRowManage">
<div className="row">
<div className="index">序号</div>
<div>模拟项目</div>
<div>模拟时间</div>
<div>模拟分数</div>
</div>
{score.map((item, index) => {
return <div className="row" key={index}>
<div className="index">{index + 1}</div>
<div>{item.subject_name}</div>
<div>{moment(item.submit_time).format('YYYY-MM-DD HH:mm:ss')}</div>
<div>{item.score}</div>
</div>
})}
</div> : <Nodata _html="暂无数据"/>
}
const customExpandIcon = (props) => {
if (props.record.members && props.record.members.length > 0) {
if (props.expanded) {
@ -264,7 +260,40 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
}}>查看成员<i className="iconfont icon-jiantou9 font-12 ml5"></i></a>
}
} else {
return <span style={{ color: 'gray' }}>查看成员</span>
return <span style={{ color: 'gray', marginRight: 8 }}>查看成员<i className="iconfont icon-jiantou9 font-12 ml5"></i></span>
}
}
const customExpandIcon1 = (props) => {
if (props.expanded) {
return <Button type="link" onClick={e => {
props.onExpand(props.record, e);
}}>查看模拟详情<i className="iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-12 ml5"></i></Button>
} else {
return <Button type="link" loading={loadingBut} onClick={e => {
const user_id = props.record.user_id;
if(scoreList[user_id]){
props.onExpand(props.record, e);
}else{
setLoadingBut(true);
getScoreList({
user_id: user_id+"",
sign: encryptionuserId(user_id)
}).then(response=>{
if (response && response.msg === "成功") {
const list = {...scoreList};
list[user_id] = response.result
setScoreList(list);
setTimeout(() => {
props.onExpand(props.record, e);
}, 0);
}else{
message.error(response.msg);
}
setLoadingBut(false);
})
}
}}>查看模拟详情<i className="iconfont icon-jiantou9 font-12 ml5"></i></Button>
}
}
@ -286,8 +315,9 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
</div>
<div>
{type === "applys" && <a href={current_main_site_url + `/api/competition_infos/${competitionId}/enroll_template.zip`}><Button className="but_2e5 ml10">导出单位证明</Button></a>}
{type === "production" && <a href={current_main_site_url + `/api/competition_infos/${competitionId}/enroll_list.zip?upload=true`}><Button className="but_2e5 ml10">导出作品文件</Button></a>}
<a href={current_main_site_url + `/api/competition_infos/${competitionId}/enroll_list.xlsx${type === "applys" ? '' : "?upload=true"}`}><Button className="but_2e5 ml10">导出{type === "applys" ? '报名信息' : '作品信息'}</Button></a>
{type === "applys" && <a href={current_main_site_url + `/api/competition_infos/${competitionId}/enroll_list.xlsx`}><Button className="but_2e5 ml10">导出报名信息</Button></a>}
{/* {type === "production" && <a href={current_main_site_url + `/api/competition_infos/${competitionId}/enroll_list.zip?upload=true`}><Button className="but_2e5 ml10">导出作品文件</Button></a>} */}
{/* <a href={current_main_site_url + `/api/competition_infos/${competitionId}/enroll_list.xlsx${type === "applys" ? '' : "?upload=true"}`}><Button className="but_2e5 ml10">导出{type === "applys" ? '报名信息' : '作品信息'}</Button></a> */}
</div>
</div>
@ -299,10 +329,10 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
total={total}
setCurPage={(page) => setCurPage(page)}
current={curPage}
expandedRowRender={qzDetail && qzDetail.is_local ? expandRow : expandRowWai}
expandIconColumnIndex={type === "applys" ? qzDetail && qzDetail.is_local ? 7 : 4 : 20}
expandedRowRender={type === "applys" ? qzDetail && qzDetail.is_local ? expandRow : expandRowWai : expandRow1}
expandIconColumnIndex={type === "applys" ? qzDetail && qzDetail.is_local ? 7 : 4 : 4}
expandIconAsCell={false}
expandIcon={customExpandIcon}
expandIcon={type === "applys" ? customExpandIcon : customExpandIcon1}
pageSize={10} />
</div>
)