考核评估-成绩管理

This commit is contained in:
xusd 2024-05-07 14:25:42 +08:00
parent 54095a7983
commit 515a41fb3e
15 changed files with 936 additions and 1 deletions

View File

@ -102,4 +102,17 @@ public class ExamInfoController extends BaseController
{
return toAjax(examInfoService.deleteExamInfoByIds(ids));
}
/**
* 考试信息下拉
*
* @Author xusd
* @Date 11:21 2024/5/7
* @return java.util.List<com.inspur.examine.domain.ExamInfo>
*/
@GetMapping("/selection")
@PreAuthorize("@ss.hasPermi('examine:examInfo:list')")
public List<ExamInfo> selection() {
return examInfoService.selection();
}
}

View File

@ -0,0 +1,104 @@
package com.inspur.web.controller.examine;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.inspur.common.annotation.Log;
import com.inspur.common.core.controller.BaseController;
import com.inspur.common.core.domain.AjaxResult;
import com.inspur.common.enums.BusinessType;
import com.inspur.examine.domain.ExamPaperInfo;
import com.inspur.examine.service.IExamPaperInfoService;
import com.inspur.common.utils.poi.ExcelUtil;
import com.inspur.common.core.page.TableDataInfo;
/**
* 试卷信息Controller
*
* @author inspur
* @date 2024-05-07
*/
@RestController
@RequestMapping("/examine/paperInfo")
public class ExamPaperInfoController extends BaseController
{
@Autowired
private IExamPaperInfoService examPaperInfoService;
/**
* 查询试卷信息列表
*/
@PreAuthorize("@ss.hasPermi('examine:paperInfo:list')")
@GetMapping("/list")
public TableDataInfo list(ExamPaperInfo examPaperInfo)
{
startPage();
List<ExamPaperInfo> list = examPaperInfoService.selectExamPaperInfoList(examPaperInfo);
return getDataTable(list);
}
/**
* 导出试卷信息列表
*/
@PreAuthorize("@ss.hasPermi('examine:paperInfo:export')")
@Log(title = "试卷信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ExamPaperInfo examPaperInfo)
{
List<ExamPaperInfo> list = examPaperInfoService.selectExamPaperInfoList(examPaperInfo);
ExcelUtil<ExamPaperInfo> util = new ExcelUtil<ExamPaperInfo>(ExamPaperInfo.class);
util.exportExcel(response, list, "试卷信息数据");
}
/**
* 获取试卷信息详细信息
*/
@PreAuthorize("@ss.hasPermi('examine:paperInfo:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(examPaperInfoService.selectExamPaperInfoById(id));
}
/**
* 新增试卷信息
*/
@PreAuthorize("@ss.hasPermi('examine:paperInfo:add')")
@Log(title = "试卷信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ExamPaperInfo examPaperInfo)
{
return toAjax(examPaperInfoService.insertExamPaperInfo(examPaperInfo));
}
/**
* 修改试卷信息
*/
@PreAuthorize("@ss.hasPermi('examine:paperInfo:edit')")
@Log(title = "试卷信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ExamPaperInfo examPaperInfo)
{
return toAjax(examPaperInfoService.updateExamPaperInfo(examPaperInfo));
}
/**
* 删除试卷信息
*/
@PreAuthorize("@ss.hasPermi('examine:paperInfo:remove')")
@Log(title = "试卷信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(examPaperInfoService.deleteExamPaperInfoByIds(ids));
}
}

View File

@ -0,0 +1,78 @@
package com.inspur.examine.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.inspur.common.annotation.Excel;
import lombok.Data;
/**
* 试卷信息对象 exam_paper_info
*
* @author inspur
* @date 2024-05-07
*/
@Data
public class ExamPaperInfo {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 考试id
*/
private String examId;
/**
* 考试名称
*/
@Excel(name = "考试名称")
private String examName;
/**
* 考生id
*/
@Excel(name = "考生id")
private Long examineId;
/**
* 考生名称
*/
@Excel(name = "考生名称")
private String examineName;
/**
* 考试开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "考试开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date examStartTime;
/**
* 考试结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "考试结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date examEndTime;
/**
* 分数
*/
@Excel(name = "分数")
private BigDecimal score;
/**
* 状态 0 未通过1 通过
*/
@Excel(name = "状态",dictType = "examine_result")
private String status;
/**
* 租户id
*/
private String tenantId;
}

View File

@ -58,4 +58,13 @@ public interface ExamInfoMapper
* @return 结果
*/
public int deleteExamInfoByIds(String[] ids);
/**
* 考试信息下拉
*
* @Author xusd
* @Date 11:21 2024/5/7
* @return java.util.List<com.inspur.examine.domain.ExamInfo>
*/
List<ExamInfo> selection();
}

View File

@ -0,0 +1,61 @@
package com.inspur.examine.mapper;
import java.util.List;
import com.inspur.examine.domain.ExamPaperInfo;
/**
* 试卷信息Mapper接口
*
* @author inspur
* @date 2024-05-07
*/
public interface ExamPaperInfoMapper
{
/**
* 查询试卷信息
*
* @param id 试卷信息主键
* @return 试卷信息
*/
public ExamPaperInfo selectExamPaperInfoById(String id);
/**
* 查询试卷信息列表
*
* @param examPaperInfo 试卷信息
* @return 试卷信息集合
*/
public List<ExamPaperInfo> selectExamPaperInfoList(ExamPaperInfo examPaperInfo);
/**
* 新增试卷信息
*
* @param examPaperInfo 试卷信息
* @return 结果
*/
public int insertExamPaperInfo(ExamPaperInfo examPaperInfo);
/**
* 修改试卷信息
*
* @param examPaperInfo 试卷信息
* @return 结果
*/
public int updateExamPaperInfo(ExamPaperInfo examPaperInfo);
/**
* 删除试卷信息
*
* @param id 试卷信息主键
* @return 结果
*/
public int deleteExamPaperInfoById(String id);
/**
* 批量删除试卷信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteExamPaperInfoByIds(String[] ids);
}

View File

@ -58,4 +58,13 @@ public interface IExamInfoService
* @return 结果
*/
public int deleteExamInfoById(String id);
/**
* 考试信息下拉
*
* @Author xusd
* @Date 11:21 2024/5/7
* @return java.util.List<com.inspur.examine.domain.ExamInfo>
*/
List<ExamInfo> selection();
}

View File

@ -0,0 +1,61 @@
package com.inspur.examine.service;
import java.util.List;
import com.inspur.examine.domain.ExamPaperInfo;
/**
* 试卷信息Service接口
*
* @author inspur
* @date 2024-05-07
*/
public interface IExamPaperInfoService
{
/**
* 查询试卷信息
*
* @param id 试卷信息主键
* @return 试卷信息
*/
public ExamPaperInfo selectExamPaperInfoById(String id);
/**
* 查询试卷信息列表
*
* @param examPaperInfo 试卷信息
* @return 试卷信息集合
*/
public List<ExamPaperInfo> selectExamPaperInfoList(ExamPaperInfo examPaperInfo);
/**
* 新增试卷信息
*
* @param examPaperInfo 试卷信息
* @return 结果
*/
public int insertExamPaperInfo(ExamPaperInfo examPaperInfo);
/**
* 修改试卷信息
*
* @param examPaperInfo 试卷信息
* @return 结果
*/
public int updateExamPaperInfo(ExamPaperInfo examPaperInfo);
/**
* 批量删除试卷信息
*
* @param ids 需要删除的试卷信息主键集合
* @return 结果
*/
public int deleteExamPaperInfoByIds(String[] ids);
/**
* 删除试卷信息信息
*
* @param id 试卷信息主键
* @return 结果
*/
public int deleteExamPaperInfoById(String id);
}

View File

@ -1,5 +1,6 @@
package com.inspur.examine.service.impl;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@ -103,4 +104,15 @@ public class ExamInfoServiceImpl implements IExamInfoService {
return examInfoMapper.deleteExamInfoById(id);
}
/**
* 考试信息下拉
*
* @Author xusd
* @Date 11:21 2024/5/7
* @return java.util.List<com.inspur.examine.domain.ExamInfo>
*/
@Override
public List<ExamInfo> selection() {
return examInfoMapper.selection();
}
}

View File

@ -0,0 +1,93 @@
package com.inspur.examine.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.inspur.examine.mapper.ExamPaperInfoMapper;
import com.inspur.examine.domain.ExamPaperInfo;
import com.inspur.examine.service.IExamPaperInfoService;
/**
* 试卷信息Service业务层处理
*
* @author inspur
* @date 2024-05-07
*/
@Service
public class ExamPaperInfoServiceImpl implements IExamPaperInfoService
{
@Autowired
private ExamPaperInfoMapper examPaperInfoMapper;
/**
* 查询试卷信息
*
* @param id 试卷信息主键
* @return 试卷信息
*/
@Override
public ExamPaperInfo selectExamPaperInfoById(String id)
{
return examPaperInfoMapper.selectExamPaperInfoById(id);
}
/**
* 查询试卷信息列表
*
* @param examPaperInfo 试卷信息
* @return 试卷信息
*/
@Override
public List<ExamPaperInfo> selectExamPaperInfoList(ExamPaperInfo examPaperInfo)
{
return examPaperInfoMapper.selectExamPaperInfoList(examPaperInfo);
}
/**
* 新增试卷信息
*
* @param examPaperInfo 试卷信息
* @return 结果
*/
@Override
public int insertExamPaperInfo(ExamPaperInfo examPaperInfo)
{
return examPaperInfoMapper.insertExamPaperInfo(examPaperInfo);
}
/**
* 修改试卷信息
*
* @param examPaperInfo 试卷信息
* @return 结果
*/
@Override
public int updateExamPaperInfo(ExamPaperInfo examPaperInfo)
{
return examPaperInfoMapper.updateExamPaperInfo(examPaperInfo);
}
/**
* 批量删除试卷信息
*
* @param ids 需要删除的试卷信息主键
* @return 结果
*/
@Override
public int deleteExamPaperInfoByIds(String[] ids)
{
return examPaperInfoMapper.deleteExamPaperInfoByIds(ids);
}
/**
* 删除试卷信息信息
*
* @param id 试卷信息主键
* @return 结果
*/
@Override
public int deleteExamPaperInfoById(String id)
{
return examPaperInfoMapper.deleteExamPaperInfoById(id);
}
}

View File

@ -36,13 +36,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="examLevel != null and examLevel != ''"> and exam_level = #{examLevel}</if>
<if test="examType != null and examType != ''"> and exam_type = #{examType}</if>
</where>
order by create_time desc
</select>
<select id="selectExamInfoById" parameterType="String" resultMap="ExamInfoResult">
<include refid="selectExamInfoVo"/>
where id = #{id}
</select>
<select id="selection" resultMap="ExamInfoResult">
<include refid="selectExamInfoVo"/>
</select>
<insert id="insertExamInfo" parameterType="com.inspur.examine.domain.ExamInfo">
insert into exam_info
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.inspur.examine.mapper.ExamPaperInfoMapper">
<resultMap type="com.inspur.examine.domain.ExamPaperInfo" id="ExamPaperInfoResult">
<result property="id" column="id" />
<result property="examId" column="exam_id" />
<result property="examineId" column="examine_id" />
<result property="score" column="score" />
<result property="status" column="status" />
<result property="examStartTime" column="exam_start_time" />
<result property="examEndTime" column="exam_end_time" />
<result property="tenantId" column="tenant_id" />
<result property="examName" column="exam_name" />
<result property="examineName" column="nick_name" />
</resultMap>
<sql id="selectExamPaperInfoVo">
SELECT
epi.id,
epi.exam_id,
epi.examine_id,
epi.score,
epi.`status`,
epi.exam_start_time,
epi.exam_end_time,
epi.tenant_id,
su.nick_name,
ei.exam_name
FROM
exam_paper_info AS epi
LEFT JOIN sys_user AS su ON su.user_id = epi.examine_id
LEFT JOIN exam_info AS ei ON ei.id = epi.exam_id
</sql>
<select id="selectExamPaperInfoList" parameterType="com.inspur.examine.domain.ExamPaperInfo" resultMap="ExamPaperInfoResult">
<include refid="selectExamPaperInfoVo"/>
<where>
<if test="examId != null and examId != ''"> and epi.exam_id = #{examId}</if>
<if test="examineId != null "> and epi.examine_id = #{examineId}</if>
<if test="score != null "> and epi.score = #{score}</if>
<if test="status != null and status != ''"> and epi.status = #{status}</if>
<if test="tenantId != null and tenantId != ''"> and epi.tenant_id = #{tenantId}</if>
</where>
order by epi.exam_start_time desc
</select>
<select id="selectExamPaperInfoById" parameterType="String" resultMap="ExamPaperInfoResult">
<include refid="selectExamPaperInfoVo"/>
where epi.id = #{id}
</select>
<insert id="insertExamPaperInfo" parameterType="com.inspur.examine.domain.ExamPaperInfo">
insert into exam_paper_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="examId != null">exam_id,</if>
<if test="examineId != null">examine_id,</if>
<if test="score != null">score,</if>
<if test="status != null">status,</if>
<if test="examStartTime != null">exam_start_time,</if>
<if test="examEndTime != null">exam_end_time,</if>
<if test="tenantId != null">tenant_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="examId != null">#{examId},</if>
<if test="examineId != null">#{examineId},</if>
<if test="score != null">#{score},</if>
<if test="status != null">#{status},</if>
<if test="examStartTime != null">#{examStartTime},</if>
<if test="examEndTime != null">#{examEndTime},</if>
<if test="tenantId != null">#{tenantId},</if>
</trim>
</insert>
<update id="updateExamPaperInfo" parameterType="com.inspur.examine.domain.ExamPaperInfo">
update exam_paper_info
<trim prefix="SET" suffixOverrides=",">
<if test="examId != null">exam_id = #{examId},</if>
<if test="examineId != null">examine_id = #{examineId},</if>
<if test="score != null">score = #{score},</if>
<if test="status != null">status = #{status},</if>
<if test="examStartTime != null">exam_start_time = #{examStartTime},</if>
<if test="examEndTime != null">exam_end_time = #{examEndTime},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteExamPaperInfoById" parameterType="String">
delete from exam_paper_info where id = #{id}
</delete>
<delete id="deleteExamPaperInfoByIds" parameterType="String">
delete from exam_paper_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="questionTitle != null and questionTitle != ''"> and question_title like concat('%', #{questionTitle}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="selectExamQuestionBankById" parameterType="String" resultMap="ExamQuestionBankResult">

View File

@ -42,3 +42,11 @@ export function delExamInfo(id) {
method: 'delete'
})
}
// 考试信息下拉
export function examInfoSelection() {
return request({
url: '/examine/examInfo/selection',
method: 'get'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询试卷信息列表
export function listPaperInfo(query) {
return request({
url: '/examine/paperInfo/list',
method: 'get',
params: query
})
}
// 查询试卷信息详细
export function getPaperInfo(id) {
return request({
url: '/examine/paperInfo/' + id,
method: 'get'
})
}
// 新增试卷信息
export function addPaperInfo(data) {
return request({
url: '/examine/paperInfo',
method: 'post',
data: data
})
}
// 修改试卷信息
export function updatePaperInfo(data) {
return request({
url: '/examine/paperInfo',
method: 'put',
data: data
})
}
// 删除试卷信息
export function delPaperInfo(id) {
return request({
url: '/examine/paperInfo/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,334 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="考试名称" prop="status">
<el-select v-model="queryParams.examId" placeholder="请选择考试名称" clearable>
<el-option
v-for="item in examInfoSelection"
:key="item.id"
:label="item.examName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="考生名称" prop="status">
<el-select v-model="queryParams.examineId" placeholder="请选择考生名称" clearable>
<el-option
v-for="item in userSelection"
:key="item.userId"
:label="item.nickName"
:value="item.userId"
/>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option
v-for="dict in dict.type.examine_result"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['examine:paperInfo:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['examine:paperInfo:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['examine:paperInfo:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['examine:paperInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="paperInfoList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="考试名称" align="center" prop="examName" />
<el-table-column label="考生名称" align="center" prop="examineName" />
<el-table-column label="考试开始时间" align="center" prop="examStartTime"/>
<el-table-column label="考试结束时间" align="center" prop="examEndTime"/>
<el-table-column label="分数" align="center" prop="score" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.examine_result" :value="scope.row.status"/>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['examine:paperInfo:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['examine:paperInfo:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改试卷信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="分数" prop="score">
<el-input v-model="form.score" placeholder="请输入分数" />
</el-form-item>
<el-form-item label="状态 0 未通过1 通过" prop="status">
<el-select v-model="form.status" placeholder="请选择状态">
<el-option
v-for="dict in dict.type.examine_result"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="考试开始时间" prop="examStartTime">
<el-date-picker clearable
v-model="form.examStartTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择考试开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="考试结束时间" prop="examEndTime">
<el-date-picker clearable
v-model="form.examEndTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择考试结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="租户id" prop="tenantId">
<el-input v-model="form.tenantId" placeholder="请输入租户id" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listPaperInfo, getPaperInfo, delPaperInfo, addPaperInfo, updatePaperInfo } from "@/api/examine/paperInfo";
import { examInfoSelection } from "@/api/examine/examInfo";
import { userSelection } from "@/api/system/user";
export default {
name: "PaperInfo",
dicts: ['examine_result'],
data() {
return {
userSelection:[],
examInfoSelection: [],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
paperInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
examId: null,
examineId: null,
score: null,
status: null,
tenantId: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
this.getExamInfoSelection();
this.getUserSelection();
},
methods: {
//
getUserSelection(){
userSelection().then((res)=>{
this.userSelection = res.data;
})
},
//
getExamInfoSelection(){
examInfoSelection().then((res)=>{
this.examInfoSelection = res;
})
},
/** 查询试卷信息列表 */
getList() {
this.loading = true;
listPaperInfo(this.queryParams).then(response => {
this.paperInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
examId: null,
examineId: null,
score: null,
status: null,
examStartTime: null,
examEndTime: null,
tenantId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {}
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加试卷信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getPaperInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改试卷信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updatePaperInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPaperInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除试卷信息编号为"' + ids + '"的数据项?').then(function() {
return delPaperInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('examine/paperInfo/export', {
...this.queryParams
}, `paperInfo_${new Date().getTime()}.xlsx`)
}
}
};
</script>