|
@@ -26,7 +26,7 @@
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="scoring-main-wrap dark-iview-table">
|
|
|
- <Table v-show="!showTest" class="score-box" border :columns="tableColumn" :data="studentScore" :loading="tableLoading" :max-height="tableHeight">
|
|
|
+ <Table v-show="!showTest" class="score-box" border :columns="tableColumn" :data="studentScore" :loading="tableLoading" :max-height="tableHeight" no-data-text="班级暂无学生">
|
|
|
<template slot-scope="{ row,index }" :slot="'qu'+qIndex" v-for="(item,qIndex) in quCount">
|
|
|
<div :key="'qu'+qIndex" @click="getStuScore(row,qIndex)">
|
|
|
<span style="cursor:pointer;" @click="noAnswer" v-if="row.data[qIndex] == -1 && row.status == 1">- -</span>
|
|
@@ -40,7 +40,7 @@
|
|
|
<!-- 1: 未作答 2:未评分 3:已评分 -->
|
|
|
<template slot-scope="{ row,index }" slot="status">
|
|
|
<span class="stu-status-tag" @click="getStuScore(row,0)" :style="{'background':row.status == 1 ? '#ed4014' : row.status == 2 ? '#ff9900' : '#19be6b', 'cursor':row.status == 2 ? 'pointer':'text'}">
|
|
|
- {{row.status == 1 ? '暂未作答' : row.status == 2 ? '前往评分' : '查看评分'}}
|
|
|
+ {{row.status == 1 ? '暂未作答' : row.status == 2 ? '前往评分' : '查看分数'}}
|
|
|
</span>
|
|
|
</template>
|
|
|
<Loading slot="loading" :top="-50"></Loading>
|
|
@@ -110,7 +110,8 @@ export default {
|
|
|
studentScore: [],
|
|
|
quCount: [],
|
|
|
paperInfo: {},
|
|
|
- students: []
|
|
|
+ students: [],
|
|
|
+ privClassList: []
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -222,7 +223,7 @@ export default {
|
|
|
this.dataLoading = true;
|
|
|
let requestData = {
|
|
|
id: this.examInfo.id,
|
|
|
- school: this.$store.state.user.schoolCode,
|
|
|
+ code: this.examInfo.scope == 'school' ? this.$store.state.user.schoolCode : this.$store.state.userInfo.TEAMModelId,
|
|
|
subjectId: this.chooseSubject,
|
|
|
classId: this.chooseClass,
|
|
|
};
|
|
@@ -238,6 +239,14 @@ export default {
|
|
|
}
|
|
|
).finally(() => {
|
|
|
setTimeout(() => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let fixed = document.getElementsByClassName('ivu-table-fixed-body')
|
|
|
+ console.log(fixed)
|
|
|
+ for (let iterator of fixed) {
|
|
|
+ console.log(iterator)
|
|
|
+ iterator.style.maxHeight = (this.tableHeight - 40) + 'px'
|
|
|
+ }
|
|
|
+ })
|
|
|
this.dataLoading = false
|
|
|
this.tableLoading = false
|
|
|
}, 500);
|
|
@@ -360,21 +369,23 @@ export default {
|
|
|
if (n.subjects && n.subjects.length) {
|
|
|
this.chooseSubject = n.subjects[0].id;
|
|
|
}
|
|
|
+
|
|
|
if (n.grades && n.grades.length) {
|
|
|
this.chooseGrade = n.grades[0].id;
|
|
|
}
|
|
|
- // if (n.targetClassIds && n.targetClassIds.length) {
|
|
|
- // this.chooseClass = n.targetClassIds[0];
|
|
|
- // }
|
|
|
+
|
|
|
if (n.papers && n.papers.length) {
|
|
|
- let res = n.papers.find((item) => {
|
|
|
- return item.subjectId == this.chooseSubject;
|
|
|
- });
|
|
|
- this.paperInfo = res ? this._.cloneDeep(res) : {};
|
|
|
+ if (n.scope == 'school') {
|
|
|
+ let res = n.papers.find((item) => {
|
|
|
+ return item.subjectId == this.chooseSubject;
|
|
|
+ });
|
|
|
+ this.paperInfo = res ? this._.cloneDeep(res) : {};
|
|
|
+ } else {
|
|
|
+ this.paperInfo = n.papers[0]
|
|
|
+ }
|
|
|
} else {
|
|
|
this.paperInfo = {};
|
|
|
}
|
|
|
- // this.getClassStudent();
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|
|
@@ -389,35 +400,49 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- classList() {
|
|
|
- if (this.examInfo && this.examInfo.targetClassIds) {
|
|
|
- if (this.examInfo.scope == 'school') {
|
|
|
- this.showTest = false
|
|
|
- let classes = this.$store.state.user.schoolProfile.school_classes.filter(
|
|
|
- (item) => {
|
|
|
- return (this.examInfo.targetClassIds.indexOf(item.id) >= 0 && item.gradeId == this.chooseGrade);
|
|
|
+ classList: {
|
|
|
+ get: function () {
|
|
|
+ if (this.examInfo && this.examInfo.targetClassIds) {
|
|
|
+ if (this.examInfo.scope == 'school') {
|
|
|
+ this.showTest = false
|
|
|
+ let classes = this.$store.state.user.schoolProfile.school_classes.filter(
|
|
|
+ (item) => {
|
|
|
+ return (this.examInfo.targetClassIds.indexOf(item.id) >= 0 && item.gradeId == this.chooseGrade);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ return classes;
|
|
|
+ } else {
|
|
|
+ //根据targetClassIds查询班级信息
|
|
|
+ if (!this.privClassList.length) {
|
|
|
+ this.$api.schoolSetting.getClassByIds({
|
|
|
+ code: this.$store.state.userInfo.TEAMModelId,
|
|
|
+ ids: this.examInfo.targetClassIds
|
|
|
+ }).then(
|
|
|
+ res => {
|
|
|
+ console.log('list', res)
|
|
|
+ this.privClassList = res.className
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+ )
|
|
|
}
|
|
|
- );
|
|
|
- return classes;
|
|
|
+ return this.privClassList
|
|
|
+ }
|
|
|
} else {
|
|
|
- let list = this.examInfo.targetClassIds.map(item => {
|
|
|
- return {
|
|
|
- id: item,
|
|
|
- name: item
|
|
|
- }
|
|
|
- })
|
|
|
- console.log('list',list)
|
|
|
- return list
|
|
|
- //根据targetClassIds查询班级信息
|
|
|
+ return []
|
|
|
}
|
|
|
- } else {
|
|
|
- return [];
|
|
|
+ },
|
|
|
+ set: function (newValue) {
|
|
|
+ // this.classList = newValue
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
let tableWrap = document.getElementsByClassName('scoring-main-wrap')
|
|
|
this.tableHeight = tableWrap[0].offsetHeight - 27
|
|
|
+
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -428,7 +453,11 @@ export default {
|
|
|
<style lang="less">
|
|
|
.scoring-main-wrap .ivu-table-fixed-body {
|
|
|
background: #2b2b2e;
|
|
|
- max-height: 701px;
|
|
|
+ // max-height: 701px;
|
|
|
+}
|
|
|
+.scoring-main-wrap .ivu-table-tip{
|
|
|
+ position: relative;
|
|
|
+ z-index: 9999;
|
|
|
}
|
|
|
.scoring-main-wrap .ivu-table-fixed-right::before,
|
|
|
.scoring-main-wrap .ivu-table-fixed::before {
|