序号
姓名
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*/}
- 您可以稍后尝试 返回首页
{/* ,或者