From d82ab8f93cf19116782d7743f537adf6e180930b Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 18 Apr 2022 18:43:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/management/userexam.js | 5 +- .../studentStatistics/gradeStatistic.vue | 75 ++++++++++--------- .../organization/studentStatistics/index.vue | 16 ++-- .../studentStatistics/studentGradeStatis.vue | 12 +-- 4 files changed, 53 insertions(+), 55 deletions(-) diff --git a/src/api/management/userexam.js b/src/api/management/userexam.js index 7dec56fc6..a72980272 100644 --- a/src/api/management/userexam.js +++ b/src/api/management/userexam.js @@ -76,11 +76,10 @@ export function getClassGradeStatistic(orgId, examId) { } /** 查询组织学生单次考试成绩曲线 */ -export function getStuGradeStatistic(params) { +export function getStuGradeStatistic(userId) { return request({ - url: `/api/userExam/curve/personal`, + url: `/api/userExam/curve/${userId}`, method: 'get', - params }); } diff --git a/src/views/organization/studentStatistics/gradeStatistic.vue b/src/views/organization/studentStatistics/gradeStatistic.vue index d1a8f5ea5..ea3a88c3c 100644 --- a/src/views/organization/studentStatistics/gradeStatistic.vue +++ b/src/views/organization/studentStatistics/gradeStatistic.vue @@ -7,21 +7,21 @@ import { getStuGradeStatistic } from '@/api/management/userexam'; export default { name: 'GradeStatistics', props:{ - creatorId:{ - type:String, - require:true - }, - orgId:{ - type:String, - require:true - }, + // creatorId:{ + // type:String, + // require:true + // }, + // orgId:{ + // type:String, + // require:true + // }, userId:{ - type:Number, + type:String, require:true }, }, watch:{ - 'orgId':function(){ + 'userId':function(){ this.loadData() } }, @@ -50,18 +50,18 @@ export default { }, axisLine:{show:true} }, - { - nameLocation:'end', - nameTextStyle:{ - align:'left', - fontSize:14 - }, - axisLine:{show:true}, - name: '时长', - alignTicks: true, - type: 'value', - // inverse: true - }, + // { + // nameLocation:'end', + // nameTextStyle:{ + // align:'left', + // fontSize:14 + // }, + // axisLine:{show:true}, + // name: '时长', + // alignTicks: true, + // type: 'value', + // // inverse: true + // }, ], } }, @@ -76,7 +76,7 @@ export default { xAxis: { type: 'category', axisLabel:{ - show :false + show :true }, data:[] }, @@ -90,14 +90,14 @@ export default { { name: '分数', data:[], - type: 'line' - }, - { - name:'时长', - yAxisIndex: 1, - data:[], - type: 'line' + type: 'bar' }, + // { + // name:'时长', + // yAxisIndex: 1, + // data:[], + // type: 'line' + // }, ] } option && this.myChart2 && this.myChart2.setOption(option); @@ -106,12 +106,13 @@ export default { this.loadData(); }, loadData(){ - let data={creatorId:this.creatorId,orgId:this.orgId,userId:this.userId} - debugger - getStuGradeStatistic(data).then(res=>{ + // creatorId:this.creatorId,orgId:this.orgId, + // let data={userId:this.userId} + // debugger + getStuGradeStatistic(this.userId).then(resp=>{ const results = resp.data; if (results) { - const gradeList = results.results; + const gradeList = results; // const gradeList = [ // { // "id": "92", @@ -152,16 +153,16 @@ export default { // ]; let gradeNumList=[]; let exameNameList=[]; - let durationList=[]; + // let durationList=[]; gradeList.forEach(item=>{ gradeNumList.push(item.score); exameNameList.push(item.examName); - durationList.push(item.duration); + // durationList.push(item.duration); }) let option=this.myChart2.getOption(); option.xAxis[0].data=exameNameList; option.series[0].data=gradeNumList; - option.series[1].data=durationList; + // option.series[1].data=durationList; option && this.myChart2 && this.myChart2.setOption(option); } }).catch(error=>{ diff --git a/src/views/organization/studentStatistics/index.vue b/src/views/organization/studentStatistics/index.vue index b6bc8dc5e..0fe65471e 100644 --- a/src/views/organization/studentStatistics/index.vue +++ b/src/views/organization/studentStatistics/index.vue @@ -8,7 +8,8 @@
- + +
@@ -29,8 +30,9 @@ export default { data() { return { myChart3:null, - creatorId:'', - orgId:'', + // creatorId:'', + // orgId:'', + userId:'', title:{ show:true, text:'仿真时长统计', @@ -46,12 +48,8 @@ export default { async mounted() { this.initChart() this.loadData(); - this.orgId=this.$store.state.user.companyId; - }, - computed:{ - userId(){ - return parseInt(this.$store.state.user.id); - } + this.userId=this.$store.state.user.id; + // this.orgId=this.$store.state.user.companyId; }, methods: { initChart(){ diff --git a/src/views/organization/studentStatistics/studentGradeStatis.vue b/src/views/organization/studentStatistics/studentGradeStatis.vue index 02fef7ae1..506b11543 100644 --- a/src/views/organization/studentStatistics/studentGradeStatis.vue +++ b/src/views/organization/studentStatistics/studentGradeStatis.vue @@ -9,7 +9,7 @@ :close-on-click-modal="false" >
- +
@@ -24,19 +24,19 @@ export default { return { studentName:'', show:false, - creatorId:'', + // creatorId:'', userId:'', - orgId:'', + // orgId:'', } }, methods: { doShow(row){ this.show=true; this.studentName=row.name; - this.userId=row.userId; - this.creatorId=this.$store.state.user.id; + // this.creatorId=this.$store.state.user.id; this.$nextTick(()=>{ - this.orgId=row.companyId; + // this.orgId=row.companyId; + this.userId=row.userId; }) // this.$refs.gradeStatic.doShow(); },