Commit 460f791c authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	danger-manage-web/src/views/educationPlanExam/myLessons/CheckLesson/index.vue
parents da704ed1 7321ff8b
......@@ -45,6 +45,16 @@ public class TContractorTrainCourseController extends BaseController
return getDataTable(list);
}
/**
* 查询承包商及访客培训信息
* @param tContractorTrainCourse
* @return
*/
@GetMapping("/getITContractorTrainCourse")
public AjaxResult getITContractorTrainCourse(TContractorTrainCourse tContractorTrainCourse){
return AjaxResult.success(tContractorTrainCourseService.getITContractorTrainCourse(tContractorTrainCourse));
}
/**
* 导出承包商及访客培训列表
*/
......
......@@ -39,7 +39,7 @@ public class TSafetyCommitmentAnnouncementController extends BaseController
/**
* 查询安全承诺公告列表
*/
@PreAuthorize("@ss.hasPermi('system:announcement:list')")
// @PreAuthorize("@ss.hasPermi('system:announcement:list')")
@GetMapping("/list")
public TableDataInfo list(TSafetyCommitmentAnnouncement tSafetyCommitmentAnnouncement)
{
......
package com.zehong.web.controller.system;
import java.util.Date;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TContractorTrainResult;
import com.zehong.system.service.ITContractorTrainResultService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 承包商及访客培训考试结果详情Controller
*
* @author zehong
* @date 2022-12-27
*/
@RestController
@RequestMapping("/system/result")
public class TContractorTrainResultController extends BaseController
{
@Autowired
private ITContractorTrainResultService tContractorTrainResultService;
/**
* 查询承包商及访客培训考试结果详情列表
*/
//@PreAuthorize("@ss.hasPermi('system:result:list')")
@GetMapping("/list")
public TableDataInfo list(TContractorTrainResult tContractorTrainResult)
{
startPage();
List<TContractorTrainResult> list = tContractorTrainResultService.selectTContractorTrainResultList(tContractorTrainResult);
return getDataTable(list);
}
/**
* 导出承包商及访客培训考试结果详情列表
*/
//@PreAuthorize("@ss.hasPermi('system:result:export')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TContractorTrainResult tContractorTrainResult)
{
List<TContractorTrainResult> list = tContractorTrainResultService.selectTContractorTrainResultList(tContractorTrainResult);
ExcelUtil<TContractorTrainResult> util = new ExcelUtil<TContractorTrainResult>(TContractorTrainResult.class);
return util.exportExcel(list, "承包商及访客培训考试结果详情数据");
}
/**
* 获取承包商及访客培训考试结果详情详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:result:query')")
@GetMapping(value = "/{resultId}")
public AjaxResult getInfo(@PathVariable("resultId") Long resultId)
{
return AjaxResult.success(tContractorTrainResultService.selectTContractorTrainResultById(resultId));
}
/**
* 新增承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:result:add')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TContractorTrainResult tContractorTrainResult)
{
return toAjax(tContractorTrainResultService.insertTContractorTrainResult(tContractorTrainResult));
}
@ApiOperation("用户课程考试交卷")
@GetMapping("/examination")
public AjaxResult examination( TContractorTrainResult tContractorTrainResult){
//结束时间
tContractorTrainResult.setTestEndTime(new Date());
Map<String, Object> examination = tContractorTrainResultService.examination(tContractorTrainResult);
return AjaxResult.success(examination);
}
/**
* 修改承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:result:edit')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TContractorTrainResult tContractorTrainResult)
{
return toAjax(tContractorTrainResultService.updateTContractorTrainResult(tContractorTrainResult));
}
/**
* 删除承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:result:remove')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{resultIds}")
public AjaxResult remove(@PathVariable Long[] resultIds)
{
return toAjax(tContractorTrainResultService.deleteTContractorTrainResultByIds(resultIds));
}
}
package com.zehong.web.controller.system;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TContractorTrainResultDetail;
import com.zehong.system.service.ITContractorTrainResultDetailService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 承包商及访客培训考试结果详情Controller
*
* @author wu
* @date 2022-12-30
*/
@RestController
@RequestMapping("/system/detail")
public class TContractorTrainResultDetailController extends BaseController
{
@Autowired
private ITContractorTrainResultDetailService tContractorTrainResultDetailService;
/**
* 查询承包商及访客培训考试结果详情列表
*/
//@PreAuthorize("@ss.hasPermi('system:detail:list')")
@GetMapping("/list")
public TableDataInfo list(TContractorTrainResultDetail tContractorTrainResultDetail)
{
startPage();
List<TContractorTrainResultDetail> list = tContractorTrainResultDetailService.selectTContractorTrainResultDetailList(tContractorTrainResultDetail);
return getDataTable(list);
}
/**
* 导出承包商及访客培训考试结果详情列表
*/
//@PreAuthorize("@ss.hasPermi('system:detail:export')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TContractorTrainResultDetail tContractorTrainResultDetail)
{
List<TContractorTrainResultDetail> list = tContractorTrainResultDetailService.selectTContractorTrainResultDetailList(tContractorTrainResultDetail);
ExcelUtil<TContractorTrainResultDetail> util = new ExcelUtil<TContractorTrainResultDetail>(TContractorTrainResultDetail.class);
return util.exportExcel(list, "承包商及访客培训考试结果详情数据");
}
/**
* 获取承包商及访客培训考试结果详情详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:detail:query')")
@GetMapping(value = "/{detailId}")
public AjaxResult getInfo(@PathVariable("detailId") Long detailId)
{
return AjaxResult.success(tContractorTrainResultDetailService.selectTContractorTrainResultDetailById(detailId));
}
/**
* 新增承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:detail:add')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TContractorTrainResultDetail tContractorTrainResultDetail)
{
return toAjax(tContractorTrainResultDetailService.insertTContractorTrainResultDetail(tContractorTrainResultDetail));
}
/**
* 修改承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:detail:edit')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TContractorTrainResultDetail tContractorTrainResultDetail)
{
return toAjax(tContractorTrainResultDetailService.updateTContractorTrainResultDetail(tContractorTrainResultDetail));
}
/**
* 删除承包商及访客培训考试结果详情
*/
//@PreAuthorize("@ss.hasPermi('system:detail:remove')")
@Log(title = "承包商及访客培训考试结果详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{detailIds}")
public AjaxResult remove(@PathVariable Long[] detailIds)
{
return toAjax(tContractorTrainResultDetailService.deleteTContractorTrainResultDetailByIds(detailIds));
}
}
......@@ -41,6 +41,7 @@ public class TTrainCourseBankController extends BaseController
public TableDataInfo list(TTrainCourseBank tTrainCourseBank)
{
startPage();
System.out.println(tTrainCourseBank);
List<TTrainCourseBank> list = tTrainCourseBankService.selectTTrainCourseBankList(tTrainCourseBank);
return getDataTable(list);
}
......
package com.zehong.framework.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
......@@ -103,11 +104,17 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js"
"/**/*.js",
"/contractTrain/getITContractorTrainCourse",
"/contractTrain/list",
"/system/result/list",
"/contractTrainTopic/list",
"/system/result/**"
).permitAll()
.antMatchers(
HttpMethod.POST,
"/subscription/**"
"/subscription/**",
"/system/result/**"
).permitAll()
.antMatchers("/profile/**").anonymous()
.antMatchers("/common/download**").anonymous()
......
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 承包商及访客培训考试结果详情对象 t_contractor_train_result
*
* @author zehong
* @date 2022-12-27
*/
public class TContractorTrainResult extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 结果id */
private Long resultId;
/** 所属单位 */
@Excel(name = "所属单位")
private String beyondUnit;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 性别:0 男,1 女 */
@Excel(name = "性别:0 男,1 女")
private String sex;
/** 手机号 */
@Excel(name = "手机号")
private String phoneNum;
/** 考试开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "考试开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date testBeginTime;
/** 考试结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "考试结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date testEndTime;
/** 答对数量 */
@Excel(name = "答对数量")
private String score;
/** 是否合格:0 合格,1 不合格 */
@Excel(name = "是否合格:0 合格,1 不合格")
private String isQualified;
/** 是否删除(0正常,1删除) */
private String isDel;
private String answers;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getAnswers() {
return answers;
}
public void setAnswers(String answers) {
this.answers = answers;
}
public void setResultId(Long resultId)
{
this.resultId = resultId;
}
public Long getResultId()
{
return resultId;
}
public void setBeyondUnit(String beyondUnit)
{
this.beyondUnit = beyondUnit;
}
public String getBeyondUnit()
{
return beyondUnit;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getSex()
{
return sex;
}
public void setPhoneNum(String phoneNum)
{
this.phoneNum = phoneNum;
}
public String getPhoneNum()
{
return phoneNum;
}
public void setTestBeginTime(Date testBeginTime)
{
this.testBeginTime = testBeginTime;
}
public Date getTestBeginTime()
{
return testBeginTime;
}
public void setTestEndTime(Date testEndTime)
{
this.testEndTime = testEndTime;
}
public Date getTestEndTime()
{
return testEndTime;
}
public void setScore(String score)
{
this.score = score;
}
public String getScore()
{
return score;
}
public void setIsQualified(String isQualified)
{
this.isQualified = isQualified;
}
public String getIsQualified()
{
return isQualified;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return "TContractorTrainResult{" +
"resultId=" + resultId +
", beyondUnit='" + beyondUnit + '\'' +
", name='" + name + '\'' +
", sex='" + sex + '\'' +
", phoneNum='" + phoneNum + '\'' +
", testBeginTime=" + testBeginTime +
", testEndTime=" + testEndTime +
", score='" + score + '\'' +
", isQualified='" + isQualified + '\'' +
", isDel='" + isDel + '\'' +
", answers='" + answers + '\'' +
'}';
}
}
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 承包商及访客培训考试结果详情对象 t_contractor_train_result_detail
*
* @author wu
* @date 2022-12-30
*/
public class TContractorTrainResultDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 结果详情id */
private Long detailId;
/** 结果关联id */
@Excel(name = "结果关联id")
private Long resultId;
/** 题目内容 */
@Excel(name = "题目内容")
private String topicTitle;
/** 题目选项(json) */
@Excel(name = "题目选项", readConverterExp = "j=son")
private String topicOption;
/** 答案 */
@Excel(name = "答案")
private Integer answer;
/** 所选答案 */
@Excel(name = "所选答案")
private Integer answerChoice;
/** 答题结果:0 对,1 错 */
@Excel(name = "答题结果:0 对,1 错")
private String result;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
public void setDetailId(Long detailId)
{
this.detailId = detailId;
}
public Long getDetailId()
{
return detailId;
}
public void setResultId(Long resultId)
{
this.resultId = resultId;
}
public Long getResultId()
{
return resultId;
}
public void setTopicTitle(String topicTitle)
{
this.topicTitle = topicTitle;
}
public String getTopicTitle()
{
return topicTitle;
}
public void setTopicOption(String topicOption)
{
this.topicOption = topicOption;
}
public String getTopicOption()
{
return topicOption;
}
public void setAnswer(Integer answer)
{
this.answer = answer;
}
public Integer getAnswer()
{
return answer;
}
public void setAnswerChoice(Integer answerChoice)
{
this.answerChoice = answerChoice;
}
public Integer getAnswerChoice()
{
return answerChoice;
}
public void setResult(String result)
{
this.result = result;
}
public String getResult()
{
return result;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("detailId", getDetailId())
.append("resultId", getResultId())
.append("topicTitle", getTopicTitle())
.append("topicOption", getTopicOption())
.append("answer", getAnswer())
.append("answerChoice", getAnswerChoice())
.append("result", getResult())
.append("createTime", getCreateTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
......@@ -58,4 +58,11 @@ public interface TContractorTrainCourseMapper
* @return 结果
*/
public int deleteTContractorTrainCourseByIds(Long[] contractorCourseIds);
/**
* 查询承包商及访客培训
* @param tContractorTrainCourse
* @return
*/
TContractorTrainCourse getITContractorTrainCourse(TContractorTrainCourse tContractorTrainCourse);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TContractorTrainResultDetail;
/**
* 承包商及访客培训考试结果详情Mapper接口
*
* @author wu
* @date 2022-12-30
*/
public interface TContractorTrainResultDetailMapper
{
/**
* 查询承包商及访客培训考试结果详情
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
public TContractorTrainResultDetail selectTContractorTrainResultDetailById(Long detailId);
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情集合
*/
public List<TContractorTrainResultDetail> selectTContractorTrainResultDetailList(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
public int insertTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
public int updateTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 删除承包商及访客培训考试结果详情
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultDetailById(Long detailId);
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param detailIds 需要删除的数据ID
* @return 结果
*/
public int deleteTContractorTrainResultDetailByIds(Long[] detailIds);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TContractorTrainResult;
/**
* 承包商及访客培训考试结果详情Mapper接口
*
* @author zehong
* @date 2022-12-27
*/
public interface TContractorTrainResultMapper
{
/**
* 查询承包商及访客培训考试结果详情
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
public TContractorTrainResult selectTContractorTrainResultById(Long resultId);
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情集合
*/
public List<TContractorTrainResult> selectTContractorTrainResultList(TContractorTrainResult tContractorTrainResult);
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
public int insertTContractorTrainResult(TContractorTrainResult tContractorTrainResult);
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
public int updateTContractorTrainResult(TContractorTrainResult tContractorTrainResult);
/**
* 删除承包商及访客培训考试结果详情
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultById(Long resultId);
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param resultIds 需要删除的数据ID
* @return 结果
*/
public int deleteTContractorTrainResultByIds(Long[] resultIds);
}
......@@ -58,4 +58,11 @@ public interface ITContractorTrainCourseService
* @return 结果
*/
public int deleteTContractorTrainCourseById(Long contractorCourseId);
/**
* 查询承包商及访客培训
* @param tContractorTrainCourse
* @return
*/
TContractorTrainCourse getITContractorTrainCourse(TContractorTrainCourse tContractorTrainCourse);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TContractorTrainResultDetail;
/**
* 承包商及访客培训考试结果详情Service接口
*
* @author wu
* @date 2022-12-30
*/
public interface ITContractorTrainResultDetailService
{
/**
* 查询承包商及访客培训考试结果详情
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
public TContractorTrainResultDetail selectTContractorTrainResultDetailById(Long detailId);
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情集合
*/
public List<TContractorTrainResultDetail> selectTContractorTrainResultDetailList(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
public int insertTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
public int updateTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail);
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param detailIds 需要删除的承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultDetailByIds(Long[] detailIds);
/**
* 删除承包商及访客培训考试结果详情信息
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultDetailById(Long detailId);
}
package com.zehong.system.service;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TContractorTrainResult;
/**
* 承包商及访客培训考试结果详情Service接口
*
* @author zehong
* @date 2022-12-27
*/
public interface ITContractorTrainResultService
{
/**
* 查询承包商及访客培训考试结果详情
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
public TContractorTrainResult selectTContractorTrainResultById(Long resultId);
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情集合
*/
public List<TContractorTrainResult> selectTContractorTrainResultList(TContractorTrainResult tContractorTrainResult);
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
public int insertTContractorTrainResult(TContractorTrainResult tContractorTrainResult);
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
public int updateTContractorTrainResult(TContractorTrainResult tContractorTrainResult);
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param resultIds 需要删除的承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultByIds(Long[] resultIds);
/**
* 删除承包商及访客培训考试结果详情信息
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 结果
*/
public int deleteTContractorTrainResultById(Long resultId);
/**
* 用户课程考试交卷
* @param tContractorTrainResult
*/
Map<String,Object> examination(TContractorTrainResult tContractorTrainResult);
}
......@@ -92,4 +92,14 @@ public class TContractorTrainCourseServiceImpl implements ITContractorTrainCours
{
return tContractorTrainCourseMapper.deleteTContractorTrainCourseById(contractorCourseId);
}
/**
* 查询承包商及访客培训
* @param tContractorTrainCourse
* @return
*/
@Override
public TContractorTrainCourse getITContractorTrainCourse(TContractorTrainCourse tContractorTrainCourse) {
return tContractorTrainCourseMapper.getITContractorTrainCourse(tContractorTrainCourse);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TContractorTrainCourseTopicMapper;
import com.zehong.system.domain.TContractorTrainCourse;
import com.zehong.system.domain.TContractorTrainCourseTopic;
import com.zehong.system.mapper.TContractorTrainCourseMapper;
import com.zehong.system.mapper.TContractorTrainCourseTopicMapper;
import com.zehong.system.service.ITContractorTrainCourseTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 承包商及访客培训题库Service业务层处理
......@@ -19,6 +24,8 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
{
@Autowired
private TContractorTrainCourseTopicMapper tContractorTrainCourseTopicMapper;
@Resource
private TContractorTrainCourseMapper tContractorTrainCourseMapper;
/**
* 查询承包商及访客培训题库
......@@ -51,8 +58,14 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertTContractorTrainCourseTopic(TContractorTrainCourseTopic tContractorTrainCourseTopic)
{
TContractorTrainCourse course = tContractorTrainCourseMapper.selectTContractorTrainCourseById(tContractorTrainCourseTopic.getContractorCourseId());
if(course!=null){
course.setTopicNum(course.getTopicNum()+1);
tContractorTrainCourseMapper.updateTContractorTrainCourse(course);
}
tContractorTrainCourseTopic.setCreateTime(DateUtils.getNowDate());
return tContractorTrainCourseTopicMapper.insertTContractorTrainCourseTopic(tContractorTrainCourseTopic);
}
......@@ -76,8 +89,18 @@ public class TContractorTrainCourseTopicServiceImpl implements ITContractorTrain
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteTContractorTrainCourseTopicByIds(Long[] topicIds)
{
for(Long topicId : topicIds){
TContractorTrainCourseTopic topic = tContractorTrainCourseTopicMapper.selectTContractorTrainCourseTopicById(topicId);
TContractorTrainCourse course = tContractorTrainCourseMapper.selectTContractorTrainCourseById(topic.getContractorCourseId());
if(course!=null){
course.setTopicNum(course.getTopicNum() - 1);
tContractorTrainCourseMapper.updateTContractorTrainCourse(course);
}
}
return tContractorTrainCourseTopicMapper.deleteTContractorTrainCourseTopicByIds(topicIds);
}
......
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TContractorTrainResultDetailMapper;
import com.zehong.system.domain.TContractorTrainResultDetail;
import com.zehong.system.service.ITContractorTrainResultDetailService;
/**
* 承包商及访客培训考试结果详情Service业务层处理
*
* @author wu
* @date 2022-12-30
*/
@Service
public class TContractorTrainResultDetailServiceImpl implements ITContractorTrainResultDetailService
{
@Autowired
private TContractorTrainResultDetailMapper tContractorTrainResultDetailMapper;
/**
* 查询承包商及访客培训考试结果详情
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
@Override
public TContractorTrainResultDetail selectTContractorTrainResultDetailById(Long detailId)
{
return tContractorTrainResultDetailMapper.selectTContractorTrainResultDetailById(detailId);
}
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情
*/
@Override
public List<TContractorTrainResultDetail> selectTContractorTrainResultDetailList(TContractorTrainResultDetail tContractorTrainResultDetail)
{
return tContractorTrainResultDetailMapper.selectTContractorTrainResultDetailList(tContractorTrainResultDetail);
}
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
@Override
public int insertTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail)
{
tContractorTrainResultDetail.setCreateTime(DateUtils.getNowDate());
return tContractorTrainResultDetailMapper.insertTContractorTrainResultDetail(tContractorTrainResultDetail);
}
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResultDetail 承包商及访客培训考试结果详情
* @return 结果
*/
@Override
public int updateTContractorTrainResultDetail(TContractorTrainResultDetail tContractorTrainResultDetail)
{
return tContractorTrainResultDetailMapper.updateTContractorTrainResultDetail(tContractorTrainResultDetail);
}
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param detailIds 需要删除的承包商及访客培训考试结果详情ID
* @return 结果
*/
@Override
public int deleteTContractorTrainResultDetailByIds(Long[] detailIds)
{
return tContractorTrainResultDetailMapper.deleteTContractorTrainResultDetailByIds(detailIds);
}
/**
* 删除承包商及访客培训考试结果详情信息
*
* @param detailId 承包商及访客培训考试结果详情ID
* @return 结果
*/
@Override
public int deleteTContractorTrainResultDetailById(Long detailId)
{
return tContractorTrainResultDetailMapper.deleteTContractorTrainResultDetailById(detailId);
}
}
package com.zehong.system.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.service.ITContractorTrainResultService;
/**
* 承包商及访客培训考试结果详情Service业务层处理
*
* @author zehong
* @date 2022-12-27
*/
@Service
public class TContractorTrainResultServiceImpl implements ITContractorTrainResultService
{
@Autowired
private TContractorTrainResultMapper tContractorTrainResultMapper;
@Autowired
private TBankSubjectMapper tBankSubjectMapper;
@Autowired
private TContractorTrainCourseTopicMapper tContractorTrainCourseTopicMapper;
@Autowired
private TContractorTrainCourseMapper tContractorTrainCourseMapper;
@Autowired
private TContractorTrainResultDetailMapper tContractorTrainResultDetailMapper;
/**
* 查询承包商及访客培训考试结果详情
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 承包商及访客培训考试结果详情
*/
@Override
public TContractorTrainResult selectTContractorTrainResultById(Long resultId)
{
return tContractorTrainResultMapper.selectTContractorTrainResultById(resultId);
}
/**
* 查询承包商及访客培训考试结果详情列表
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 承包商及访客培训考试结果详情
*/
@Override
public List<TContractorTrainResult> selectTContractorTrainResultList(TContractorTrainResult tContractorTrainResult)
{
return tContractorTrainResultMapper.selectTContractorTrainResultList(tContractorTrainResult);
}
/**
* 新增承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
@Override
public int insertTContractorTrainResult(TContractorTrainResult tContractorTrainResult)
{
tContractorTrainResult.setCreateTime(DateUtils.getNowDate());
return tContractorTrainResultMapper.insertTContractorTrainResult(tContractorTrainResult);
}
/**
* 修改承包商及访客培训考试结果详情
*
* @param tContractorTrainResult 承包商及访客培训考试结果详情
* @return 结果
*/
@Override
public int updateTContractorTrainResult(TContractorTrainResult tContractorTrainResult)
{
return tContractorTrainResultMapper.updateTContractorTrainResult(tContractorTrainResult);
}
/**
* 批量删除承包商及访客培训考试结果详情
*
* @param resultIds 需要删除的承包商及访客培训考试结果详情ID
* @return 结果
*/
@Override
public int deleteTContractorTrainResultByIds(Long[] resultIds)
{
return tContractorTrainResultMapper.deleteTContractorTrainResultByIds(resultIds);
}
/**
* 删除承包商及访客培训考试结果详情信息
*
* @param resultId 承包商及访客培训考试结果详情ID
* @return 结果
*/
@Override
public int deleteTContractorTrainResultById(Long resultId)
{
return tContractorTrainResultMapper.deleteTContractorTrainResultById(resultId);
}
/**
* 用户课程考试交卷
* @param tContractorTrainResult
*/
@Override
public Map<String,Object> examination(TContractorTrainResult tContractorTrainResult) {
TContractorTrainCourseTopic tContractorTrainCourseTopic=new TContractorTrainCourseTopic();
String answers = tContractorTrainResult.getAnswers();
//交卷答题
String[] split = answers.split(",");
//查询考试题和答案
List<TContractorTrainCourseTopic> tContractorTrainCourseTopics = tContractorTrainCourseTopicMapper.selectTContractorTrainCourseTopicList(tContractorTrainCourseTopic);
//正确答案数量
int num = 0;
for(Integer i=0;i<split.length;i++){
if(Integer.parseInt(split[i])==tContractorTrainCourseTopics.get(i).getAnswer()){
num++;
}
}
TContractorTrainCourse tContractorTrainCourse=new TContractorTrainCourse();
//查询需要正确几道题算通过
TContractorTrainCourse itContractorTrainCourse = tContractorTrainCourseMapper.getITContractorTrainCourse(tContractorTrainCourse);
//判断答题是否合格
if(num>=itContractorTrainCourse.getQualifiedNum()){
tContractorTrainResult.setIsQualified("0");
}else {
tContractorTrainResult.setIsQualified("1");
}
//答对数量
tContractorTrainResult.setScore(String.valueOf(num));
tContractorTrainResult.setCreateTime(new Date());
//承包商及访客培训考试结果 添加方法
tContractorTrainResultMapper.insertTContractorTrainResult(tContractorTrainResult);
/**添加承包商及访客培训考试结果详情*/
for (int n=0;n<split.length;n++){
TContractorTrainResultDetail tContractorTrainResultDetail=new TContractorTrainResultDetail();
//设置结果管理id
tContractorTrainResultDetail.setResult(String.valueOf(tContractorTrainResult.getResultId()));
//设置题目内容
tContractorTrainResultDetail.setTopicTitle(tContractorTrainCourseTopics.get(n).getTopicTitle());
//设置题目选项
tContractorTrainResultDetail.setTopicOption(tContractorTrainCourseTopics.get(n).getTopicOption());
//答案
tContractorTrainResultDetail.setAnswer(tContractorTrainCourseTopics.get(n).getAnswer());
//所选答案
tContractorTrainResultDetail.setAnswerChoice(Integer.valueOf(split[n]));
//答案结果
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);
}
Map<String,Object> map = new HashMap<>();
map.put("answer",num);
map.put("qualifiedNum",itContractorTrainCourse.getQualifiedNum());
map.put("topicNum",tContractorTrainCourseTopics.size());
return map;
}
}
......@@ -96,4 +96,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{contractorCourseId}
</foreach>
</delete>
<!--查询承包商及访客培训-->
<select id="getITContractorTrainCourse" resultMap="TContractorTrainCourseResult">
<include refid="selectTContractorTrainCourseVo"/>
limit 0,1
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TContractorTrainResultDetailMapper">
<resultMap type="TContractorTrainResultDetail" id="TContractorTrainResultDetailResult">
<result property="detailId" column="detail_id" />
<result property="resultId" column="result_id" />
<result property="topicTitle" column="topic_title" />
<result property="topicOption" column="topic_option" />
<result property="answer" column="answer" />
<result property="answerChoice" column="answer_choice" />
<result property="result" column="result" />
<result property="createTime" column="create_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTContractorTrainResultDetailVo">
select detail_id, result_id, topic_title, topic_option, answer, answer_choice, result, create_time, is_del, remark from t_contractor_train_result_detail
</sql>
<select id="selectTContractorTrainResultDetailList" parameterType="TContractorTrainResultDetail" resultMap="TContractorTrainResultDetailResult">
<include refid="selectTContractorTrainResultDetailVo"/>
<where>
<if test="resultId != null "> and result_id = #{resultId}</if>
<if test="topicTitle != null and topicTitle != ''"> and topic_title = #{topicTitle}</if>
<if test="topicOption != null and topicOption != ''"> and topic_option = #{topicOption}</if>
<if test="answer != null "> and answer = #{answer}</if>
<if test="answerChoice != null "> and answer_choice = #{answerChoice}</if>
<if test="result != null and result != ''"> and result = #{result}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectTContractorTrainResultDetailById" parameterType="Long" resultMap="TContractorTrainResultDetailResult">
<include refid="selectTContractorTrainResultDetailVo"/>
where detail_id = #{detailId}
</select>
<insert id="insertTContractorTrainResultDetail" parameterType="TContractorTrainResultDetail" useGeneratedKeys="true" keyProperty="detailId">
insert into t_contractor_train_result_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="resultId != null">result_id,</if>
<if test="topicTitle != null">topic_title,</if>
<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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resultId != null">#{resultId},</if>
<if test="topicTitle != null">#{topicTitle},</if>
<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>
</trim>
</insert>
<update id="updateTContractorTrainResultDetail" parameterType="TContractorTrainResultDetail">
update t_contractor_train_result_detail
<trim prefix="SET" suffixOverrides=",">
<if test="resultId != null">result_id = #{resultId},</if>
<if test="topicTitle != null">topic_title = #{topicTitle},</if>
<if test="topicOption != null">topic_option = #{topicOption},</if>
<if test="answer != null">answer = #{answer},</if>
<if test="answerChoice != null">answer_choice = #{answerChoice},</if>
<if test="result != null">result = #{result},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where detail_id = #{detailId}
</update>
<delete id="deleteTContractorTrainResultDetailById" parameterType="Long">
delete from t_contractor_train_result_detail where detail_id = #{detailId}
</delete>
<delete id="deleteTContractorTrainResultDetailByIds" parameterType="String">
delete from t_contractor_train_result_detail where detail_id in
<foreach item="detailId" collection="array" open="(" separator="," close=")">
#{detailId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TContractorTrainResultMapper">
<resultMap type="TContractorTrainResult" id="TContractorTrainResultResult">
<result property="resultId" column="result_id" />
<result property="beyondUnit" column="beyond_unit" />
<result property="name" column="name" />
<result property="sex" column="sex" />
<result property="phoneNum" column="phone_num" />
<result property="testBeginTime" column="test_begin_time" />
<result property="testEndTime" column="test_end_time" />
<result property="score" column="score" />
<result property="isQualified" column="is_qualified" />
<result property="createTime" column="create_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTContractorTrainResultVo">
select result_id, beyond_unit, name, sex, phone_num, test_begin_time, test_end_time, score, is_qualified, create_time, is_del, remark from t_contractor_train_result
</sql>
<select id="selectTContractorTrainResultList" parameterType="TContractorTrainResult" resultMap="TContractorTrainResultResult">
<include refid="selectTContractorTrainResultVo"/>
<where>
<if test="beyondUnit != null and beyondUnit != ''"> and beyond_unit = #{beyondUnit}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
<if test="phoneNum != null and phoneNum != ''"> and phone_num = #{phoneNum}</if>
<if test="testBeginTime != null and testEndTime != null"> and test_begin_time BETWEEN #{testBeginTime} AND #{testEndTime}</if>
<if test="score != null and score != ''"> and score = #{score}</if>
<if test="isQualified != null and isQualified != ''"> and is_qualified = #{isQualified}</if>
</where>
</select>
<select id="selectTContractorTrainResultById" parameterType="Long" resultMap="TContractorTrainResultResult">
<include refid="selectTContractorTrainResultVo"/>
where result_id = #{resultId}
</select>
<insert id="insertTContractorTrainResult" parameterType="TContractorTrainResult" useGeneratedKeys="true" keyProperty="resultId">
insert into t_contractor_train_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="beyondUnit != null">beyond_unit,</if>
<if test="name != null">name,</if>
<if test="sex != null">sex,</if>
<if test="phoneNum != null">phone_num,</if>
<if test="testBeginTime != null">test_begin_time,</if>
<if test="testEndTime != null">test_end_time,</if>
<if test="score != null">score,</if>
<if test="isQualified != null">is_qualified,</if>
<if test="createTime != null">create_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="beyondUnit != null">#{beyondUnit},</if>
<if test="name != null">#{name},</if>
<if test="sex != null">#{sex},</if>
<if test="phoneNum != null">#{phoneNum},</if>
<if test="testBeginTime != null">#{testBeginTime},</if>
<if test="testEndTime != null">#{testEndTime},</if>
<if test="score != null">#{score},</if>
<if test="isQualified != null">#{isQualified},</if>
<if test="createTime != null">#{createTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTContractorTrainResult" parameterType="TContractorTrainResult">
update t_contractor_train_result
<trim prefix="SET" suffixOverrides=",">
<if test="beyondUnit != null">beyond_unit = #{beyondUnit},</if>
<if test="name != null">name = #{name},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="phoneNum != null">phone_num = #{phoneNum},</if>
<if test="testBeginTime != null">test_begin_time = #{testBeginTime},</if>
<if test="testEndTime != null">test_end_time = #{testEndTime},</if>
<if test="score != null">score = #{score},</if>
<if test="isQualified != null">is_qualified = #{isQualified},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where result_id = #{resultId}
</update>
<delete id="deleteTContractorTrainResultById" parameterType="Long">
delete from t_contractor_train_result where result_id = #{resultId}
</delete>
<delete id="deleteTContractorTrainResultByIds" parameterType="String">
delete from t_contractor_train_result where result_id in
<foreach item="resultId" collection="array" open="(" separator="," close=")">
#{resultId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -46,12 +46,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectTStaningBookList" parameterType="TStaningBook" resultMap="TStaningBookResult">
SELECT b.*,s1.`staff_name` AS escalationName,
SELECT b.*,s5.nick_name AS escalationName,
s2.`staff_name` AS rectificationName,
s3.`staff_name` AS personLiableName ,
d.`dept_name` AS deptName
FROM t_staning_book b
LEFT JOIN t_staff s1 ON b.`escalation` = s1.`staff_id`
LEFT JOIN sys_user s5 ON b.escalation=s5.user_id
LEFT JOIN t_staff s2 ON b.`rectification` = s2.`staff_id`
LEFT JOIN t_staff s3 ON b.`person_liable` = s3.`staff_id`
LEFT JOIN sys_dept d ON d.`dept_id` = b.`dept_id`
......
......@@ -26,6 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="bankName != null and bankName != ''"> and a.bank_name like concat('%', #{bankName}, '%')</if>
</where>
<where>
<if test="deptId != null and deptId != ''"> and a.dept_id = #{deptId} </if>
</where>
group by bank_id desc
</select>
......
import request from '@/utils/request'
// 查询承包商及访客培训考试结果详情列表
export function listResult(query) {
return request({
url: '/system/result/list',
method: 'get',
params: query
})
}
// 查询承包商及访客培训考试结果详情详细
export function getResult(resultId) {
return request({
url: '/system/result/' + resultId,
method: 'get'
})
}
// 新增承包商及访客培训考试结果详情
export function addResult(data) {
return request({
url: '/system/result',
method: 'post',
data: data
})
}
// 修改承包商及访客培训考试结果详情
export function updateResult(data) {
return request({
url: '/system/result',
method: 'put',
data: data
})
}
// 删除承包商及访客培训考试结果详情
export function delResult(resultId) {
return request({
url: '/system/result/' + resultId,
method: 'delete'
})
}
// 导出承包商及访客培训考试结果详情
export function exportResult(query) {
return request({
url: '/system/result/export',
method: 'get',
params: query
})
}
\ No newline at end of file
......@@ -8,6 +8,14 @@ export function listTopic(query) {
params: query
})
}
// 新增承包商及访客培训考试结果
export function setEsult(query) {
return request({
url: '/system/result/examination',
method: 'get',
params: query
})
}
// 查询承包商及访客培训题库详细
export function getTopic(topicId) {
......
import request from '@/utils/request'
// 查询承包商及访客培训信息
export function ITContractorTrainCourse(query) {
return request({
url: '/contractTrain/getITContractorTrainCourse',
method: 'get',
params: query
})
}
......@@ -7,7 +7,7 @@ import { getToken } from "@/utils/auth";
NProgress.configure({ showSpinner: false });
const whiteList = ["/login", "/auth-redirect", "/bind", "/register"];
const whiteList = ["/login", "/auth-redirect", "/bind", "/register","/enterInformation","/trainingMaterials",];
router.beforeEach((to, from, next) => {
NProgress.start();
......
......@@ -48,6 +48,16 @@ export const constantRoutes = [
component: (resolve) => require(['@/views/error/404'], resolve),
hidden: true
},
{
path: '/enterInformation',
component: (resolve) => require(['@/views/visitorExam/EnterInformation'], resolve),
hidden: true
},
{
path: '/trainingMaterials',
component: (resolve) => require(['@/views/visitorExam/Trainingmaterials/index'], resolve),
hidden: true
},
// {
// path: '/bigWindow',
// component: (resolve) => require(['@/views/bigWindow'], resolve),
......
......@@ -55,7 +55,8 @@ service.interceptors.response.use(res => {
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
// 重新登录
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:38:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-12-26 09:54:47
* @LastEditTime: 2023-01-04 17:50:46
* @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
-->
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-22 10:59:44
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 17:52:32
* @LastEditTime: 2023-01-04 17:47:53
* @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
-->
......@@ -107,6 +107,7 @@
@resFun="getFileInfoFile"
@remove="listRemoveFile"
:fileArr="fileListFile"
:fileType="fileType"
/>
<el-input v-show="false" disabled v-model="form.enclosure"></el-input>
</el-form-item>
......@@ -146,6 +147,7 @@ export default {
video: "",
enclosure: "",
},
fileType: ["doc", "docx", "xls", "xlsx", "ppt", "txt", "pdf"],
fileListVideo: [],
fileListFile: [],
readOnly: false,
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 20:14:18
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 16:59:32
* @LastEditTime: 2023-01-05 09:38:13
* @FilePath: /danger-manage-web/src/views/myLessons/CheckLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -39,10 +39,10 @@
</div>
</div>
<div class="bt flex fz14 video">
<div class="bt flex fz14 video" >
<div class="a">视频文件</div>
<div class="b">
<div class="video">
<div class="video" v-if="lessonData.video">
<video-player
class="video-player vjs-custom-skin"
ref="videoPlayer"
......@@ -50,6 +50,7 @@
:options="playerOptions"
></video-player>
</div>
<div v-else>未上传视频</div>
</div>
</div>
......@@ -61,6 +62,9 @@
<el-button style="padding: 0; margin-left: 20px" type="text">
<a :href="lessonData.enclosure">下载</a>
</el-button>
<el-button style="padding: 0; margin-left: 20px" type="text">
<a @click="openXslx(lessonData.enclosure)">预览</a>
</el-button>
</div>
</div>
</div>
......@@ -100,6 +104,9 @@
:visible.sync="answerOpen"
@jj="jj"
/>
<el-dialog :visible.sync="iframeVisible" width="80%">
<iframe style="width: 100%; height: 600px" :src="ky"></iframe>
</el-dialog>
</div>
</template>
......@@ -121,6 +128,7 @@ export default {
playerOptions: {
aspectRatio: "16:9",
},
dingshi:null,
// 课程类型
courseOptions: [],
......@@ -134,6 +142,8 @@ export default {
fenshu: 0,
answerOpen: false,
lessonTypeName: "",
iframeVisible: false,
ky: "https://view.xdocin.com/222-223-203-154-8082_o52uv3.htm",
};
},
created() {
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 14:29:26
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 18:00:44
* @LastEditTime: 2023-01-03 15:10:43
* @FilePath: /danger-manage-web/src/views/myLessons/components/LearnItem.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -12,7 +12,7 @@
<div class="allone">
<img v-if="itemData.dataKind==0" style="height: 18px" src="@/assets/img/ykao.png"/>
<img v-if="itemData.dataKind==1" style="height: 18px" src="@/assets/img/skao.png"/>
<div class="lesson" style="width: 75%"> {{ itemData.courseName }}</div>
<div class="lesson zzz" style="width: 75%" :title="itemData.courseName"> {{ itemData.courseName }}</div>
</div>
<div class="time">发布时间:{{ itemData.createTime }}</div>
<div class="bottom flex">
......
......@@ -5,6 +5,7 @@
ref="queryForm"
:inline="true"
label-width="68px"
>
<!-- <el-form-item label="课件类别" prop="courseType">
<el-select
......@@ -23,7 +24,7 @@
</el-form-item> -->
<el-form-item
label="所属单位"
label="归属部门"
prop="deptId"
ref="treeItem"
>
......@@ -36,10 +37,10 @@
style="width:200px"
/>
</el-form-item>
<el-form-item label="名称" prop="courseName">
<el-form-item label="题库名称" prop="courseName">
<el-input
v-model="queryParams.courseName"
placeholder="考试时间"
v-model="queryParams.bankName"
placeholder="题库名称"
clearable
size="small"
/>
......@@ -89,7 +90,7 @@
<el-table-column label="题库名称" align="center" prop="bankName">
</el-table-column>
<el-table-column
label="所属单位"
label="归属部门"
align="center"
prop="courseType"
>
......
......@@ -181,7 +181,8 @@
dataKind: "",
releaseTimeBegin: "",
releaseTimeEnd: ""
}
};
this.getTestList();
},
courseDetail(courseId){
this.testStatDetailOpen = true;
......
......@@ -259,13 +259,13 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.$refs.Dia.title = "新增培训课程";
this.$refs.Dia.title = "新增考试试卷";
this.componentsNum = 1;
this.courseId = null;
this.dilogFlag = true;
},
changeLesson(courseId) {
this.$refs.Dia.title = "修改培训课程";
this.$refs.Dia.title = "修改考试试卷";
this.componentsNum = 1;
this.courseId = courseId;
this.dilogFlag = true;
......
......@@ -27,15 +27,16 @@
<div>
<div class="top">参与培训人员({{personnelOptions.length}})</div>
<div class="bottom">
<el-checkbox-group class="" v-model="infoData.postIds">
<!-- <el-checkbox-group class="" v-model="infoData.postIds"> -->
<el-checkbox
:disabled="!isActive"
v-model="personnel.ischeck"
v-for="personnel in personnelOptions"
:label="personnel.postId"
:key="personnel.postId"
>{{ personnel.postName }}</el-checkbox
>
</el-checkbox-group>
<!-- </el-checkbox-group> -->
</div>
</div>
</div>
......
<template>
<div class="form-wrapper">
<div style="width: 100%;height:100%;">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="培训名称" prop="name">
<el-input v-model="ruleForm.name"></el-input>
<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="region">
<el-input type="textarea" v-model="ruleForm.region" rows="5"></el-input>
<el-form-item label="培训内容" prop="courseConent">
<el-input type="textarea" v-model="contractTrainForm.courseConent" rows="5"></el-input>
</el-form-item>
</el-form>
</div>
<el-form>
<div class="flex">
<el-form-item label="视频上传" v-if="!readOnly" prop="video">
<FileUpload
......@@ -21,7 +18,7 @@
:fileSize="500"
:fileType="['mp4']"
/>
<el-input v-show="false" disabled v-model="form.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
......@@ -30,27 +27,25 @@
@remove="listRemoveFile"
:fileArr="fileListFile"
/>
<el-input v-show="false" disabled v-model="form.enclosure"></el-input>
<el-input v-show="false" disabled v-model="contractTrainForm.enclosure"></el-input>
</el-form-item>
</div>
</el-form>
<visitorQuestion></visitorQuestion>
</div>
<visitorQuestion ref="visitorQuestion"></visitorQuestion>
</div>
</template>
<script>
import FileUpload from "@/components/FileUpload";
import uploadfile from "@/assets/uploadfile.png";
import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQuestion";
// import visitorDia from "@/views/educationPlanExam/visitorProgram/visitorDia";
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 {
ruleForm: {
name: '',
region: '',
},
form: {
contractTrainForm: {
courseName: '',
courseConent: '',
video: "",
enclosure: "",
},
......@@ -70,7 +65,7 @@ import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQue
enclosure: [
{ required: true, trigger: "blur", message: "附件不能为空" },
],
}
},
};
},
components: {
......@@ -78,11 +73,32 @@ import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQue
visitorQuestion,
},
created() {
if (this.courseId) {
this.getLessonById();
}
this.getContractTrainList();
},
methods: {
getContractTrainList(){
listCourse().then(res =>{
this.contractTrainForm = res.rows[0];
if(this.contractTrainForm.video){
this.fileListVideo = [
{
name: this.contractTrainForm.courseName + "视频",
url: uploadfile,
},
];
}
if(this.contractTrainForm.enclosure){
this.fileListFile = [
{
name: this.contractTrainForm.courseName + "附件",
url: uploadfile,
},
];
}
this.$refs.visitorQuestion.rightNum = this.contractTrainForm.qualifiedNum;
this.$refs.visitorQuestion.getContractTopicList(this.contractTrainForm.contractorCourseId)
})
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
......@@ -95,8 +111,7 @@ import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQue
},
getFileInfoVideo(res) {
this.form.video = res.url;
// this.form.videoName = res.fileName;
this.contractTrainForm.video = res.url;
this.fileListVideo = [
{
name: res.fileName,
......@@ -106,12 +121,11 @@ import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQue
},
listRemoveVideo(e) {
this.fileListVideo = [];
this.form.video = "";
this.contractTrainForm.video = "";
// this.form.videoName = null;
},
getFileInfoFile(res) {
this.form.enclosure = res.url;
// this.form.enclosureName = res.fileName;
this.contractTrainForm.enclosure = res.url;
this.fileListFile = [
{
name: res.fileName,
......@@ -121,12 +135,12 @@ import visitorQuestion from "@/views/educationPlanExam/visitorProgram/visitorQue
},
listRemoveFile(e) {
this.fileListFild = [];
this.form.enclosure = "";
this.contractTrainForm.enclosure = "";
// this.form.fileName = null;
},
}
}
</script>
</script>
<style lang="scss" scoped>
.form-wrapper {
padding-top: 30px;
......
......@@ -116,34 +116,11 @@
</div>
</el-form>
</div>
</div>
</template>
<script>
import {
addQuestion,
checkQuestion,
changeQuestion,
getQuestion,
getLessonById,
} from "@/api/educationPlanExam/lessonsProgram.js";
export default {
name: "AnswerLesson",
props: {
// visible: {
// type: Boolean,
// default: false,
// },
courseId: {
type: Number,
},
topicId: {
type: Number,
},
},
components: {},
data() {
return {
form: {
......@@ -159,47 +136,12 @@
},
created() {
// 如果存在就是修改
// if (this.topicId) {
// checkQuestion(this.topicId).then((res) => {
// console.log(res.data);
// const data = res.data;
// this.form = {
// topicTitle: data.topicTitle,
// questions: JSON.parse(data.topicOption),
// };
// this.answerNum = data.answer;
// });
// }
// 查询是第几道题
// this.getQuestion();
// 获取课程标题
// this.getLessonById(this.courseId);
},
methods: {
getQuestion() {
getQuestion({ courseId: this.courseId }).then((res) => {
this.questionNextNum = res.total + 1;
});
},
getLessonById(courseId) {
getLessonById(courseId).then((res) => {
console.log(res);
this.courseName = res.data.courseName;
});
},
addQuestion(data) {
// 如果是修改,就用修改的方法,如果是新增,就用新增的方法
if (this.topicId) {
return changeQuestion({ topicId: this.topicId, ...data });
} else {
return addQuestion({ courseId: this.courseId, ...data });
}
},
//设置正确答案
rightAnswerClick(index) {
this.answerNum = index;
console.log(index);
},
// 删除选项
removeDomain(question) {
......@@ -215,48 +157,6 @@
// 新增选项
add(addValue) {
this.form.questions.push({ value: addValue });
console.log();
},
save(num = 2) {
return new Promise((resove) => {
if (!this.answerNum && this.answerNum !== 0) {
this.$message({
message: "警告,请设置一个正确答案",
type: "warning",
});
return resove(false);
}
this.$refs.form.validate((valid) => {
if (valid) {
const data = {};
data.topicTitle = this.form.topicTitle;
data.topicOption = JSON.stringify(this.form.questions);
data.answer = this.answerNum;
this.addQuestion(data).then((res) => {
if (res.code == 200) {
// 把修改的这个归位,变成正常添加
this.$emit("update:topicId", null);
this.$message({
message: "添加题目成功",
type: "success",
});
this.$parent.$parent.componentsNumChange(num);
this.$parent.$parent.$parent.getList();
resove(true);
}
});
}
});
});
},
saveAndNext() {
this.save(3).then((res) => {
if (res) {
this.reset();
this.questionNextNum++;
}
});
},
reset() {
this.form = {
......@@ -359,4 +259,3 @@
}
}
</style>
\ No newline at end of file
......@@ -11,21 +11,52 @@
<div style="color: #1890ff;">题目管理</div>
<div class="text flex">
<div class="left">
<el-button type="primary" plain @click="dialogVisible = true">{{
saveNextText
}}</el-button>
目前有<span></span>道题
<el-button type="primary" plain @click="enterContractTrainTopic">录入考题</el-button>
目前有<span>{{questionNum}}</span>道题
<span class="warn">温馨提示:发布课程前需要进行考试设置</span>
</div>
<!-- <div class="right">{{courseName}}</div> -->
</div>
<!-- 试题列表 -->
<div class="table flex">
<div class="th flex">
<div class="left">序号</div>
<div class="middle">题目名称</div>
<div class="right">操作</div>
</div>
<div class="td-wrapper">
<div
v-for="(item, index) in questionList"
:key="item.topicId"
class="td flex"
>
<div class="left">{{ index + 1 }}</div>
<div class="middle zzz">
{{ item.topicTitle }}
</div>
<div class="right">
<div>
<el-button
@click="editContractTrainTopic(item.topicId,index + 1)"
icon="el-icon-edit"
type="text"
>修改</el-button
>
<el-button
@click="deleteContractTrainTopic(item.topicId)"
icon="el-icon-delete"
type="text"
>删除</el-button
>
</div>
</div>
</div>
</div>
</div>
<!-- 底部 -->
<div class="d3">
<div class="rightNum flex">
<div class="left">考试设置</div>
......@@ -53,6 +84,7 @@
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="saveContractTrian"
>{{ "确认" }}</el-button
>
<el-button>取消</el-button>
......@@ -63,25 +95,15 @@
title="录入题目"
:visible.sync="dialogVisible"
>
<visitorAdd></visitorAdd>
<visitorAdd ref="visitorAdd" :key="next"/>
<span slot="footer" class="dialog-footer">
<!-- <el-button>保存</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button> -->
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
@click="save"
>保存</el-button
>
<el-button type="primary" @click="saveAndNext">{{
saveNextText
}}</el-button>
<el-button
v-if="this.componentsNum == 2"
type="primary"
>{{ "确认" }}</el-button
>
<el-button type="primary" @click="saveAndNext">保存并录入下一题</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
</div>
</span>
......@@ -91,20 +113,15 @@
<script>
import visitorAdd from "@/views/educationPlanExam/visitorProgram/visitorAdd";
import {updateCourse} from "@/api/contractTrain/contractTrain";
import { addTopic,listTopic,getTopic,delTopic,updateTopic } from "@/api/contractTrain/contractTrainTopic";
export default {
name: "AnswerLesson",
props: {
courseId: {
type: Number,
},
visible: {
type: Boolean,
default: false,
},
componentsNum: {
type: Number,
default: 1,
},
},
components: {
visitorAdd,
......@@ -113,43 +130,151 @@
return {
dialogVisible: false,
rightNum: 0,
next: 0,
questionList: [],
questionNum: null,
courseId: ""
};
},
methods: {
//获取考题列表
getContractTopicList(contractorCourseId){
this.courseId = contractorCourseId;
listTopic({contractorCourseId:contractorCourseId}).then(res =>{
this.questionList = res.rows.map((item) => {
return {
topicId: item.topicId,
topicTitle: item.topicTitle,
};
});
this.questionNum = res.total;
})
},
//录入考题
enterContractTrainTopic(){
this.dialogVisible = true;
this.next++;
this.$nextTick(() => {
this.$refs.visitorAdd.questionNextNum = this.questionNum + 1;
})
},
//保存试题
save(next) {
new Promise((resove) => {
if (!this.$refs.visitorAdd.answerNum && this.$refs.visitorAdd.answerNum !== 0) {
this.$message({
message: "警告,请设置一个正确答案",
type: "warning",
});
return resove(false);
}
computed: {
saveNextText() {
let text;
if (this.componentsNum == 1) {
text = "保存并录入题目";
} else if (this.componentsNum == 2) {
text = "录入考题";
} else {
text = "保存并录入下一题";
this.$refs.visitorAdd.$refs.form.validate((valid) => {
if (valid) {
const data = {};
data.contractorCourseId = this.courseId;
data.topicTitle = this.$refs.visitorAdd.form.topicTitle;
data.topicOption = JSON.stringify(this.$refs.visitorAdd.form.questions);
data.answer = this.$refs.visitorAdd.answerNum;
this.addContractTrainTopic(data).then((res) => {
if (res.code == 200) {
// 把修改的这个归位,变成正常添加
this.$emit("update:topicId", null);
this.$message({
message: "添加题目成功",
type: "success",
});
if(next != 1){
this.dialogVisible = false;
this.getContractTopicList(this.courseId)
}else{
this.next++;
}
resove(true);
}
});
}
return text;
});
});
},
//保存并录入下一题
saveAndNext() {
this.save(1);
},
created() {
console.log("this.courseId", this.courseId);
//新增试题
addContractTrainTopic(data){
if (this.$refs.visitorAdd.form.topicId) {
return updateTopic({ topicId: this.$refs.visitorAdd.form.topicId, ...data });
} else {
return addTopic({ contractorCourseId: this.courseId, ...data });
}
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
//试题修改
editContractTrainTopic(topicId,index){
this.dialogVisible = true;
getTopic(topicId).then(res =>{
const data = res.data;
this.$refs.visitorAdd.form = {
topicId: data.topicId,
topicTitle: data.topicTitle,
questions: JSON.parse(data.topicOption),
};
this.$refs.visitorAdd.answerNum = data.answer;
})
this.$nextTick(() => {
this.$refs.visitorAdd.questionNextNum = index;
})
.catch(_ => {});
},
save() {
// this.answerClear();
this.$refs.current.save();
//试题删除
deleteContractTrainTopic(topicId){
this.$confirm("请确定删除该题", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
return delTopic(topicId);
}).then((res) => {
if (res.code == 200) {
this.$message({
message: "删除成功",
type: "success",
});
}
return this.getContractTopicList(this.courseId);
})
},
saveRightNum() {
if (this.rightNum > this.questionList.length) {
this.$message({
message: "答对题目数应小于等于考试题目总数",
type: "warning",
});
return;
}
updateCourse({ contractorCourseId: this.courseId, qualifiedNum: this.rightNum }).then((res) => {
if (res.code == 200) {
this.$message({
message: "答题合格数修改成功",
type: "success",
});
}
}
);
},
saveAndNext() {
this.$refs.current.saveAndNext();
},
//保存承包商信息
saveContractTrian(){
updateCourse(this.$parent.contractTrainForm).then(res =>{
if(res.code == 200){
this.$message({
message: "培训信息修改成功",
type: "success",
});
this.$parent.getContractTrainList();
}
})
}
},
};
</script>
......@@ -287,4 +412,3 @@
}
}
</style>
\ No newline at end of file
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属单位" prop="beyondUnit">
<el-input
v-model="queryParams.beyondUnit"
placeholder="请输入所属单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="考试时间" prop="releaseTimeBegin">
<el-date-picker
v-model="testTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
@change="dateFormat">
</el-date-picker>
</el-form-item>
<el-form-item label="是否合格" prop="isQualified">
<el-select v-model="queryParams.isQualified" placeholder="请选择" clearable size="small">
<el-option label="合格" value="0" />
<el-option label="不合格" value="1" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="resultList">
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="所属单位" align="center" prop="beyondUnit" />
<el-table-column label="性别" align="center" prop="sex">
<template slot-scope="scope">
<span v-if="scope.row.sex == '0'"></span>
<span v-if="scope.row.sex == '1'"></span>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="phoneNum" />
<el-table-column label="考试开始时间" align="center" prop="testBeginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.testBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="考试结束时间" align="center" prop="testEndTime" width="180">
<template slot-scope="scope">
<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="isQualified">
<template slot-scope="scope">
<span v-if="scope.row.isQualified == '0'">合格</span>
<span v-if="scope.row.isQualified == '1'">不合格</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listResult, getResult, delResult, addResult, updateResult, exportResult } from "@/api/contractTrain/contractTrainResult";
import {listCourse} from "@/api/contractTrain/contractTrain";
export default {
name: "Result",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 承包商及访客培训考试结果详情表格数据
resultList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
beyondUnit: null,
name: null,
sex: null,
phoneNum: null,
testBeginTime: null,
testEndTime: null,
score: null,
isQualified: null,
},
testTime: "",
//题目数量
topicNum: 0
};
},
created() {
this.getList();
this.getQualifiedNum();
},
methods: {
/** 查询承包商及访客培训考试结果详情列表 */
getList() {
this.loading = true;
console.log("this.queryParams---",this.queryParams)
listResult(this.queryParams).then(response => {
this.resultList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
resultId: null,
beyondUnit: null,
name: null,
sex: null,
phoneNum: null,
testBeginTime: null,
testEndTime: null,
score: null,
isQualified: null,
createTime: null,
isDel: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.testTime = "";
this.queryParams.testBeginTime = "";
this.queryParams.testEndTime = "";
this.handleQuery();
},
dateFormat(picker){
this.queryParams.testBeginTime = picker[0];
this.queryParams.testEndTime = picker[1];
},
getQualifiedNum(){
listCourse().then(res =>{
if(res.code == 200){
this.topicNum = res.rows[0].topicNum;
}
})
}
}
};
</script>
......@@ -143,9 +143,10 @@
/>
<!-- 添加或修改应急演练对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1800px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<div class="division">
<div class="division" style="margin-bottom:20px" >
<div class="div-kuang" style="width: 50%;">
<el-form-item label="演练名称" prop="drillName">
<el-input v-model="form.drillName" placeholder="请输入演练名称" />
......@@ -199,8 +200,9 @@
</el-form-item>
</div>
</div>
<div class="div-kuang" style="width: 95%;margin-left: 2%">
<div class="div-kuang" style="width: 100%;">
<el-form-item label="选择人员" prop="releaseTime">
<!-- table -->
<!-- jsonSelectNameList就是呗选中的人员的json -->
......@@ -214,8 +216,6 @@
</el-form-item>
</div>
</div>
<!--<el-form-item label="评估" prop="assessment">-->
<!--<el-input v-model="form.assessment" type="textarea" placeholder="请输入内容" />-->
......@@ -258,7 +258,7 @@
</div>
<div class="div-kuang" style="width: 58%;margin-left: 2%">
<el-form-item label="参演人员:" prop="drillPeople">
<span>{{form.drillPeople}}</span>
<span style="margin-right:5px" v-for='item in form.jsonPeople' :key="item.peoPleId">{{item.peoPleName}}</span>
</el-form-item>
<el-form-item label="演练内容:">
<editor v-model="form.drillContent" :min-height="240" :readOnly="readOnly"/>
......@@ -396,10 +396,6 @@ export default {
});
},
mounted() {
// this.jsonSelectNameList
// '[{"staffId":880,"staffName":"孙卓亚"},{"staffId":871,"staffName":"张玉宾"},{"staffId":869,"staffName":"李二朝"},{"staffId":870,"staffName":"盖永峰"},{"staffId":868,"staffName":"刘丽艳"},{"staffId":867,"staffName":"霍文俊"},{"staffId":866,"staffName":"刘志坚"},{"staffId":865,"staffName":"郝文权"},{"staffId":864,"staffName":"齐雪军"},{"staffId":852,"staffName":"刘江平"},{"staffId":853,"staffName":"谷建海"},{"staffId":851,"staffName":"丁振国"},{"staffId":850,"staffName":"齐江波"},{"staffId":849,"staffName":"周立新"},{"staffId":848,"staffName":"史志波"},{"staffId":847,"staffName":"王增波"},{"staffId":846,"staffName":"杨彦龙"},{"staffId":845,"staffName":"杨华国"},{"staffId":844,"staffName":"王青华"}]';
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
},
methods: {
// 获取参考人员的list
......@@ -428,6 +424,9 @@ export default {
const data = [];
TStaffList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.jsonSelectNameList=response;
this.$nextTick(()=>{
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
})
// response.rows.forEach((city, index) => {
// data.push({
// label: city.staffName,
......@@ -511,11 +510,13 @@ export default {
// this.cities = response.rows.staffName;
// generateData.cities=['shanghai', 'beijing', 'guangzhou', 'shenzhen', 'nanjing', 'xian', 'chengdu']
// });
this.generateData();
this.reset();
this.open = true;
this.title = "添加应急演练";
this.$nextTick(()=>{
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
})
},
/** 修改按钮操作 */
handleUpdate(row) {
......@@ -525,6 +526,11 @@ export default {
this.form = response.data;
this.open = true;
this.title = "修改应急演练";
console.log(response.data.drillPeople)
this.jsonSelectNameList=response.data.drillPeople;
this.$nextTick(()=>{
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
})
});
},
/** 评估按钮操作 */
......@@ -565,6 +571,8 @@ export default {
handleDetail(row) {
getDrill(row.drillId).then(response => {
this.form = response.data;
this.form.jsonPeople = JSON.parse(this.form.drillPeople)
console.log(this.form.jsonPeople)
this.form.drillType = this.selectDictLabel(this.drillTypeOptions, row.drillType);
this.form.drillForm = this.selectDictLabel(this.drillFormOptions, row.drillForm);
this.open2 = true;
......@@ -607,6 +615,7 @@ export default {
background: white;
padding-top:20px ;
padding-right: 20px;
padding-bottom:10px;
border-radius: 10px;
}
.division{
......
<template>
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
<h3>个人信息录入</h3>
<el-form-item label="单位" prop="beyondUnit">
<el-input
style="width: 70%;"
placeholder="请输入单位"
v-model="form.beyondUnit"
maxlength="30"
clearable>
</el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input
style="width: 70%;"
placeholder="请输入姓名"
v-model="form.name"
maxlength="11"
clearable>
</el-input>
</el-form-item>
<el-form-item label="性别">
<el-radio-group v-model="form.sex">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="手机号">
<el-input
style="width: 70%;"
placeholder="手机号"
v-model="form.phoneNum"
type="number"
maxlength="11"
clearable>
</el-input>
</el-form-item>
<el-form-item>
<el-button @click="onSubmit" type="primary" >下一步</el-button>
<el-button>取消</el-button>
</el-form-item>
</el-form>
</template>
<script>
export default {
name: "EnterInformation",
data() {
return {
form: {
beyondUnit: null,
name: null,
sex: null,
phoneNum: null,
testBeginTime:null,
},
}
},
methods: {
/**
* 获取当前时间
*/
currentTime() {
var date = new Date();
var year = date.getFullYear(); //月份从0~11,所以加一
let month = date.getMonth();
var dateArr = [
date.getMonth() + 1,
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
//如果格式是MM则需要此步骤,如果是M格式则此循环注释掉
for (var i = 0; i < dateArr.length; i++) {
if (dateArr[i] >= 1 && dateArr[i] <= 9) {
dateArr[i] = "0" + dateArr[i];
}
}
var strDate =
year +
"/" +
dateArr[0] +
"/" +
dateArr[1] +
" " +
dateArr[2] +
":" +
dateArr[3] +
":" +
dateArr[4];
//此处可以拿外部的变量接收 strDate:2022-05-01 13:25:30
//this.date = 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位');
} else {
const routeData = this.$router.resolve({
path: '/trainingMaterials', //跳转目标窗口的地址
query: {
params //括号内是要传递给新窗口的参数
}
})
window.open(routeData.href, "_search");
}
},
next() {
if (this.active++ > 2) this.active = 0;
}
}
}
</script>
<style>
</style>
<template>
<el-dialog
class="answerLesson"
title="开始答题"
:visible.sync="visible"
width="87.5%"
:close-on-click-modal="false"
:close-on-press-escape="false"
:before-close="dialogCancel"
@closed="closeFinished"
destroy-on-close
>
<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
style="width: 89%;"
v-if="index === nowQuestion"
:questionObj="item"
:index="index"
:nowQuestion="nowQuestion"
:selectLetter="selectLetter"
@changeLetter="changeLetter"
/>
</div>
</div>
</transition>
<div class="select flex">
<div class="select-item flex">
<div
class="item"
:class="{
active:
answerArr.findIndex(
(item) => item.questionNum === index + 1
) >= 0,
now: index === nowQuestion,
}"
v-for="(item, index) in list"
:key="item.id + 'a' + index"
@click="questionNumClick(index)"
>
{{ index + 1 }}
</div>
<div @click="nextBtnClick" class="btn">下一题</div>
</div>
</div>
</template>
<template v-else>
<div :style="{ height: startHeight }">
<GoodJob :goodJobData="goodJobData" />
</div>
</template>
</div>
</transition>
</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="dialogSubmitForm" v-else
>交卷</el-button
>
<el-button @click="dialogCancel">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import Question from "../Trainingmaterials/components/Question";
import GoodJob from "../Trainingmaterials/components/GoodJob.vue";
import {
userQuestionList,
setAnswer,
} from "@/api/educationPlanExam/lessonsProgram";
import {
listTopic,
setEsult
} from "@/api/contractTrain/contractTrainTopic";
export default {
name: "AnswerLesson",
props: {
visible: {
type: Boolean,
default: false,
},
userCourseId: {
type: [Number, String],
},
courseId: {
type: [Number, String],
},
},
from:{
answers:{}
},
components: {
Question,
GoodJob,
},
data() {
return {
nowQuestion: 0,
startHeight: "0px",
goodJobShow: false,
goodJobData: {},
loading: false,
from:{},
list: [
{
id: 19,
text: "j9",
question: ["adsf", "dfgsdfg", "adsfadsf", "dfasdfadsf"],
},
],
answerArr: [],
// 题目是否被答过,如果答过,就把值传回去,如果没有答过,就是空
selectLetter: 999,
};
},
// watch: {
// visible(newValue) {
// if (newValue) {
// this.$nextTick(() => {
// this.saveBody();
// });
// }
// },
// },
created() {
listTopic().then((res) => {
console.log(res);
this.list = res.rows.map((item) => {
return {
id: item.topicId,
text: item.topicTitle,
question: JSON.parse(item.topicOption).map((item) => item.value),
};
});
});
},
methods: {
saveBody() {
this.startHeight = this.$refs.myBody.offsetHeight - 55 + "px";
},
dialogSubmitForm() {
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);
this.loading = true;
console.log(this.form)
this.form.answers=answers
console.log(this.form)
setEsult(this.form)
.then((res) => {
if (res.code == 200) {
this.goodJobData = res.data;
this.goodJobShow = true;
}
})
.finally(() => {
this.loading = false;
// 是否作对
this.$emit('jj',this.goodJobData)
});
},
dialogCancel() {
this.$emit("update:visible", false);
},
// 关闭之后
closeFinished() {
const routeData = this.$router.resolve({
path: '/enterInformation', //跳转目标窗口的地址
query: {
}
})
window.open(routeData.href, "_search");
// this.answerClear();
this.goodJobShow = false;
},
answerClear() {
this.answerArr = [];
this.nowQuestion = 0;
},
// 点题目时
questionNumClick(index) {
// 是否是回答过的,数组中存在它,那它就是回答过的
const bool =
this.answerArr.findIndex((item) => item.questionNum === index + 1) >= 0;
// 或者下一题与当前题目是紧挨着的并且当前题目是答完的,相差为1就算是紧挨着的
const nowQuestionAnswerBool = this.nextQuestion(index);
if (bool || nowQuestionAnswerBool) {
this.nowQuestion = index;
}
// 赋值,如果答过的,就传回去,如果没答过,就是空 变成字符串是因为0位false
this.selectLetter =
this.answerArr[this.nowQuestion]?.answer + "" || 99999;
},
nextBtnClick() {
// 到头了,打完了
if (this.nowQuestion + 1 == this.list.length) return;
this.questionNumClick(this.nowQuestion + 1);
},
// 紧挨着且当前题目是打完的
nextQuestion(index) {
// 下一题相差1
// const nextIndexBool = index - this.nowQuestion == 1;
// 答案数组的长度,就是档当前达到了第几题,长度-1是因为题目是从0开始记录
const nextIndexBool = index - (this.answerArr.length - 1) == 1;
// 当前题已经回答过
const nowQuestionAnswerBool =
this.answerArr.findIndex(
(item) => item.questionNum === this.nowQuestion + 1
) >= 0;
return nextIndexBool && nowQuestionAnswerBool;
},
changeLetter(letter) {
console.log(letter);
console.log(this.$route.query) // 输出为:{params:"message"}
const obj = {};
obj.questionNum = this.nowQuestion + 1;
obj.answer = letter;
// 数组中是否存在这个题目
const index = this.answerArr.findIndex(
(item) => item.questionNum === this.nowQuestion + 1
);
if (index < 0) {
// 如果不存在
// 推入
this.answerArr.push(obj);
} else {
// 如果存在
// 替换
this.answerArr.splice(index, 1, obj);
}
// console.log(this.answerArr);
},
},
};
</script>
<style lang="scss" scoped>
.body {
width: 120%;
height: 100%;
padding-right: 40px;
padding-left: 20px;
.question-wrapper {
}
.text {
margin-bottom: 16px;
.float {
padding-right: 70%;
width: 106%;
height: 28px;
background: #1d84ff;
line-height: 28px;
color: #ffffff;
font-size: 10px;
text-align: right;
float: right;
}
&:after {
content: "";
display: block;
clear: both;
}
}
.select {
.select-item {
padding-top: 30px;
flex-wrap: wrap;
> div {
margin-bottom: 10px;
}
.item {
width: 38px;
height: 28px;
border: 1px solid #bbbbbb;
line-height: 28px;
font-size: 14px;
text-align: center;
margin-right: 18px;
cursor: pointer;
&.active {
background: #e9e9e9;
}
&.now {
background: #a3d3ff;
border: none;
}
}
.btn {
width: 84px;
height: 28px;
background: #e8f4ff;
border: 1px solid #a3d3ff;
color: #1d84ff;
text-align: center;
line-height: 28px;
font-size: 14px;
cursor: pointer;
&:hover {
background: rgba(29, 132, 255, 0.5);
color: #ffffff;
}
}
}
}
}
</style>
<template>
<el-dialog
class="answerLesson"
title="开始答题"
:visible.sync="visible"
width="57.5%"
:close-on-click-modal="false"
:close-on-press-escape="false"
:before-close="dialogCancel"
@closed="closeFinished"
destroy-on-close
>
<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>
<div class="select flex">
<div class="select-item flex">
<div
class="item"
:class="{
active:
answerArr.findIndex(
(item) => item.questionNum === index + 1
) >= 0,
now: index === nowQuestion,
}"
v-for="(item, index) in list"
:key="item.id + 'a' + index"
@click="questionNumClick(index)"
>
{{ index + 1 }}
</div>
<div @click="nextBtnClick" class="btn">下一题</div>
</div>
</div>
</template>
<template v-else>
<div :style="{ height: startHeight }">
<GoodJob :goodJobData="goodJobData" />
</div>
</template>
</div>
</transition>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="closeFinished" v-if="goodJobShow"
>重新考试</el-button
>
<el-button type="primary" @click="dialogSubmitForm" v-else
>交卷</el-button
>
<el-button @click="dialogCancel">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import Question from "./Question";
import GoodJob from "./GoodJob.vue";
import {
userQuestionList,
setAnswer,
} from "@/api/educationPlanExam/lessonsProgram";
export default {
name: "AnswerLesson",
props: {
visible: {
type: Boolean,
default: false,
},
userCourseId: {
type: [Number, String],
},
courseId: {
type: [Number, String],
},
},
components: {
Question,
GoodJob,
},
data() {
return {
nowQuestion: 0,
startHeight: "0px",
goodJobShow: false,
goodJobData: {},
loading: false,
list: [
{
id: 19,
text: "j9",
question: ["adsf", "dfgsdfg", "adsfadsf", "dfasdfadsf"],
},
],
answerArr: [],
// 题目是否被答过,如果答过,就把值传回去,如果没有答过,就是空
selectLetter: 999,
};
},
// watch: {
// visible(newValue) {
// if (newValue) {
// this.$nextTick(() => {
// this.saveBody();
// });
// }
// },
// },
created() {
userQuestionList({ courseId: this.courseId }).then((res) => {
console.log(res.data);
this.list = res.data.map((item) => {
return {
id: item.topicId,
text: item.topicTitle,
question: JSON.parse(item.topicOption).map((item) => item.value),
};
});
});
},
methods: {
saveBody() {
this.startHeight = this.$refs.myBody.offsetHeight - 55 + "px";
},
dialogSubmitForm() {
// this.answerClear();
// this.$emit("update:visible", false);
this.saveBody();
const answers = this.answerArr.map((item) => item.answer).join(",");
this.loading = true;
setAnswer({
userCourseId: this.userCourseId,
answers,
})
.then((res) => {
if (res.code == 200) {
this.goodJobData = res.data;
this.goodJobShow = true;
}
})
.finally(() => {
this.loading = false;
// 是否作对
this.$emit('jj',this.goodJobData)
});
},
dialogCancel() {
this.$emit("update:visible", false);
},
// 关闭之后
closeFinished() {
this.answerClear();
this.goodJobShow = false;
},
answerClear() {
this.answerArr = [];
this.nowQuestion = 0;
},
// 点题目时
questionNumClick(index) {
// 是否是回答过的,数组中存在它,那它就是回答过的
const bool =
this.answerArr.findIndex((item) => item.questionNum === index + 1) >= 0;
// 或者下一题与当前题目是紧挨着的并且当前题目是答完的,相差为1就算是紧挨着的
const nowQuestionAnswerBool = this.nextQuestion(index);
if (bool || nowQuestionAnswerBool) {
this.nowQuestion = index;
}
// 赋值,如果答过的,就传回去,如果没答过,就是空 变成字符串是因为0位false
this.selectLetter =
this.answerArr[this.nowQuestion]?.answer + "" || 99999;
},
nextBtnClick() {
// 到头了,打完了
if (this.nowQuestion + 1 == this.list.length) return;
this.questionNumClick(this.nowQuestion + 1);
},
// 紧挨着且当前题目是打完的
nextQuestion(index) {
// 下一题相差1
// const nextIndexBool = index - this.nowQuestion == 1;
// 答案数组的长度,就是档当前达到了第几题,长度-1是因为题目是从0开始记录
const nextIndexBool = index - (this.answerArr.length - 1) == 1;
// 当前题已经回答过
const nowQuestionAnswerBool =
this.answerArr.findIndex(
(item) => item.questionNum === this.nowQuestion + 1
) >= 0;
return nextIndexBool && nowQuestionAnswerBool;
},
changeLetter(letter) {
console.log(letter);
const obj = {};
obj.questionNum = this.nowQuestion + 1;
obj.answer = letter;
// 数组中是否存在这个题目
const index = this.answerArr.findIndex(
(item) => item.questionNum === this.nowQuestion + 1
);
if (index < 0) {
// 如果不存在
// 推入
this.answerArr.push(obj);
} else {
// 如果存在
// 替换
this.answerArr.splice(index, 1, obj);
}
// console.log(this.answerArr);
},
},
};
</script>
<style lang="scss" scoped>
.body {
width: 100%;
height: 100%;
padding-right: 50px;
padding-left: 60px;
.question-wrapper {
}
.text {
margin-bottom: 27px;
.float {
padding-right: 7px;
width: 411px;
height: 28px;
background: #1d84ff;
line-height: 28px;
color: #ffffff;
font-size: 14px;
text-align: right;
float: right;
}
&:after {
content: "";
display: block;
clear: both;
}
}
.select {
.select-item {
padding-top: 20px;
flex-wrap: wrap;
> div {
margin-bottom: 10px;
}
.item {
width: 28px;
height: 28px;
border: 1px solid #bbbbbb;
line-height: 28px;
font-size: 14px;
text-align: center;
margin-right: 18px;
cursor: pointer;
&.active {
background: #e9e9e9;
}
&.now {
background: #a3d3ff;
border: none;
}
}
.btn {
width: 84px;
height: 28px;
background: #e8f4ff;
border: 1px solid #a3d3ff;
color: #1d84ff;
text-align: center;
line-height: 28px;
font-size: 14px;
cursor: pointer;
&:hover {
background: rgba(29, 132, 255, 0.5);
color: #ffffff;
}
}
}
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 17:20:49
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 11:56:49
* @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
-->
<template>
<div class="goodjob-wrapper flex">
<div class="text flex">
<div class="text flex">
<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)
}},成绩合格!
</div>
</template>
<template v-else>
<div class="icon"><i class="iconfont icon-nanguo" /></div>
<div>
继续努力,做对{{ goodJobData.answer }}道题得分{{
Math.floor((goodJobData.answer / goodJobData.topicNum) * 100)
}},成绩不合格!
</div>
</template>
</div>
</div>
</div>
</template>
<script>
export default {
name: "",
props: {
goodJobData: {
type: Object,
},
},
data() {
return {};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.goodjob-wrapper {
justify-content: center;
align-items: center;
width: 86%;
height: 100%;
border-bottom: 1px solid #bbbbbb;
.text {
width: 94%;
height: 174px;
color: #1d84ff;
background: #f9f9f9 100%;
border-radius: 15px;
line-height: 40px;
font-size: 28px;
justify-content: center;
align-items: center;
.icon {
margin-right: 10px;
.iconfont {
color: #e2852a;
font-size: 40px !important;
}
}
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 14:17:00
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 13:05:49
* @FilePath: /danger-manage-web/src/views/myLessions/components/learnAfter.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="learnbrfore flex">
<transition name="fade" mode="out-in">
<div class="top flex" :key="currentPage">
<div
v-show="index < 9 * currentPage && index >= 9 * (currentPage - 1)"
v-for="(item, index) in afterList"
:key="index + ''"
class="learn-item"
>
<LearnItem
:state="state"
:itemData="item"
@examination="examination"
/>
</div>
</div>
</transition>
<div class="bottom flex">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="9"
:layout="total > 9 ? layout : layout2"
:total="afterList.length"
>
</el-pagination>
</div>
</div>
</template>
<script>
import LearnItem from "./LearnItem";
export default {
name: "learnbrfore",
components: {
LearnItem,
},
props: {
state: {
type: Object,
},
list: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
// list: [
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// { state: 2},
// ],
currentPage: 1,
total: 19,
layout: "prev, pager, next, jumper",
layout2: "prev, pager, next",
};
},
computed: {
afterList() {
return this.list.filter((item) => item.state > 1);
},
},
created() {
console.log("after");
},
methods: {
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
},
examination(e) {
this.$emit("examination", e);
},
},
};
</script>
<style lang="scss" scoped>
.learnbrfore {
width: 100%;
height: 100%;
flex-direction: column;
.top {
width: 100%;
flex: 1;
padding: 2px;
box-sizing: border-box;
// justify-content: space-between;
flex-wrap: wrap;
.learn-item {
width: 32.5%;
height: 31.5%;
margin-right: 1.25%;
&:nth-child(3n) {
margin-right: 0px;
}
}
}
.bottom {
height: 12.7%;
max-height: 100px;
justify-content: center;
align-items: center;
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 14:17:00
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 09:37:40
* @FilePath: /danger-manage-web/src/views/myLessions/components/learnAfter.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="learnbrfore flex">
<transition name="fade" mode="out-in">
<div class="top flex" :key="currentPage">
<div
v-show="index < 9 * currentPage && index >= 9 * (currentPage - 1)"
v-for="(item, index) in beforeList"
:key="index + ''"
class="learn-item"
>
<LearnItem
:state="state"
:itemData="item"
@examination="examination"
/>
</div>
</div>
</transition>
<div class="bottom flex">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="9"
:layout="total > 9 ? layout : layout2"
:total="beforeList.length"
>
</el-pagination>
</div>
</div>
</template>
<script>
import LearnItem from "./LearnItem";
export default {
name: "learnbrfore",
components: {
LearnItem,
},
props: {
state: {
type: Object,
},
list: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
// list: [
// { state: 0 },
// { state: 1 },
// { state: 0 },
// { state: 1 },
// { state: 0 },
// { state: 1 },
// { state: 1 },
// { state: 1 },
// { state: 0 },
// ],
currentPage: 1,
total: 19,
layout: "prev, pager, next, jumper",
layout2: "prev, pager, next",
};
},
computed: {
beforeList() {
return this.list.filter((item) => item.state < 2);
},
},
created() {
console.log("before");
},
methods: {
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
},
examination(e) {
this.$emit("examination", e);
},
},
};
</script>
<style lang="scss" scoped>
.learnbrfore {
width: 100%;
height: 100%;
flex-direction: column;
.top {
width: 100%;
flex: 1;
padding: 2px;
box-sizing: border-box;
// justify-content: space-between;
flex-wrap: wrap;
.learn-item {
width: 32.5%;
height: 31.5%;
margin-right: 1.25%;
&:nth-child(3n) {
margin-right: 0px;
}
}
}
.bottom {
height: 12.7%;
max-height: 100px;
justify-content: center;
align-items: center;
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 14:29:26
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 18:00:44
* @FilePath: /danger-manage-web/src/views/myLessons/components/LearnItem.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="item flex">
<div class="title" style="text-align: center">{{ itemData.courseType||'-' }}</div>
<div class="allone">
<img v-if="itemData.dataKind==0" style="height: 18px" src="@/assets/img/ykao.png"/>
<img v-if="itemData.dataKind==1" style="height: 18px" src="@/assets/img/skao.png"/>
<div class="lesson" style="width: 75%"> {{ itemData.courseName }}</div>
</div>
<div class="time">发布时间:{{ itemData.createTime }}</div>
<div class="bottom flex">
<div @click="click" class="btn" :class="{ again: yesOrNo }">
{{ yesOrNo ? "重新考试" : "开始学习" }}
</div>
</div>
<div
class="img"
:class="{
no: itemData.state === 1,
yes: itemData.state === 2,
}"
>
{{ state[itemData.state] }}
</div>
</div>
</template>
<script>
export default {
name: "",
props: {
itemData: {
type: Object,
default: () => {
return {
again: 2,
};
},
},
state: {
type: Object,
},
},
computed: {
yesOrNo() {
return this.itemData.state == 1 || this.itemData.state == 2;
},
},
data() {
return {};
},
methods: {
click() {
const { courseId, userCourseId, state, examinationResult, topicNum } =
this.itemData;
// if (!this.yesOrNo) {
// this.$router.push("myLessons/CheckLesson");
let fenshu;
if (examinationResult) {
fenshu = Math.floor((examinationResult / topicNum) * 100);
} else {
fenshu = 0;
}
this.$router.push({
path: "myLessons/CheckLesson",
query: { courseId, userCourseId, state, fenshu },
});
// } else {
// this.$emit("examination", { courseId, userCourseId });
// }
// $router.push("myLessons/CheckLesson");
},
},
};
</script>
<style lang="scss" scoped>
.item {
width: 100%;
height: 100%;
// background: red;
overflow: hidden;
padding-top: 15px;
padding-left: 18px;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.12);
border-radius: 5px;
flex-direction: column;
position: relative;
> div {
font-size: 14px;
}
.title {
color: #606266;
margin-bottom: 8%;
}
.lesson {
color: #1d84ff;
text-align: center;
margin-bottom: 3%;
}
.time {
text-align: center;
font-size: 12px;
color: #7b808a;
margin-bottom: 5%;
}
.bottom {
flex: 1;
justify-content: center;
.btn {
width: 110px;
height: 40px;
border-radius: 4px;
font-size: 14px;
text-align: center;
line-height: 40px;
color: #1d84ff;
border: 1px solid #a3d3ff;
background: #e8f4ff;
font-size: 14;
cursor: pointer;
&.again {
color: #ffffff;
border: 1px solid #a3d3ff;
background: #1d84ff 100%;
}
&:hover {
background: rgba(29, 132, 255, 0.5);
color: #ffffff;
}
}
}
.allone{
display:flex;
flex-direction:row;
justify-content:flex-start;
}
.img {
position: absolute;
width: 100px;
height: 20px;
background: #1d84ff;
// opacity: .2;
top: 3%;
right: -7%;
text-align: center;
line-height: 20px;
font-size: 10px;
color: #ffffff;
transform: rotateZ(40deg);
&.no {
background: #e2852a;
}
&.yes {
background: #3cc426 !important;
}
}
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 11:30:14
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 09:19:38
* @FilePath: /danger-manage-web/src/views/myLessons/components/Left.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="lession-left-wrapper flex">
<el-tabs class="top" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="待学习" name="first"></el-tab-pane>
<el-tab-pane label="已学习" name="second"></el-tab-pane>
</el-tabs>
<div class="middle flex">
<transition name="fade-transform" mode="out-in">
<keep-alive>
<component :is="currentTabComponent" @examination="examination" :state="state" :list="list"></component>
</keep-alive>
</transition>
</div>
</div>
</template>
<script>
import LearnAfter from "./LearnAfter";
import LearnBefore from "./LearnBefore";
import {getUserLessons} from "@/api/educationPlanExam/lessonsProgram"
export default {
name: "lession-left",
components: {
// LearnAfter,
// LearnBefore,
},
data() {
return {
activeName: "first",
currentTabComponent: LearnBefore,
list:[],
state:{
"0":'未学习',
"1":'未通过',
"2":"通过"
},
};
},
created(){
this.getUserLessons();
},
methods: {
getUserLessons(){
getUserLessons().then(res=>{
console.log(res.rows);
this.list = res.rows;
})
},
handleClick(tab) {
if (tab.paneName == "first") {
this.currentTabComponent = LearnBefore;
} else {
this.currentTabComponent = LearnAfter;
}
},
examination(e){
this.$emit('examination',e)
}
},
};
</script>
<style lang="scss" scoped>
.lession-left-wrapper {
padding: 5px 26px 0;
height: 100%;
width: 100%;
flex-direction: column;
.top {
// margin-bottom: 47px;
}
.middle {
flex: 1;
height: 100%;
width: 100%;
justify-content: space-between;
overflow: hidden;
}
// .bottom{
// max-height: 105px;
// height: 11%;
// }
}
</style>
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-21 11:00:14
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-28 11:15:27
* @FilePath: /danger-manage-web/src/views/myLessons/components/Question.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="question flex">
<div
class="top"
:class="{ flex: alignItemsCenter }"
:style="{ alignItems: alignItemsCenter ? 'center' : '' }"
ref="top"
>
<div class="text" ref="text">
{{ questionObj.text }}
</div>
<div class="num">{{ nowQuestion + 1 }}</div>
</div>
<div class="middle">
<div
class="item flex"
v-for="(item, index) in questionObj.question"
:key="item+'aas'+index"
>
<div class="letter">
{{ letters[index] }}
</div>
<div class="">
{{ item }}
</div>
</div>
</div>
<div class="bottom flex">
<div class="change-wrapper flex">
<div
class="change"
:class="{ active: letterActive+'' === index+'' }"
@click="changeLetter(index)"
v-for="(item, index) in questionObj.question"
:key="item+'a'+index"
>
{{ letters[index] }}
</div>
</div>
</div>
</div>
</template>
<script>
const letters = [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
];
export default {
name: "question",
props: {
questionObj: {
type: Object,
default: () => {
return {
text: "asdfasdf",
question: [
"沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师沙发斯蒂芬大师",
"沙发斯蒂芬大师",
"沙发斯蒂芬大师",
"沙发斯蒂芬大师",
"沙发斯蒂芬大师",
],
};
},
},
nowQuestion: {
type: Number,
},
index: {
type: Number,
},
// 从外面传进来的选项,选择过的才有,没选择过的没有
selectLetter: {
type: [String, Number],
default:999,
},
},
data() {
return {
alignItemsCenter: false,
// 如果传进来了,就是这个值,如果没有就是null,因为动画需要那个key的问题,会清空原始的盒子,所以要传一下值
letterActive: this.selectLetter,
letters,
};
},
mounted() {
// console.log('123')
// 每次都会更新,所以不需要watch 直接在这里面写 因为动画需要那个key的问题,会清空原始的盒子,所以要传一下值
this.textCenter();
},
watch: {
// 监听一下当前题目,调整一下位置
// nowQuestion(value) {
// console.log('nowQuestion变化',value)
// this.$nextTick(() => {
// this.textCenter();
// });
// },
},
methods: {
textCenter() {
let h1 = this.$refs.text?.offsetHeight;
let h2 = this.$refs.top?.offsetHeight;
// 如果text大于或者等于top,就出不居中,如果不小于top,就上下居中
if (h2 <= h1) {
this.alignItemsCenter = false;
} else {
this.alignItemsCenter = true;
}
},
changeLetter(index) {
this.letterActive = index;
this.$emit("changeLetter", index);
// this.$emit("changeLetter", this.letters[index]);
},
},
};
</script>
<style lang="scss" scoped>
.question {
// position: absolute;
// top: 0px;
// display: inline-block;
width: 100%;
height: 370px;
padding-bottom: 10px;
border-bottom: 1px solid #bbbbbb;
// background: red;
flex-direction: column;
.top {
background: #f9f9f9;
height: 54px;
padding: 0px 10px 0px 43px;
overflow-wrap: anywhere;
// align-items: center;
overflow-y: auto;
position: relative;
.text {
font-size: 14px;
text-indent: 2em;
}
.num {
position: absolute;
left: 0;
width: 48px;
height: 48px;
top: 4px;
background: #1d84ff;
border-radius: 50%;
text-align: center;
line-height: 48px;
font-size: 18px;
color: #ffffff;
}
}
.middle {
flex: 1;
// background: blue;
overflow-y: auto;
padding-left: 43px;
padding-right: 10px;
margin-bottom: 15px;
.item {
padding-top: 38px;
width: 100%;
overflow-wrap: anywhere;
font-size: 14px;
color: #101010;
.letter {
padding: 2px;
margin-right: 10px;
box-sizing: border-box;
}
}
}
.bottom {
max-height: 70px;
// background: black;
padding-left: 43px;
padding-right: 10px;
overflow-y: auto;
.change-wrapper {
width: 756px;
flex-wrap: wrap;
margin: 0 auto;
.change {
width: 90px;
height: 30px;
background: #e8f4ff;
color: #101010;
border: 1px solid #a3d3ff;
line-height: 30px;
text-align: center;
margin: 0 9px 5px;
border-radius: 4px;
cursor: pointer;
&.active {
background: #1d84ff;
color: #ffffff;
border: 1px solid #a3d3ff;
}
&:hover {
background: rgba(29, 132, 255, 0.5);
color: #ffffff;
}
}
}
}
}
</style>
<template>
<div class="lession-right-wrapper flex">
<div class="top flex">
<div class="title">通知</div>
<div class="content-wrapper flex">
<div v-for="item in []" :key="item + ''" class="content flex">
<div class="left zzz">
啥啊啥飒哈市罚款收到回复夹寒暑假电烤炉付货款静安荟SDK复活卡开始了东航飞机好看的发
</div>
<div class="right">2022-9-15</div>
</div>
</div>
</div>
<div class="bottom flex">
<div class="title">考试历史</div>
<div class="th flex">
<div class="left">学习课程</div>
<div class="middle">考试时间</div>
<div class="right">得分</div>
</div>
<div v-for="item in list" :key="item.courseId" class="td flex" style="">
<div class="left zzz">{{ item.courseName }}</div>
<div class="middle zzz" :title="item.examinationTime">
{{ item.examinationTime }}
</div>
<div class="right flex">
<div class="a">
<span
class="text"
:class="{ red: item.examinationResult < item.qualifiedNum }"
>{{
(item.examinationResult &&item.topicNum)? Math.floor((item.examinationResult / item.topicNum) * 100):0
}}</span
>/<span>100</span>
</div>
<div class="b flex">
<div style="width: 60px">
<el-progress
:percentage="
Math.floor((item.examinationResult / item.topicNum) * 100)
"
:show-text="false"
></el-progress>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "lession-right",
props: {
list: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {};
},
methods: {},
};
</script>
<style lang="scss" scoped>
.lession-right-wrapper {
width: 100%;
height: 100%;
flex-direction: column;
> div {
border: 1px solid#BBBBBB;
border-radius: 5px;
}
.top {
width: 100%;
height: 32.7%;
margin-bottom: 23px;
padding: 30px 19px 25px 21px;
flex-direction: column;
overflow: hidden;
.title {
font-size: 14px;
color: #606266;
margin-bottom: 20px;
}
.content-wrapper {
flex: 1;
width: 100%;
overflow-y: auto;
&::-webkit-scrollbar {
width: 0 !important;
}
flex-direction: column;
justify-content: space-between;
.content {
justify-content: space-between;
width: 100%;
font-size: 14px;
color: #7b808a;
.left {
flex: 1;
max-width: 304px;
margin-right: 19px;
}
.right {
min-width: 70px;
}
}
}
}
.bottom {
flex: 1;
width: 100%;
padding-top: 30px;
padding-bottom: 30px;
flex-direction: column;
.title {
margin-left: 21px;
font-size: 14px;
color: #606266;
margin-bottom: 20px;
}
.th {
width: 100%;
height: 50px;
background: #e8f4ff;
justify-content: space-between;
padding-left: 21px;
padding-right: 25px;
margin-bottom: 14px;
> div {
width: 33%;
line-height: 50px;
font-size: 14px;
color: #606266;
text-align: center;
&.left {
width: 40%;
}
&.middle {
width: 30%;
}
&.right {
width: 30%;
text-align: center;
}
}
}
.td {
width: 100%;
height: 40px;
justify-content: space-between;
padding-left: 21px;
padding-right: 25px;
> div {
line-height: 40px;
font-size: 14px;
color: #606266;
text-align: center;
&.left {
width: 40%;
}
&.middle {
width: 30%;
}
&.right {
width: 30%;
overflow: hidden;
justify-content: space-between;
.a {
// width: 20px;
// overflow: hidden;
margin-right: 5px;
text-align: right;
flex: 1;
.text {
color: #32be0f;
&.red {
color: #d11414;
}
}
}
.b {
align-items: center;
// flex: 1;
> div {
width: 100%;
}
}
}
}
}
}
}
</style>
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