修改统计及调用代码

This commit is contained in:
何童崇 2022-03-29 13:54:40 +08:00
parent ba3b6b5917
commit 4e5b2dea73
2 changed files with 258 additions and 257 deletions

View File

@ -1,5 +1,6 @@
import fetch,{main_web_site_url, current_main_site_url} from './fetch'; import fetch,{ current_main_site_url} from './fetch';
import { notification } from 'antd'; import axios from 'axios';
// 用户参与启智2022状态 // 用户参与启智2022状态
export async function userCompetitionStatus(id) { export async function userCompetitionStatus(id) {
@ -29,10 +30,11 @@ export async function enrollCompetition(data){
// 统计启智2022 竞赛 // 统计启智2022 竞赛
export async function stattistics(data){ export async function stattistics(data){
return fetch({ // return fetch({
url: `${current_main_site_url}/api/competition_infos/qz2022/statistics.json`, // url: `${current_main_site_url}/api/competition_infos/qz2022/statistics.json`,
method: 'get', // method: 'get',
}); // });
return axios.get( `/competition_infos/qz2022/statistics.json`);
} }
// 竞赛提交作品 // 竞赛提交作品
@ -69,238 +71,3 @@ export function getQzProList(params) {
params params
}); });
} }
//删除专家
export function deleteExpert(expertId) {
return fetch({
url: `/api/experts/${expertId}?isDelete=1`,
method: 'delete'
});
}
// 获取用户信息
export function getUserInfo() {
return fetch({
url: '/user/getUserInfo',
method: 'get'
});
}
// 查看当前登录用户专家信息
export function getCurrentExpert(params) {
return fetch({
url: '/api/experts/getCurrentExpert',
method: 'get',
params
});
}
//专家注册
export async function expertRegister(data){
let res = await fetch({
url: '/api/experts/register',
method: 'post',
data,
});
return res;
}
//更新专家信息
export async function expertUpdate(data){
let res = await fetch({
url: '/api/experts/',
method: 'put',
data,
});
return res;
}
//管理员审核专家信息
export async function registerCheck(data){
let res = await fetch({
url: '/api/experts/adminCheckExpert',
method: 'post',
data,
});
return res;
}
// 获取文件信息
export function getFile(id) {
return fetch({
url: `/busiAttachments/${id}`,
method: 'get'
});
}
// 获取评审任务列表
export function getExpertTasks(params) {
return fetch({
url: `/api/taskExpert/getExpertTasksPageList`,
method: 'get',
params,
});
}
// 获取竞赛作品列表
export function getCompetition(id) {
return fetch({
url: `${main_web_site_url}/api/v1/competitions/${id}/works`,
method: 'get',
});
}
// 获取竞赛详情接口
export function getCompetitionDetail(id) {
return fetch({
url: `${main_web_site_url}/api/v1/competitions/${id}`,
method: 'get',
});
}
// 查看竞赛/任务的评分细则
export function getScoringDetails(params) {
return fetch({
url: `/api/expertScoringDetails/getExpertScoringDetailsList`,
method: 'get',
params,
});
}
// 查看最终得分排行
export function getFinalScoreRankingList(params) {
return fetch({
url: `/api/expertScoringDetails/getFinalScoreRankingList`,
method: 'get',
params,
});
}
// 查看单个竞赛/任务的所有评分细则
export function getOpsScoringDetails(params) {
return fetch({
url: `/api/expertScoringDetails/getOpsExpertScoringDetailsList`,
method: 'get',
params,
});
}
// 初始化评分细则
export function initScoringDetails(data){
return fetch({
url: '/api/expertScoringDetails/initExpertScoringDetails',
method: 'post',
data,
})
}
// 更新评分细则
export function updateScoringDetails(data){
return fetch({
url: '/api/expertScoringDetails/',
method: 'put',
data,
});
}
//评选胜出者和公示者
export function selectWinnersAndPublicists(data){
return fetch({
url: '/api/expertScoringDetails/selectWinnersAndPublicists',
method: 'post',
data,
});
}
//查看胜出者和公示名单
export function getWinnersAndPublicists(params) {
return fetch({
url: `/api/expertScoringDetails/getWinnersAndPublicists`,
method: 'get',
params,
});
}
//获取创客任务评审规则
export async function getRules(params){
let response = await fetch({
url: `/api/taskRuleCriteria/getRuleAndCriteria`,
method: 'get',
params
});
if(response && response.message === "success"){
let criterias = [];
response.data.criteriaOne && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaOne);
response.data.criteriaTwo && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaTwo);
response.data.criteriaThree && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaThree);
response.data.criteriaFour && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaFour);
response.data.criteriaFive && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaFive);
response.data.criterias = criterias;
response.data.reviewData = response.data.reviewStartOn.substring(0,response.data.reviewStartOn.length-3) + " ~ " + response.data.reviewEndOn.substring(0,response.data.reviewEndOn.length-3)
}
return response;
}
//编辑评审规则(第一次)
export async function editRules(data){
let res = await fetch({
url: '/api/taskRuleCriteria/editRuleAndCriteria',
method: 'post',
data,
});
return res;
}
//更新评审规则(第一次)
export async function updateRules(data){
let res = await fetch({
url: '/api/taskRuleCriteria/',
method: 'put',
data,
});
return res;
}
//为创客任务添加评审专家
export async function assignExperts(data){
let res = await fetch({
url: '/api/taskExpert/assignExperts',
method: 'post',
data,
});
return res;
}
//删除指派专家
export function deleteExperts(taskExpertId,isDelete) {
return fetch({
url: `/api/taskExpert/${taskExpertId}?isDelete=${isDelete}`,
method: 'delete'
});
}
//已选专家列表
export function selectExpertList(params) {
return fetch({
url: `/api/taskExpert/selectedExpertPageList`,
method: 'get',
params
});
}
//竞赛任务列表
export function getCompetitionList(params) {
return fetch({
url: `/api/competitionExpert/getCompetitionList`,
method: 'get',
params
});
}
// 修改竞赛是否加入专家评审流程
export function updateCompetitionReview(data) {
return fetch({
url: `${main_web_site_url}/api/v1/competitions/update_expert_audit`,
method: 'post',
data,
});
}

View File

@ -14,15 +14,245 @@ if (clientWidth < 1000) {
} }
let fontSizeTitle = 1.25 * fontSizeText; let fontSizeTitle = 1.25 * fontSizeText;
const colorArr = ['#3b7afe', '#fccb42', '#9b80f5'] const colorArr0 = ['rgba(226, 217, 255, 1)', 'rgba(251, 201, 0, 0.36)', 'rgba(145, 193, 255, 0.61)'];
const colorArr1= ['rgba(155, 128, 245, 1)', 'rgba(254, 140, 0, 1)', 'rgba(37, 109, 255, 1)'];
export default ({ id, className, title, legendArr, xData, yData }) => { export default ({ id, className, title, legendArr, xData, yData }) => {
useEffect(() => { useEffect(() => {
let newEchartBar = document.getElementById(id) && echarts.init(document.getElementById(id)); let newEchartBar = document.getElementById(id) && echarts.init(document.getElementById(id));
let textColor = "#7988a5"; let textColor = "#7988a5";
let normalColor = "#e8e8ed"; let normalColor = "#e8e8ed";
// var colors = [
// {
// type: 'linear',
// x: 0, x2: 1, y: 0, y2: 0,
// colorStops: [{
// offset: 0,
// color: '#218bd1'
// }, {
// offset: 0.5,
// color: '#7EC3F0'
// }, {
// offset: 0.5,
// color: '#1985cd'
// }, {
// offset: 1,
// color: '#1985cd'
// }]
// },
// {
// type: 'linear',
// x: 0, x2: 1, y: 0, y2: 0,
// colorStops: [{
// offset: 0,
// color: '#6DD4E5'
// }, {
// offset: 0.5,
// color: '#6DD4E5'
// }, {
// offset: 0.5,
// color: '#0EADC9'
// }, {
// offset: 1,
// color: '#218bd1'
// }]
// },
// {
// type: 'linear',
// x: 0, x2: 1, y: 0, y2: 0,
// colorStops: [{
// offset: 0,
// color: '#acace6'
// }, {
// offset: 0.5,
// color: '#acace6'
// }, {
// offset: 0.5,
// color: '#6161bd'
// }, {
// offset: 1,
// color: '#6161bd'
// }]
// }
// ];
// var barWidth = 35;
// let option = {
// title: {
// text: 'Awesome Chart'
// },
// xAxis: {
// data: ['Sun', 'Mon', 'Tue']
// },
// legend: {
// data: ['', '',''],
// textStyle: {
// color: 'white', //
// },
// },
// tooltip:{
// trigger:'axis',
// formatter:function(params){
// // console.log(params);
// return params
// }
// },
// yAxis: {},
// series: [
// {
// z:1,
// name:'',
// type: 'bar',
// barWidth:barWidth,
// data:[320, 200, 260],
// itemStyle:{
// normal:{
// color:colors[0]
// }
// },
// }
// ,
// {
// z:3,
// name:'1',
// type:'pictorialBar',
// symbolPosition:'end',
// data:[320, 200, 260],
// symbol :'diamond',
// symbolOffset:['-165%','-50%'],
// symbolSize:[barWidth - 4,10 * (barWidth - 4) / barWidth],
// itemStyle:{
// normal:{
// borderColor: '#218bd1',
// borderWidth: 2,
// color:'#218bd1'
// }
// },
// },
// {
// name:'2',
// type: 'bar',
// label: {
// normal: {
// show: true,
// position: 'top',
// fontSize: 16,
// color: '#218bd1',
// offset: [-30, -5]
// }
// },
// itemStyle: {
// color: 'transparent'
// },
// tooltip: {
// },
// data: [320, 200, 260],
// },
// {
// z:1,
// name:'',
// type: 'bar',
// barWidth:barWidth,
// data:[170, 182, 191],
// itemStyle:{
// normal:{
// color:colors[1]
// }
// },
// }
// ,
// {
// z:3,
// name:'1',
// type:'pictorialBar',
// symbolPosition:'end',
// data:[170, 182, 191],
// symbol :'diamond',
// symbolOffset:['-15%','-50%'],
// symbolSize:[barWidth - 4,10 * (barWidth - 4) / barWidth],
// itemStyle:{
// normal:{
// borderColor: '#2edaf8',
// borderWidth: 2,
// color:'#2edaf8'
// }
// },
// },
// {
// name:'2',
// type: 'bar',
// label: {
// normal: {
// show: true,
// position: 'top',
// fontSize: 16,
// color: '#2edaf8',
// offset: [-30, -5]
// }
// },
// itemStyle: {
// color: 'transparent'
// },
// tooltip: {
// },
// data:[170, 182, 191],
// },
// {
// z:1,
// type: 'bar',
// name:'',
// barWidth:barWidth,
// data:[220, 182, 191],
// itemStyle:{
// normal:{
// color:colors[2]
// }
// },
// }
// ,
// {
// z:3,
// name:'1',
// type:'pictorialBar',
// symbolPosition:'end',
// data:[220, 182, 191],
// symbol :'diamond',
// symbolOffset:['130%','-50%'],
// symbolSize:[barWidth - 4,10 * (barWidth - 4) / barWidth],
// itemStyle:{
// normal:{
// borderColor: '#7b7be1',
// borderWidth: 2,
// color:'#7b7be1'
// }
// },
// },
// {
// name:'2',
// type: 'bar',
// label: {
// normal: {
// show: true,
// position: 'top',
// fontSize: 16,
// color: '#7b7be1',
// offset: [-30, -5]
// }
// },
// itemStyle: {
// color: 'transparent'
// },
// tooltip: {
// },
// data:[220, 182, 191],
// },
// ]
// };
let option = { let option = {
grid: { grid: {
left: "3%", left: "3%",
@ -47,8 +277,8 @@ export default ({ id, className, title, legendArr, xData, yData }) => {
// color: "#fff" // color: "#fff"
// } // }
type: 'line', type: 'line',
lineStyle:{ lineStyle: {
type:'dotted' type: 'dotted'
}, },
}, },
backgroundColor: 'rgba(255,255,255,0.8)', backgroundColor: 'rgba(255,255,255,0.8)',
@ -127,6 +357,11 @@ export default ({ id, className, title, legendArr, xData, yData }) => {
type: "bar", type: "bar",
data: data, data: data,
barWidth: "20%", barWidth: "20%",
// itemStyle: {
// normal: {
// color: colors[i]
// }
// },
itemStyle: { itemStyle: {
normal: { normal: {
color: { color: {
@ -137,27 +372,26 @@ export default ({ id, className, title, legendArr, xData, yData }) => {
y2: 1, y2: 1,
colorStops: [{ colorStops: [{
offset: 0, offset: 0,
color: colorArr[i], color: colorArr0[i],
}, },
{ {
offset: 1, offset: 1,
color: colorArr[i] color: colorArr1[i]
// color: '#7988a5'
} }
], ],
globalCoord: false globalCoord: false
} }
} }
}, },
// label: { label: {
// show: true, show: true,
// position: "top", position: "top",
// color: '#fff', color: '#fff',
// fontSize: fontSizeText, fontSize: fontSizeText,
// formatter: function (params) { formatter: function (params) {
// return params.value || '' return params.value || ''
// }, },
// } }
}); });
}); });
newEchartBar && newEchartBar.setOption(option); newEchartBar && newEchartBar.setOption(option);