完善客户需求
This commit is contained in:
parent
915ac72596
commit
fe787e5772
|
|
@ -187,6 +187,18 @@ public class PsyUserProfileController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取学员档案列表(仅包含拥有学员角色的用户)
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('psychology:profile:list')")
|
||||||
|
@GetMapping("/student/list")
|
||||||
|
public TableDataInfo studentList(PsyUserProfile profile)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<PsyUserProfile> list = profileService.selectStudentProfileList(profile);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增档案
|
* 新增档案
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ spring:
|
||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ry_xinli?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://1.15.149.240:3306/ry_xinli?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: ry_xinli
|
username: ry_xinli
|
||||||
password: ZLZBcfGtsWJe5r4z
|
password: ZLZBcfGtsWJe5r4z
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,3 @@
|
||||||
Application Version: ${ruoyi.version}
|
Application Version: ${ruoyi.version}
|
||||||
Spring Boot Version: ${spring-boot.version}
|
Spring Boot Version: ${spring-boot.version}
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// _ooOoo_ //
|
|
||||||
// o8888888o //
|
|
||||||
// 88" . "88 //
|
|
||||||
// (| ^_^ |) //
|
|
||||||
// O\ = /O //
|
|
||||||
// ____/`---'\____ //
|
|
||||||
// .' \\| |// `. //
|
|
||||||
// / \\||| : |||// \ //
|
|
||||||
// / _||||| -:- |||||- \ //
|
|
||||||
// | | \\\ - /// | | //
|
|
||||||
// | \_| ''\---/'' | | //
|
|
||||||
// \ .-\__ `-` ___/-. / //
|
|
||||||
// ___`. .' /--.--\ `. . ___ //
|
|
||||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
|
||||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
|
||||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
|
||||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
|
||||||
// `=---=' //
|
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
|
||||||
// AI心理健康测评系统 永不宕机 永无BUG //
|
// AI心理健康测评系统 永不宕机 永无BUG //
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@ public class SysUser extends BaseEntity
|
||||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/** 用户账号 */
|
/** 用户账号(信息编号/登录账号) */
|
||||||
@Excel(name = "登录名称")
|
@Excel(name = "信息编号")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/** 用户昵称 */
|
/** 用户真实姓名(罪犯姓名) */
|
||||||
@Excel(name = "用户名称")
|
@Excel(name = "罪犯姓名")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
/** 用户邮箱 */
|
/** 用户邮箱 */
|
||||||
|
|
@ -55,6 +55,9 @@ public class SysUser extends BaseEntity
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
/** 注册类型 */
|
||||||
|
private String registerType;
|
||||||
|
|
||||||
/** 账号状态(0正常 1停用) */
|
/** 账号状态(0正常 1停用) */
|
||||||
@Excel(name = "账号状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "账号状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
@ -106,10 +109,6 @@ public class SysUser extends BaseEntity
|
||||||
@Excel(name = "身份证号")
|
@Excel(name = "身份证号")
|
||||||
private String idCard;
|
private String idCard;
|
||||||
|
|
||||||
/** 生日 */
|
|
||||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date birthday;
|
|
||||||
|
|
||||||
/** 学历 */
|
/** 学历 */
|
||||||
@Excel(name = "学历")
|
@Excel(name = "学历")
|
||||||
private String education;
|
private String education;
|
||||||
|
|
@ -171,6 +170,7 @@ public class SysUser extends BaseEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Xss(message = "用户昵称不能包含脚本字符")
|
@Xss(message = "用户昵称不能包含脚本字符")
|
||||||
|
@NotBlank(message = "姓名不能为空")
|
||||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||||
public String getNickName()
|
public String getNickName()
|
||||||
{
|
{
|
||||||
|
|
@ -248,6 +248,16 @@ public class SysUser extends BaseEntity
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getRegisterType()
|
||||||
|
{
|
||||||
|
return registerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegisterType(String registerType)
|
||||||
|
{
|
||||||
|
this.registerType = registerType;
|
||||||
|
}
|
||||||
|
|
||||||
public String getStatus()
|
public String getStatus()
|
||||||
{
|
{
|
||||||
return status;
|
return status;
|
||||||
|
|
@ -380,16 +390,6 @@ public class SysUser extends BaseEntity
|
||||||
this.idCard = idCard;
|
this.idCard = idCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getBirthday()
|
|
||||||
{
|
|
||||||
return birthday;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBirthday(Date birthday)
|
|
||||||
{
|
|
||||||
this.birthday = birthday;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEducation()
|
public String getEducation()
|
||||||
{
|
{
|
||||||
return education;
|
return education;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,14 @@ public interface PsyUserProfileMapper
|
||||||
*/
|
*/
|
||||||
public List<PsyUserProfile> selectProfileList(PsyUserProfile profile);
|
public List<PsyUserProfile> selectProfileList(PsyUserProfile profile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学员档案列表(仅包含拥有学员角色的用户)
|
||||||
|
*
|
||||||
|
* @param profile 档案信息
|
||||||
|
* @return 档案集合
|
||||||
|
*/
|
||||||
|
public List<PsyUserProfile> selectStudentProfileList(PsyUserProfile profile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增档案
|
* 新增档案
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,19 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
||||||
return profileMapper.selectProfileList(profile);
|
return profileMapper.selectProfileList(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学员档案列表(仅包含拥有学员角色的用户)
|
||||||
|
*
|
||||||
|
* @param profile 档案信息
|
||||||
|
* @return 档案集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@com.ddnai.common.annotation.DataScope(deptAlias = "d", userAlias = "u")
|
||||||
|
public List<PsyUserProfile> selectStudentProfileList(PsyUserProfile profile)
|
||||||
|
{
|
||||||
|
return profileMapper.selectStudentProfileList(profile);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增档案
|
* 新增档案
|
||||||
*
|
*
|
||||||
|
|
@ -531,14 +544,36 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
||||||
|
|
||||||
if (failureNum > 0)
|
if (failureNum > 0)
|
||||||
{
|
{
|
||||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
if (successNum == 0)
|
||||||
throw new ServiceException(failureMsg.toString());
|
{
|
||||||
|
// 全部失败,保持原有行为:抛出异常
|
||||||
|
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||||
|
throw new ServiceException(failureMsg.toString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 部分成功、部分失败:同时返回成功和失败统计,前端可一次性展示
|
||||||
|
StringBuilder resultMsg = new StringBuilder();
|
||||||
|
resultMsg.append("本次导入完成:共 ")
|
||||||
|
.append(successNum + failureNum)
|
||||||
|
.append(" 条,其中成功 ")
|
||||||
|
.append(successNum)
|
||||||
|
.append(" 条,失败 ")
|
||||||
|
.append(failureNum)
|
||||||
|
.append(" 条。成功明细如下:");
|
||||||
|
|
||||||
|
resultMsg.append(successMsg);
|
||||||
|
failureMsg.insert(0, "<br/><br/>失败明细如下:");
|
||||||
|
resultMsg.append(failureMsg);
|
||||||
|
return resultMsg.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// 全部成功
|
||||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||||
|
return successMsg.toString();
|
||||||
}
|
}
|
||||||
return successMsg.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,14 @@ public interface IPsyUserProfileService
|
||||||
*/
|
*/
|
||||||
public List<PsyUserProfile> selectProfileList(PsyUserProfile profile);
|
public List<PsyUserProfile> selectProfileList(PsyUserProfile profile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询学员档案列表(仅包含拥有学员角色的用户)
|
||||||
|
*
|
||||||
|
* @param profile 档案信息
|
||||||
|
* @return 档案集合
|
||||||
|
*/
|
||||||
|
public List<PsyUserProfile> selectStudentProfileList(PsyUserProfile profile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增档案
|
* 新增档案
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="sex" column="sex" />
|
<result property="sex" column="sex" />
|
||||||
<result property="avatar" column="avatar" />
|
<result property="avatar" column="avatar" />
|
||||||
<result property="password" column="password" />
|
<result property="password" column="password" />
|
||||||
|
<result property="registerType" column="register_type" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag" />
|
||||||
<result property="loginIp" column="login_ip" />
|
<result property="loginIp" column="login_ip" />
|
||||||
|
|
@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<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.pwd_update_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.register_type, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark,
|
||||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||||
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
|
||||||
|
|
@ -58,7 +59,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.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.sex, u.register_type, 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
|
||||||
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'
|
where u.del_flag = '0'
|
||||||
<if test="userId != null and userId != 0">
|
<if test="userId != null and userId != 0">
|
||||||
|
|
@ -158,6 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="email != null and email != ''">email,</if>
|
<if test="email != null and email != ''">email,</if>
|
||||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||||
|
<if test="registerType != null and registerType != ''">register_type,</if>
|
||||||
<if test="sex != null and sex != ''">sex,</if>
|
<if test="sex != null and sex != ''">sex,</if>
|
||||||
<if test="password != null and password != ''">password,</if>
|
<if test="password != null and password != ''">password,</if>
|
||||||
<if test="status != null and status != ''">status,</if>
|
<if test="status != null and status != ''">status,</if>
|
||||||
|
|
@ -172,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="email != null and email != ''">#{email},</if>
|
<if test="email != null and email != ''">#{email},</if>
|
||||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||||
|
<if test="registerType != null and registerType != ''">#{registerType},</if>
|
||||||
<if test="sex != null and sex != ''">#{sex},</if>
|
<if test="sex != null and sex != ''">#{sex},</if>
|
||||||
<if test="password != null and password != ''">#{password},</if>
|
<if test="password != null and password != ''">#{password},</if>
|
||||||
<if test="status != null and status != ''">#{status},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
|
|
@ -189,6 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||||
<if test="email != null ">email = #{email},</if>
|
<if test="email != null ">email = #{email},</if>
|
||||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||||
|
<if test="registerType != null and registerType != ''">register_type = #{registerType},</if>
|
||||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||||
<if test="password != null and password != ''">password = #{password},</if>
|
<if test="password != null and password != ''">password = #{password},</if>
|
||||||
|
|
|
||||||
|
|
@ -91,11 +91,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="infoNumber != null and infoNumber != ''">
|
<if test="infoNumber != null and infoNumber != ''">
|
||||||
AND p.info_number like concat('%', #{infoNumber}, '%')
|
AND p.info_number like concat('%', #{infoNumber}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="phone != null and phone != ''">
|
<if test="prison != null and prison != ''">
|
||||||
AND u.phonenumber like concat('%', #{phone}, '%')
|
AND p.prison like concat('%', #{prison}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="status != null and status != ''">
|
<if test="prisonArea != null and prisonArea != ''">
|
||||||
AND u.status = #{status}
|
AND p.prison_area like concat('%', #{prisonArea}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="gender != null and gender != ''">
|
||||||
|
AND p.gender = #{gender}
|
||||||
|
</if>
|
||||||
|
<if test="nation != null and nation != ''">
|
||||||
|
AND p.nation like concat('%', #{nation}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="educationLevel != null and educationLevel != ''">
|
||||||
|
AND p.education_level = #{educationLevel}
|
||||||
|
</if>
|
||||||
|
<if test="crimeName != null and crimeName != ''">
|
||||||
|
AND p.crime_name like concat('%', #{crimeName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != ''">
|
<if test="params.beginTime != null and params.beginTime != ''">
|
||||||
AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
||||||
|
|
@ -195,5 +207,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<!-- 查询学员用户档案列表:只返回拥有学员角色的用户 -->
|
||||||
|
<select id="selectStudentProfileList" parameterType="com.ddnai.system.domain.psychology.PsyUserProfile" resultMap="PsyUserProfileResult">
|
||||||
|
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar as user_avatar, u.phonenumber as phone, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by as user_create_by, u.create_time as user_create_time, u.remark as user_remark,
|
||||||
|
d.dept_name, d.leader,
|
||||||
|
p.profile_id, p.profile_type, p.profile_data, p.avatar, p.id_card, p.birthday,
|
||||||
|
p.prison, p.prison_area, p.gender, p.nation, p.education_level, p.crime_name,
|
||||||
|
p.sentence_term, p.sentence_start_date, p.sentence_end_date, p.entry_date,
|
||||||
|
p.info_number, p.create_by, p.create_time, p.update_by, p.update_time, p.remark
|
||||||
|
from sys_user u
|
||||||
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
|
left join psy_user_profile p on u.user_id = p.user_id
|
||||||
|
inner join sys_user_role ur on u.user_id = ur.user_id
|
||||||
|
inner join sys_role r on ur.role_id = r.role_id
|
||||||
|
where u.del_flag = '0'
|
||||||
|
and (
|
||||||
|
lower(r.role_key) = 'student'
|
||||||
|
or r.role_name like '%学员%'
|
||||||
|
or r.role_id = 101
|
||||||
|
)
|
||||||
|
<if test="userId != null and userId != 0">
|
||||||
|
AND u.user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
AND u.user_name like concat('%', #{userName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="profileType != null and profileType != ''">
|
||||||
|
AND p.profile_type = #{profileType}
|
||||||
|
</if>
|
||||||
|
<if test="idCard != null and idCard != ''">
|
||||||
|
AND p.id_card like concat('%', #{idCard}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="infoNumber != null and infoNumber != ''">
|
||||||
|
AND p.info_number like concat('%', #{infoNumber}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="prison != null and prison != ''">
|
||||||
|
AND p.prison like concat('%', #{prison}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="prisonArea != null and prisonArea != ''">
|
||||||
|
AND p.prison_area like concat('%', #{prisonArea}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="gender != null and gender != ''">
|
||||||
|
AND p.gender = #{gender}
|
||||||
|
</if>
|
||||||
|
<if test="nation != null and nation != ''">
|
||||||
|
AND p.nation like concat('%', #{nation}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="educationLevel != null and educationLevel != ''">
|
||||||
|
AND p.education_level = #{educationLevel}
|
||||||
|
</if>
|
||||||
|
<if test="crimeName != null and crimeName != ''">
|
||||||
|
AND p.crime_name like concat('%', #{crimeName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="params.beginTime != null and params.beginTime != ''">
|
||||||
|
AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="params.endTime != null and params.endTime != ''">
|
||||||
|
AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="deptId != null and deptId != 0">
|
||||||
|
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||||
|
</if>
|
||||||
|
${params.dataScope}
|
||||||
|
order by u.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,15 @@ export function listProfile(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询学员档案列表(仅包含拥有学员角色的用户)
|
||||||
|
export function listStudentProfile(query) {
|
||||||
|
return request({
|
||||||
|
url: '/psychology/profile/student/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询档案详细
|
// 查询档案详细
|
||||||
export function getProfile(profileId) {
|
export function getProfile(profileId) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { startAssessment, pausedAssessmentList, resumeAssessment } from "@/api/psychology/assessment";
|
import { startAssessment, pausedAssessmentList, resumeAssessment } from "@/api/psychology/assessment";
|
||||||
import { listScale } from "@/api/psychology/scale";
|
import { listScale } from "@/api/psychology/scale";
|
||||||
import { listProfile } from "@/api/psychology/profile";
|
import { listStudentProfile } from "@/api/psychology/profile";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AssessmentStart",
|
name: "AssessmentStart",
|
||||||
|
|
@ -263,14 +263,13 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 加载用户档案列表 */
|
/** 加载学员用户档案列表(用于选择被测评人,小页加载) */
|
||||||
loadProfiles() {
|
loadProfiles() {
|
||||||
const params = {
|
const params = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 1000 // 加载更多用户档案
|
pageSize: 100 // 加载一页学员档案用于选择
|
||||||
}
|
}
|
||||||
listProfile(params).then(response => {
|
listStudentProfile(params).then(response => {
|
||||||
// 确保获取到正确的数据结构
|
|
||||||
if (response.rows && Array.isArray(response.rows)) {
|
if (response.rows && Array.isArray(response.rows)) {
|
||||||
this.profileList = response.rows
|
this.profileList = response.rows
|
||||||
} else if (Array.isArray(response.data)) {
|
} else if (Array.isArray(response.data)) {
|
||||||
|
|
@ -278,10 +277,10 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.profileList = []
|
this.profileList = []
|
||||||
}
|
}
|
||||||
console.log('Loaded user profiles:', this.profileList)
|
console.log('Loaded student profiles:', this.profileList)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error('Failed to load user profiles:', error)
|
console.error('Failed to load student profiles:', error)
|
||||||
this.$message.error('加载用户档案失败,请重试')
|
this.$message.error('加载学员档案失败,请重试')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 加载暂停的测评 */
|
/** 加载暂停的测评 */
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ export default {
|
||||||
roleId: studentRoleId,
|
roleId: studentRoleId,
|
||||||
status: '0',
|
status: '0',
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 1000, // 设置足够大的值以获取所有匹配的学员用户
|
pageSize: 200,
|
||||||
userName: keyword || undefined,
|
userName: keyword || undefined,
|
||||||
phonenumber: keyword || undefined
|
phonenumber: keyword || undefined
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||||
<el-form-item label="用户名称" prop="userName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.userName"
|
|
||||||
placeholder="请输入用户名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 用户ID已隐藏,只使用信息编号 -->
|
|
||||||
<el-form-item label="手机号码" prop="phone">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.phone"
|
|
||||||
placeholder="请输入手机号码"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="状态" prop="status">
|
|
||||||
<el-select v-model="queryParams.status" placeholder="档案状态" clearable>
|
|
||||||
<el-option label="在押" value="0" />
|
|
||||||
<el-option label="释放" value="1" />
|
|
||||||
<el-option label="外出" value="2" />
|
|
||||||
<el-option label="假释" value="3" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="档案类型" prop="profileType">
|
|
||||||
<el-select v-model="queryParams.profileType" placeholder="档案类型" clearable>
|
|
||||||
<el-option label="标准" value="standard" />
|
|
||||||
<el-option label="儿童" value="child" />
|
|
||||||
<el-option label="成人" value="adult" />
|
|
||||||
<el-option label="老年" value="senior" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="信息编号" prop="infoNumber">
|
<el-form-item label="信息编号" prop="infoNumber">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.infoNumber"
|
v-model="queryParams.infoNumber"
|
||||||
|
|
@ -42,6 +9,66 @@
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="罪犯姓名" prop="userName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userName"
|
||||||
|
placeholder="请输入罪犯姓名"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="监狱" prop="prison">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.prison"
|
||||||
|
placeholder="请输入监狱名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="监区" prop="prisonArea">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.prisonArea"
|
||||||
|
placeholder="请输入监区"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="性别" prop="gender">
|
||||||
|
<el-select v-model="queryParams.gender" placeholder="请选择性别" clearable>
|
||||||
|
<el-option label="男" value="0" />
|
||||||
|
<el-option label="女" value="1" />
|
||||||
|
<el-option label="未知" value="2" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="民族" prop="nation">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.nation"
|
||||||
|
placeholder="请输入民族"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文化程度" prop="educationLevel">
|
||||||
|
<el-select v-model="queryParams.educationLevel" placeholder="请选择文化程度" clearable>
|
||||||
|
<el-option label="小学" value="小学" />
|
||||||
|
<el-option label="初中" value="初中" />
|
||||||
|
<el-option label="高中" value="高中" />
|
||||||
|
<el-option label="中专" value="中专" />
|
||||||
|
<el-option label="大专" value="大专" />
|
||||||
|
<el-option label="本科" value="本科" />
|
||||||
|
<el-option label="硕士" value="硕士" />
|
||||||
|
<el-option label="博士" value="博士" />
|
||||||
|
<el-option label="其他" value="其他" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="罪名" prop="crimeName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.crimeName"
|
||||||
|
placeholder="请输入罪名"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -109,6 +136,11 @@
|
||||||
<span>{{ scope.row.educationLevel || '-' }}</span>
|
<span>{{ scope.row.educationLevel || '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="出生日期" align="center" prop="birthday" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') || '-' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="罪名" align="center" prop="crimeName" width="120">
|
<el-table-column label="罪名" align="center" prop="crimeName" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.crimeName || '-' }}</span>
|
<span>{{ scope.row.crimeName || '-' }}</span>
|
||||||
|
|
@ -205,7 +237,7 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="监狱" prop="prison">
|
<el-form-item label="监狱" prop="prison" v-if="false">
|
||||||
<el-input v-model="form.prison" placeholder="请输入监狱名称" />
|
<el-input v-model="form.prison" placeholder="请输入监狱名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -248,6 +280,19 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.birthday"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择出生日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
<el-form-item label="罪名" prop="crimeName">
|
<el-form-item label="罪名" prop="crimeName">
|
||||||
<el-input v-model="form.crimeName" placeholder="请输入罪名" />
|
<el-input v-model="form.crimeName" placeholder="请输入罪名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -307,8 +352,8 @@
|
||||||
<el-form ref="userForm" :model="userForm" :rules="userRules" label-width="80px">
|
<el-form ref="userForm" :model="userForm" :rules="userRules" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户昵称" prop="nickName">
|
<el-form-item label="用户姓名" prop="nickName">
|
||||||
<el-input v-model="userForm.nickName" placeholder="请输入用户昵称" maxlength="30" />
|
<el-input v-model="userForm.nickName" placeholder="请输入用户姓名" maxlength="30" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -331,8 +376,8 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户名称" prop="userName">
|
<el-form-item label="登录名称" prop="userName">
|
||||||
<el-input v-model="userForm.userName" placeholder="请输入用户名称" maxlength="30" />
|
<el-input v-model="userForm.userName" placeholder="请输入登录名称" maxlength="30" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -389,7 +434,7 @@
|
||||||
|
|
||||||
<!-- 用户档案导入对话框 -->
|
<!-- 用户档案导入对话框 -->
|
||||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :on-error="handleFileError" :auto-upload="false" drag>
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
<div class="el-upload__tip text-center" slot="tip">
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
|
|
@ -409,10 +454,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listProfile, getProfile, getProfileByUserId, delProfile, addProfile, updateProfile, getUserInfo, addUserInProfile, getUserInfoById, updateUserInProfile, delUserInProfile } from "@/api/psychology/profile"
|
import { listStudentProfile, getProfile, getProfileByUserId, delProfile, addProfile, updateProfile, getUserInfo, addUserInProfile, getUserInfoById, updateUserInProfile, delUserInProfile } from "@/api/psychology/profile"
|
||||||
import { deptTreeSelect } from "@/api/system/user"
|
import { deptTreeSelect } from "@/api/system/user"
|
||||||
import { allocatedUserList } from "@/api/system/role"
|
|
||||||
import { listRole } from "@/api/system/role"
|
|
||||||
import { getToken } from "@/utils/auth"
|
import { getToken } from "@/utils/auth"
|
||||||
import Treeselect from "@riophae/vue-treeselect"
|
import Treeselect from "@riophae/vue-treeselect"
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
||||||
|
|
@ -438,8 +481,6 @@ export default {
|
||||||
total: 0,
|
total: 0,
|
||||||
// 档案表格数据
|
// 档案表格数据
|
||||||
profileList: [],
|
profileList: [],
|
||||||
// 学员角色ID(缓存)
|
|
||||||
studentRoleId: null,
|
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
|
|
@ -463,13 +504,15 @@ export default {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
userName: undefined,
|
|
||||||
userId: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
status: undefined,
|
|
||||||
profileType: undefined,
|
|
||||||
idCard: undefined,
|
|
||||||
infoNumber: undefined,
|
infoNumber: undefined,
|
||||||
|
userName: undefined,
|
||||||
|
prison: undefined,
|
||||||
|
prisonArea: undefined,
|
||||||
|
gender: undefined,
|
||||||
|
nation: undefined,
|
||||||
|
educationLevel: undefined,
|
||||||
|
crimeName: undefined,
|
||||||
|
userId: undefined,
|
||||||
deptId: undefined
|
deptId: undefined
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
|
|
@ -486,9 +529,6 @@ export default {
|
||||||
{ required: true, message: "罪犯姓名不能为空", trigger: "blur" },
|
{ required: true, message: "罪犯姓名不能为空", trigger: "blur" },
|
||||||
{ pattern: /^[\u4e00-\u9fa5]+$/, message: "姓名只能输入汉字", trigger: "blur" }
|
{ pattern: /^[\u4e00-\u9fa5]+$/, message: "姓名只能输入汉字", trigger: "blur" }
|
||||||
],
|
],
|
||||||
prison: [
|
|
||||||
{ required: true, message: "监狱不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
prisonArea: [
|
prisonArea: [
|
||||||
{ required: true, message: "监区不能为空", trigger: "blur" }
|
{ required: true, message: "监区不能为空", trigger: "blur" }
|
||||||
]
|
]
|
||||||
|
|
@ -496,11 +536,11 @@ export default {
|
||||||
// 用户表单校验
|
// 用户表单校验
|
||||||
userRules: {
|
userRules: {
|
||||||
userName: [
|
userName: [
|
||||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
{ required: true, message: "登录名称不能为空", trigger: "blur" },
|
||||||
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
{ min: 2, max: 20, message: '登录名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
nickName: [
|
nickName: [
|
||||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
{ required: true, message: "用户姓名不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
||||||
|
|
@ -539,184 +579,44 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getStudentRoleId().then(() => {
|
this.getList()
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
this.getDeptTree()
|
this.getDeptTree()
|
||||||
this.getConfigKey("sys.user.initPassword").then(response => {
|
this.getConfigKey("sys.user.initPassword").then(response => {
|
||||||
this.initPassword = response.msg
|
this.initPassword = response.msg
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 获取学员角色ID */
|
/** 查询学员档案列表(后端分页) */
|
||||||
getStudentRoleId() {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
if (this.studentRoleId) {
|
|
||||||
resolve(this.studentRoleId)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 先尝试从角色列表中找到学员角色
|
|
||||||
listRole({}).then(response => {
|
|
||||||
const roles = response.rows || []
|
|
||||||
// 查找学员角色:roleId=101 或 roleKey='student' 或 roleName包含'学员'
|
|
||||||
const studentRole = roles.find(role => {
|
|
||||||
return (role.roleId === 101) ||
|
|
||||||
(role.roleKey && role.roleKey.toLowerCase() === 'student') ||
|
|
||||||
(role.roleName && role.roleName.includes('学员'))
|
|
||||||
})
|
|
||||||
if (studentRole && studentRole.roleId) {
|
|
||||||
this.studentRoleId = studentRole.roleId
|
|
||||||
resolve(this.studentRoleId)
|
|
||||||
} else {
|
|
||||||
// 如果找不到,尝试使用默认值101
|
|
||||||
console.warn("未找到学员角色,使用默认值101")
|
|
||||||
this.studentRoleId = 101
|
|
||||||
resolve(this.studentRoleId)
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("获取角色列表失败:", error)
|
|
||||||
// 如果获取角色列表失败,尝试使用默认值101
|
|
||||||
this.studentRoleId = 101
|
|
||||||
resolve(this.studentRoleId)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 查询档案列表 */
|
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
// 为了正确过滤学员用户,需要获取所有数据(不分页或获取足够多的数据)
|
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
...this.queryParams,
|
...this.queryParams
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10000 // 获取足够多的数据,确保能过滤所有记录
|
|
||||||
}
|
}
|
||||||
listProfile(queryParams).then(response => {
|
listStudentProfile(queryParams).then(response => {
|
||||||
const rows = response.rows || []
|
const rows = response.rows || []
|
||||||
// 为状态设置默认值,确保是字符串类型
|
// 为状态设置默认值,确保是字符串类型
|
||||||
rows.forEach(row => {
|
rows.forEach(row => {
|
||||||
if (row.status === null || row.status === undefined || row.status === '') {
|
if (row.status === null || row.status === undefined || row.status === '') {
|
||||||
row.status = '0' // 默认为"在押"
|
row.status = '0'
|
||||||
} else {
|
} else {
|
||||||
row.status = String(row.status) // 确保是字符串类型
|
row.status = String(row.status)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 如果已获取学员角色ID,过滤掉非学员用户
|
this.profileList = rows
|
||||||
if (this.studentRoleId) {
|
this.total = response.total || rows.length
|
||||||
this.filterStudentUsers(rows).then(filteredRows => {
|
this.selectedRows = []
|
||||||
// 前端分页处理
|
this.ids = []
|
||||||
const pageNum = this.queryParams.pageNum || 1
|
this.single = true
|
||||||
const pageSize = this.queryParams.pageSize || 10
|
this.multiple = true
|
||||||
const start = (pageNum - 1) * pageSize
|
this.$nextTick(() => {
|
||||||
const end = start + pageSize
|
if (this.$refs.profileTable) {
|
||||||
this.profileList = filteredRows.slice(start, end)
|
this.$refs.profileTable.clearSelection()
|
||||||
this.total = filteredRows.length
|
}
|
||||||
this.selectedRows = []
|
|
||||||
this.ids = []
|
|
||||||
this.single = true
|
|
||||||
this.multiple = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.profileTable) {
|
|
||||||
this.$refs.profileTable.clearSelection()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("过滤学员用户失败:", error)
|
|
||||||
// 如果过滤失败,仍然显示所有用户(但不推荐)
|
|
||||||
const pageNum = this.queryParams.pageNum || 1
|
|
||||||
const pageSize = this.queryParams.pageSize || 10
|
|
||||||
const start = (pageNum - 1) * pageSize
|
|
||||||
const end = start + pageSize
|
|
||||||
this.profileList = rows.slice(start, end)
|
|
||||||
this.total = rows.length
|
|
||||||
this.selectedRows = []
|
|
||||||
this.ids = []
|
|
||||||
this.single = true
|
|
||||||
this.multiple = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.profileTable) {
|
|
||||||
this.$refs.profileTable.clearSelection()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// 如果还没有获取到学员角色ID,先获取再过滤
|
|
||||||
this.getStudentRoleId().then(() => {
|
|
||||||
this.filterStudentUsers(rows).then(filteredRows => {
|
|
||||||
// 前端分页处理
|
|
||||||
const pageNum = this.queryParams.pageNum || 1
|
|
||||||
const pageSize = this.queryParams.pageSize || 10
|
|
||||||
const start = (pageNum - 1) * pageSize
|
|
||||||
const end = start + pageSize
|
|
||||||
this.profileList = filteredRows.slice(start, end)
|
|
||||||
this.total = filteredRows.length
|
|
||||||
this.selectedRows = []
|
|
||||||
this.ids = []
|
|
||||||
this.single = true
|
|
||||||
this.multiple = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.profileTable) {
|
|
||||||
this.$refs.profileTable.clearSelection()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("过滤学员用户失败:", error)
|
|
||||||
const pageNum = this.queryParams.pageNum || 1
|
|
||||||
const pageSize = this.queryParams.pageSize || 10
|
|
||||||
const start = (pageNum - 1) * pageSize
|
|
||||||
const end = start + pageSize
|
|
||||||
this.profileList = rows.slice(start, end)
|
|
||||||
this.total = rows.length
|
|
||||||
this.selectedRows = []
|
|
||||||
this.ids = []
|
|
||||||
this.single = true
|
|
||||||
this.multiple = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.profileTable) {
|
|
||||||
this.$refs.profileTable.clearSelection()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("查询档案列表失败:", error)
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 过滤学员用户 */
|
|
||||||
filterStudentUsers(rows) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
if (!this.studentRoleId || rows.length === 0) {
|
|
||||||
resolve(rows)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 获取所有学员用户ID列表
|
|
||||||
allocatedUserList({
|
|
||||||
roleId: this.studentRoleId,
|
|
||||||
status: '0',
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10000
|
|
||||||
}).then(response => {
|
|
||||||
const studentUserIds = new Set()
|
|
||||||
const studentUsers = response.rows || []
|
|
||||||
studentUsers.forEach(user => {
|
|
||||||
if (user.userId) {
|
|
||||||
studentUserIds.add(user.userId)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 过滤出只包含学员用户的记录
|
|
||||||
const filteredRows = rows.filter(row => {
|
|
||||||
return row.userId && studentUserIds.has(row.userId)
|
|
||||||
})
|
|
||||||
resolve(filteredRows)
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("获取学员用户列表失败:", error)
|
|
||||||
reject(error)
|
|
||||||
})
|
})
|
||||||
|
this.loading = false
|
||||||
|
}).catch(error => {
|
||||||
|
console.error("查询学员档案列表失败:", error)
|
||||||
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
|
|
@ -737,6 +637,7 @@ export default {
|
||||||
gender: undefined,
|
gender: undefined,
|
||||||
nation: undefined,
|
nation: undefined,
|
||||||
educationLevel: undefined,
|
educationLevel: undefined,
|
||||||
|
birthday: undefined,
|
||||||
crimeName: undefined,
|
crimeName: undefined,
|
||||||
sentenceTerm: undefined,
|
sentenceTerm: undefined,
|
||||||
sentenceStartDate: undefined,
|
sentenceStartDate: undefined,
|
||||||
|
|
@ -973,6 +874,7 @@ export default {
|
||||||
gender: (row && row.gender) || undefined,
|
gender: (row && row.gender) || undefined,
|
||||||
nation: (row && row.nation) || undefined,
|
nation: (row && row.nation) || undefined,
|
||||||
educationLevel: (row && row.educationLevel) || undefined,
|
educationLevel: (row && row.educationLevel) || undefined,
|
||||||
|
birthday: (row && row.birthday) || undefined,
|
||||||
crimeName: (row && row.crimeName) || undefined,
|
crimeName: (row && row.crimeName) || undefined,
|
||||||
sentenceTerm: (row && row.sentenceTerm) || undefined,
|
sentenceTerm: (row && row.sentenceTerm) || undefined,
|
||||||
sentenceStartDate: undefined,
|
sentenceStartDate: undefined,
|
||||||
|
|
@ -1046,36 +948,31 @@ export default {
|
||||||
this.$modal.msgError("请选择要删除的记录")
|
this.$modal.msgError("请选择要删除的记录")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 检查是否都是学员用户(非学员用户不能删除)
|
|
||||||
this.checkStudentUsers(targets).then(isAllStudents => {
|
|
||||||
if (!isAllStudents) {
|
|
||||||
this.$modal.msgError("只能删除学员用户,系统管理员等非学员用户不能删除")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const profileIdSet = new Set()
|
|
||||||
const userIdSet = new Set()
|
|
||||||
const userIdsWithProfile = new Set() // 记录有档案的用户ID
|
|
||||||
targets.forEach(item => {
|
|
||||||
// 优先使用 profileId,如果没有则使用 userId
|
|
||||||
if (item.profileId) {
|
|
||||||
profileIdSet.add(item.profileId)
|
|
||||||
// 记录有档案的用户ID(删除档案时会自动删除用户,不需要单独删除)
|
|
||||||
if (item.userId) {
|
|
||||||
userIdsWithProfile.add(item.userId)
|
|
||||||
}
|
|
||||||
} else if (item.userId) {
|
|
||||||
// 没有 profileId,但有 userId,说明用户存在但可能没有档案,需要单独删除用户
|
|
||||||
userIdSet.add(item.userId)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const profileIds = Array.from(profileIdSet)
|
|
||||||
// 只保留没有档案的用户ID(避免重复删除)
|
|
||||||
const userIds = Array.from(userIdSet).filter(userId => !userIdsWithProfile.has(userId))
|
|
||||||
|
|
||||||
if (!profileIds.length && !userIds.length) {
|
const profileIdSet = new Set()
|
||||||
this.$modal.msgError("未找到可删除的档案或用户")
|
const userIdSet = new Set()
|
||||||
return
|
const userIdsWithProfile = new Set() // 记录有档案的用户ID
|
||||||
|
targets.forEach(item => {
|
||||||
|
// 优先使用 profileId,如果没有则使用 userId
|
||||||
|
if (item.profileId) {
|
||||||
|
profileIdSet.add(item.profileId)
|
||||||
|
// 记录有档案的用户ID(删除档案时会自动删除用户,不需要单独删除)
|
||||||
|
if (item.userId) {
|
||||||
|
userIdsWithProfile.add(item.userId)
|
||||||
|
}
|
||||||
|
} else if (item.userId) {
|
||||||
|
// 没有 profileId,但有 userId,说明用户存在但可能没有档案,需要单独删除用户
|
||||||
|
userIdSet.add(item.userId)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
const profileIds = Array.from(profileIdSet)
|
||||||
|
// 只保留没有档案的用户ID(避免重复删除)
|
||||||
|
const userIds = Array.from(userIdSet).filter(userId => !userIdsWithProfile.has(userId))
|
||||||
|
|
||||||
|
if (!profileIds.length && !userIds.length) {
|
||||||
|
this.$modal.msgError("未找到可删除的档案或用户")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const parts = []
|
const parts = []
|
||||||
if (profileIds.length) {
|
if (profileIds.length) {
|
||||||
|
|
@ -1084,67 +981,31 @@ export default {
|
||||||
if (userIds.length) {
|
if (userIds.length) {
|
||||||
parts.push(`用户编号 ${userIds.join(',')}`)
|
parts.push(`用户编号 ${userIds.join(',')}`)
|
||||||
}
|
}
|
||||||
const message = `是否确认删除${parts.join(' 和 ')}?`
|
const message = `是否确认删除${parts.join(' 和 ')}?`
|
||||||
|
|
||||||
this.$modal.confirm(message).then(() => {
|
this.$modal.confirm(message).then(() => {
|
||||||
const tasks = []
|
const tasks = []
|
||||||
// 删除档案(如果有)
|
// 删除档案(如果有)
|
||||||
profileIds.forEach(id => tasks.push(delProfile(id)))
|
profileIds.forEach(id => tasks.push(delProfile(id)))
|
||||||
// 删除用户(只删除没有档案的用户)
|
// 删除用户(只删除没有档案的用户)
|
||||||
// 注意:如果用户有档案,删除档案时会自动删除用户,所以这里只删除没有档案的用户
|
// 注意:如果用户有档案,删除档案时会自动删除用户,所以这里只删除没有档案的用户
|
||||||
if (userIds.length) {
|
if (userIds.length) {
|
||||||
// 找出没有档案的用户(在 targets 中没有 profileId 的用户)
|
// 找出没有档案的用户(在 targets 中没有 profileId 的用户)
|
||||||
const userIdsWithoutProfile = userIds.filter(userId => {
|
const userIdsWithoutProfile = userIds.filter(userId => {
|
||||||
return !targets.some(item => item.userId === userId && item.profileId)
|
return !targets.some(item => item.userId === userId && item.profileId)
|
||||||
})
|
})
|
||||||
if (userIdsWithoutProfile.length > 0) {
|
if (userIdsWithoutProfile.length > 0) {
|
||||||
tasks.push(delUserInProfile(userIdsWithoutProfile))
|
tasks.push(delUserInProfile(userIdsWithoutProfile))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Promise.all(tasks)
|
|
||||||
}).then(() => {
|
|
||||||
this.getList()
|
|
||||||
this.$modal.msgSuccess("删除成功")
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("删除失败:", error)
|
|
||||||
const errorMsg = error.msg || error.message || "删除失败"
|
|
||||||
this.$modal.msgError(errorMsg)
|
|
||||||
})
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("检查学员用户失败:", error)
|
|
||||||
this.$modal.msgError("检查用户角色失败,无法删除")
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 检查用户是否都是学员用户 */
|
|
||||||
checkStudentUsers(targets) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
if (!this.studentRoleId || !targets || targets.length === 0) {
|
|
||||||
resolve(false)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
// 获取所有学员用户ID列表
|
return Promise.all(tasks)
|
||||||
allocatedUserList({
|
}).then(() => {
|
||||||
roleId: this.studentRoleId,
|
this.getList()
|
||||||
status: '0',
|
this.$modal.msgSuccess("删除成功")
|
||||||
pageNum: 1,
|
}).catch(error => {
|
||||||
pageSize: 10000
|
console.error("删除失败:", error)
|
||||||
}).then(response => {
|
const errorMsg = error.msg || error.message || "删除失败"
|
||||||
const studentUserIds = new Set()
|
this.$modal.msgError(errorMsg)
|
||||||
const studentUsers = response.rows || []
|
|
||||||
studentUsers.forEach(user => {
|
|
||||||
if (user.userId) {
|
|
||||||
studentUserIds.add(user.userId)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 检查所有目标用户是否都是学员用户
|
|
||||||
const allAreStudents = targets.every(item => {
|
|
||||||
return item.userId && studentUserIds.has(item.userId)
|
|
||||||
})
|
|
||||||
resolve(allAreStudents)
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("获取学员用户列表失败:", error)
|
|
||||||
reject(error)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
|
|
@ -1170,10 +1031,20 @@ export default {
|
||||||
handleFileSuccess(response, file, fileList) {
|
handleFileSuccess(response, file, fileList) {
|
||||||
this.upload.open = false
|
this.upload.open = false
|
||||||
this.upload.isUploading = false
|
this.upload.isUploading = false
|
||||||
this.$refs.upload.clearFiles()
|
if (this.$refs.upload) {
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
}
|
||||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
// 文件上传失败处理
|
||||||
|
handleFileError(err, file, fileList) {
|
||||||
|
this.upload.isUploading = false
|
||||||
|
if (this.$refs.upload) {
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
}
|
||||||
|
this.$modal.msgError((err && (err.msg || err.message)) || "文件上传失败,请稍后重试或检查网络连接。")
|
||||||
|
},
|
||||||
// 提交上传文件
|
// 提交上传文件
|
||||||
submitFileForm() {
|
submitFileForm() {
|
||||||
const file = this.$refs.upload.uploadFiles
|
const file = this.$refs.upload.uploadFiles
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
||||||
<el-form-item label="用户名称" prop="userName">
|
<el-form-item label="登录名称" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.userName"
|
v-model="queryParams.userName"
|
||||||
placeholder="请输入用户名称"
|
placeholder="请输入登录名称"
|
||||||
clearable
|
clearable
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
|
|
@ -61,8 +61,8 @@
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
|
<el-table-column label="登录名称" prop="userName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
|
<el-table-column label="用户姓名" prop="nickName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
|
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
<!-- 授权用户 -->
|
<!-- 授权用户 -->
|
||||||
<el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
<el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
|
||||||
<el-form-item label="用户名称" prop="userName">
|
<el-form-item label="登录名称" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.userName"
|
v-model="queryParams.userName"
|
||||||
placeholder="请输入用户名称"
|
placeholder="请输入登录名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
|
|
@ -26,8 +26,8 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
|
<el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
|
||||||
<el-table-column type="selection" width="55"></el-table-column>
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
|
<el-table-column label="登录名称" prop="userName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
|
<el-table-column label="用户姓名" prop="nickName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
|
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<el-form ref="form" :model="form" label-width="80px">
|
<el-form ref="form" :model="form" label-width="80px">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8" :offset="2">
|
<el-col :span="8" :offset="2">
|
||||||
<el-form-item label="用户昵称" prop="nickName">
|
<el-form-item label="用户姓名" prop="nickName">
|
||||||
<el-input v-model="form.nickName" disabled />
|
<el-input v-model="form.nickName" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,9 @@
|
||||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns.userId.visible" />
|
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns.userId.visible" />
|
||||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible" :show-overflow-tooltip="true" />
|
<el-table-column label="登录名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns.nickName.visible" :show-overflow-tooltip="true" />
|
<el-table-column label="用户姓名" align="center" key="nickName" prop="nickName" v-if="columns.nickName.visible" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="注册类型" align="center" key="registerType" prop="registerType" v-if="columns.registerType && columns.registerType.visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
|
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="false" width="120" />
|
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="false" width="120" />
|
||||||
<el-table-column label="状态" align="center" key="status" v-if="columns.status.visible">
|
<el-table-column label="状态" align="center" key="status" v-if="columns.status.visible">
|
||||||
|
|
@ -114,8 +115,8 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户昵称" prop="nickName">
|
<el-form-item label="用户姓名" prop="nickName">
|
||||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称/姓名" maxlength="30" @input="handleNickNameInput" />
|
<el-input v-model="form.nickName" placeholder="请输入用户姓名" maxlength="30" @input="handleNickNameInput" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -125,18 +126,23 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="注册类型" prop="registerType">
|
||||||
|
<el-input v-model="form.registerType" placeholder="请输入注册类型" maxlength="30" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="手机号码" prop="phonenumber">
|
<el-form-item label="手机号码" prop="phonenumber">
|
||||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="邮箱" prop="email">
|
<el-form-item label="邮箱" prop="email">
|
||||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="性别" prop="sex">
|
<el-form-item label="性别" prop="sex">
|
||||||
<el-select v-model="form.sex" placeholder="请选择性别">
|
<el-select v-model="form.sex" placeholder="请选择性别">
|
||||||
|
|
@ -144,6 +150,8 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-radio-group v-model="form.status">
|
<el-radio-group v-model="form.status">
|
||||||
|
|
@ -173,24 +181,11 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="生日" prop="birthday">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.birthday"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择生日"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="学历" prop="education">
|
<el-form-item label="学历" prop="education">
|
||||||
<el-input v-model="form.education" placeholder="请输入学历" />
|
<el-input v-model="form.education" placeholder="请输入学历" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="职业" prop="occupation">
|
<el-form-item label="职业" prop="occupation">
|
||||||
<el-input v-model="form.occupation" placeholder="请输入职业" />
|
<el-input v-model="form.occupation" placeholder="请输入职业" />
|
||||||
|
|
@ -256,7 +251,7 @@
|
||||||
|
|
||||||
<!-- 用户导入对话框 -->
|
<!-- 用户导入对话框 -->
|
||||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :on-error="handleFileError" :auto-upload="false" drag>
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
<div class="el-upload__tip text-center" slot="tip">
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
|
|
@ -354,8 +349,9 @@ export default {
|
||||||
// 列信息
|
// 列信息
|
||||||
columns: {
|
columns: {
|
||||||
userId: { label: '用户编号', visible: true },
|
userId: { label: '用户编号', visible: true },
|
||||||
userName: { label: '用户名称', visible: true },
|
userName: { label: '登录名称', visible: true },
|
||||||
nickName: { label: '用户昵称', visible: true },
|
nickName: { label: '用户姓名', visible: true },
|
||||||
|
registerType: { label: '注册类型', visible: true },
|
||||||
deptName: { label: '部门', visible: true },
|
deptName: { label: '部门', visible: true },
|
||||||
phonenumber: { label: '手机号码', visible: false },
|
phonenumber: { label: '手机号码', visible: false },
|
||||||
status: { label: '状态', visible: true },
|
status: { label: '状态', visible: true },
|
||||||
|
|
@ -364,11 +360,11 @@ export default {
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
userName: [
|
userName: [
|
||||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
{ required: true, message: "登录名称不能为空", trigger: "blur" },
|
||||||
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
{ min: 2, max: 20, message: '登录名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
nickName: [
|
nickName: [
|
||||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
{ required: true, message: "用户姓名不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
||||||
|
|
@ -470,6 +466,7 @@ export default {
|
||||||
password: undefined,
|
password: undefined,
|
||||||
phonenumber: undefined,
|
phonenumber: undefined,
|
||||||
email: undefined,
|
email: undefined,
|
||||||
|
registerType: undefined,
|
||||||
sex: undefined,
|
sex: undefined,
|
||||||
status: "0",
|
status: "0",
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
|
|
@ -663,10 +660,20 @@ export default {
|
||||||
handleFileSuccess(response, file, fileList) {
|
handleFileSuccess(response, file, fileList) {
|
||||||
this.upload.open = false
|
this.upload.open = false
|
||||||
this.upload.isUploading = false
|
this.upload.isUploading = false
|
||||||
this.$refs.upload.clearFiles()
|
if (this.$refs.upload) {
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
}
|
||||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
// 文件上传失败处理
|
||||||
|
handleFileError(err, file, fileList) {
|
||||||
|
this.upload.isUploading = false
|
||||||
|
if (this.$refs.upload) {
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
}
|
||||||
|
this.$modal.msgError((err && (err.msg || err.message)) || "文件上传失败,请稍后重试或检查网络连接。")
|
||||||
|
},
|
||||||
// 提交上传文件
|
// 提交上传文件
|
||||||
submitFileForm() {
|
submitFileForm() {
|
||||||
const file = this.$refs.upload.uploadFiles
|
const file = this.$refs.upload.uploadFiles
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,13 @@
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group list-group-striped">
|
<ul class="list-group list-group-striped">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<svg-icon icon-class="user" />用户名称
|
<svg-icon icon-class="user" />登录名称
|
||||||
<div class="pull-right">{{ user.userName }}</div>
|
<div class="pull-right">{{ user.userName }}</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<svg-icon icon-class="edit" />注册类型
|
||||||
|
<div class="pull-right">{{ user.registerType || '-' }}</div>
|
||||||
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<svg-icon icon-class="phone" />手机号码
|
<svg-icon icon-class="phone" />手机号码
|
||||||
<div class="pull-right">{{ user.phonenumber }}</div>
|
<div class="pull-right">{{ user.phonenumber }}</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="用户昵称" prop="nickName">
|
<el-form-item label="用户姓名" prop="nickName">
|
||||||
<el-input v-model="form.nickName" maxlength="30" />
|
<el-input v-model="form.nickName" maxlength="30" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="手机号码" prop="phonenumber">
|
<el-form-item label="手机号码" prop="phonenumber">
|
||||||
|
|
@ -37,7 +37,7 @@ export default {
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
nickName: [
|
nickName: [
|
||||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
{ required: true, message: "用户姓名不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
email: [
|
email: [
|
||||||
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
|
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user