Merge remote-tracking branch 'origin/master'
| | |
| | | import axios from "./request"; |
| | | import axios from './request' |
| | | |
| | | // 获取考试分页 |
| | | export const getExams = (params) => { |
| | | return axios({ |
| | | url: "/api/exam/page", |
| | | method: "GET", |
| | | params: params |
| | | }) |
| | | return axios({ |
| | | url: '/api/admin/exam/page', |
| | | method: 'GET', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | // 获取考试列表 |
| | | export const getExamList = () => { |
| | | return axios({ |
| | | url: "/api/exam/list", |
| | | method: "GET" |
| | | }) |
| | | return axios({ |
| | | url: '/api/admin/exam/list', |
| | | method: 'GET' |
| | | }) |
| | | } |
| | | |
| | | // 通过id获取考试 |
| | | export const getExamById = (params) => { |
| | | return axios({ |
| | | url: "/api/exam/" + params, |
| | | method: "GET" |
| | | }) |
| | | return axios({ |
| | | url: '/api/admin/exam/' + params, |
| | | method: 'GET' |
| | | }) |
| | | } |
| | | |
| | | // 通过id获取考试 |
| | | export const getExamMarkPaperInfo = (id) => { |
| | | return axios({ |
| | | url: '/api/admin/exam/mark/paper/' + id, |
| | | method: 'GET' |
| | | }) |
| | | } |
| | | |
| | | // 通过id删除考试 |
| | | export const deleteExamById = (params) => { |
| | | return axios({ |
| | | url: "/api/exam/" + params, |
| | | method: "DELETE" |
| | | }) |
| | | return axios({ |
| | | url: '/api/admin/exam/' + params, |
| | | method: 'DELETE' |
| | | }) |
| | | } |
| | | |
| | | // 批量删除考试 |
| | | export const deleteExamByIds = (params) => { |
| | | return axios({ |
| | | url: "/api/exam/batch", |
| | | method: "DELETE", |
| | | data: params |
| | | }) |
| | | return axios({ |
| | | url: '/api/admin/exam/batch', |
| | | method: 'DELETE', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | // 修改考试 |
| | | export const editExam = (params) => { |
| | | return axios({ |
| | | url: "/api/exam/", |
| | | method: "PUT", |
| | | data: params |
| | | }) |
| | | return axios({ |
| | | url: '/api/admin/exam/', |
| | | method: 'PUT', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | // 添加考试 |
| | | export const addExam = (params) => { |
| | | return axios({ |
| | | url: "/api/exam/", |
| | | method: "POST", |
| | | data: params |
| | | }) |
| | | return axios({ |
| | | url: '/api/admin/exam/', |
| | | method: 'POST', |
| | | data: params |
| | | }) |
| | | } |
| | |
| | | import axios from "axios"; |
| | | import router from "../router"; |
| | | import {Message} from 'element-ui'; |
| | | import vue from "vue"; |
| | | import axios from 'axios' |
| | | import router from '../router' |
| | | import { Message } from 'element-ui' |
| | | import vue from 'vue' |
| | | |
| | | const instance = axios.create({ |
| | | baseURL: process.env.VUE_APP_URL, |
| | |
| | | // 不携带cookie |
| | | withCredentials: true, |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | // 添加请求拦截器 |
| | | instance.interceptors.request.use(function (config) { |
| | | return config; |
| | | return config |
| | | }, function (error) { |
| | | Message.error("请求存在问题,请检查") |
| | | return Promise.reject(error); |
| | | }); |
| | | Message.error('请求存在问题,请检查') |
| | | return Promise.reject(error) |
| | | }) |
| | | |
| | | // 添加响应拦截器 |
| | | instance.interceptors.response.use(function (response) { |
| | | if (response.data.code === 1) { |
| | | return response; |
| | | // 验证码错误放行,以便刷新验证码 |
| | | } |
| | | // 处理自定义状态码 |
| | | else if (response.data.code === 1998) { |
| | | return response; |
| | | return response |
| | | } else if (response.data.code === 401) { |
| | | Message.error('登录已过期,请重新登录') |
| | | vue.prototype.$$router.push({ path: '/login' }) |
| | | return Promise.reject(response.data) |
| | | } else if (response.data.code === 403) { |
| | | Message.error('权限不足,无法访问') |
| | | return Promise.reject(response.data) |
| | | } else { |
| | | Message.error(response.data.msg); |
| | | return Promise.reject(response.data.msg); |
| | | Message.error(response.data.message) |
| | | return Promise.reject(response.data.message) |
| | | } |
| | | }, |
| | | |
| | | }, function (error) { |
| | | function (error) { |
| | | console.log(error, '错误') |
| | | // 处理http状态码 |
| | | if (error.response.data) { |
| | | error.message = error.response.data.msg; |
| | | error.message = error.response.data.msg |
| | | } |
| | | if (error.response.code === 401) { |
| | | error.message = "登录已过期,请重新登录"; |
| | | error.message = '登录已过期,请重新登录' |
| | | vue.prototype.$$router.push({ path: '/login' }) |
| | | } |
| | | if (error.response.code === 403) { |
| | | error.message = "权限不足"; |
| | | error.message = '权限不足' |
| | | } |
| | | Message.error(error.message); |
| | | return Promise.reject(error); |
| | | }); |
| | | Message.error(error.message) |
| | | return Promise.reject(error) |
| | | } |
| | | |
| | | export default instance; |
| | | ) |
| | | |
| | | |
| | | export default instance |
| | |
| | | component: () => import('@/views/exam/exam/ExamManage'), |
| | | name: 'Exam', |
| | | meta: { title: '考试管理', icon: 'exam', affix: true } |
| | | }, |
| | | { |
| | | path: '/exam/mark/paper', |
| | | component: () => import('@/views/exam/exam/MarkPaper'), |
| | | name: 'MarkPaper', |
| | | meta: { title: '阅卷'}, |
| | | hidden: true |
| | | } |
| | | ] |
| | | }, |
| | |
| | | component: () => import('@/views/class-management/ClassStaff'), |
| | | name: 'Classes', |
| | | hidden: true, |
| | | meta: { title: '班级成员管理', icon: 'classes', affix: true } |
| | | meta: { title: '班级成员管理', icon: 'classes' } |
| | | } |
| | | ] |
| | | }, |
| | |
| | | >修改 |
| | | </el-button> |
| | | <el-button type="danger" size="small" @click="deleteExam(scope.row.id)">删除</el-button> |
| | | <el-button type="success" size="small" @click="markPaper(scope.row)">阅卷</el-button> |
| | | <el-button v-if="scope.row.status === 'finished'" type="success" size="small" @click="markPaper(scope.row)">阅卷</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | status: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | time: [], |
| | | time: [] |
| | | }, |
| | | examRules: { |
| | | examName: [ |
| | |
| | | ], |
| | | time: [ |
| | | { required: true, message: '请选择考试时间', trigger: 'change' } |
| | | ], |
| | | ] |
| | | }, |
| | | total: 0, |
| | | title: '安排考试', |
| | |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | tableData: [], |
| | | tableData: [] |
| | | } |
| | | }, |
| | | mounted () { |
| | |
| | | }, |
| | | routerTo (url) { |
| | | this.$router.push(url) |
| | | }, |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <div> |
| | | <div> |
| | | <div></div> |
| | | <div></div> |
| | | </div> |
| | | <div></div> |
| | | <div class="app-container"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="5"> |
| | | <div class="nameClass"> |
| | | <div class="bottom5">考试名称</div> |
| | | <div class="title">{{examInfo.examName}}</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <div class="nameClass"> |
| | | <div class="bottom5">试卷名称</div> |
| | | <div class="title">{{examInfo.examPaperName}}</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div class="staticNum"> |
| | | <div class="bottom5">应考人数</div> |
| | | <div class="title">{{examInfo.shouldJoinNum}}</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div class="staticNum"> |
| | | <div class="bottom5">缺考人数</div> |
| | | <div class="title">{{examInfo.missJoinNum}}</div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div class="staticNum"> |
| | | <div class="bottom5">参加但未完成人数</div> |
| | | <div class="title">{{examInfo.joinButNotFinishNum}}</div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- 表格 --> |
| | | <el-table |
| | | :data="examInfo.studentExamInfoVOList" |
| | | border |
| | | style="width: 100%;margin-top: 20px" |
| | | > |
| | | <el-table-column |
| | | align="center" |
| | | prop="id" |
| | | label="学号" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="realName" |
| | | label="姓名" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="phone" |
| | | label="电话" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | prop="phone" |
| | | label="系统自动估分(选择题型)" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | width="300px" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button @click="markPaper(scope.row)" type="warning">阅卷</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getExamInfo } from '@/api/exam' |
| | | import { getExamMarkPaperInfo } from '@/api/exam' |
| | | |
| | | export default { |
| | | name: 'MarkPaper', |
| | | mounted () { |
| | | this.examInfo.examName = this.$route.query.examName |
| | | this.examInfo.id = this.$route.query.examId |
| | | this.getExamInfo() |
| | | this.examInfo.examId = this.$route.query.examId |
| | | if (this.examInfo.examId) { |
| | | this.getExamInfo() |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | examInfo: { |
| | | examName: '', |
| | | id: null, |
| | | paperList: [] |
| | | examPaperName: '', |
| | | suggestTime: 0, |
| | | shouldJoinNum: 0, |
| | | joinNum: 0, |
| | | missJoinNum: 0, |
| | | joinButNotFinishNum: 0, |
| | | examId: null, |
| | | studentExamInfoVOList: [] |
| | | } |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | markPaper (row) { |
| | | // todo打开阅卷页面 |
| | | }, |
| | | getExamInfo () { |
| | | getExamInfo(this.examInfo.id).then(res => { |
| | | getExamMarkPaperInfo(this.examInfo.examId).then(res => { |
| | | this.examInfo = res.data.data |
| | | }) |
| | | } |
| | |
| | | |
| | | <style scoped> |
| | | |
| | | .title { |
| | | font-size: 18px; |
| | | } |
| | | .bottom5 { |
| | | margin-bottom: 5px; |
| | | } |
| | | .nameInfo { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | .nameClass { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 70px; |
| | | background-color: #cb5858; |
| | | } |
| | | .staticNum { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background-color: #0a76a4; |
| | | height: 70px; |
| | | } |
| | | </style> |