Commit e764c385 authored by 吴卿华's avatar 吴卿华

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	danger-manage-system/src/main/java/com/zehong/system/domain/vo/UserCourseVo.java
#	danger-manage-system/src/main/resources/mapper/system/TTrainCourseMapper.xml
parents c6feac8e 6f2adafc
......@@ -19,7 +19,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.40</version>
<version>1.2.83</version>
</dependency>
<dependency>
......@@ -93,6 +93,11 @@
<systemPath>${project.basedir}/arcsoft_lib/arcsoft-sdk-face-3.0.0.0.jar</systemPath>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies>
<build>
......
......@@ -52,7 +52,7 @@ public class FaceEngineUtils {
//引擎配置
EngineConfiguration engineConfiguration = new EngineConfiguration();
engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);
engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_0_ONLY);
engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_ALL_OUT);
engineConfiguration.setDetectFaceMaxNum(detectFaceMaxNum);
engineConfiguration.setDetectFaceScaleVal(detectFaceScaleVal);
......
......@@ -2,16 +2,30 @@ package com.zehong.web.controller.arcfacecompare;
import com.arcsoft.face.toolkit.ImageFactory;
import com.arcsoft.face.toolkit.ImageInfo;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.domain.model.LoginUser;
import com.zehong.common.utils.ServletUtils;
import com.zehong.framework.web.service.TokenService;
import com.zehong.web.arcface.util.FaceEngineUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.http.entity.ContentType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
......@@ -26,6 +40,10 @@ public class FaceCompareController {
@Autowired
private FaceEngineUtils faceEngineUtil;
@Autowired
private TokenService tokenService;
@Value("${zehong.profile}")
public String uploadUrl;
/**
* 图片比对
......@@ -49,4 +67,81 @@ public class FaceCompareController {
return result;
}
}
@PostMapping(value = "/compareOne")
public Map<String,Object> compareOne(@RequestParam(value = "file")MultipartFile file){
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
SysUser user = loginUser.getUser();
Map<String,Object> result = new HashMap<>(16);
try {
//MultipartFile file2 = createFileItem(user.getCertificateUrl());
MultipartFile file2 = createMfileByPath(user.getCertificateUrl());
ImageInfo rgbData1 = ImageFactory.getRGBData(file.getBytes());
ImageInfo rgbData2 = ImageFactory.getRGBData(file2.getBytes());
result.put("code","0");
result.put("faceSimilar",faceEngineUtil.compareFace(rgbData1,rgbData2));
return result;
} catch (Exception e) {
result.put("code","1");
result.put("msg",e.getMessage());
logger.error("图片比对系统错误:" + e);
return result;
}
}
/**
* url转变为 MultipartFile对象
* @return
* @throws Exception
*/
public MultipartFile createMfileByPath(String path) {
MultipartFile mFile = null;
path = uploadUrl + "/upload"+path.split("upload")[1];
//path = "D:\\zehong\\uploadPath\\upload\\2023\\02\\07\\b8d62b74-eee3-46fc-8918-8fd2a2b8ba31.jpg";
try {
File file = new File(path);
FileInputStream fileInputStream = new FileInputStream(file);
String fileName = file.getName();
fileName = fileName.substring((fileName.lastIndexOf("/") + 1));
mFile = new MockMultipartFile(fileName, fileName, ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
} catch (Exception e) {
e.printStackTrace();
}
return mFile;
}
/**
* url转变为 MultipartFile对象
* @param url
* @return
* @throws Exception
*/
private MultipartFile createFileItem(String url) throws Exception{
FileItem item = null;
String fileName = "123.jpg";
try {
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setReadTimeout(30000);
conn.setConnectTimeout(30000);
//设置应用程序要从网络连接读取数据
conn.setDoInput(true);
conn.setRequestMethod("GET");
if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {
InputStream is = conn.getInputStream();
FileItemFactory factory = new DiskFileItemFactory(16, null);
String textFieldName = "uploadfile";
item = factory.createItem(textFieldName, ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName);
OutputStream os = item.getOutputStream();
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = is.read(buffer, 0, 8192)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
is.close();
}
} catch (IOException e) {
throw new RuntimeException("文件下载失败", e);
}
return new CommonsMultipartFile(item);
}
}
......@@ -69,6 +69,7 @@ public class TEnterpriseSystemController extends BaseController
/**
* 新增企业制度管理
*/
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:add')")
@Log(title = "企业制度管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TEnterpriseSystem tEnterpriseSystem)
......@@ -79,6 +80,7 @@ public class TEnterpriseSystemController extends BaseController
/**
* 修改企业制度管理
*/
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:edit')")
@Log(title = "企业制度管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TEnterpriseSystem tEnterpriseSystem)
......@@ -89,6 +91,7 @@ public class TEnterpriseSystemController extends BaseController
/**
* 删除企业制度管理
*/
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:remove')")
@Log(title = "企业制度管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{systemIds}")
public AjaxResult remove(@PathVariable Long[] systemIds)
......
......@@ -106,7 +106,7 @@ zehong:
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: D:/zehong/uploadPath
profile: /home/zehong/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
......@@ -116,9 +116,9 @@ zehong:
config:
arcface-sdk:
#算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64)
sdk-lib-path: \danger-manage-admin\arcsoft_lib\WIN64
sdk-lib-path: /arcsoft_lib/LINUX64
app-id: C8vzXcY8iD7yGFCHweh1QcvJaV684GCPk2oCe4JC1rpZ
sdk-key: C8MFKCRxMAsBSDG5W5cL1x1YirGREoojZvFtBzKv3bAP
sdk-key: C8MFKCRxMAsBSDG5W5cL1x1YajhEddpDmSyPpX4HYZkY
detect-face-max-num: 10
detect-face-scale-val: 32
thread-pool-size: 5
......
......@@ -74,13 +74,13 @@ spring:
# redis 配置
redis:
# 地址
host: 127.0.0.1
host: 36.148.23.59
# 端口,默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
password: 1qaz2wsx3edc
# 连接超时时间
timeout: 10s
lettuce:
......@@ -106,7 +106,7 @@ zehong:
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: /home/zehong/uploadPath
profile: E:/zehong/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
......@@ -117,9 +117,9 @@ zehong:
config:
arcface-sdk:
#算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64)
sdk-lib-path: /arcsoft_lib/LINUX64
app-id: 3ZM3ayaRriUPWzzy29QsqeynFcpmu9zMVXGjBrQ4rPkL
sdk-key: J1wqG4VVGJYLe5YYT2hQN3xHSqLEwrZJBBRQmuEXkZqc
sdk-lib-path: \danger-manage-admin\arcsoft_lib\WIN64
app-id: C8vzXcY8iD7yGFCHweh1QcvJaV684GCPk2oCe4JC1rpZ
sdk-key: C8MFKCRxMAsBSDG5W5cL1x1YirGREoojZvFtBzKv3bAP
detect-face-max-num: 10
detect-face-scale-val: 32
thread-pool-size: 5
......
......@@ -106,7 +106,7 @@ zehong:
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: D:/zehong/uploadPath
profile: /home/zehong/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
......@@ -117,8 +117,8 @@ config:
arcface-sdk:
#算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64)
sdk-lib-path: /arcsoft_lib/LINUX64
app-id: 3ZM3ayaRriUPWzzy29QsqeynFcpmu9zMVXGjBrQ4rPkL
sdk-key: J1wqG4VVGJYLe5YYT2hQN3xHSqLEwrZJBBRQmuEXkZqc
app-id: C8vzXcY8iD7yGFCHweh1QcvJaV684GCPk2oCe4JC1rpZ
sdk-key: C8MFKCRxMAsBSDG5W5cL1x1YajhEddpDmSyPpX4HYZkY
detect-face-max-num: 10
detect-face-scale-val: 32
thread-pool-size: 5
......
......@@ -92,6 +92,16 @@ public class SysUser extends BaseEntity
/** 岗位组 */
private Long[] postIds;
private String certificateUrl;
public String getCertificateUrl() {
return certificateUrl;
}
public void setCertificateUrl(String certificateUrl) {
this.certificateUrl = certificateUrl;
}
public SysUser()
{
......
......@@ -114,7 +114,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers(
HttpMethod.POST,
"/subscription/**",
"/system/result/**"
"/system/result/**",
"/arcFace/**"
).permitAll()
.antMatchers("/profile/**").anonymous()
.antMatchers("/common/download**").anonymous()
......
......@@ -100,6 +100,9 @@ public class TTrainCourse extends BaseEntity
/**判断题分数*/
private Integer judgmentScore;
/** 是否人脸认证:1是 2否 */
private String isVeriftyFace;
public static long getSerialVersionUID() {
return serialVersionUID;
}
......@@ -297,6 +300,14 @@ public class TTrainCourse extends BaseEntity
return testPersons;
}
public String getIsVeriftyFace() {
return isVeriftyFace;
}
public void setIsVerfityFace(String isVeriftyFace) {
this.isVeriftyFace = isVeriftyFace;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -57,4 +57,6 @@ public class UserCourseVo {
/** 已完成时长*/
private Integer finishDuration;
private Integer isVeriftyFace;
}
......@@ -57,6 +57,13 @@ public class TStaningBookServiceImpl implements ITStaningBookService
tStaningBook.setUserId(0l);
}
List<TStaningBook> list = tStaningBookMapper.selectTStaningBookList(tStaningBook);
for (TStaningBook t : list){
if(t.getRectificationTerm()!=null&&t.getRectificationTerm().getTime()<new Date().getTime()&&t.getState()==0){
t.setFinishDay(1l);
}else {
t.setFinishDay(0l);
}
}
return list;
}
public List<Long> selectDeptIds(List<Long> list,List<Long> deptIds){
......
......@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="certificateUrl" column="certificate_url" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
......@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,u.certificate_url,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
......@@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.certificate_url, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0' and u.user_staff='0'
<if test="userName != null and userName != ''">
......
......@@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="multipleChoiceScore" column="multiple_choice_score" />
<result property="singleChoiceScore" column="single_choice_score" />
<result property="judgmentScore" column="judgment_score" />
<result property="isVeriftyFace" column="is_verifty_face" />
</resultMap>
<resultMap id="StatisticsTrainCourseResult" type="StatisticsTrainCourse">
......@@ -42,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectTTrainCourseVo">
select multiple_choice_score,single_choice_score,judgment_score,course_id, course_name, course_type, course_conent, status,personnel_type, release_time, enclosure, video, qualified_num, topic_num, create_time, create_user, is_del, data_kind, test_start_time, test_end_time, test_persons,duration from t_train_course
select multiple_choice_score,single_choice_score,judgment_score,course_id, course_name, course_type, course_conent, status,personnel_type, release_time, enclosure, video, qualified_num, topic_num, create_time, create_user, is_del, data_kind, test_start_time, test_end_time, test_persons,duration,is_verifty_face from t_train_course
</sql>
<select id="selectTTrainCourseList" parameterType="TTrainCourse" resultMap="TTrainCourseResult">
......@@ -97,7 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="multipleChoiceScore != null">multiple_choice_score,</if>
<if test="singleChoiceScore != null">single_choice_score,</if>
<if test="judgmentScore != null">judgment_score,</if>
</trim>
<if test="isVeriftyFace != null">is_verifty_face,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="courseName != null">#{courseName},</if>
<if test="courseType != null">#{courseType},</if>
......@@ -120,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="multipleChoiceScore != null">#{multipleChoiceScore},</if>
<if test="singleChoiceScore != null">#{singleChoiceScore},</if>
<if test="judgmentScore != null">#{judgmentScore},</if>
</trim>
<if test="isVeriftyFace != null">#{isVeriftyFace},</if>
</trim>
</insert>
<update id="updateTTrainCourse" parameterType="TTrainCourse">
......@@ -147,6 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="multipleChoiceScore != null">multiple_choice_score = #{multipleChoiceScore},</if>
<if test="singleChoiceScore != null">single_choice_score = #{singleChoiceScore},</if>
<if test="judgmentScore != null">judgment_score = #{judgmentScore},</if>
<if test="isVeriftyFace != null">is_verifty_face = #{isVeriftyFace},</if>
</trim>
where course_id = #{courseId}
</update>
......@@ -168,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<select id="userCourseList" resultType="com.zehong.system.domain.vo.UserCourseVo">
SELECT uc.user_course_id AS userCourseId,uc.finish_duration AS finishDuration,uc.state ,uc.examination_time AS examinationTime,uc.train_state AS trainState,
SELECT uc.user_course_id AS userCourseId,uc.state ,uc.examination_time AS examinationTime,uc.train_state AS trainState,c.is_verifty_face AS isVeriftyFace,
uc.`examination_result` AS examinationResult,uc.`create_time` AS createTime,c.test_start_time as testStartTime,c.test_end_time as testEndTime,
c.`course_name` AS courseName, c.`topic_num` AS topicNum,c.`release_time` AS releaseTime,c.data_kind as dataKind,c.personnel_type as personnelType,
p.`plan_name` AS courseType,c.course_id as courseId,c.qualified_num as qualifiedNum,c.multiple_choice_score as multipleChoiceScore,
......@@ -183,9 +187,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type!=null and type == 2">
and uc.state = 2
</if>
<if test="dataKind!=null">
and c.data_kind = #{dataKind}
</if>
<if test="type!=null and type == 3">
and uc.state !=0
order by uc.examination_time desc
......
......@@ -17,7 +17,7 @@
>
<div class="top flex">
<el-form-item label="课程标题" prop="courseName">
<el-input style="width: 400px" v-model="form.courseName" :disabled="checkLock"></el-input>
<el-input style="width: 568px" v-model="form.courseName" :disabled="checkLock"></el-input>
</el-form-item>
<!--<el-form-item label="培训计划" prop="courseType">-->
......@@ -44,6 +44,7 @@
clearable
size="small"
:disabled="checkLock"
style="width:215px"
>
<el-option
v-for="course in courseOptions"
......@@ -59,12 +60,15 @@
style="margin-left: 55px"
>
<el-input
style="width: 220px"
style="width: 180px"
placeholder="分钟"
type="number"
v-model="form.duration"
:disabled="checkLock"
></el-input>
<el-label>
(分钟)
</el-label>
</el-form-item>
</div>
<div class="flex">
......@@ -89,6 +93,10 @@
:disabled="checkLock"
/>
</el-form-item>
<el-form-item label="是否人脸认证" prop="isVeriftyFace" style="margin-left: 50px">
<el-radio v-model="form.isVeriftyFace" label="1"></el-radio>
<el-radio v-model="form.isVeriftyFace" label="2"></el-radio>
</el-form-item>
</div>
<!-- </div> -->
<el-form-item label="课程内容" prop="courseConent">
......@@ -162,6 +170,7 @@ export default {
courseConent: "",
video: "",
enclosure: "",
isVeriftyFace: "2"
},
fileType: ["doc", "docx", "xls", "xlsx", "ppt", "txt", "pdf"],
fileListVideo: [],
......@@ -219,6 +228,7 @@ export default {
getLessonById() {
getLessonById(this.courseId).then((res) => {
if (res.code == 200) {
res.data.duration=res.data.duration/60;
const data = res.data;
const {
courseName,
......@@ -229,6 +239,7 @@ export default {
duration,
testStartTime,
testEndTime,
isVeriftyFace,
} = data;
this.form = {
courseName,
......@@ -239,6 +250,7 @@ export default {
duration,
testStartTime,
testEndTime,
isVeriftyFace,
};
console.log('video',video)
this.fileListVideo = video? [
......
......@@ -33,7 +33,7 @@
>
</div>
<div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span
判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
......
......@@ -132,11 +132,21 @@
width="180"
>
<template v-slot="{ row: { topicNum, courseId, status } }">
<span @click="checkQuestion(courseId, status)" class="timuNum">
<span v-if="topicNum > 0">
<span>
<span
class="timuNum"
@click="checkQuestion(courseId, status)"
v-if="topicNum > 0"
>
{{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</span>
<span v-else>未录入</span>
<span v-else-if="status === 1 && topicNum == 0"> - </span>
<span
class="timuNum"
@click="checkQuestion(courseId, status)"
v-else
>未录入</span
>
</span>
</template>
</el-table-column>
......@@ -145,7 +155,9 @@
align="center"
class-name="small-padding fixed-width"
>
<template v-slot="{ row: { status, courseId } }">
<template
v-slot="{ row: { courseName, courseType, status, courseId } }"
>
<!-- <div>{{status}}</div> -->
<el-button
v-if="status == 0"
......@@ -175,7 +187,7 @@
size="mini"
type="text"
icon="el-icon-delete"
@click="issueDilog(courseId)"
@click="issueDilog(courseId, courseName, courseType)"
>发布</el-button
>
</template>
......@@ -196,7 +208,18 @@
:checkLock.sync="checkLock"
:visible.sync="dilogFlag"
/>
<el-dialog title="发布详情" :visible.sync="issueVisible" width="60%">
<el-dialog
class="lessons-program"
title="培训考试发布详情"
:visible.sync="issueVisible"
width="60%"
>
<span class="dialogName"
>培训名称: <span class="a">{{ dilogName }}</span>
</span>
<span class="dialogName"
>培训计划: <span class="a">{{ dilogType }}</span></span
>
<div class="detail flex">
<div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span
......@@ -213,20 +236,19 @@
}}</span
>
</div>
<div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span
判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
</div>
<div class="detail">
<div class="detail-item">
<span>{{ danxs + duoxs + pds }}</span
<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
......@@ -235,6 +257,12 @@
>
</div>
</div>
<div class="detail">
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button>
......@@ -289,6 +317,8 @@ export default {
dilogFlag: false,
// 发布弹框
issueVisible: false,
dilogName: "",
dilogType: null,
bottomFrom: {
singleChoiceScore: 0,
multipleChoiceScore: 0,
......@@ -307,13 +337,13 @@ export default {
computed: {
...mapGetters(["courseOptions"]),
danxs() {
return this.questionList.filter((item) => item.topicType === 1).length;
return this.questionList.filter((item) => item.topicType === 1).length || 0;
},
duoxs() {
return this.questionList.filter((item) => item.topicType === 2).length;
return this.questionList.filter((item) => item.topicType === 2).length || 0;
},
pds() {
return this.questionList.filter((item) => item.topicType === 3).length;
return this.questionList.filter((item) => item.topicType === 3).length || 0;
},
},
created() {
......@@ -426,8 +456,8 @@ export default {
.catch(() => {});
},
// 发布弹框
issueDilog(courseId) {
getQuestion({courseId})
issueDilog(courseId, name, type) {
getQuestion({ courseId })
.then((res) => {
this.questionList = res.rows.map((item) => {
return {
......@@ -442,13 +472,19 @@ export default {
})
.then((res) => {
this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore,
multipleChoiceScore: res.data.multipleChoiceScore,
judgmentScore: res.data.judgmentScore,
qualifiedNum: res.data.qualifiedNum,
singleChoiceScore: res.data.singleChoiceScore || 0,
multipleChoiceScore: res.data.multipleChoiceScore || 0,
judgmentScore: res.data.judgmentScore || 0,
qualifiedNum: res.data.qualifiedNum || 0,
};
})
.then((res) => {
this.dilogName = name;
this.dilogType =
type &&
this.courseOptions.filter((item) => item.planId == type)[0] &&
this.courseOptions.filter((item) => item.planId == type)[0]
.planName;
this.issueVisible = true;
this.issueCourseId = courseId;
});
......@@ -457,15 +493,16 @@ export default {
},
// 发布
issueLesson(courseId) {
this.$confirm("确定要发布吗", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
// 判断是否录入答题合格数
return getLessonById(courseId);
})
// this.$confirm("确定要发布吗", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// })
// .then(() => {
// // 判断是否录入答题合格数
// return getLessonById(courseId);
// })
getLessonById(courseId)
.then((res) => {
// if (
// res.data.singleChoiceScore >= 0 &&
......@@ -592,12 +629,21 @@ export default {
width: 100%;
}
::v-deep .el-dialog {
margin-top: 15vh !important;
margin-top: 10vh !important;
}
::v-deep .el-dialog .el-dialog__body {
padding-top: 5px;
}
.dialogName {
margin-right: 50px;
// color: #ccc;
font-size: 16px;
}
.detail {
// position: absolute;
// bottom: -20px;
// left: 10px;
margin-top: 20px;
.textC {
font-weight: 800;
font-size: 18px;
......
......@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 20:14:18
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-01-05 09:38:13
* @LastEditTime: 2023-02-03 15:59:38
* @FilePath: /danger-manage-web/src/views/myLessons/CheckLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -92,7 +92,8 @@
</div>
<div class="btn-wrapper flex">
<el-button v-if="this.finish" @click="againQuesstion" type="primary">{{
<!-- topicNum>0代表有考试题,没考试题不需要考试 -->
<el-button v-if="this.finish &&lessonData.topicNum>0 " @click="againQuesstion" type="primary">{{
state == 2 || state == 1 ? "重新考试" : "开始考试"
}}</el-button>
<el-button @click="$router.back()" type="primary" plain>取消</el-button>
......
......@@ -9,9 +9,11 @@
<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="allone" style="position:relative">
<!--<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="content">{{itemData.dataKind==0?"培训课程":"随机考试"}}</div>
<div class="border"></div>
<div class="lesson zzz" style="width: 75%" :title="itemData.courseName"> {{ itemData.courseName }}</div>
</div>
<div class="time">发布时间:{{ itemData.createTime }}</div>
......@@ -222,4 +224,27 @@ export default {
}
}
}
.border {
width: 0;
height: 0;
border: 10px solid;
border-color: transparent transparent transparent #1d84ff;
}
.border:after {
content: '';
border-style: solid;
border-width: 10px;
border-color: transparent transparent transparent #fff;
position: absolute;
top: 0px;
left: 49px;
}
.content{
border: 1.5px solid #1d84ff;
height: 20px;
font-size: 10px;
color: #1d84ff;
line-height: 18px;
}
</style>
......@@ -44,6 +44,10 @@
:disabled="checkLock"
/>
</el-form-item>
<el-form-item label="是否人脸认证" prop="isVeriftyFace" style="margin-left: 50px">
<el-radio v-model="form.isVeriftyFace" label="1"></el-radio>
<el-radio v-model="form.isVeriftyFace" label="2"></el-radio>
</el-form-item>
</div>
<el-form-item label="选择人员" prop="testPersons">
<ChangePapel
......@@ -93,6 +97,7 @@ export default {
testStartTime: "",
testEndTime: "",
testPersons: "",
isVeriftyFace: "2"
},
jsonSelectNameList: null,
// '[{"peoPleId":880,"peoPleName":"孙卓亚"},{"peoPleId":871,"peoPleName":"张玉宾"}]',
......@@ -146,12 +151,13 @@ export default {
getLessonById(this.courseId).then((res) => {
if (res.code == 200) {
const data = res.data;
const { courseName, testStartTime, testEndTime, testPersons } = data;
const { courseName, testStartTime, testEndTime, testPersons, isVeriftyFace } = data;
this.form = {
courseName,
testStartTime,
testEndTime,
testPersons,
isVeriftyFace,
};
this.jsonSelectNameList = testPersons;
this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
......
......@@ -34,7 +34,7 @@
>
</div>
<div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span
判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
......
......@@ -63,7 +63,7 @@
<el-table v-loading="loading" :data="lessonsList">
<el-table-column label="序号" align="center" prop="bankNum" width="55" />
<el-table-column label="课程标题" align="center" prop="courseName" />
<el-table-column label="考试名称" align="center" prop="courseName" />
<el-table-column
label="开始时间"
align="center"
......@@ -102,7 +102,11 @@
align="center"
class-name="small-padding fixed-width"
>
<template v-slot="{ row: { status, courseId, qualifiedNum } }">
<template
v-slot="{
row: { courseName, topicNum, status, courseId,testStartTime,testEndTime },
}"
>
<!-- <div>{{status}}</div> -->
<!-- <el-button
v-if="status == 0"
......@@ -140,7 +144,7 @@
size="mini"
type="text"
icon="el-icon-delete"
@click="issueDilog(courseId)"
@click="issueDilog(courseId, courseName, topicNum,testStartTime,testEndTime)"
>发布</el-button
>
</template>
......@@ -161,7 +165,29 @@
:checkLock.sync="checkLock"
:visible.sync="dilogFlag"
/>
<el-dialog title="发布详情" :visible.sync="issueVisible" width="60%">
<el-dialog
class="lessons-program"
title="试卷考试发布详情"
:visible.sync="issueVisible"
width="60%"
>
<div>
<span class="dialogName"
>考试名称: <span class="a">{{ dilogName }}</span>
</span>
</div>
<div style="margin-top:20px">
<span class="dialogName"
>开始时间: <span class="a">{{ dilogStartTime }}</span>
</span>
<span class="dialogName"
>结束时间: <span class="a">{{ dilogEndTime }}</span>
</span>
</div>
<!-- <span class="dialogName"
>培训计划: <span class="a">{{ dilogType }}</span></span
> -->
<div class="detail flex">
<div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span
......@@ -178,20 +204,19 @@
}}</span
>
</div>
<div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span
判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
>
</div>
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
</div>
<div class="detail">
<div class="detail-item">
<span>{{ danxs + duoxs + pds }}</span
<span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore +
......@@ -200,6 +225,12 @@
>
</div>
</div>
<div class="detail">
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button>
......@@ -255,6 +286,11 @@ export default {
dilogFlag: false,
// 发布
issueVisible: false,
dilogName: "",
dilogTopicNum: 0,
dilogStartTime:0,
dilogEndTime:0,
// dilogType: null,
bottomFrom: {
singleChoiceScore: 0,
multipleChoiceScore: 0,
......@@ -404,12 +440,18 @@ export default {
.catch(() => {});
},
// 发布
issueDilog(courseId) {
getQuestion({courseId})
issueDilog(courseId, name, num,startTime,endTime) {
if (num === 0) {
this.$message({
message: "请至少录入一道考题在发布",
type: "warning",
});
return;
}
getQuestion({ courseId })
.then((res) => {
console.log(res)
console.log(res);
this.questionList = res.rows.map((item) => {
return {
topicType: item.topicType,
topicId: item.topicId,
......@@ -422,13 +464,17 @@ export default {
})
.then((res) => {
this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore ||0,
multipleChoiceScore: res.data.multipleChoiceScore||0,
judgmentScore: res.data.judgmentScore||0,
qualifiedNum: res.data.qualifiedNum||0,
singleChoiceScore: res.data.singleChoiceScore || 0,
multipleChoiceScore: res.data.multipleChoiceScore || 0,
judgmentScore: res.data.judgmentScore || 0,
qualifiedNum: res.data.qualifiedNum || 0,
};
})
.then((res) => {
// 名称
this.dilogName = name;
this.dilogStartTime=startTime;
this.dilogEndTime=endTime;
this.issueVisible = true;
this.issueCourseId = courseId;
});
......@@ -436,15 +482,17 @@ export default {
//
},
issueLesson(courseId) {
this.$confirm("确定要发布吗", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
// 判断是否录入答题合格数
return getLessonById(courseId);
})
// this.$confirm("确定要发布吗", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// })
// .then(() => {
// // 判断是否录入答题合格数
// return getLessonById(courseId);
// })
getLessonById(courseId)
.then((res) => {
// if (
// res.data.singleChoiceScore > 0 &&
......@@ -500,12 +548,21 @@ export default {
width: 100%;
}
::v-deep .el-dialog {
margin-top: 15vh !important;
margin-top: 10vh !important;
}
::v-deep .el-dialog .el-dialog__body {
padding-top: 5px;
}
.dialogName {
margin-right: 50px;
// color: #ccc;
font-size: 16px;
}
.detail {
// position: absolute;
// bottom: -20px;
// left: 10px;
margin-top: 20px;
.textC {
font-weight: 800;
font-size: 18px;
......
......@@ -40,7 +40,7 @@
>
</div>
<div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span
判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore
}}</span
......
......@@ -56,6 +56,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['safetyManagement:enterpriseSystem:add']"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
......@@ -77,18 +78,24 @@
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<!-- <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />-->
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.status == '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<!--<el-button
v-if="scope.row.status == '0'"
size="mini"
type="text"
......@@ -108,13 +115,13 @@
type="text"
icon="el-icon-edit"
@click="handleInvalid(scope.row)"
>作废</el-button>
>作废</el-button>-->
<el-button
v-if="scope.row.status == '0'"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:remove']"
>删除</el-button>
</template>
</el-table-column>
......@@ -169,10 +176,10 @@
</span>
<span v-else>-</span>
</el-form-item>
<el-form-item v-show="operate" label="审批" prop="status">
<!--<el-form-item v-show="operate" label="审批" prop="status">
<el-radio v-model="form.status" label="2">通过</el-radio>
<el-radio v-model="form.status" label="0">驳回</el-radio>
</el-form-item>
</el-form-item>-->
</div>
<div style="width: 58%;margin-left: 2%">
<div class="dialogTitle">制度内容</div>
......@@ -180,7 +187,7 @@
</div>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer" v-show="!readOnly">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
......@@ -339,6 +346,20 @@ export default {
}
});
},
/** 详情按钮操作 */
handleDetail(row) {
this.readOnly=true;
this.reset();
const systemId = row.systemId || this.ids
getEnterpriseSystem(systemId).then(response => {
this.form = response.data;
this.open = true;
this.title = "企业制度信息详情";
if(this.form.fileUrl!=null||this.form.fileUrl==""){
this.fileList = [{name: this.form.fileName, url: uploadfile}];
}
});
},
/** 审批按钮操作 */
handleApproval(row) {
this.readOnly = true;
......
......@@ -46,6 +46,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['safetyManagement:enterpriseSystem:add']"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
......@@ -92,7 +93,14 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<!--<el-button
v-if="scope.row.status == '0'"
size="mini"
......@@ -119,6 +127,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:remove']"
>删除</el-button>
</template>
</el-table-column>
......@@ -200,7 +209,7 @@
</div>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer" v-show="!readOnly">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
......@@ -357,6 +366,20 @@ export default {
}
});
},
/** 详情按钮操作*/
handleDetail(row) {
this.readOnly=true;
this.reset();
const systemId = row.systemId || this.ids
getEnterpriseSystem(systemId).then(response => {
this.form = response.data;
this.open = true;
this.title = "法律法规信息详情";
if(this.form.fileUrl!=null||this.form.fileUrl==""){
this.fileList = [{name: this.form.fileName, url: uploadfile}];
}
});
},
/** 审批按钮操作 */
handleApproval(row) {
this.readOnly = true;
......
......@@ -86,6 +86,12 @@
</el-table-column>
<el-table-column label="责任部门" align="center" prop="deptName" />
<el-table-column label="整改人" align="center" prop="rectificationName" />
<el-table-column label="是否逾期 " align="center" prop="state" >
<template slot-scope="scope">
<span v-if="scope.row.finishDay==0"></span>
<span style="color: red" v-if="scope.row.finishDay==1"></span>
</template>
</el-table-column>
<el-table-column label="整改时间" align="center" prop="rectificationTime" width="180">
</el-table-column>
<el-table-column label="隐患状态 " align="center" prop="state" >
......@@ -97,6 +103,14 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.state==0&&(scope.row.escalation == user.userId||scope.row.createId == user.userId)"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleEdit(scope.row)"
v-hasPermi="['system:book:edit']"
>修改</el-button>
<el-button
v-if="scope.row.state==0&&scope.row.rectification == user.userId"
size="mini"
......@@ -384,8 +398,11 @@
</div>
</el-dialog>
<!--详情-->
<el-dialog :title="title" :visible.sync="open2" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-dialog :title="title" :visible.sync="open2" style="position: absolute" width="900px" append-to-body>
<div v-if="form.finishDay==1" class="guoqi">
<span>(已过期)</span>
</div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-divider content-position="left"><i class="el-icon-info"></i><span class="boxx">隐患信息</span></el-divider>
<el-form-item label="隐患名称">
<el-input v-model="form.troubleName" placeholder="请输入隐患名称" disabled/>
......@@ -1084,7 +1101,18 @@ export default {
this.zhong = 3;
this.staffList2 = this.staffList;
},
handleEdit(book){
this.zhong = 0;
this.fast = false;
this.reset();
this.open = true;
this.title = "添加隐患台账";
this.staffList2 = this.staffList;
this.form = book;
this.fileList.push({
url: this.form.picture,
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
......@@ -1157,6 +1185,7 @@ export default {
const bookId = row.bookId || this.ids
getBook(bookId).then(response => {
this.form = response.data;
this.form.finishDay = row.finishDay;
if(this.form.troubleLevel==1){
this.zhong = 1
}
......@@ -1339,6 +1368,13 @@ export default {
font-weight: bold;
padding-left: 5px;
}
.guoqi{
position: relative;
top: -35px;
left: 120px;
font-size: 17px;
color: red;
}
::v-deep .el-dialog__body{
padding:0px 20px!important;
}
......
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