提交代码
parent
0d67d70ff4
commit
c51bd4bc1e
|
@ -29,6 +29,9 @@ public class SysUser extends BaseEntity
|
|||
@Excel(name = "公司编号", type = Type.IMPORT)
|
||||
private Long comId;
|
||||
|
||||
/** 公司名称 */
|
||||
private String comName;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
@ -168,6 +171,14 @@ public class SysUser extends BaseEntity
|
|||
this.comId = comId;
|
||||
}
|
||||
|
||||
public String getComName() {
|
||||
return comName;
|
||||
}
|
||||
|
||||
public void setComName(String comName) {
|
||||
this.comName = comName;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
|
|
|
@ -73,6 +73,11 @@ public class LoginUser implements Serializable
|
|||
*/
|
||||
private Long projectDeptId;
|
||||
|
||||
/**
|
||||
* 项目公司信息
|
||||
*/
|
||||
private String projectDeptName;
|
||||
|
||||
public String getToken()
|
||||
{
|
||||
return token;
|
||||
|
@ -187,6 +192,14 @@ public class LoginUser implements Serializable
|
|||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getProjectDeptName() {
|
||||
return projectDeptName;
|
||||
}
|
||||
|
||||
public void setProjectDeptName(String projectDeptName) {
|
||||
this.projectDeptName = projectDeptName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 无参构造方法
|
||||
*/
|
||||
|
|
|
@ -67,12 +67,14 @@ public class TokenController
|
|||
Map<String, Object> proData = dataResult.getData();
|
||||
SysUser user = loginUser.getSysUser();
|
||||
user.setActiveComId(Convert.toLong(proData.get("comId")));
|
||||
user.setActiveComName(Convert.toStr(proData.get("comName")));
|
||||
user.setActiveProjectId(Convert.toLong(proData.get("id")));
|
||||
user.setActiveProjectName(Convert.toStr(proData.get("projectName")));
|
||||
loginUser.setSysUser(user);
|
||||
loginUser.setProjectId(Convert.toLong(proData.get("id")));
|
||||
loginUser.setProjectName(Convert.toStr(proData.get("projectName")));
|
||||
loginUser.setProjectDeptId(Convert.toLong(proData.get("comId")));
|
||||
loginUser.setProjectDeptName(Convert.toStr(proData.get("comName")));
|
||||
// 刷新令牌有效期
|
||||
tokenService.refreshToken(loginUser);
|
||||
return R.ok();
|
||||
|
@ -86,6 +88,9 @@ public class TokenController
|
|||
if(Objects.nonNull(user.getActiveComId())){
|
||||
userInfo.setProjectDeptId(user.getActiveComId());
|
||||
}
|
||||
if(Objects.nonNull(user.getActiveComName())){
|
||||
userInfo.setProjectDeptName(user.getActiveComName());
|
||||
}
|
||||
if(Objects.nonNull(user.getActiveProjectId())){
|
||||
userInfo.setProjectId(user.getActiveProjectId());
|
||||
}
|
||||
|
|
|
@ -107,6 +107,9 @@ public class SysLoginService
|
|||
if(Objects.nonNull(user.getActiveComId())){
|
||||
userInfo.setProjectDeptId(user.getActiveComId());
|
||||
}
|
||||
if(Objects.nonNull(user.getActiveComName())){
|
||||
userInfo.setProjectDeptName(user.getActiveComName());
|
||||
}
|
||||
if(Objects.nonNull(user.getActiveProjectId())){
|
||||
userInfo.setProjectId(user.getActiveProjectId());
|
||||
}
|
||||
|
|
|
@ -44,6 +44,9 @@ public class BaseEntity implements Serializable
|
|||
/** 选中公司 */
|
||||
private Long activeComId;
|
||||
|
||||
/** 选中公司 */
|
||||
private String activeComName;
|
||||
|
||||
/** 选中项目 */
|
||||
private Long activeProjectId;
|
||||
|
||||
|
@ -147,6 +150,14 @@ public class BaseEntity implements Serializable
|
|||
this.activeComId = activeComId;
|
||||
}
|
||||
|
||||
public String getActiveComName() {
|
||||
return activeComName;
|
||||
}
|
||||
|
||||
public void setActiveComName(String activeComName) {
|
||||
this.activeComName = activeComName;
|
||||
}
|
||||
|
||||
public Long getActiveProjectId() {
|
||||
return activeProjectId;
|
||||
}
|
||||
|
|
|
@ -54,14 +54,26 @@ public class BusExamInfo extends BaseEntity
|
|||
@Excel(name = "单选题数量")
|
||||
private String singleNum;
|
||||
|
||||
/** 单选题分数 */
|
||||
@Excel(name = "单选题分数")
|
||||
private String singleMark;
|
||||
|
||||
/** 多选题数量 */
|
||||
@Excel(name = "多选题数量")
|
||||
private String multipleNum;
|
||||
|
||||
/** 多选题分数 */
|
||||
@Excel(name = "多选题分数")
|
||||
private String multipleMark;
|
||||
|
||||
/** 判断题数量 */
|
||||
@Excel(name = "判断题数量")
|
||||
private String estimateNum;
|
||||
|
||||
/** 判断题分数 */
|
||||
@Excel(name = "判断题分数")
|
||||
private String estimateMark;
|
||||
|
||||
/** 试卷分数 */
|
||||
@Excel(name = "试卷分数")
|
||||
private Long fullMark;
|
||||
|
@ -214,6 +226,31 @@ public class BusExamInfo extends BaseEntity
|
|||
{
|
||||
return useNumber;
|
||||
}
|
||||
|
||||
public String getSingleMark() {
|
||||
return singleMark;
|
||||
}
|
||||
|
||||
public void setSingleMark(String singleMark) {
|
||||
this.singleMark = singleMark;
|
||||
}
|
||||
|
||||
public String getMultipleMark() {
|
||||
return multipleMark;
|
||||
}
|
||||
|
||||
public void setMultipleMark(String multipleMark) {
|
||||
this.multipleMark = multipleMark;
|
||||
}
|
||||
|
||||
public String getEstimateMark() {
|
||||
return estimateMark;
|
||||
}
|
||||
|
||||
public void setEstimateMark(String estimateMark) {
|
||||
this.estimateMark = estimateMark;
|
||||
}
|
||||
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
|
|
|
@ -50,6 +50,10 @@ public class BusExamQuestion extends BaseEntity
|
|||
@Excel(name = "问题类型")
|
||||
private Long questionType;
|
||||
|
||||
/** 问题范围 */
|
||||
@Excel(name = "问题范围")
|
||||
private String questionScope;
|
||||
|
||||
/** 问题描述 */
|
||||
@Excel(name = "问题描述")
|
||||
private String questionDesc;
|
||||
|
@ -144,6 +148,15 @@ public class BusExamQuestion extends BaseEntity
|
|||
{
|
||||
return questionType;
|
||||
}
|
||||
|
||||
public String getQuestionScope() {
|
||||
return questionScope;
|
||||
}
|
||||
|
||||
public void setQuestionScope(String questionScope) {
|
||||
this.questionScope = questionScope;
|
||||
}
|
||||
|
||||
public void setQuestionDesc(String questionDesc)
|
||||
{
|
||||
this.questionDesc = questionDesc;
|
||||
|
|
|
@ -18,18 +18,33 @@ public class BusExamUser extends BaseEntity
|
|||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 部门主键 */
|
||||
@Excel(name = "部门主键")
|
||||
private Long deptId;
|
||||
/** 单位主键 */
|
||||
@Excel(name = "单位主键")
|
||||
private Long comId;
|
||||
|
||||
/** 单位名称 */
|
||||
@Excel(name = "单位名称")
|
||||
private String comName;
|
||||
|
||||
/** 项目主键 */
|
||||
@Excel(name = "项目主键")
|
||||
private Long projectId;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/** 用户主键 */
|
||||
@Excel(name = "用户主键")
|
||||
private Long userId;
|
||||
|
||||
/** 用户名称 */
|
||||
@Excel(name = "用户名称")
|
||||
private Long userNick;
|
||||
|
||||
/** 用户账号 */
|
||||
@Excel(name = "用户账号")
|
||||
private Long userName;
|
||||
|
||||
/** 试卷名称 */
|
||||
@Excel(name = "试卷名称")
|
||||
private String examTitle;
|
||||
|
@ -83,15 +98,23 @@ public class BusExamUser extends BaseEntity
|
|||
{
|
||||
return id;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
|
||||
public Long getComId() {
|
||||
return comId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
public void setComId(Long comId) {
|
||||
this.comId = comId;
|
||||
}
|
||||
|
||||
public String getComName() {
|
||||
return comName;
|
||||
}
|
||||
|
||||
public void setComName(String comName) {
|
||||
this.comName = comName;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
|
@ -101,6 +124,15 @@ public class BusExamUser extends BaseEntity
|
|||
{
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
|
@ -110,6 +142,23 @@ public class BusExamUser extends BaseEntity
|
|||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
public Long getUserNick() {
|
||||
return userNick;
|
||||
}
|
||||
|
||||
public void setUserNick(Long userNick) {
|
||||
this.userNick = userNick;
|
||||
}
|
||||
|
||||
public Long getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(Long userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public void setExamTitle(String examTitle)
|
||||
{
|
||||
this.examTitle = examTitle;
|
||||
|
@ -214,7 +263,7 @@ public class BusExamUser extends BaseEntity
|
|||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("comId", getComId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("userId", getUserId())
|
||||
.append("examTitle", getExamTitle())
|
||||
|
|
|
@ -15,8 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="craftType" column="craft_type" />
|
||||
<result property="craftPost" column="craft_post" />
|
||||
<result property="singleNum" column="single_num" />
|
||||
<result property="singleMark" column="single_mark" />
|
||||
<result property="multipleNum" column="multiple_num" />
|
||||
<result property="multipleMark" column="multiple_mark" />
|
||||
<result property="estimateNum" column="estimate_num" />
|
||||
<result property="estimateMark" column="estimate_mark" />
|
||||
<result property="fullMark" column="full_mark" />
|
||||
<result property="passMark" column="pass_mark" />
|
||||
<result property="useNumber" column="use_number" />
|
||||
|
@ -40,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectBusExamInfoVo">
|
||||
select bei.id, bei.com_id, sd.dept_name as com_name, bei.project_id, pi.project_name, bei.exam_title, bei.exam_type, bei.craft_type, bei.craft_post, bei.single_num, bei.multiple_num, bei.estimate_num, bei.full_mark, bei.pass_mark, bei.use_number, bei.is_del, bei.create_by, bei.create_time, bei.update_by, bei.update_time, bei.remark from bus_exam_info bei
|
||||
select bei.id, bei.com_id, sd.dept_name as com_name, bei.project_id, pi.project_name, bei.exam_title, bei.exam_type, bei.craft_type, bei.craft_post, bei.single_num, bei.single_mark, bei.multiple_num, bei.multiple_mark, bei.estimate_num, bei.estimate_mark, bei.full_mark, bei.pass_mark, bei.use_number, bei.is_del, bei.create_by, bei.create_time, bei.update_by, bei.update_time, bei.remark from bus_exam_info bei
|
||||
left join pro_project_info pi on pi.id = bei.project_id
|
||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
||||
</sql>
|
||||
|
@ -51,6 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bei.is_del != 2
|
||||
<if test="comId != null "> and bei.com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and bei.project_id = #{projectId}</if>
|
||||
<if test="activeComId != null "> and bei.com_id = #{activeComId}</if>
|
||||
<if test="activeProjectId != null "> and bei.project_id = #{activeProjectId}</if>
|
||||
<if test="examTitle != null and examTitle != ''"> and bei.exam_title = #{examTitle}</if>
|
||||
<if test="examType != null and examType != ''"> and bei.exam_type = #{examType}</if>
|
||||
<if test="craftType != null and craftType != ''"> and bei.craft_type = #{craftType}</if>
|
||||
|
@ -60,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectBusExamInfoById" parameterType="Long" resultMap="BusExamInfoBusExamInfoQuesResult">
|
||||
select a.id, a.com_id, sd.dept_name as com_name, a.project_id, pi.project_name, a.exam_title, a.exam_type, a.craft_type, a.craft_post, a.single_num, a.multiple_num, a.estimate_num, a.full_mark, a.pass_mark, a.use_number, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||
select a.id, a.com_id, sd.dept_name as com_name, a.project_id, pi.project_name, a.exam_title, a.exam_type, a.craft_type, a.craft_post, a.single_num, a.single_mark, a.multiple_num, a.multiple_mark, a.estimate_num, a.estimate_mark, a.full_mark, a.pass_mark, a.use_number, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||
b.exam_id as sub_exam_id, b.question_id as sub_question_id, b.marks as sub_marks, b.sort_by as sub_sort_by
|
||||
from bus_exam_info a
|
||||
left join pro_project_info pi on pi.id = a.project_id
|
||||
|
@ -79,8 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="craftType != null">craft_type,</if>
|
||||
<if test="craftPost != null">craft_post,</if>
|
||||
<if test="singleNum != null">single_num,</if>
|
||||
<if test="singleMark != null">single_mark,</if>
|
||||
<if test="multipleNum != null">multiple_num,</if>
|
||||
<if test="multipleMark != null">multiple_mark,</if>
|
||||
<if test="estimateNum != null">estimate_num,</if>
|
||||
<if test="estimateMark != null">estimate_mark,</if>
|
||||
<if test="fullMark != null">full_mark,</if>
|
||||
<if test="passMark != null">pass_mark,</if>
|
||||
<if test="useNumber != null">use_number,</if>
|
||||
|
@ -99,8 +107,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="craftType != null">#{craftType},</if>
|
||||
<if test="craftPost != null">#{craftPost},</if>
|
||||
<if test="singleNum != null">#{singleNum},</if>
|
||||
<if test="singleMark != null">#{singleMark},</if>
|
||||
<if test="multipleNum != null">#{multipleNum},</if>
|
||||
<if test="multipleMark != null">#{multipleMark},</if>
|
||||
<if test="estimateNum != null">#{estimateNum},</if>
|
||||
<if test="estimateMark != null">#{estimateMark},</if>
|
||||
<if test="fullMark != null">#{fullMark},</if>
|
||||
<if test="passMark != null">#{passMark},</if>
|
||||
<if test="useNumber != null">#{useNumber},</if>
|
||||
|
@ -123,8 +134,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="craftType != null">craft_type = #{craftType},</if>
|
||||
<if test="craftPost != null">craft_post = #{craftPost},</if>
|
||||
<if test="singleNum != null">single_num = #{singleNum},</if>
|
||||
<if test="singleMark != null">single_mark = #{singleMark},</if>
|
||||
<if test="multipleNum != null">multiple_num = #{multipleNum},</if>
|
||||
<if test="multipleMark != null">multiple_mark = #{multipleMark},</if>
|
||||
<if test="estimateNum != null">estimate_num = #{estimateNum},</if>
|
||||
<if test="estimateMark != null">estimate_mark = #{estimateMark},</if>
|
||||
<if test="fullMark != null">full_mark = #{fullMark},</if>
|
||||
<if test="passMark != null">pass_mark = #{passMark},</if>
|
||||
<if test="useNumber != null">use_number = #{useNumber},</if>
|
||||
|
|
|
@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="craftPost" column="craft_post" />
|
||||
<result property="questionDiff" column="question_diff" />
|
||||
<result property="questionType" column="question_type" />
|
||||
<result property="questionScope" column="question_scope" />
|
||||
<result property="questionDesc" column="question_desc" />
|
||||
<result property="questionAnswer" column="question_answer" />
|
||||
<result property="isDel" column="is_del" />
|
||||
|
@ -42,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectBusExamQuestionVo">
|
||||
select beq.id, beq.com_id, sd.dept_name as com_name, beq.project_id, pi.project_name, beq.craft_type, beq.craft_post, beq.question_diff, beq.question_type, beq.question_desc, beq.question_answer, beq.is_del, beq.create_by, beq.create_time, beq.update_by, beq.update_time, beq.remark from bus_exam_question beq
|
||||
select beq.id, beq.com_id, sd.dept_name as com_name, beq.project_id, pi.project_name, beq.craft_type, beq.craft_post, beq.question_diff, beq.question_type, beq.question_scope, beq.question_desc, beq.question_answer, beq.is_del, beq.create_by, beq.create_time, beq.update_by, beq.update_time, beq.remark from bus_exam_question beq
|
||||
left join pro_project_info pi on pi.id = beq.project_id
|
||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
||||
</sql>
|
||||
|
@ -59,14 +60,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="craftPost != null and craftPost != ''"> and find_in_set(#{craftPost}, beq.craft_post)</if>
|
||||
<if test="questionDiff != null "> and beq.question_diff = #{questionDiff} </if>
|
||||
<if test="questionType != null "> and beq.question_type = #{questionType} </if>
|
||||
<if test="questionScope != null and questionScope != ''"> and beq.question_scope = #{questionScope}</if>
|
||||
<if test="questionDesc != null and questionDesc != ''"> and beq.question_desc = #{questionDesc}</if>
|
||||
<if test="questionAnswer != null and questionAnswer != ''"> and beq.question_answer = #{questionAnswer}</if>
|
||||
</where>
|
||||
order by beq.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectBusExamQuestionById" parameterType="Long" resultMap="BusExamQuestionBusExamQuestionResultResult">
|
||||
select a.id, a.com_id, sd.dept_name as com_name, a.project_id, pi.project_name, a.craft_type, a.craft_post, a.question_diff, a.question_type, a.question_desc, a.question_answer, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||
select a.id, a.com_id, sd.dept_name as com_name, a.project_id, pi.project_name, a.craft_type, a.craft_post, a.question_diff, a.question_type, a.question_scope, a.question_desc, a.question_answer, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||
b.id as sub_id, b.question_id as sub_question_id, b.opt as sub_opt, b.result as sub_result, b.is_ok as sub_is_ok, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark
|
||||
from bus_exam_question a
|
||||
left join pro_project_info pi on pi.id = a.project_id
|
||||
|
@ -84,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="craftPost != null">craft_post,</if>
|
||||
<if test="questionDiff != null">question_diff,</if>
|
||||
<if test="questionType != null">question_type,</if>
|
||||
<if test="questionScope != null">question_scope,</if>
|
||||
<if test="questionDesc != null">question_desc,</if>
|
||||
<if test="questionAnswer != null">question_answer,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
|
@ -100,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="craftPost != null">#{craftPost},</if>
|
||||
<if test="questionDiff != null">#{questionDiff},</if>
|
||||
<if test="questionType != null">#{questionType},</if>
|
||||
<if test="questionScope != null">#{questionScope},</if>
|
||||
<if test="questionDesc != null">#{questionDesc},</if>
|
||||
<if test="questionAnswer != null">#{questionAnswer},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
|
@ -120,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="craftPost != null">craft_post = #{craftPost},</if>
|
||||
<if test="questionDiff != null">question_diff = #{questionDiff},</if>
|
||||
<if test="questionType != null">question_type = #{questionType},</if>
|
||||
<if test="questionScope != null">question_scope = #{questionScope},</if>
|
||||
<if test="questionDesc != null">question_desc = #{questionDesc},</if>
|
||||
<if test="questionAnswer != null">question_answer = #{questionAnswer},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
|
|
|
@ -6,9 +6,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<resultMap type="BusExamUser" id="BusExamUserResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="comId" column="com_id" />
|
||||
<result property="comName" column="com_name" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userNick" column="user_nick" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="examTitle" column="exam_title" />
|
||||
<result property="examType" column="exam_type" />
|
||||
<result property="craftType" column="craft_type" />
|
||||
|
@ -28,32 +32,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectBusExamUserVo">
|
||||
select id, dept_id, project_id, user_id, exam_title, exam_type, craft_type, craft_post, single_num, multiple_num, estimate_num, user_mark, res_status, use_times, is_del, create_by, create_time, update_by, update_time, remark from bus_exam_user
|
||||
select beu.id, beu.com_id, sd.dept_name as com_name, beu.project_id, pi.project_name, beu.user_id, su.user_nick, su.user_name, beu.exam_title, beu.exam_type, beu.craft_type, beu.craft_post, beu.single_num, beu.multiple_num, beu.estimate_num, beu.user_mark, beu.res_status, beu.use_times, beu.is_del, beu.create_by, beu.create_time, beu.update_by, beu.update_time, beu.remark from bus_exam_user beu
|
||||
left join pro_project_info pi on pi.id = beu.project_id
|
||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
||||
left join sys_user su on su.user_id = beu.user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectBusExamUserList" parameterType="BusExamUser" resultMap="BusExamUserResult">
|
||||
<include refid="selectBusExamUserVo"/>
|
||||
<where>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="examTitle != null and examTitle != ''"> and exam_title = #{examTitle}</if>
|
||||
<if test="examType != null and examType != ''"> and exam_type = #{examType}</if>
|
||||
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
|
||||
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
|
||||
<if test="singleNum != null and singleNum != ''"> and single_num = #{singleNum}</if>
|
||||
<if test="multipleNum != null and multipleNum != ''"> and multiple_num = #{multipleNum}</if>
|
||||
<if test="estimateNum != null and estimateNum != ''"> and estimate_num = #{estimateNum}</if>
|
||||
<if test="userMark != null "> and user_mark = #{userMark}</if>
|
||||
<if test="resStatus != null "> and res_status = #{resStatus}</if>
|
||||
<if test="useTimes != null and useTimes != ''"> and use_times = #{useTimes}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
beu.is_del = 0
|
||||
<if test="comId != null "> and beu.com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and beu.project_id = #{projectId}</if>
|
||||
<if test="activeComId != null "> and beu.com_id = #{activeComId}</if>
|
||||
<if test="activeProjectId != null "> and beu.project_id = #{activeProjectId}</if>
|
||||
<if test="userId != null "> and beu.user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and (beu.com_id = #{activeComId} or )</if>
|
||||
<if test="examTitle != null and examTitle != ''"> and beu.exam_title = #{examTitle}</if>
|
||||
<if test="examType != null and examType != ''"> and beu.exam_type = #{examType}</if>
|
||||
<if test="craftType != null and craftType != ''"> and beu.craft_type = #{craftType}</if>
|
||||
<if test="craftPost != null and craftPost != ''"> and beu.craft_post = #{craftPost}</if>
|
||||
<if test="resStatus != null "> and beu.res_status = #{resStatus}</if>
|
||||
<if test="useTimes != null and useTimes != ''"> and beu.use_times = #{useTimes}</if>
|
||||
</where>
|
||||
order by beu.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectBusExamUserById" parameterType="Long" resultMap="BusExamUserResult">
|
||||
<include refid="selectBusExamUserVo"/>
|
||||
where id = #{id}
|
||||
where beu.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusExamUser" parameterType="BusExamUser" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
@ -71,7 +71,7 @@ public class BusExamUserController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BusExamUser busExamUser)
|
||||
{
|
||||
return toAjax(busExamUserService.insertBusExamUser(busExamUser));
|
||||
return success(busExamUserService.insertBusExamUser(busExamUser));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,4 +95,15 @@ public class BusExamUserController extends BaseController
|
|||
{
|
||||
return toAjax(busExamUserService.deleteBusExamUserByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户试卷
|
||||
* @RequiresPermissions("manage:busExamUser:add")
|
||||
*/
|
||||
@Log(title = "新增试卷考题", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/push")
|
||||
public AjaxResult pushBusExamUser(@RequestBody BusExamUser busExamUser)
|
||||
{
|
||||
return success(busExamUserService.insertBusExamUser(busExamUser));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public interface IBusExamUserService
|
|||
* @param busExamUser 用户试卷
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusExamUser(BusExamUser busExamUser);
|
||||
public BusExamUser insertBusExamUser(BusExamUser busExamUser);
|
||||
|
||||
/**
|
||||
* 修改用户试卷
|
||||
|
|
|
@ -68,8 +68,8 @@ public class BusExamQuestionServiceImpl implements IBusExamQuestionService
|
|||
@Override
|
||||
public int insertBusExamQuestion(BusExamQuestion busExamQuestion)
|
||||
{
|
||||
ProProjectInfo info = redisService.getCacheObject(CacheConstants.PRO_PROJECT+busExamQuestion.getProjectId());
|
||||
busExamQuestion.setComId(info.getComId());
|
||||
/**ProProjectInfo info = redisService.getCacheObject(CacheConstants.PRO_PROJECT+busExamQuestion.getProjectId());
|
||||
busExamQuestion.setComId(info.getComId());*/
|
||||
busExamQuestion.setCreateBy(SecurityUtils.getUsername());
|
||||
busExamQuestion.setCreateTime(DateUtils.getNowDate());
|
||||
busExamQuestion.setUpdateTime(DateUtils.getNowDate());
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.yanzhu.manage.service.impl;
|
|||
|
||||
import java.util.List;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.manage.mapper.BusExamUserMapper;
|
||||
|
@ -51,8 +53,10 @@ public class BusExamUserServiceImpl implements IBusExamUserService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBusExamUser(BusExamUser busExamUser)
|
||||
public BusExamUser insertBusExamUser(BusExamUser busExamUser)
|
||||
{
|
||||
SysUser cache = SecurityUtils.getLoginUser().getSysUser();
|
||||
|
||||
busExamUser.setCreateTime(DateUtils.getNowDate());
|
||||
return busExamUserMapper.insertBusExamUser(busExamUser);
|
||||
}
|
||||
|
|
|
@ -135,6 +135,7 @@ public class SysUserController extends BaseController {
|
|||
// 默认以公司管理员登录
|
||||
sysUser = userService.selectUserByUserName(username, sysUser.getComId());
|
||||
sysUser.setActiveComId(sysUser.getComId());
|
||||
sysUser.setActiveComName(sysUser.getComName());
|
||||
} else {
|
||||
// 查询用户绑定项目列表
|
||||
List<Map<String, Object>> list = userService.selectProjectsByUserId(sysUser.getUserId());
|
||||
|
@ -144,6 +145,7 @@ public class SysUserController extends BaseController {
|
|||
// 以项目人员身份登录
|
||||
sysUser = userService.selectUserByUserName(username, Convert.toLong(list.get(0).get("project_id")));
|
||||
sysUser.setActiveComId(sysUser.getComId());
|
||||
sysUser.setActiveComName(sysUser.getComName());
|
||||
sysUser.setActiveProjectId(Convert.toLong(list.get(0).get("project_id")));
|
||||
sysUser.setActiveProjectName(Convert.toStr(list.get(0).get("project_name")));
|
||||
}
|
||||
|
@ -170,6 +172,7 @@ public class SysUserController extends BaseController {
|
|||
List<Map<String, Object>> list = userService.selectProjectsByUserId(sysUser.getUserId());
|
||||
|
||||
sysUser.setActiveComId(sysUser.getComId());
|
||||
sysUser.setActiveComName(sysUser.getComName());
|
||||
sysUser.setActiveProjectId(Convert.toLong(list.get(0).get("project_id")));
|
||||
sysUser.setActiveProjectName(Convert.toStr(list.get(0).get("project_name")));
|
||||
|
||||
|
@ -231,6 +234,7 @@ public class SysUserController extends BaseController {
|
|||
}
|
||||
}
|
||||
user.setActiveComId(cache.getComId());
|
||||
user.setActiveComName(cache.getComName());
|
||||
user.setActiveProjectId(cache.getActiveProjectId());
|
||||
user.setActiveProjectName(cache.getActiveProjectName());
|
||||
// 角色集合
|
||||
|
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="SysUser" id="SysUserResult">
|
||||
<id property="userId" column="user_id" />
|
||||
<id property="comId" column="com_id" />
|
||||
<id property="comName" column="com_name" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
|
@ -65,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.com_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type, u.card_code, u.user_picture, u.card_img_pos, u.card_img_inv, u.user_infos, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
select u.user_id, u.com_id, com.dept_name as com_name, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type, u.card_code, u.user_picture, u.card_img_pos, u.card_img_inv, u.user_infos, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_short_name, d.dept_code, d.dept_type, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,com.dept_name com_dept_name
|
||||
from sys_user u
|
||||
|
@ -288,8 +289,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<!--根据用户编号查询入场项目信息-->
|
||||
<select id="selectProjectsByUserId" parameterType="Long" resultType="Map">
|
||||
select pu.project_id, pi.project_name, pi.com_id from pro_project_info_users pu
|
||||
select pi.com_id, sd.dept_name as com_name, pu.project_id, pi.project_name from pro_project_info_users pu
|
||||
left join pro_project_info pi on pi.id = pu.project_id
|
||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
||||
where pu.user_id=#{userId} and pu.is_del=0 and pu.use_status=1 order by pu.sort_by asc
|
||||
</select>
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ const useUserStore = defineStore(
|
|||
compInfo:{},
|
||||
roles: [],
|
||||
permissions: [],
|
||||
currentComId: null,
|
||||
currentComName: null,
|
||||
currentProId: null,
|
||||
currentProName: null,
|
||||
}),
|
||||
|
@ -46,11 +48,13 @@ const useUserStore = defineStore(
|
|||
} else {
|
||||
this.roles = ['ROLE_DEFAULT']
|
||||
}
|
||||
this.name = user.userName
|
||||
this.name = user.userName;
|
||||
this.compInfo=user.comp;
|
||||
this.avatar = avatar;
|
||||
this.currentProId = user.activeProjectId
|
||||
this.currentProName = user.activeProjectName
|
||||
this.currentComId = user.activeComId;
|
||||
this.currentComName = user.activeComName;
|
||||
this.currentProId = user.activeProjectId;
|
||||
this.currentProName = user.activeProjectName;
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
|
|
@ -27,10 +27,11 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种岗位" prop="craftPost">
|
||||
<el-form-item label="工种岗位" prop="craftPost" v-if="queryParams.craftType">
|
||||
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
|
||||
<el-option
|
||||
v-for="dict in pro_craft_post"
|
||||
v-show="dict.elTagClass == queryParams.craftType"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
@ -87,7 +88,7 @@
|
|||
|
||||
<el-table v-loading="loading" :data="busExamInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="试卷编号" align="center" prop="id" />
|
||||
<el-table-column label="试卷编号" align="center" prop="id" width="80"/>
|
||||
<el-table-column label="所属公司" align="center" prop="comName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="试卷名称" align="center" prop="examTitle" />
|
||||
|
@ -101,11 +102,17 @@
|
|||
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单选题数量" align="center" prop="singleNum" />
|
||||
<el-table-column label="多选题数量" align="center" prop="multipleNum" />
|
||||
<el-table-column label="判断题数量" align="center" prop="estimateNum" />
|
||||
<el-table-column label="试卷分数" align="center" prop="fullMark" />
|
||||
<el-table-column label="通过分数" align="center" prop="passMark" />
|
||||
<el-table-column label="单选题数量" align="center" prop="singleNum" width="88"/>
|
||||
<el-table-column label="单选题分数" align="center" prop="fullMark" width="88"/>
|
||||
<el-table-column label="多选题数量" align="center" prop="multipleNum" width="88"/>
|
||||
<el-table-column label="多选题分数" align="center" prop="fullMark" width="88"/>
|
||||
<el-table-column label="判断题数量" align="center" prop="estimateNum" width="88"/>
|
||||
<el-table-column label="判断题分数" align="center" prop="fullMark" width="88"/>
|
||||
<el-table-column label="通过分数" align="center" prop="passMark" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" effect="dark">{{ scope.row.passMark }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答题次数" align="center" prop="useNumber" />
|
||||
<el-table-column label="是否启用" align="center" prop="isDel">
|
||||
<template #default="scope">
|
||||
|
@ -114,7 +121,6 @@
|
|||
:active-value="parseInt(0)"
|
||||
:inactive-value="parseInt(1)"
|
||||
v-model="scope.row.isDel"
|
||||
:disabled="scope.row.disabledState"
|
||||
@change="setStatus($event, scope.row)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
|
@ -122,9 +128,9 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="150" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button v-if="!scope.row.disabledState" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamInfo:edit']">修改</el-button>
|
||||
<el-button v-if="!scope.row.disabledState" link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busExamInfo:remove']">删除</el-button>
|
||||
<el-button v-if="scope.row.disabledState" type="danger" link disabled>-</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamInfo:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busExamInfo:remove']">删除</el-button>
|
||||
<el-button type="danger" link disabled>-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -139,7 +145,7 @@
|
|||
|
||||
<!-- 添加或修改基础试卷对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body>
|
||||
<el-form ref="busExamInfoRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form ref="busExamInfoRef" :model="form" :rules="rules" label-width="88px">
|
||||
<el-form-item label="项目名称" v-if="form.projectId">
|
||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||
</el-form-item>
|
||||
|
@ -147,7 +153,7 @@
|
|||
<el-input v-model="form.examTitle" placeholder="请输入试卷名称" maxlength="64" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种类型" prop="craftType">
|
||||
<el-select v-model="form.craftType" placeholder="请选择工种类型" style="width:100%">
|
||||
<el-select v-model="form.craftType" placeholder="请选择工种类型" style="width:100%" @change="changeCraftType">
|
||||
<el-option
|
||||
v-for="dict in pro_craft_type"
|
||||
:key="dict.value"
|
||||
|
@ -160,14 +166,52 @@
|
|||
<el-select v-model="form.craftPost" placeholder="请选择工种岗位" style="width:100%">
|
||||
<el-option
|
||||
v-for="dict in pro_craft_post"
|
||||
v-show="dict.elTagClass == form.craftType"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="合格分数" prop="passMark">
|
||||
<el-input v-model.number="form.passMark" placeholder="请输入合格分数" />
|
||||
<el-divider content-position="center">试卷分数设置</el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单选题数量" prop="singleNum">
|
||||
<el-input v-model.number="form.singleNum" placeholder="请输入单选题数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单选题分数" prop="singleMark">
|
||||
<el-input v-model.number="form.singleMark" placeholder="请输入单选题分数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="多选题数量" prop="multipleNum">
|
||||
<el-input v-model.number="form.multipleNum" placeholder="请输入多选题数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="多选题分数" prop="multipleMark">
|
||||
<el-input v-model.number="form.multipleMark" placeholder="请输入多选题分数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单选题数量" prop="estimateNum">
|
||||
<el-input v-model.number="form.estimateNum" placeholder="请输入单选题数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单选题分数" prop="estimateMark">
|
||||
<el-input v-model.number="form.estimateMark" placeholder="请输入单选题分数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="及格分数" prop="passMark">
|
||||
<el-input v-model.number="form.passMark" placeholder="请输入及格分数" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
@ -177,34 +221,7 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- <el-divider content-position="center">试卷问题信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="Plus" @click="handleAddBusExamInfoQues">添加</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="Delete" @click="handleDeleteBusExamInfoQues">删除</el-button>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<!-- <el-table :data="busExamInfoQuesList" :row-class-name="rowBusExamInfoQuesIndex" @selection-change="handleBusExamInfoQuesSelectionChange" ref="busExamInfoQues">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
<el-table-column label="问题主键" prop="questionId" width="150">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.questionId" placeholder="请输入问题主键" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分数" prop="marks" width="150">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.marks" placeholder="请输入分数" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" prop="sortBy" width="150">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.sortBy" placeholder="请输入排序" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -242,6 +259,30 @@ const data = reactive({
|
|||
examTitle: [{ required: true, message: "试卷名称不能为空", trigger: "blur" }],
|
||||
craftType: [{ required: true, message: "工种类型不能为空", trigger: "change" }],
|
||||
craftPost: [{ required: true, message: "工种岗位不能为空", trigger: "change" }],
|
||||
singleNum: [
|
||||
{ required: true, message: "单选题数量不能为空", trigger: "blur" },
|
||||
{ type: "number", message: "请输入数字类型", trigger: "blur" },
|
||||
],
|
||||
singleMark: [
|
||||
{ required: true, message: "单选题分数不能为空", trigger: "blur" },
|
||||
{ type: "number", message: "请输入数字类型", trigger: "blur" },
|
||||
],
|
||||
multipleNum: [
|
||||
{ required: true, message: "多选题数量不能为空", trigger: "blur" },
|
||||
{ type: "number", message: "请输入数字类型", trigger: "blur" },
|
||||
],
|
||||
multipleMark: [
|
||||
{ required: true, message: "多选题分数不能为空", trigger: "blur" },
|
||||
{ type: "number", message: "请输入数字类型", trigger: "blur" },
|
||||
],
|
||||
estimateNum: [
|
||||
{ required: true, message: "判断题数量不能为空", trigger: "blur" },
|
||||
{ type: "number", message: "请输入数字类型", trigger: "blur" },
|
||||
],
|
||||
estimateMark: [
|
||||
{ required: true, message: "判断题分数不能为空", trigger: "blur" },
|
||||
{ type: "number", message: "请输入数字类型", trigger: "blur" },
|
||||
],
|
||||
passMark: [
|
||||
{ required: true, message: "合格分数不能为空", trigger: "blur" },
|
||||
{ type: "number", message: "请输入数字类型", trigger: "blur" },
|
||||
|
@ -255,9 +296,6 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
function getList() {
|
||||
loading.value = true;
|
||||
listBusExamInfo(queryParams.value).then(response => {
|
||||
response.rows.forEach(item => {
|
||||
item.disabledState = initRowDisabled(item);
|
||||
})
|
||||
busExamInfoList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
|
@ -385,6 +423,11 @@ function setStatus(val, row) {
|
|||
});
|
||||
}
|
||||
|
||||
/** 岗位类型改变 */
|
||||
function changeCraftType() {
|
||||
form.value.craftPost = null;
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
|
@ -435,20 +478,6 @@ function handleExport() {
|
|||
}, `busExamInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
/** 初始化行标识 */
|
||||
function initRowDisabled(row) {
|
||||
let roles = userStore.roles;
|
||||
if(roles.includes("admin")){
|
||||
return false;
|
||||
}else if(roles.includes("gsAdmin") && row.comId){
|
||||
return false;
|
||||
}else if(row.projectId){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
|
|
|
@ -1,267 +0,0 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="试卷主键" prop="examId">
|
||||
<el-input
|
||||
v-model="queryParams.examId"
|
||||
placeholder="请输入试卷主键"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题主键" prop="questionId">
|
||||
<el-input
|
||||
v-model="queryParams.questionId"
|
||||
placeholder="请输入问题主键"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分数" prop="marks">
|
||||
<el-input
|
||||
v-model="queryParams.marks"
|
||||
placeholder="请输入分数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sortBy">
|
||||
<el-input
|
||||
v-model="queryParams.sortBy"
|
||||
placeholder="请输入排序"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @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="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:busExamInfoQues:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['manage:busExamInfoQues:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['manage:busExamInfoQues:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['manage:busExamInfoQues:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="busExamInfoQuesList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="试卷主键" align="center" prop="examId" />
|
||||
<el-table-column label="问题主键" align="center" prop="questionId" />
|
||||
<el-table-column label="分数" align="center" prop="marks" />
|
||||
<el-table-column label="排序" align="center" prop="sortBy" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamInfoQues:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busExamInfoQues:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改试卷问题对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="busExamInfoQuesRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="试卷主键" prop="examId">
|
||||
<el-input v-model="form.examId" placeholder="请输入试卷主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="问题主键" prop="questionId">
|
||||
<el-input v-model="form.questionId" placeholder="请输入问题主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分数" prop="marks">
|
||||
<el-input v-model="form.marks" placeholder="请输入分数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sortBy">
|
||||
<el-input v-model="form.sortBy" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="BusExamInfoQues">
|
||||
import { listBusExamInfoQues, getBusExamInfoQues, delBusExamInfoQues, addBusExamInfoQues, updateBusExamInfoQues } from "@/api/manage/busExamInfoQues";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const busExamInfoQuesList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
examId: null,
|
||||
questionId: null,
|
||||
marks: null,
|
||||
sortBy: null
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询试卷问题列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listBusExamInfoQues(queryParams.value).then(response => {
|
||||
busExamInfoQuesList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
examId: null,
|
||||
questionId: null,
|
||||
marks: null,
|
||||
sortBy: null
|
||||
};
|
||||
proxy.resetForm("busExamInfoQuesRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.examId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加试卷问题";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _examId = row.examId || ids.value
|
||||
getBusExamInfoQues(_examId).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改试卷问题";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["busExamInfoQuesRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.examId != null) {
|
||||
updateBusExamInfoQues(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addBusExamInfoQues(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _examIds = row.examId || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除试卷问题编号为"' + _examIds + '"的数据项?').then(function() {
|
||||
return delBusExamInfoQues(_examIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/busExamInfoQues/export', {
|
||||
...queryParams.value
|
||||
}, `busExamInfoQues_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -27,10 +27,11 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种岗位" prop="craftPost">
|
||||
<el-form-item label="工种岗位" prop="craftPost" v-if="queryParams.craftType">
|
||||
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
|
||||
<el-option
|
||||
v-for="dict in pro_craft_post"
|
||||
v-show="dict.elTagClass == queryParams.craftType"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
@ -47,6 +48,16 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题范围" prop="questionScope">
|
||||
<el-select v-model="queryParams.questionScope" placeholder="请选择问题范围" clearable>
|
||||
<el-option
|
||||
v-for="dict in edu_question_scope"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
|
@ -54,14 +65,31 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col v-if="FirRoles=='admin'" :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:busExamQuestion:add']"
|
||||
>新增通用问题</el-button>
|
||||
</el-col>
|
||||
<el-col v-if="FirRoles=='admin' || FirRoles=='gsAdmin'" :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAddCom"
|
||||
v-hasPermi="['manage:busExamQuestion:add']"
|
||||
>新增公司问题</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
@click="handleAddProject"
|
||||
v-hasPermi="['manage:busExamQuestion:add']"
|
||||
>新增</el-button>
|
||||
>新增项目问题</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -98,8 +126,18 @@
|
|||
<el-table v-loading="loading" :data="busExamQuestionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="问题编号" align="center" prop="id" width="80"/>
|
||||
<el-table-column label="所属公司" align="center" prop="comName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="所属公司" align="center" prop="comName" >
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.comId">{{scope.row.comName}}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" >
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.projectId">{{scope.row.projectName}}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="问题描述" align="center" prop="questionDesc" width="200"/>
|
||||
<el-table-column label="工种类型" align="center" prop="craftType" width="100">
|
||||
<template #default="scope">
|
||||
|
@ -124,6 +162,11 @@
|
|||
<dict-tag :options="edu_question_type" :value="scope.row.questionType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="问题范围" align="center" prop="questionScope" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="edu_question_scope" :value="scope.row.questionScope"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="问题答案" align="center" prop="questionAnswer" />
|
||||
<el-table-column label="是否启用" align="center" prop="isDel" width="88">
|
||||
<template #default="scope">
|
||||
|
@ -163,11 +206,14 @@
|
|||
<!-- 添加或修改基础题库对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body>
|
||||
<el-form ref="busExamQuestionRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="所属公司" v-if="form.comId">
|
||||
<el-tag effect="plain">{{ form.comName }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" v-if="form.projectId">
|
||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种类型" prop="craftType">
|
||||
<el-select v-model="form.craftType" placeholder="请选择工种类型" style="width:100%">
|
||||
<el-select v-model="form.craftType" placeholder="请选择工种类型" style="width:100%" @change="changeCraftType">
|
||||
<el-option
|
||||
v-for="dict in pro_craft_type"
|
||||
:key="dict.value"
|
||||
|
@ -176,10 +222,11 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种岗位" prop="craftPost">
|
||||
<el-form-item label="工种岗位" prop="craftPost" v-if="form.craftType">
|
||||
<el-select v-model="form.craftPost" multiple placeholder="请选择工种岗位" style="width:100%">
|
||||
<el-option
|
||||
v-for="dict in pro_craft_post"
|
||||
v-show="dict.elTagClass == form.craftType"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
@ -196,6 +243,11 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题范围" prop="questionScope">
|
||||
<el-radio-group v-model="form.questionScope">
|
||||
<el-radio v-for="dict in edu_question_scope" :label="dict.value" border>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题描述" prop="questionDesc">
|
||||
<el-input v-model="form.questionDesc" placeholder="请输入问题描述" type="textarea" rows="2" maxlength="64" show-word-limit/>
|
||||
</el-form-item>
|
||||
|
@ -249,7 +301,7 @@ import { listBusExamQuestion, getBusExamQuestion, delBusExamQuestion, addBusExam
|
|||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { pro_craft_type, edu_question_type, sys_is_del, pro_craft_post, edu_question_diff } = proxy.useDict('pro_craft_type', 'edu_question_type', 'sys_is_del', 'pro_craft_post', 'edu_question_diff');
|
||||
const { pro_craft_type, edu_question_type, sys_is_del, pro_craft_post, edu_question_diff, edu_question_scope } = proxy.useDict('pro_craft_type', 'edu_question_type', 'sys_is_del', 'pro_craft_post', 'edu_question_diff', 'edu_question_scope');
|
||||
|
||||
const userStore = useUserStore()
|
||||
const busExamQuestionList = ref([]);
|
||||
|
@ -263,6 +315,7 @@ const single = ref(true);
|
|||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const FirRoles = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
|
@ -274,11 +327,13 @@ const data = reactive({
|
|||
craftPost: null,
|
||||
questionType: null,
|
||||
questionDesc: null,
|
||||
questionScope: null,
|
||||
},
|
||||
rules: {
|
||||
craftType: [{ required: true, message: "工种类型不能为空", trigger: "change" }],
|
||||
craftPost: [{ required: true, message: "工种岗位不能为空", trigger: "change" }],
|
||||
questionType: [{ required: true, message: "问题类型不能为空", trigger: "change" }],
|
||||
questionScope: [{ required: true, message: "问题范围不能为空", trigger: "change" }],
|
||||
questionDesc: [{ required: true, message: "问题描述不能为空", trigger: "blur" }]
|
||||
}
|
||||
});
|
||||
|
@ -288,6 +343,9 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
/** 查询基础题库列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
if(!queryParams.value.craftType && queryParams.value.craftPost){
|
||||
queryParams.value.craftPost = null;
|
||||
}
|
||||
listBusExamQuestion(queryParams.value).then(response => {
|
||||
response.rows.forEach(item => {
|
||||
item.disabledState = initRowDisabled(item);
|
||||
|
@ -315,6 +373,7 @@ function reset() {
|
|||
questionDiff: null,
|
||||
questionType: null,
|
||||
questionDesc: null,
|
||||
questionScope: "1",
|
||||
questionAnswer: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
|
@ -348,15 +407,37 @@ function handleSelectionChange(selection) {
|
|||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加问题及答案";
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAddCom() {
|
||||
if(!userStore.currentProId){
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
}
|
||||
reset();
|
||||
form.value.comId = userStore.currentComId;
|
||||
form.value.comName = userStore.currentComName;
|
||||
open.value = true;
|
||||
title.value = "添加问题及答案";
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAddProject() {
|
||||
if(!userStore.currentProId){
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
}
|
||||
reset();
|
||||
form.value.comId = userStore.currentComId;
|
||||
form.value.comName = userStore.currentComName;
|
||||
form.value.projectId = userStore.currentProId;
|
||||
form.value.projectName = userStore.currentProName;
|
||||
open.value = true;
|
||||
title.value = "添加基础题库";
|
||||
title.value = "添加问题及答案";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
|
@ -368,7 +449,7 @@ function handleUpdate(row) {
|
|||
form.value = response.data;
|
||||
busExamQuestionResultList.value = response.data.busExamQuestionResultList;
|
||||
open.value = true;
|
||||
title.value = "修改基础题库";
|
||||
title.value = "修改问题及答案";
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -491,6 +572,11 @@ function handleExport() {
|
|||
}, `busExamQuestion_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
/** 岗位类型改变 */
|
||||
function changeCraftType() {
|
||||
form.value.craftPost = null;
|
||||
}
|
||||
|
||||
/** 初始化行标识 */
|
||||
function initRowDisabled(row) {
|
||||
let roles = userStore.roles;
|
||||
|
@ -505,6 +591,19 @@ function initRowDisabled(row) {
|
|||
}
|
||||
}
|
||||
|
||||
/** 初始化页面 */
|
||||
function initPage() {
|
||||
let roles = userStore.roles;
|
||||
if(roles.includes("admin")){
|
||||
FirRoles.value = "admin";
|
||||
}else if(roles.includes("gsAdmin")){
|
||||
FirRoles.value = "gsAdmin";
|
||||
}else{
|
||||
FirRoles.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
initPage();
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
|
|
|
@ -1,26 +1,10 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="部门主键" prop="deptId">
|
||||
<el-form-item label="项目名称" prop="projectName" v-if="!userStore.currentProId">
|
||||
<el-input
|
||||
v-model="queryParams.deptId"
|
||||
placeholder="请输入部门主键"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目主键" prop="projectId">
|
||||
<el-input
|
||||
v-model="queryParams.projectId"
|
||||
placeholder="请输入项目主键"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户主键" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入用户主键"
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
|
@ -33,6 +17,14 @@
|
|||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户账号" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户账号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种类型" prop="craftType">
|
||||
<el-select v-model="queryParams.craftType" placeholder="请选择工种类型" clearable>
|
||||
<el-option
|
||||
|
@ -43,50 +35,19 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种岗位" prop="craftPost">
|
||||
<el-form-item label="工种岗位" prop="craftPost" v-if="queryParams.craftType">
|
||||
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
|
||||
<el-option
|
||||
v-for="dict in pro_craft_post"
|
||||
v-show="dict.elTagClass == queryParams.craftType"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单选题数量" prop="singleNum">
|
||||
<el-input
|
||||
v-model="queryParams.singleNum"
|
||||
placeholder="请输入单选题数量"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="多选题数量" prop="multipleNum">
|
||||
<el-input
|
||||
v-model="queryParams.multipleNum"
|
||||
placeholder="请输入多选题数量"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="判断题数量" prop="estimateNum">
|
||||
<el-input
|
||||
v-model="queryParams.estimateNum"
|
||||
placeholder="请输入判断题数量"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户分数" prop="userMark">
|
||||
<el-input
|
||||
v-model="queryParams.userMark"
|
||||
placeholder="请输入用户分数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结果状态" prop="resStatus">
|
||||
<el-select v-model="queryParams.resStatus" placeholder="请选择结果状态" clearable>
|
||||
<el-form-item label="考试结果" prop="resStatus">
|
||||
<el-select v-model="queryParams.resStatus" placeholder="请选择考试结果" clearable>
|
||||
<el-option
|
||||
v-for="dict in edu_res_status"
|
||||
:key="dict.value"
|
||||
|
@ -95,24 +56,6 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="答题耗时" prop="useTimes">
|
||||
<el-input
|
||||
v-model="queryParams.useTimes"
|
||||
placeholder="请输入答题耗时"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标识" prop="isDel">
|
||||
<el-select v-model="queryParams.isDel" placeholder="请选择删除标识" clearable>
|
||||
<el-option
|
||||
v-for="dict in sys_is_del"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
|
@ -120,7 +63,7 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
|
@ -128,7 +71,7 @@
|
|||
@click="handleAdd"
|
||||
v-hasPermi="['manage:busExamUser:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
|
@ -162,11 +105,9 @@
|
|||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="busExamUserList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="部门主键" align="center" prop="deptId" />
|
||||
<el-table-column label="项目主键" align="center" prop="projectId" />
|
||||
<el-table-column label="用户主键" align="center" prop="userId" />
|
||||
<el-table-column label="所属公司" align="center" prop="comName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="用户账号" align="center" prop="userName" />
|
||||
<el-table-column label="试卷名称" align="center" prop="examTitle" />
|
||||
<el-table-column label="试卷类型" align="center" prop="examType" />
|
||||
<el-table-column label="工种类型" align="center" prop="craftType">
|
||||
|
@ -179,22 +120,18 @@
|
|||
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单选题数量" align="center" prop="singleNum" />
|
||||
<el-table-column label="多选题数量" align="center" prop="multipleNum" />
|
||||
<el-table-column label="判断题数量" align="center" prop="estimateNum" />
|
||||
<el-table-column label="用户分数" align="center" prop="userMark" />
|
||||
<el-table-column label="答题时间" align="center" prop="createTime" width="150">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结果状态" align="center" prop="resStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="edu_res_status" :value="scope.row.resStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="答题耗时" align="center" prop="useTimes" />
|
||||
<el-table-column label="删除标识" align="center" prop="isDel">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_is_del" :value="scope.row.isDel"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamUser:edit']">修改</el-button>
|
||||
|
@ -296,10 +233,12 @@
|
|||
|
||||
<script setup name="BusExamUser">
|
||||
import { listBusExamUser, getBusExamUser, delBusExamUser, addBusExamUser, updateBusExamUser } from "@/api/manage/busExamUser";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { edu_res_status, pro_craft_type, sys_is_del, pro_craft_post } = proxy.useDict('edu_res_status', 'pro_craft_type', 'sys_is_del', 'pro_craft_post');
|
||||
|
||||
const userStore = useUserStore()
|
||||
const busExamUserList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
|
@ -315,20 +254,13 @@ const data = reactive({
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deptId: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
userId: null,
|
||||
userName: null,
|
||||
examTitle: null,
|
||||
examType: null,
|
||||
craftType: null,
|
||||
craftPost: null,
|
||||
singleNum: null,
|
||||
multipleNum: null,
|
||||
estimateNum: null,
|
||||
userMark: null,
|
||||
resStatus: null,
|
||||
useTimes: null,
|
||||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
|
|
|
@ -170,6 +170,7 @@
|
|||
<el-option v-for="dict in sys_is_del" :key="dict.value" :label="dict.label"
|
||||
:value="parseInt(dict.value)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频文件" prop="trainFilePath" :class="form.trainFilePath?'has-video':'no-video'" class="fitem-video">
|
||||
<file-upload v-model="form.trainFilePath" :limit="1" :fileType="['mp4']" :fileSize="100"/>
|
||||
</el-form-item>
|
||||
|
@ -257,7 +258,7 @@ function cancel() {
|
|||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
deptId: userStore.compInfo.deptId||'',
|
||||
deptId: null,
|
||||
projectId: null,
|
||||
trainTitle: null,
|
||||
trainType: null,
|
||||
|
@ -268,7 +269,7 @@ function reset() {
|
|||
trainFilePath: null,
|
||||
trainFileImage: null,
|
||||
trainFileTimes: null,
|
||||
compName:userStore.compInfo.deptName||'',
|
||||
compName:null,
|
||||
ord:1,
|
||||
remark: null
|
||||
};
|
||||
|
@ -287,6 +288,7 @@ function getQueryCraftPost(){
|
|||
|
||||
function getCraftPost(){
|
||||
let datas=pro_craft_post._object.pro_craft_post;
|
||||
console.log("dsds",datas)
|
||||
if(form.value.craftType){
|
||||
data.craftPostList= datas.filter(d=>d.elTagClass==form.value.craftType);
|
||||
}else{
|
||||
|
|
Loading…
Reference in New Issue