From 2d541100470d158068dbe0bc6daf1849feeda0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= Date: Fri, 13 May 2022 17:21:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=B3=E8=BD=AC=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/military/qz2022.js | 4 ++-- src/military/qz2022/api.js | 4 ++-- src/military/qz2022/statistics/index.jsx | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 970cd620..66814afe 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || 'a' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/military/qz2022.js b/src/military/qz2022.js index 3aa9dccd..ff8a4fcf 100644 --- a/src/military/qz2022.js +++ b/src/military/qz2022.js @@ -82,10 +82,10 @@ const Qz2022 = (props) => { const menu = ( - { current_user && !current_user.login && props.showLoginDialog() }}>报名列表 + { current_user && !current_user.login && props.showLoginDialog() }}>报名列表 - { current_user && !current_user.login && props.showLoginDialog() }}>作品列表 + { current_user && !current_user.login && props.showLoginDialog() }}>作品列表 ); diff --git a/src/military/qz2022/api.js b/src/military/qz2022/api.js index 764d109a..e2085e1b 100644 --- a/src/military/qz2022/api.js +++ b/src/military/qz2022/api.js @@ -21,8 +21,8 @@ export async function enrollUpdate(data){ } // 统计启智2022 竞赛 -export async function stattistics(data){ - return axios.get( `/competition_infos/qz2022/statistics.json`); +export async function stattistics(competitionId){ + return axios.get( `/competition_infos/${competitionId}/statistics.json`); } // 竞赛提交作品 diff --git a/src/military/qz2022/statistics/index.jsx b/src/military/qz2022/statistics/index.jsx index 55b2ade5..3e2dbd06 100644 --- a/src/military/qz2022/statistics/index.jsx +++ b/src/military/qz2022/statistics/index.jsx @@ -12,7 +12,8 @@ import EchartBar from './EchartBar'; const initBarYData = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]; -function Statistics({ showNotification, qzDetail }) { +function Statistics({ showNotification, qzDetail,match }) { + const {competitionId}=match.params; const is_local= qzDetail &&qzDetail.is_local; const [pieArr, setPieArr] = useState([]); @@ -24,7 +25,7 @@ function Statistics({ showNotification, qzDetail }) { useEffect(() => { - stattistics().then(res => { + stattistics(competitionId).then(res => { if (res && res.data && Array.isArray(res.data.data)) { let pieArrList = []; let xData = [];