|
@@ -54,10 +54,12 @@ export default {
|
|
|
async search({ skip, limit = 10, ...info } = {}) {
|
|
|
let res = await this.query({ lessonid: this.lessonid, teacherid: this.teacherid, ...info });
|
|
|
if (res.errcode === 0) {
|
|
|
- this.$set(this, `list`, res.data);
|
|
|
+ let nd = _.uniqBy(res.data, 'stuid');
|
|
|
+ nd = nd.filter(f => this.stuList.find(sf => sf._id === f.stuid));
|
|
|
+ this.$set(this, `list`, nd);
|
|
|
this.$set(this, `total`, res.total);
|
|
|
// 教师总分
|
|
|
- let teatotal = res.data.reduce((p, n) => p + (n['score'] * 1 || 0), 0);
|
|
|
+ let teatotal = nd.reduce((p, n) => p + (n['score'] * 1 || 0), 0);
|
|
|
// 教师平均分
|
|
|
let teapinjuntotal = _.round(teatotal / this.stutotal, 2);
|
|
|
let data = {
|
|
@@ -69,7 +71,7 @@ export default {
|
|
|
let noScoreList = [];
|
|
|
let duplicate = _.cloneDeep(this.stuList);
|
|
|
duplicate = duplicate.map(i => {
|
|
|
- const r = res.data.find(f => f.stuid === i._id);
|
|
|
+ const r = nd.find(f => f.stuid === i._id);
|
|
|
if (r) i.score = r.score * 1;
|
|
|
else {
|
|
|
noScoreList.push(i.name);
|