提交 05299021 编写于 作者: 麦嘉得's avatar 麦嘉得

①更改学生成绩报告,优秀学生接口数据处理

上级 828ab46a
文件已删除
此差异已折叠。
...@@ -53,15 +53,15 @@ ...@@ -53,15 +53,15 @@
columns1: [ columns1: [
{ {
title: '学院', title: '学院',
key: 'name' key: 'dept'
}, },
{ {
title: '优秀学生人数', title: '优秀学生人数',
key: 'age' key: 'fine_num'
}, },
{ {
title: '排名', title: '排名',
key: 'address' key: 'rank1'
} }
], ],
data1: [ data1: [
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
}, },
{ {
title: '排名', title: '排名',
key: 'rank' key: 'rank2'
} }
], ],
data2: [ data2: [
...@@ -168,7 +168,8 @@ ...@@ -168,7 +168,8 @@
age: 459, age: 459,
address: 20 address: 20
} }
] ],
point:[]
} }
}, },
methods: { methods: {
...@@ -176,8 +177,21 @@ ...@@ -176,8 +177,21 @@
api.Score({term:this.term}) api.Score({term:this.term})
.then(resp => { .then(resp => {
if (resp.code == 1) { if (resp.code == 1) {
//院系优秀学生data
this.data1 = [];
this.point = [];//绩点
resp.response.forEach((item,z)=>{
this.point.push(item);
item.rank1=z+1;//优秀学生排名
})
this.data1 = resp.response;
//院系绩点data
this.data2 = []; this.data2 = [];
this.data2 = resp.response; this.point.sort(this.sortId);//排序
this.point.forEach(function(res,i){
res.rank2=i+1;//绩点排名
})
this.data2 = this.point;
} else { } else {
throw resp; throw resp;
} }
...@@ -202,11 +216,14 @@ ...@@ -202,11 +216,14 @@
change_term(name){ change_term(name){
                this.term = name;                 this.term = name;
                this.changeLimit();                 this.changeLimit();
            }             },
sortId(a,b){
return b.avg_score-a.avg_score
}
}, },
mounted () { mounted () {
this.changeLimit(); this.changeLimit();
} },
} }
</script> </script>
<style> <style>
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或