龚焕茏
2024-06-07 e8d84774b46145df1c36e5a27e4b60154df4a179
feat:成绩管理-考生展示
2个文件已修改
2个文件已添加
1 文件已重命名
176 ■■■■■ 已修改文件
src/api/examPaperAnswer.js 补丁 | 查看 | 原始文档 | blame | 历史
src/router.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Manage/ScoreInquiry/detail.vue 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Manage/ScoreInquiry/index.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Manage/ScoreInquiry/list.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/examPaperAnswer.js
src/router.js
@@ -103,12 +103,24 @@
        name: 'attendanceRecord',
        component: () => import('@/views/Manage/AttendanceRecord/index.vue')
      },
      // 成绩查询
      // 答卷列表
      {
        path: 'score-inquiry',
        name: 'ScoreInquiry',
        component: () => import('@/views/Manage/ScoreInquiry/index.vue')
      },
      // 答卷成绩
      {
        path: 'answer-list',
        name: 'ScoreInquiry',
        component: () => import('@/views/Manage/ScoreInquiry/list.vue')
      },
      // 答卷详情
      {
        path: 'answer-detail',
        name: 'ScoreInquiry',
        component: () => import('@/views/Manage/ScoreInquiry/detail.vue')
      },
      // 学分计算规则
      {
        path: 'credit-hour',
src/views/Manage/ScoreInquiry/detail.vue
src/views/Manage/ScoreInquiry/index.vue
@@ -35,6 +35,7 @@
            </el-table-column>
            <el-table-column align="center" prop="questionCount" label="题目数量" width="100px" />
            <el-table-column align="center" prop="systemScore" label="总分" width="100px" />
            <el-table-column align="center" prop="suggestTime" label="建议时长" width="100px" />
            <el-table-column align="center" prop="personAnswerNum" label="参考人数" width="100px">
              <template slot-scope="{row}">
                <span>{{ row.personAnswerNum + "/" + row.personTotalNum }}</span>
@@ -52,27 +53,12 @@
        </div>
      </div>
    </div>
    <el-dialog :visible.sync="visible" width="400px">
      <el-form :model="form" ref="form" label-width="100px" v-loading="formLoading" :rules="rules">
        <el-form-item label="名称:" prop="name" required>
          <el-input v-model="form.name" maxlength="10" show-word-limit />
        </el-form-item>
        <el-form-item label="排序:" prop="itemOrder" required>
          <el-input-number v-model="form.itemOrder" type="number" :min="1" :max="100" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submitForm">提交</el-button>
          <el-button @click="resetForm">重置</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>
<script>
// 引入彈出窗口組件
import subjectApi from '@/api/subject'
import examPaperAnwserApi from '@/api/examPaperAnwser'
import examPaperAnwserApi from '@/api/examPaperAnswer'
import Pagination from '@/components/Pagination'
export default {
@@ -91,11 +77,6 @@
      formLoading: false,
      total: 0,
      tableData: [],
      form: {
        id: '',
        name: '',
        itemOrder: ''
      },
      visible: false,
      subjects: []
    };
@@ -123,39 +104,7 @@
      })
    },
    view(row) {
      if (row) {
        subjectApi.select(row.id).then(re => {
          if (re.code === 1) {
            this.form = re.data;
            this.visible = true;
            this.$router.push({ path: '/manage/question-bank', query: { id: row.id } });
          } else {
            this.$message.error(re.message)
          }
        })
      } else {
        this.visible = true;
      }
    },
    submitForm() {
      let _this = this
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.formLoading = true
          subjectApi.edit(this.form).then(re => {
            if (re.code === 1) {
              _this.$message.success(re.message)
              _this.search()
              _this.formLoading = false
              _this.visible = false
            } else {
              _this.$message.error(re.message)
              _this.formLoading = false
              _this.visible = false
            }
          })
        }
      })
      this.$router.push({ path: '/manage/answer-list', query: { id: row.id } });
    }
  }
};
src/views/Manage/ScoreInquiry/list.vue
New file
@@ -0,0 +1,105 @@
<!-- 答卷管理 -->
<template>
  <div class="c">
    <div class="bg">
      <div class="main">
        <!-- 待返回的标题 -->
        <TitleIndex title="答卷管理" />
        <div class="content">
          <!-- 搜索 -->
          <div>
            <el-form :inline="true" :model="queryParam" class="demo-form-inline" label-width="80px">
              <el-form-item>
                <el-input v-model="queryParam.userName" placeholder="请输入名称" clearable></el-input>
              </el-form-item>
              <el-form-item>
                <el-button style="width:100px;" type="primary" size="small" @click="search()">查询</el-button>
              </el-form-item>
            </el-form>
          </div>
          <!-- 表格 -->
          <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
            <el-table-column prop="paperName" label="试卷名称" />
            <el-table-column prop="userName" 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="createTime" label="提交时间" width="160px" />
          </el-table>
          <pagination v-show="total > 0" :total="total" :page.sync="queryParam.pageIndex"
            :limit.sync="queryParam.pageSize" @pagination="search" />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
// 引入彈出窗口組件
import examPaperAnswerApi from '@/api/examPaperAnswer'
import Pagination from '@/components/Pagination'
export default {
  // 注册
  components: {
    Pagination
  },
  data() {
    return {
      listLoading: true,
      queryParam: {
        examPaperId: '',
        userName: '',
        pageIndex: 1,
        pageSize: 10
      },
      formLoading: false,
      total: 0,
      tableData: [],
      visible: false,
      subjects: []
    };
  },
  created() {
    this.queryParam.examPaperId = this.$route.query.id
    this.search()
  },
  methods: {
    // 获取列表
    search() {
      this.listLoading = true
      examPaperAnswerApi.page(this.queryParam).then(re => {
        this.tableData = re.data.list
        this.total = re.data.total
        this.queryParam.pageSize = re.data.pageSize
        this.queryParam.pageIndex = re.data.pageNum
        this.listLoading = false
      })
    },
    view(row) {
      this.$router.push({ path: '/manage/answer-detail', query: { id: row.id } });
    }
  }
};
</script>
<style scoped lang="scss">
.flex {
  display: flex;
}
// 内容
.content {
  width: 1262px;
  margin-bottom: 80px;
  background-color: #fff;
  padding: 20px 40px;
  border-radius: 10px;
}
</style>