|
|
@@ -1,13 +1,17 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <page-header :routes="[{ name: '成绩管理', path: 'result/' }]">
|
|
|
+ <page-header
|
|
|
+ :loading="isResultLoading"
|
|
|
+ :routes="[{ name: '成绩管理', path: 'result/' }]"
|
|
|
+ >
|
|
|
<template slot="title">
|
|
|
全部作业成绩
|
|
|
</template>
|
|
|
</page-header>
|
|
|
<page-body>
|
|
|
+ <page-section-loading :show="isResultLoading" />
|
|
|
<!-- container面板-->
|
|
|
- <div class="data-table">
|
|
|
+ <div v-show="!isResultLoading" class="data-table">
|
|
|
<!--下拉框&搜索框-->
|
|
|
<div class="form-group">
|
|
|
<!--下拉框-->
|
|
|
@@ -166,7 +170,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <a class="button is-link" @click="isCardModalActive = false"
|
|
|
+ <a
|
|
|
+ :class="['button', 'is-link', { 'is-loading': submitting }]"
|
|
|
+ @click="confirmPercent"
|
|
|
>确认调整</a
|
|
|
>
|
|
|
</div>
|
|
|
@@ -175,19 +181,20 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import { mapState } from "vuex";
|
|
|
-// import { getStudentCourseReviewList } from "@/api/review";
|
|
|
import PageHeader from "@/components/PageHeader";
|
|
|
import PageBody from "@/components/PageBody/index";
|
|
|
import Chart from "chart.js";
|
|
|
import BInput from "buefy/src/components/input/Input";
|
|
|
import { required, numeric, between } from "vuelidate/lib/validators";
|
|
|
import { getStudentFinaleResult } from "@/api/resultstatistics";
|
|
|
+import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
BInput,
|
|
|
PageHeader,
|
|
|
- PageBody
|
|
|
+ PageBody,
|
|
|
+ PageSectionLoading
|
|
|
},
|
|
|
validations: {
|
|
|
percent: {
|
|
|
@@ -206,15 +213,15 @@ export default {
|
|
|
name: "",
|
|
|
courses: [],
|
|
|
review: [],
|
|
|
- questionType: [
|
|
|
- { id: 1, title: "文档作业题目" },
|
|
|
- { id: 2, title: "代码作业题目" }
|
|
|
- ],
|
|
|
data: [],
|
|
|
isCardModalActive: false,
|
|
|
myChart2: {},
|
|
|
percent: "",
|
|
|
- finalResultPercentage: [20, 20, 20, 10, 10, 10, 10]
|
|
|
+ finalResultPercentage: [20, 20, 20, 10, 10, 10, 10],
|
|
|
+ submitting: false,
|
|
|
+ isServerError: false,
|
|
|
+ errorMessage: "服务器错误,请稍后重试",
|
|
|
+ isResultLoading: true
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -256,6 +263,13 @@ export default {
|
|
|
currentIndex++;
|
|
|
}
|
|
|
return parseInt(finalRes);
|
|
|
+ },
|
|
|
+ confirmPercent() {
|
|
|
+ this.submitting = true;
|
|
|
+ this.$toast.open({
|
|
|
+ message: "成绩比例调整成功",
|
|
|
+ type: "is-success"
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -263,19 +277,22 @@ export default {
|
|
|
getStudentFinaleResult(this.courses.id).then(res => {
|
|
|
console.log(res.data);
|
|
|
this.data = res.data;
|
|
|
+ this.isResultLoading = false;
|
|
|
});
|
|
|
//绘制图表
|
|
|
- var resultChart = document.getElementById("result-chart");
|
|
|
- var myChart2 = new Chart(resultChart, {
|
|
|
+ let resultChart = document.getElementById("result-chart");
|
|
|
+ let myChart2 = new Chart(resultChart, {
|
|
|
type: "bar",
|
|
|
data: {
|
|
|
labels: [
|
|
|
- "0-30分段",
|
|
|
- "30-60分段",
|
|
|
- "60-70分段",
|
|
|
- "70-80分段",
|
|
|
- "80-90分段",
|
|
|
- "90-100分段"
|
|
|
+ "0分",
|
|
|
+ "1-29分",
|
|
|
+ "30-59分段",
|
|
|
+ "60-69分段",
|
|
|
+ "70-79分段",
|
|
|
+ "80-89分段",
|
|
|
+ "90-99分段",
|
|
|
+ "100分"
|
|
|
],
|
|
|
datasets: [
|
|
|
{
|
|
|
@@ -285,7 +302,7 @@ export default {
|
|
|
borderWidth: 1,
|
|
|
pointStrokeColor: "#fff",
|
|
|
pointStyle: "crossRot",
|
|
|
- data: [6, 10, 34, 50, 80, 30],
|
|
|
+ data: [2, 6, 10, 34, 50, 80, 30, 2],
|
|
|
cubicInterpolationMode: "monotone",
|
|
|
spanGaps: "false",
|
|
|
fill: "false"
|
|
|
@@ -303,12 +320,6 @@ export default {
|
|
|
/*color: #7957d5;*/
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
-/*.data-table {*/
|
|
|
-/*width: 100%;*/
|
|
|
-/*padding: 30px;*/
|
|
|
-/*!*min-height: 80vh;*!*/
|
|
|
-/*background-color: #ffffff;*/
|
|
|
-/*}*/
|
|
|
.chart {
|
|
|
margin-top: 1.5rem;
|
|
|
}
|