|
|
|
|
@ -7411,11 +7411,15 @@ var StatisticsResult_WorkList = function WorkList(_ref) {
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
spinning = _useState8[0],
|
|
|
|
|
setSpinning = _useState8[1];
|
|
|
|
|
var myChart = null;
|
|
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
|
|
tableData = _useState10[0],
|
|
|
|
|
setTableData = _useState10[1];
|
|
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
|
|
statistics = _useState12[0],
|
|
|
|
|
setStatistics = _useState12[1];
|
|
|
|
|
var myChart = null;
|
|
|
|
|
var columns = [{
|
|
|
|
|
title: '作业总分',
|
|
|
|
|
dataIndex: 'homework_score',
|
|
|
|
|
@ -7431,7 +7435,12 @@ var StatisticsResult_WorkList = function WorkList(_ref) {
|
|
|
|
|
}, {
|
|
|
|
|
title: '参加率',
|
|
|
|
|
dataIndex: 'joined_rate',
|
|
|
|
|
ellipsis: true
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
render: function render(text, record) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
children: [text, "%"]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
title: '平均成绩',
|
|
|
|
|
dataIndex: 'average_score',
|
|
|
|
|
@ -7452,7 +7461,12 @@ var StatisticsResult_WorkList = function WorkList(_ref) {
|
|
|
|
|
}, {
|
|
|
|
|
title: '实验通过率',
|
|
|
|
|
dataIndex: 'homework_pass_rate',
|
|
|
|
|
ellipsis: true
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
render: function render(text, record) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
children: [text, "%"]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
var _res$student_works;
|
|
|
|
|
@ -7474,12 +7488,17 @@ var StatisticsResult_WorkList = function WorkList(_ref) {
|
|
|
|
|
getData();
|
|
|
|
|
}
|
|
|
|
|
}, [activeTabs]);
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
if (statistics) {
|
|
|
|
|
initEcharts();
|
|
|
|
|
}
|
|
|
|
|
}, [statistics]);
|
|
|
|
|
var onHandleChange = function onHandleChange() {
|
|
|
|
|
getData();
|
|
|
|
|
};
|
|
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
var formValue, course_group_ids, res, _res$data;
|
|
|
|
|
var formValue, course_group_ids, res, _res$data, _res$data2, arr;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
@ -7508,7 +7527,8 @@ var StatisticsResult_WorkList = function WorkList(_ref) {
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
if (res.status == 0) {
|
|
|
|
|
setTableData([res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.homework_statistics]);
|
|
|
|
|
initEcharts();
|
|
|
|
|
arr = (res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.student_socre_statistics).reverse();
|
|
|
|
|
setStatistics(arr);
|
|
|
|
|
}
|
|
|
|
|
setSpinning(false);
|
|
|
|
|
case 9:
|
|
|
|
|
@ -7524,34 +7544,72 @@ var StatisticsResult_WorkList = function WorkList(_ref) {
|
|
|
|
|
var initEcharts = function initEcharts() {
|
|
|
|
|
myChart = _echarts_4_8_0_echarts.init(document.getElementById("myChart"));
|
|
|
|
|
var option = {
|
|
|
|
|
title: {
|
|
|
|
|
text: 'World Population'
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
axisPointer: {
|
|
|
|
|
type: 'shadow'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
legend: {},
|
|
|
|
|
grid: {
|
|
|
|
|
left: '3%',
|
|
|
|
|
right: '4%',
|
|
|
|
|
right: '15%',
|
|
|
|
|
bottom: '3%',
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
name: '学生比例(%)',
|
|
|
|
|
type: 'value',
|
|
|
|
|
boundaryGap: [0, 0.01]
|
|
|
|
|
boundaryGap: [0, 0.01],
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
splitLine: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
//坐标轴在 grid 区域中的分隔线。
|
|
|
|
|
nameTextStyle: {
|
|
|
|
|
padding: [0, 0, 0, 20] // 调整 padding,使名称向右移动
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: true,
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#666',
|
|
|
|
|
type: 'solid'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
name: '成绩(分)',
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
|
|
|
|
|
data: statistics === null || statistics === void 0 ? void 0 : statistics.map(function (v) {
|
|
|
|
|
return v.name;
|
|
|
|
|
}),
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
nameTextStyle: {
|
|
|
|
|
padding: [0, 60, 0, 0] // 调整 padding,使名称向左移动
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [{
|
|
|
|
|
name: '2011',
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: [18203, 23489, 29034, 104970, 131744, 630230]
|
|
|
|
|
data: statistics === null || statistics === void 0 ? void 0 : statistics.map(function (v) {
|
|
|
|
|
return v.rate;
|
|
|
|
|
}),
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#3061D0'
|
|
|
|
|
},
|
|
|
|
|
label: {
|
|
|
|
|
show: true,
|
|
|
|
|
position: 'right',
|
|
|
|
|
// 显示在柱状图的顶部
|
|
|
|
|
color: '#3061D0',
|
|
|
|
|
formatter: function formatter(params) {
|
|
|
|
|
// 自定义格式化显示内容
|
|
|
|
|
return "".concat(params.value, "% (").concat(statistics[params === null || params === void 0 ? void 0 : params.dataIndex].num, "\u4EBA)");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
barWidth: 40,
|
|
|
|
|
// 设置柱状图的宽度
|
|
|
|
|
barCategoryGap: 18 // 设置柱状图之间的间隔
|
|
|
|
|
}]
|
|
|
|
|
};
|
|
|
|
|
myChart.setOption(option);
|
|
|
|
|
@ -7661,6 +7719,7 @@ var StatisticsResult_WorkList = function WorkList(_ref) {
|
|
|
|
|
className: StatisticsResultmodules.title,
|
|
|
|
|
children: "\u4F5C\u4E1A\u6982\u89C8"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
|
|
rowKey: 1,
|
|
|
|
|
pagination: false,
|
|
|
|
|
dataSource: tableData,
|
|
|
|
|
columns: columns
|
|
|
|
|
@ -7674,8 +7733,7 @@ var StatisticsResult_WorkList = function WorkList(_ref) {
|
|
|
|
|
style: {
|
|
|
|
|
width: '100%',
|
|
|
|
|
height: '373px',
|
|
|
|
|
background: '#F6F7F9',
|
|
|
|
|
opacity: 0.6
|
|
|
|
|
background: 'rgba(246, 247, 249, .6)'
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
id: "myChart",
|