Commit ed27c9a0 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 9b0abed6 16064447
package com.zehong.web.controller.contractTrain;
import java.util.List;
import com.zehong.system.domain.vo.BatchTopicVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -79,6 +81,16 @@ public class TContractorTrainCourseTopicController extends BaseController
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;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -81,6 +82,10 @@ public class TContractorTrainResultController extends BaseController
@GetMapping("/examination")
public AjaxResult examination( TContractorTrainResult tContractorTrainResult){
String n="["+tContractorTrainResult.getAnswers()+']';
//字符串转换成二维数组
Integer[][] integers = JSON.parseObject(n, Integer[][].class);
tContractorTrainResult.setIntegers(integers);
//结束时间
tContractorTrainResult.setTestEndTime(new Date());
Map<String, Object> examination = tContractorTrainResultService.examination(tContractorTrainResult);
......
......@@ -41,7 +41,6 @@ public class TTrainCourseBankController extends BaseController
public TableDataInfo list(TTrainCourseBank tTrainCourseBank)
{
startPage();
System.out.println(tTrainCourseBank);
List<TTrainCourseBank> list = tTrainCourseBankService.selectTTrainCourseBankList(tTrainCourseBank);
return getDataTable(list);
}
......
......@@ -50,6 +50,43 @@ public class TContractorTrainCourse extends BaseEntity
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/** 多选题分数*/
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;
......@@ -134,18 +171,19 @@ public class TContractorTrainCourse extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("contractorCourseId", getContractorCourseId())
.append("courseName", getCourseName())
.append("courseConent", getCourseConent())
.append("enclosure", getEnclosure())
.append("video", getVideo())
.append("qualifiedNum", getQualifiedNum())
.append("topicNum", getTopicNum())
.append("createTime", getCreateTime())
.append("createUser", getCreateUser())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
return "TContractorTrainCourse{" +
"contractorCourseId=" + contractorCourseId +
", courseName='" + courseName + '\'' +
", courseConent='" + courseConent + '\'' +
", enclosure='" + enclosure + '\'' +
", video='" + video + '\'' +
", qualifiedNum=" + qualifiedNum +
", topicNum=" + topicNum +
", createUser='" + createUser + '\'' +
", isDel='" + isDel + '\'' +
", multipleChoiceScore=" + multipleChoiceScore +
", singleChoiceScore=" + singleChoiceScore +
", judgmentScore=" + judgmentScore +
'}';
}
}
......@@ -32,12 +32,31 @@ public class TContractorTrainCourseTopic extends BaseEntity
/** 答案 */
@Excel(name = "答案")
private Integer answer;
private String answer;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/**题目类型*/
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;
......@@ -74,15 +93,11 @@ public class TContractorTrainCourseTopic extends BaseEntity
{
return topicOption;
}
public void setAnswer(Integer answer)
{
this.answer = answer;
}
public Integer getAnswer()
{
public String getAnswer() {
return answer;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
......@@ -95,15 +110,14 @@ public class TContractorTrainCourseTopic extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("topicId", getTopicId())
.append("contractorCourseId", getContractorCourseId())
.append("topicTitle", getTopicTitle())
.append("topicOption", getTopicOption())
.append("answer", getAnswer())
.append("createTime", getCreateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
return "TContractorTrainCourseTopic{" +
"topicId=" + topicId +
", contractorCourseId=" + contractorCourseId +
", topicTitle='" + topicTitle + '\'' +
", topicOption='" + topicOption + '\'' +
", answer='" + answer + '\'' +
", isDel='" + isDel + '\'' +
", topicType=" + topicType +
'}';
}
}
......@@ -55,8 +55,20 @@ public class TContractorTrainResult extends BaseEntity
/** 是否删除(0正常,1删除) */
private String isDel;
/** 答案*/
private String answers;
/** 转换成二维数组答案*/
private Integer[][] integers;
public Integer[][] getIntegers() {
return integers;
}
public void setIntegers(Integer[][] integers) {
this.integers = integers;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
......
......@@ -32,11 +32,11 @@ public class TContractorTrainResultDetail extends BaseEntity
/** 答案 */
@Excel(name = "答案")
private Integer answer;
private String answer;
/** 所选答案 */
@Excel(name = "所选答案")
private Integer answerChoice;
private String answerChoice;
/** 答题结果:0 对,1 错 */
@Excel(name = "答题结果:0 对,1 错")
......@@ -82,24 +82,27 @@ public class TContractorTrainResultDetail extends BaseEntity
{
return topicOption;
}
public void setAnswer(Integer answer)
{
this.answer = answer;
}
public Integer getAnswer()
{
public String getAnswer() {
return answer;
}
public void setAnswerChoice(Integer answerChoice)
{
this.answerChoice = answerChoice;
public void setAnswer(String answer) {
this.answer = answer;
}
public Integer getAnswerChoice()
{
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getAnswerChoice() {
return answerChoice;
}
public void setAnswerChoice(String answerChoice) {
this.answerChoice = answerChoice;
}
public void setResult(String result)
{
this.result = result;
......
package com.zehong.system.domain;
import java.util.Arrays;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
......@@ -17,6 +18,8 @@ public class TStaff extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**系统用户id*/
private Integer userId;
/** 员工id */
private Integer staffId;
......@@ -49,6 +52,9 @@ public class TStaff extends BaseEntity
/** 岗位id */
@Excel(name = "岗位id")
private Integer postId;
/** 角色组 */
private Long[] roleIds;
/** 角色id */
@Excel(name = "角色id")
......@@ -83,6 +89,22 @@ public class TStaff extends BaseEntity
@Excel(name = "删除标志", readConverterExp = "0=正常,1删除")
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() {
return serialVersionUID;
}
......@@ -246,7 +268,8 @@ public class TStaff extends BaseEntity
@Override
public String toString() {
return "TStaff{" +
"staffId=" + staffId +
"userId=" + userId +
", staffId=" + staffId +
", userName='" + userName + '\'' +
", password='" + password + '\'' +
", staffName='" + staffName + '\'' +
......@@ -255,6 +278,7 @@ public class TStaff extends BaseEntity
", deptId=" + deptId +
", phonenumber='" + phonenumber + '\'' +
", postId=" + postId +
", roleIds=" + Arrays.toString(roleIds) +
", roleId=" + roleId +
", positionalTitles='" + positionalTitles + '\'' +
", profession='" + profession + '\'' +
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TContractorTrainCourse;
import com.zehong.system.domain.TContractorTrainCourseTopic;
import com.zehong.system.domain.TTrainCourse;
import com.zehong.system.domain.TTrainCourseTopic;
/**
* 承包商及访客培训题库Mapper接口
......@@ -58,4 +62,24 @@ public interface TContractorTrainCourseTopicMapper
* @return 结果
*/
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,6 +2,7 @@ package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TContractorTrainCourseTopic;
import com.zehong.system.domain.vo.BatchTopicVo;
/**
* 承包商及访客培训题库Service接口
......@@ -58,4 +59,11 @@ public interface ITContractorTrainCourseTopicService
* @return 结果
*/
public int deleteTContractorTrainCourseTopicById(Long topicId);
/**
* 题库批量导入试题
* @param batchTopicVo
* @return
*/
int bachAddTopic(BatchTopicVo batchTopicVo);
}
package com.zehong.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TContractorTrainCourse;
import com.zehong.system.domain.TContractorTrainCourseTopic;
import com.zehong.common.utils.StringUtils;
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.TContractorTrainCourseTopicMapper;
import com.zehong.system.service.ITContractorTrainCourseTopicService;
......@@ -11,6 +14,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
......@@ -26,6 +32,8 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
private TContractorTrainCourseTopicMapper tContractorTrainCourseTopicMapper;
@Resource
private TContractorTrainCourseMapper tContractorTrainCourseMapper;
@Resource
private TBankSubjectMapper tBankSubjectMapper;
/**
* 查询承包商及访客培训题库
......@@ -115,4 +123,44 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
{
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;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.*;
......@@ -112,21 +113,43 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul
@Override
public Map<String,Object> examination(TContractorTrainResult tContractorTrainResult) {
TContractorTrainCourseTopic tContractorTrainCourseTopic=new TContractorTrainCourseTopic();
String answers = tContractorTrainResult.getAnswers();
//交卷答题
String[] split = answers.split(",");
TContractorTrainCourse tContractorTrainCourse=new TContractorTrainCourse();
//查询考试题和答案
List<TContractorTrainCourseTopic> tContractorTrainCourseTopics = tContractorTrainCourseTopicMapper.selectTContractorTrainCourseTopicList(tContractorTrainCourseTopic);
//正确答案数量
//查询需要正确几道题算通过
TContractorTrainCourse itContractorTrainCourse = tContractorTrainCourseMapper.getITContractorTrainCourse(tContractorTrainCourse);
//已获得分数
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;
}
}
TContractorTrainCourse tContractorTrainCourse=new TContractorTrainCourse();
//查询需要正确几道题算通过
TContractorTrainCourse itContractorTrainCourse = tContractorTrainCourseMapper.getITContractorTrainCourse(tContractorTrainCourse);
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();
}
}
}
}
//判断答题是否合格
if(num>=itContractorTrainCourse.getQualifiedNum()){
tContractorTrainResult.setIsQualified("0");
......@@ -139,7 +162,7 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul
//承包商及访客培训考试结果 添加方法
tContractorTrainResultMapper.insertTContractorTrainResult(tContractorTrainResult);
/**添加承包商及访客培训考试结果详情*/
for (int n=0;n<split.length;n++){
for (int n=0;n<tContractorTrainResult.getIntegers().length;n++){
TContractorTrainResultDetail tContractorTrainResultDetail=new TContractorTrainResultDetail();
//设置结果管理id
tContractorTrainResultDetail.setResult(String.valueOf(tContractorTrainResult.getResultId()));
......@@ -150,13 +173,13 @@ public class TContractorTrainResultServiceImpl implements ITContractorTrainResul
//答案
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()){
tContractorTrainResultDetail.setResult("0");
}else {
tContractorTrainResultDetail.setResult("1");
}
// if (Integer.valueOf(split[n])==tContractorTrainCourseTopics.get(n).getAnswer()){
// tContractorTrainResultDetail.setResult("0");
// }else {
// tContractorTrainResultDetail.setResult("1");
// }
tContractorTrainResultDetail.setCreateTime(new Date());
tContractorTrainResultDetail.setResultId(tContractorTrainResult.getResultId());
tContractorTrainResultDetailMapper.insertTContractorTrainResultDetail(tContractorTrainResultDetail);
......
......@@ -161,12 +161,12 @@ public class TEntranceGuardPersonInfoServiceImpl implements ITEntranceGuardPerso
return;
}
if("0".equals(tEntranceGuardPersonInfo.getActionType())){
crc="入";
crc="入";
}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++;
}
contents[5]=" "+DateUtils.getDate();//展示当日日期
......
package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
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.form.TStaffForm;
import com.zehong.system.domain.vo.TStaffVo;
import com.zehong.system.mapper.SysUserRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TStaffMapper;
......@@ -22,6 +28,10 @@ public class TStaffServiceImpl implements ITStaffService
@Autowired
private TStaffMapper tStaffMapper;
@Autowired
private SysUserRoleMapper userRoleMapper;
/**
* 查询员工信息管理
*
......@@ -58,7 +68,10 @@ public class TStaffServiceImpl implements ITStaffService
String staffCode = tStaffMapper.getStaffCode();
tStaff.setStaffCode(staffCode);
tStaff.setCreateTime(DateUtils.getNowDate());
return tStaffMapper.insertTStaff(tStaff);
tStaffMapper.insertTStaff(tStaff);
// 新增用户与角色管理
insertUserRole(tStaff);
return tStaff.getStaffId();
}
/**
......@@ -70,6 +83,10 @@ public class TStaffServiceImpl implements ITStaffService
@Override
public int updateTStaff(TStaff tStaff)
{
// 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(Long.valueOf(tStaff.getStaffId()));
// 新增用户与角色管理
insertUserRole(tStaff);
tStaff.setUpdateTime(DateUtils.getNowDate());
return tStaffMapper.updateTStaff(tStaff);
}
......@@ -97,4 +114,30 @@ public class TStaffServiceImpl implements ITStaffService
{
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,6 +67,10 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
return 0;
}
List<String> userIds = tTrainPlanMapper.selectAlluserByplanId(course.getCourseType());
//异常数据
if(userIds==null||userIds.size()==0){
return 0;
}
tTrainCourseMapper.insertUserCourse(courseId,userIds,course.getPersonnelType());
course.setStatus(1);
course.setReleaseTime(new Date());
......@@ -205,7 +209,6 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String,Object> examination (Long userCourseId,Integer[][] answers){
//查询用户课程信息
TTrainUserCourse userCourse = tTrainUserCourseMapper.selectTTrainUserCourseById(userCourseId);
TTrainCourseTopic topic = new TTrainCourseTopic();
......@@ -226,7 +229,6 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
Integer qualifiedNum = c.getQualifiedNum();
//已获得分数
int num = 0;
/**
* 大循环 共有多少答案 此循环最后只算出 得了多少分
*/
......@@ -235,10 +237,8 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
int PassedNot =0;
/*题目答案*/
String answer = list.get(i).getAnswer();
System.out.println("答案:"+answer);
//答案转换成数组
Integer[] integers = JSON.parseObject(answer, Integer[].class);
/**判断所选答案是否与正确答案长度相等*/
if (integers.length==answers[i].length){
boolean adopt=true;
......@@ -251,13 +251,10 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
if (adopt){
/** 1单选 2多选 3判断*/
if (list.get(i).getTopicType()==1){
System.out.println(num);
num=num+singleChoiceScore;
}else if (list.get(i).getTopicType()==2){
System.out.println(num);
num=num+multipleChoiceScore;
}else if (list.get(i).getTopicType()==3){
System.out.println(num);
num=num+judgmentScore;
}
}
......@@ -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);
// if(Integer.parseInt(answers[i])==demosub){
// num++;
// }
}
// }
/**已获得分数*/
userCourse.setExaminationResult(num);
/**生成日期*/
......
......@@ -16,10 +16,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createUser" column="create_user" />
<result property="isDel" column="is_del" />
<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>
<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>
<select id="selectTContractorTrainCourseList" parameterType="TContractorTrainCourse" resultMap="TContractorTrainCourseResult">
......@@ -54,6 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUser != null">create_user,</if>
<if test="isDel != null">is_del,</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 prefix="values (" suffix=")" suffixOverrides=",">
<if test="courseName != null">#{courseName},</if>
......@@ -66,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUser != null">#{createUser},</if>
<if test="isDel != null">#{isDel},</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>
</insert>
......@@ -82,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createUser != null">create_user = #{createUser},</if>
<if test="isDel != null">is_del = #{isDel},</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>
where contractor_course_id = #{contractorCourseId}
</update>
......
......@@ -13,10 +13,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="isDel" column="is_del" />
<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>
<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>
<select id="selectTContractorTrainCourseTopicList" parameterType="TContractorTrainCourseTopic" resultMap="TContractorTrainCourseTopicResult">
......@@ -45,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
<if test="topicType != null">topic_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="contractorCourseId != null">#{contractorCourseId},</if>
......@@ -54,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
<if test="topicType != null">#{topicType},</if>
</trim>
</insert>
......@@ -67,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="topicType != null">topic_type = #{topicType},</if>
</trim>
where topic_id = #{topicId}
</update>
......@@ -81,4 +91,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{topicId}
</foreach>
</delete>
<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>
......@@ -47,7 +47,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="topicOption != null">topic_option,</if>
<if test="answer != null">answer,</if>
<if test="answerChoice != null">answer_choice,</if>
<if test="result != null">result,</if>
<if test="createTime != null">create_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
......@@ -58,7 +57,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="topicOption != null">#{topicOption},</if>
<if test="answer != null">#{answer},</if>
<if test="answerChoice != null">#{answerChoice},</if>
<if test="result != null">#{result},</if>
<if test="createTime != null">#{createTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
......
......@@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="score != null and score != ''"> and score = #{score}</if>
<if test="isQualified != null and isQualified != ''"> and is_qualified = #{isQualified}</if>
</where>
order by result_id desc
</select>
<select id="selectTContractorTrainResultById" parameterType="Long" resultMap="TContractorTrainResultResult">
......
......@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where t.user_id = #{staffId}
</select>
<insert id="insertTStaff" parameterType="TStaff">
<insert id="insertTStaff" parameterType="TStaff" useGeneratedKeys = "true" keyProperty = "staffId">
insert into sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
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'
// 查询承包商及访客培训列表
......@@ -9,6 +17,7 @@ export function listCourse(query) {
})
}
// 查询承包商及访客培训详细
export function getCourse(contractorCourseId) {
return request({
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-23 11:02:24
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -186,3 +186,10 @@ export function bachAddTopic(data) {
})
}
export function bachAddTopicGuest(data) {
return request({
url: '/contractTrainTopic/bachAddTopic',
method: 'post',
data: data
})
}
......@@ -2,6 +2,7 @@
<div class="upload-file">
<el-upload
:action="uploadFileUrl"
:disabled="disabled"
:before-upload="handleBeforeUpload"
:file-list="fileArr"
:limit="1"
......@@ -16,11 +17,11 @@
:show-file-list="true"
:headers="headers"
class="upload-file-uploader"
:class="{ hide: fileArr.length>0 ||addShow }"
:class="{ hide: fileArr.length > 0 || addShow }"
ref="upload"
>
<!-- 上传按钮 -->
<el-button plain type="primary">选取文件</el-button>
<el-button :disabled="disabled" plain type="primary">选取文件</el-button>
<!--<i class="el-icon-plus"></i>-->
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
......@@ -33,9 +34,9 @@
</template>
的文件,且不超过一个
</div>
</el-upload>
<el-image v-show="false"
<el-image
v-show="false"
id="img"
ref="previewImg"
:src="dialogImageUrl"
......@@ -66,9 +67,9 @@
</template>
<script>
import { getToken } from "@/utils/auth";
import { getToken } from "@/utils/auth";
export default {
export default {
props: {
// 值
value: [String, Object, Array],
......@@ -95,6 +96,10 @@
type: Boolean,
default: true,
},
disabled: {
type: Boolean,
default:false,
},
},
data() {
return {
......@@ -134,7 +139,7 @@
}
},
bigImageArr() {
return [this.dialogImageUrl]
return [this.dialogImageUrl];
},
},
methods: {
......@@ -234,31 +239,29 @@
// this.fileList = this.list;
this.addShow = this.fileArr.length > 0 ? true : false;
},
};
};
</script>
<style scoped lang="scss">
img {
img {
width: 100%;
}
.upload-file-uploader {
}
.upload-file-uploader {
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
}
</style>
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 15:23:58
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -16,7 +16,10 @@
@select-all="all"
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>
<el-table-column
......@@ -55,10 +58,14 @@ export default {
selectNameList: {
type: Array,
},
disabled: {
type: Boolean,
},
},
created() {
// this.listStaff();
},
data() {
return {
queryParams: {
......@@ -71,6 +78,9 @@ export default {
nameList: [],
loading: false,
};
},
mounted() {
},
methods: {
listStaff() {
......@@ -109,6 +119,11 @@ export default {
}
this.$emit("selectAll", this.nameList, allSelect);
},
selectable(row, rowIndex) {
if (!this.disabled) {
return true;
}
},
// 切换选项
toggleSelection(staffId, SeclctFlag = false) {
const item = this.nameList.find((item) => {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-19 17:39:55
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -43,6 +43,7 @@
<ChangPapelTable
ref="table"
:selectNameList.sync="selectNameList"
:disabled="disabled"
@selectOne="selectOne"
@selectAll="selectAll"
/>
......@@ -83,6 +84,9 @@ export default {
type: String,
default: null,
},
disabled:{
type:Boolean,
}
},
data() {
return {
......@@ -143,6 +147,7 @@ export default {
this.$refs.table.listStaff();
},
deleteName(staffId) {
if(this.disabled) return;
const index = this.selectNameList.findIndex((item) => {
return item.staffId == staffId;
});
......
......@@ -7,7 +7,7 @@
// [114.07708709377842, 38.248960473114614],
// ],
// colorNum: 1,
// fxlb: "风险区域",
// fxlb: "重大风险区域",
// bsjh: "",
// wxy: "锅炉操作",
// fxd: "锅炉点火",
......@@ -145,7 +145,7 @@ export const dangerArr = [
[114.08164030994841, 38.25079994477491],
],
data: {
fxlb: "较风险"
fxlb: "较风险"
},
colorNum: 2,
},
......@@ -160,7 +160,7 @@ export const dangerArr = [
[114.08037480953207, 38.249932590119556],
],
data: {
fxlb: "风险",
fxlb: "重大风险",
src: [jzyh, jzdhz, dxzd, dxxl, dxbz, bxdfdmj],
},
colorNum: 1,
......@@ -174,7 +174,7 @@ export const dangerArr = [
[114.08098376391818, 38.24951885572243],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -201,7 +201,7 @@ export const dangerArr = [
[114.08000932886821, 38.25149427805925],
],
data: {
fxlb: "较风险"
fxlb: "较风险"
},
colorNum: 2,
},
......@@ -215,7 +215,7 @@ export const dangerArr = [
[114.07992247747968, 38.2490596822873],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
},
{
......@@ -240,7 +240,7 @@ export const dangerArr = [
[114.07896214915758, 38.2485657203445],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -253,7 +253,7 @@ export const dangerArr = [
[114.07968503158452, 38.249621022521914],
],
data: {
fxlb: "较风险"
fxlb: "较风险"
},
colorNum: 2,
},
......@@ -266,7 +266,7 @@ export const dangerArr = [
[114.07932854865001, 38.25049906057526],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -279,7 +279,7 @@ export const dangerArr = [
[114.07929156270377, 38.24989004286162],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -293,7 +293,7 @@ export const dangerArr = [
[114.07818775308438, 38.24904718615451],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
},
{
......@@ -308,7 +308,7 @@ export const dangerArr = [
[114.07822516569071, 38.24873709204756],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
},
{
......@@ -320,7 +320,7 @@ export const dangerArr = [
[114.0778791617466, 38.24978811628299],
],
data: {
fxlb: "较风险"
fxlb: "较风险"
},
colorNum: 2,
},
......@@ -334,7 +334,7 @@ export const dangerArr = [
[114.07811902680491, 38.25084109067064],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
},
{
......@@ -346,7 +346,7 @@ export const dangerArr = [
[114.07816939918499, 38.250464604821424],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -362,7 +362,7 @@ export const dangerArr = [
[114.07655032796976, 38.24855692071795],
],
data: {
fxlb: "较风险"
fxlb: "较风险"
},
},
{
......@@ -375,7 +375,7 @@ export const dangerArr = [
[114.07645852296761, 38.249258052783055],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
},
{
......@@ -387,7 +387,7 @@ export const dangerArr = [
[114.07673177371679, 38.24999869046041],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -400,7 +400,7 @@ export const dangerArr = [
[114.07638572203807, 38.250006593486276],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -413,7 +413,7 @@ export const dangerArr = [
[114.0763611632972, 38.2506105391965],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -440,7 +440,7 @@ export const dangerArr = [
[114.07610863025666, 38.249559594773935],
],
data: {
fxlb: "较风险"
fxlb: "较风险"
},
},
{
......@@ -452,7 +452,7 @@ export const dangerArr = [
[114.07629629633044, 38.249994075703896],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -479,7 +479,7 @@ export const dangerArr = [
[114.07614690640786, 38.250982027231906],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -492,7 +492,7 @@ export const dangerArr = [
[114.07506815524074, 38.24935807751058],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -505,7 +505,7 @@ export const dangerArr = [
[114.07575424777615, 38.25022009521355],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -518,7 +518,7 @@ export const dangerArr = [
[114.07569321404614, 38.25050557141559],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -531,7 +531,7 @@ export const dangerArr = [
[114.07533109169464, 38.25112532353275],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -544,7 +544,7 @@ export const dangerArr = [
[114.07506400522227, 38.2498509809399],
],
data: {
fxlb: "较风险"
fxlb: "较风险"
},
colorNum: 2,
},
......@@ -557,7 +557,7 @@ export const dangerArr = [
[114.07507104315593, 38.249669088954406],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -571,7 +571,7 @@ export const dangerArr = [
[114.07329016901807, 38.24975956466659],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
},
{
......@@ -583,7 +583,7 @@ export const dangerArr = [
[114.07449942174725, 38.25005976641145],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
colorNum: 1,
},
......@@ -596,7 +596,7 @@ export const dangerArr = [
[114.07409377782558, 38.25057015884229],
],
data: {
fxlb: "风险"
fxlb: "重大风险"
},
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 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -20,13 +20,14 @@
>
</div> -->
<div id="mapbox"></div>
<DangerTips />
</div>
</template>
<script>
import CreateCesium, { DEVICE_PIC_TYPE } from "@/utils/cesium/cesiumClass.js";
import { dangerArr } from "@/utils/cesium/dangerArr.js";
import DangerTips from "./DangerTips.vue";
import Video from "@/components/bigWindow/video";
import Null from "@/components/bigWindow/Null";
import Danger from "@/components/bigWindow/Danger";
......@@ -42,6 +43,7 @@ export default {
name: "profile",
components: {
Editor,
DangerTips,
},
data() {
return {
......@@ -249,6 +251,7 @@ export default {
<style lang="scss" scoped>
.big-window {
width: 100%;
position:relative;
// height: calc(100vh - 84px);
height: calc(100vh - 50px);
#mapbox {
......
......@@ -11,9 +11,15 @@
size="mini"
@input="topicTypeChange"
>
<el-radio-button :label="1">单选</el-radio-button>
<el-radio-button :label="2">多选</el-radio-button>
<el-radio-button :label="3">判断</el-radio-button>
<el-radio-button :disabled="checkLock" :label="1"
>单选</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>
</div>
......@@ -29,7 +35,7 @@
:rules="{
required: true,
message: '必须输入题目内容',
trigger: 'blur',
trigger: ['blur', 'change'],
}"
>
<el-input
......@@ -38,6 +44,7 @@
resize="none"
rows="4"
v-model="form.topicTitle"
:disabled="checkLock"
>
</el-input>
</el-form-item>
......@@ -55,7 +62,7 @@
:rules="{
required: true,
message: '选项内容不能为空不能为空',
trigger: 'change',
trigger: ['blur', 'change'],
}"
>
<div class="add-select flex">
......@@ -65,6 +72,7 @@
style="flex: 1; margin-right: 10px"
rows="2"
v-model="question.value"
:disabled="checkLock"
></el-input>
<div class="flex algin-items">
<div
......@@ -79,8 +87,9 @@
<el-button
size="mini"
type="danger"
v-if="index > 0"
v-if="index > 0 && form.topicType != 3"
@click.prevent="removeDomain(question)"
:disabled="checkLock"
>删除</el-button
>
</div>
......@@ -111,7 +120,11 @@
设为正确答案
</div> -->
<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
>
</div>
......@@ -146,6 +159,10 @@ export default {
topicId: {
type: Number,
},
// 如果是查看,就禁止修改
checkLock: {
type: Boolean,
},
},
components: {},
data() {
......@@ -171,7 +188,7 @@ export default {
console.log(res.data);
const data = res.data;
this.form = {
topicType :data.topicType,
topicType: data.topicType,
topicTitle: data.topicTitle,
questions: JSON.parse(data.topicOption),
};
......@@ -232,6 +249,7 @@ export default {
}
},
rightAnswerClick(index) {
if (this.checkLock) return;
if (this.form.topicType === 2) {
const ind = this.answerNum.indexOf(index);
if (ind < 0) {
......@@ -250,6 +268,8 @@ export default {
},
// 删除选项
removeDomain(question) {
if (this.checkLock) return;
const index = this.form.questions.indexOf(question);
console.log(index);
// 如果是正确答案,就让正确答案清空
......@@ -276,11 +296,10 @@ export default {
// 新增选项
add(addValue) {
this.form.questions.push({ value: addValue });
console.log();
},
save(num = 2) {
return new Promise((resove) => {
if (this.answerNum.length<=0) {
if (this.answerNum.length <= 0) {
this.$message({
message: "警告,请设置一个正确答案",
type: "warning",
......@@ -293,8 +312,8 @@ export default {
data.topicTitle = this.form.topicTitle;
data.topicOption = JSON.stringify(this.form.questions);
data.answer = JSON.stringify(this.answerNum);
data.topicType=this.form.topicType;
console.log(data)
data.topicType = this.form.topicType;
console.log(data);
this.addQuestion(data).then((res) => {
if (res.code == 200) {
// 把修改的这个归位,变成正常添加
......@@ -324,7 +343,7 @@ export default {
});
},
reset() {
const topicType = this.form.topicType
const topicType = this.form.topicType;
this.form = {
topicType,
topicTitle: "",
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 09:30:19
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -193,7 +193,8 @@ export default {
this.loading = false;
});
},
saveAndNext() {
save(num=2) {
const topicInfos = this.list
.filter((item) => item.checked)
.map((item) => {
......@@ -202,18 +203,20 @@ export default {
quan: item.changeNum,
};
});
console.log(this.courseId, topicInfos);
const data = { courseId: this.courseId, topicInfos };
console.log(data);
bachAddTopic(data).then((res) => {
console.log(res);
if (res.code == 200) {
this.$parent.$parent.componentsNumChange(2);
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.$parent.getList();
}
});
},
saveAndNext(){
this.save(3)
},
resetClick() {},
search() {
this.getList();
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -24,6 +24,7 @@
:is="currentComponent"
:courseId.sync="courseId"
:topicId.sync="topicId"
:checkLock="checkLock"
ref="current"
></component>
</transition>
......@@ -32,27 +33,31 @@
<QuestionList/> -->
</div>
<div slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer" v-if="!checkLock">
<el-button
type="primary"
v-if="this.componentsNum == 2"
v-if="this.componentsNum == 2 && !checkLock"
@click="componentsNumChange(4)"
>从题库选择</el-button
>
<el-button
type="primary"
v-if="this.componentsNum == 1 || this.componentsNum == 3"
@click="save"
>保存</el-button
v-if="this.componentsNum == 4 ||this.componentsNum==3"
@click="componentsNumChange(2)"
>返回题目列表</el-button
>
<el-button
type="primary"
v-if="this.componentsNum == 4"
@click="componentsNumChange(2)"
>返回题目列表</el-button
v-if="
this.componentsNum == 1 ||
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
}}</el-button>
<el-button
......@@ -63,6 +68,16 @@
>
<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>
</el-dialog>
</template>
......@@ -72,7 +87,6 @@ import AddQuestion from "./AddQuestion";
import QuestionList from "./QuestionList";
import ChangeQuestion from "./ChangeQuestion";
export default {
name: "AnswerLesson",
props: {
......@@ -87,6 +101,9 @@ export default {
courseId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
// components: {
// Lesson,
......@@ -116,14 +133,14 @@ export default {
this.currentComponent = QuestionList;
this.title = "题目列表";
} else if(num===3) {
} else if (num === 3) {
this.currentComponent = AddQuestion;
if (this.topicId) {
this.title = "修改题目";
} else {
this.title = "新增题目";
}
}else if (num == 4) {
} else if (num == 4) {
this.currentComponent = ChangeQuestion;
this.title = "从题库选题";
}
......@@ -167,6 +184,8 @@ export default {
this.topicId = null;
}
this.$emit("update:visible", false);
// 关闭的时候归位
this.$emit("update:checkLock", false);
},
// 把ID改变了
changeCourseId(courseId) {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -17,7 +17,7 @@
>
<div class="top flex">
<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 label="培训计划" prop="courseType">-->
......@@ -37,14 +37,13 @@
<!--</el-form-item>-->
</div>
<div class="flex">
<el-form-item label="培训计划" prop="courseType">
<el-select
v-model="form.courseType"
placeholder="请选择培训计划"
clearable
size="small"
:disabled="checkLock"
>
<el-option
v-for="course in courseOptions"
......@@ -54,8 +53,18 @@
/>
</el-select>
</el-form-item>
<el-form-item label="培训时长" prop="duration" style="margin-left: 55px">
<el-input style="width: 220px" placeholder="分钟" type="number" v-model="form.duration"></el-input>
<el-form-item
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>
</div>
<div class="flex">
......@@ -67,6 +76,7 @@
type="datetime"
placeholder="选择日期时间"
default-time="00:00:00"
:disabled="checkLock"
/>
</el-form-item>
<el-form-item label="结束时间" prop="testEndTime">
......@@ -76,12 +86,13 @@
type="datetime"
placeholder="选择日期时间"
default-time="00:00:00"
:disabled="checkLock"
/>
</el-form-item>
</div>
<!-- </div> -->
<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
v-show="false"
disabled
......@@ -98,6 +109,7 @@
:fileArr="fileListVideo"
:fileSize="500"
:fileType="['mp4']"
:disabled="checkLock"
/>
<el-input v-show="false" disabled v-model="form.video"></el-input>
</el-form-item>
......@@ -108,6 +120,7 @@
@remove="listRemoveFile"
:fileArr="fileListFile"
:fileType="fileType"
:disabled="checkLock"
/>
<el-input v-show="false" disabled v-model="form.enclosure"></el-input>
</el-form-item>
......@@ -133,6 +146,9 @@ export default {
courseId: {
type: Number,
},
checkLock:{
type:Boolean,
}
},
components: {
Editor,
......@@ -204,8 +220,16 @@ export default {
getLessonById(this.courseId).then((res) => {
if (res.code == 200) {
const data = res.data;
const { courseName, courseType, courseConent, video, enclosure,duration,testStartTime,testEndTime } =
data;
const {
courseName,
courseType,
courseConent,
video,
enclosure,
duration,
testStartTime,
testEndTime,
} = data;
this.form = {
courseName,
courseType,
......@@ -214,21 +238,22 @@ export default {
enclosure,
duration,
testStartTime,
testEndTime
testEndTime,
};
this.fileListVideo = [
console.log('video',video)
this.fileListVideo = video? [
{
name: courseName + "视频",
url: uploadfile,
},
];
]:[];
this.fileListFile = [
{
name: courseName + "附件",
url: uploadfile,
},
];
console.log("--",this.fileListFile);
console.log("--", this.fileListFile);
}
});
},
......@@ -280,14 +305,18 @@ export default {
message: "保存课程成功",
type: "success",
});
// 隐藏dia
this.$parent.$parent.dialogCancel()
} else if (num == 3) {
this.$message({
message: "保存课程成功,请开始录入题目",
type: "success",
});
}
// 跳转动态路由,并且把ID改变添加用
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.changeCourseId(courseId);
}
this.$parent.$parent.$parent.getList();
return true;
......@@ -307,7 +336,7 @@ export default {
.form-wrapper {
padding-top: 22px;
width: 100%;
height: 650px;
height: 680px;
overflow: hidden;
// padding-bottom: 10px;
margin-bottom: 20px;
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -71,12 +71,21 @@
<div class="right">
<div>
<el-button
v-if="!checkLock"
@click="edit(item.topicId)"
icon="el-icon-edit"
type="text"
>修改</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)"
icon="el-icon-delete"
type="text"
......@@ -98,6 +107,7 @@
v-model="bottomFrom.singleChoiceScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -109,6 +119,7 @@
v-model="bottomFrom.multipleChoiceScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -121,6 +132,7 @@
v-model="bottomFrom.judgmentScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -133,6 +145,7 @@
v-model="bottomFrom.qualifiedNum"
style="width: 60px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div>为合格</div>
......@@ -144,6 +157,7 @@
icon="el-icon-check"
size="mini"
type="success"
:disabled="checkLock"
>保存</el-button
>
</div>
......@@ -164,6 +178,9 @@ export default {
courseId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
components: {},
data() {
......@@ -293,10 +310,10 @@ export default {
// 如果有一个没写,就不允许保存
if (
!(
this.bottomFrom.singleChoiceScore > 0 &&
this.bottomFrom.multipleChoiceScore > 0 &&
this.bottomFrom.judgmentScore > 0 &&
this.fobottomFromrm.qualifiedNum > 0
this.bottomFrom.singleChoiceScore >= 0 &&
this.bottomFrom.multipleChoiceScore >= 0 &&
this.bottomFrom.judgmentScore >= 0 &&
this.bottomFrom.qualifiedNum >= 0
)
) {
this.$message({
......
......@@ -131,11 +131,13 @@
prop="topicNum"
width="180"
>
<template v-slot="{ row: { topicNum, courseId } }">
<div @click="checkQuestion(courseId)" class="timuNum">
<div v-if="topicNum > 0">{{ `已录入${topicNum}题` }}</div>
<div v-else>未录入</div>
</div>
<template v-slot="{ row: { topicNum, courseId, status } }">
<span @click="checkQuestion(courseId, status)" class="timuNum">
<span v-if="topicNum > 0">
{{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</span>
<span v-else>未录入</span>
</span>
</template>
</el-table-column>
<el-table-column
......@@ -153,6 +155,14 @@
@click="changeLesson(courseId)"
>修改</el-button
>
<el-button
v-if="status == 1"
size="mini"
type="text"
icon="el-icon-edit"
@click="checkLesson(courseId)"
>详情</el-button
>
<el-button
size="mini"
type="text"
......@@ -165,7 +175,7 @@
size="mini"
type="text"
icon="el-icon-delete"
@click="issueLesson(courseId)"
@click="issueDilog(courseId)"
>发布</el-button
>
</template>
......@@ -183,18 +193,68 @@
ref="Dia"
:componentsNum.sync="componentsNum"
:courseId.sync="courseId"
:checkLock.sync="checkLock"
: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>
</template>
<script>
import {
getQuestion,
getLessons,
getLessonById,
issue,
deleteLesson,
} from "@/api/educationPlanExam/lessonsProgram.js";
// 获取培训计划
import { getPlanList } from "@/api/educationPlanExam/trainingProgram";
import { mapGetters, mapMutations } from "vuex";
......@@ -222,18 +282,39 @@ export default {
courseName: null,
releaseTime: "",
},
// 表单参数
form: {},
// 表单校验
dilogFlag: false,
// 发布弹框
issueVisible: false,
bottomFrom: {
singleChoiceScore: 0,
multipleChoiceScore: 0,
judgmentScore: 0,
qualifiedNum: 0,
},
issueCourseId: null,
questionList: [],
componentsNum: 1,
// 点击的id,如果是新增为空
courseId: null,
// false为编辑,true为查看,查看不允许编辑的时候
checkLock: false,
};
},
computed: {
...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() {
this.getPlanList();
......@@ -275,21 +356,34 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.checkLock = false;
this.$refs.Dia.title = "新增培训课程";
this.componentsNum = 1;
this.courseId = null;
this.dilogFlag = true;
},
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.componentsNum = 1;
this.courseId = courseId;
this.dilogFlag = true;
},
// 直接查看考题
checkQuestion(courseId) {
checkQuestion(courseId, status) {
// 要查看考题的id
if (status == 1) {
this.checkLock = true;
}
this.courseId = courseId;
console.log(this.courseId);
// 2代表列表组件
......@@ -331,9 +425,39 @@ export default {
})
.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) {
this.$confirm("请确定发布", {
this.$confirm("确定要发布吗", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -343,14 +467,14 @@ export default {
return getLessonById(courseId);
})
.then((res) => {
if (
res.data.singleChoiceScore > 0 &&
res.data.multipleChoiceScore > 0 &&
res.data.judgmentScore > 0 &&
res.data.qualifiedNum > 0
) {
// if (
// res.data.singleChoiceScore >= 0 &&
// res.data.multipleChoiceScore >= 0 &&
// res.data.judgmentScore >= 0 &&
// res.data.qualifiedNum >= 0
// ) {
return true;
}
// }
})
.then((res) => {
if (res) {
......@@ -370,6 +494,7 @@ export default {
type: "success",
});
this.getList();
this.issueVisible = false;
}
})
.catch(() => {});
......@@ -469,4 +594,17 @@ export default {
::v-deep .el-dialog {
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>
......@@ -81,7 +81,7 @@
<el-button
size="mini"
type="danger"
v-if="index > 0"
v-if="index > 0 && form.topicType != 3"
@click.prevent="removeDomain(question)"
>删除</el-button
>
......
......@@ -11,9 +11,15 @@
size="mini"
@input="topicTypeChange"
>
<el-radio-button :label="1">单选</el-radio-button>
<el-radio-button :label="2">多选</el-radio-button>
<el-radio-button :label="3">判断</el-radio-button>
<el-radio-button :disabled="checkLock" :label="1"
>单选</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>
</div>
<div class="right">{{ courseName }}</div>
......@@ -28,7 +34,7 @@
:rules="{
required: true,
message: '必须输入题目内容',
trigger: 'blur',
trigger: ['blur', 'change'],
}"
>
<el-input
......@@ -37,6 +43,7 @@
resize="none"
rows="4"
v-model="form.topicTitle"
:disabled="checkLock"
>
</el-input>
</el-form-item>
......@@ -54,7 +61,7 @@
:rules="{
required: true,
message: '第一项不能为空不能为空',
trigger: 'blur',
trigger: ['blur', 'change'],
}"
>
<div class="add-select flex">
......@@ -64,6 +71,7 @@
style="flex: 1; margin-right: 10px"
rows="2"
v-model="question.value"
:disabled="checkLock"
></el-input>
<div class="flex algin-items">
<div
......@@ -76,8 +84,9 @@
<el-button
size="mini"
type="danger"
v-if="index > 0"
v-if="index > 0 && form.topicType != 3"
@click.prevent="removeDomain(question)"
:disabled="checkLock"
>删除</el-button
>
</div>
......@@ -108,7 +117,11 @@
设为正确答案
</div> -->
<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
>
</div>
......@@ -143,6 +156,9 @@ export default {
topicId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
components: {},
data() {
......@@ -229,6 +245,7 @@ export default {
}
},
rightAnswerClick(index) {
if (this.checkLock) return;
if (this.form.topicType === 2) {
const ind = this.answerNum.indexOf(index);
if (ind < 0) {
......@@ -247,6 +264,7 @@ export default {
},
// 删除选项
removeDomain(question) {
if (this.checkLock) return;
const index = this.form.questions.indexOf(question);
console.log(index);
// 如果是正确答案,就让正确答案清空
......@@ -333,9 +351,9 @@ export default {
reset() {
this.form = {
topicTitle: "",
questions: [{ value: "" }, { value: "" }, { value: "" }],
questions: [{ value: "" }, { value: "" }],
};
this.answerNum = null;
this.answerNum = [];
this.addValue = "";
},
},
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-12-27 09:30:19
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -193,7 +193,7 @@ export default {
this.loading = false;
});
},
saveAndNext() {
save(num = 2) {
const topicInfos = this.list
.filter((item) => item.checked)
.map((item) => {
......@@ -202,18 +202,20 @@ export default {
quan: item.changeNum,
};
});
console.log(this.courseId, topicInfos);
const data = { courseId: this.courseId, topicInfos };
console.log(data);
bachAddTopic(data).then((res) => {
console.log(res);
if (res.code == 200) {
this.$parent.$parent.componentsNumChange(2);
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.$parent.getList();
}
});
},
saveAndNext() {
this.save(3);
},
resetClick() {},
search() {
this.getList();
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -24,6 +24,7 @@
:is="currentComponent"
:courseId.sync="courseId"
:topicId.sync="topicId"
:checkLock="checkLock"
ref="current"
></component>
</transition>
......@@ -32,7 +33,7 @@
<QuestionList/> -->
</div>
<div slot="footer" class="dialog-footer">
<!-- <div slot="footer" class="dialog-footer">
<el-button
type="primary"
v-if="this.componentsNum == 2"
......@@ -62,6 +63,51 @@
>{{ "确认" }}</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>
</el-dialog>
</template>
......@@ -86,6 +132,9 @@ export default {
courseId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
// components: {
// Lesson,
......@@ -137,10 +186,8 @@ export default {
text = "保存并录入题目";
} else if (this.componentsNum == 2) {
text = "录入考题";
} else if (this.componentsNum == 3) {
text = "保存并录入下一题";
} else {
text = "确定选择";
text = "保存并录入下一题";
}
return text;
},
......@@ -168,6 +215,7 @@ export default {
this.topicId = null;
}
this.$emit("update:visible", false);
this.$emit("update:checkLock", false);
},
// 把ID改变了
changeCourseId(courseId) {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -16,7 +16,11 @@
:rules="rules"
>
<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>
<div class="top flex">
<el-form-item label="开始时间" prop="testStartTime">
......@@ -27,6 +31,7 @@
type="datetime"
placeholder="选择日期时间"
default-time="00:00:00"
:disabled="checkLock"
/>
</el-form-item>
<el-form-item label="结束时间" prop="testEndTime">
......@@ -36,6 +41,7 @@
type="datetime"
placeholder="选择日期时间"
default-time="00:00:00"
:disabled="checkLock"
/>
</el-form-item>
</div>
......@@ -43,6 +49,7 @@
<ChangePapel
ref="changePaple"
:jsonSelectNameList="jsonSelectNameList"
:disabled="checkLock"
@getPeopleList="getPeopleList"
/>
</el-form-item>
......@@ -70,6 +77,9 @@ export default {
courseId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
components: {
// Editor,
......@@ -196,14 +206,17 @@ export default {
message: "保存课程成功",
type: "success",
});
this.$parent.$parent.dialogCancel();
} else if (num == 3) {
this.$message({
message: "保存课程成功,请开始录入题目",
type: "success",
});
}
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();
return true;
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 17:56:05
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -34,13 +34,15 @@
>
</div>
<div class="detail-item">
判断提<span>{{ bottomFrom.judgmentScore }}</span>/题,共<span>{{ pds }}</span> 题,计<span
class="textC"
>{{ pds * bottomFrom.judgmentScore }}</span
判断提<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
一共<span>{{ danxs + duoxs + pds }}</span>道题,总共计<span class="textC">{{
一共<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
pds * bottomFrom.judgmentScore
......@@ -70,12 +72,21 @@
<div class="right">
<div>
<el-button
v-if="!checkLock"
@click="edit(item.topicId)"
icon="el-icon-edit"
type="text"
>修改</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)"
icon="el-icon-delete"
type="text"
......@@ -106,6 +117,7 @@
v-model="bottomFrom.singleChoiceScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -117,6 +129,7 @@
v-model="bottomFrom.multipleChoiceScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -129,6 +142,7 @@
v-model="bottomFrom.judgmentScore"
style="width: 50px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div></div>
......@@ -141,6 +155,7 @@
v-model="bottomFrom.qualifiedNum"
style="width: 60px"
size="mini"
:disabled="checkLock"
></el-input>
</div>
<div>为合格</div>
......@@ -151,6 +166,7 @@
icon="el-icon-check"
size="mini"
type="success"
:disabled="checkLock"
>保存</el-button
>
</div>
......@@ -171,6 +187,9 @@ export default {
courseId: {
type: Number,
},
checkLock: {
type: Boolean,
},
},
components: {},
data() {
......@@ -297,10 +316,10 @@ export default {
// }
if (
!(
this.bottomFrom.singleChoiceScore > 0 &&
this.bottomFrom.multipleChoiceScore > 0 &&
this.bottomFrom.judgmentScore > 0 &&
this.bottomFrom.qualifiedNum > 0
this.bottomFrom.singleChoiceScore >= 0 &&
this.bottomFrom.multipleChoiceScore >= 0 &&
this.bottomFrom.judgmentScore >= 0 &&
this.bottomFrom.qualifiedNum >= 0
)
) {
this.$message({
......
......@@ -82,15 +82,17 @@
prop="topicNum"
width="180"
>
<template v-slot="{ row: { topicNum, courseId } }">
<div class="timuNum">
<div v-if="topicNum > 0">{{ `已录入${topicNum}题` }}</div>
<div v-else>未录入</div>
</div>
<template v-slot="{ row: { topicNum, courseId, status } }">
<span class="timuNum" @click="checkQuestion(courseId, status)">
<span v-if="topicNum > 0">
{{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</span>
<span v-else>未录入</span>
</span>
</template>
</el-table-column>
<el-table-column
label="答对几题算合格"
label="合格分数"
align="center"
prop="qualifiedNum"
:formatter="formatter"
......@@ -102,17 +104,15 @@
>
<template v-slot="{ row: { status, courseId, qualifiedNum } }">
<!-- <div>{{status}}</div> -->
<el-button
:disabled="status == 1"
<!-- <el-button
v-if="status == 0"
size="mini"
type="text"
icon="el-icon-edit"
@click="checkQuestion(courseId)"
>录入考题</el-button
>
> -->
<el-button
:disabled="status == 1"
v-if="status == 0"
size="mini"
type="text"
......@@ -120,6 +120,14 @@
@click="changeLesson(courseId)"
>编辑</el-button
>
<el-button
v-if="status == 1"
size="mini"
type="text"
icon="el-icon-edit"
@click="checkLesson(courseId)"
>详情</el-button
>
<el-button
size="mini"
type="text"
......@@ -128,13 +136,12 @@
>删除</el-button
>
<el-button
:disabled="status == 1"
v-if="status == 0"
size="mini"
type="text"
icon="el-icon-delete"
@click="issueLesson(courseId, qualifiedNum)"
>发布考试</el-button
@click="issueDilog(courseId)"
>发布</el-button
>
</template>
</el-table-column>
......@@ -151,16 +158,62 @@
ref="Dia"
:componentsNum.sync="componentsNum"
:courseId.sync="courseId"
:checkLock.sync="checkLock"
:visible.sync="dilogFlag"
/>
<el-dialog title="提示" :visible.sync="issue" width="30%">
<div>123</div>
<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>
</template>
<script>
import {
getQuestion,
getLessons,
getLessonById,
issue,
......@@ -200,14 +253,36 @@ export default {
// 表单校验
dilogFlag: false,
// 发布
issueVisible: false,
bottomFrom: {
singleChoiceScore: 0,
multipleChoiceScore: 0,
judgmentScore: 0,
qualifiedNum: 0,
},
issueCourseId: null,
questionList: [],
componentsNum: 1,
// 点击的id,如果是新增为空
courseId: null,
issue: false,
// false为编辑,true为查看,查看不允许编辑的时候
checkLock: false,
};
},
computed: {
...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() {
// this.getPlanList();
......@@ -257,12 +332,22 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.checkLock = false;
this.$refs.Dia.title = "新增考试试卷";
this.componentsNum = 1;
this.courseId = null;
this.dilogFlag = true;
},
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.componentsNum = 1;
this.courseId = courseId;
......@@ -270,8 +355,12 @@ export default {
},
// 直接查看考题
checkQuestion(courseId) {
checkQuestion(courseId, status) {
// 要查看考题的id
if (status == 1) {
this.checkLock = true;
}
this.courseId = courseId;
console.log(this.courseId);
// 2代表列表组件
......@@ -315,8 +404,39 @@ export default {
.catch(() => {});
},
// 发布
issueLesson(courseId, qualifiedNum) {
this.$confirm("请确定发布", {
issueDilog(courseId) {
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: "确定",
cancelButtonText: "取消",
type: "warning",
......@@ -326,14 +446,14 @@ export default {
return getLessonById(courseId);
})
.then((res) => {
if (
res.data.singleChoiceScore > 0 &&
res.data.multipleChoiceScore > 0 &&
res.data.judgmentScore > 0 &&
res.data.qualifiedNum > 0
) {
// if (
// res.data.singleChoiceScore > 0 &&
// res.data.multipleChoiceScore > 0 &&
// res.data.judgmentScore > 0 &&
// res.data.qualifiedNum > 0
// ) {
return true;
}
// }
})
.then((res) => {
if (res) {
......@@ -355,6 +475,7 @@ export default {
type: "success",
});
this.getList();
this.issueVisible = false;
}
})
.catch(() => {});
......@@ -373,7 +494,7 @@ export default {
}
.timuNum {
color: #1d84ff;
// cursor: pointer;
cursor: pointer;
}
::v-deep .el-select {
width: 100%;
......@@ -381,4 +502,17 @@ export default {
::v-deep .el-dialog {
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>
<!--
* @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>
<div class="form-wrapper">
<div style="width: 100%;height:100%;">
<el-form :model="contractTrainForm" :rules="rules" ref="contractTrainForm" label-width="100px" class="demo-ruleForm">
<div style="width: 100%; height: 100%">
<el-form
:model="contractTrainForm"
:rules="rules"
ref="contractTrainForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="培训名称" prop="courseName">
<el-input v-model="contractTrainForm.courseName"></el-input>
</el-form-item>
<el-form-item label="培训内容" prop="courseConent">
<el-input type="textarea" v-model="contractTrainForm.courseConent" rows="5"></el-input>
<el-input
type="textarea"
v-model="contractTrainForm.courseConent"
rows="5"
></el-input>
</el-form-item>
<div class="flex">
<el-form-item label="视频上传" v-if="!readOnly" prop="video">
......@@ -18,7 +28,11 @@
:fileSize="500"
:fileType="['mp4']"
/>
<el-input v-show="false" disabled v-model="contractTrainForm.video"></el-input>
<el-input
v-show="false"
disabled
v-model="contractTrainForm.video"
></el-input>
</el-form-item>
<el-form-item label="附件上传" v-if="!readOnly" prop="enclosure">
<FileUpload
......@@ -27,7 +41,11 @@
@remove="listRemoveFile"
:fileArr="fileListFile"
/>
<el-input v-show="false" disabled v-model="contractTrainForm.enclosure"></el-input>
<el-input
v-show="false"
disabled
v-model="contractTrainForm.enclosure"
></el-input>
</el-form-item>
</div>
</el-form>
......@@ -36,16 +54,16 @@
</div>
</template>
<script>
import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png";
import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQuestion";
import {listCourse} from "@/api/contractTrain/contractTrain";
export default {
import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png";
import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQuestion";
import { listCourse } from "@/api/contractTrain/contractTrain";
export default {
data() {
return {
contractTrainForm: {
courseName: '',
courseConent: '',
courseName: "",
courseConent: "",
video: "",
enclosure: "",
},
......@@ -53,15 +71,11 @@
fileListFile: [],
readOnly: false,
rules: {
name: [
{ required: true, message: '请输入培训名称', trigger: 'blur' }
],
name: [{ required: true, message: "请输入培训名称", trigger: "blur" }],
region: [
{ required: true, message: '请输入培训内容', trigger: 'change' }
],
video: [
{ required: true, trigger: "blue", message: "视频不能为空" }
{ required: true, message: "请输入培训内容", trigger: "change" },
],
video: [{ required: true, trigger: "blue", message: "视频不能为空" }],
enclosure: [
{ required: true, trigger: "blur", message: "附件不能为空" },
],
......@@ -76,10 +90,11 @@
this.getContractTrainList();
},
methods: {
getContractTrainList(){
listCourse().then(res =>{
getContractTrainList() {
listCourse().then((res) => {
this.contractTrainForm = res.rows[0];
if(this.contractTrainForm.video){
console.log("this.contractTrainForm", this.contractTrainForm);
if (this.contractTrainForm.video) {
this.fileListVideo = [
{
name: this.contractTrainForm.courseName + "视频",
......@@ -87,7 +102,7 @@
},
];
}
if(this.contractTrainForm.enclosure){
if (this.contractTrainForm.enclosure) {
this.fileListFile = [
{
name: this.contractTrainForm.courseName + "附件",
......@@ -95,16 +110,27 @@
},
];
}
this.$refs.visitorQuestion.rightNum = this.contractTrainForm.qualifiedNum;
this.$refs.visitorQuestion.getContractTopicList(this.contractTrainForm.contractorCourseId)
})
// 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!');
alert("submit!");
} else {
console.log('error submit!!');
console.log("error submit!!");
return false;
}
});
......@@ -138,8 +164,8 @@
this.contractTrainForm.enclosure = "";
// this.form.fileName = null;
},
}
}
},
};
</script>
<style lang="scss" scoped>
.form-wrapper {
......@@ -148,7 +174,7 @@
height: 100%;
margin-bottom: 20px;
}
.flex{
.flex {
width: 100%;
justify-content: space-around;
padding: 20px 30px;
......
......@@ -5,6 +5,18 @@
目前录入题目是第<span>{{ questionNextNum }}</span
>道题
</div>
<div>
<el-radio-group
v-model="form.topicType"
size="mini"
@input="topicTypeChange"
>
<el-radio-button :label="1">单选</el-radio-button>
<el-radio-button :label="2">多选</el-radio-button>
<el-radio-button :label="3">判断</el-radio-button>
</el-radio-group>
</div>
</div>
<el-form class="form flex" ref="form" :model="form" label-width="auto">
<!-- <div class="top flex"> -->
......@@ -38,15 +50,11 @@
:label="'选项' + (index + 1)"
:key="question.key"
:prop="'questions.' + index + '.value'"
:rules="
index === 0
? {
:rules="{
required: true,
message: '第一项不能为空不能为空',
trigger: 'blur',
}
: {}
"
}"
>
<div class="add-select flex">
<el-input
......@@ -60,7 +68,9 @@
<el-button
@click="rightAnswerClick(index)"
class="right"
:class="{ active: answerNum === index }"
:class="{
active: answerNum.indexOf(index) >= 0,
}"
icon="el-icon-check"
>
设为答案
......@@ -68,7 +78,7 @@
<el-button
size="mini"
type="danger"
v-if="index > 0"
v-if="index > 0 && form.topicType != 3"
@click.prevent="removeDomain(question)"
plain
icon="el-icon-delete"
......@@ -78,7 +88,7 @@
</div>
</el-form-item>
<el-form-item
<!-- <el-form-item
class="noAttr"
:label="`选项${form.questions.length + 1}`"
prop=""
......@@ -112,22 +122,31 @@
>
</div>
</div>
</el-form-item>
</el-form-item> -->
<div style="padding-left: 55px" v-if="form.topicType != 3">
<el-button
size="mini"
style="background: #0bab0c; color: #fff; border: 1px solid #0bab0c"
@click.prevent="add(addValue)"
>新增选项</el-button
>
</div>
</div>
</el-form>
</div>
</template>
</template>
<script>
export default {
export default {
name: "AnswerLesson",
data() {
return {
form: {
topicType: 1,
topicTitle: "",
questions: [{ value: "" }, { value: "" }, { value: "" }],
questions: [{ value: "" }, { value: "" }],
},
answerNum: null,
answerNum: [],
addValue: "",
// 录入的是第几道题
questionNextNum: 1,
......@@ -135,24 +154,79 @@
};
},
created() {
},
created() {},
methods: {
topicTypeChange(num) {
if (num == 1) {
this.answerNum = [];
} else if (num == 2) {
this.answerNum = [];
// this.form.questions=[{ value: "" }, { value: "" }];
} else {
this.answerNum = [];
const form = {
topicType: 3,
topicTitle: this.form.topicTitle,
questions: [{ value: "对" }, { value: "错" }],
};
this.form = form;
}
},
//设置正确答案
// rightAnswerClick(index) {
// this.answerNum = index;
// },
rightAnswerClick(index) {
this.answerNum = index;
if (this.form.topicType === 2) {
const ind = this.answerNum.indexOf(index);
if (ind < 0) {
this.answerNum.push(index);
} else {
this.answerNum.splice(ind, 1);
}
this.answerNum = this.answerNum.sort((a, b) => {
return a - b;
});
console.log(this.answerNum);
} else {
// 判断跟单选模式差不多
this.answerNum = [index];
}
},
// 删除选项
// removeDomain(question) {
// const index = this.form.questions.indexOf(question);
// // 如果是正确答案,就让正确答案清空
// if (this.answerNum === index) {
// this.answerNum = null;
// }
// if (index >= 0) {
// this.form.questions.splice(index, 1);
// }
// },
removeDomain(question) {
const index = this.form.questions.indexOf(question);
console.log(index);
// 如果是正确答案,就让正确答案清空
if (this.answerNum === index) {
this.answerNum = null;
const ind = this.answerNum.indexOf(index);
if (ind >= 0) {
this.answerNum.splice(ind, 1);
}
// 如果是最后一位呗删除,那不用管,如果不是最后一位置,这一位删除之后,则这一位后面的所有数字都要-1;
if (index != this.form.questions.length - 1) {
this.answerNum = this.answerNum.map((item, i) => {
if (item >= index) {
return item - 1;
} else {
return item;
}
});
}
if (index >= 0) {
this.form.questions.splice(index, 1);
}
console.log(this.answerNum);
// console.log(this.form.questions)
},
// 新增选项
add(addValue) {
......@@ -161,16 +235,16 @@
reset() {
this.form = {
topicTitle: "",
questions: [{ value: "" }, { value: "" }, { value: "" }],
questions: [{ value: "" }, { value: "" }],
};
this.answerNum = null;
this.addValue = "";
},
},
};
</script>
};
</script>
<style lang="scss" scoped>
.add-question {
.add-question {
width: 100%;
height: 250px;
// overflow: hidden;
......@@ -257,5 +331,5 @@
text-align: right;
}
}
}
</style>
}
</style>
......@@ -62,11 +62,11 @@
<span>{{ parseTime(scope.row.testEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="正确率" align="center" prop="score">
<template slot-scope="scope">
<span>{{Math.round(scope.row.score/topicNum* 100)}}%</span>
</template>
</el-table-column>
<!-- <el-table-column label="正确率" align="center" prop="score">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{Math.round(scope.row.score/topicNum* 100)}}%</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="是否合格" align="center" prop="isQualified">
<template slot-scope="scope">
<span v-if="scope.row.isQualified == '0'">合格</span>
......
......@@ -90,7 +90,7 @@
<div class="ent-b-car1">
<div class="a-car-out">
<div>人员出场</div>
<div style="color: #c5c6c7;font-size: 14px;">出入记录</div>
<!--<div style="color: #c5c6c7;font-size: 14px;">出入记录</div>-->
</div>
<div class="ent-div"></div>
<div class="ent-b-in">
......@@ -120,14 +120,14 @@
<div class="ent-b-car1">
<div class="a-car-out">
<div>车辆出场</div>
<div style="color: #c5c6c7;font-size: 14px;">出入记录</div>
<!--<div style="color: #c5c6c7;font-size: 14px;">出入记录</div>-->
</div>
<div class="ent-div"></div>
<div class="ent-b-in">
<img src="../../assets/img/car.png" alt="">
<div>车辆类型:<span></span>{{lastExportCarData ? lastExportCarData.cName : "-"}}</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>
......
......@@ -60,6 +60,7 @@
style="margin: 0px 0px 25px 0px;color: #3db0ff;"
>记住密码</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-button
:loading="loading"
......@@ -254,4 +255,12 @@ export default {
.login-code-img {
height: 38px;
}
.certificateDownload{
color: #3e9ced;
float: right;
font-size: 14px;
}
.certificateDownload:hover{
color: #bfbfbf;
}
</style>
......@@ -83,18 +83,17 @@
<span v-else>-</span>
</template>
</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" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.status == '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
<!--<el-button
v-if="scope.row.status == '0'"
size="mini"
type="text"
......@@ -114,9 +113,8 @@
type="text"
icon="el-icon-edit"
@click="handleInvalid(scope.row)"
>作废</el-button>
>作废</el-button>-->
<el-button
v-if="scope.row.status == '0'"
size="mini"
type="text"
icon="el-icon-delete"
......@@ -191,10 +189,10 @@
</span>
<span v-else>-</span>
</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="0">驳回</el-radio>
</el-form-item>
</el-form-item>-->
</div>
<div style="width: 58%;margin-left: 2%">
<div class="dialogTitle">法律法规内容</div>
......
......@@ -150,7 +150,7 @@
</el-col>
</el-row>
<!-- 添加或修改参数配置对话框 -->
<!-- 添加参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
......@@ -238,7 +238,7 @@
<el-row>
<el-col :span="11">
<el-form-item label="角色">
<el-select v-model="form.roleId" placeholder="请选择角色" style="width: 100%">
<el-select v-model="form.roleIds" multiple placeholder="请选择">
<el-option
v-for="item in roleOptions"
:key="item.roleId"
......@@ -249,6 +249,9 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
......@@ -294,7 +297,151 @@
<el-button @click="cancel">取 消</el-button>
</div>
</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>
</template>
......@@ -303,6 +450,7 @@ import { listStaff, getStaff, delStaff, addStaff, updateStaff, exportStaff } fro
import { treeselect } from "@/api/system/dept";
import MyFileUpload from '@/components/MyFileUpload';
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";
export default {
......@@ -333,6 +481,8 @@ export default {
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 修改是否显示弹出层
opens: false,
openDetail: false,
// 部门名称
deptName: undefined,
......@@ -431,6 +581,7 @@ export default {
// 取消按钮
cancel() {
this.open = false;
this.opens = false;
this.reset();
},
cancelDetail() {
......@@ -495,7 +646,13 @@ export default {
this.getTreeselect();
// this.open = true;
// 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.roleOptions = response.roles;
this.open = true;
......@@ -507,16 +664,18 @@ export default {
this.reset();
this.getTreeselect();
const staffId = row.staffId || this.ids;
getUser().then(response => {
this.roleOptions = response.roles;
});
getStaff(staffId).then(response => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
if (this.form.certificateUrl) {
this.fileList.push({
url: this.form.certificateUrl,
});
}
this.open = true;
this.opens = true;
this.title = "修改员工信息";
});
},
......@@ -524,11 +683,10 @@ export default {
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
console.log("this.form",this.form)
if (this.form.staffId != null) {
updateStaff(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.opens = false;
this.getList();
});
} 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>
<img :src="src" style=" position: relative;
left: 37%;
top: 10%;
width: 27%;">
<img :src="src" style="position: relative; left: 37%; top: 10%; width: 27%" />
</template>
<script>
const src = require('../qRCode/img/qrcode_1673250700723.png')
export default{
computed:{
src(){
return src
}
}
}
const src = require("../qRCode/img/qrcode_1673250700723.png");
export default {
computed: {
src() {
return src;
},
},
};
</script>
<template>
<div style="padding:10px 0 0 20px">
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<h3>个人信息录入</h3>
<h3>个人信息录入</h3>
<el-form-item label="单位" prop="beyondUnit">
<el-input
style="width: 70%;"
style="width: 70%"
placeholder="请输入单位"
v-model="form.beyondUnit"
maxlength="30"
clearable>
clearable
>
</el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input
style="width: 70%;"
style="width: 70%"
placeholder="请输入姓名"
v-model="form.name"
maxlength="11"
clearable>
clearable
>
</el-input>
</el-form-item>
......@@ -31,27 +33,26 @@
<el-form-item label="手机号">
<el-input
style="width: 70%;"
style="width: 70%"
placeholder="手机号"
v-model="form.phoneNum"
type="number"
maxlength="11"
clearable>
clearable
>
</el-input>
</el-form-item>
<el-form-item>
<el-button @click="onSubmit" type="primary" >下一步</el-button>
<el-button @click="onSubmit" type="primary">下一步</el-button>
<el-button>取消</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
export default {
name: "EnterInformation",
data() {
return {
......@@ -60,9 +61,9 @@
name: null,
sex: null,
phoneNum: null,
testBeginTime:null,
testBeginTime: null,
},
}
};
},
methods: {
/**
......@@ -99,43 +100,41 @@
dateArr[4];
//此处可以拿外部的变量接收 strDate:2022-05-01 13:25:30
//this.date = strDate;
this.form.testBeginTime=strDate;
this.form.testBeginTime = strDate;
},
onSubmit() {
this.currentTime();
// let params = this.form;
let params = JSON.stringify(this.form);
console.log(this.form.beyondUnit)
if (!this.form.beyondUnit){
console.log(params.beyondUnit)
this.$message('请输入单位');
}else if (!this.form.name){
this.$message('请输入姓名');
}else if (!this.form.sex){
this.$message('请选择性别');
}else if (!this.form.phoneNum){
this.$message('请输入手机号');
}else if (this.form.phoneNum.length>11){
this.$message('长度超出11位');
console.log(this.form.beyondUnit);
if (!this.form.beyondUnit) {
console.log(params.beyondUnit);
this.$message("请输入单位");
} else if (!this.form.name) {
this.$message("请输入姓名");
} else if (!this.form.sex) {
this.$message("请选择性别");
} else if (!this.form.phoneNum) {
this.$message("请输入手机号");
} else if (this.form.phoneNum.length > 11) {
this.$message("长度超出11位");
} else {
const routeData = this.$router.resolve({
path: '/trainingMaterials', //跳转目标窗口的地址
path: "/trainingMaterials", //跳转目标窗口的地址
query: {
params //括号内是要传递给新窗口的参数
}
})
params, //括号内是要传递给新窗口的参数
},
});
window.open(routeData.href, "_search");
}
},
next() {
if (this.active++ > 2) this.active = 0;
}
}
}
},
},
};
</script>
<style>
</style>
......@@ -11,17 +11,26 @@
destroy-on-close
>
<div ref="myBody" class="body" v-loading="loading">
<!-- <div class="text">-->
<!-- <div class="float">访客和供应商培训管理</div>-->
<!-- </div>-->
<!-- <div class="text">-->
<!-- <div class="float">访客和供应商培训管理</div>-->
<!-- </div>-->
<transition name="fade" mode="out-in">
<div :key="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 v-for="(item, index) in list" :key="item.id">
<!-- <Question
style="width: 89%"
v-if="index === nowQuestion"
:questionObj="item"
:index="index"
:nowQuestion="nowQuestion"
:selectLetter="selectLetter"
@changeLetter="changeLetter"
/> -->
<template v-if="item.topicType == 1 || item.topicType === 3">
<Question
style="width: 89%;"
v-if="index === nowQuestion"
:questionObj="item"
:index="index"
......@@ -29,6 +38,17 @@
: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>
......@@ -65,9 +85,9 @@
</div>
<div slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="closeFinished" v-if="goodJobShow"-->
<!-- >重新考试</el-button-->
<!-- >-->
<!-- <el-button type="primary" @click="closeFinished" v-if="goodJobShow"-->
<!-- >重新考试</el-button-->
<!-- >-->
<el-button type="primary" @click="closeFinished" v-if="goodJobShow"
>确定</el-button
>
......@@ -80,17 +100,15 @@
</template>
<script>
import Question from "../Trainingmaterials/components/Question";
import GoodJob from "../Trainingmaterials/components/GoodJob.vue";
import {
import Question from "../Trainingmaterials/components/Question";
import QuestionChoice from "../Trainingmaterials/components/QuestionChoice";
import GoodJob from "./components/GoodJob.vue";
import {
userQuestionList,
setAnswer,
} from "@/api/educationPlanExam/lessonsProgram";
import {
listTopic,
setEsult
} from "@/api/contractTrain/contractTrainTopic";
export default {
} from "@/api/educationPlanExam/lessonsProgram";
import { listTopic, setEsult } from "@/api/contractTrain/contractTrainTopic";
export default {
name: "AnswerLesson",
props: {
visible: {
......@@ -104,11 +122,12 @@
type: [Number, String],
},
},
from:{
answers:{}
from: {
answers: {},
},
components: {
Question,
QuestionChoice,
GoodJob,
},
data() {
......@@ -118,7 +137,7 @@
goodJobShow: false,
goodJobData: {},
loading: false,
from:{},
from: {},
list: [
{
id: 19,
......@@ -128,7 +147,7 @@
],
answerArr: [],
// 题目是否被答过,如果答过,就把值传回去,如果没有答过,就是空
selectLetter: 999,
selectLetter: [],
};
},
// watch: {
......@@ -147,6 +166,7 @@
return {
id: item.topicId,
text: item.topicTitle,
topicType: item.topicType,
question: JSON.parse(item.topicOption).map((item) => item.value),
};
});
......@@ -157,16 +177,25 @@
this.startHeight = this.$refs.myBody.offsetHeight - 55 + "px";
},
dialogSubmitForm() {
console.log(JSON.parse(this.$route.query.params))
// console.log(JSON.parse(this.$route.query.params));
// this.answerClear();
// this.$emit("update:visible", false);
this.saveBody();
const answers = this.answerArr.map((item) => item.answer).join(",");
this.form=JSON.parse(this.$route.query.params);
// 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.form = JSON.parse(this.$route.query.params);
// this.form={
// beyondUnit:'1111',
// name:'zzz',
// sex:1,
// phoneNum:13012341234
// }
this.loading = true;
this.form.answers = answers;
this.loading = true;
console.log(this.form)
this.form.answers=answers
console.log(this.form)
setEsult(this.form)
.then((res) => {
if (res.code == 200) {
......@@ -177,7 +206,7 @@
.finally(() => {
this.loading = false;
// 是否作对
this.$emit('jj',this.goodJobData)
this.$emit("jj", this.goodJobData);
});
},
dialogCancel() {
......@@ -186,10 +215,9 @@
// 关闭之后
closeFinished() {
const routeData = this.$router.resolve({
path: '/enterInformation', //跳转目标窗口的地址
query: {
}
})
path: "/enterInformation", //跳转目标窗口的地址
query: {},
});
window.open(routeData.href, "_search");
// this.answerClear();
this.goodJobShow = false;
......@@ -209,8 +237,7 @@
this.nowQuestion = index;
}
// 赋值,如果答过的,就传回去,如果没答过,就是空 变成字符串是因为0位false
this.selectLetter =
this.answerArr[this.nowQuestion]?.answer + "" || 99999;
this.selectLetter = this.answerArr[this.nowQuestion]?.answer || [];
},
nextBtnClick() {
// 到头了,打完了
......@@ -232,7 +259,7 @@
},
changeLetter(letter) {
console.log(letter);
console.log(this.$route.query) // 输出为:{params:"message"}
console.log(this.$route.query); // 输出为:{params:"message"}
const obj = {};
obj.questionNum = this.nowQuestion + 1;
obj.answer = letter;
......@@ -252,11 +279,11 @@
// console.log(this.answerArr);
},
},
};
};
</script>
<style lang="scss" scoped>
.body {
width: 120%;
.body {
width: 100%;
height: 100%;
padding-right: 40px;
padding-left: 20px;
......@@ -322,5 +349,5 @@
}
}
}
}
}
</style>
......@@ -13,13 +13,30 @@
<div ref="myBody" class="body" v-loading="loading">
<div class="text">
<div class="float">炼铁车间炉前工安全生产规范课程</div>
</div>
<transition name="fade" mode="out-in">
<div :key="goodJobShow">
<template v-if="!goodJobShow">
<!-- <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">
<Question
v-if="index === nowQuestion"
:questionObj="item"
:index="index"
:nowQuestion="nowQuestion"
:selectLetter="selectLetter"
@changeLetter="changeLetter"
/>
</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"
......@@ -28,6 +45,17 @@
: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>
......@@ -77,7 +105,7 @@
<script>
import Question from "./Question";
import GoodJob from "./GoodJob.vue";
import GoodJob from "./GoodJobOld.vue";
import {
userQuestionList,
setAnswer,
......@@ -148,7 +176,9 @@ export default {
// this.answerClear();
// this.$emit("update:visible", false);
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;
setAnswer({
userCourseId: this.userCourseId,
......@@ -158,13 +188,12 @@ export default {
if (res.code == 200) {
this.goodJobData = res.data;
this.goodJobShow = true;
}
})
.finally(() => {
this.loading = false;
// 是否作对
this.$emit('jj',this.goodJobData)
this.$emit("jj", this.goodJobData);
});
},
dialogCancel() {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 17:20:49
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -13,17 +13,16 @@
<template v-if="goodJobData.answer >= goodJobData.qualifiedNum">
<div class="icon"><i class="iconfont icon-smiling" /></div>
<div>
恭喜你,做对{{ goodJobData.answer }}道题得分{{
Math.floor((goodJobData.answer / goodJobData.topicNum) * 100)
}},成绩合格!
<!-- 恭喜你,做对{{ goodJobData.answer }}道题 -->
恭喜你,得分{{ goodJobData.answer }},成绩合格!
</div>
</template>
<template v-else>
<div class="icon"><i class="iconfont icon-nanguo" /></div>
<div>
继续努力,做对{{ goodJobData.answer }}道题得分{{
Math.floor((goodJobData.answer / goodJobData.topicNum) * 100)
}},成绩不合格!
继续努力,
<!-- 做对{{ goodJobData.answer }}道题 -->
得分{{ goodJobData.answer }},成绩不合格!
</div>
</template>
</div>
......@@ -49,16 +48,16 @@ export default {
.goodjob-wrapper {
justify-content: center;
align-items: center;
width: 86%;
width: 100%;
height: 100%;
border-bottom: 1px solid #bbbbbb;
.text {
width: 94%;
height: 174px;
width: 100%;
height: 136px;
color: #1d84ff;
background: #f9f9f9 100%;
border-radius: 15px;
line-height: 40px;
line-height: 136px;
font-size: 28px;
justify-content: center;
align-items: center;
......
......@@ -163,7 +163,7 @@
methods: {
getPlanList() {
//跳转页面的传值
console.log(JSON.parse(this.$route.query.params).beyondUnit)
// console.log(JSON.parse(this.$route.query.params).beyondUnit)
ITContractorTrainCourse().then((res) => {
this.data=res.data;
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