forked from Gitlink/forgeplus-react
优化竞赛,回归相应issue
This commit is contained in:
parent
83d97b3a1c
commit
bf822e763d
|
@ -10,10 +10,10 @@ import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfComme
|
|||
import './competition/index.scss';
|
||||
import { Menu, Popover, Spin } from "antd";
|
||||
import InfoModal from './competition/components/infoModal';
|
||||
import banner from './competition/image/banner.jpg';
|
||||
import banner_local from './competition/image/banner_local.jpg';
|
||||
// import banner from './competition/image/banner.jpg';
|
||||
// import banner_local from './competition/image/banner_local.jpg';
|
||||
import logo from './competition/image/logo.png';
|
||||
import { getQz2022, userCompetitionStatus } from "./competition/api";
|
||||
import { getCompetitionDetail, userCompetitionStatus } from "./competition/api";
|
||||
// import { paths } from "./competition/static";
|
||||
import Login from './components/login';
|
||||
|
||||
|
@ -66,7 +66,7 @@ const Management = Loadable({
|
|||
loading: Loading,
|
||||
})
|
||||
|
||||
const Qz2022 = (props) => {
|
||||
const Competition = (props) => {
|
||||
const { history, current_user, match } = props;
|
||||
const { location } = history;
|
||||
const { pathname } = location;
|
||||
|
@ -117,7 +117,7 @@ const Qz2022 = (props) => {
|
|||
|
||||
useEffect(() => {
|
||||
// 获取竞赛详情
|
||||
getQz2022(competitionId).then(response => {
|
||||
getCompetitionDetail(competitionId).then(response => {
|
||||
if (response && response.status === 200) {
|
||||
setQzDetail(response.data.data);
|
||||
}
|
||||
|
@ -317,5 +317,5 @@ export default withRouter(
|
|||
ImageLayerOfCommentHOC({
|
||||
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||
parentSelector: ".newMain",
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Qz2022))))
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Competition))))
|
||||
);
|
||||
|
|
|
@ -5,8 +5,8 @@ export async function userCompetitionStatus(competitionId) {
|
|||
return axios.get(`/competition_infos/${competitionId}/enroll_status.json`);
|
||||
}
|
||||
|
||||
// 启智2022详情接口
|
||||
export function getQz2022(competitionId) {
|
||||
// 竞赛详情接口
|
||||
export function getCompetitionDetail(competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}.json`);
|
||||
}
|
||||
|
||||
|
@ -31,12 +31,12 @@ export async function uploadCompetition(data,competitionId){
|
|||
}
|
||||
|
||||
// 管理-竞赛报名列表?debug=admin
|
||||
export function getQzEnrollList(params,competitionId) {
|
||||
export function getEnrollList(params,competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}/enroll_list.json`,params={params});
|
||||
}
|
||||
|
||||
// 管理-竞赛提交作品列表&debug=admin
|
||||
export function getQzProList(params,competitionId) {
|
||||
export function getProList(params,competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}/enroll_list.json?upload=true`,params={params});
|
||||
}
|
||||
|
||||
|
@ -51,22 +51,22 @@ export function getNoticeDetail(id,competitionId) {
|
|||
}
|
||||
|
||||
// 新增通知
|
||||
export async function addQz2022Notice(data,competitionId){
|
||||
export async function addCompetitionNotice(data,competitionId){
|
||||
return axios.post(`/competition_infos/${competitionId}/competition_notices.json`,data);
|
||||
}
|
||||
|
||||
// 编辑通知
|
||||
export async function updateQz2022Notice(id,data,competitionId){
|
||||
export async function updateCompetitionNotice(id,data,competitionId){
|
||||
return axios.put(`/competition_infos/${competitionId}/competition_notices/${id}.json`,data);
|
||||
}
|
||||
|
||||
// 删除通知
|
||||
export async function deleteQz2022Notice(id,competitionId){
|
||||
export async function deleteCompetitionNotice(id,competitionId){
|
||||
return axios.delete(`/competition_infos/${competitionId}/competition_notices/${id}.json`);
|
||||
}
|
||||
|
||||
// 编辑大赛介绍、大赛指南、关于我
|
||||
export async function updateQz2022(data,competitionId){
|
||||
export async function updateCompetition(data,competitionId){
|
||||
return axios.put(`/competition_infos/${competitionId}.json`,data);
|
||||
}
|
||||
|
||||
|
|
|
@ -460,16 +460,16 @@ export default Form.create()((props) => {
|
|||
enrollStatus &&
|
||||
enrollStatus.enroll_info.members &&
|
||||
enrollStatus.enroll_info.members.map((item) => {
|
||||
return item.real_name + ",";
|
||||
})
|
||||
return item.real_name;
|
||||
}).join(',')
|
||||
}
|
||||
placement="topLeft"
|
||||
>
|
||||
{enrollStatus &&
|
||||
enrollStatus.enroll_info.members &&
|
||||
enrollStatus.enroll_info.members.map((item) => {
|
||||
return item.real_name + ",";
|
||||
})}
|
||||
return item.real_name
|
||||
}).join(',')}
|
||||
</Tooltip>
|
||||
</div>:''}
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Button, Form, message, Input } from 'antd';
|
|||
import { Link } from "react-router-dom";
|
||||
import icon from '../image/notice_breadcrumb.svg';
|
||||
import MDEditor from '../../../modules/tpm/challengesnew/tpm-md-editor';
|
||||
import { updateQz2022 } from "../api";
|
||||
import { updateCompetition } from "../api";
|
||||
import '../index.scss';
|
||||
import '../notice/index.scss';
|
||||
import '../notice/detail.scss';
|
||||
|
@ -43,7 +43,7 @@ export default Form.create()((props) => {
|
|||
const params = {
|
||||
'competition_info': info,
|
||||
}
|
||||
updateQz2022(params,competitionId).then(response=>{
|
||||
updateCompetition(params,competitionId).then(response=>{
|
||||
if(response && response.data.message === "success"){
|
||||
setReloadDetail(Math.random());
|
||||
message.success('更新成功');
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Select, Button, Tooltip, Input, Popconfirm, message } from 'antd';
|
|||
import { current_main_site_url } from '../fetch';
|
||||
import PaginationTable from "../../components/paginationTable";
|
||||
|
||||
import { getQzEnrollList, getQzProList, updateEnroll } from "../api.js";
|
||||
import { getEnrollList, getProList, updateEnroll } from "../api.js";
|
||||
const Option = Select.Option;
|
||||
const { Search } = Input;
|
||||
|
||||
|
@ -38,7 +38,7 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
}
|
||||
if (type === "applys") {
|
||||
// 报名列表
|
||||
getQzEnrollList(params, competitionId).then(response => {
|
||||
getEnrollList(params, competitionId).then(response => {
|
||||
if (response && response.status === 200) {
|
||||
setTotal(response.data.count);
|
||||
setDataList(response.data.data);
|
||||
|
@ -49,7 +49,7 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
} else {
|
||||
// 提交作品列表
|
||||
delete params.status;
|
||||
getQzProList(params, competitionId).then(response => {
|
||||
getProList(params, competitionId).then(response => {
|
||||
if (response && response.status === 200) {
|
||||
setTotal(response.data.count);
|
||||
setDataList(response.data.data);
|
||||
|
@ -97,6 +97,9 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
{
|
||||
title: '队长邮箱地址',
|
||||
dataIndex: 'mail',
|
||||
render: (text, record) => {
|
||||
return <Tooltip title={text} placement="topLeft">{text}</Tooltip>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '成员',
|
||||
|
@ -153,7 +156,10 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
},
|
||||
{
|
||||
title: '队长邮箱地址',
|
||||
dataIndex: 'mail'
|
||||
dataIndex: 'mail',
|
||||
render: (text, record) => {
|
||||
return <Tooltip title={text} placement="topLeft">{text}</Tooltip>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '作品',
|
||||
|
@ -222,7 +228,7 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
}
|
||||
// 外网环境下 赛队成员无职务、JXJXJX属性
|
||||
const expandRowWai = (record) => {
|
||||
return <div className="expandRowManage">
|
||||
return <div className="expandRowManage expandRowLess">
|
||||
<div className="row">
|
||||
<div className="index">序号</div>
|
||||
<div>姓名</div>
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
text-overflow: ellipsis;
|
||||
&.index{width: 10%;}
|
||||
}
|
||||
.expandRowLess .row div:last-child{
|
||||
width: 60%;
|
||||
}
|
||||
.expandRowManage .row{
|
||||
border-bottom: 1px solid #ececec;
|
||||
margin: 0 -8px;
|
||||
|
|
|
@ -5,7 +5,7 @@ import {current_main_site_url} from '../fetch';
|
|||
import PaginationTable from "../../components/paginationTable";
|
||||
|
||||
|
||||
import { getQzEnrollList, getQzProList, updateEnroll } from "../api.js";
|
||||
import { getEnrollList, getProList, updateEnroll } from "../api.js";
|
||||
const Option = Select.Option;
|
||||
const {Search} = Input;
|
||||
|
||||
|
@ -44,7 +44,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) {
|
|||
}
|
||||
if(type === "applys"){
|
||||
// 报名列表
|
||||
getQzEnrollList(params,competitionId).then(response=>{
|
||||
getEnrollList(params,competitionId).then(response=>{
|
||||
if(response && response.status === 200){
|
||||
setTotal(response.data.count);
|
||||
setDataList(response.data.data);
|
||||
|
@ -54,7 +54,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) {
|
|||
})
|
||||
}else{
|
||||
// 提交作品列表
|
||||
getQzProList(params,competitionId).then(response=>{
|
||||
getProList(params,competitionId).then(response=>{
|
||||
if(response && response.status === 200){
|
||||
setTotal(response.data.count);
|
||||
setDataList(response.data.data);
|
||||
|
@ -216,7 +216,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) {
|
|||
return <div className="row">
|
||||
<div className="index">{index+1}</div>
|
||||
<div>{item.real_name}</div>
|
||||
<div>{item.org_name}</div>
|
||||
<div>{item.org_name&&<Tooltip title={item.org_name} placement="topLeft">{item.org_name}</Tooltip>}</div>
|
||||
<div>{item.org_job}</div>
|
||||
<div>{item.org_rank}</div>
|
||||
</div>
|
||||
|
@ -225,7 +225,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) {
|
|||
}
|
||||
// 外网环境下 赛队成员无职务、JXJXJX属性
|
||||
const expandRowWai = (record) =>{
|
||||
return <div className="expandRowManage">
|
||||
return <div className="expandRowManage expandRowLess">
|
||||
<div className="row">
|
||||
<div className="index">序号</div>
|
||||
<div>姓名</div>
|
||||
|
|
|
@ -5,7 +5,7 @@ import icon from '../image/notice_breadcrumb.svg';
|
|||
import MDEditor from '../../../modules/tpm/challengesnew/tpm-md-editor';
|
||||
import './index.scss';
|
||||
import './detail.scss';
|
||||
import { getNoticeDetail, addQz2022Notice, updateQz2022Notice } from "../api";
|
||||
import { getNoticeDetail, addCompetitionNotice, updateCompetitionNotice } from "../api";
|
||||
|
||||
export default Form.create()((props) => {
|
||||
const {form, history, match:{params:{noticeId,type,competitionId}}, current_user, qzDetail} = props;
|
||||
|
@ -47,7 +47,7 @@ export default Form.create()((props) => {
|
|||
...values,
|
||||
content: description
|
||||
}
|
||||
type === "add" && addQz2022Notice(params,competitionId).then(response=>{
|
||||
type === "add" && addCompetitionNotice(params,competitionId).then(response=>{
|
||||
if(response && response.data.message === "success"){
|
||||
message.success('新增成功');
|
||||
history.push(`/competition/${competitionId}/notice`);
|
||||
|
@ -55,7 +55,7 @@ export default Form.create()((props) => {
|
|||
message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
type === "edit" && updateQz2022Notice(noticeId,params,competitionId).then(response=>{
|
||||
type === "edit" && updateCompetitionNotice(noticeId,params,competitionId).then(response=>{
|
||||
if(response && response.data.message === "success"){
|
||||
message.success('修改成功');
|
||||
history.push(`/competition/${competitionId}/notice`);
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Link } from "react-router-dom";
|
|||
import notice from '../image/notice.gif';
|
||||
import './index.scss';
|
||||
import '../../index.scss';
|
||||
import { getNoticeList, deleteQz2022Notice } from "../api";
|
||||
import { getNoticeList, deleteCompetitionNotice } from "../api";
|
||||
import RenderHtml from "src/components/render-html";
|
||||
|
||||
function Notice({ current_user, qzDetail,match }) {
|
||||
|
@ -26,7 +26,7 @@ function Notice({ current_user, qzDetail,match }) {
|
|||
title: "是否删除",
|
||||
content: "确定删除此通知公告?",
|
||||
onOk() {
|
||||
deleteQz2022Notice(id,competitionId).then(response => {
|
||||
deleteCompetitionNotice(id,competitionId).then(response => {
|
||||
if (response.status === 200 && response.data.message === "success") {
|
||||
setReload(Math.random());
|
||||
message.success("删除成功");
|
||||
|
|
Loading…
Reference in New Issue