Commit ed27c9a0 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 9b0abed6 16064447
package com.zehong.web.controller.contractTrain; package com.zehong.web.controller.contractTrain;
import java.util.List; import java.util.List;
import com.zehong.system.domain.vo.BatchTopicVo;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -79,6 +81,16 @@ public class TContractorTrainCourseTopicController extends BaseController ...@@ -79,6 +81,16 @@ public class TContractorTrainCourseTopicController extends BaseController
return toAjax(tContractorTrainCourseTopicService.insertTContractorTrainCourseTopic(tContractorTrainCourseTopic)); return toAjax(tContractorTrainCourseTopicService.insertTContractorTrainCourseTopic(tContractorTrainCourseTopic));
} }
/**
* 题库批量导入试题
* @param batchTopicVo 试题实体
* @return AjaxResult
*/
@PostMapping("/bachAddTopic")
public AjaxResult bachAddTopic(@RequestBody BatchTopicVo batchTopicVo){
return toAjax(tContractorTrainCourseTopicService.bachAddTopic(batchTopicVo));
}
/** /**
* 修改承包商及访客培训题库 * 修改承包商及访客培训题库
*/ */
......
...@@ -4,6 +4,7 @@ import java.util.Date; ...@@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -81,6 +82,10 @@ public class TContractorTrainResultController extends BaseController ...@@ -81,6 +82,10 @@ public class TContractorTrainResultController extends BaseController
@GetMapping("/examination") @GetMapping("/examination")
public AjaxResult examination( TContractorTrainResult tContractorTrainResult){ public AjaxResult examination( TContractorTrainResult tContractorTrainResult){
String n="["+tContractorTrainResult.getAnswers()+']';
//字符串转换成二维数组
Integer[][] integers = JSON.parseObject(n, Integer[][].class);
tContractorTrainResult.setIntegers(integers);
//结束时间 //结束时间
tContractorTrainResult.setTestEndTime(new Date()); tContractorTrainResult.setTestEndTime(new Date());
Map<String, Object> examination = tContractorTrainResultService.examination(tContractorTrainResult); Map<String, Object> examination = tContractorTrainResultService.examination(tContractorTrainResult);
......
...@@ -41,7 +41,6 @@ public class TTrainCourseBankController extends BaseController ...@@ -41,7 +41,6 @@ public class TTrainCourseBankController extends BaseController
public TableDataInfo list(TTrainCourseBank tTrainCourseBank) public TableDataInfo list(TTrainCourseBank tTrainCourseBank)
{ {
startPage(); startPage();
System.out.println(tTrainCourseBank);
List<TTrainCourseBank> list = tTrainCourseBankService.selectTTrainCourseBankList(tTrainCourseBank); List<TTrainCourseBank> list = tTrainCourseBankService.selectTTrainCourseBankList(tTrainCourseBank);
return getDataTable(list); return getDataTable(list);
} }
......
...@@ -7,7 +7,7 @@ import com.zehong.common.core.domain.BaseEntity; ...@@ -7,7 +7,7 @@ import com.zehong.common.core.domain.BaseEntity;
/** /**
* 承包商及访客培训对象 t_contractor_train_course * 承包商及访客培训对象 t_contractor_train_course
* *
* @author zehong * @author zehong
* @date 2022-12-27 * @date 2022-12-27
*/ */
...@@ -50,102 +50,140 @@ public class TContractorTrainCourse extends BaseEntity ...@@ -50,102 +50,140 @@ public class TContractorTrainCourse extends BaseEntity
@Excel(name = "是否删除(0正常,1删除)") @Excel(name = "是否删除(0正常,1删除)")
private String isDel; private String isDel;
public void setContractorCourseId(Long contractorCourseId) /** 多选题分数*/
private Integer multipleChoiceScore;
/**单选题分数*/
private Integer singleChoiceScore;
/**判断题分数*/
private Integer judgmentScore;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Integer getMultipleChoiceScore() {
return multipleChoiceScore;
}
public void setMultipleChoiceScore(Integer multipleChoiceScore) {
this.multipleChoiceScore = multipleChoiceScore;
}
public Integer getSingleChoiceScore() {
return singleChoiceScore;
}
public void setSingleChoiceScore(Integer singleChoiceScore) {
this.singleChoiceScore = singleChoiceScore;
}
public Integer getJudgmentScore() {
return judgmentScore;
}
public void setJudgmentScore(Integer judgmentScore) {
this.judgmentScore = judgmentScore;
}
public void setContractorCourseId(Long contractorCourseId)
{ {
this.contractorCourseId = contractorCourseId; this.contractorCourseId = contractorCourseId;
} }
public Long getContractorCourseId() public Long getContractorCourseId()
{ {
return contractorCourseId; return contractorCourseId;
} }
public void setCourseName(String courseName) public void setCourseName(String courseName)
{ {
this.courseName = courseName; this.courseName = courseName;
} }
public String getCourseName() public String getCourseName()
{ {
return courseName; return courseName;
} }
public void setCourseConent(String courseConent) public void setCourseConent(String courseConent)
{ {
this.courseConent = courseConent; this.courseConent = courseConent;
} }
public String getCourseConent() public String getCourseConent()
{ {
return courseConent; return courseConent;
} }
public void setEnclosure(String enclosure) public void setEnclosure(String enclosure)
{ {
this.enclosure = enclosure; this.enclosure = enclosure;
} }
public String getEnclosure() public String getEnclosure()
{ {
return enclosure; return enclosure;
} }
public void setVideo(String video) public void setVideo(String video)
{ {
this.video = video; this.video = video;
} }
public String getVideo() public String getVideo()
{ {
return video; return video;
} }
public void setQualifiedNum(Integer qualifiedNum) public void setQualifiedNum(Integer qualifiedNum)
{ {
this.qualifiedNum = qualifiedNum; this.qualifiedNum = qualifiedNum;
} }
public Integer getQualifiedNum() public Integer getQualifiedNum()
{ {
return qualifiedNum; return qualifiedNum;
} }
public void setTopicNum(Integer topicNum) public void setTopicNum(Integer topicNum)
{ {
this.topicNum = topicNum; this.topicNum = topicNum;
} }
public Integer getTopicNum() public Integer getTopicNum()
{ {
return topicNum; return topicNum;
} }
public void setCreateUser(String createUser) public void setCreateUser(String createUser)
{ {
this.createUser = createUser; this.createUser = createUser;
} }
public String getCreateUser() public String getCreateUser()
{ {
return createUser; return createUser;
} }
public void setIsDel(String isDel) public void setIsDel(String isDel)
{ {
this.isDel = isDel; this.isDel = isDel;
} }
public String getIsDel() public String getIsDel()
{ {
return isDel; return isDel;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "TContractorTrainCourse{" +
.append("contractorCourseId", getContractorCourseId()) "contractorCourseId=" + contractorCourseId +
.append("courseName", getCourseName()) ", courseName='" + courseName + '\'' +
.append("courseConent", getCourseConent()) ", courseConent='" + courseConent + '\'' +
.append("enclosure", getEnclosure()) ", enclosure='" + enclosure + '\'' +
.append("video", getVideo()) ", video='" + video + '\'' +
.append("qualifiedNum", getQualifiedNum()) ", qualifiedNum=" + qualifiedNum +
.append("topicNum", getTopicNum()) ", topicNum=" + topicNum +
.append("createTime", getCreateTime()) ", createUser='" + createUser + '\'' +
.append("createUser", getCreateUser()) ", isDel='" + isDel + '\'' +
.append("isDel", getIsDel()) ", multipleChoiceScore=" + multipleChoiceScore +
.append("remark", getRemark()) ", singleChoiceScore=" + singleChoiceScore +
.toString(); ", judgmentScore=" + judgmentScore +
'}';
} }
} }
...@@ -7,7 +7,7 @@ import com.zehong.common.core.domain.BaseEntity; ...@@ -7,7 +7,7 @@ import com.zehong.common.core.domain.BaseEntity;
/** /**
* 承包商及访客培训题库对象 t_contractor_train_course_topic * 承包商及访客培训题库对象 t_contractor_train_course_topic
* *
* @author zehong * @author zehong
* @date 2022-12-27 * @date 2022-12-27
*/ */
...@@ -32,78 +32,92 @@ public class TContractorTrainCourseTopic extends BaseEntity ...@@ -32,78 +32,92 @@ public class TContractorTrainCourseTopic extends BaseEntity
/** 答案 */ /** 答案 */
@Excel(name = "答案") @Excel(name = "答案")
private Integer answer; private String answer;
/** 是否删除(0正常,1删除) */ /** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)") @Excel(name = "是否删除(0正常,1删除)")
private String isDel; private String isDel;
public void setTopicId(Long topicId) /**题目类型*/
private Integer topicType;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public Integer getTopicType() {
return topicType;
}
public void setTopicType(Integer topicType) {
this.topicType = topicType;
}
public void setTopicId(Long topicId)
{ {
this.topicId = topicId; this.topicId = topicId;
} }
public Long getTopicId() public Long getTopicId()
{ {
return topicId; return topicId;
} }
public void setContractorCourseId(Long contractorCourseId) public void setContractorCourseId(Long contractorCourseId)
{ {
this.contractorCourseId = contractorCourseId; this.contractorCourseId = contractorCourseId;
} }
public Long getContractorCourseId() public Long getContractorCourseId()
{ {
return contractorCourseId; return contractorCourseId;
} }
public void setTopicTitle(String topicTitle) public void setTopicTitle(String topicTitle)
{ {
this.topicTitle = topicTitle; this.topicTitle = topicTitle;
} }
public String getTopicTitle() public String getTopicTitle()
{ {
return topicTitle; return topicTitle;
} }
public void setTopicOption(String topicOption) public void setTopicOption(String topicOption)
{ {
this.topicOption = topicOption; this.topicOption = topicOption;
} }
public String getTopicOption() public String getTopicOption()
{ {
return topicOption; return topicOption;
} }
public void setAnswer(Integer answer)
{
this.answer = answer;
}
public Integer getAnswer() public String getAnswer() {
{
return answer; return answer;
} }
public void setIsDel(String isDel)
public void setIsDel(String isDel)
{ {
this.isDel = isDel; this.isDel = isDel;
} }
public String getIsDel() public String getIsDel()
{ {
return isDel; return isDel;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "TContractorTrainCourseTopic{" +
.append("topicId", getTopicId()) "topicId=" + topicId +
.append("contractorCourseId", getContractorCourseId()) ", contractorCourseId=" + contractorCourseId +
.append("topicTitle", getTopicTitle()) ", topicTitle='" + topicTitle + '\'' +
.append("topicOption", getTopicOption()) ", topicOption='" + topicOption + '\'' +
.append("answer", getAnswer()) ", answer='" + answer + '\'' +
.append("createTime", getCreateTime()) ", isDel='" + isDel + '\'' +
.append("isDel", getIsDel()) ", topicType=" + topicType +
.append("remark", getRemark()) '}';
.toString();
} }
} }
...@@ -55,8 +55,20 @@ public class TContractorTrainResult extends BaseEntity ...@@ -55,8 +55,20 @@ public class TContractorTrainResult extends BaseEntity
/** 是否删除(0正常,1删除) */ /** 是否删除(0正常,1删除) */
private String isDel; private String isDel;
/** 答案*/
private String answers; private String answers;
/** 转换成二维数组答案*/
private Integer[][] integers;
public Integer[][] getIntegers() {
return integers;
}
public void setIntegers(Integer[][] integers) {
this.integers = integers;
}
public static long getSerialVersionUID() { public static long getSerialVersionUID() {
return serialVersionUID; return serialVersionUID;
} }
......
...@@ -7,7 +7,7 @@ import com.zehong.common.core.domain.BaseEntity; ...@@ -7,7 +7,7 @@ import com.zehong.common.core.domain.BaseEntity;
/** /**
* 承包商及访客培训考试结果详情对象 t_contractor_train_result_detail * 承包商及访客培训考试结果详情对象 t_contractor_train_result_detail
* *
* @author wu * @author wu
* @date 2022-12-30 * @date 2022-12-30
*/ */
...@@ -32,11 +32,11 @@ public class TContractorTrainResultDetail extends BaseEntity ...@@ -32,11 +32,11 @@ public class TContractorTrainResultDetail extends BaseEntity
/** 答案 */ /** 答案 */
@Excel(name = "答案") @Excel(name = "答案")
private Integer answer; private String answer;
/** 所选答案 */ /** 所选答案 */
@Excel(name = "所选答案") @Excel(name = "所选答案")
private Integer answerChoice; private String answerChoice;
/** 答题结果:0 对,1 错 */ /** 答题结果:0 对,1 错 */
@Excel(name = "答题结果:0 对,1 错") @Excel(name = "答题结果:0 对,1 错")
...@@ -46,75 +46,78 @@ public class TContractorTrainResultDetail extends BaseEntity ...@@ -46,75 +46,78 @@ public class TContractorTrainResultDetail extends BaseEntity
@Excel(name = "是否删除(0正常,1删除)") @Excel(name = "是否删除(0正常,1删除)")
private String isDel; private String isDel;
public void setDetailId(Long detailId) public void setDetailId(Long detailId)
{ {
this.detailId = detailId; this.detailId = detailId;
} }
public Long getDetailId() public Long getDetailId()
{ {
return detailId; return detailId;
} }
public void setResultId(Long resultId) public void setResultId(Long resultId)
{ {
this.resultId = resultId; this.resultId = resultId;
} }
public Long getResultId() public Long getResultId()
{ {
return resultId; return resultId;
} }
public void setTopicTitle(String topicTitle) public void setTopicTitle(String topicTitle)
{ {
this.topicTitle = topicTitle; this.topicTitle = topicTitle;
} }
public String getTopicTitle() public String getTopicTitle()
{ {
return topicTitle; return topicTitle;
} }
public void setTopicOption(String topicOption) public void setTopicOption(String topicOption)
{ {
this.topicOption = topicOption; this.topicOption = topicOption;
} }
public String getTopicOption() public String getTopicOption()
{ {
return topicOption; return topicOption;
} }
public void setAnswer(Integer answer)
{
this.answer = answer;
}
public Integer getAnswer() public String getAnswer() {
{
return answer; return answer;
} }
public void setAnswerChoice(Integer answerChoice)
{ public void setAnswer(String answer) {
this.answerChoice = answerChoice; this.answer = answer;
} }
public Integer getAnswerChoice() public static long getSerialVersionUID() {
{ return serialVersionUID;
}
public String getAnswerChoice() {
return answerChoice; return answerChoice;
} }
public void setResult(String result)
public void setAnswerChoice(String answerChoice) {
this.answerChoice = answerChoice;
}
public void setResult(String result)
{ {
this.result = result; this.result = result;
} }
public String getResult() public String getResult()
{ {
return result; return result;
} }
public void setIsDel(String isDel) public void setIsDel(String isDel)
{ {
this.isDel = isDel; this.isDel = isDel;
} }
public String getIsDel() public String getIsDel()
{ {
return isDel; return isDel;
} }
......
package com.zehong.system.domain; package com.zehong.system.domain;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
...@@ -17,6 +18,8 @@ public class TStaff extends BaseEntity ...@@ -17,6 +18,8 @@ public class TStaff extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**系统用户id*/
private Integer userId;
/** 员工id */ /** 员工id */
private Integer staffId; private Integer staffId;
...@@ -49,6 +52,9 @@ public class TStaff extends BaseEntity ...@@ -49,6 +52,9 @@ public class TStaff extends BaseEntity
/** 岗位id */ /** 岗位id */
@Excel(name = "岗位id") @Excel(name = "岗位id")
private Integer postId; private Integer postId;
/** 角色组 */
private Long[] roleIds;
/** 角色id */ /** 角色id */
@Excel(name = "角色id") @Excel(name = "角色id")
...@@ -83,6 +89,22 @@ public class TStaff extends BaseEntity ...@@ -83,6 +89,22 @@ public class TStaff extends BaseEntity
@Excel(name = "删除标志", readConverterExp = "0=正常,1删除") @Excel(name = "删除标志", readConverterExp = "0=正常,1删除")
private String isDel; private String isDel;
public Long[] getRoleIds() {
return roleIds;
}
public void setRoleIds(Long[] roleIds) {
this.roleIds = roleIds;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public static long getSerialVersionUID() { public static long getSerialVersionUID() {
return serialVersionUID; return serialVersionUID;
} }
...@@ -246,7 +268,8 @@ public class TStaff extends BaseEntity ...@@ -246,7 +268,8 @@ public class TStaff extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return "TStaff{" + return "TStaff{" +
"staffId=" + staffId + "userId=" + userId +
", staffId=" + staffId +
", userName='" + userName + '\'' + ", userName='" + userName + '\'' +
", password='" + password + '\'' + ", password='" + password + '\'' +
", staffName='" + staffName + '\'' + ", staffName='" + staffName + '\'' +
...@@ -255,6 +278,7 @@ public class TStaff extends BaseEntity ...@@ -255,6 +278,7 @@ public class TStaff extends BaseEntity
", deptId=" + deptId + ", deptId=" + deptId +
", phonenumber='" + phonenumber + '\'' + ", phonenumber='" + phonenumber + '\'' +
", postId=" + postId + ", postId=" + postId +
", roleIds=" + Arrays.toString(roleIds) +
", roleId=" + roleId + ", roleId=" + roleId +
", positionalTitles='" + positionalTitles + '\'' + ", positionalTitles='" + positionalTitles + '\'' +
", profession='" + profession + '\'' + ", profession='" + profession + '\'' +
......
...@@ -12,7 +12,7 @@ import java.util.Date; ...@@ -12,7 +12,7 @@ import java.util.Date;
/** /**
* 员工信息管理对象 t_staff * 员工信息管理对象 t_staff
* *
* @author zehong * @author zehong
* @date 2022-06-17 * @date 2022-06-17
*/ */
......
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TContractorTrainCourse;
import com.zehong.system.domain.TContractorTrainCourseTopic; import com.zehong.system.domain.TContractorTrainCourseTopic;
import com.zehong.system.domain.TTrainCourse;
import com.zehong.system.domain.TTrainCourseTopic;
/** /**
* 承包商及访客培训题库Mapper接口 * 承包商及访客培训题库Mapper接口
* *
* @author zehong * @author zehong
* @date 2022-12-27 * @date 2022-12-27
*/ */
public interface TContractorTrainCourseTopicMapper public interface TContractorTrainCourseTopicMapper
{ {
/** /**
* 查询承包商及访客培训题库 * 查询承包商及访客培训题库
* *
* @param topicId 承包商及访客培训题库ID * @param topicId 承包商及访客培训题库ID
* @return 承包商及访客培训题库 * @return 承包商及访客培训题库
*/ */
...@@ -21,7 +25,7 @@ public interface TContractorTrainCourseTopicMapper ...@@ -21,7 +25,7 @@ public interface TContractorTrainCourseTopicMapper
/** /**
* 查询承包商及访客培训题库列表 * 查询承包商及访客培训题库列表
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 承包商及访客培训题库集合 * @return 承包商及访客培训题库集合
*/ */
...@@ -29,7 +33,7 @@ public interface TContractorTrainCourseTopicMapper ...@@ -29,7 +33,7 @@ public interface TContractorTrainCourseTopicMapper
/** /**
* 新增承包商及访客培训题库 * 新增承包商及访客培训题库
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 结果 * @return 结果
*/ */
...@@ -37,7 +41,7 @@ public interface TContractorTrainCourseTopicMapper ...@@ -37,7 +41,7 @@ public interface TContractorTrainCourseTopicMapper
/** /**
* 修改承包商及访客培训题库 * 修改承包商及访客培训题库
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 结果 * @return 结果
*/ */
...@@ -45,7 +49,7 @@ public interface TContractorTrainCourseTopicMapper ...@@ -45,7 +49,7 @@ public interface TContractorTrainCourseTopicMapper
/** /**
* 删除承包商及访客培训题库 * 删除承包商及访客培训题库
* *
* @param topicId 承包商及访客培训题库ID * @param topicId 承包商及访客培训题库ID
* @return 结果 * @return 结果
*/ */
...@@ -53,9 +57,29 @@ public interface TContractorTrainCourseTopicMapper ...@@ -53,9 +57,29 @@ public interface TContractorTrainCourseTopicMapper
/** /**
* 批量删除承包商及访客培训题库 * 批量删除承包商及访客培训题库
* *
* @param topicIds 需要删除的数据ID * @param topicIds 需要删除的数据ID
* @return 结果 * @return 结果
*/ */
public int deleteTContractorTrainCourseTopicByIds(Long[] topicIds); public int deleteTContractorTrainCourseTopicByIds(Long[] topicIds);
/**
* 批量新增试题
* @param topics
*/
void batchInsertTTrainCourseTopic(List<TContractorTrainCourseTopic> topics);
/**
* 更新试题数量
* @param courseId
* @return
*/
TContractorTrainCourse selectTTrainCourseById(Long courseId);
/**
* 更新试题数量
* @param course
* @return
*/
int updateTTrainCourse(TContractorTrainCourse course);
} }
...@@ -2,18 +2,19 @@ package com.zehong.system.service; ...@@ -2,18 +2,19 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TContractorTrainCourseTopic; import com.zehong.system.domain.TContractorTrainCourseTopic;
import com.zehong.system.domain.vo.BatchTopicVo;
/** /**
* 承包商及访客培训题库Service接口 * 承包商及访客培训题库Service接口
* *
* @author zehong * @author zehong
* @date 2022-12-27 * @date 2022-12-27
*/ */
public interface ITContractorTrainCourseTopicService public interface ITContractorTrainCourseTopicService
{ {
/** /**
* 查询承包商及访客培训题库 * 查询承包商及访客培训题库
* *
* @param topicId 承包商及访客培训题库ID * @param topicId 承包商及访客培训题库ID
* @return 承包商及访客培训题库 * @return 承包商及访客培训题库
*/ */
...@@ -21,7 +22,7 @@ public interface ITContractorTrainCourseTopicService ...@@ -21,7 +22,7 @@ public interface ITContractorTrainCourseTopicService
/** /**
* 查询承包商及访客培训题库列表 * 查询承包商及访客培训题库列表
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 承包商及访客培训题库集合 * @return 承包商及访客培训题库集合
*/ */
...@@ -29,7 +30,7 @@ public interface ITContractorTrainCourseTopicService ...@@ -29,7 +30,7 @@ public interface ITContractorTrainCourseTopicService
/** /**
* 新增承包商及访客培训题库 * 新增承包商及访客培训题库
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 结果 * @return 结果
*/ */
...@@ -37,7 +38,7 @@ public interface ITContractorTrainCourseTopicService ...@@ -37,7 +38,7 @@ public interface ITContractorTrainCourseTopicService
/** /**
* 修改承包商及访客培训题库 * 修改承包商及访客培训题库
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 结果 * @return 结果
*/ */
...@@ -45,7 +46,7 @@ public interface ITContractorTrainCourseTopicService ...@@ -45,7 +46,7 @@ public interface ITContractorTrainCourseTopicService
/** /**
* 批量删除承包商及访客培训题库 * 批量删除承包商及访客培训题库
* *
* @param topicIds 需要删除的承包商及访客培训题库ID * @param topicIds 需要删除的承包商及访客培训题库ID
* @return 结果 * @return 结果
*/ */
...@@ -53,9 +54,16 @@ public interface ITContractorTrainCourseTopicService ...@@ -53,9 +54,16 @@ public interface ITContractorTrainCourseTopicService
/** /**
* 删除承包商及访客培训题库信息 * 删除承包商及访客培训题库信息
* *
* @param topicId 承包商及访客培训题库ID * @param topicId 承包商及访客培训题库ID
* @return 结果 * @return 结果
*/ */
public int deleteTContractorTrainCourseTopicById(Long topicId); public int deleteTContractorTrainCourseTopicById(Long topicId);
/**
* 题库批量导入试题
* @param batchTopicVo
* @return
*/
int bachAddTopic(BatchTopicVo batchTopicVo);
} }
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TContractorTrainCourse; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TContractorTrainCourseTopic; import com.zehong.system.domain.*;
import com.zehong.system.domain.vo.BatchTopicVo;
import com.zehong.system.mapper.TBankSubjectMapper;
import com.zehong.system.mapper.TContractorTrainCourseMapper; import com.zehong.system.mapper.TContractorTrainCourseMapper;
import com.zehong.system.mapper.TContractorTrainCourseTopicMapper; import com.zehong.system.mapper.TContractorTrainCourseTopicMapper;
import com.zehong.system.service.ITContractorTrainCourseTopicService; import com.zehong.system.service.ITContractorTrainCourseTopicService;
...@@ -11,25 +14,30 @@ import org.springframework.stereotype.Service; ...@@ -11,25 +14,30 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* 承包商及访客培训题库Service业务层处理 * 承包商及访客培训题库Service业务层处理
* *
* @author zehong * @author zehong
* @date 2022-12-27 * @date 2022-12-27
*/ */
@Service @Service
public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrainCourseTopicService public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrainCourseTopicService
{ {
@Autowired @Autowired
private TContractorTrainCourseTopicMapper tContractorTrainCourseTopicMapper; private TContractorTrainCourseTopicMapper tContractorTrainCourseTopicMapper;
@Resource @Resource
private TContractorTrainCourseMapper tContractorTrainCourseMapper; private TContractorTrainCourseMapper tContractorTrainCourseMapper;
@Resource
private TBankSubjectMapper tBankSubjectMapper;
/** /**
* 查询承包商及访客培训题库 * 查询承包商及访客培训题库
* *
* @param topicId 承包商及访客培训题库ID * @param topicId 承包商及访客培训题库ID
* @return 承包商及访客培训题库 * @return 承包商及访客培训题库
*/ */
...@@ -41,7 +49,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain ...@@ -41,7 +49,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
/** /**
* 查询承包商及访客培训题库列表 * 查询承包商及访客培训题库列表
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 承包商及访客培训题库 * @return 承包商及访客培训题库
*/ */
...@@ -53,7 +61,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain ...@@ -53,7 +61,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
/** /**
* 新增承包商及访客培训题库 * 新增承包商及访客培训题库
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 结果 * @return 结果
*/ */
...@@ -72,7 +80,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain ...@@ -72,7 +80,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
/** /**
* 修改承包商及访客培训题库 * 修改承包商及访客培训题库
* *
* @param tContractorTrainCourseTopic 承包商及访客培训题库 * @param tContractorTrainCourseTopic 承包商及访客培训题库
* @return 结果 * @return 结果
*/ */
...@@ -84,7 +92,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain ...@@ -84,7 +92,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
/** /**
* 批量删除承包商及访客培训题库 * 批量删除承包商及访客培训题库
* *
* @param topicIds 需要删除的承包商及访客培训题库ID * @param topicIds 需要删除的承包商及访客培训题库ID
* @return 结果 * @return 结果
*/ */
...@@ -106,7 +114,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain ...@@ -106,7 +114,7 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
/** /**
* 删除承包商及访客培训题库信息 * 删除承包商及访客培训题库信息
* *
* @param topicId 承包商及访客培训题库ID * @param topicId 承包商及访客培训题库ID
* @return 结果 * @return 结果
*/ */
...@@ -115,4 +123,44 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain ...@@ -115,4 +123,44 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
{ {
return tContractorTrainCourseTopicMapper.deleteTContractorTrainCourseTopicById(topicId); return tContractorTrainCourseTopicMapper.deleteTContractorTrainCourseTopicById(topicId);
} }
/**
* 题库批量导入试题
* @param batchTopicVo
* @return
*/
@Override
public int bachAddTopic(BatchTopicVo batchTopicVo) {
if(CollectionUtil.isEmpty(batchTopicVo.getTopicInfos()) || StringUtils.isEmpty(String.valueOf(batchTopicVo.getCourseId()))){
return 0;
}
List<TContractorTrainCourseTopic> topics = new ArrayList<>();
int count = 0;
for(BatchTopicVo.TopicInfos topic : batchTopicVo.getTopicInfos()){
//获取题库试题
TBankSubject tBankSubject = new TBankSubject();
tBankSubject.setBankId(topic.getBankId());
List<TBankSubject> bankSubjects = tBankSubjectMapper.selectTBankSubjectList(tBankSubject);
//获取随机试题
Collections.shuffle(bankSubjects);
for(int i = 0;i<topic.getQuan();i++){
TContractorTrainCourseTopic courseTopic = new TContractorTrainCourseTopic();
courseTopic.setContractorCourseId(batchTopicVo.getCourseId());
courseTopic.setTopicTitle(bankSubjects.get(i).getTopicTitle());
courseTopic.setTopicOption(bankSubjects.get(i).getTopicOption());
courseTopic.setAnswer(String.valueOf(bankSubjects.get(i).getAnswer()));
courseTopic.setCreateTime(new Date());
courseTopic.setTopicType(bankSubjects.get(i).getTopicType());
topics.add(courseTopic);
}
count += topic.getQuan();
}
//批量新增试题
tContractorTrainCourseTopicMapper.batchInsertTTrainCourseTopic(topics);
//更新试题数量
TContractorTrainCourse course = tContractorTrainCourseTopicMapper.selectTTrainCourseById(batchTopicVo.getCourseId());
course.setTopicNum(course.getTopicNum() + count);
tContractorTrainCourseTopicMapper.updateTTrainCourse(course);
return 1;
}
} }
...@@ -5,6 +5,7 @@ import java.util.HashMap; ...@@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
import com.zehong.system.mapper.*; import com.zehong.system.mapper.*;
...@@ -112,21 +113,43 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul ...@@ -112,21 +113,43 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul
@Override @Override
public Map<String,Object> examination(TContractorTrainResult tContractorTrainResult) { public Map<String,Object> examination(TContractorTrainResult tContractorTrainResult) {
TContractorTrainCourseTopic tContractorTrainCourseTopic=new TContractorTrainCourseTopic(); TContractorTrainCourseTopic tContractorTrainCourseTopic=new TContractorTrainCourseTopic();
String answers = tContractorTrainResult.getAnswers(); TContractorTrainCourse tContractorTrainCourse=new TContractorTrainCourse();
//交卷答题
String[] split = answers.split(",");
//查询考试题和答案 //查询考试题和答案
List<TContractorTrainCourseTopic> tContractorTrainCourseTopics = tContractorTrainCourseTopicMapper.selectTContractorTrainCourseTopicList(tContractorTrainCourseTopic); List<TContractorTrainCourseTopic> tContractorTrainCourseTopics = tContractorTrainCourseTopicMapper.selectTContractorTrainCourseTopicList(tContractorTrainCourseTopic);
//正确答案数量 //查询需要正确几道题算通过
TContractorTrainCourse itContractorTrainCourse = tContractorTrainCourseMapper.getITContractorTrainCourse(tContractorTrainCourse);
//已获得分数
int num = 0; int num = 0;
for(Integer i=0;i<split.length;i++){ /**
if(Integer.parseInt(split[i])==tContractorTrainCourseTopics.get(i).getAnswer()){ * 大循环 共有多少答案 此循环最后只算出 得了多少分
num++; */
for (int i=0;i<tContractorTrainResult.getIntegers().length;i++){
/*题目答案*/
String answer = tContractorTrainCourseTopics.get(i).getAnswer();
//答案转换成数组
Integer[] integers = JSON.parseObject(answer, Integer[].class);
/**判断所选答案是否与正确答案长度相等*/
if (integers.length==tContractorTrainResult.getIntegers()[i].length){
boolean adopt=true;
for (int n=0;n<integers.length;n++){
if (integers[n]!=tContractorTrainResult.getIntegers()[i][n]){
adopt=false;
break;
}
}
if (adopt){
/** 1单选 2多选 3判断*/
if (tContractorTrainCourseTopics.get(i).getTopicType()==1){
num=num+itContractorTrainCourse.getSingleChoiceScore();
}else if (tContractorTrainCourseTopics.get(i).getTopicType()==2){
num=num+itContractorTrainCourse.getMultipleChoiceScore();
}else if (tContractorTrainCourseTopics.get(i).getTopicType()==3){
num=num+itContractorTrainCourse.getJudgmentScore();
}
}
} }
} }
TContractorTrainCourse tContractorTrainCourse=new TContractorTrainCourse();
//查询需要正确几道题算通过
TContractorTrainCourse itContractorTrainCourse = tContractorTrainCourseMapper.getITContractorTrainCourse(tContractorTrainCourse);
//判断答题是否合格 //判断答题是否合格
if(num>=itContractorTrainCourse.getQualifiedNum()){ if(num>=itContractorTrainCourse.getQualifiedNum()){
tContractorTrainResult.setIsQualified("0"); tContractorTrainResult.setIsQualified("0");
...@@ -139,7 +162,7 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul ...@@ -139,7 +162,7 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul
//承包商及访客培训考试结果 添加方法 //承包商及访客培训考试结果 添加方法
tContractorTrainResultMapper.insertTContractorTrainResult(tContractorTrainResult); tContractorTrainResultMapper.insertTContractorTrainResult(tContractorTrainResult);
/**添加承包商及访客培训考试结果详情*/ /**添加承包商及访客培训考试结果详情*/
for (int n=0;n<split.length;n++){ for (int n=0;n<tContractorTrainResult.getIntegers().length;n++){
TContractorTrainResultDetail tContractorTrainResultDetail=new TContractorTrainResultDetail(); TContractorTrainResultDetail tContractorTrainResultDetail=new TContractorTrainResultDetail();
//设置结果管理id //设置结果管理id
tContractorTrainResultDetail.setResult(String.valueOf(tContractorTrainResult.getResultId())); tContractorTrainResultDetail.setResult(String.valueOf(tContractorTrainResult.getResultId()));
...@@ -150,13 +173,13 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul ...@@ -150,13 +173,13 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul
//答案 //答案
tContractorTrainResultDetail.setAnswer(tContractorTrainCourseTopics.get(n).getAnswer()); tContractorTrainResultDetail.setAnswer(tContractorTrainCourseTopics.get(n).getAnswer());
//所选答案 //所选答案
tContractorTrainResultDetail.setAnswerChoice(Integer.valueOf(split[n])); tContractorTrainResultDetail.setAnswerChoice(tContractorTrainResult.getAnswers());
//答案结果 //答案结果
if (Integer.valueOf(split[n])==tContractorTrainCourseTopics.get(n).getAnswer()){ // if (Integer.valueOf(split[n])==tContractorTrainCourseTopics.get(n).getAnswer()){
tContractorTrainResultDetail.setResult("0"); // tContractorTrainResultDetail.setResult("0");
}else { // }else {
tContractorTrainResultDetail.setResult("1"); // tContractorTrainResultDetail.setResult("1");
} // }
tContractorTrainResultDetail.setCreateTime(new Date()); tContractorTrainResultDetail.setCreateTime(new Date());
tContractorTrainResultDetail.setResultId(tContractorTrainResult.getResultId()); tContractorTrainResultDetail.setResultId(tContractorTrainResult.getResultId());
tContractorTrainResultDetailMapper.insertTContractorTrainResultDetail(tContractorTrainResultDetail); tContractorTrainResultDetailMapper.insertTContractorTrainResultDetail(tContractorTrainResultDetail);
......
...@@ -161,12 +161,12 @@ public class TEntranceGuardPersonInfoServiceImpl implements ITEntranceGuardPerso ...@@ -161,12 +161,12 @@ public class TEntranceGuardPersonInfoServiceImpl implements ITEntranceGuardPerso
return; return;
} }
if("0".equals(tEntranceGuardPersonInfo.getActionType())){ if("0".equals(tEntranceGuardPersonInfo.getActionType())){
crc="入"; crc="入";
}else if("1".equals(tEntranceGuardPersonInfo.getActionType())){ }else if("1".equals(tEntranceGuardPersonInfo.getActionType())){
crc="出"; crc="出";
} }
contents[i+2]=tEntranceGuardPersonInfo.getPersonName()+" "+crc+" "+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,tEntranceGuardPersonInfo.getActionTime()); contents[i+2]=tEntranceGuardPersonInfo.getPersonName()+""+crc+""+DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,tEntranceGuardPersonInfo.getActionTime());
i++; i++;
} }
contents[5]=" "+DateUtils.getDate();//展示当日日期 contents[5]=" "+DateUtils.getDate();//展示当日日期
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.SysUserRole;
import com.zehong.system.domain.TStaff; import com.zehong.system.domain.TStaff;
import com.zehong.system.domain.form.TStaffForm; import com.zehong.system.domain.form.TStaffForm;
import com.zehong.system.domain.vo.TStaffVo; import com.zehong.system.domain.vo.TStaffVo;
import com.zehong.system.mapper.SysUserRoleMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TStaffMapper; import com.zehong.system.mapper.TStaffMapper;
...@@ -12,19 +18,23 @@ import com.zehong.system.service.ITStaffService; ...@@ -12,19 +18,23 @@ import com.zehong.system.service.ITStaffService;
/** /**
* 员工信息管理Service业务层处理 * 员工信息管理Service业务层处理
* *
* @author zehong * @author zehong
* @date 2022-06-17 * @date 2022-06-17
*/ */
@Service @Service
public class TStaffServiceImpl implements ITStaffService public class TStaffServiceImpl implements ITStaffService
{ {
@Autowired @Autowired
private TStaffMapper tStaffMapper; private TStaffMapper tStaffMapper;
@Autowired
private SysUserRoleMapper userRoleMapper;
/** /**
* 查询员工信息管理 * 查询员工信息管理
* *
* @param staffId 员工信息管理ID * @param staffId 员工信息管理ID
* @return 员工信息管理 * @return 员工信息管理
*/ */
...@@ -36,7 +46,7 @@ public class TStaffServiceImpl implements ITStaffService ...@@ -36,7 +46,7 @@ public class TStaffServiceImpl implements ITStaffService
/** /**
* 查询员工信息管理列表 * 查询员工信息管理列表
* *
* @param tStaff 员工信息管理 * @param tStaff 员工信息管理
* @return 员工信息管理 * @return 员工信息管理
*/ */
...@@ -48,7 +58,7 @@ public class TStaffServiceImpl implements ITStaffService ...@@ -48,7 +58,7 @@ public class TStaffServiceImpl implements ITStaffService
/** /**
* 新增员工信息管理 * 新增员工信息管理
* *
* @param tStaff 员工信息管理 * @param tStaff 员工信息管理
* @return 结果 * @return 结果
*/ */
...@@ -58,25 +68,32 @@ public class TStaffServiceImpl implements ITStaffService ...@@ -58,25 +68,32 @@ public class TStaffServiceImpl implements ITStaffService
String staffCode = tStaffMapper.getStaffCode(); String staffCode = tStaffMapper.getStaffCode();
tStaff.setStaffCode(staffCode); tStaff.setStaffCode(staffCode);
tStaff.setCreateTime(DateUtils.getNowDate()); tStaff.setCreateTime(DateUtils.getNowDate());
return tStaffMapper.insertTStaff(tStaff); tStaffMapper.insertTStaff(tStaff);
// 新增用户与角色管理
insertUserRole(tStaff);
return tStaff.getStaffId();
} }
/** /**
* 修改员工信息管理 * 修改员工信息管理
* *
* @param tStaff 员工信息管理 * @param tStaff 员工信息管理
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateTStaff(TStaff tStaff) public int updateTStaff(TStaff tStaff)
{ {
// 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(Long.valueOf(tStaff.getStaffId()));
// 新增用户与角色管理
insertUserRole(tStaff);
tStaff.setUpdateTime(DateUtils.getNowDate()); tStaff.setUpdateTime(DateUtils.getNowDate());
return tStaffMapper.updateTStaff(tStaff); return tStaffMapper.updateTStaff(tStaff);
} }
/** /**
* 批量删除员工信息管理 * 批量删除员工信息管理
* *
* @param staffIds 需要删除的员工信息管理ID * @param staffIds 需要删除的员工信息管理ID
* @return 结果 * @return 结果
*/ */
...@@ -88,7 +105,7 @@ public class TStaffServiceImpl implements ITStaffService ...@@ -88,7 +105,7 @@ public class TStaffServiceImpl implements ITStaffService
/** /**
* 删除员工信息管理信息 * 删除员工信息管理信息
* *
* @param staffId 员工信息管理ID * @param staffId 员工信息管理ID
* @return 结果 * @return 结果
*/ */
...@@ -97,4 +114,30 @@ public class TStaffServiceImpl implements ITStaffService ...@@ -97,4 +114,30 @@ public class TStaffServiceImpl implements ITStaffService
{ {
return tStaffMapper.deleteTStaffById(staffId); return tStaffMapper.deleteTStaffById(staffId);
} }
/**
* 新增用户角色信息
*
* @param user 用户对象
*/
public void insertUserRole(TStaff user)
{
Long[] roles = user.getRoleIds();
if (StringUtils.isNotNull(roles))
{
// 新增用户与角色管理
List<SysUserRole> list = new ArrayList<SysUserRole>();
for (Long roleId : roles)
{
SysUserRole ur = new SysUserRole();
ur.setUserId(Long.valueOf(user.getStaffId()));
ur.setRoleId(roleId);
list.add(ur);
}
if (list.size() > 0)
{
userRoleMapper.batchUserRole(list);
}
}
}
} }
...@@ -67,7 +67,11 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -67,7 +67,11 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
return 0; return 0;
} }
List<String> userIds = tTrainPlanMapper.selectAlluserByplanId(course.getCourseType()); List<String> userIds = tTrainPlanMapper.selectAlluserByplanId(course.getCourseType());
tTrainCourseMapper.insertUserCourse(courseId,userIds,course.getPersonnelType()); //异常数据
if(userIds==null||userIds.size()==0){
return 0;
}
tTrainCourseMapper.insertUserCourse(courseId,userIds,course.getPersonnelType());
course.setStatus(1); course.setStatus(1);
course.setReleaseTime(new Date()); course.setReleaseTime(new Date());
return tTrainCourseMapper.updateTTrainCourse(course); return tTrainCourseMapper.updateTTrainCourse(course);
...@@ -205,7 +209,6 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -205,7 +209,6 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String,Object> examination (Long userCourseId,Integer[][] answers){ public Map<String,Object> examination (Long userCourseId,Integer[][] answers){
//查询用户课程信息 //查询用户课程信息
TTrainUserCourse userCourse = tTrainUserCourseMapper.selectTTrainUserCourseById(userCourseId); TTrainUserCourse userCourse = tTrainUserCourseMapper.selectTTrainUserCourseById(userCourseId);
TTrainCourseTopic topic = new TTrainCourseTopic(); TTrainCourseTopic topic = new TTrainCourseTopic();
...@@ -226,7 +229,6 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -226,7 +229,6 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
Integer qualifiedNum = c.getQualifiedNum(); Integer qualifiedNum = c.getQualifiedNum();
//已获得分数 //已获得分数
int num = 0; int num = 0;
/** /**
* 大循环 共有多少答案 此循环最后只算出 得了多少分 * 大循环 共有多少答案 此循环最后只算出 得了多少分
*/ */
...@@ -235,10 +237,8 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -235,10 +237,8 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
int PassedNot =0; int PassedNot =0;
/*题目答案*/ /*题目答案*/
String answer = list.get(i).getAnswer(); String answer = list.get(i).getAnswer();
System.out.println("答案:"+answer);
//答案转换成数组 //答案转换成数组
Integer[] integers = JSON.parseObject(answer, Integer[].class); Integer[] integers = JSON.parseObject(answer, Integer[].class);
/**判断所选答案是否与正确答案长度相等*/ /**判断所选答案是否与正确答案长度相等*/
if (integers.length==answers[i].length){ if (integers.length==answers[i].length){
boolean adopt=true; boolean adopt=true;
...@@ -251,13 +251,10 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -251,13 +251,10 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
if (adopt){ if (adopt){
/** 1单选 2多选 3判断*/ /** 1单选 2多选 3判断*/
if (list.get(i).getTopicType()==1){ if (list.get(i).getTopicType()==1){
System.out.println(num);
num=num+singleChoiceScore; num=num+singleChoiceScore;
}else if (list.get(i).getTopicType()==2){ }else if (list.get(i).getTopicType()==2){
System.out.println(num);
num=num+multipleChoiceScore; num=num+multipleChoiceScore;
}else if (list.get(i).getTopicType()==3){ }else if (list.get(i).getTopicType()==3){
System.out.println(num);
num=num+judgmentScore; num=num+judgmentScore;
} }
} }
...@@ -273,12 +270,12 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService ...@@ -273,12 +270,12 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
} }
for(Integer i=0;i<answers.length;i++){ // for(Integer i=0;i<answers.length;i++){
// String demosub = list.get(i).getAnswer().substring(1,list.get(i).getAnswer().length()-1); // String demosub = list.get(i).getAnswer().substring(1,list.get(i).getAnswer().length()-1);
// if(Integer.parseInt(answers[i])==demosub){ // if(Integer.parseInt(answers[i])==demosub){
// num++; // num++;
// } // }
} // }
/**已获得分数*/ /**已获得分数*/
userCourse.setExaminationResult(num); userCourse.setExaminationResult(num);
/**生成日期*/ /**生成日期*/
......
...@@ -16,10 +16,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -16,10 +16,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createUser" column="create_user" /> <result property="createUser" column="create_user" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="singleChoiceScore" column="single_choice_score" />
<result property="multipleChoiceScore" column="multiple_choice_score" />
<result property="judgmentScore" column="judgment_score" />
</resultMap> </resultMap>
<sql id="selectTContractorTrainCourseVo"> <sql id="selectTContractorTrainCourseVo">
select contractor_course_id, course_name, course_conent, enclosure, video, qualified_num, topic_num, create_time, create_user, is_del, remark from t_contractor_train_course select single_choice_score,multiple_choice_score,judgment_score,contractor_course_id, course_name, course_conent, enclosure, video, qualified_num, topic_num, create_time, create_user, is_del, remark from t_contractor_train_course
</sql> </sql>
<select id="selectTContractorTrainCourseList" parameterType="TContractorTrainCourse" resultMap="TContractorTrainCourseResult"> <select id="selectTContractorTrainCourseList" parameterType="TContractorTrainCourse" resultMap="TContractorTrainCourseResult">
...@@ -54,6 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -54,6 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUser != null">create_user,</if> <if test="createUser != null">create_user,</if>
<if test="isDel != null">is_del,</if> <if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="singleChoiceScore != null">single_choice_score,</if>
<if test="multipleChoiceScore != null">multiple_choice_score,</if>
<if test="judgmentScore != null">judgment_score,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="courseName != null">#{courseName},</if> <if test="courseName != null">#{courseName},</if>
...@@ -66,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -66,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUser != null">#{createUser},</if> <if test="createUser != null">#{createUser},</if>
<if test="isDel != null">#{isDel},</if> <if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="singleChoiceScore != null">#{singleChoiceScore},</if>
<if test="multipleChoiceScore != null">#{multipleChoiceScore},</if>
<if test="judgmentScore != null">#{judgmentScore},</if>
</trim> </trim>
</insert> </insert>
...@@ -82,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -82,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUser != null">create_user = #{createUser},</if> <if test="createUser != null">create_user = #{createUser},</if>
<if test="isDel != null">is_del = #{isDel},</if> <if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="singleChoiceScore != null">single_choice_score = #{singleChoiceScore},</if>
<if test="multipleChoiceScore != null">multiple_choice_score = #{multipleChoiceScore},</if>
<if test="judgmentScore != null">judgment_score = #{judgmentScore},</if>
</trim> </trim>
where contractor_course_id = #{contractorCourseId} where contractor_course_id = #{contractorCourseId}
</update> </update>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TContractorTrainCourseTopicMapper"> <mapper namespace="com.zehong.system.mapper.TContractorTrainCourseTopicMapper">
<resultMap type="TContractorTrainCourseTopic" id="TContractorTrainCourseTopicResult"> <resultMap type="TContractorTrainCourseTopic" id="TContractorTrainCourseTopicResult">
<result property="topicId" column="topic_id" /> <result property="topicId" column="topic_id" />
<result property="contractorCourseId" column="contractor_course_id" /> <result property="contractorCourseId" column="contractor_course_id" />
...@@ -13,15 +13,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -13,15 +13,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="topicType" column="topic_type" />
</resultMap>
<resultMap type="TContractorTrainCourse" id="TContractorTrainCourseResult">
<result property="contractor_course_id" column="contractorCourseId" />
</resultMap> </resultMap>
<sql id="selectTContractorTrainCourseTopicVo"> <sql id="selectTContractorTrainCourseTopicVo">
select topic_id, contractor_course_id, topic_title, topic_option, answer, create_time, is_del, remark from t_contractor_train_course_topic select topic_id, contractor_course_id, topic_title, topic_option, answer, create_time, is_del, remark,topic_type from t_contractor_train_course_topic
</sql> </sql>
<select id="selectTContractorTrainCourseTopicList" parameterType="TContractorTrainCourseTopic" resultMap="TContractorTrainCourseTopicResult"> <select id="selectTContractorTrainCourseTopicList" parameterType="TContractorTrainCourseTopic" resultMap="TContractorTrainCourseTopicResult">
<include refid="selectTContractorTrainCourseTopicVo"/> <include refid="selectTContractorTrainCourseTopicVo"/>
<where> <where>
<if test="contractorCourseId != null "> and contractor_course_id = #{contractorCourseId}</if> <if test="contractorCourseId != null "> and contractor_course_id = #{contractorCourseId}</if>
<if test="topicTitle != null and topicTitle != ''"> and topic_title = #{topicTitle}</if> <if test="topicTitle != null and topicTitle != ''"> and topic_title = #{topicTitle}</if>
<if test="topicOption != null and topicOption != ''"> and topic_option = #{topicOption}</if> <if test="topicOption != null and topicOption != ''"> and topic_option = #{topicOption}</if>
...@@ -29,12 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -29,12 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if> <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where> </where>
</select> </select>
<select id="selectTContractorTrainCourseTopicById" parameterType="Long" resultMap="TContractorTrainCourseTopicResult"> <select id="selectTContractorTrainCourseTopicById" parameterType="Long" resultMap="TContractorTrainCourseTopicResult">
<include refid="selectTContractorTrainCourseTopicVo"/> <include refid="selectTContractorTrainCourseTopicVo"/>
where topic_id = #{topicId} where topic_id = #{topicId}
</select> </select>
<insert id="insertTContractorTrainCourseTopic" parameterType="TContractorTrainCourseTopic" useGeneratedKeys="true" keyProperty="topicId"> <insert id="insertTContractorTrainCourseTopic" parameterType="TContractorTrainCourseTopic" useGeneratedKeys="true" keyProperty="topicId">
insert into t_contractor_train_course_topic insert into t_contractor_train_course_topic
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -45,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="isDel != null">is_del,</if> <if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="topicType != null">topic_type,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="contractorCourseId != null">#{contractorCourseId},</if> <if test="contractorCourseId != null">#{contractorCourseId},</if>
...@@ -54,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -54,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="isDel != null">#{isDel},</if> <if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="topicType != null">#{topicType},</if>
</trim> </trim>
</insert> </insert>
...@@ -67,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -67,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="isDel != null">is_del = #{isDel},</if> <if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="topicType != null">topic_type = #{topicType},</if>
</trim> </trim>
where topic_id = #{topicId} where topic_id = #{topicId}
</update> </update>
...@@ -76,9 +86,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -76,9 +86,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteTContractorTrainCourseTopicByIds" parameterType="String"> <delete id="deleteTContractorTrainCourseTopicByIds" parameterType="String">
delete from t_contractor_train_course_topic where topic_id in delete from t_contractor_train_course_topic where topic_id in
<foreach item="topicId" collection="array" open="(" separator="," close=")"> <foreach item="topicId" collection="array" open="(" separator="," close=")">
#{topicId} #{topicId}
</foreach> </foreach>
</delete> </delete>
</mapper>
\ No newline at end of file <insert id="batchInsertTTrainCourseTopic" parameterType="java.util.List">
insert into t_contractor_train_course_topic(contractor_course_id,topic_title,topic_option,answer,create_time,topic_type) values
<foreach collection="list" item="topic" index="index" separator="," >
(#{topic.contractorCourseId},#{topic.topicTitle},#{topic.topicOption},#{topic.answer},#{topic.createTime},#{topic.topicType})
</foreach>
</insert>
<select id="selectTTrainCourseById" resultType="com.zehong.system.domain.TContractorTrainCourse">
select topic_num topicNum from t_contractor_train_course
where contractor_course_id = #{courseId}
</select>
<update id="updateTTrainCourse" parameterType="TContractorTrainCourse">
update t_contractor_train_course set topic_num=#{topicNum}
where contractor_course_id = #{contractorCourseId}
</update>
</mapper>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TContractorTrainResultDetailMapper"> <mapper namespace="com.zehong.system.mapper.TContractorTrainResultDetailMapper">
<resultMap type="TContractorTrainResultDetail" id="TContractorTrainResultDetailResult"> <resultMap type="TContractorTrainResultDetail" id="TContractorTrainResultDetailResult">
<result property="detailId" column="detail_id" /> <result property="detailId" column="detail_id" />
<result property="resultId" column="result_id" /> <result property="resultId" column="result_id" />
...@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTContractorTrainResultDetailList" parameterType="TContractorTrainResultDetail" resultMap="TContractorTrainResultDetailResult"> <select id="selectTContractorTrainResultDetailList" parameterType="TContractorTrainResultDetail" resultMap="TContractorTrainResultDetailResult">
<include refid="selectTContractorTrainResultDetailVo"/> <include refid="selectTContractorTrainResultDetailVo"/>
<where> <where>
<if test="resultId != null "> and result_id = #{resultId}</if> <if test="resultId != null "> and result_id = #{resultId}</if>
<if test="topicTitle != null and topicTitle != ''"> and topic_title = #{topicTitle}</if> <if test="topicTitle != null and topicTitle != ''"> and topic_title = #{topicTitle}</if>
<if test="topicOption != null and topicOption != ''"> and topic_option = #{topicOption}</if> <if test="topicOption != null and topicOption != ''"> and topic_option = #{topicOption}</if>
...@@ -33,12 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -33,12 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if> <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where> </where>
</select> </select>
<select id="selectTContractorTrainResultDetailById" parameterType="Long" resultMap="TContractorTrainResultDetailResult"> <select id="selectTContractorTrainResultDetailById" parameterType="Long" resultMap="TContractorTrainResultDetailResult">
<include refid="selectTContractorTrainResultDetailVo"/> <include refid="selectTContractorTrainResultDetailVo"/>
where detail_id = #{detailId} where detail_id = #{detailId}
</select> </select>
<insert id="insertTContractorTrainResultDetail" parameterType="TContractorTrainResultDetail" useGeneratedKeys="true" keyProperty="detailId"> <insert id="insertTContractorTrainResultDetail" parameterType="TContractorTrainResultDetail" useGeneratedKeys="true" keyProperty="detailId">
insert into t_contractor_train_result_detail insert into t_contractor_train_result_detail
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -47,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -47,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="topicOption != null">topic_option,</if> <if test="topicOption != null">topic_option,</if>
<if test="answer != null">answer,</if> <if test="answer != null">answer,</if>
<if test="answerChoice != null">answer_choice,</if> <if test="answerChoice != null">answer_choice,</if>
<if test="result != null">result,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="isDel != null">is_del,</if> <if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
...@@ -58,7 +57,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -58,7 +57,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="topicOption != null">#{topicOption},</if> <if test="topicOption != null">#{topicOption},</if>
<if test="answer != null">#{answer},</if> <if test="answer != null">#{answer},</if>
<if test="answerChoice != null">#{answerChoice},</if> <if test="answerChoice != null">#{answerChoice},</if>
<if test="result != null">#{result},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="isDel != null">#{isDel},</if> <if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
...@@ -86,9 +84,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -86,9 +84,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteTContractorTrainResultDetailByIds" parameterType="String"> <delete id="deleteTContractorTrainResultDetailByIds" parameterType="String">
delete from t_contractor_train_result_detail where detail_id in delete from t_contractor_train_result_detail where detail_id in
<foreach item="detailId" collection="array" open="(" separator="," close=")"> <foreach item="detailId" collection="array" open="(" separator="," close=")">
#{detailId} #{detailId}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TContractorTrainResultMapper"> <mapper namespace="com.zehong.system.mapper.TContractorTrainResultMapper">
<resultMap type="TContractorTrainResult" id="TContractorTrainResultResult"> <resultMap type="TContractorTrainResult" id="TContractorTrainResultResult">
<result property="resultId" column="result_id" /> <result property="resultId" column="result_id" />
<result property="beyondUnit" column="beyond_unit" /> <result property="beyondUnit" column="beyond_unit" />
...@@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTContractorTrainResultList" parameterType="TContractorTrainResult" resultMap="TContractorTrainResultResult"> <select id="selectTContractorTrainResultList" parameterType="TContractorTrainResult" resultMap="TContractorTrainResultResult">
<include refid="selectTContractorTrainResultVo"/> <include refid="selectTContractorTrainResultVo"/>
<where> <where>
<if test="beyondUnit != null and beyondUnit != ''"> and beyond_unit = #{beyondUnit}</if> <if test="beyondUnit != null and beyondUnit != ''"> and beyond_unit = #{beyondUnit}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if> <if test="sex != null and sex != ''"> and sex = #{sex}</if>
...@@ -34,13 +34,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -34,13 +34,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="score != null and score != ''"> and score = #{score}</if> <if test="score != null and score != ''"> and score = #{score}</if>
<if test="isQualified != null and isQualified != ''"> and is_qualified = #{isQualified}</if> <if test="isQualified != null and isQualified != ''"> and is_qualified = #{isQualified}</if>
</where> </where>
order by result_id desc
</select> </select>
<select id="selectTContractorTrainResultById" parameterType="Long" resultMap="TContractorTrainResultResult"> <select id="selectTContractorTrainResultById" parameterType="Long" resultMap="TContractorTrainResultResult">
<include refid="selectTContractorTrainResultVo"/> <include refid="selectTContractorTrainResultVo"/>
where result_id = #{resultId} where result_id = #{resultId}
</select> </select>
<insert id="insertTContractorTrainResult" parameterType="TContractorTrainResult" useGeneratedKeys="true" keyProperty="resultId"> <insert id="insertTContractorTrainResult" parameterType="TContractorTrainResult" useGeneratedKeys="true" keyProperty="resultId">
insert into t_contractor_train_result insert into t_contractor_train_result
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -94,9 +95,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -94,9 +95,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteTContractorTrainResultByIds" parameterType="String"> <delete id="deleteTContractorTrainResultByIds" parameterType="String">
delete from t_contractor_train_result where result_id in delete from t_contractor_train_result where result_id in
<foreach item="resultId" collection="array" open="(" separator="," close=")"> <foreach item="resultId" collection="array" open="(" separator="," close=")">
#{resultId} #{resultId}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where t.user_id = #{staffId} where t.user_id = #{staffId}
</select> </select>
<insert id="insertTStaff" parameterType="TStaff"> <insert id="insertTStaff" parameterType="TStaff" useGeneratedKeys = "true" keyProperty = "staffId">
insert into sys_user insert into sys_user
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
user_staff, user_staff,
......
/*
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 16:04:04
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-31 16:22:00
* @FilePath: /danger-manage-web/src/api/contractTrain/contractTrain.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from '@/utils/request' import request from '@/utils/request'
// 查询承包商及访客培训列表 // 查询承包商及访客培训列表
...@@ -9,6 +17,7 @@ export function listCourse(query) { ...@@ -9,6 +17,7 @@ export function listCourse(query) {
}) })
} }
// 查询承包商及访客培训详细 // 查询承包商及访客培训详细
export function getCourse(contractorCourseId) { export function getCourse(contractorCourseId) {
return request({ return request({
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-23 11:02:24 * @Date: 2022-09-23 11:02:24
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-28 09:57:47 * @LastEditTime: 2023-01-29 14:53:07
* @FilePath: /danger-manage-web/src/api/educationPlanExam/trainingProgram.js * @FilePath: /danger-manage-web/src/api/educationPlanExam/trainingProgram.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -186,3 +186,10 @@ export function bachAddTopic(data) { ...@@ -186,3 +186,10 @@ export function bachAddTopic(data) {
}) })
} }
export function bachAddTopicGuest(data) {
return request({
url: '/contractTrainTopic/bachAddTopic',
method: 'post',
data: data
})
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 15:23:58 * @Date: 2022-12-19 15:23:58
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-21 16:56:26 * @LastEditTime: 2023-02-01 17:24:30
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/Lesson-table.vue * @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/Lesson-table.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -16,7 +16,10 @@ ...@@ -16,7 +16,10 @@
@select-all="all" @select-all="all"
ref="multipleTable" ref="multipleTable"
> >
<el-table-column type="selection"></el-table-column> <el-table-column
v-if='!disabled'
type="selection"
></el-table-column>
<el-table-column label="姓名" align="center" prop="staffName"> <el-table-column label="姓名" align="center" prop="staffName">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -55,10 +58,14 @@ export default { ...@@ -55,10 +58,14 @@ export default {
selectNameList: { selectNameList: {
type: Array, type: Array,
}, },
disabled: {
type: Boolean,
},
}, },
created() { created() {
// this.listStaff(); // this.listStaff();
}, },
data() { data() {
return { return {
queryParams: { queryParams: {
...@@ -71,6 +78,9 @@ export default { ...@@ -71,6 +78,9 @@ export default {
nameList: [], nameList: [],
loading: false, loading: false,
}; };
},
mounted() {
}, },
methods: { methods: {
listStaff() { listStaff() {
...@@ -109,6 +119,11 @@ export default { ...@@ -109,6 +119,11 @@ export default {
} }
this.$emit("selectAll", this.nameList, allSelect); this.$emit("selectAll", this.nameList, allSelect);
}, },
selectable(row, rowIndex) {
if (!this.disabled) {
return true;
}
},
// 切换选项 // 切换选项
toggleSelection(staffId, SeclctFlag = false) { toggleSelection(staffId, SeclctFlag = false) {
const item = this.nameList.find((item) => { const item = this.nameList.find((item) => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 17:39:55 * @Date: 2022-12-19 17:39:55
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-13 15:37:54 * @LastEditTime: 2023-02-02 10:56:52
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangePapel.vue * @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangePapel.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -36,13 +36,14 @@ ...@@ -36,13 +36,14 @@
> >
</el-input> </el-input>
<div> <div>
<el-button @click="searchTable" size="mini">搜索</el-button> <el-button @click="searchTable" size="mini">搜索</el-button>
</div> </div>
</div> </div>
<div class="left-middle-table"> <div class="left-middle-table">
<ChangPapelTable <ChangPapelTable
ref="table" ref="table"
:selectNameList.sync="selectNameList" :selectNameList.sync="selectNameList"
:disabled="disabled"
@selectOne="selectOne" @selectOne="selectOne"
@selectAll="selectAll" @selectAll="selectAll"
/> />
...@@ -60,7 +61,7 @@ ...@@ -60,7 +61,7 @@
:key="item.staffId" :key="item.staffId"
> >
<div>{{ item.staffName }}</div> <div>{{ item.staffName }}</div>
<div class="close" @click="deleteName(item.staffId)">x</div> <div class="close" @click="deleteName(item.staffId)">x</div>
</div> </div>
</div> </div>
<div class="bottom-text">已选择{{selectNameList.length}}</div> <div class="bottom-text">已选择{{selectNameList.length}}</div>
...@@ -83,6 +84,9 @@ export default { ...@@ -83,6 +84,9 @@ export default {
type: String, type: String,
default: null, default: null,
}, },
disabled:{
type:Boolean,
}
}, },
data() { data() {
return { return {
...@@ -143,6 +147,7 @@ export default { ...@@ -143,6 +147,7 @@ export default {
this.$refs.table.listStaff(); this.$refs.table.listStaff();
}, },
deleteName(staffId) { deleteName(staffId) {
if(this.disabled) return;
const index = this.selectNameList.findIndex((item) => { const index = this.selectNameList.findIndex((item) => {
return item.staffId == staffId; return item.staffId == staffId;
}); });
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// [114.07708709377842, 38.248960473114614], // [114.07708709377842, 38.248960473114614],
// ], // ],
// colorNum: 1, // colorNum: 1,
// fxlb: "风险区域", // fxlb: "重大风险区域",
// bsjh: "", // bsjh: "",
// wxy: "锅炉操作", // wxy: "锅炉操作",
// fxd: "锅炉点火", // fxd: "锅炉点火",
...@@ -145,7 +145,7 @@ export const dangerArr = [ ...@@ -145,7 +145,7 @@ export const dangerArr = [
[114.08164030994841, 38.25079994477491], [114.08164030994841, 38.25079994477491],
], ],
data: { data: {
fxlb: "较风险" fxlb: "较风险"
}, },
colorNum: 2, colorNum: 2,
}, },
...@@ -160,7 +160,7 @@ export const dangerArr = [ ...@@ -160,7 +160,7 @@ export const dangerArr = [
[114.08037480953207, 38.249932590119556], [114.08037480953207, 38.249932590119556],
], ],
data: { data: {
fxlb: "风险", fxlb: "重大风险",
src: [jzyh, jzdhz, dxzd, dxxl, dxbz, bxdfdmj], src: [jzyh, jzdhz, dxzd, dxxl, dxbz, bxdfdmj],
}, },
colorNum: 1, colorNum: 1,
...@@ -174,7 +174,7 @@ export const dangerArr = [ ...@@ -174,7 +174,7 @@ export const dangerArr = [
[114.08098376391818, 38.24951885572243], [114.08098376391818, 38.24951885572243],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -201,7 +201,7 @@ export const dangerArr = [ ...@@ -201,7 +201,7 @@ export const dangerArr = [
[114.08000932886821, 38.25149427805925], [114.08000932886821, 38.25149427805925],
], ],
data: { data: {
fxlb: "较风险" fxlb: "较风险"
}, },
colorNum: 2, colorNum: 2,
}, },
...@@ -215,7 +215,7 @@ export const dangerArr = [ ...@@ -215,7 +215,7 @@ export const dangerArr = [
[114.07992247747968, 38.2490596822873], [114.07992247747968, 38.2490596822873],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
}, },
{ {
...@@ -240,7 +240,7 @@ export const dangerArr = [ ...@@ -240,7 +240,7 @@ export const dangerArr = [
[114.07896214915758, 38.2485657203445], [114.07896214915758, 38.2485657203445],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -253,7 +253,7 @@ export const dangerArr = [ ...@@ -253,7 +253,7 @@ export const dangerArr = [
[114.07968503158452, 38.249621022521914], [114.07968503158452, 38.249621022521914],
], ],
data: { data: {
fxlb: "较风险" fxlb: "较风险"
}, },
colorNum: 2, colorNum: 2,
}, },
...@@ -266,7 +266,7 @@ export const dangerArr = [ ...@@ -266,7 +266,7 @@ export const dangerArr = [
[114.07932854865001, 38.25049906057526], [114.07932854865001, 38.25049906057526],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -279,7 +279,7 @@ export const dangerArr = [ ...@@ -279,7 +279,7 @@ export const dangerArr = [
[114.07929156270377, 38.24989004286162], [114.07929156270377, 38.24989004286162],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -293,7 +293,7 @@ export const dangerArr = [ ...@@ -293,7 +293,7 @@ export const dangerArr = [
[114.07818775308438, 38.24904718615451], [114.07818775308438, 38.24904718615451],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
}, },
{ {
...@@ -308,7 +308,7 @@ export const dangerArr = [ ...@@ -308,7 +308,7 @@ export const dangerArr = [
[114.07822516569071, 38.24873709204756], [114.07822516569071, 38.24873709204756],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
}, },
{ {
...@@ -320,7 +320,7 @@ export const dangerArr = [ ...@@ -320,7 +320,7 @@ export const dangerArr = [
[114.0778791617466, 38.24978811628299], [114.0778791617466, 38.24978811628299],
], ],
data: { data: {
fxlb: "较风险" fxlb: "较风险"
}, },
colorNum: 2, colorNum: 2,
}, },
...@@ -334,7 +334,7 @@ export const dangerArr = [ ...@@ -334,7 +334,7 @@ export const dangerArr = [
[114.07811902680491, 38.25084109067064], [114.07811902680491, 38.25084109067064],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
}, },
{ {
...@@ -346,7 +346,7 @@ export const dangerArr = [ ...@@ -346,7 +346,7 @@ export const dangerArr = [
[114.07816939918499, 38.250464604821424], [114.07816939918499, 38.250464604821424],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -362,7 +362,7 @@ export const dangerArr = [ ...@@ -362,7 +362,7 @@ export const dangerArr = [
[114.07655032796976, 38.24855692071795], [114.07655032796976, 38.24855692071795],
], ],
data: { data: {
fxlb: "较风险" fxlb: "较风险"
}, },
}, },
{ {
...@@ -375,7 +375,7 @@ export const dangerArr = [ ...@@ -375,7 +375,7 @@ export const dangerArr = [
[114.07645852296761, 38.249258052783055], [114.07645852296761, 38.249258052783055],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
}, },
{ {
...@@ -387,7 +387,7 @@ export const dangerArr = [ ...@@ -387,7 +387,7 @@ export const dangerArr = [
[114.07673177371679, 38.24999869046041], [114.07673177371679, 38.24999869046041],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -400,7 +400,7 @@ export const dangerArr = [ ...@@ -400,7 +400,7 @@ export const dangerArr = [
[114.07638572203807, 38.250006593486276], [114.07638572203807, 38.250006593486276],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -413,7 +413,7 @@ export const dangerArr = [ ...@@ -413,7 +413,7 @@ export const dangerArr = [
[114.0763611632972, 38.2506105391965], [114.0763611632972, 38.2506105391965],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -440,7 +440,7 @@ export const dangerArr = [ ...@@ -440,7 +440,7 @@ export const dangerArr = [
[114.07610863025666, 38.249559594773935], [114.07610863025666, 38.249559594773935],
], ],
data: { data: {
fxlb: "较风险" fxlb: "较风险"
}, },
}, },
{ {
...@@ -452,7 +452,7 @@ export const dangerArr = [ ...@@ -452,7 +452,7 @@ export const dangerArr = [
[114.07629629633044, 38.249994075703896], [114.07629629633044, 38.249994075703896],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -479,7 +479,7 @@ export const dangerArr = [ ...@@ -479,7 +479,7 @@ export const dangerArr = [
[114.07614690640786, 38.250982027231906], [114.07614690640786, 38.250982027231906],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -492,7 +492,7 @@ export const dangerArr = [ ...@@ -492,7 +492,7 @@ export const dangerArr = [
[114.07506815524074, 38.24935807751058], [114.07506815524074, 38.24935807751058],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -505,7 +505,7 @@ export const dangerArr = [ ...@@ -505,7 +505,7 @@ export const dangerArr = [
[114.07575424777615, 38.25022009521355], [114.07575424777615, 38.25022009521355],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -518,7 +518,7 @@ export const dangerArr = [ ...@@ -518,7 +518,7 @@ export const dangerArr = [
[114.07569321404614, 38.25050557141559], [114.07569321404614, 38.25050557141559],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -531,7 +531,7 @@ export const dangerArr = [ ...@@ -531,7 +531,7 @@ export const dangerArr = [
[114.07533109169464, 38.25112532353275], [114.07533109169464, 38.25112532353275],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -544,7 +544,7 @@ export const dangerArr = [ ...@@ -544,7 +544,7 @@ export const dangerArr = [
[114.07506400522227, 38.2498509809399], [114.07506400522227, 38.2498509809399],
], ],
data: { data: {
fxlb: "较风险" fxlb: "较风险"
}, },
colorNum: 2, colorNum: 2,
}, },
...@@ -557,7 +557,7 @@ export const dangerArr = [ ...@@ -557,7 +557,7 @@ export const dangerArr = [
[114.07507104315593, 38.249669088954406], [114.07507104315593, 38.249669088954406],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -571,7 +571,7 @@ export const dangerArr = [ ...@@ -571,7 +571,7 @@ export const dangerArr = [
[114.07329016901807, 38.24975956466659], [114.07329016901807, 38.24975956466659],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
}, },
{ {
...@@ -583,7 +583,7 @@ export const dangerArr = [ ...@@ -583,7 +583,7 @@ export const dangerArr = [
[114.07449942174725, 38.25005976641145], [114.07449942174725, 38.25005976641145],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
...@@ -596,7 +596,7 @@ export const dangerArr = [ ...@@ -596,7 +596,7 @@ export const dangerArr = [
[114.07409377782558, 38.25057015884229], [114.07409377782558, 38.25057015884229],
], ],
data: { data: {
fxlb: "风险" fxlb: "重大风险"
}, },
colorNum: 1, colorNum: 1,
}, },
......
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2023-02-01 09:37:02
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-02-01 09:59:55
* @FilePath: /danger-manage-web/src/views/dangerScale/profile/tiops.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="danger-tips">
<!-- <div>管道压力</div> -->
<div class="hasColorBox" :style="{ color: dangerColor['1'] }">
<div :style="{ backgroundColor: dangerColor['1'] }"></div>
<span>重大风险</span>
</div>
<div class="hasColorBox" :style="{ color: dangerColor[`2`] }">
<div :style="{ backgroundColor: dangerColor[`2`] }"></div>
<span>较大风险</span>
</div>
<div class="hasColorBox" :style="{ color: dangerColor[`3`] }">
<div :style="{ backgroundColor: dangerColor[`3`] }"></div>
<span>一般风险</span>
</div>
<div class="hasColorBox" :style="{ color: dangerColor[`4`] }">
<div :style="{ backgroundColor: dangerColor[`4`] }"></div>
<span>低风险</span>
</div>
</div>
</template>
<script>
export default {
name: "",
data() {
return {
dangerColor: {
1: "red",
2: "orange",
3: "yellow",
4: "blue",
},
};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.danger-tips {
position: absolute;
color: #fff;
left: 10px;
top: 10px;
padding: 1px;
padding-left:10px;
width: 150px;
// background: rgba(6, 29, 51, 0.2);
.hasColorBox {
// border: 1px solid #053b6a;
padding: 2px 5px;
margin-bottom: 5px;
position:relative;
& > div {
display: inline-block;
width: 50px;
height: 20px;
margin-right: 10px;
}
& > span {
position:absolute;
display: inline-block;
width: 100px;
}
}
}
</style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40 * @Date: 2022-06-16 15:03:40
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-10-22 10:39:48 * @LastEditTime: 2023-02-01 09:48:47
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue * @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -20,13 +20,14 @@ ...@@ -20,13 +20,14 @@
> >
</div> --> </div> -->
<div id="mapbox"></div> <div id="mapbox"></div>
<DangerTips />
</div> </div>
</template> </template>
<script> <script>
import CreateCesium, { DEVICE_PIC_TYPE } from "@/utils/cesium/cesiumClass.js"; import CreateCesium, { DEVICE_PIC_TYPE } from "@/utils/cesium/cesiumClass.js";
import { dangerArr } from "@/utils/cesium/dangerArr.js"; import { dangerArr } from "@/utils/cesium/dangerArr.js";
import DangerTips from "./DangerTips.vue";
import Video from "@/components/bigWindow/video"; import Video from "@/components/bigWindow/video";
import Null from "@/components/bigWindow/Null"; import Null from "@/components/bigWindow/Null";
import Danger from "@/components/bigWindow/Danger"; import Danger from "@/components/bigWindow/Danger";
...@@ -42,6 +43,7 @@ export default { ...@@ -42,6 +43,7 @@ export default {
name: "profile", name: "profile",
components: { components: {
Editor, Editor,
DangerTips,
}, },
data() { data() {
return { return {
...@@ -249,6 +251,7 @@ export default { ...@@ -249,6 +251,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.big-window { .big-window {
width: 100%; width: 100%;
position:relative;
// height: calc(100vh - 84px); // height: calc(100vh - 84px);
height: calc(100vh - 50px); height: calc(100vh - 50px);
#mapbox { #mapbox {
......
...@@ -11,9 +11,15 @@ ...@@ -11,9 +11,15 @@
size="mini" size="mini"
@input="topicTypeChange" @input="topicTypeChange"
> >
<el-radio-button :label="1">单选</el-radio-button> <el-radio-button :disabled="checkLock" :label="1"
<el-radio-button :label="2">多选</el-radio-button> >单选</el-radio-button
<el-radio-button :label="3">判断</el-radio-button> >
<el-radio-button :disabled="checkLock" :label="2"
>多选</el-radio-button
>
<el-radio-button :disabled="checkLock" :label="3"
>判断</el-radio-button
>
</el-radio-group> </el-radio-group>
</div> </div>
...@@ -29,7 +35,7 @@ ...@@ -29,7 +35,7 @@
:rules="{ :rules="{
required: true, required: true,
message: '必须输入题目内容', message: '必须输入题目内容',
trigger: 'blur', trigger: ['blur', 'change'],
}" }"
> >
<el-input <el-input
...@@ -38,6 +44,7 @@ ...@@ -38,6 +44,7 @@
resize="none" resize="none"
rows="4" rows="4"
v-model="form.topicTitle" v-model="form.topicTitle"
:disabled="checkLock"
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -55,7 +62,7 @@ ...@@ -55,7 +62,7 @@
:rules="{ :rules="{
required: true, required: true,
message: '选项内容不能为空不能为空', message: '选项内容不能为空不能为空',
trigger: 'change', trigger: ['blur', 'change'],
}" }"
> >
<div class="add-select flex"> <div class="add-select flex">
...@@ -65,6 +72,7 @@ ...@@ -65,6 +72,7 @@
style="flex: 1; margin-right: 10px" style="flex: 1; margin-right: 10px"
rows="2" rows="2"
v-model="question.value" v-model="question.value"
:disabled="checkLock"
></el-input> ></el-input>
<div class="flex algin-items"> <div class="flex algin-items">
<div <div
...@@ -79,8 +87,9 @@ ...@@ -79,8 +87,9 @@
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
v-if="index > 0" v-if="index > 0 && form.topicType != 3"
@click.prevent="removeDomain(question)" @click.prevent="removeDomain(question)"
:disabled="checkLock"
>删除</el-button >删除</el-button
> >
</div> </div>
...@@ -111,7 +120,11 @@ ...@@ -111,7 +120,11 @@
设为正确答案 设为正确答案
</div> --> </div> -->
<div style="padding-left: 30px" v-if="form.topicType != 3"> <div style="padding-left: 30px" v-if="form.topicType != 3">
<el-button size="mini" type="primary" @click.prevent="add(addValue)" <el-button
size="mini"
:disabled="checkLock"
type="primary"
@click.prevent="add(addValue)"
>新增选项</el-button >新增选项</el-button
> >
</div> </div>
...@@ -146,6 +159,10 @@ export default { ...@@ -146,6 +159,10 @@ export default {
topicId: { topicId: {
type: Number, type: Number,
}, },
// 如果是查看,就禁止修改
checkLock: {
type: Boolean,
},
}, },
components: {}, components: {},
data() { data() {
...@@ -171,7 +188,7 @@ export default { ...@@ -171,7 +188,7 @@ export default {
console.log(res.data); console.log(res.data);
const data = res.data; const data = res.data;
this.form = { this.form = {
topicType :data.topicType, topicType: data.topicType,
topicTitle: data.topicTitle, topicTitle: data.topicTitle,
questions: JSON.parse(data.topicOption), questions: JSON.parse(data.topicOption),
}; };
...@@ -232,6 +249,7 @@ export default { ...@@ -232,6 +249,7 @@ export default {
} }
}, },
rightAnswerClick(index) { rightAnswerClick(index) {
if (this.checkLock) return;
if (this.form.topicType === 2) { if (this.form.topicType === 2) {
const ind = this.answerNum.indexOf(index); const ind = this.answerNum.indexOf(index);
if (ind < 0) { if (ind < 0) {
...@@ -250,6 +268,8 @@ export default { ...@@ -250,6 +268,8 @@ export default {
}, },
// 删除选项 // 删除选项
removeDomain(question) { removeDomain(question) {
if (this.checkLock) return;
const index = this.form.questions.indexOf(question); const index = this.form.questions.indexOf(question);
console.log(index); console.log(index);
// 如果是正确答案,就让正确答案清空 // 如果是正确答案,就让正确答案清空
...@@ -276,11 +296,10 @@ export default { ...@@ -276,11 +296,10 @@ export default {
// 新增选项 // 新增选项
add(addValue) { add(addValue) {
this.form.questions.push({ value: addValue }); this.form.questions.push({ value: addValue });
console.log();
}, },
save(num = 2) { save(num = 2) {
return new Promise((resove) => { return new Promise((resove) => {
if (this.answerNum.length<=0) { if (this.answerNum.length <= 0) {
this.$message({ this.$message({
message: "警告,请设置一个正确答案", message: "警告,请设置一个正确答案",
type: "warning", type: "warning",
...@@ -293,8 +312,8 @@ export default { ...@@ -293,8 +312,8 @@ export default {
data.topicTitle = this.form.topicTitle; data.topicTitle = this.form.topicTitle;
data.topicOption = JSON.stringify(this.form.questions); data.topicOption = JSON.stringify(this.form.questions);
data.answer = JSON.stringify(this.answerNum); data.answer = JSON.stringify(this.answerNum);
data.topicType=this.form.topicType; data.topicType = this.form.topicType;
console.log(data) console.log(data);
this.addQuestion(data).then((res) => { this.addQuestion(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
// 把修改的这个归位,变成正常添加 // 把修改的这个归位,变成正常添加
...@@ -324,7 +343,7 @@ export default { ...@@ -324,7 +343,7 @@ export default {
}); });
}, },
reset() { reset() {
const topicType = this.form.topicType const topicType = this.form.topicType;
this.form = { this.form = {
topicType, topicType,
topicTitle: "", topicTitle: "",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 09:30:19 * @Date: 2022-12-27 09:30:19
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-28 10:29:18 * @LastEditTime: 2023-02-01 16:15:10
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangeQuestion.vue * @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangeQuestion.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -193,7 +193,8 @@ export default { ...@@ -193,7 +193,8 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
saveAndNext() { save(num=2) {
const topicInfos = this.list const topicInfos = this.list
.filter((item) => item.checked) .filter((item) => item.checked)
.map((item) => { .map((item) => {
...@@ -202,18 +203,20 @@ export default { ...@@ -202,18 +203,20 @@ export default {
quan: item.changeNum, quan: item.changeNum,
}; };
}); });
console.log(this.courseId, topicInfos); console.log(this.courseId, topicInfos);
const data = { courseId: this.courseId, topicInfos }; const data = { courseId: this.courseId, topicInfos };
console.log(data); console.log(data);
bachAddTopic(data).then((res) => { bachAddTopic(data).then((res) => {
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.$parent.$parent.componentsNumChange(2); this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.$parent.getList(); this.$parent.$parent.$parent.getList();
} }
}); });
}, },
saveAndNext(){
this.save(3)
},
resetClick() {}, resetClick() {},
search() { search() {
this.getList(); this.getList();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49 * @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-13 15:59:47 * @LastEditTime: 2023-02-01 16:16:44
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue * @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
:is="currentComponent" :is="currentComponent"
:courseId.sync="courseId" :courseId.sync="courseId"
:topicId.sync="topicId" :topicId.sync="topicId"
:checkLock="checkLock"
ref="current" ref="current"
></component> ></component>
</transition> </transition>
...@@ -32,27 +33,31 @@ ...@@ -32,27 +33,31 @@
<QuestionList/> --> <QuestionList/> -->
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer" v-if="!checkLock">
<el-button <el-button
type="primary" type="primary"
v-if="this.componentsNum == 2" v-if="this.componentsNum == 2 && !checkLock"
@click="componentsNumChange(4)" @click="componentsNumChange(4)"
>从题库选择</el-button >从题库选择</el-button
> >
<el-button <el-button
type="primary" type="primary"
v-if="this.componentsNum == 1 || this.componentsNum == 3" v-if="this.componentsNum == 4 ||this.componentsNum==3"
@click="save" @click="componentsNumChange(2)"
>保存</el-button >返回题目列表</el-button
> >
<el-button <el-button
type="primary" type="primary"
v-if="this.componentsNum == 4" v-if="
@click="componentsNumChange(2)" this.componentsNum == 1 ||
>返回题目列表</el-button this.componentsNum == 3 ||
this.componentsNum == 4
"
@click="save"
>保存</el-button
> >
<el-button type="primary" @click="saveAndNext">{{
<el-button type="primary" @click="saveAndNext" v-if="!checkLock">{{
saveNextText saveNextText
}}</el-button> }}</el-button>
<el-button <el-button
...@@ -63,6 +68,16 @@ ...@@ -63,6 +68,16 @@
> >
<el-button @click="dialogCancel">取消</el-button> <el-button @click="dialogCancel">取消</el-button>
</div> </div>
<div slot="footer" class="dialog-footer" v-else>
<el-button
type="primary"
v-if="this.componentsNum == 3 && checkLock"
@click="componentsNumChange(2)"
>返回题目列表</el-button
>
<el-button type="primary" @click="dialogCancel">{{ "确认" }}</el-button>
<el-button @click="dialogCancel">取消</el-button>
</div>
</el-dialog> </el-dialog>
</template> </template>
...@@ -72,7 +87,6 @@ import AddQuestion from "./AddQuestion"; ...@@ -72,7 +87,6 @@ import AddQuestion from "./AddQuestion";
import QuestionList from "./QuestionList"; import QuestionList from "./QuestionList";
import ChangeQuestion from "./ChangeQuestion"; import ChangeQuestion from "./ChangeQuestion";
export default { export default {
name: "AnswerLesson", name: "AnswerLesson",
props: { props: {
...@@ -87,6 +101,9 @@ export default { ...@@ -87,6 +101,9 @@ export default {
courseId: { courseId: {
type: Number, type: Number,
}, },
checkLock: {
type: Boolean,
},
}, },
// components: { // components: {
// Lesson, // Lesson,
...@@ -116,14 +133,14 @@ export default { ...@@ -116,14 +133,14 @@ export default {
this.currentComponent = QuestionList; this.currentComponent = QuestionList;
this.title = "题目列表"; this.title = "题目列表";
} else if(num===3) { } else if (num === 3) {
this.currentComponent = AddQuestion; this.currentComponent = AddQuestion;
if (this.topicId) { if (this.topicId) {
this.title = "修改题目"; this.title = "修改题目";
} else { } else {
this.title = "新增题目"; this.title = "新增题目";
} }
}else if (num == 4) { } else if (num == 4) {
this.currentComponent = ChangeQuestion; this.currentComponent = ChangeQuestion;
this.title = "从题库选题"; this.title = "从题库选题";
} }
...@@ -167,6 +184,8 @@ export default { ...@@ -167,6 +184,8 @@ export default {
this.topicId = null; this.topicId = null;
} }
this.$emit("update:visible", false); this.$emit("update:visible", false);
// 关闭的时候归位
this.$emit("update:checkLock", false);
}, },
// 把ID改变了 // 把ID改变了
changeCourseId(courseId) { changeCourseId(courseId) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44 * @Date: 2022-09-22 10:59:44
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-04 17:47:53 * @LastEditTime: 2023-02-01 15:21:15
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue * @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -17,34 +17,33 @@ ...@@ -17,34 +17,33 @@
> >
<div class="top flex"> <div class="top flex">
<el-form-item label="课程标题" prop="courseName"> <el-form-item label="课程标题" prop="courseName">
<el-input style="width: 400px" v-model="form.courseName"></el-input> <el-input style="width: 400px" v-model="form.courseName" :disabled="checkLock"></el-input>
</el-form-item> </el-form-item>
<!--<el-form-item label="培训计划" prop="courseType">--> <!--<el-form-item label="培训计划" prop="courseType">-->
<!--<el-select--> <!--<el-select-->
<!--v-model="form.courseType"--> <!--v-model="form.courseType"-->
<!--placeholder="请选择培训计划"--> <!--placeholder="请选择培训计划"-->
<!--clearable--> <!--clearable-->
<!--size="small"--> <!--size="small"-->
<!--&gt;--> <!--&gt;-->
<!--<el-option--> <!--<el-option-->
<!--v-for="course in courseOptions"--> <!--v-for="course in courseOptions"-->
<!--:key="course.planId"--> <!--:key="course.planId"-->
<!--:label="course.planName"--> <!--:label="course.planName"-->
<!--:value="course.planId"--> <!--:value="course.planId"-->
<!--/>--> <!--/>-->
<!--</el-select>--> <!--</el-select>-->
<!--</el-form-item>--> <!--</el-form-item>-->
</div> </div>
<div class="flex"> <div class="flex">
<el-form-item label="培训计划" prop="courseType"> <el-form-item label="培训计划" prop="courseType">
<el-select <el-select
v-model="form.courseType" v-model="form.courseType"
placeholder="请选择培训计划" placeholder="请选择培训计划"
clearable clearable
size="small" size="small"
:disabled="checkLock"
> >
<el-option <el-option
v-for="course in courseOptions" v-for="course in courseOptions"
...@@ -54,8 +53,18 @@ ...@@ -54,8 +53,18 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="培训时长" prop="duration" style="margin-left: 55px"> <el-form-item
<el-input style="width: 220px" placeholder="分钟" type="number" v-model="form.duration"></el-input> label="培训时长"
prop="duration"
style="margin-left: 55px"
>
<el-input
style="width: 220px"
placeholder="分钟"
type="number"
v-model="form.duration"
:disabled="checkLock"
></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="flex"> <div class="flex">
...@@ -67,6 +76,7 @@ ...@@ -67,6 +76,7 @@
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
default-time="00:00:00" default-time="00:00:00"
:disabled="checkLock"
/> />
</el-form-item> </el-form-item>
<el-form-item label="结束时间" prop="testEndTime"> <el-form-item label="结束时间" prop="testEndTime">
...@@ -76,12 +86,13 @@ ...@@ -76,12 +86,13 @@
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
default-time="00:00:00" default-time="00:00:00"
:disabled="checkLock"
/> />
</el-form-item> </el-form-item>
</div> </div>
<!-- </div> --> <!-- </div> -->
<el-form-item label="课程内容" prop="courseConent"> <el-form-item label="课程内容" prop="courseConent">
<Editor v-model="form.courseConent" :min-height="192" /> <Editor v-model="form.courseConent" :min-height="192" :readOnly="checkLock"/>
<el-input <el-input
v-show="false" v-show="false"
disabled disabled
...@@ -90,7 +101,7 @@ ...@@ -90,7 +101,7 @@
</el-form-item> </el-form-item>
<div class="flex"> <div class="flex">
<el-form-item label="视频上传" v-if="!readOnly" prop="video"> <el-form-item label="视频上传" v-if="!readOnly" prop="video">
<FileUpload <FileUpload
listType="picture" listType="picture"
@resFun="getFileInfoVideo" @resFun="getFileInfoVideo"
...@@ -98,6 +109,7 @@ ...@@ -98,6 +109,7 @@
:fileArr="fileListVideo" :fileArr="fileListVideo"
:fileSize="500" :fileSize="500"
:fileType="['mp4']" :fileType="['mp4']"
:disabled="checkLock"
/> />
<el-input v-show="false" disabled v-model="form.video"></el-input> <el-input v-show="false" disabled v-model="form.video"></el-input>
</el-form-item> </el-form-item>
...@@ -108,6 +120,7 @@ ...@@ -108,6 +120,7 @@
@remove="listRemoveFile" @remove="listRemoveFile"
:fileArr="fileListFile" :fileArr="fileListFile"
:fileType="fileType" :fileType="fileType"
:disabled="checkLock"
/> />
<el-input v-show="false" disabled v-model="form.enclosure"></el-input> <el-input v-show="false" disabled v-model="form.enclosure"></el-input>
</el-form-item> </el-form-item>
...@@ -133,6 +146,9 @@ export default { ...@@ -133,6 +146,9 @@ export default {
courseId: { courseId: {
type: Number, type: Number,
}, },
checkLock:{
type:Boolean,
}
}, },
components: { components: {
Editor, Editor,
...@@ -204,8 +220,16 @@ export default { ...@@ -204,8 +220,16 @@ export default {
getLessonById(this.courseId).then((res) => { getLessonById(this.courseId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
const data = res.data; const data = res.data;
const { courseName, courseType, courseConent, video, enclosure,duration,testStartTime,testEndTime } = const {
data; courseName,
courseType,
courseConent,
video,
enclosure,
duration,
testStartTime,
testEndTime,
} = data;
this.form = { this.form = {
courseName, courseName,
courseType, courseType,
...@@ -214,21 +238,22 @@ export default { ...@@ -214,21 +238,22 @@ export default {
enclosure, enclosure,
duration, duration,
testStartTime, testStartTime,
testEndTime testEndTime,
}; };
this.fileListVideo = [ console.log('video',video)
this.fileListVideo = video? [
{ {
name: courseName + "视频", name: courseName + "视频",
url: uploadfile, url: uploadfile,
}, },
]; ]:[];
this.fileListFile = [ this.fileListFile = [
{ {
name: courseName + "附件", name: courseName + "附件",
url: uploadfile, url: uploadfile,
}, },
]; ];
console.log("--",this.fileListFile); console.log("--", this.fileListFile);
} }
}); });
}, },
...@@ -280,14 +305,18 @@ export default { ...@@ -280,14 +305,18 @@ export default {
message: "保存课程成功", message: "保存课程成功",
type: "success", type: "success",
}); });
// 隐藏dia
this.$parent.$parent.dialogCancel()
} else if (num == 3) { } else if (num == 3) {
this.$message({ this.$message({
message: "保存课程成功,请开始录入题目", message: "保存课程成功,请开始录入题目",
type: "success", type: "success",
}); });
// 跳转动态路由,并且把ID改变添加用
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.changeCourseId(courseId);
} }
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.changeCourseId(courseId);
this.$parent.$parent.$parent.getList(); this.$parent.$parent.$parent.getList();
return true; return true;
...@@ -307,7 +336,7 @@ export default { ...@@ -307,7 +336,7 @@ export default {
.form-wrapper { .form-wrapper {
padding-top: 22px; padding-top: 22px;
width: 100%; width: 100%;
height: 650px; height: 680px;
overflow: hidden; overflow: hidden;
// padding-bottom: 10px; // padding-bottom: 10px;
margin-bottom: 20px; margin-bottom: 20px;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05 * @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-13 16:26:33 * @LastEditTime: 2023-02-02 10:05:15
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue * @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -71,12 +71,21 @@ ...@@ -71,12 +71,21 @@
<div class="right"> <div class="right">
<div> <div>
<el-button <el-button
v-if="!checkLock"
@click="edit(item.topicId)" @click="edit(item.topicId)"
icon="el-icon-edit" icon="el-icon-edit"
type="text" type="text"
>修改</el-button >修改</el-button
> >
<el-button <el-button
v-if="checkLock"
@click="edit(item.topicId)"
icon="el-icon-edit"
type="text"
>查看</el-button
>
<el-button
v-if="!checkLock"
@click="deleteLesson(item.topicId)" @click="deleteLesson(item.topicId)"
icon="el-icon-delete" icon="el-icon-delete"
type="text" type="text"
...@@ -98,6 +107,7 @@ ...@@ -98,6 +107,7 @@
v-model="bottomFrom.singleChoiceScore" v-model="bottomFrom.singleChoiceScore"
style="width: 50px" style="width: 50px"
size="mini" size="mini"
:disabled="checkLock"
></el-input> ></el-input>
</div> </div>
<div></div> <div></div>
...@@ -109,6 +119,7 @@ ...@@ -109,6 +119,7 @@
v-model="bottomFrom.multipleChoiceScore" v-model="bottomFrom.multipleChoiceScore"
style="width: 50px" style="width: 50px"
size="mini" size="mini"
:disabled="checkLock"
></el-input> ></el-input>
</div> </div>
<div></div> <div></div>
...@@ -121,6 +132,7 @@ ...@@ -121,6 +132,7 @@
v-model="bottomFrom.judgmentScore" v-model="bottomFrom.judgmentScore"
style="width: 50px" style="width: 50px"
size="mini" size="mini"
:disabled="checkLock"
></el-input> ></el-input>
</div> </div>
<div></div> <div></div>
...@@ -133,6 +145,7 @@ ...@@ -133,6 +145,7 @@
v-model="bottomFrom.qualifiedNum" v-model="bottomFrom.qualifiedNum"
style="width: 60px" style="width: 60px"
size="mini" size="mini"
:disabled="checkLock"
></el-input> ></el-input>
</div> </div>
<div>为合格</div> <div>为合格</div>
...@@ -144,6 +157,7 @@ ...@@ -144,6 +157,7 @@
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
type="success" type="success"
:disabled="checkLock"
>保存</el-button >保存</el-button
> >
</div> </div>
...@@ -164,6 +178,9 @@ export default { ...@@ -164,6 +178,9 @@ export default {
courseId: { courseId: {
type: Number, type: Number,
}, },
checkLock: {
type: Boolean,
},
}, },
components: {}, components: {},
data() { data() {
...@@ -293,10 +310,10 @@ export default { ...@@ -293,10 +310,10 @@ export default {
// 如果有一个没写,就不允许保存 // 如果有一个没写,就不允许保存
if ( if (
!( !(
this.bottomFrom.singleChoiceScore > 0 && this.bottomFrom.singleChoiceScore >= 0 &&
this.bottomFrom.multipleChoiceScore > 0 && this.bottomFrom.multipleChoiceScore >= 0 &&
this.bottomFrom.judgmentScore > 0 && this.bottomFrom.judgmentScore >= 0 &&
this.fobottomFromrm.qualifiedNum > 0 this.bottomFrom.qualifiedNum >= 0
) )
) { ) {
this.$message({ this.$message({
......
...@@ -131,11 +131,13 @@ ...@@ -131,11 +131,13 @@
prop="topicNum" prop="topicNum"
width="180" width="180"
> >
<template v-slot="{ row: { topicNum, courseId } }"> <template v-slot="{ row: { topicNum, courseId, status } }">
<div @click="checkQuestion(courseId)" class="timuNum"> <span @click="checkQuestion(courseId, status)" class="timuNum">
<div v-if="topicNum > 0">{{ `已录入${topicNum}题` }}</div> <span v-if="topicNum > 0">
<div v-else>未录入</div> {{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</div> </span>
<span v-else>未录入</span>
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -153,6 +155,14 @@ ...@@ -153,6 +155,14 @@
@click="changeLesson(courseId)" @click="changeLesson(courseId)"
>修改</el-button >修改</el-button
> >
<el-button
v-if="status == 1"
size="mini"
type="text"
icon="el-icon-edit"
@click="checkLesson(courseId)"
>详情</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -165,7 +175,7 @@ ...@@ -165,7 +175,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="issueLesson(courseId)" @click="issueDilog(courseId)"
>发布</el-button >发布</el-button
> >
</template> </template>
...@@ -183,18 +193,68 @@ ...@@ -183,18 +193,68 @@
ref="Dia" ref="Dia"
:componentsNum.sync="componentsNum" :componentsNum.sync="componentsNum"
:courseId.sync="courseId" :courseId.sync="courseId"
:checkLock.sync="checkLock"
:visible.sync="dilogFlag" :visible.sync="dilogFlag"
/> />
<el-dialog title="发布详情" :visible.sync="issueVisible" width="60%">
<div class="detail flex">
<div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span
>/,<span>{{ danxs }}</span
>题,计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore
}}</span
>
</div>
<div class="detail-item">
多选题<span>{{ bottomFrom.multipleChoiceScore }}</span
>/,<span>{{ duoxs }}</span> 题,计<span class="textC">{{
duoxs * bottomFrom.multipleChoiceScore
}}</span
>
</div>
<div class="detail-item">
判断提<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
<div class="detail-item">
一共<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore
}}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button>
<el-button type="primary" @click="issueLesson(issueCourseId)"
>确认发布</el-button
>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
getQuestion,
getLessons, getLessons,
getLessonById, getLessonById,
issue, issue,
deleteLesson, deleteLesson,
} from "@/api/educationPlanExam/lessonsProgram.js"; } from "@/api/educationPlanExam/lessonsProgram.js";
// 获取培训计划 // 获取培训计划
import { getPlanList } from "@/api/educationPlanExam/trainingProgram"; import { getPlanList } from "@/api/educationPlanExam/trainingProgram";
import { mapGetters, mapMutations } from "vuex"; import { mapGetters, mapMutations } from "vuex";
...@@ -222,18 +282,39 @@ export default { ...@@ -222,18 +282,39 @@ export default {
courseName: null, courseName: null,
releaseTime: "", releaseTime: "",
}, },
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
dilogFlag: false, dilogFlag: false,
// 发布弹框
issueVisible: false,
bottomFrom: {
singleChoiceScore: 0,
multipleChoiceScore: 0,
judgmentScore: 0,
qualifiedNum: 0,
},
issueCourseId: null,
questionList: [],
componentsNum: 1, componentsNum: 1,
// 点击的id,如果是新增为空 // 点击的id,如果是新增为空
courseId: null, courseId: null,
// false为编辑,true为查看,查看不允许编辑的时候
checkLock: false,
}; };
}, },
computed: { computed: {
...mapGetters(["courseOptions"]), ...mapGetters(["courseOptions"]),
danxs() {
return this.questionList.filter((item) => item.topicType === 1).length;
},
duoxs() {
return this.questionList.filter((item) => item.topicType === 2).length;
},
pds() {
return this.questionList.filter((item) => item.topicType === 3).length;
},
}, },
created() { created() {
this.getPlanList(); this.getPlanList();
...@@ -275,21 +356,34 @@ export default { ...@@ -275,21 +356,34 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.checkLock = false;
this.$refs.Dia.title = "新增培训课程"; this.$refs.Dia.title = "新增培训课程";
this.componentsNum = 1; this.componentsNum = 1;
this.courseId = null; this.courseId = null;
this.dilogFlag = true; this.dilogFlag = true;
}, },
changeLesson(courseId) { changeLesson(courseId) {
this.checkLock = false;
this.$refs.Dia.title = "修改培训课程"; this.$refs.Dia.title = "修改培训课程";
this.componentsNum = 1; this.componentsNum = 1;
this.courseId = courseId; this.courseId = courseId;
this.dilogFlag = true; this.dilogFlag = true;
}, },
checkLesson(courseId) {
this.checkLock = true;
this.$refs.Dia.title = "查看培训课程";
this.componentsNum = 1;
this.courseId = courseId;
this.dilogFlag = true;
},
// 直接查看考题 // 直接查看考题
checkQuestion(courseId) { checkQuestion(courseId, status) {
// 要查看考题的id // 要查看考题的id
if (status == 1) {
this.checkLock = true;
}
this.courseId = courseId; this.courseId = courseId;
console.log(this.courseId); console.log(this.courseId);
// 2代表列表组件 // 2代表列表组件
...@@ -331,9 +425,39 @@ export default { ...@@ -331,9 +425,39 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
// 发布弹框
issueDilog(courseId) {
getQuestion({courseId})
.then((res) => {
this.questionList = res.rows.map((item) => {
return {
topicType: item.topicType,
topicId: item.topicId,
topicTitle: item.topicTitle,
};
});
})
.then((res) => {
return getLessonById(courseId);
})
.then((res) => {
this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore,
multipleChoiceScore: res.data.multipleChoiceScore,
judgmentScore: res.data.judgmentScore,
qualifiedNum: res.data.qualifiedNum,
};
})
.then((res) => {
this.issueVisible = true;
this.issueCourseId = courseId;
});
//
},
// 发布 // 发布
issueLesson(courseId) { issueLesson(courseId) {
this.$confirm("请确定发布", { this.$confirm("确定要发布吗", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
...@@ -343,14 +467,14 @@ export default { ...@@ -343,14 +467,14 @@ export default {
return getLessonById(courseId); return getLessonById(courseId);
}) })
.then((res) => { .then((res) => {
if ( // if (
res.data.singleChoiceScore > 0 && // res.data.singleChoiceScore >= 0 &&
res.data.multipleChoiceScore > 0 && // res.data.multipleChoiceScore >= 0 &&
res.data.judgmentScore > 0 && // res.data.judgmentScore >= 0 &&
res.data.qualifiedNum > 0 // res.data.qualifiedNum >= 0
) { // ) {
return true; return true;
} // }
}) })
.then((res) => { .then((res) => {
if (res) { if (res) {
...@@ -370,6 +494,7 @@ export default { ...@@ -370,6 +494,7 @@ export default {
type: "success", type: "success",
}); });
this.getList(); this.getList();
this.issueVisible = false;
} }
}) })
.catch(() => {}); .catch(() => {});
...@@ -469,4 +594,17 @@ export default { ...@@ -469,4 +594,17 @@ export default {
::v-deep .el-dialog { ::v-deep .el-dialog {
margin-top: 15vh !important; margin-top: 15vh !important;
} }
.detail {
// position: absolute;
// bottom: -20px;
// left: 10px;
.textC {
font-weight: 800;
font-size: 18px;
}
.detail-item {
margin-right: 20px;
color: red;
}
}
</style> </style>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
v-if="index > 0" v-if="index > 0 && form.topicType != 3"
@click.prevent="removeDomain(question)" @click.prevent="removeDomain(question)"
>删除</el-button >删除</el-button
> >
......
...@@ -11,9 +11,15 @@ ...@@ -11,9 +11,15 @@
size="mini" size="mini"
@input="topicTypeChange" @input="topicTypeChange"
> >
<el-radio-button :label="1">单选</el-radio-button> <el-radio-button :disabled="checkLock" :label="1"
<el-radio-button :label="2">多选</el-radio-button> >单选</el-radio-button
<el-radio-button :label="3">判断</el-radio-button> >
<el-radio-button :disabled="checkLock" :label="2"
>多选</el-radio-button
>
<el-radio-button :disabled="checkLock" :label="3"
>判断</el-radio-button
>
</el-radio-group> </el-radio-group>
</div> </div>
<div class="right">{{ courseName }}</div> <div class="right">{{ courseName }}</div>
...@@ -28,7 +34,7 @@ ...@@ -28,7 +34,7 @@
:rules="{ :rules="{
required: true, required: true,
message: '必须输入题目内容', message: '必须输入题目内容',
trigger: 'blur', trigger: ['blur', 'change'],
}" }"
> >
<el-input <el-input
...@@ -37,6 +43,7 @@ ...@@ -37,6 +43,7 @@
resize="none" resize="none"
rows="4" rows="4"
v-model="form.topicTitle" v-model="form.topicTitle"
:disabled="checkLock"
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -54,7 +61,7 @@ ...@@ -54,7 +61,7 @@
:rules="{ :rules="{
required: true, required: true,
message: '第一项不能为空不能为空', message: '第一项不能为空不能为空',
trigger: 'blur', trigger: ['blur', 'change'],
}" }"
> >
<div class="add-select flex"> <div class="add-select flex">
...@@ -64,6 +71,7 @@ ...@@ -64,6 +71,7 @@
style="flex: 1; margin-right: 10px" style="flex: 1; margin-right: 10px"
rows="2" rows="2"
v-model="question.value" v-model="question.value"
:disabled="checkLock"
></el-input> ></el-input>
<div class="flex algin-items"> <div class="flex algin-items">
<div <div
...@@ -76,8 +84,9 @@ ...@@ -76,8 +84,9 @@
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
v-if="index > 0" v-if="index > 0 && form.topicType != 3"
@click.prevent="removeDomain(question)" @click.prevent="removeDomain(question)"
:disabled="checkLock"
>删除</el-button >删除</el-button
> >
</div> </div>
...@@ -108,7 +117,11 @@ ...@@ -108,7 +117,11 @@
设为正确答案 设为正确答案
</div> --> </div> -->
<div style="padding-left: 30px"> <div style="padding-left: 30px">
<el-button size="mini" type="primary" @click.prevent="add(addValue)" <el-button
size="mini"
type="primary"
@click.prevent="add(addValue)"
:disabled="checkLock"
>新增选项</el-button >新增选项</el-button
> >
</div> </div>
...@@ -143,6 +156,9 @@ export default { ...@@ -143,6 +156,9 @@ export default {
topicId: { topicId: {
type: Number, type: Number,
}, },
checkLock: {
type: Boolean,
},
}, },
components: {}, components: {},
data() { data() {
...@@ -229,6 +245,7 @@ export default { ...@@ -229,6 +245,7 @@ export default {
} }
}, },
rightAnswerClick(index) { rightAnswerClick(index) {
if (this.checkLock) return;
if (this.form.topicType === 2) { if (this.form.topicType === 2) {
const ind = this.answerNum.indexOf(index); const ind = this.answerNum.indexOf(index);
if (ind < 0) { if (ind < 0) {
...@@ -247,6 +264,7 @@ export default { ...@@ -247,6 +264,7 @@ export default {
}, },
// 删除选项 // 删除选项
removeDomain(question) { removeDomain(question) {
if (this.checkLock) return;
const index = this.form.questions.indexOf(question); const index = this.form.questions.indexOf(question);
console.log(index); console.log(index);
// 如果是正确答案,就让正确答案清空 // 如果是正确答案,就让正确答案清空
...@@ -333,9 +351,9 @@ export default { ...@@ -333,9 +351,9 @@ export default {
reset() { reset() {
this.form = { this.form = {
topicTitle: "", topicTitle: "",
questions: [{ value: "" }, { value: "" }, { value: "" }], questions: [{ value: "" }, { value: "" }],
}; };
this.answerNum = null; this.answerNum = [];
this.addValue = ""; this.addValue = "";
}, },
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 09:30:19 * @Date: 2022-12-27 09:30:19
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-28 10:29:18 * @LastEditTime: 2023-02-01 18:02:14
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangeQuestion.vue * @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangeQuestion.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -193,7 +193,7 @@ export default { ...@@ -193,7 +193,7 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
saveAndNext() { save(num = 2) {
const topicInfos = this.list const topicInfos = this.list
.filter((item) => item.checked) .filter((item) => item.checked)
.map((item) => { .map((item) => {
...@@ -202,18 +202,20 @@ export default { ...@@ -202,18 +202,20 @@ export default {
quan: item.changeNum, quan: item.changeNum,
}; };
}); });
console.log(this.courseId, topicInfos); console.log(this.courseId, topicInfos);
const data = { courseId: this.courseId, topicInfos }; const data = { courseId: this.courseId, topicInfos };
console.log(data); console.log(data);
bachAddTopic(data).then((res) => { bachAddTopic(data).then((res) => {
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.$parent.$parent.componentsNumChange(2); this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.$parent.getList(); this.$parent.$parent.$parent.getList();
} }
}); });
}, },
saveAndNext() {
this.save(3);
},
resetClick() {}, resetClick() {},
search() { search() {
this.getList(); this.getList();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49 * @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-28 10:31:06 * @LastEditTime: 2023-02-01 17:34:25
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue * @FilePath: /danger-manage-web/src/views/lessonsProgram/components/addLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
:is="currentComponent" :is="currentComponent"
:courseId.sync="courseId" :courseId.sync="courseId"
:topicId.sync="topicId" :topicId.sync="topicId"
:checkLock="checkLock"
ref="current" ref="current"
></component> ></component>
</transition> </transition>
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
<QuestionList/> --> <QuestionList/> -->
</div> </div>
<div slot="footer" class="dialog-footer"> <!-- <div slot="footer" class="dialog-footer">
<el-button <el-button
type="primary" type="primary"
v-if="this.componentsNum == 2" v-if="this.componentsNum == 2"
...@@ -62,6 +63,51 @@ ...@@ -62,6 +63,51 @@
>{{ "确认" }}</el-button >{{ "确认" }}</el-button
> >
<el-button @click="dialogCancel">取消</el-button> <el-button @click="dialogCancel">取消</el-button>
</div> -->
<div slot="footer" class="dialog-footer" v-if="!checkLock">
<el-button
type="primary"
v-if="this.componentsNum == 2 && !checkLock"
@click="componentsNumChange(4)"
>从题库选择</el-button
>
<el-button
type="primary"
v-if="this.componentsNum == 4 || this.componentsNum == 3"
@click="componentsNumChange(2)"
>返回题目列表</el-button
>
<el-button
type="primary"
v-if="
this.componentsNum == 1 ||
this.componentsNum == 3 ||
this.componentsNum == 4
"
@click="save"
>保存</el-button
>
<el-button type="primary" @click="saveAndNext" v-if="!checkLock">{{
saveNextText
}}</el-button>
<el-button
v-if="this.componentsNum == 2"
type="primary"
@click="dialogCancel"
>{{ "确认" }}</el-button
>
<el-button @click="dialogCancel">取消</el-button>
</div>
<div slot="footer" class="dialog-footer" v-else>
<el-button
type="primary"
v-if="this.componentsNum == 3 && checkLock"
@click="componentsNumChange(2)"
>返回题目列表</el-button
>
<el-button type="primary" @click="dialogCancel">{{ "确认" }}</el-button>
<el-button @click="dialogCancel">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
...@@ -86,6 +132,9 @@ export default { ...@@ -86,6 +132,9 @@ export default {
courseId: { courseId: {
type: Number, type: Number,
}, },
checkLock: {
type: Boolean,
},
}, },
// components: { // components: {
// Lesson, // Lesson,
...@@ -137,11 +186,9 @@ export default { ...@@ -137,11 +186,9 @@ export default {
text = "保存并录入题目"; text = "保存并录入题目";
} else if (this.componentsNum == 2) { } else if (this.componentsNum == 2) {
text = "录入考题"; text = "录入考题";
} else if (this.componentsNum == 3) { } else {
text = "保存并录入下一题"; text = "保存并录入下一题";
} else { }
text = "确定选择";
}
return text; return text;
}, },
}, },
...@@ -168,6 +215,7 @@ export default { ...@@ -168,6 +215,7 @@ export default {
this.topicId = null; this.topicId = null;
} }
this.$emit("update:visible", false); this.$emit("update:visible", false);
this.$emit("update:checkLock", false);
}, },
// 把ID改变了 // 把ID改变了
changeCourseId(courseId) { changeCourseId(courseId) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44 * @Date: 2022-09-22 10:59:44
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-26 16:31:34 * @LastEditTime: 2023-02-01 16:58:26
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue * @FilePath: /danger-manage-web/src/views/lessonsProgram/components/Lession.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -16,7 +16,11 @@ ...@@ -16,7 +16,11 @@
:rules="rules" :rules="rules"
> >
<el-form-item label="考试标题" prop="courseName"> <el-form-item label="考试标题" prop="courseName">
<el-input style="width: 700px" v-model="form.courseName"></el-input> <el-input
:disabled="checkLock"
style="width: 700px"
v-model="form.courseName"
></el-input>
</el-form-item> </el-form-item>
<div class="top flex"> <div class="top flex">
<el-form-item label="开始时间" prop="testStartTime"> <el-form-item label="开始时间" prop="testStartTime">
...@@ -27,6 +31,7 @@ ...@@ -27,6 +31,7 @@
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
default-time="00:00:00" default-time="00:00:00"
:disabled="checkLock"
/> />
</el-form-item> </el-form-item>
<el-form-item label="结束时间" prop="testEndTime"> <el-form-item label="结束时间" prop="testEndTime">
...@@ -36,6 +41,7 @@ ...@@ -36,6 +41,7 @@
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
default-time="00:00:00" default-time="00:00:00"
:disabled="checkLock"
/> />
</el-form-item> </el-form-item>
</div> </div>
...@@ -43,6 +49,7 @@ ...@@ -43,6 +49,7 @@
<ChangePapel <ChangePapel
ref="changePaple" ref="changePaple"
:jsonSelectNameList="jsonSelectNameList" :jsonSelectNameList="jsonSelectNameList"
:disabled="checkLock"
@getPeopleList="getPeopleList" @getPeopleList="getPeopleList"
/> />
</el-form-item> </el-form-item>
...@@ -70,6 +77,9 @@ export default { ...@@ -70,6 +77,9 @@ export default {
courseId: { courseId: {
type: Number, type: Number,
}, },
checkLock: {
type: Boolean,
},
}, },
components: { components: {
// Editor, // Editor,
...@@ -196,14 +206,17 @@ export default { ...@@ -196,14 +206,17 @@ export default {
message: "保存课程成功", message: "保存课程成功",
type: "success", type: "success",
}); });
this.$parent.$parent.dialogCancel();
} else if (num == 3) { } else if (num == 3) {
this.$message({ this.$message({
message: "保存课程成功,请开始录入题目", message: "保存课程成功,请开始录入题目",
type: "success", type: "success",
}); });
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.changeCourseId(courseId);
} }
this.$parent.$parent.componentsNumChange(num); // this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.changeCourseId(courseId); // this.$parent.$parent.changeCourseId(courseId);
this.$parent.$parent.$parent.getList(); this.$parent.$parent.$parent.getList();
return true; return true;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05 * @Date: 2022-09-22 17:56:05
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-13 16:26:00 * @LastEditTime: 2023-02-01 17:45:09
* @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue * @FilePath: /danger-manage-web/src/views/lessonsProgram/components/QuestionList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -34,13 +34,15 @@ ...@@ -34,13 +34,15 @@
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断提<span>{{ bottomFrom.judgmentScore }}</span>/题,共<span>{{ pds }}</span> 题,计<span 判断提<span>{{ bottomFrom.judgmentScore }}</span
class="textC" >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
>{{ pds * bottomFrom.judgmentScore }}</span pds * bottomFrom.judgmentScore
}}</span
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
一共<span>{{ danxs + duoxs + pds }}</span>道题,总共计<span class="textC">{{ 一共<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore + danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore + duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
...@@ -70,12 +72,21 @@ ...@@ -70,12 +72,21 @@
<div class="right"> <div class="right">
<div> <div>
<el-button <el-button
v-if="!checkLock"
@click="edit(item.topicId)" @click="edit(item.topicId)"
icon="el-icon-edit" icon="el-icon-edit"
type="text" type="text"
>修改</el-button >修改</el-button
> >
<el-button <el-button
v-if="checkLock"
@click="edit(item.topicId)"
icon="el-icon-edit"
type="text"
>查看</el-button
>
<el-button
v-if="!checkLock"
@click="deleteLesson(item.topicId)" @click="deleteLesson(item.topicId)"
icon="el-icon-delete" icon="el-icon-delete"
type="text" type="text"
...@@ -106,6 +117,7 @@ ...@@ -106,6 +117,7 @@
v-model="bottomFrom.singleChoiceScore" v-model="bottomFrom.singleChoiceScore"
style="width: 50px" style="width: 50px"
size="mini" size="mini"
:disabled="checkLock"
></el-input> ></el-input>
</div> </div>
<div></div> <div></div>
...@@ -117,6 +129,7 @@ ...@@ -117,6 +129,7 @@
v-model="bottomFrom.multipleChoiceScore" v-model="bottomFrom.multipleChoiceScore"
style="width: 50px" style="width: 50px"
size="mini" size="mini"
:disabled="checkLock"
></el-input> ></el-input>
</div> </div>
<div></div> <div></div>
...@@ -129,6 +142,7 @@ ...@@ -129,6 +142,7 @@
v-model="bottomFrom.judgmentScore" v-model="bottomFrom.judgmentScore"
style="width: 50px" style="width: 50px"
size="mini" size="mini"
:disabled="checkLock"
></el-input> ></el-input>
</div> </div>
<div></div> <div></div>
...@@ -141,6 +155,7 @@ ...@@ -141,6 +155,7 @@
v-model="bottomFrom.qualifiedNum" v-model="bottomFrom.qualifiedNum"
style="width: 60px" style="width: 60px"
size="mini" size="mini"
:disabled="checkLock"
></el-input> ></el-input>
</div> </div>
<div>为合格</div> <div>为合格</div>
...@@ -151,6 +166,7 @@ ...@@ -151,6 +166,7 @@
icon="el-icon-check" icon="el-icon-check"
size="mini" size="mini"
type="success" type="success"
:disabled="checkLock"
>保存</el-button >保存</el-button
> >
</div> </div>
...@@ -171,6 +187,9 @@ export default { ...@@ -171,6 +187,9 @@ export default {
courseId: { courseId: {
type: Number, type: Number,
}, },
checkLock: {
type: Boolean,
},
}, },
components: {}, components: {},
data() { data() {
...@@ -297,10 +316,10 @@ export default { ...@@ -297,10 +316,10 @@ export default {
// } // }
if ( if (
!( !(
this.bottomFrom.singleChoiceScore > 0 && this.bottomFrom.singleChoiceScore >= 0 &&
this.bottomFrom.multipleChoiceScore > 0 && this.bottomFrom.multipleChoiceScore >= 0 &&
this.bottomFrom.judgmentScore > 0 && this.bottomFrom.judgmentScore >= 0 &&
this.bottomFrom.qualifiedNum > 0 this.bottomFrom.qualifiedNum >= 0
) )
) { ) {
this.$message({ this.$message({
......
...@@ -82,15 +82,17 @@ ...@@ -82,15 +82,17 @@
prop="topicNum" prop="topicNum"
width="180" width="180"
> >
<template v-slot="{ row: { topicNum, courseId } }"> <template v-slot="{ row: { topicNum, courseId, status } }">
<div class="timuNum"> <span class="timuNum" @click="checkQuestion(courseId, status)">
<div v-if="topicNum > 0">{{ `已录入${topicNum}题` }}</div> <span v-if="topicNum > 0">
<div v-else>未录入</div> {{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</div> </span>
<span v-else>未录入</span>
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="答对几题算合格" label="合格分数"
align="center" align="center"
prop="qualifiedNum" prop="qualifiedNum"
:formatter="formatter" :formatter="formatter"
...@@ -102,17 +104,15 @@ ...@@ -102,17 +104,15 @@
> >
<template v-slot="{ row: { status, courseId, qualifiedNum } }"> <template v-slot="{ row: { status, courseId, qualifiedNum } }">
<!-- <div>{{status}}</div> --> <!-- <div>{{status}}</div> -->
<el-button <!-- <el-button
:disabled="status == 1"
v-if="status == 0" v-if="status == 0"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="checkQuestion(courseId)" @click="checkQuestion(courseId)"
>录入考题</el-button >录入考题</el-button
> > -->
<el-button <el-button
:disabled="status == 1"
v-if="status == 0" v-if="status == 0"
size="mini" size="mini"
type="text" type="text"
...@@ -120,6 +120,14 @@ ...@@ -120,6 +120,14 @@
@click="changeLesson(courseId)" @click="changeLesson(courseId)"
>编辑</el-button >编辑</el-button
> >
<el-button
v-if="status == 1"
size="mini"
type="text"
icon="el-icon-edit"
@click="checkLesson(courseId)"
>详情</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -128,13 +136,12 @@ ...@@ -128,13 +136,12 @@
>删除</el-button >删除</el-button
> >
<el-button <el-button
:disabled="status == 1"
v-if="status == 0" v-if="status == 0"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="issueLesson(courseId, qualifiedNum)" @click="issueDilog(courseId)"
>发布考试</el-button >发布</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
...@@ -151,16 +158,62 @@ ...@@ -151,16 +158,62 @@
ref="Dia" ref="Dia"
:componentsNum.sync="componentsNum" :componentsNum.sync="componentsNum"
:courseId.sync="courseId" :courseId.sync="courseId"
:checkLock.sync="checkLock"
:visible.sync="dilogFlag" :visible.sync="dilogFlag"
/> />
<el-dialog title="提示" :visible.sync="issue" width="30%"> <el-dialog title="发布详情" :visible.sync="issueVisible" width="60%">
<div>123</div> <div class="detail flex">
<div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span
>/,<span>{{ danxs }}</span
>题,计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore
}}</span
>
</div>
<div class="detail-item">
多选题<span>{{ bottomFrom.multipleChoiceScore }}</span
>/,<span>{{ duoxs }}</span> 题,计<span class="textC">{{
duoxs * bottomFrom.multipleChoiceScore
}}</span
>
</div>
<div class="detail-item">
判断提<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
<div class="detail-item">
一共<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore
}}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button>
<el-button type="primary" @click="issueLesson(issueCourseId)"
>确认发布</el-button
>
</span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
getQuestion,
getLessons, getLessons,
getLessonById, getLessonById,
issue, issue,
...@@ -200,14 +253,36 @@ export default { ...@@ -200,14 +253,36 @@ export default {
// 表单校验 // 表单校验
dilogFlag: false, dilogFlag: false,
// 发布
issueVisible: false,
bottomFrom: {
singleChoiceScore: 0,
multipleChoiceScore: 0,
judgmentScore: 0,
qualifiedNum: 0,
},
issueCourseId: null,
questionList: [],
componentsNum: 1, componentsNum: 1,
// 点击的id,如果是新增为空 // 点击的id,如果是新增为空
courseId: null, courseId: null,
issue: false, issue: false,
// false为编辑,true为查看,查看不允许编辑的时候
checkLock: false,
}; };
}, },
computed: { computed: {
...mapGetters(["courseOptions"]), ...mapGetters(["courseOptions"]),
danxs() {
return this.questionList.filter((item) => item.topicType === 1).length;
},
duoxs() {
return this.questionList.filter((item) => item.topicType === 2).length;
},
pds() {
return this.questionList.filter((item) => item.topicType === 3).length;
},
}, },
created() { created() {
// this.getPlanList(); // this.getPlanList();
...@@ -257,12 +332,22 @@ export default { ...@@ -257,12 +332,22 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.checkLock = false;
this.$refs.Dia.title = "新增考试试卷"; this.$refs.Dia.title = "新增考试试卷";
this.componentsNum = 1; this.componentsNum = 1;
this.courseId = null; this.courseId = null;
this.dilogFlag = true; this.dilogFlag = true;
}, },
changeLesson(courseId) { changeLesson(courseId) {
this.checkLock = false;
this.$refs.Dia.title = "修改考试试卷";
this.componentsNum = 1;
this.courseId = courseId;
this.dilogFlag = true;
},
checkLesson(courseId) {
this.checkLock = true;
this.$refs.Dia.title = "修改考试试卷"; this.$refs.Dia.title = "修改考试试卷";
this.componentsNum = 1; this.componentsNum = 1;
this.courseId = courseId; this.courseId = courseId;
...@@ -270,8 +355,12 @@ export default { ...@@ -270,8 +355,12 @@ export default {
}, },
// 直接查看考题 // 直接查看考题
checkQuestion(courseId) { checkQuestion(courseId, status) {
// 要查看考题的id // 要查看考题的id
if (status == 1) {
this.checkLock = true;
}
this.courseId = courseId; this.courseId = courseId;
console.log(this.courseId); console.log(this.courseId);
// 2代表列表组件 // 2代表列表组件
...@@ -315,8 +404,39 @@ export default { ...@@ -315,8 +404,39 @@ export default {
.catch(() => {}); .catch(() => {});
}, },
// 发布 // 发布
issueLesson(courseId, qualifiedNum) { issueDilog(courseId) {
this.$confirm("请确定发布", { getQuestion({courseId})
.then((res) => {
console.log(res)
this.questionList = res.rows.map((item) => {
return {
topicType: item.topicType,
topicId: item.topicId,
topicTitle: item.topicTitle,
};
});
})
.then((res) => {
return getLessonById(courseId);
})
.then((res) => {
this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore ||0,
multipleChoiceScore: res.data.multipleChoiceScore||0,
judgmentScore: res.data.judgmentScore||0,
qualifiedNum: res.data.qualifiedNum||0,
};
})
.then((res) => {
this.issueVisible = true;
this.issueCourseId = courseId;
});
//
},
issueLesson(courseId) {
this.$confirm("确定要发布吗", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
...@@ -326,14 +446,14 @@ export default { ...@@ -326,14 +446,14 @@ export default {
return getLessonById(courseId); return getLessonById(courseId);
}) })
.then((res) => { .then((res) => {
if ( // if (
res.data.singleChoiceScore > 0 && // res.data.singleChoiceScore > 0 &&
res.data.multipleChoiceScore > 0 && // res.data.multipleChoiceScore > 0 &&
res.data.judgmentScore > 0 && // res.data.judgmentScore > 0 &&
res.data.qualifiedNum > 0 // res.data.qualifiedNum > 0
) { // ) {
return true; return true;
} // }
}) })
.then((res) => { .then((res) => {
if (res) { if (res) {
...@@ -355,6 +475,7 @@ export default { ...@@ -355,6 +475,7 @@ export default {
type: "success", type: "success",
}); });
this.getList(); this.getList();
this.issueVisible = false;
} }
}) })
.catch(() => {}); .catch(() => {});
...@@ -373,7 +494,7 @@ export default { ...@@ -373,7 +494,7 @@ export default {
} }
.timuNum { .timuNum {
color: #1d84ff; color: #1d84ff;
// cursor: pointer; cursor: pointer;
} }
::v-deep .el-select { ::v-deep .el-select {
width: 100%; width: 100%;
...@@ -381,4 +502,17 @@ export default { ...@@ -381,4 +502,17 @@ export default {
::v-deep .el-dialog { ::v-deep .el-dialog {
margin-top: 15vh !important; margin-top: 15vh !important;
} }
.detail {
// position: absolute;
// bottom: -20px;
// left: 10px;
.textC {
font-weight: 800;
font-size: 18px;
}
.detail-item {
margin-right: 20px;
color: red;
}
}
</style> </style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 09:30:19
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-29 14:52:33
* @FilePath: /danger-manage-web/src/views/educationPlanExam/textPaper/components/ChangeQuestion.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="table-wrapper">
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="所属单位" prop="deptId" ref="treeItem">
<Treeselect
class="tree"
v-model="queryParams.deptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择归属部门"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="题库名称" prop="bankName">
<el-input
v-model="queryParams.bankName"
placeholder="考试时间"
clearable
size="small"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="search"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetClick"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" height="435" ref="multipleTable">
<!-- <el-table-column type="selection"></el-table-column> -->
<el-table-column label="" align="center" prop="profession">
<template v-slot="{ row }">
<!-- <div> -->
<el-checkbox
:disabled="row.numberQuestions == 0"
v-model="row.checked"
></el-checkbox>
<!-- </div> -->
</template>
</el-table-column>
<el-table-column label="题库名称" align="center" prop="bankName">
</el-table-column>
<el-table-column label="所属单位" align="center" prop="courseType">
<template v-slot="scope">
<div>
{{ selectList(deptOptions, scope.row.deptId) || "-" }}
</div>
</template>
</el-table-column>
<el-table-column
label="包含题目数量"
align="center"
prop="numberQuestions"
:formatter="formatter"
>
</el-table-column>
<el-table-column label="选取题目数量" align="center" prop="profession">
<template v-slot="{ row }">
<div>
<!-- <el-input
:disabled="!row.checked|| row.numberQuestions==0 "
v-model="row.changeNum"
size="mini"
style="width: 100px"
></el-input> -->
<el-input-number
v-model="row.changeNum"
:disabled="!row.checked || row.numberQuestions == 0"
size="mini"
:min="1"
:max="+row.numberQuestions ? +row.numberQuestions : 1000000"
label="描述文字"
></el-input-number>
</div>
</template>
</el-table-column>
</el-table>
<!-- <div> -->
<el-pagination
:layout="'prev, pager, next'"
v-show="total > 0"
:total="total"
:current-page="queryParams.pageNum"
:page-sizes="[queryParams.pageSize]"
@current-change="currentChangeClick"
/>
</div>
</template>
<script>
import { listBank, delBank } from "@/api/educationPlanExam/questionBank";
import { bachAddTopicGuest } from "@/api/educationPlanExam/lessonsProgram.js";
// 部门列表
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "",
components: {
Treeselect,
},
props: {
courseId: {
type: Number,
},
},
data() {
return {
queryParams: {
deptId: null,
courseName: "",
pageNum: 1,
pageSize: 10,
},
list: [
{
checked: false,
},
],
total: 20,
loading: false,
// 题库id
deptId: null,
// 归属部门列表
deptOptions: [],
};
},
created() {
this.getList();
this.getTreeselect();
},
methods: {
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
// console.log("123", this.deptOptions);
// console.log(this.selectList(this.deptOptions, 175));
});
},
// 递归查值的方法
selectList(list, id) {
for (let i = 0; i < list.length; i++) {
let item = list[i];
if (item.id == id) {
return item.label;
} else {
if (Array.isArray(item.children)) {
let a = this.selectList(item.children, id);
if (a) {
return a;
}
}
}
}
},
getList() {
this.loading = true;
listBank(this.queryParams)
.then((res) => {
console.log(res);
this.list = res.rows.map((item, index) => {
return {
bankNum:
index +
1 +
(this.queryParams.pageNum - 1) * this.queryParams.pageSize,
checked: false,
changeNum: 0,
...item,
};
});
this.total = res.total;
})
.finally(() => {
this.loading = false;
});
},
saveAndNext() {
const topicInfos = this.list
.filter((item) => item.checked)
.map((item) => {
return {
bankId: item.bankId,
quan: item.changeNum,
};
});
console.log(this.courseId, topicInfos);
const data = { courseId: this.courseId, topicInfos };
console.log(data);
bachAddTopicGuest(data).then((res) => {
console.log(res);
if (res.code == 200) {
// this.$parent.$parent.componentsNumChange(2);
this.$parent.$parent.getContractTopicList(this.courseId);
this.$parent.$parent.dialogVisible2=false;
}
});
},
resetClick() {},
search() {
this.getList();
},
currentChangeClick() {},
formatter(row, column, cellValue, index) {
// console.log(row, column, cellValue, index);
if (!cellValue) return "-";
else return cellValue;
},
},
};
</script>
<style lang="scss" scoped>
.table-wrapper {
padding-top: 22px;
width: 100%;
height: 550px;
overflow: hidden;
// padding-bottom: 10px;
margin-bottom: 20px;
}
</style>
<template> <template>
<div class="form-wrapper"> <div class="form-wrapper">
<div style="width: 100%;height:100%;"> <div style="width: 100%; height: 100%">
<el-form :model="contractTrainForm" :rules="rules" ref="contractTrainForm" label-width="100px" class="demo-ruleForm"> <el-form
<el-form-item label="培训名称" prop="courseName"> :model="contractTrainForm"
<el-input v-model="contractTrainForm.courseName"></el-input> :rules="rules"
</el-form-item> ref="contractTrainForm"
<el-form-item label="培训内容" prop="courseConent"> label-width="100px"
<el-input type="textarea" v-model="contractTrainForm.courseConent" rows="5"></el-input> class="demo-ruleForm"
</el-form-item> >
<div class="flex"> <el-form-item label="培训名称" prop="courseName">
<el-form-item label="视频上传" v-if="!readOnly" prop="video"> <el-input v-model="contractTrainForm.courseName"></el-input>
<FileUpload </el-form-item>
listType="picture" <el-form-item label="培训内容" prop="courseConent">
@resFun="getFileInfoVideo" <el-input
@remove="listRemoveVideo" type="textarea"
:fileArr="fileListVideo" v-model="contractTrainForm.courseConent"
:fileSize="500" rows="5"
:fileType="['mp4']" ></el-input>
/> </el-form-item>
<el-input v-show="false" disabled v-model="contractTrainForm.video"></el-input> <div class="flex">
</el-form-item> <el-form-item label="视频上传" v-if="!readOnly" prop="video">
<el-form-item label="附件上传" v-if="!readOnly" prop="enclosure"> <FileUpload
<FileUpload listType="picture"
listType="picture" @resFun="getFileInfoVideo"
@resFun="getFileInfoFile" @remove="listRemoveVideo"
@remove="listRemoveFile" :fileArr="fileListVideo"
:fileArr="fileListFile" :fileSize="500"
/> :fileType="['mp4']"
<el-input v-show="false" disabled v-model="contractTrainForm.enclosure"></el-input> />
</el-form-item> <el-input
</div> v-show="false"
</el-form> disabled
v-model="contractTrainForm.video"
></el-input>
</el-form-item>
<el-form-item label="附件上传" v-if="!readOnly" prop="enclosure">
<FileUpload
listType="picture"
@resFun="getFileInfoFile"
@remove="listRemoveFile"
:fileArr="fileListFile"
/>
<el-input
v-show="false"
disabled
v-model="contractTrainForm.enclosure"
></el-input>
</el-form-item>
</div> </div>
<visitorQuestion ref="visitorQuestion"></visitorQuestion> </el-form>
</div> </div>
<visitorQuestion ref="visitorQuestion"></visitorQuestion>
</div>
</template> </template>
<script> <script>
import FileUpload from "@/components/FileUpload"; import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png"; import uploadfile from "@/assets/uploadfile.png";
import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQuestion"; import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQuestion";
import {listCourse} from "@/api/contractTrain/contractTrain"; import { listCourse } from "@/api/contractTrain/contractTrain";
export default { export default {
data() { data() {
return { return {
contractTrainForm: { contractTrainForm: {
courseName: '', courseName: "",
courseConent: '', courseConent: "",
video: "", video: "",
enclosure: "", enclosure: "",
}, },
fileListVideo: [], fileListVideo: [],
fileListFile: [], fileListFile: [],
readOnly: false, readOnly: false,
rules: { rules: {
name: [ name: [{ required: true, message: "请输入培训名称", trigger: "blur" }],
{ required: true, message: '请输入培训名称', trigger: 'blur' } region: [
], { required: true, message: "请输入培训内容", trigger: "change" },
region: [ ],
{ required: true, message: '请输入培训内容', trigger: 'change' } video: [{ required: true, trigger: "blue", message: "视频不能为空" }],
], enclosure: [
video: [ { required: true, trigger: "blur", message: "附件不能为空" },
{ required: true, trigger: "blue", message: "视频不能为空" } ],
], },
enclosure: [ };
{ required: true, trigger: "blur", message: "附件不能为空" }, },
], components: {
FileUpload,
visitorQuestion,
},
created() {
this.getContractTrainList();
},
methods: {
getContractTrainList() {
listCourse().then((res) => {
this.contractTrainForm = res.rows[0];
console.log("this.contractTrainForm", this.contractTrainForm);
if (this.contractTrainForm.video) {
this.fileListVideo = [
{
name: this.contractTrainForm.courseName + "视频",
url: uploadfile,
},
];
}
if (this.contractTrainForm.enclosure) {
this.fileListFile = [
{
name: this.contractTrainForm.courseName + "附件",
url: uploadfile,
},
];
}
// this.$refs.visitorQuestion.rightNum =
// this.contractTrainForm.qualifiedNum;
this.$refs.visitorQuestion.bottomFrom = {
judgmentScore: this.contractTrainForm.judgmentScore || 0,
multipleChoiceScore: this.contractTrainForm.multipleChoiceScore || 0,
qualifiedNum: this.contractTrainForm.qualifiedNum || 0,
singleChoiceScore: this.contractTrainForm.singleChoiceScore || 0,
};
this.$refs.visitorQuestion.getContractTopicList(
this.contractTrainForm.contractorCourseId
);
});
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
},
getFileInfoVideo(res) {
this.contractTrainForm.video = res.url;
this.fileListVideo = [
{
name: res.fileName,
url: uploadfile,
}, },
}; ];
}, },
components: { listRemoveVideo(e) {
FileUpload, this.fileListVideo = [];
visitorQuestion, this.contractTrainForm.video = "";
// this.form.videoName = null;
}, },
created() { getFileInfoFile(res) {
this.getContractTrainList(); this.contractTrainForm.enclosure = res.url;
this.fileListFile = [
{
name: res.fileName,
url: uploadfile,
},
];
}, },
methods: { listRemoveFile(e) {
getContractTrainList(){ this.fileListFild = [];
listCourse().then(res =>{ this.contractTrainForm.enclosure = "";
this.contractTrainForm = res.rows[0]; // this.form.fileName = null;
if(this.contractTrainForm.video){ },
this.fileListVideo = [ },
{ };
name: this.contractTrainForm.courseName + "视频",
url: uploadfile,
},
];
}
if(this.contractTrainForm.enclosure){
this.fileListFile = [
{
name: this.contractTrainForm.courseName + "附件",
url: uploadfile,
},
];
}
this.$refs.visitorQuestion.rightNum = this.contractTrainForm.qualifiedNum;
this.$refs.visitorQuestion.getContractTopicList(this.contractTrainForm.contractorCourseId)
})
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
getFileInfoVideo(res) {
this.contractTrainForm.video = res.url;
this.fileListVideo = [
{
name: res.fileName,
url: uploadfile,
},
];
},
listRemoveVideo(e) {
this.fileListVideo = [];
this.contractTrainForm.video = "";
// this.form.videoName = null;
},
getFileInfoFile(res) {
this.contractTrainForm.enclosure = res.url;
this.fileListFile = [
{
name: res.fileName,
url: uploadfile,
},
];
},
listRemoveFile(e) {
this.fileListFild = [];
this.contractTrainForm.enclosure = "";
// this.form.fileName = null;
},
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.form-wrapper { .form-wrapper {
...@@ -148,7 +174,7 @@ ...@@ -148,7 +174,7 @@
height: 100%; height: 100%;
margin-bottom: 20px; margin-bottom: 20px;
} }
.flex{ .flex {
width: 100%; width: 100%;
justify-content: space-around; justify-content: space-around;
padding: 20px 30px; padding: 20px 30px;
......
...@@ -62,11 +62,11 @@ ...@@ -62,11 +62,11 @@
<span>{{ parseTime(scope.row.testEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <span>{{ parseTime(scope.row.testEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="正确率" align="center" prop="score"> <!-- <el-table-column label="正确率" align="center" prop="score">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span>{{Math.round(scope.row.score/topicNum* 100)}}%</span> <!-- <span>{{Math.round(scope.row.score/topicNum* 100)}}%</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="是否合格" align="center" prop="isQualified"> <el-table-column label="是否合格" align="center" prop="isQualified">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.isQualified == '0'">合格</span> <span v-if="scope.row.isQualified == '0'">合格</span>
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<div class="ent-b-car1"> <div class="ent-b-car1">
<div class="a-car-out"> <div class="a-car-out">
<div>人员出场</div> <div>人员出场</div>
<div style="color: #c5c6c7;font-size: 14px;">出入记录</div> <!--<div style="color: #c5c6c7;font-size: 14px;">出入记录</div>-->
</div> </div>
<div class="ent-div"></div> <div class="ent-div"></div>
<div class="ent-b-in"> <div class="ent-b-in">
...@@ -120,14 +120,14 @@ ...@@ -120,14 +120,14 @@
<div class="ent-b-car1"> <div class="ent-b-car1">
<div class="a-car-out"> <div class="a-car-out">
<div>车辆出场</div> <div>车辆出场</div>
<div style="color: #c5c6c7;font-size: 14px;">出入记录</div> <!--<div style="color: #c5c6c7;font-size: 14px;">出入记录</div>-->
</div> </div>
<div class="ent-div"></div> <div class="ent-div"></div>
<div class="ent-b-in"> <div class="ent-b-in">
<img src="../../assets/img/car.png" alt=""> <img src="../../assets/img/car.png" alt="">
<div>车辆类型:<span></span>{{lastExportCarData ? lastExportCarData.cName : "-"}}</div> <div>车辆类型:<span></span>{{lastExportCarData ? lastExportCarData.cName : "-"}}</div>
<div>车辆号牌:<span>{{lastExportCarData?lastExportCarData.plateNumber:"-"}}</span> </div> <div>车辆号牌:<span>{{lastExportCarData?lastExportCarData.plateNumber:"-"}}</span> </div>
<div>场时间:<span>{{lastExportCarData?changeDateFormat(lastExportCarData.outParkTime):"-"}}</span> </div> <div>场时间:<span>{{lastExportCarData?changeDateFormat(lastExportCarData.outParkTime):"-"}}</span> </div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
style="margin: 0px 0px 25px 0px;color: #3db0ff;" style="margin: 0px 0px 25px 0px;color: #3db0ff;"
>记住密码</el-checkbox >记住密码</el-checkbox
> >
<a class="certificateDownload" href="http://27.128.189.137:81/nginxService/v1/download/InstallRootCert.exe">下载证书</a>
<el-form-item style="width: 100%;height: 40px;" class="zhanghaomima"> <el-form-item style="width: 100%;height: 40px;" class="zhanghaomima">
<el-button <el-button
:loading="loading" :loading="loading"
...@@ -254,4 +255,12 @@ export default { ...@@ -254,4 +255,12 @@ export default {
.login-code-img { .login-code-img {
height: 38px; height: 38px;
} }
.certificateDownload{
color: #3e9ced;
float: right;
font-size: 14px;
}
.certificateDownload:hover{
color: #bfbfbf;
}
</style> </style>
...@@ -83,18 +83,17 @@ ...@@ -83,18 +83,17 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" width="120px" /> <!-- <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" width="120px" />-->
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>修改</el-button> >修改</el-button>
<el-button <!--<el-button
v-if="scope.row.status == '0'" v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
...@@ -114,9 +113,8 @@ ...@@ -114,9 +113,8 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleInvalid(scope.row)" @click="handleInvalid(scope.row)"
>作废</el-button> >作废</el-button>-->
<el-button <el-button
v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
...@@ -191,10 +189,10 @@ ...@@ -191,10 +189,10 @@
</span> </span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
<el-form-item v-show="operate" label="审批" prop="status"> <!--<el-form-item v-show="operate" label="审批" prop="status">
<el-radio v-model="form.status" label="2">通过</el-radio> <el-radio v-model="form.status" label="2">通过</el-radio>
<el-radio v-model="form.status" label="0">驳回</el-radio> <el-radio v-model="form.status" label="0">驳回</el-radio>
</el-form-item> </el-form-item>-->
</div> </div>
<div style="width: 58%;margin-left: 2%"> <div style="width: 58%;margin-left: 2%">
<div class="dialogTitle">法律法规内容</div> <div class="dialogTitle">法律法规内容</div>
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
</el-col> </el-col>
</el-row> </el-row>
<!-- 添加或修改参数配置对话框 --> <!-- 添加参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="角色"> <el-form-item label="角色">
<el-select v-model="form.roleId" placeholder="请选择角色" style="width: 100%"> <el-select v-model="form.roleIds" multiple placeholder="请选择">
<el-option <el-option
v-for="item in roleOptions" v-for="item in roleOptions"
:key="item.roleId" :key="item.roleId"
...@@ -249,6 +249,9 @@ ...@@ -249,6 +249,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="23"> <el-col :span="23">
...@@ -294,7 +297,151 @@ ...@@ -294,7 +297,151 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="opens" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="11">
<el-form-item label="姓名" prop="staffName">
<el-input v-model="form.staffName" placeholder="请输入员工姓名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别" prop="sex" label-width="140px">
<el-select v-model="form.sex" placeholder="请选择员工性别" style="width: 100%">
<el-option
v-for="dict in sexOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="手机号码" prop="phonenumber">
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属部门" prop="deptId" label-width="140px">
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="岗位" prop="postId">
<el-select v-model="form.postId" placeholder="请选择岗位" style="width: 100%">
<el-option
v-for="item in postOptions"
:key="item.postId"
:label="item.postName"
:value="item.postId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职称" prop="positionalTitles" label-width="140px">
<el-input v-model="form.positionalTitles" placeholder="请输入员工职称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="工种" prop="profession">
<el-input v-model="form.profession" placeholder="请输入员工工种" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否为特种作业人员" label-width="140px">
<el-select v-model="form.specialOperators" placeholder="请选择是否为特种作业人员" style="width: 100%">
<el-option
v-for="dict in specialOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<!-- <el-form-item label="角色">-->
<!-- <el-select v-model="form.roleId" placeholder="请选择角色" style="width: 100%">-->
<!-- <el-option-->
<!-- v-for="item in roleOptions"-->
<!-- :key="item.roleId"-->
<!-- :label="item.roleName"-->
<!-- :value="item.roleId"-->
<!-- :disabled="item.status == 1"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择">
<el-option
v-for="item in roleOptions"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="证书照片" prop="certificateUrl">
<MyFileUpload
listType="picture-card"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
/>
<el-input v-show="false" disabled v-model="form.certificateUrl"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="证书名称" prop="certificateName">
<el-input v-model="form.certificateName" placeholder="请输入证书名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="证书有效日期" prop="effectiveDate" label-width="140px">
<el-date-picker clearable
v-model="form.effectiveDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择证书有效日期"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注信息"></el-input>
</el-form-item>
</el-col>
</el-row>
</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> </div>
</template> </template>
...@@ -303,6 +450,7 @@ import { listStaff, getStaff, delStaff, addStaff, updateStaff, exportStaff } fro ...@@ -303,6 +450,7 @@ import { listStaff, getStaff, delStaff, addStaff, updateStaff, exportStaff } fro
import { treeselect } from "@/api/system/dept"; import { treeselect } from "@/api/system/dept";
import MyFileUpload from '@/components/MyFileUpload'; import MyFileUpload from '@/components/MyFileUpload';
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate } from "@/api/system/user";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
...@@ -333,6 +481,8 @@ export default { ...@@ -333,6 +481,8 @@ export default {
deptOptions: undefined, deptOptions: undefined,
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 修改是否显示弹出层
opens: false,
openDetail: false, openDetail: false,
// 部门名称 // 部门名称
deptName: undefined, deptName: undefined,
...@@ -431,6 +581,7 @@ export default { ...@@ -431,6 +581,7 @@ export default {
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
this.opens = false;
this.reset(); this.reset();
}, },
cancelDetail() { cancelDetail() {
...@@ -495,7 +646,13 @@ export default { ...@@ -495,7 +646,13 @@ export default {
this.getTreeselect(); this.getTreeselect();
// this.open = true; // this.open = true;
// this.title = "添加员工信息"; // this.title = "添加员工信息";
getStaff().then(response => { // getStaff().then(response => {
// this.postOptions = response.posts;
// this.roleOptions = response.roles;
// this.open = true;
// this.title = "添加员工信息";
// });
getUser().then(response => {
this.postOptions = response.posts; this.postOptions = response.posts;
this.roleOptions = response.roles; this.roleOptions = response.roles;
this.open = true; this.open = true;
...@@ -507,16 +664,18 @@ export default { ...@@ -507,16 +664,18 @@ export default {
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
const staffId = row.staffId || this.ids; const staffId = row.staffId || this.ids;
getUser().then(response => {
this.roleOptions = response.roles;
});
getStaff(staffId).then(response => { getStaff(staffId).then(response => {
this.form = response.data; this.form = response.data;
this.postOptions = response.posts; this.postOptions = response.posts;
this.roleOptions = response.roles;
if (this.form.certificateUrl) { if (this.form.certificateUrl) {
this.fileList.push({ this.fileList.push({
url: this.form.certificateUrl, url: this.form.certificateUrl,
}); });
} }
this.open = true; this.opens = true;
this.title = "修改员工信息"; this.title = "修改员工信息";
}); });
}, },
...@@ -524,11 +683,10 @@ export default { ...@@ -524,11 +683,10 @@ export default {
submitForm: function() { submitForm: function() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
console.log("this.form",this.form)
if (this.form.staffId != null) { if (this.form.staffId != null) {
updateStaff(this.form).then(response => { updateStaff(this.form).then(response => {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.opens = false;
this.getList(); this.getList();
}); });
} else { } else {
......
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2023-01-17 13:47:40
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-28 17:58:47
* @FilePath: /danger-manage-web/src/views/system/qRCode/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template> <template>
<img :src="src" style=" position: relative; <img :src="src" style="position: relative; left: 37%; top: 10%; width: 27%" />
left: 37%;
top: 10%;
width: 27%;">
</template> </template>
<script> <script>
const src = require('../qRCode/img/qrcode_1673250700723.png') const src = require("../qRCode/img/qrcode_1673250700723.png");
export default{ export default {
computed:{ computed: {
src(){ src() {
return src return src;
} },
} },
} };
</script> </script>
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
<div ref="myBody" class="body" v-loading="loading"> <div ref="myBody" class="body" v-loading="loading">
<div class="text"> <div class="text">
<div class="float">炼铁车间炉前工安全生产规范课程</div> <div class="float">炼铁车间炉前工安全生产规范课程</div>
</div> </div>
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<div :key="goodJobShow"> <div :key="goodJobShow">
<template v-if="!goodJobShow"> <template v-if="!goodJobShow">
<transition name="fade" mode="out-in"> <!-- <transition name="fade" mode="out-in">
<div class="question-wrapper" v-if="visible" :key="nowQuestion"> <div class="question-wrapper" v-if="visible" :key="nowQuestion">
<div v-for="(item, index) in list" :key="item.id"> <div v-for="(item, index) in list" :key="item.id">
<Question <Question
...@@ -30,6 +31,33 @@ ...@@ -30,6 +31,33 @@
/> />
</div> </div>
</div> </div>
</transition> -->
<transition name="fade" mode="out-in">
<div class="question-wrapper" v-if="visible" :key="nowQuestion">
<div v-for="(item, index) in list" :key="item.id">
<template v-if="item.topicType == 1 || item.topicType === 3">
<Question
v-if="index === nowQuestion"
:questionObj="item"
:index="index"
:nowQuestion="nowQuestion"
:selectLetter="selectLetter"
@changeLetter="changeLetter"
/>
</template>
<template v-else>
<QuestionChoice
v-if="index === nowQuestion"
:questionObj="item"
:index="index"
:nowQuestion="nowQuestion"
:selectLetter="selectLetter"
@changeLetter="changeLetter"
/>
</template>
</div>
</div>
</transition> </transition>
<div class="select flex"> <div class="select flex">
...@@ -77,7 +105,7 @@ ...@@ -77,7 +105,7 @@
<script> <script>
import Question from "./Question"; import Question from "./Question";
import GoodJob from "./GoodJob.vue"; import GoodJob from "./GoodJobOld.vue";
import { import {
userQuestionList, userQuestionList,
setAnswer, setAnswer,
...@@ -148,7 +176,9 @@ export default { ...@@ -148,7 +176,9 @@ export default {
// this.answerClear(); // this.answerClear();
// this.$emit("update:visible", false); // this.$emit("update:visible", false);
this.saveBody(); this.saveBody();
const answers = this.answerArr.map((item) => item.answer).join(","); // const answers = this.answerArr.map((item) => item.answer).join(",");
const json = JSON.stringify(this.answerArr.map((item) => item.answer));
const answers = json.slice(1, json.length - 1);
this.loading = true; this.loading = true;
setAnswer({ setAnswer({
userCourseId: this.userCourseId, userCourseId: this.userCourseId,
...@@ -158,13 +188,12 @@ export default { ...@@ -158,13 +188,12 @@ export default {
if (res.code == 200) { if (res.code == 200) {
this.goodJobData = res.data; this.goodJobData = res.data;
this.goodJobShow = true; this.goodJobShow = true;
} }
}) })
.finally(() => { .finally(() => {
this.loading = false; this.loading = false;
// 是否作对 // 是否作对
this.$emit('jj',this.goodJobData) this.$emit("jj", this.goodJobData);
}); });
}, },
dialogCancel() { dialogCancel() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 17:20:49 * @Date: 2022-09-21 17:20:49
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 11:56:49 * @LastEditTime: 2023-01-12 17:00:34
* @FilePath: /danger-manage-web/src/views/myLessons/components/GoodJob.vue * @FilePath: /danger-manage-web/src/views/myLessons/components/GoodJob.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -13,17 +13,16 @@ ...@@ -13,17 +13,16 @@
<template v-if="goodJobData.answer >= goodJobData.qualifiedNum"> <template v-if="goodJobData.answer >= goodJobData.qualifiedNum">
<div class="icon"><i class="iconfont icon-smiling" /></div> <div class="icon"><i class="iconfont icon-smiling" /></div>
<div> <div>
恭喜你,做对{{ goodJobData.answer }}道题得分{{ <!-- 恭喜你,做对{{ goodJobData.answer }}道题 -->
Math.floor((goodJobData.answer / goodJobData.topicNum) * 100) 恭喜你,得分{{ goodJobData.answer }},成绩合格!
}},成绩合格!
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="icon"><i class="iconfont icon-nanguo" /></div> <div class="icon"><i class="iconfont icon-nanguo" /></div>
<div> <div>
继续努力,做对{{ goodJobData.answer }}道题得分{{ 继续努力,
Math.floor((goodJobData.answer / goodJobData.topicNum) * 100) <!-- 做对{{ goodJobData.answer }}道题 -->
}},成绩不合格! 得分{{ goodJobData.answer }},成绩不合格!
</div> </div>
</template> </template>
</div> </div>
...@@ -49,16 +48,16 @@ export default { ...@@ -49,16 +48,16 @@ export default {
.goodjob-wrapper { .goodjob-wrapper {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 86%; width: 100%;
height: 100%; height: 100%;
border-bottom: 1px solid #bbbbbb; border-bottom: 1px solid #bbbbbb;
.text { .text {
width: 94%; width: 100%;
height: 174px; height: 136px;
color: #1d84ff; color: #1d84ff;
background: #f9f9f9 100%; background: #f9f9f9 100%;
border-radius: 15px; border-radius: 15px;
line-height: 40px; line-height: 136px;
font-size: 28px; font-size: 28px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
methods: { methods: {
getPlanList() { getPlanList() {
//跳转页面的传值 //跳转页面的传值
console.log(JSON.parse(this.$route.query.params).beyondUnit) // console.log(JSON.parse(this.$route.query.params).beyondUnit)
ITContractorTrainCourse().then((res) => { ITContractorTrainCourse().then((res) => {
this.data=res.data; this.data=res.data;
this.changeVideo(this.data.video); this.changeVideo(this.data.video);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment