考核管理查看成绩增加全部按钮

dev_2022-05-11
e 3 years ago
parent e50435c221
commit 1da531440c
  1. 30
      src/pages/achievement/ass/index.vue

@ -90,7 +90,15 @@ export default {
classId: this.$route.query.classId, classId: this.$route.query.classId,
projectId: this.$route.query.projectId, projectId: this.$route.query.projectId,
assessmentId:'', assessmentId:'',
classInfo: [], classInfo: [
{
architectureId: "",
className: "全部",
createTime: "2021-12-30 12:02:33",
id: "",
isDel: 0,
}
],
experimentalName: this.$route.query.experimentalName, experimentalName: this.$route.query.experimentalName,
className: this.$route.query.class, className: this.$route.query.class,
keyword: "", keyword: "",
@ -106,29 +114,39 @@ export default {
}, },
created() { created() {
this.getData(); this.getData();
this.classInfo = JSON.parse(this.$route.query.classInfo) let classInfo = JSON.parse(this.$route.query.classInfo)
for (var i=0;i<classInfo.length;i++){
this.classInfo.push(classInfo[i])
}
console.log(this.classInfo)
for(var i=0;i<this.classInfo.length;i++){ for(var i=0;i<this.classInfo.length;i++){
let id = this.classInfo[i].id let id = this.classInfo[i].id
this.classInfo[i].id = id.toString() this.classInfo[i].id = id.toString()
} }
const activeName2 = sessionStorage.getItem('activeName2') const activeName2 = sessionStorage.getItem('activeName2')
if(activeName2 && this.classInfo.some(item => item.id === activeName2)) { if(activeName2 && this.classInfo.some(item => item.id === activeName2)) {
this.classId = activeName2 this.classId = ""
this.activeName = activeName2 this.activeName = ""
}else { }else {
this.classId = this.classInfo[0].id; this.classId = "";
this.activeName = this.classInfo[0].id; this.activeName = "";
} }
this.id = this.$route.query.id this.id = this.$route.query.id
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
sessionStorage.setItem('activeName2', tab.name) sessionStorage.setItem('activeName2', tab.name)
if(this.activeName == 0){
this.activeName = ''
}
this.getData() this.getData()
}, },
getData() { getData() {
this.$post(`${this.api.getAssessmentDetail}?assessmentId=${+this.id}&pageNum=${this.page}&pageSize=${this.pageSize}&classId=${this.activeName}`).then(res => { this.$post(`${this.api.getAssessmentDetail}?assessmentId=${+this.id}&pageNum=${this.page}&pageSize=${this.pageSize}&classId=${this.activeName}`).then(res => {
if (res.status == 200){ if (res.status == 200){
if(this.activeName == ''){
this.activeName = '0'
}
this.avg = res.avgScore this.avg = res.avgScore
this.total = res.peopleNum this.total = res.peopleNum
let list = res.page.records; let list = res.page.records;

Loading…
Cancel
Save