17808
2023-11-07 e7ea50917403199d7cfc25ba201b443f519db104
成绩统计前端
2个文件已修改
3个文件已添加
187 ■■■■■ 已修改文件
src/api/AchievementStatistics.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/answer/achievementStatistics.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/gradeDetails/list.vue 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/paper/edit.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/AchievementStatistics.js
New file
@@ -0,0 +1,6 @@
import { post } from '@/utils/request'
export default {
  page: query => post('/api/admin/examPaperGrade/page', query),
  gradeDetails: query => post('/api/admin/examPaperGrade/details', query)
}
src/router.js
@@ -247,6 +247,19 @@
        component: () => import('@/views/answer/sheetStatistics.vue'),
        name: 'AnswerPageList',
        meta: { title: '答卷统计', noCache: true }
      },
      {
        path: 'achievementStatistics',
        component: () => import('@/views/answer/achievementStatistics.vue'),
        name: 'AnswerPageList',
        meta: { title: '成绩统计', noCache: true }
      },
      {
        path: 'achievementStatistics/gradeDetails',
        component: () => import('@/views/exam/gradeDetails/list.vue'),
        name: 'AnswerPageList',
        meta: { title: '成绩统计详情', noCache: true, activeMenu: '/exam/gradeDetails/list' },
        hidden: true
      }
    ]
  },
src/views/answer/achievementStatistics.vue
New file
@@ -0,0 +1,81 @@
<template>
  <div class="app-container">
<!--    <el-form :model="queryParam" ref="queryForm" :inline="true " style="display: flex">-->
<!--      <el-form-item label="学生:" >-->
<!--       <el-input v-model="queryParam.userName"></el-input>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="试卷题目:">-->
<!--        <el-input v-model="queryParam.paperName"></el-input>-->
<!--    </el-form-item>-->
<!--      <el-form-item>-->
<!--        <el-button type="primary" @click="submitForm">查询</el-button>-->
<!--      </el-form-item>-->
<!--    </el-form>-->
    <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
      <el-table-column prop="userName" label="考生名称"/>
      <el-table-column prop="counts" label="考试次数" width="160px"/>
      <el-table-column  label="操作" align="center"  width="300px">
        <template slot-scope="{row}">
          <el-button size="mini" @click="$router.push({path:'/answer/achievementStatistics/gradeDetails',query:{id:row.id,userId:row.userId,createUser:row.createUser}})" >查看</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize"
                @pagination="search"/>
  </div>
</template>
<script>
import { mapGetters, mapState, mapActions } from 'vuex'
import Pagination from '@/components/Pagination'
import examPaperAnswerApi from '@/api/examPaperAnwser'
import AchievementStatistics from "@/api/AchievementStatistics";
export default {
  components: { Pagination },
  data () {
    return {
      avgSource:null,
      queryParam: {
        paperName:'',
        userName:'',
        subjectId: null,
        pageIndex: 1,
        pageSize: 10
      },
      listLoading: false,
      tableData: [],
      total: 0
    }
  },
  created () {
    this.initSubject()
    this.search()
  },
  methods: {
    search () {
      this.listLoading = true
      AchievementStatistics.page(this.queryParam).then(data => {
        const re = data.response
        this.avgSource = re.list[0].avgSource
        this.tableData = re.list
        this.total = re.total
        this.queryParam.pageIndex = re.pageNum
        this.listLoading = false
      })
    },
    submitForm () {
      this.queryParam.pageIndex = 1
      this.search()
    },
    ...mapActions('exam', { initSubject: 'initSubject' })
  },
  computed: {
    ...mapGetters('enumItem', ['enumFormat']),
    ...mapGetters('exam', ['subjectEnumFormat']),
    ...mapState('exam', { subjects: state => state.subjects })
  }
}
</script>
src/views/exam/gradeDetails/list.vue
New file
@@ -0,0 +1,85 @@
<template>
  <div class="app-container">
<!--    <el-form :model="queryParam" ref="queryForm" :inline="true">-->
<!--      <el-form-item label="用户名:">-->
<!--        <el-input v-model="queryParam.userName" clearable></el-input>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="模板名:">-->
<!--        <el-input v-model="queryParam.templatesName" clearable></el-input>-->
<!--      </el-form-item>-->
<!--      <el-form-item>-->
<!--        <el-button type="primary" @click="submitForm">查询</el-button>-->
<!--      </el-form-item>-->
<!--    </el-form>-->
    <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
      <el-table-column prop="paperName" label="试卷名称" />
      <el-table-column  label="得分" width="100px" >
        <template slot-scope="{row}">
          {{row.userScore}} / {{row.paperScore}}
        </template>
      </el-table-column>
        <el-table-column  label="题目对错" width="80px" >
          <template slot-scope="{row}">
            {{row.questionCorrect}} / {{row.questionCount}}
          </template>
        </el-table-column>
        <el-table-column prop="doTime" label="耗时" width="100px"/>
        <el-table-column prop="formattedTime" label="提交时间" width="160px"/>
    </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize"
                @pagination="search"/>
  </div>
</template>
<script>
import { mapGetters, mapState, mapActions } from 'vuex'
import Pagination from '@/components/Pagination'
import examPaperApi from '@/api/examPaper'
import AchievementStatistics from "@/api/AchievementStatistics";
export default {
  components: { Pagination },
  data () {
    return {
      queryParam: {
        pageIndex: 1,
        pageSize: 10,
        id:'',
        userId:''
      },
      subjectFilter: null,
      listLoading: true,
      tableData: [],
      total: 0,
    }
  },
  created () {
  },
  mounted () {
    this.queryParam.id=this.$route.query.id
    this.queryParam.userId=this.$route.query.userId
    this.queryParam.createUser=this.$route.query.createUser
    this.search()
  },
  methods: {
    submitForm () {
      this.queryParam.pageIndex = 1
      this.search()
    },
    search () {
      this.listLoading = true
      AchievementStatistics.gradeDetails(this.queryParam).then(data => {
        const re = data.response
        this.tableData = re.list
        this.total = re.total
        this.queryParam.pageIndex = re.pageNum
        this.listLoading = false
      })
    },
  },
}
</script>
src/views/exam/paper/edit.vue
@@ -296,8 +296,6 @@
    },
    submitForm () {
      let _this = this
      console.log(this.subjectIdList)
      console.log(this.form.subjectSource)
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.formLoading = true;