代码调整

This commit is contained in:
joylink_cuiweidong 2022-04-18 18:43:39 +08:00
parent 62be008849
commit d82ab8f93c
4 changed files with 53 additions and 55 deletions

View File

@ -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
});
}

View File

@ -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=>{

View File

@ -8,7 +8,8 @@
<exam-statistics/>
</div>
<div class="statisticChartCenter">
<grade-statistics :creatorId="creatorId" :orgId="orgId" :userId="userId"/>
<!-- :creatorId="creatorId" :orgId="orgId" -->
<grade-statistics :userId="userId"/>
</div>
<div id="mychart3" class="statisticChartRight" />
</div>
@ -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(){

View File

@ -9,7 +9,7 @@
:close-on-click-modal="false"
>
<div class="statisticChart">
<grade-statistics ref="gradeStatic" :creatorId="creatorId" :orgId="orgId" :userId="userId"/>
<grade-statistics ref="gradeStatic" :userId="userId"/>
</div>
</el-dialog>
</template>
@ -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();
},