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 @@ ...@@ -19,7 +19,7 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.40</version> <version>1.2.83</version>
</dependency> </dependency>
<dependency> <dependency>
...@@ -93,6 +93,11 @@ ...@@ -93,6 +93,11 @@
<systemPath>${project.basedir}/arcsoft_lib/arcsoft-sdk-face-3.0.0.0.jar</systemPath> <systemPath>${project.basedir}/arcsoft_lib/arcsoft-sdk-face-3.0.0.0.jar</systemPath>
</dependency> </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -52,7 +52,7 @@ public class FaceEngineUtils { ...@@ -52,7 +52,7 @@ public class FaceEngineUtils {
//引擎配置 //引擎配置
EngineConfiguration engineConfiguration = new EngineConfiguration(); EngineConfiguration engineConfiguration = new EngineConfiguration();
engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE); 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.setDetectFaceMaxNum(detectFaceMaxNum);
engineConfiguration.setDetectFaceScaleVal(detectFaceScaleVal); engineConfiguration.setDetectFaceScaleVal(detectFaceScaleVal);
......
...@@ -2,16 +2,30 @@ package com.zehong.web.controller.arcfacecompare; ...@@ -2,16 +2,30 @@ package com.zehong.web.controller.arcfacecompare;
import com.arcsoft.face.toolkit.ImageFactory; import com.arcsoft.face.toolkit.ImageFactory;
import com.arcsoft.face.toolkit.ImageInfo; 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 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; 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.HashMap;
import java.util.Map; import java.util.Map;
...@@ -26,6 +40,10 @@ public class FaceCompareController { ...@@ -26,6 +40,10 @@ public class FaceCompareController {
@Autowired @Autowired
private FaceEngineUtils faceEngineUtil; private FaceEngineUtils faceEngineUtil;
@Autowired
private TokenService tokenService;
@Value("${zehong.profile}")
public String uploadUrl;
/** /**
* 图片比对 * 图片比对
...@@ -49,4 +67,81 @@ public class FaceCompareController { ...@@ -49,4 +67,81 @@ public class FaceCompareController {
return result; 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 ...@@ -69,6 +69,7 @@ public class TEnterpriseSystemController extends BaseController
/** /**
* 新增企业制度管理 * 新增企业制度管理
*/ */
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:add')")
@Log(title = "企业制度管理", businessType = BusinessType.INSERT) @Log(title = "企业制度管理", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TEnterpriseSystem tEnterpriseSystem) public AjaxResult add(@RequestBody TEnterpriseSystem tEnterpriseSystem)
...@@ -79,6 +80,7 @@ public class TEnterpriseSystemController extends BaseController ...@@ -79,6 +80,7 @@ public class TEnterpriseSystemController extends BaseController
/** /**
* 修改企业制度管理 * 修改企业制度管理
*/ */
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:edit')")
@Log(title = "企业制度管理", businessType = BusinessType.UPDATE) @Log(title = "企业制度管理", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TEnterpriseSystem tEnterpriseSystem) public AjaxResult edit(@RequestBody TEnterpriseSystem tEnterpriseSystem)
...@@ -89,6 +91,7 @@ public class TEnterpriseSystemController extends BaseController ...@@ -89,6 +91,7 @@ public class TEnterpriseSystemController extends BaseController
/** /**
* 删除企业制度管理 * 删除企业制度管理
*/ */
@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseSystem:remove')")
@Log(title = "企业制度管理", businessType = BusinessType.DELETE) @Log(title = "企业制度管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{systemIds}") @DeleteMapping("/{systemIds}")
public AjaxResult remove(@PathVariable Long[] systemIds) public AjaxResult remove(@PathVariable Long[] systemIds)
......
...@@ -106,7 +106,7 @@ zehong: ...@@ -106,7 +106,7 @@ zehong:
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath) # 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: D:/zehong/uploadPath profile: /home/zehong/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
...@@ -116,9 +116,9 @@ zehong: ...@@ -116,9 +116,9 @@ zehong:
config: config:
arcface-sdk: arcface-sdk:
#算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64) #算法引擎路径 示例(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 app-id: C8vzXcY8iD7yGFCHweh1QcvJaV684GCPk2oCe4JC1rpZ
sdk-key: C8MFKCRxMAsBSDG5W5cL1x1YirGREoojZvFtBzKv3bAP sdk-key: C8MFKCRxMAsBSDG5W5cL1x1YajhEddpDmSyPpX4HYZkY
detect-face-max-num: 10 detect-face-max-num: 10
detect-face-scale-val: 32 detect-face-scale-val: 32
thread-pool-size: 5 thread-pool-size: 5
......
...@@ -74,13 +74,13 @@ spring: ...@@ -74,13 +74,13 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 127.0.0.1 host: 36.148.23.59
# 端口,默认为6379 # 端口,默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
password: password: 1qaz2wsx3edc
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
...@@ -106,7 +106,7 @@ zehong: ...@@ -106,7 +106,7 @@ zehong:
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath) # 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: /home/zehong/uploadPath profile: E:/zehong/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
...@@ -117,9 +117,9 @@ zehong: ...@@ -117,9 +117,9 @@ zehong:
config: config:
arcface-sdk: arcface-sdk:
#算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64) #算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64)
sdk-lib-path: /arcsoft_lib/LINUX64 sdk-lib-path: \danger-manage-admin\arcsoft_lib\WIN64
app-id: 3ZM3ayaRriUPWzzy29QsqeynFcpmu9zMVXGjBrQ4rPkL app-id: C8vzXcY8iD7yGFCHweh1QcvJaV684GCPk2oCe4JC1rpZ
sdk-key: J1wqG4VVGJYLe5YYT2hQN3xHSqLEwrZJBBRQmuEXkZqc sdk-key: C8MFKCRxMAsBSDG5W5cL1x1YirGREoojZvFtBzKv3bAP
detect-face-max-num: 10 detect-face-max-num: 10
detect-face-scale-val: 32 detect-face-scale-val: 32
thread-pool-size: 5 thread-pool-size: 5
......
...@@ -106,7 +106,7 @@ zehong: ...@@ -106,7 +106,7 @@ zehong:
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath) # 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: D:/zehong/uploadPath profile: /home/zehong/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
...@@ -117,8 +117,8 @@ config: ...@@ -117,8 +117,8 @@ config:
arcface-sdk: arcface-sdk:
#算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64) #算法引擎路径 示例(Windows配置\danger-manage-admin\arcsoft_lib\WIN64,Linux配置/arcsoft_lib/LINUX64)
sdk-lib-path: /arcsoft_lib/LINUX64 sdk-lib-path: /arcsoft_lib/LINUX64
app-id: 3ZM3ayaRriUPWzzy29QsqeynFcpmu9zMVXGjBrQ4rPkL app-id: C8vzXcY8iD7yGFCHweh1QcvJaV684GCPk2oCe4JC1rpZ
sdk-key: J1wqG4VVGJYLe5YYT2hQN3xHSqLEwrZJBBRQmuEXkZqc sdk-key: C8MFKCRxMAsBSDG5W5cL1x1YajhEddpDmSyPpX4HYZkY
detect-face-max-num: 10 detect-face-max-num: 10
detect-face-scale-val: 32 detect-face-scale-val: 32
thread-pool-size: 5 thread-pool-size: 5
......
...@@ -92,6 +92,16 @@ public class SysUser extends BaseEntity ...@@ -92,6 +92,16 @@ public class SysUser extends BaseEntity
/** 岗位组 */ /** 岗位组 */
private Long[] postIds; private Long[] postIds;
private String certificateUrl;
public String getCertificateUrl() {
return certificateUrl;
}
public void setCertificateUrl(String certificateUrl) {
this.certificateUrl = certificateUrl;
}
public SysUser() public SysUser()
{ {
......
...@@ -114,7 +114,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -114,7 +114,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers( .antMatchers(
HttpMethod.POST, HttpMethod.POST,
"/subscription/**", "/subscription/**",
"/system/result/**" "/system/result/**",
"/arcFace/**"
).permitAll() ).permitAll()
.antMatchers("/profile/**").anonymous() .antMatchers("/profile/**").anonymous()
.antMatchers("/common/download**").anonymous() .antMatchers("/common/download**").anonymous()
......
...@@ -100,6 +100,9 @@ public class TTrainCourse extends BaseEntity ...@@ -100,6 +100,9 @@ public class TTrainCourse extends BaseEntity
/**判断题分数*/ /**判断题分数*/
private Integer judgmentScore; private Integer judgmentScore;
/** 是否人脸认证:1是 2否 */
private String isVeriftyFace;
public static long getSerialVersionUID() { public static long getSerialVersionUID() {
return serialVersionUID; return serialVersionUID;
} }
...@@ -297,6 +300,14 @@ public class TTrainCourse extends BaseEntity ...@@ -297,6 +300,14 @@ public class TTrainCourse extends BaseEntity
return testPersons; return testPersons;
} }
public String getIsVeriftyFace() {
return isVeriftyFace;
}
public void setIsVerfityFace(String isVeriftyFace) {
this.isVeriftyFace = isVeriftyFace;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
...@@ -57,4 +57,6 @@ public class UserCourseVo { ...@@ -57,4 +57,6 @@ public class UserCourseVo {
/** 已完成时长*/ /** 已完成时长*/
private Integer finishDuration; private Integer finishDuration;
private Integer isVeriftyFace;
} }
...@@ -57,6 +57,13 @@ public class TStaningBookServiceImpl implements ITStaningBookService ...@@ -57,6 +57,13 @@ public class TStaningBookServiceImpl implements ITStaningBookService
tStaningBook.setUserId(0l); tStaningBook.setUserId(0l);
} }
List<TStaningBook> list = tStaningBookMapper.selectTStaningBookList(tStaningBook); 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; return list;
} }
public List<Long> selectDeptIds(List<Long> list,List<Long> deptIds){ public List<Long> selectDeptIds(List<Long> list,List<Long> deptIds){
......
...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="certificateUrl" column="certificate_url" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap> </resultMap>
...@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectUserVo"> <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, 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 r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
...@@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> <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 left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0' and u.user_staff='0' where u.del_flag = '0' and u.user_staff='0'
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
......
...@@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="multipleChoiceScore" column="multiple_choice_score" /> <result property="multipleChoiceScore" column="multiple_choice_score" />
<result property="singleChoiceScore" column="single_choice_score" /> <result property="singleChoiceScore" column="single_choice_score" />
<result property="judgmentScore" column="judgment_score" /> <result property="judgmentScore" column="judgment_score" />
<result property="isVeriftyFace" column="is_verifty_face" />
</resultMap> </resultMap>
<resultMap id="StatisticsTrainCourseResult" type="StatisticsTrainCourse"> <resultMap id="StatisticsTrainCourseResult" type="StatisticsTrainCourse">
...@@ -42,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -42,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTTrainCourseVo"> <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> </sql>
<select id="selectTTrainCourseList" parameterType="TTrainCourse" resultMap="TTrainCourseResult"> <select id="selectTTrainCourseList" parameterType="TTrainCourse" resultMap="TTrainCourseResult">
...@@ -97,7 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -97,7 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="multipleChoiceScore != null">multiple_choice_score,</if> <if test="multipleChoiceScore != null">multiple_choice_score,</if>
<if test="singleChoiceScore != null">single_choice_score,</if> <if test="singleChoiceScore != null">single_choice_score,</if>
<if test="judgmentScore != null">judgment_score,</if> <if test="judgmentScore != null">judgment_score,</if>
</trim> <if test="isVeriftyFace != null">is_verifty_face,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="courseName != null">#{courseName},</if> <if test="courseName != null">#{courseName},</if>
<if test="courseType != null">#{courseType},</if> <if test="courseType != null">#{courseType},</if>
...@@ -120,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -120,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="multipleChoiceScore != null">#{multipleChoiceScore},</if> <if test="multipleChoiceScore != null">#{multipleChoiceScore},</if>
<if test="singleChoiceScore != null">#{singleChoiceScore},</if> <if test="singleChoiceScore != null">#{singleChoiceScore},</if>
<if test="judgmentScore != null">#{judgmentScore},</if> <if test="judgmentScore != null">#{judgmentScore},</if>
</trim> <if test="isVeriftyFace != null">#{isVeriftyFace},</if>
</trim>
</insert> </insert>
<update id="updateTTrainCourse" parameterType="TTrainCourse"> <update id="updateTTrainCourse" parameterType="TTrainCourse">
...@@ -147,6 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -147,6 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="multipleChoiceScore != null">multiple_choice_score = #{multipleChoiceScore},</if> <if test="multipleChoiceScore != null">multiple_choice_score = #{multipleChoiceScore},</if>
<if test="singleChoiceScore != null">single_choice_score = #{singleChoiceScore},</if> <if test="singleChoiceScore != null">single_choice_score = #{singleChoiceScore},</if>
<if test="judgmentScore != null">judgment_score = #{judgmentScore},</if> <if test="judgmentScore != null">judgment_score = #{judgmentScore},</if>
<if test="isVeriftyFace != null">is_verifty_face = #{isVeriftyFace},</if>
</trim> </trim>
where course_id = #{courseId} where course_id = #{courseId}
</update> </update>
...@@ -168,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -168,7 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</insert> </insert>
<select id="userCourseList" resultType="com.zehong.system.domain.vo.UserCourseVo"> <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, 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, 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, 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" ...@@ -183,9 +187,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type!=null and type == 2"> <if test="type!=null and type == 2">
and uc.state = 2 and uc.state = 2
</if> </if>
<if test="dataKind!=null">
and c.data_kind = #{dataKind}
</if>
<if test="type!=null and type == 3"> <if test="type!=null and type == 3">
and uc.state !=0 and uc.state !=0
order by uc.examination_time desc order by uc.examination_time desc
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
> >
<div class="top flex"> <div class="top flex">
<el-form-item label="课程标题" prop="courseName"> <el-form-item label="课程标题" prop="courseName">
<el-input style="width: 400px" v-model="form.courseName" :disabled="checkLock"></el-input> <el-input style="width: 568px" v-model="form.courseName" :disabled="checkLock"></el-input>
</el-form-item> </el-form-item>
<!--<el-form-item label="培训计划" prop="courseType">--> <!--<el-form-item label="培训计划" prop="courseType">-->
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
clearable clearable
size="small" size="small"
:disabled="checkLock" :disabled="checkLock"
style="width:215px"
> >
<el-option <el-option
v-for="course in courseOptions" v-for="course in courseOptions"
...@@ -59,12 +60,15 @@ ...@@ -59,12 +60,15 @@
style="margin-left: 55px" style="margin-left: 55px"
> >
<el-input <el-input
style="width: 220px" style="width: 180px"
placeholder="分钟" placeholder="分钟"
type="number" type="number"
v-model="form.duration" v-model="form.duration"
:disabled="checkLock" :disabled="checkLock"
></el-input> ></el-input>
<el-label>
(分钟)
</el-label>
</el-form-item> </el-form-item>
</div> </div>
<div class="flex"> <div class="flex">
...@@ -89,6 +93,10 @@ ...@@ -89,6 +93,10 @@
:disabled="checkLock" :disabled="checkLock"
/> />
</el-form-item> </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>
<!-- </div> --> <!-- </div> -->
<el-form-item label="课程内容" prop="courseConent"> <el-form-item label="课程内容" prop="courseConent">
...@@ -162,6 +170,7 @@ export default { ...@@ -162,6 +170,7 @@ export default {
courseConent: "", courseConent: "",
video: "", video: "",
enclosure: "", enclosure: "",
isVeriftyFace: "2"
}, },
fileType: ["doc", "docx", "xls", "xlsx", "ppt", "txt", "pdf"], fileType: ["doc", "docx", "xls", "xlsx", "ppt", "txt", "pdf"],
fileListVideo: [], fileListVideo: [],
...@@ -219,6 +228,7 @@ export default { ...@@ -219,6 +228,7 @@ export default {
getLessonById() { getLessonById() {
getLessonById(this.courseId).then((res) => { getLessonById(this.courseId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
res.data.duration=res.data.duration/60;
const data = res.data; const data = res.data;
const { const {
courseName, courseName,
...@@ -229,6 +239,7 @@ export default { ...@@ -229,6 +239,7 @@ export default {
duration, duration,
testStartTime, testStartTime,
testEndTime, testEndTime,
isVeriftyFace,
} = data; } = data;
this.form = { this.form = {
courseName, courseName,
...@@ -239,6 +250,7 @@ export default { ...@@ -239,6 +250,7 @@ export default {
duration, duration,
testStartTime, testStartTime,
testEndTime, testEndTime,
isVeriftyFace,
}; };
console.log('video',video) console.log('video',video)
this.fileListVideo = video? [ this.fileListVideo = video? [
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
......
...@@ -132,11 +132,21 @@ ...@@ -132,11 +132,21 @@
width="180" width="180"
> >
<template v-slot="{ row: { topicNum, courseId, status } }"> <template v-slot="{ row: { topicNum, courseId, status } }">
<span @click="checkQuestion(courseId, status)" class="timuNum"> <span>
<span v-if="topicNum > 0"> <span
class="timuNum"
@click="checkQuestion(courseId, status)"
v-if="topicNum > 0"
>
{{ status == 0 ? `已录入${topicNum}题` : "查看" }} {{ status == 0 ? `已录入${topicNum}题` : "查看" }}
</span> </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> </span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -145,7 +155,9 @@ ...@@ -145,7 +155,9 @@
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template v-slot="{ row: { status, courseId } }"> <template
v-slot="{ row: { courseName, courseType, status, courseId } }"
>
<!-- <div>{{status}}</div> --> <!-- <div>{{status}}</div> -->
<el-button <el-button
v-if="status == 0" v-if="status == 0"
...@@ -175,7 +187,7 @@ ...@@ -175,7 +187,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="issueDilog(courseId)" @click="issueDilog(courseId, courseName, courseType)"
>发布</el-button >发布</el-button
> >
</template> </template>
...@@ -196,7 +208,18 @@ ...@@ -196,7 +208,18 @@
:checkLock.sync="checkLock" :checkLock.sync="checkLock"
:visible.sync="dilogFlag" :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 flex">
<div class="detail-item"> <div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span 单选题<span>{{ bottomFrom.singleChoiceScore }}</span
...@@ -213,20 +236,19 @@ ...@@ -213,20 +236,19 @@
}}</span }}</span
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
> >
</div> </div>
<div class="detail-item"> </div>
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
<div class="detail">
<div class="detail-item"> <div class="detail-item">
<span>{{ danxs + duoxs + pds }}</span <span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{ >道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore + danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore + duoxs * bottomFrom.multipleChoiceScore +
...@@ -235,6 +257,12 @@ ...@@ -235,6 +257,12 @@
> >
</div> </div>
</div> </div>
<div class="detail">
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button> <el-button @click="issueVisible = false"> </el-button>
...@@ -289,6 +317,8 @@ export default { ...@@ -289,6 +317,8 @@ export default {
dilogFlag: false, dilogFlag: false,
// 发布弹框 // 发布弹框
issueVisible: false, issueVisible: false,
dilogName: "",
dilogType: null,
bottomFrom: { bottomFrom: {
singleChoiceScore: 0, singleChoiceScore: 0,
multipleChoiceScore: 0, multipleChoiceScore: 0,
...@@ -307,13 +337,13 @@ export default { ...@@ -307,13 +337,13 @@ export default {
computed: { computed: {
...mapGetters(["courseOptions"]), ...mapGetters(["courseOptions"]),
danxs() { danxs() {
return this.questionList.filter((item) => item.topicType === 1).length; return this.questionList.filter((item) => item.topicType === 1).length || 0;
}, },
duoxs() { duoxs() {
return this.questionList.filter((item) => item.topicType === 2).length; return this.questionList.filter((item) => item.topicType === 2).length || 0;
}, },
pds() { pds() {
return this.questionList.filter((item) => item.topicType === 3).length; return this.questionList.filter((item) => item.topicType === 3).length || 0;
}, },
}, },
created() { created() {
...@@ -426,8 +456,8 @@ export default { ...@@ -426,8 +456,8 @@ export default {
.catch(() => {}); .catch(() => {});
}, },
// 发布弹框 // 发布弹框
issueDilog(courseId) { issueDilog(courseId, name, type) {
getQuestion({courseId}) getQuestion({ courseId })
.then((res) => { .then((res) => {
this.questionList = res.rows.map((item) => { this.questionList = res.rows.map((item) => {
return { return {
...@@ -442,13 +472,19 @@ export default { ...@@ -442,13 +472,19 @@ export default {
}) })
.then((res) => { .then((res) => {
this.bottomFrom = { this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore, singleChoiceScore: res.data.singleChoiceScore || 0,
multipleChoiceScore: res.data.multipleChoiceScore, multipleChoiceScore: res.data.multipleChoiceScore || 0,
judgmentScore: res.data.judgmentScore, judgmentScore: res.data.judgmentScore || 0,
qualifiedNum: res.data.qualifiedNum, qualifiedNum: res.data.qualifiedNum || 0,
}; };
}) })
.then((res) => { .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.issueVisible = true;
this.issueCourseId = courseId; this.issueCourseId = courseId;
}); });
...@@ -457,15 +493,16 @@ export default { ...@@ -457,15 +493,16 @@ export default {
}, },
// 发布 // 发布
issueLesson(courseId) { issueLesson(courseId) {
this.$confirm("确定要发布吗", { // this.$confirm("确定要发布吗", {
confirmButtonText: "确定", // confirmButtonText: "确定",
cancelButtonText: "取消", // cancelButtonText: "取消",
type: "warning", // type: "warning",
}) // })
.then(() => { // .then(() => {
// 判断是否录入答题合格数 // // 判断是否录入答题合格数
return getLessonById(courseId); // return getLessonById(courseId);
}) // })
getLessonById(courseId)
.then((res) => { .then((res) => {
// if ( // if (
// res.data.singleChoiceScore >= 0 && // res.data.singleChoiceScore >= 0 &&
...@@ -592,12 +629,21 @@ export default { ...@@ -592,12 +629,21 @@ export default {
width: 100%; width: 100%;
} }
::v-deep .el-dialog { ::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 { .detail {
// position: absolute; // position: absolute;
// bottom: -20px; // bottom: -20px;
// left: 10px; // left: 10px;
margin-top: 20px;
.textC { .textC {
font-weight: 800; font-weight: 800;
font-size: 18px; font-size: 18px;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-20 20:14:18 * @Date: 2022-09-20 20:14:18
* @LastEditors: 纪泽龙 jizelong@qq.com * @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 * @FilePath: /danger-manage-web/src/views/myLessons/CheckLesson.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
</div> </div>
<div class="btn-wrapper flex"> <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 ? "重新考试" : "开始考试" state == 2 || state == 1 ? "重新考试" : "开始考试"
}}</el-button> }}</el-button>
<el-button @click="$router.back()" type="primary" plain>取消</el-button> <el-button @click="$router.back()" type="primary" plain>取消</el-button>
......
...@@ -9,9 +9,11 @@ ...@@ -9,9 +9,11 @@
<template> <template>
<div class="item flex"> <div class="item flex">
<div class="title" style="text-align: center">{{ itemData.courseType||'-' }}</div> <div class="title" style="text-align: center">{{ itemData.courseType||'-' }}</div>
<div class="allone"> <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==0" style="height: 18px" src="@/assets/img/ykao.png"/>-->
<img v-if="itemData.dataKind==1" style="height: 18px" src="@/assets/img/skao.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 class="lesson zzz" style="width: 75%" :title="itemData.courseName"> {{ itemData.courseName }}</div>
</div> </div>
<div class="time">发布时间:{{ itemData.createTime }}</div> <div class="time">发布时间:{{ itemData.createTime }}</div>
...@@ -222,4 +224,27 @@ export default { ...@@ -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> </style>
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
:disabled="checkLock" :disabled="checkLock"
/> />
</el-form-item> </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="testPersons"> <el-form-item label="选择人员" prop="testPersons">
<ChangePapel <ChangePapel
...@@ -93,6 +97,7 @@ export default { ...@@ -93,6 +97,7 @@ export default {
testStartTime: "", testStartTime: "",
testEndTime: "", testEndTime: "",
testPersons: "", testPersons: "",
isVeriftyFace: "2"
}, },
jsonSelectNameList: null, jsonSelectNameList: null,
// '[{"peoPleId":880,"peoPleName":"孙卓亚"},{"peoPleId":871,"peoPleName":"张玉宾"}]', // '[{"peoPleId":880,"peoPleName":"孙卓亚"},{"peoPleId":871,"peoPleName":"张玉宾"}]',
...@@ -146,12 +151,13 @@ export default { ...@@ -146,12 +151,13 @@ export default {
getLessonById(this.courseId).then((res) => { getLessonById(this.courseId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
const data = res.data; const data = res.data;
const { courseName, testStartTime, testEndTime, testPersons } = data; const { courseName, testStartTime, testEndTime, testPersons, isVeriftyFace } = data;
this.form = { this.form = {
courseName, courseName,
testStartTime, testStartTime,
testEndTime, testEndTime,
testPersons, testPersons,
isVeriftyFace,
}; };
this.jsonSelectNameList = testPersons; this.jsonSelectNameList = testPersons;
this.$refs.changePaple.changeNameList(this.jsonSelectNameList); this.$refs.changePaple.changeNameList(this.jsonSelectNameList);
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<el-table v-loading="loading" :data="lessonsList"> <el-table v-loading="loading" :data="lessonsList">
<el-table-column label="序号" align="center" prop="bankNum" width="55" /> <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 <el-table-column
label="开始时间" label="开始时间"
align="center" align="center"
...@@ -102,7 +102,11 @@ ...@@ -102,7 +102,11 @@
align="center" align="center"
class-name="small-padding fixed-width" 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> --> <!-- <div>{{status}}</div> -->
<!-- <el-button <!-- <el-button
v-if="status == 0" v-if="status == 0"
...@@ -140,7 +144,7 @@ ...@@ -140,7 +144,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="issueDilog(courseId)" @click="issueDilog(courseId, courseName, topicNum,testStartTime,testEndTime)"
>发布</el-button >发布</el-button
> >
</template> </template>
...@@ -161,7 +165,29 @@ ...@@ -161,7 +165,29 @@
:checkLock.sync="checkLock" :checkLock.sync="checkLock"
:visible.sync="dilogFlag" :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 flex">
<div class="detail-item"> <div class="detail-item">
单选题<span>{{ bottomFrom.singleChoiceScore }}</span 单选题<span>{{ bottomFrom.singleChoiceScore }}</span
...@@ -178,20 +204,19 @@ ...@@ -178,20 +204,19 @@
}}</span }}</span
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
> >
</div> </div>
<div class="detail-item"> </div>
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
<div class="detail">
<div class="detail-item"> <div class="detail-item">
<span>{{ danxs + duoxs + pds }}</span <span>{{ danxs + duoxs + pds }}</span
>道题,总共计<span class="textC">{{ >道题,总共计<span class="textC">{{
danxs * bottomFrom.singleChoiceScore + danxs * bottomFrom.singleChoiceScore +
duoxs * bottomFrom.multipleChoiceScore + duoxs * bottomFrom.multipleChoiceScore +
...@@ -200,6 +225,12 @@ ...@@ -200,6 +225,12 @@
> >
</div> </div>
</div> </div>
<div class="detail">
<div class="detail-item">
合格分数为<span class="textC">{{ bottomFrom.qualifiedNum }}</span
>
</div>
</div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="issueVisible = false"> </el-button> <el-button @click="issueVisible = false"> </el-button>
...@@ -255,6 +286,11 @@ export default { ...@@ -255,6 +286,11 @@ export default {
dilogFlag: false, dilogFlag: false,
// 发布 // 发布
issueVisible: false, issueVisible: false,
dilogName: "",
dilogTopicNum: 0,
dilogStartTime:0,
dilogEndTime:0,
// dilogType: null,
bottomFrom: { bottomFrom: {
singleChoiceScore: 0, singleChoiceScore: 0,
multipleChoiceScore: 0, multipleChoiceScore: 0,
...@@ -404,12 +440,18 @@ export default { ...@@ -404,12 +440,18 @@ export default {
.catch(() => {}); .catch(() => {});
}, },
// 发布 // 发布
issueDilog(courseId) { issueDilog(courseId, name, num,startTime,endTime) {
getQuestion({courseId}) if (num === 0) {
this.$message({
message: "请至少录入一道考题在发布",
type: "warning",
});
return;
}
getQuestion({ courseId })
.then((res) => { .then((res) => {
console.log(res) console.log(res);
this.questionList = res.rows.map((item) => { this.questionList = res.rows.map((item) => {
return { return {
topicType: item.topicType, topicType: item.topicType,
topicId: item.topicId, topicId: item.topicId,
...@@ -422,13 +464,17 @@ export default { ...@@ -422,13 +464,17 @@ export default {
}) })
.then((res) => { .then((res) => {
this.bottomFrom = { this.bottomFrom = {
singleChoiceScore: res.data.singleChoiceScore ||0, singleChoiceScore: res.data.singleChoiceScore || 0,
multipleChoiceScore: res.data.multipleChoiceScore||0, multipleChoiceScore: res.data.multipleChoiceScore || 0,
judgmentScore: res.data.judgmentScore||0, judgmentScore: res.data.judgmentScore || 0,
qualifiedNum: res.data.qualifiedNum||0, qualifiedNum: res.data.qualifiedNum || 0,
}; };
}) })
.then((res) => { .then((res) => {
// 名称
this.dilogName = name;
this.dilogStartTime=startTime;
this.dilogEndTime=endTime;
this.issueVisible = true; this.issueVisible = true;
this.issueCourseId = courseId; this.issueCourseId = courseId;
}); });
...@@ -436,15 +482,17 @@ export default { ...@@ -436,15 +482,17 @@ export default {
// //
}, },
issueLesson(courseId) { issueLesson(courseId) {
this.$confirm("确定要发布吗", { // this.$confirm("确定要发布吗", {
confirmButtonText: "确定", // confirmButtonText: "确定",
cancelButtonText: "取消", // cancelButtonText: "取消",
type: "warning", // type: "warning",
}) // })
.then(() => { // .then(() => {
// 判断是否录入答题合格数 // // 判断是否录入答题合格数
return getLessonById(courseId); // return getLessonById(courseId);
}) // })
getLessonById(courseId)
.then((res) => { .then((res) => {
// if ( // if (
// res.data.singleChoiceScore > 0 && // res.data.singleChoiceScore > 0 &&
...@@ -500,12 +548,21 @@ export default { ...@@ -500,12 +548,21 @@ export default {
width: 100%; width: 100%;
} }
::v-deep .el-dialog { ::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 { .detail {
// position: absolute; // position: absolute;
// bottom: -20px; // bottom: -20px;
// left: 10px; // left: 10px;
margin-top: 20px;
.textC { .textC {
font-weight: 800; font-weight: 800;
font-size: 18px; font-size: 18px;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
> >
</div> </div>
<div class="detail-item"> <div class="detail-item">
判断<span>{{ bottomFrom.judgmentScore }}</span 判断<span>{{ bottomFrom.judgmentScore }}</span
>/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{ >/题,共<span>{{ pds }}</span> 题,计<span class="textC">{{
pds * bottomFrom.judgmentScore pds * bottomFrom.judgmentScore
}}</span }}</span
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['safetyManagement:enterpriseSystem:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
...@@ -77,18 +78,24 @@ ...@@ -77,18 +78,24 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" /> <!-- <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />-->
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>修改</el-button> >修改</el-button>
<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'" v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
...@@ -108,13 +115,13 @@ ...@@ -108,13 +115,13 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleInvalid(scope.row)" @click="handleInvalid(scope.row)"
>作废</el-button> >作废</el-button>-->
<el-button <el-button
v-if="scope.row.status == '0'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -169,10 +176,10 @@ ...@@ -169,10 +176,10 @@
</span> </span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
<el-form-item v-show="operate" label="审批" prop="status"> <!--<el-form-item v-show="operate" label="审批" prop="status">
<el-radio v-model="form.status" label="2">通过</el-radio> <el-radio v-model="form.status" label="2">通过</el-radio>
<el-radio v-model="form.status" label="0">驳回</el-radio> <el-radio v-model="form.status" label="0">驳回</el-radio>
</el-form-item> </el-form-item>-->
</div> </div>
<div style="width: 58%;margin-left: 2%"> <div style="width: 58%;margin-left: 2%">
<div class="dialogTitle">制度内容</div> <div class="dialogTitle">制度内容</div>
...@@ -180,7 +187,7 @@ ...@@ -180,7 +187,7 @@
</div> </div>
</div> </div>
</el-form> </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 type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
...@@ -339,6 +346,20 @@ export default { ...@@ -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) { handleApproval(row) {
this.readOnly = true; this.readOnly = true;
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['safetyManagement:enterpriseSystem:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
...@@ -92,7 +93,14 @@ ...@@ -92,7 +93,14 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>修改</el-button> >修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<!--<el-button <!--<el-button
v-if="scope.row.status == '0'" v-if="scope.row.status == '0'"
size="mini" size="mini"
...@@ -119,6 +127,7 @@ ...@@ -119,6 +127,7 @@
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -200,7 +209,7 @@ ...@@ -200,7 +209,7 @@
</div> </div>
</div> </div>
</el-form> </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 type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
...@@ -357,6 +366,20 @@ export default { ...@@ -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) { handleApproval(row) {
this.readOnly = true; this.readOnly = true;
......
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
</el-table-column> </el-table-column>
<el-table-column label="责任部门" align="center" prop="deptName" /> <el-table-column label="责任部门" align="center" prop="deptName" />
<el-table-column label="整改人" align="center" prop="rectificationName" /> <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 label="整改时间" align="center" prop="rectificationTime" width="180">
</el-table-column> </el-table-column>
<el-table-column label="隐患状态 " align="center" prop="state" > <el-table-column label="隐患状态 " align="center" prop="state" >
...@@ -97,6 +103,14 @@ ...@@ -97,6 +103,14 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
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 <el-button
v-if="scope.row.state==0&&scope.row.rectification == user.userId" v-if="scope.row.state==0&&scope.row.rectification == user.userId"
size="mini" size="mini"
...@@ -384,8 +398,11 @@ ...@@ -384,8 +398,11 @@
</div> </div>
</el-dialog> </el-dialog>
<!--详情--> <!--详情-->
<el-dialog :title="title" :visible.sync="open2" width="900px" append-to-body> <el-dialog :title="title" :visible.sync="open2" style="position: absolute" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <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-divider content-position="left"><i class="el-icon-info"></i><span class="boxx">隐患信息</span></el-divider>
<el-form-item label="隐患名称"> <el-form-item label="隐患名称">
<el-input v-model="form.troubleName" placeholder="请输入隐患名称" disabled/> <el-input v-model="form.troubleName" placeholder="请输入隐患名称" disabled/>
...@@ -1084,7 +1101,18 @@ export default { ...@@ -1084,7 +1101,18 @@ export default {
this.zhong = 3; this.zhong = 3;
this.staffList2 = this.staffList; 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) { handleUpdate(row) {
this.reset(); this.reset();
...@@ -1157,6 +1185,7 @@ export default { ...@@ -1157,6 +1185,7 @@ export default {
const bookId = row.bookId || this.ids const bookId = row.bookId || this.ids
getBook(bookId).then(response => { getBook(bookId).then(response => {
this.form = response.data; this.form = response.data;
this.form.finishDay = row.finishDay;
if(this.form.troubleLevel==1){ if(this.form.troubleLevel==1){
this.zhong = 1 this.zhong = 1
} }
...@@ -1339,6 +1368,13 @@ export default { ...@@ -1339,6 +1368,13 @@ export default {
font-weight: bold; font-weight: bold;
padding-left: 5px; padding-left: 5px;
} }
.guoqi{
position: relative;
top: -35px;
left: 120px;
font-size: 17px;
color: red;
}
::v-deep .el-dialog__body{ ::v-deep .el-dialog__body{
padding:0px 20px!important; 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