批量删除
@@ -257,12 +272,12 @@ import axios from 'axios';
export default {
data () {
return {
- activeName: "", // 当前标签页
- classId: "", // 当前班级id
- classList: [], // 班级标签页列表
- permissions: Number(this.$route.query.permissions),
+ classId: +this.$route.query.classId || '', // 当前班级id
+ classes: [], // 班级标签页列表
+ permissions: +this.$route.query.permissions,
experimentalName: this.$route.query.projectName,
id: this.$route.query.id,
+ workNumber: this.$route.query.workNumber,
keyword: "",
searchTimer: null,
listDataAll: [],
@@ -302,46 +317,32 @@ export default {
}
},
mounted () {
- // 考核才需要查询班级列表
- this.permissions ?
- this.getSpliceClass() :
- this.tabs.push({
- id: '1',
- name: '活跃度'
- })
- this.getData()
+ this.permissions || this.tabs.push({
+ id: '1',
+ name: '活跃度'
+ })
+ this.getClass()
+ if (this.workNumber) {
+ this.keyword = this.workNumber
+ window.scrollTo(0, document.documentElement.scrollHeight)
+ } else {
+ this.getData()
+ }
},
methods: {
- handleClick (tab, event) { // 处理点击标签页
- if (this.classId === tab.name) return;
- this.classId = tab.name;
- sessionStorage.setItem('activeName', tab.name)
- this.getData();
- },
- // 获取拼接班级
- getSpliceClass () {
- this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`).then(res => {
- this.classList = res.list
- const activeName = sessionStorage.getItem('activeName')
- if (activeName && this.classList.some(item => item.id === activeName)) {
- this.classId = activeName
- this.activeName = activeName
- } else {
- this.classId = this.classList[0].id;
- this.activeName = this.classList[0].id;
- }
- }).catch(err => { })
+ // 获取班级下拉框数据
+ async getClass () {
+ const { list } = this.permissions ?
+ await this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`) :
+ await this.$post(this.api.myClass)
+ this.classes = list
},
- // tab切换
- tabChange () {
- this.curTab == 1 && this.getActivity()
- },
- // 获取表格数据
+ // 成绩
async getData () {
// 考核和练习调不同接口
const res = this.permissions ?
await this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}`) :
- await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyword=${this.keyword}`)
+ await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}`)
this.listDataAll = res.page.records
this.total = res.page.total
this.avgScore = (+res.avgScore).toFixed(2)
@@ -358,14 +359,14 @@ export default {
// 活跃度
async getActivity () {
// 考核和练习调不同接口
- const { message } = await this.$post(`${this.api.practiceActivity}?pageNum=${this.pageActivation}&pageSize=${this.pageSizeActivation}&projectId=${this.id}`)
+ const { message } = await this.$post(`${this.api.practiceActivity}?pageNum=${this.pageActivation}&pageSize=${this.pageSizeActivation}&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}`)
this.activations = message.records
this.totalActivation = message.total
},
initData () {
- this.$refs.table.clearSelection();
- this.page = 1;
- this.getData();
+ this.page = 1
+ this.pageActivation = 1
+ this.curTab == 0 ? this.getData() : this.getActivity()
},
// 分页
handlePage () {
@@ -374,6 +375,7 @@ export default {
},
// 查看成绩报告
show (row) {
+ this.$store.commit('achievement/setRow', null)
this.$router.push(`show?reportId=${row.reportId}`)
},
// 导出(有勾选:就导勾选中的;没有勾选:就导全部)
@@ -491,34 +493,13 @@ export default {
util.downloadFileDirect(`活跃度.xls`, new Blob([res.data]))
},
getChart () { // 初始化折线图
- const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+ const xData = Array.from({ length: 101 }, (v, k) => k)
+ const yData = Array.from({ length: 101 }, (v, k) => 0)
const list = this.listDataAll
list.map(n => {
- n.score;
- if (n.score === 0) {
- data[0]++;
- } else if (n.score > 0 && n.score <= 10) {
- data[1]++;
- } else if (n.score > 10 && n.score <= 20) {
- data[2]++;
- } else if (n.score > 20 && n.score <= 30) {
- data[3]++;
- } else if (n.score > 30 && n.score <= 40) {
- data[4]++;
- } else if (n.score > 40 && n.score <= 50) {
- data[5]++;
- } else if (n.score > 50 && n.score <= 60) {
- data[6]++;
- } else if (n.score > 60 && n.score <= 70) {
- data[7]++;
- } else if (n.score > 70 && n.score <= 80) {
- data[8]++;
- } else if (n.score > 80 && n.score <= 90) {
- data[9]++;
- } else if (n.score > 90 && n.score <= 100) {
- data[10]++;
- }
+ yData[n.score]++
})
+ console.log(333, xData, yData)
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
@@ -527,16 +508,19 @@ export default {
name: "分数",
type: "category",
boundaryGap: false,
- interval: 10,
- data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100']
+ interval: 5,
+ axisLabel: {
+ interval: 9,
+ },
+ data: xData
},
yAxis: {
name: this.permissions ? "人数" : '成绩报告数量',
type: "value",
- interval: 1
+ interval: 5
},
series: [{
- data,
+ data: yData,
type: "line",
areaStyle: {},
color: ["#8191fd"]
diff --git a/src/pages/achievement/list/course.vue b/src/pages/achievement/list/course.vue
new file mode 100644
index 0000000..26c4d65
--- /dev/null
+++ b/src/pages/achievement/list/course.vue
@@ -0,0 +1,275 @@
+
+
+
筛选
+
+
+
+
+ {{ scope.$index + (page - 1) * pageSize + 1 }}
+
+
+
+
+
+
+
+
+
+ 成绩管理
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/achievement/list/index.vue b/src/pages/achievement/list/index.vue
index 68c1afb..9d63fbf 100644
--- a/src/pages/achievement/list/index.vue
+++ b/src/pages/achievement/list/index.vue
@@ -1,431 +1,69 @@