diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 6ae01046..39c59eb0 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -13,7 +13,7 @@ export function getImageUrl(path) { // const local = 'http://localhost:3000' // const local = 'http://39.105.176.215:49999'; const local = 'http://111.8.36.180:8000'; - path && !path.startsWith('/') && (path = '/'.concat(path)); + path && !path.startsWith('/') && !path.startsWith('http') && (path = '/'.concat(path)); if (isDev) { return `${local}${path}` } diff --git a/src/forge/Component/NoticeModal/SystemNotice.jsx b/src/forge/Component/NoticeModal/SystemNotice.jsx index 33871e8c..29708e7f 100644 --- a/src/forge/Component/NoticeModal/SystemNotice.jsx +++ b/src/forge/Component/NoticeModal/SystemNotice.jsx @@ -6,12 +6,21 @@ import RenderHtml from '../../../components/render-html'; import cookie from 'react-cookies'; // import axios from 'axios'; -function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice}){ +function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice,location}){ const [ visible , setVisible ] = useState(false); useEffect(()=>{ if(system_notification && !cookie.load('notice_stage')){ - setVisible(true); + let pathname=history.location.pathname; + let isCompetition=pathname.indexOf('/competition/')>-1; + let openNotice=true; + // 非启智竞赛路由不展示启智通知 + if(isCompetition&&system_notification.subject.indexOf('启智')&&!(pathname.indexOf('/competition/qz2022')>-1)){ + openNotice=false; + } + + openNotice&&setVisible(true); } + },[system_notification,history.location]) // useEffect(()=>{ diff --git a/src/home/QzModal/index.jsx b/src/home/QzModal/index.jsx index 6d26f158..8c7ccaf2 100644 --- a/src/home/QzModal/index.jsx +++ b/src/home/QzModal/index.jsx @@ -2,8 +2,9 @@ import React, { memo, useEffect, useState } from 'react'; import { Button, Modal } from 'antd'; import { Link } from 'react-router-dom'; -import bg from '../img/modal.png'; -import bg_local from '../img/modal_local.png'; +// import bg from '../img/modal.png'; +import bg from '../img/ckds.jpg'; +// import bg_local from '../img/modal_local.png'; import './index.scss'; @@ -37,9 +38,9 @@ function QzModal() { width='728px' maskClosable={false} > - -1?bg_local: bg} /> - - 查看详情 + {/* -1?bg_local: bg} /> */} + + 查看详情 ) } diff --git a/src/home/QzModal/index.scss b/src/home/QzModal/index.scss index 94f07959..99ecbf91 100644 --- a/src/home/QzModal/index.scss +++ b/src/home/QzModal/index.scss @@ -6,6 +6,7 @@ img { border-radius: 2px; + width: 100%; } } diff --git a/src/home/Slider/index.jsx b/src/home/Slider/index.jsx index c5237855..7c54e8a7 100644 --- a/src/home/Slider/index.jsx +++ b/src/home/Slider/index.jsx @@ -38,14 +38,14 @@ function SecondSection() {
- +
- + diff --git a/src/home/Slider/index.scss b/src/home/Slider/index.scss index 5cfd035d..a9841804 100644 --- a/src/home/Slider/index.scss +++ b/src/home/Slider/index.scss @@ -9,6 +9,7 @@ .competition-slide-item { display: flex; justify-content: center; + align-items: center; height: 2.6vw; } @@ -18,7 +19,8 @@ } .competition-text { - width: 23.5vw; + // width: 23.5vw; + height: 2vw; } @keyframes ballRotation { diff --git a/src/home/img/ckds.jpg b/src/home/img/ckds.jpg new file mode 100644 index 00000000..a4813347 Binary files /dev/null and b/src/home/img/ckds.jpg differ diff --git a/src/home/img/slider.png b/src/home/img/slider.png index 598e7a7d..74cabc2e 100644 Binary files a/src/home/img/slider.png and b/src/home/img/slider.png differ diff --git a/src/managements/competition/setting/index.jsx b/src/managements/competition/setting/index.jsx index 3944906a..5081b497 100644 --- a/src/managements/competition/setting/index.jsx +++ b/src/managements/competition/setting/index.jsx @@ -21,6 +21,9 @@ export default Form.create()(({ form, match, history, current_user, showNotifica const [plainOptions, setPlainOptions] = useState([]); const [admin_data, setAdmin_data] = useState([]); + const [contentMd,setContentMd]=useState(false); + const [guideMd,setGuideMd]=useState(false); + let tableRef = useRef(); useEffect(() => { @@ -49,27 +52,29 @@ export default Form.create()(({ form, match, history, current_user, showNotifica // manager_ids: details.manager_ids, }; setFieldsValue(initValue); + setContent(details.content); + setGuide(details.guide); + setAbout_us(details.about_us); setTimeout(() => { - setContent(details.content); + setContentMd(true); }, 200); setTimeout(() => { - setGuide(details.guide); - }, 800); + setGuideMd(true); + }, 300); setTimeout(() => { - setAbout_us(details.about_us); document.querySelector('#title').focus(); - }, 1400); + setLoading(false); + }, 600); if (details.is_local) { zonesArr(details.zones_local); } else { zonesArr(details.zones); } setAdmin_data(Array.isArray(details.admin_data) ? details.admin_data : []); + }else{ + setLoading(false); } - setLoading(false); }).catch((error) => { - }).finally(() => { - setLoading(false); }) } }, [id]) @@ -314,26 +319,26 @@ export default Form.create()(({ form, match, history, current_user, showNotifica - { onContentChange(value, 'content') }} - /> + />} {getFieldDecorator("content", { rules: [{ required: true, message: "请输入大赛介绍" }], })()} - { onContentChange(value, 'guide') }} - /> + />} {getFieldDecorator("guide", { rules: [{ required: true, message: "请输入赛事指南" }], })()} diff --git a/src/managements/components/layouts/index.jsx b/src/managements/components/layouts/index.jsx index 53b9e6cc..7623add6 100644 --- a/src/managements/components/layouts/index.jsx +++ b/src/managements/components/layouts/index.jsx @@ -44,9 +44,6 @@ export default (props) => { sessionStorage.setItem("current_user", JSON.stringify(current_user)); }, [current_user.login]); - useEffect(() => { - - }, []) useEffect(() => { @@ -69,7 +66,6 @@ export default (props) => { } function itemClick(item) { - console.log(111); let myIframe = document.getElementById("iframe"); if (myIframe) { myIframe.height = 'auto'; @@ -112,14 +108,36 @@ export default (props) => { try { let myIframe = document.getElementById("iframe"); if (myIframe.contentDocument) { - myIframe.height = myIframe.contentDocument.querySelector('.content').clientHeight + 60; + myIframe.height = myIframe.contentDocument.querySelector('.content').clientHeight + 260; myIframe.contentDocument.querySelector('.admin-body-container').style.overflow = 'hidden'; + // let MutationObserver =window.MutationObserver ; + + // // let MutationObserver =myIframe.contentWindow.MutationObserver || myIframe.contentWindow.WebKitMutationObserver || myIframe.contentWindow.MozMutationObserver; + // let observer = new MutationObserver(function (mutations) { + // console.log("asdf", mutations); + // }); + // observer.observe(myIframe.contentDocument.querySelector('.content'), { + // attributes: true, + // attributeFilter:['style'], + // attributeOldValue:true + // }); } } catch (err) { console.error(err); } } + // useEffect(() => { + // try { + // document.getElementById("iframe").contentDocument.querySelector('.content').addEventListener("message", iframeHeight, false); + // return () => { + // document.getElementById("iframe").contentDocument.querySelector('.content').removeEventListener("message", iframeHeight, false); + // } + // } catch (err) { + // console.error(err); + // } + // }, []); + function onOpenChange(newOpenKeys) { const latestOpenKey = newOpenKeys.find(key => openKeys.indexOf(key) === -1); if (rootSubmenuKeys.indexOf(latestOpenKey) === -1) { @@ -150,7 +168,7 @@ export default (props) => { function iframeHeight(e) { if (e.origin === main_web_site_url && e.data && !isNaN(e.data)) { - document.getElementById("iframe").height=Number(e.data); + document.getElementById("iframe").height=Number(e.data)+20; } } diff --git a/src/managements/components/layouts/index.scss b/src/managements/components/layouts/index.scss index 49af46ca..e5cc64d5 100644 --- a/src/managements/components/layouts/index.scss +++ b/src/managements/components/layouts/index.scss @@ -3,7 +3,8 @@ top: 70px; left: 0; width: 13.75rem; - height: 100vh; + height: calc(100vh - 70px); + padding-bottom: 5vh; overflow: hidden; overflow-y: scroll; background-color:#ffffff; diff --git a/src/managements/index.js b/src/managements/index.js index 3e9e8f76..dd29ba4d 100644 --- a/src/managements/index.js +++ b/src/managements/index.js @@ -136,7 +136,7 @@ const MenuList = Loadable({ const Managements = (propsF) => { return ( -
+
@@ -330,5 +330,5 @@ export default withRouter( ImageLayerOfCommentHOC({ imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget", parentSelector: ".newMain", - })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Managements)))) + })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Managements,{noFooter:true})))) ); diff --git a/src/managements/index.scss b/src/managements/index.scss index 3004018a..bf6ea144 100644 --- a/src/managements/index.scss +++ b/src/managements/index.scss @@ -1,8 +1,11 @@ +.managementMain{ + padding:0; +} .managements{ margin-left: 13.75rem; padding:0 1.875rem 1.6rem; background: #f6f9fe; - min-height: 80vh; + min-height: calc(100vh - 70px); .content{ margin-top:1rem; } diff --git a/src/managements/notice/index.css b/src/managements/notice/index.css index ecfa2ff0..a7b79a1a 100644 --- a/src/managements/notice/index.css +++ b/src/managements/notice/index.css @@ -4,7 +4,7 @@ background: #fff; border-radius: 1em; box-shadow: 0 1px 2px #d9d9d9; - overflow-y: scroll; + padding-bottom: 1vh; } .notice-title { diff --git a/src/managements/statistics/global/index.jsx b/src/managements/statistics/global/index.jsx index 686b8fde..4ee09286 100644 --- a/src/managements/statistics/global/index.jsx +++ b/src/managements/statistics/global/index.jsx @@ -35,7 +35,7 @@ export default function Global(props){ url: 'http://111.8.36.180:8092/api/GlobalResourcesData/', method: 'get', }).then(res => { - if (res.code === '1') { + if (res.data) { const data = res.data; setTotalProjects(data.totalProjects); setTotalMembers(data.totalMembers); diff --git a/src/military/competition.js b/src/military/competition.js index 60888d75..e4520745 100644 --- a/src/military/competition.js +++ b/src/military/competition.js @@ -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'; @@ -49,6 +49,10 @@ const Refer = Loadable({ loader: () => import('./competition/refer'), loading: Loading, }) +const Rank = Loadable({ + loader: () => import('./competition/rank'), + loading: Loading, +}); const Chat = Loadable({ loader: () => import('./competition/chat'), loading: Loading, @@ -66,7 +70,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 +121,7 @@ const Qz2022 = (props) => { useEffect(() => { // 获取竞赛详情 - getQz2022(competitionId).then(response => { + getCompetitionDetail(competitionId).then(response => { if (response && response.status === 200) { setQzDetail(response.data.data); } @@ -149,9 +153,10 @@ const Qz2022 = (props) => { props.showNotification("您还未报名竞赛!"); } else if (enrollStatus && enrollStatus.status === 0) { props.showNotification("报名信息被管理员驳回!"); - } else if (['ccks','zstp2022'].includes(competitionId)&& enrollStatus && enrollStatus.status === 1) { + } else if (['ccks', 'zstp2022'].includes(competitionId) && enrollStatus && enrollStatus.status === 1) { props.showNotification("您的报名信息未通过审核!"); - } else { + } else if(['ccks', 'zstp2022'].includes(competitionId) && applyStatus ){ + }else{ !referStatus ? props.showNotification(!referEnd ? `竞赛尚未开始提交作品,提交作品开始时间为:${qzDetail && qzDetail.enroll_date.substring(0, 10)}` : "比赛已结束") : ""; } } @@ -163,8 +168,8 @@ const Qz2022 = (props) => { {/* banner图+选项 */} - {banner_url&&} - {pathname.indexOf("qz2022")>-1 && } + {banner_url && } + {pathname.indexOf("qz2022") > -1 && }
{/* {paths.indexOf(active) !== -1 && */} @@ -184,16 +189,25 @@ const Qz2022 = (props) => { 通知公告 {/* 处于报名阶段正常跳转到报名页面,不处于右侧弹消息 */} -
  • + {competitionId === 'qz2022' ?
  • { current_user && current_user.login ? !applyStatus && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名 +
  • :
  • + 1) && current_user && current_user.login ? `/competition/${competitionId}/apply` : '' }} onClick={() => { current_user && current_user.login ? !applyStatus&& ( enrollStatus && enrollStatus.status<2 ) && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名
  • + } {competitionId === 'qz2022' ?
  • 提案提交
  • :
  • - 提案提交 + 1 ? `/competition/${competitionId}/refer` : '' }} onClick={goToRefer}>提案提交
  • } + { + ['ccks', 'zstp2022'].includes(competitionId) &&
  • + 排行榜 +
  • + } + {competitionId === 'qz2022' &&
  • 数据统计
  • } @@ -258,6 +272,12 @@ const Qz2022 = (props) => { () => () } > + {/* 排行榜 */} + () + } + > {/* 交流互动 */} { {/* 大赛介绍 */} (competitionId=='qz2022'? :) + () => (competitionId == 'qz2022' ? : ) } > @@ -317,5 +337,5 @@ export default withRouter( ImageLayerOfCommentHOC({ imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget", parentSelector: ".newMain", - })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Qz2022)))) + })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Competition)))) ); diff --git a/src/military/competition/api.js b/src/military/competition/api.js index c197c6e6..17740720 100644 --- a/src/military/competition/api.js +++ b/src/military/competition/api.js @@ -5,39 +5,39 @@ 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`); } // 报名启智2022 竞赛?debug=teacher -export async function enrollCompetition(data,competitionId){ - return axios.post(`/competition_infos/${competitionId}/enroll.json`,data); +export async function enrollCompetition(data, competitionId) { + return axios.post(`/competition_infos/${competitionId}/enroll.json`, data); } // 修改报名信息 -export async function enrollUpdate(data,competitionId){ - return axios.post(`/competition_infos/${competitionId}/enroll_update.json`,data); +export async function enrollUpdate(data, competitionId) { + return axios.post(`/competition_infos/${competitionId}/enroll_update.json`, data); } // 统计启智2022 竞赛 -export async function stattistics(competitionId){ - return axios.get( `/competition_infos/${competitionId}/statistics.json`); +export async function stattistics(competitionId) { + return axios.get(`/competition_infos/${competitionId}/statistics.json`); } // 竞赛提交作品 -export async function uploadCompetition(data,competitionId){ - return axios.post(`/competition_infos/${competitionId}/upload.json`,data); +export async function uploadCompetition(data, competitionId) { + return axios.post(`/competition_infos/${competitionId}/upload.json`, data); } // 管理-竞赛报名列表?debug=admin -export function getQzEnrollList(params,competitionId) { - return axios.get(`/competition_infos/${competitionId}/enroll_list.json`,params={params}); +export function getEnrollList(params, competitionId) { + return axios.get(`/competition_infos/${competitionId}/enroll_list.json`, params = { params }); } // 管理-竞赛提交作品列表&debug=admin -export function getQzProList(params,competitionId) { - return axios.get(`/competition_infos/${competitionId}/enroll_list.json?upload=true`,params={params}); +export function getProList(params, competitionId) { + return axios.get(`/competition_infos/${competitionId}/enroll_list.json?upload=true`, params = { params }); } // 通知公告列表 @@ -46,36 +46,41 @@ export function getNoticeList(competitionId) { } // 通知公告详情 -export function getNoticeDetail(id,competitionId) { +export function getNoticeDetail(id, competitionId) { return axios.get(`/competition_infos/${competitionId}/competition_notices/${id}.json`); } // 新增通知 -export async function addQz2022Notice(data,competitionId){ - return axios.post(`/competition_infos/${competitionId}/competition_notices.json`,data); +export async function addCompetitionNotice(data, competitionId) { + return axios.post(`/competition_infos/${competitionId}/competition_notices.json`, data); } // 编辑通知 -export async function updateQz2022Notice(id,data,competitionId){ - return axios.put(`/competition_infos/${competitionId}/competition_notices/${id}.json`,data); +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){ - return axios.put(`/competition_infos/${competitionId}.json`,data); +export async function updateCompetition(data, competitionId) { + return axios.put(`/competition_infos/${competitionId}.json`, data); } // 修改竞赛报名状态 -export async function updateEnroll(data,competitionId){ - return axios.post(`/competition_infos/${competitionId}/enroll_status_update.json`,data); +export async function updateEnroll(data, competitionId) { + return axios.post(`/competition_infos/${competitionId}/enroll_status_update.json`, data); } // 报名表扫描件上传 -export async function updateTemplate(data,competitionId){ - return axios.post(`/competition_infos/${competitionId}/upload_enroll_template.json`,data); +export async function updateTemplate(data, competitionId) { + return axios.post(`/competition_infos/${competitionId}/upload_enroll_template.json`, data); +} + + +export async function rankingList(competitionId, params) { + return axios.get(`/competition_infos/${competitionId}/ranking_list.json`, { params }); } \ No newline at end of file diff --git a/src/military/competition/apply/ccks.jsx b/src/military/competition/apply/ccks.jsx index 95100aba..17213b4e 100644 --- a/src/military/competition/apply/ccks.jsx +++ b/src/military/competition/apply/ccks.jsx @@ -44,7 +44,7 @@ export default Form.create()((props) => { const applyStatus = qzDetail ? Date.parse(new Date()) < Date.parse(new Date(qzDetail.enroll_date)) : true; - if ((current_user && !current_user.login) || !applyStatus) { + if ((current_user && !current_user.login) || (!applyStatus && (enrollStatus && enrollStatus.status<2))) { history.push(`/competition/${competitionId}`); } if ( @@ -77,7 +77,7 @@ export default Form.create()((props) => { // form表单公共处理函数 const helper = useCallback( - (label, name, rules, widget, extra,className) => ( + (label, name, rules, widget, extra, className) => ( {getFieldDecorator(name, { rules, validateFirst: true })(widget)} @@ -96,14 +96,14 @@ export default Form.create()((props) => { // 检查用户填写信息 function checkInfo() { - if(!files.length){ - setFieldsValue({enroll_template_id:''}) + if (!files.length) { + setFieldsValue({ enroll_template_id: '' }) } setErrorMessage(undefined); // 检查用户输入的成员属性是否完全 if (members.length > 0) { let all = 0; - const len =3; + const len = 3; // 用户输入的长度是否满足要求 let sizes = 0; members.map((item) => { @@ -186,7 +186,7 @@ export default Form.create()((props) => { info.file.status === "removed" ) { setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1)); - + } } @@ -199,15 +199,15 @@ export default Form.create()((props) => { // 进行文件大小检查 function beforeUpload(file) { const isLt100M = file.size / 1024 / 1024 < 10; - const isType = file.type === "image/png" || file.type === "image/jpg" || file.type === "image/jpeg" ||file.name.endsWith(".zip") || file.name.endsWith(".rar"); - if(!isType){ + const isType = file.type === "image/png" || file.type === "image/jpg" || file.type === "image/jpeg" || file.name.endsWith(".zip") || file.name.endsWith(".rar"); + if (!isType) { message.error("只能上传指定类型文件"); } if (!isLt100M) { message.error("文件大小必须小于10MB"); } - - return isLt100M &&isType; + + return isLt100M && isType; } return ( @@ -218,11 +218,10 @@ export default Form.create()((props) => {
    个人信息 @@ -231,9 +230,8 @@ export default Form.create()((props) => {
    报名审核中 @@ -242,9 +240,8 @@ export default Form.create()((props) => {
    报名成功 @@ -379,7 +376,7 @@ export default Form.create()((props) => {
    {/*

    成员 :

    */} - + {qzDetail && ( { {enrollStatus && enrollStatus.enroll_info.mail}
    - +
    队长单位证明 : @@ -453,28 +450,28 @@ export default Form.create()((props) => { )}
    - {enrollStatus && enrollStatus.enroll_info.members.length ?
    + {enrollStatus && enrollStatus.enroll_info.members.length ?
    成员 : { - 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(',')} -
    :''} +
    : ''}
    - {enrollStatus && enrollStatus.enroll_info.status == 2 &&qzDetail && qzDetail.enroll_template&& ( + {enrollStatus && enrollStatus.enroll_info.status == 2 && qzDetail && qzDetail.enroll_template && ( {enrollStatus && - (!enrollStatus.enroll_status || enrollStatus.status === 0) && ( + (!enrollStatus.enroll_status || enrollStatus.status === 0) && + (
    : } - onConfirm={() => { reject(record.user_id, 2) }} - > - } - } + // { + // title: '操作', + // dataIndex: "status", + // align: "center", + // render: (text, record) => { + // return text === 1 ? : } + // onConfirm={() => { reject(record.user_id, 2) }} + // > + // } + // } ]; }, [qzDetail]); @@ -222,7 +228,7 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) { } // 外网环境下 赛队成员无职务、JXJXJX属性 const expandRowWai = (record) => { - return
    + return
    序号
    姓名
    diff --git a/src/military/competition/management/index.scss b/src/military/competition/management/index.scss index 287ce72b..7d27ed92 100644 --- a/src/military/competition/management/index.scss +++ b/src/military/competition/management/index.scss @@ -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; diff --git a/src/military/competition/management/qz2022.jsx b/src/military/competition/management/qz2022.jsx index 27d5a7d3..0e372b67 100644 --- a/src/military/competition/management/qz2022.jsx +++ b/src/military/competition/management/qz2022.jsx @@ -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
    {index+1}
    {item.real_name}
    -
    {item.org_name}
    +
    {item.org_name&&{item.org_name}}
    {item.org_job}
    {item.org_rank}
    @@ -225,7 +225,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) { } // 外网环境下 赛队成员无职务、JXJXJX属性 const expandRowWai = (record) =>{ - return
    + return
    序号
    姓名
    diff --git a/src/military/competition/notice/addNotice.jsx b/src/military/competition/notice/addNotice.jsx index 20d0d836..b4ba6422 100644 --- a/src/military/competition/notice/addNotice.jsx +++ b/src/military/competition/notice/addNotice.jsx @@ -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`); diff --git a/src/military/competition/notice/index.jsx b/src/military/competition/notice/index.jsx index 7fc15db0..0db79e50 100644 --- a/src/military/competition/notice/index.jsx +++ b/src/military/competition/notice/index.jsx @@ -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("删除成功"); diff --git a/src/military/competition/rank/index.jsx b/src/military/competition/rank/index.jsx new file mode 100644 index 00000000..b09fc8f3 --- /dev/null +++ b/src/military/competition/rank/index.jsx @@ -0,0 +1,105 @@ +import React, { useEffect, useState } from "react"; +import { Tabs, Input, Pagination, Table, Tooltip } from 'antd'; +import { rankingList } from '../api'; +import rank_start from "../image/rank_start.png"; +import PaginationTable from "../../components/paginationTable"; + +import './index.scss'; +import '../index.scss'; +import { set } from "lodash"; +const { Search } = Input; +function Rank({ isLocal, match }) { + const { competitionId } = match.params; + const [keyword, setKeyword] = useState(''); + const [curPage, setCurPage] = useState(1); + const [list, setList] = useState([]); + const [total, setTotal] = useState(0); + const [loading, setLoading] = useState(false); + + const columns = [{ + title: '排名', + dataIndex: 'rank_num', + className: 'ranking-num', + render: (text, record, i) => { + return text < 4 ?
    : text + } + }, + { + title: '参赛单位', + dataIndex: 'org_name', + width: '30%', + render: (text, record) => { + return {text}; + } + }, + { + title: '参赛队长', + dataIndex: 'leader', + }, + { + title: '三元组个数', + dataIndex: 'other_score_1', + className: 'textCenter', + }, + { + title: '分数', + dataIndex: 'score', + className: 'textCenter', + }, + ] + + useEffect(() => { + rankingList(competitionId, { + page: curPage, + limit: 20, + keyword, + }).then(res => { + if (res && res.data && res.data.message == "success") { + setList(res.data.data); + setTotal(res.data.count) + } + }) + }, [keyword, curPage]) + + return ( +
    +
    +
    +
    +
    +
    + 排 行 榜 +
    +
    + +
    + +
    + { setKeyword(value);setCurPage(1) }} + /> +
    + {/* row.id || i} + dataSource={list} + columns={columns} + /> */} + + setCurPage(page)} + current={curPage} + pageSize={20} /> + + + + + ) +} +export default Rank; \ No newline at end of file diff --git a/src/military/competition/rank/index.scss b/src/military/competition/rank/index.scss new file mode 100644 index 00000000..d9ec4ead --- /dev/null +++ b/src/military/competition/rank/index.scss @@ -0,0 +1,144 @@ +.rang-bg { + position: relative; + background-color: #fcfcfc; + padding: 20px 0 70px; + + .rank_bg1 { + position: absolute; + width: 33.45vw; + height: 27.5vw; + background-image: url("../image/rank_bg1.png"); + background-size: 100% 100%; + left: 0; + z-index: 0; + } + .rank_bg2 { + position: absolute; + width: 33.45vw; + height: 27.5vw; + top: 10vw; + right: 0; + z-index: 0; + background-image: url("../image/rank_bg1.png"); + background-size: 100% 100%; + } +} +.rank { + position: relative; + margin: 0 auto; + padding: 10px; + background-color: #4c5ef1; + border-radius: 5px; + z-index: 10; + .rank-head { + text-align: center; + } + .head-tit { + display: inline-flex; + justify-content: center; + align-items: center; + color: #ffdc9f; + font-size: 24px; + margin: 15px auto 20px; + } + .head-tit-img { + display: inline-block; + margin: 0 18px; + width: 64px; + height: 15px; + background-image: url("../image/rank_tit.png"); + background-size: 100% 100%; + + &:last-child { + transform: rotate(180deg); + } + } + .rank-search { + text-align: right; + margin: -15px auto 10px; + .ant-input-group-wrapper { + width: 30%; + } + .ant-input { + border: 0 !important; + background: #f1f3ff !important; + } + } + .ant-input-group { + .ant-input-affix-wrapper { + height: 40px; + } + .ant-input-search-button { + font-size: 20px; + width: 61px; + height: 40px; + border-color: #7e89ff; + background-color: #7e89ff; + border-radius: 0px 4px 4px 0px; + } + } + + .rank-list { + position: relative; + background: #fff; + padding: 40px; + border-radius: 10px; + + .pagination-table .ant-table{ + border:0; + } + .ant-table-thead > tr > th { + background: inherit; + + .ant-table-column-title { + color: #1d2f60; + font-size: 16px; + } + } + + .ant-table-tbody > tr > td { + border-bottom: 1px dashed #bed4ff; + color: #485884; + font-size: 15px; + } + + .rank-icon { + width: 36px; + height: 35px; + margin: 0 auto; + } + .rank1 { + background-image: url("../image/rank_first.png"); + background-size: 100% 100%; + } + .rank2 { + background-image: url("../image/rank_second.png"); + background-size: 100% 100%; + } + .rank3 { + background-image: url("../image/rank_third.png"); + background-size: 100% 100%; + } + } + + .ant-table-tbody > tr:nth-child(2n) > td { + background: #f8faff; + } + // .ant-table-tbody > tr:nth-child(2) > td { + // background: #fff; + // } + + .ccks_start { + position: absolute; + width: 187px; + top: -10px; + left: -19px; + } + + .ranking-num { + text-align: center; + } + .textCenter { + text-align: center; + } +} diff --git a/src/military/competition/refer/ccks.jsx b/src/military/competition/refer/ccks.jsx new file mode 100644 index 00000000..4953bdaf --- /dev/null +++ b/src/military/competition/refer/ccks.jsx @@ -0,0 +1,180 @@ +import React, { useState, useEffect } from "react"; +import { Prompt } from 'react-router-dom' +import { Select, Button, Upload, Modal, Icon, message } from 'antd'; +import { appendFileSizeToUploadFileAll, getUploadActionUrl, getImageUrl } from 'educoder'; +import { current_main_site_url } from '../fetch.js'; +import { uploadCompetition } from '../api'; +import ccks_upload from "../image/ccks_upload.png"; +import ccks_upload_success from "../image/ccks_upload_success.png"; +import ccks_csv from "../image/ccks_csv.png"; + + +import './index.scss'; +import '../../index.scss'; +import '../apply/index.scss'; + +function Introduce({ form, showNotification, match, history, enrollStatus, current_user, qzDetail, setReload }) { + const { competitionId } = match.params; + + console.log(enrollStatus); + // 是否允许用户上传作品 + // const upload = enrollStatus && (!enrollStatus.upload_status || enrollStatus.upload_status === 1); + + const [upload, setUpload] = useState(false); + // 上传文件时 按钮loading效果 + const [loading, setLoading] = useState(false); + const [files, setFiles] = useState(); + // 用户是否更改上传的作品列表 + const [changeFiles, setChangeFiles] = useState(false); + const [visible, setVisible] = useState(false); + + window.onbeforeunload = function (e) { + if (changeFiles) { + e.returnValue = "离开此页面将不保留已上传的作品文件,确定离开?"; + } + } + + useEffect(() => { + if (enrollStatus && (!enrollStatus.upload_status || enrollStatus.upload_status === 1)) { + setUpload(true); + } + }, [enrollStatus]) + + + useEffect(() => { + // referStatus : 当前时间不处于提案提交时间 + if (qzDetail && enrollStatus && current_user) { + const referStatus = qzDetail && !(Date.parse(new Date()) < Date.parse(new Date(qzDetail.upload_date))); + // 当前时间不处于提案提交时间 或者用户未登录情况下 或者用户未报名 通过URL访问此页面,跳转到大赛介绍页面 或者用户报名信息被驳回未处理(enrollStatus.status = 0) + if (referStatus || (current_user && !current_user.login) || (enrollStatus && (!enrollStatus.enroll_status || enrollStatus.status <2))) { + history.push(`/competition/${competitionId}`); + } + } + + }, [qzDetail, current_user, enrollStatus]) + + useEffect(() => { + if (enrollStatus && enrollStatus.upload_status) { + enrollStatus.attachments.map(item => { + item.uid = 'rc-upload' + item.id; + item.name = item.title; + item.status = "done"; + }); + setFiles(enrollStatus.attachments); + } + }, [enrollStatus]); + + function handleChange(info) { + if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') { + setLoading(true); + setFiles(info.fileList.slice(-1)) + } + if (info.file.status === "done" || info.file.status === 'removed') { + setLoading(false); + setChangeFiles(true); + } + } + + // 支持文件下载 + function download(file) { + const fileId = file.id || file.response.id; + window.open(`${current_main_site_url}/api/attachments/${fileId}`); + } + + // 进行文件大小检查 + function beforeUpload(file) { + const isZip = file.name.endsWith(".csv"); + if (!isZip) { + showNotification(`只能上传csv文件`); + } + const isLt100M = file.size / 1024 / 1024 < 50; + if (!isLt100M) { + showNotification(`文件大小必须小于${50}MB!`); + } + return isLt100M && isZip; + } + + // 作品提交 + function referProduction() { + if (files && files.length === 1) { + const params = { + "attachment_ids": [files[0].response.id] + } + uploadCompetition(params, competitionId).then(response => { + if (response && response.status === 200) { + setChangeFiles(false); + setReload(Math.random()); + setVisible(false); + setUpload(false); + message.success('提交作品成功'); + } else { + message.error(response.data.message); + } + }) + } + } + + return ( +
    +
    +
    + { + changeFiles && + '离开此页面将不保留已上传的作品文件,确定离开?'} + /> + } +
    +
    上传作品
    + {upload ?
    + +
    请上传utf-8编码格式的csv格式作品
    + + + +
    + :
    + +
    您的作品已上传成功,可在排行榜实时查看作品得分
    +
    + } + + { + Array.isArray(files) && files.map(i => { + return
    + {i.name} {i.filesize} + {enrollStatus && enrollStatus.enroll_info && enrollStatus.enroll_info && enrollStatus.enroll_info.api_result_text &&
    {enrollStatus.enroll_info.api_result_text}
    } +
    + }) + } + + {upload ? + : + } +
    + { setVisible(false) }} + centered + wrapClassName="applyInfoCon" + cancelText="" + > +
    确定提交作品
    + 可重复提交,每天最多可提交一次作品! +
    +
    + ) +} +export default Introduce; \ No newline at end of file diff --git a/src/military/competition/refer/index.jsx b/src/military/competition/refer/index.jsx index c611e04d..a50ef3b6 100644 --- a/src/military/competition/refer/index.jsx +++ b/src/military/competition/refer/index.jsx @@ -1,146 +1,14 @@ -import React, { useState, useEffect } from "react"; -import {Prompt} from 'react-router-dom' -import {Select, Button, Upload, Modal, Icon, message } from 'antd'; -import { appendFileSizeToUploadFileAll, getUploadActionUrl } from 'educoder'; -import {current_main_site_url} from '../fetch.js'; -import {uploadCompetition} from '../api'; -import refer from "../image/refer.svg"; - +import React, {useState, useCallback} from "react"; +import Qz2022 from './qz2022'; +import Ccks from './ccks'; import './index.scss'; -import '../../index.scss'; -import '../apply/index.scss'; +import '../index.scss'; -function Introduce({ form, showNotification, match, history, enrollStatus, current_user, qzDetail, setReload}) { +export default (props)=>{ + const {match} = props; const { competitionId } = match.params; - // 上传文件时 按钮loading效果 - const [loading, setLoading] = useState(false); - const [files, setFiles] = useState(); - // 用户是否更改上传的作品列表 - const [changeFiles, setChangeFiles] = useState(false); - const [visible, setVisible] = useState(false); - - window.onbeforeunload = function (e) { - if(changeFiles){ - e.returnValue = "离开此页面将不保留已上传的作品文件,确定离开?"; - } - } - - useEffect(()=>{ - // referStatus : 当前时间不处于提案提交时间 - const referStatus = qzDetail && !(Date.parse(new Date()) > Date.parse(new Date(qzDetail.enroll_date)) && Date.parse(new Date()) < Date.parse(new Date(qzDetail.upload_date))); - // 当前时间不处于提案提交时间 或者用户未登录情况下 或者用户未报名 通过URL访问此页面,跳转到大赛介绍页面 或者用户报名信息被驳回未处理(enrollStatus.status = 0) - if(referStatus || (current_user && !current_user.login) || (enrollStatus && (!enrollStatus.enroll_status || enrollStatus.status === 0))){ - history.push(`/competition/${competitionId}`); - } - },[qzDetail, current_user, enrollStatus]) - - useEffect(() => { - if(enrollStatus && enrollStatus.upload_status){ - enrollStatus.attachments.map(item=>{ - item.uid = 'rc-upload'+item.id; - item.name = item.title; - item.status = "done"; - }); - setFiles(enrollStatus.attachments); - } - }, [enrollStatus]); - - function handleChange(info) { - if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') { - setLoading(true); - setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1)) - } - if(info.file.status === "done" || info.file.status === 'removed'){ - setLoading(false); - setChangeFiles(true); - } - } - - // 支持文件下载 - function download(file){ - const fileId = file.id || file.response.id; - window.open(`${current_main_site_url}/api/attachments/${fileId}`); - } - - // 进行文件大小检查 - function beforeUpload(file){ - const isZip = file.name.endsWith(".zip") || file.name.endsWith(".tar") || file.name.endsWith(".rar"); - if(!isZip){ - showNotification(`只能上传压缩包文件`); - } - const isLt100M = file.size / 1024 / 1024 < 50; - if (!isLt100M) { - showNotification(`文件大小必须小于${50}MB!`); - } - return isLt100M && isZip; - } - - // 作品提交 - function referProduction(){ - if(files && files.length === 1){ - const params = { - "attachment_ids": [files[0].response.id] - } - uploadCompetition(params,competitionId).then(response=>{ - if(response && response.status === 200){ - setChangeFiles(false); - setReload(Math.random()); - setVisible(false); - message.success('提交作品成功'); - }else{ - message.error(response.data.message); - } - }) - } - } - // 是否允许用户上传作品 - const upload = enrollStatus && (!enrollStatus.upload_status || enrollStatus.status === 1); - return ( -
    - { - changeFiles && - '离开此页面将不保留已上传的作品文件,确定离开?'} - /> - } -
    - - , - showRemoveIcon: false - }} - > - - - - {enrollStatus && enrollStatus.upload_status && enrollStatus.status === 1 &&
    您的作品被打回,可以再次提交作品,未重新提交前保留您原来的提交记录。
    } -
    上传单个作品压缩包(仅限上传一个压缩包)
    -
    - -
    - {setVisible(false)}} - centered - wrapClassName="applyInfoCon" - cancelText="" - > -
    确定提交作品
    - 提交后作品文件将无法修改! -
    -
    + + return( + competitionId=="qz2022"? : ) -} -export default Introduce; \ No newline at end of file +} \ No newline at end of file diff --git a/src/military/competition/refer/index.scss b/src/military/competition/refer/index.scss index 51656039..5cf290ff 100644 --- a/src/military/competition/refer/index.scss +++ b/src/military/competition/refer/index.scss @@ -1,53 +1,151 @@ -.refer_bg{ - padding: 40px 0 60px; +.refer_bg { + padding: 40px 0 60px; } -.refer{ - background-color:white; - // border:1px solid rgba(46, 91, 254, 0.37); - border-radius:4px 4px 0px 0px; - display: flex; - align-items: center; - flex-direction: column; - padding: 66px 0 86px; - .refer_img{ - width: 48px; +.refer { + position: relative; + background-color: white; + // border:1px solid rgba(46, 91, 254, 0.37); + border-radius: 4px 4px 0px 0px; + display: flex; + align-items: center; + flex-direction: column; + padding: 66px 0 86px; + .refer_img { + width: 48px; + } + .upload { + padding: 0 28px; + } + .refer_tip { + color: #595959; + font-size: 15px; + &.cover { + color: red; + margin-bottom: -20px; } - .upload{ - padding: 0 28px; + &.cover .icon-erciqueren_icon { + color: #fa2d2d; } - .refer_tip{ - color:#595959; - font-size:15px; - &.cover{ - color: red; - margin-bottom: -20px; - } - &.cover .icon-erciqueren_icon{ - color: #FA2D2D; - } + } + .refer_bor { + width: 40vw; + border-bottom: 1px solid #eeeeee; + margin: 25px 0 35px; + } + > span { + text-align: center; + } + .ant-upload-list-item-info { + color: #2e5bfe; + :hover { + color: #2e5bfe; } - .refer_bor{ - width: 40vw; - border-bottom: 1px solid #eeeeee; - margin: 25px 0 35px; + .ant-upload-list-item-card-actions { + right: -55px; + .anticon { + padding-right: 10px; + } } - >span{ - text-align: center; + & a:link { + color: #2e5bfe; } - .ant-upload-list-item-info{ - color: #2e5bfe; - :hover{color: #2e5bfe;} - .ant-upload-list-item-card-actions{ - right: -55px; - .anticon{padding-right: 10px;} - } - & a:link{ - color: #2e5bfe; - } + } + .ant-upload-list-item:hover .ant-upload-list-item-info { + background: none; + } + .ant-upload-list-item { + text-overflow: ellipsis; + max-width: 46vw; + } + + &.ccks_refer { + border-radius: 10px; + padding: 24px 57px; + .refer_content { + text-align: center; + width: 100%; + height: 252px; + background-image: linear-gradient(180deg, #f7fafe 0%, #f2f8ff 100%); + border: 1px dashed #c0c4d3; + + .refer_img { + width: 92px; + margin: 33px auto 24px; + } } - .ant-upload-list-item:hover .ant-upload-list-item-info{background: none;} - .ant-upload-list-item{ - text-overflow: ellipsis; - max-width: 46vw; + + .upload { + color: #4154f1; + border-color: #4154f1; + &:hover { + opacity: 0.75; + } } -} \ No newline at end of file + + .refer_tip { + color: #243b55; + font-size: 17px; + text-align: center; + margin-bottom: 15px; + } + + + .ccks_csv { + align-self: flex-start; + margin-top: 24px; + color: #243b55; + font-size: 15px; + display: flex; + .ccks_csv_img { + width: 34px; + margin-right: 10px; + } + .filesize { + margin-left: 10px; + color: #90a0b2; + } + + .error_text{ + margin-left: 30px; + color: red; + } + } + } + .ant-btn-primary{ + margin-top:35px; + } + .refer_tit { + font-weight: 700; + color: #0b1929; + font-size: 18px; + align-self: flex-start; + margin-bottom: 5px; + } +} + + +.rang-bg { + position: relative; + background-color: #f7f7f7; + padding:40px 0 70px; + + .rank_bg1{ + position: absolute; + width: 33.45vw; + height: 27.5vw; + background-image: url("../image/rank_bg1.png"); + background-size: 100% 100%; + left:0; + z-index: 0; + } + .rank_bg2{ + position: absolute; + width: 33.45vw; + height: 27.5vw; + top:10vw; + right: 0; + z-index: 0; + background-image: url("../image/rank_bg1.png"); + background-size: 100% 100%; + } + } \ No newline at end of file diff --git a/src/military/competition/refer/qz2022.jsx b/src/military/competition/refer/qz2022.jsx new file mode 100644 index 00000000..621c335b --- /dev/null +++ b/src/military/competition/refer/qz2022.jsx @@ -0,0 +1,152 @@ +import React, { useState, useEffect } from "react"; +import { Prompt } from 'react-router-dom' +import { Select, Button, Upload, Modal, Icon, message } from 'antd'; +import { appendFileSizeToUploadFileAll, getUploadActionUrl } from 'educoder'; +import { current_main_site_url } from '../fetch.js'; +import { uploadCompetition } from '../api'; +import refer from "../image/refer.svg"; + +import './index.scss'; +import '../../index.scss'; +import '../apply/index.scss'; + +function Introduce({ form, showNotification, match, history, enrollStatus, current_user, qzDetail, setReload }) { + const { competitionId } = match.params; + // 上传文件时 按钮loading效果 + const [loading, setLoading] = useState(false); + const [files, setFiles] = useState(); + // 用户是否更改上传的作品列表 + const [changeFiles, setChangeFiles] = useState(false); + const [visible, setVisible] = useState(false); + + window.onbeforeunload = function (e) { + if (changeFiles) { + e.returnValue = "离开此页面将不保留已上传的作品文件,确定离开?"; + } + } + + useEffect(() => { + // referStatus : 当前时间不处于提案提交时间 + const referStatus = qzDetail && !(Date.parse(new Date()) > Date.parse(new Date(qzDetail.enroll_date)) && Date.parse(new Date()) < Date.parse(new Date(qzDetail.upload_date))); + // 当前时间不处于提案提交时间 或者用户未登录情况下 或者用户未报名 通过URL访问此页面,跳转到大赛介绍页面 或者用户报名信息被驳回未处理(enrollStatus.status = 0) + if (referStatus || (current_user && !current_user.login) || (enrollStatus && (!enrollStatus.enroll_status || enrollStatus.status === 0))) { + history.push(`/competition/${competitionId}`); + } + }, [qzDetail, current_user, enrollStatus]) + + useEffect(() => { + if (enrollStatus && enrollStatus.upload_status) { + enrollStatus.attachments.map(item => { + item.uid = 'rc-upload' + item.id; + item.name = item.title; + item.status = "done"; + }); + setFiles(enrollStatus.attachments); + } + }, [enrollStatus]); + + function handleChange(info) { + if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') { + setLoading(true); + setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1)) + } + if (info.file.status === "done" || info.file.status === 'removed') { + setLoading(false); + setChangeFiles(true); + } + } + + // 支持文件下载 + function download(file) { + const fileId = file.id || file.response.id; + window.open(`${current_main_site_url}/api/attachments/${fileId}`); + } + + // 进行文件大小检查 + function beforeUpload(file) { + const isZip = file.name.endsWith(".zip") || file.name.endsWith(".tar") || file.name.endsWith(".rar"); + if (!isZip) { + showNotification(`只能上传压缩包文件`); + } + const isLt100M = file.size / 1024 / 1024 < 50; + if (!isLt100M) { + showNotification(`文件大小必须小于${50}MB!`); + } + return isLt100M && isZip; + } + + // 作品提交 + function referProduction() { + if (files && files.length === 1) { + const params = { + "attachment_ids": [files[0].response.id] + } + uploadCompetition(params, competitionId).then(response => { + if (response && response.status === 200) { + setChangeFiles(false); + setReload(Math.random()); + setVisible(false); + message.success('提交作品成功'); + + // 三分钟后刷新一次结果 + setTimeout(() => { + setReload(Math.random()); + }, 180000); + } else { + message.error(response.data.message); + } + }) + } + } + // 是否允许用户上传作品 + const upload = enrollStatus && (!enrollStatus.upload_status || enrollStatus.status === 1); + return ( +
    + { + changeFiles && + '离开此页面将不保留已上传的作品文件,确定离开?'} + /> + } +
    + + , + showRemoveIcon: false + }} + > + + + + {/* {enrollStatus && enrollStatus.upload_status && enrollStatus.status === 1 &&
    您的作品被打回,可以再次提交作品,未重新提交前保留您原来的提交记录。
    } */} +
    {enrollStatus && enrollStatus.upload_status && enrollStatus.status === 1 ? "您的作品被打回,可以再次提交作品,未重新提交前保留您原来的提交记录。" : "提案提交后不允许再修改,如有问题请联系分赛区管理员"}
    +
    上传单个作品压缩包(仅限上传一个压缩包)
    +
    + +
    + { setVisible(false) }} + centered + wrapClassName="applyInfoCon" + cancelText="" + > +
    确定提交作品
    + 提交后作品文件将无法修改! +
    +
    + ) +} +export default Introduce; \ No newline at end of file diff --git a/src/military/javaFetch.js b/src/military/javaFetch.js index 1930e9e7..e50a3cc9 100644 --- a/src/military/javaFetch.js +++ b/src/military/javaFetch.js @@ -97,7 +97,8 @@ service.interceptors.response.use( message: "提示", description: res.data.message || '无权限!', }); - if(window.location.port !== "3007"){ + if(window.location.port !== "3007" && !res.config.url.startsWith('/api/tasks/getTask/')){ + // console.log(res); window.location.href="/403"; } return Promise.reject('error'); diff --git a/src/military/task/components/itemListTask/index.jsx b/src/military/task/components/itemListTask/index.jsx index 5d8d8019..6626ee5c 100644 --- a/src/military/task/components/itemListTask/index.jsx +++ b/src/military/task/components/itemListTask/index.jsx @@ -4,6 +4,7 @@ import { getImageUrl } from 'educoder'; import Nodata from 'forge/Nodata'; import { taskStatusAllArr } from '../../static'; import Loading from "src/Loading"; +import chuangke_icon from '../../image/chuangke_icon.svg'; import './index.scss'; const statusArr = []; @@ -31,7 +32,10 @@ export default (props) => {
    { itemClick(item.id) }}> + {/* {item.enterpriseName=="taohuayuan" ||item.enterpriseName=="军工企业" &&
    创客行动-2022
    } */} + {item.enterpriseName=="taohuayuan" && }
    {item.name}
    + {/* 为创客行动特地加的标签,以后会去除 */} {item.status && {item.exceptClosedBoolean ? '已关闭' : statusArr[item.status]}} {(item.status !== 8) && item.delayTime.indexOf('延期') > -1 ? 延期中 : diff --git a/src/military/task/components/itemListTask/index.scss b/src/military/task/components/itemListTask/index.scss index 7accfd22..71793ca0 100644 --- a/src/military/task/components/itemListTask/index.scss +++ b/src/military/task/components/itemListTask/index.scss @@ -32,6 +32,28 @@ display: inline-block; max-width: 80%; } + .chuangke_icon{ + position: relative; + top:-10px; + margin-left: -40px; + } + // .chuangke_icon{ + // position: relative; + // top:-8px; + // background-image: url("../../image/chuangke_icon.png"); + // width: 140px; + // height: 46px; + // background-size: 100% 100%; + // font-size: 14px; + // color: #fff; + // display: flex; + // transform: scale(0.75); + // justify-content: center; + // align-items: center; + // padding-left: 10px; + // margin-right: -15px; + // margin-left: -27px; + // } } .list-title:hover { color: #4154f1; @@ -55,3 +77,4 @@ margin-right: 5px; } } + diff --git a/src/military/task/image/chuangke_icon.svg b/src/military/task/image/chuangke_icon.svg new file mode 100644 index 00000000..18b9a37f --- /dev/null +++ b/src/military/task/image/chuangke_icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/military/task/taskDetail/index.jsx b/src/military/task/taskDetail/index.jsx index c13c893d..ed344dfc 100644 --- a/src/military/task/taskDetail/index.jsx +++ b/src/military/task/taskDetail/index.jsx @@ -29,7 +29,7 @@ for (const item of applyStatusAllArr) { export default Form.create()( forwardRef((props, ref) => { - const { match, current_user, form, history, showNotification, mygetHelmetapi } = props; + const { match, current_user, form, history, showNotification, mygetHelmetapi ,showLoginDialog} = props; const id = match.params.taskId; const { getFieldDecorator, validateFields, setFieldsValue } = form; @@ -57,6 +57,11 @@ export default Form.create()( // 已发布评审任务 评审规则 const [publishedReviewRules, setPublishedReviewRules] = useState(undefined); + useEffect(()=>{ + !current_user.login&&showLoginDialog(); + },[current_user.login]); + + // 获取任务领域配置数据 useEffect(() => { getTaskCategory().then(data => { @@ -87,21 +92,21 @@ export default Form.create()( // 检查用户是否同意协议 useEffect(() => { - current_user.user_id && id && checkAgreement(id).then(res => { + current_user.login && id && checkAgreement(id).then(res => { if (res && res.data && res.data.status === 1) { setSignAgreement(true); } }) - }, [current_user.user_id]); + }, [current_user.login]); // 检查用户是否上传成果 useEffect(() => { - current_user.user_id && id && checkHavePaper(id).then(res => { + current_user.login && id && checkHavePaper(id).then(res => { if (res && res.data && res.data.status === 1) { setIsPaper(true); } }) - }, [current_user.user_id]); + }, [current_user.login]); const taskLimit = useMemo(() => { if (current_user.admin) { @@ -114,7 +119,7 @@ export default Form.create()( // 获取协议内容 useEffect(() => { - applyModal && getAgreement(1).then(res => { + applyModal&¤t_user.login && getAgreement(1).then(res => { if (res && res.data) { setApplyContent({ title: res.data.title, @@ -122,12 +127,12 @@ export default Form.create()( }); } }); - }, [applyModal]); + }, [applyModal,current_user.login]); // 获取成果列表 useEffect(() => { // 等加载完成果详情再加载成果列表 - if (detailData.id) { + if (detailData.id && current_user.login) { setLoading(true); let params = { taskId: id, @@ -150,7 +155,7 @@ export default Form.create()( setTotal(data.total); }); } - }, [id, status, curPage, reload, relaodChildList, detailData]); + }, [id, status, curPage, reload, relaodChildList, detailData ,current_user.login]); // 流程步骤显示,返回剩余时间 @@ -354,7 +359,8 @@ export default Form.create()( ) } else if (detailData.user && (current_user.login !== detailData.user.login)) { return
    - + {/* 为创客大赛,暂时disable应征投稿 */} +
    } }, [signAgreement, isPaper, current_user, detailData, dataList]); @@ -451,7 +457,8 @@ export default Form.create()(
    } -
    知识产权说明:
    + {/* 配合创客大赛,暂时注释,以后还原 */} + {/*
    知识产权说明:

    1、参赛作品一经采用,其所有权、修改权和使用权均归主办方所有,设计者不得再在任何地方使用;
    2、应征者所提交的作品必须由应征者本人创作或参与创作,应征者应确认其作品的原创性,主办单位不承担因作品侵犯他人(或单位)的权利而产生的法律责任,其法律责任由应征者本人承担。 @@ -459,7 +466,8 @@ export default Form.create()(

    交稿声明:

    应征者提交的稿件必须是设计作品,广告等无效交稿一律不采用! -

    +

    */} + {publishedReviewRules &&
    评审规则:

    {publishedReviewRules.rule}

    @@ -470,10 +478,14 @@ export default Form.create()(
    }
    - {!current_user.enterpriseCertification &&
    + {!current_user.enterpriseCertification && current_user.login &&} + {!current_user.login &&
    + 创客任务仅限登录用户查看,请先注册登录红山开源账号! +
    } + {current_user.enterpriseCertification && detailData.status === 3 && (!detailData.exceptClosedBoolean) && signContent()}
    diff --git a/src/military/task/taskDetail/index.scss b/src/military/task/taskDetail/index.scss index 2f12465d..ef350ede 100644 --- a/src/military/task/taskDetail/index.scss +++ b/src/military/task/taskDetail/index.scss @@ -150,12 +150,6 @@ } } -.task-detail{ - .ant-btn-primary{ - background-color:#4154f1; - border-color: #4154f1; - } -} .agreement-content{ box-sizing: border-box; diff --git a/src/modules/403/Shixunauthority.js b/src/modules/403/Shixunauthority.js index 1e781f45..38e1a791 100644 --- a/src/modules/403/Shixunauthority.js +++ b/src/modules/403/Shixunauthority.js @@ -11,7 +11,7 @@ class Shixunauthority extends Component { {/*mt100 mb100*/}

    - 您可以稍后尝试 返回首页 {/* ,或者