mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-17 10:56:39 +08:00
commit
b1cbad8362
@ -28,7 +28,7 @@ public class NoticeQueryForm extends PageParam {
|
||||
private String documentNumber;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private Long createUserId;
|
||||
private String createUserName;
|
||||
|
||||
@Schema(description = "删除标识")
|
||||
private Boolean deletedFlag;
|
||||
|
@ -208,6 +208,10 @@ public class NoticeService {
|
||||
}
|
||||
|
||||
NoticeUpdateFormVO updateFormVO = SmartBeanUtil.copy(noticeEntity, NoticeUpdateFormVO.class);
|
||||
NoticeTypeVO noticeType = noticeTypeService.getByNoticeTypeId(noticeEntity.getNoticeTypeId());
|
||||
updateFormVO.setNoticeTypeName(noticeType.getNoticeTypeName());
|
||||
updateFormVO.setPublishFlag(updateFormVO.getPublishTime() != null && updateFormVO.getPublishTime().isBefore(LocalDateTime.now()));
|
||||
|
||||
if (!updateFormVO.getAllVisibleFlag()) {
|
||||
List<NoticeVisibleRangeVO> noticeVisibleRangeList = noticeDao.queryVisibleRange(noticeId);
|
||||
List<Long> employeeIdList = noticeVisibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue().equals(e.getDataType()))
|
||||
|
@ -5,7 +5,7 @@ import net.lab1024.sa.base.common.enumeration.BaseEnum;
|
||||
|
||||
|
||||
/**
|
||||
* 数据范围 种类
|
||||
* 数据可见范围类型
|
||||
*
|
||||
* @Author 1024创新实验室: 罗伊
|
||||
* @Date 2020/11/28 20:59:17
|
||||
|
@ -25,7 +25,7 @@ public class DataScopeSqlConfig {
|
||||
/**
|
||||
* join sql 具体实现类
|
||||
*/
|
||||
private Class joinSqlImplClazz;
|
||||
private Class<?> joinSqlImplClazz;
|
||||
|
||||
private String joinSql;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 数据范围
|
||||
* 数据可见范围
|
||||
*
|
||||
* @Author 1024创新实验室: 罗伊
|
||||
* @Date 2020/11/28 20:59:17
|
||||
|
@ -46,6 +46,11 @@ public class DataScopeSqlConfigService {
|
||||
|
||||
private static final String DEPARTMENT_PARAM = "#departmentIds";
|
||||
|
||||
/**
|
||||
* 用于拼接查看本人数据范围的 SQL
|
||||
*/
|
||||
private static final String CREATE_USER_ID_EQUALS = "create_user_id = ";
|
||||
|
||||
private final ConcurrentHashMap<String, DataScopeSqlConfig> dataScopeMethodMap = new ConcurrentHashMap<>();
|
||||
|
||||
@Resource
|
||||
@ -94,14 +99,23 @@ public class DataScopeSqlConfigService {
|
||||
* 组装需要拼接的sql
|
||||
*/
|
||||
public String getJoinSql(Map<String, Object> paramMap, DataScopeSqlConfig sqlConfigDTO) {
|
||||
DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType();
|
||||
String joinSql = sqlConfigDTO.getJoinSql();
|
||||
Long employeeId = SmartRequestUtil.getRequestUserId();
|
||||
if (employeeId == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType();
|
||||
DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
|
||||
|
||||
// 数据权限设置为仅本人可见时 直接返回 create_user_id = employeeId
|
||||
if (DataScopeViewTypeEnum.ME == viewTypeEnum) {
|
||||
return CREATE_USER_ID_EQUALS + employeeId;
|
||||
}
|
||||
|
||||
String joinSql = sqlConfigDTO.getJoinSql();
|
||||
|
||||
if (DataScopeWhereInTypeEnum.CUSTOM_STRATEGY == sqlConfigDTO.getDataScopeWhereInType()) {
|
||||
Class strategyClass = sqlConfigDTO.getJoinSqlImplClazz();
|
||||
Class<?> strategyClass = sqlConfigDTO.getJoinSqlImplClazz();
|
||||
if (strategyClass == null) {
|
||||
log.warn("data scope custom strategy class is null");
|
||||
return "";
|
||||
@ -111,11 +125,10 @@ public class DataScopeSqlConfigService {
|
||||
log.warn("data scope custom strategy class:{} ,bean is null", sqlConfigDTO.getJoinSqlImplClazz());
|
||||
return "";
|
||||
}
|
||||
DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
|
||||
return powerStrategy.getCondition(viewTypeEnum,paramMap, sqlConfigDTO);
|
||||
}
|
||||
if (DataScopeWhereInTypeEnum.EMPLOYEE == sqlConfigDTO.getDataScopeWhereInType()) {
|
||||
List<Long> canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(dataScopeTypeEnum, employeeId);
|
||||
List<Long> canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(viewTypeEnum, employeeId);
|
||||
if (CollectionUtils.isEmpty(canViewEmployeeIds)) {
|
||||
return "";
|
||||
}
|
||||
@ -124,7 +137,7 @@ public class DataScopeSqlConfigService {
|
||||
return sql;
|
||||
}
|
||||
if (DataScopeWhereInTypeEnum.DEPARTMENT == sqlConfigDTO.getDataScopeWhereInType()) {
|
||||
List<Long> canViewDepartmentIds = dataScopeViewService.getCanViewDepartmentId(dataScopeTypeEnum, employeeId);
|
||||
List<Long> canViewDepartmentIds = dataScopeViewService.getCanViewDepartmentId(viewTypeEnum, employeeId);
|
||||
if (CollectionUtils.isEmpty(canViewDepartmentIds)) {
|
||||
return "";
|
||||
}
|
||||
|
@ -44,10 +44,9 @@ public class DataScopeViewService {
|
||||
private DepartmentService departmentService;
|
||||
|
||||
/**
|
||||
* 获取某人可以查看的所有人员信息
|
||||
* 获取某人可以查看的所有人员数据
|
||||
*/
|
||||
public List<Long> getCanViewEmployeeId(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) {
|
||||
DataScopeViewTypeEnum viewType = this.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
|
||||
public List<Long> getCanViewEmployeeId(DataScopeViewTypeEnum viewType, Long employeeId) {
|
||||
if (DataScopeViewTypeEnum.ME == viewType) {
|
||||
return this.getMeEmployeeIdList(employeeId);
|
||||
}
|
||||
@ -57,16 +56,17 @@ public class DataScopeViewService {
|
||||
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
|
||||
return this.getDepartmentAndSubEmployeeIdList(employeeId);
|
||||
}
|
||||
// 可以查看所有员工数据
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某人可以查看的所有部门信息
|
||||
* 获取某人可以查看的所有部门数据
|
||||
*/
|
||||
public List<Long> getCanViewDepartmentId(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) {
|
||||
DataScopeViewTypeEnum viewType = this.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
|
||||
public List<Long> getCanViewDepartmentId(DataScopeViewTypeEnum viewType, Long employeeId) {
|
||||
if (DataScopeViewTypeEnum.ME == viewType) {
|
||||
return this.getMeDepartmentIdList(employeeId);
|
||||
// 数据可见范围类型为本人时 不可以查看任何部门数据
|
||||
return Lists.newArrayList(0L);
|
||||
}
|
||||
if (DataScopeViewTypeEnum.DEPARTMENT == viewType) {
|
||||
return this.getMeDepartmentIdList(employeeId);
|
||||
@ -74,6 +74,7 @@ public class DataScopeViewService {
|
||||
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
|
||||
return this.getDepartmentAndSubIdList(employeeId);
|
||||
}
|
||||
// 可以查看所有部门数据
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@ -91,10 +92,16 @@ public class DataScopeViewService {
|
||||
* 根据员工id 获取各数据范围最大的可见范围 map<dataScopeType,viewType></>
|
||||
*/
|
||||
public DataScopeViewTypeEnum getEmployeeDataScopeViewType(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) {
|
||||
if (employeeId == null) {
|
||||
EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
|
||||
if (employeeEntity == null || employeeEntity.getEmployeeId() == null) {
|
||||
return DataScopeViewTypeEnum.ME;
|
||||
}
|
||||
|
||||
// 如果是超级管理员 则可查看全部
|
||||
if (employeeEntity.getAdministratorFlag()) {
|
||||
return DataScopeViewTypeEnum.ALL;
|
||||
}
|
||||
|
||||
List<Long> roleIdList = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId);
|
||||
//未设置角色 默认本人
|
||||
if (CollectionUtils.isEmpty(roleIdList)) {
|
||||
|
@ -57,11 +57,11 @@ public class EmployeeController {
|
||||
return employeeService.updateEmployee(employeeUpdateForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新登录人信息 @author 善逸")
|
||||
@PostMapping("/employee/update/login")
|
||||
public ResponseDTO<String> updateByLogin(@Valid @RequestBody EmployeeUpdateForm employeeUpdateForm) {
|
||||
employeeUpdateForm.setEmployeeId(SmartRequestUtil.getRequestUserId());
|
||||
return employeeService.updateEmployee(employeeUpdateForm);
|
||||
@Operation(summary = "更新员工个人中心信息 @author 善逸")
|
||||
@PostMapping("/employee/update/center")
|
||||
public ResponseDTO<String> updateCenter(@Valid @RequestBody EmployeeUpdateCenterForm updateCenterForm) {
|
||||
updateCenterForm.setEmployeeId(SmartRequestUtil.getRequestUserId());
|
||||
return employeeService.updateCenter(updateCenterForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新登录人头像 @author 善逸")
|
||||
|
@ -34,31 +34,30 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
|
||||
*/
|
||||
List<EmployeeVO> selectEmployeeByDisabledAndDeleted(@Param("disabledFlag") Boolean disabledFlag, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
|
||||
/**
|
||||
* 更新单个
|
||||
* 更新禁用状态
|
||||
*/
|
||||
void updateDisableFlag(@Param("employeeId") Long employeeId, @Param("disabledFlag") Boolean disabledFlag);
|
||||
|
||||
|
||||
/**
|
||||
* 通过登录名查询
|
||||
*/
|
||||
EmployeeEntity getByLoginName(@Param("loginName") String loginName,
|
||||
@Param("disabledFlag") Boolean disabledFlag);
|
||||
|
||||
EmployeeEntity getByLoginName(@Param("loginName") String loginName, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 通过姓名查询
|
||||
*/
|
||||
EmployeeEntity getByActualName(@Param("actualName") String actualName,
|
||||
@Param("disabledFlag") Boolean disabledFlag
|
||||
);
|
||||
EmployeeEntity getByActualName(@Param("actualName") String actualName, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 通过手机号查询
|
||||
*/
|
||||
EmployeeEntity getByPhone(@Param("phone") String phone, @Param("disabledFlag") Boolean disabledFlag);
|
||||
EmployeeEntity getByPhone(@Param("phone") String phone, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 通过邮箱账号查询
|
||||
*/
|
||||
EmployeeEntity getByEmail(@Param("email") String email, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 获取所有员工
|
||||
@ -67,7 +66,6 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
|
||||
|
||||
/**
|
||||
* 获取某个部门员工数
|
||||
*
|
||||
*/
|
||||
Integer countByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
@ -76,39 +74,35 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
|
||||
*/
|
||||
List<EmployeeVO> getEmployeeByIds(@Param("employeeIds") Collection<Long> employeeIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询单个员工信息
|
||||
*/
|
||||
EmployeeVO getEmployeeById(@Param("employeeId") Long employeeId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取某个部门的员工
|
||||
*/
|
||||
List<EmployeeEntity> selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag);
|
||||
|
||||
List<EmployeeEntity> selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 查询某些部门下用户名是xxx的员工
|
||||
*/
|
||||
List<EmployeeEntity> selectByActualName(@Param("departmentIdList") List<Long> departmentIdList, @Param("actualName") String actualName, @Param("disabledFlag") Boolean disabledFlag);
|
||||
|
||||
List<EmployeeEntity> selectByActualName(@Param("departmentIdList") List<Long> departmentIdList, @Param("actualName") String actualName, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 获取某批部门的员工Id
|
||||
*/
|
||||
List<Long> getEmployeeIdByDepartmentIdList(@Param("departmentIds") List<Long> departmentIds, @Param("disabledFlag") Boolean disabledFlag);
|
||||
List<Long> getEmployeeIdByDepartmentIdList(@Param("departmentIds") List<Long> departmentIds, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 获取所有
|
||||
*/
|
||||
List<Long> getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("disabledFlag") Boolean disabledFlag);
|
||||
List<Long> getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 获取某个部门的员工Id
|
||||
*/
|
||||
List<Long> getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag);
|
||||
List<Long> getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 员工重置密码
|
||||
|
@ -51,17 +51,19 @@ public class EmployeeAddForm {
|
||||
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
@Schema(description = "邮箱账号")
|
||||
@NotNull(message = "邮箱账号不能为空")
|
||||
@Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱账号格式不正确")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "职务级别ID")
|
||||
private Long positionId;
|
||||
|
||||
@Schema(description = "角色列表")
|
||||
private List<Long> roleIdList;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Length(max = 30, message = "备注最多200字符")
|
||||
@Length(max = 200, message = "备注最多200字符")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "职务级别ID")
|
||||
private Long positionId;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
package net.lab1024.sa.admin.module.system.employee.domain.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.base.common.enumeration.GenderEnum;
|
||||
import net.lab1024.sa.base.common.swagger.SchemaEnum;
|
||||
import net.lab1024.sa.base.common.util.SmartVerificationUtil;
|
||||
import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* 更新员工个人中心信息
|
||||
*
|
||||
* @Author 1024创新实验室: 开云
|
||||
* @Date 2021-12-20 21:06:49
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeUpdateCenterForm {
|
||||
|
||||
@Schema(hidden = true)
|
||||
private Long employeeId;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
@NotNull(message = "姓名不能为空")
|
||||
@Length(max = 30, message = "姓名最多30字符")
|
||||
private String actualName;
|
||||
|
||||
@SchemaEnum(GenderEnum.class)
|
||||
@CheckEnum(value = GenderEnum.class, message = "性别错误")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
@NotNull(message = "手机号不能为空")
|
||||
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "邮箱账号")
|
||||
@NotNull(message = "邮箱账号不能为空")
|
||||
@Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱账号格式不正确")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "职务级别ID")
|
||||
private Long positionId;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Length(max = 200, message = "备注最多200字符")
|
||||
private String remark;
|
||||
}
|
@ -168,19 +168,14 @@ public class EmployeeService {
|
||||
return ResponseDTO.userErrorParam("部门不存在");
|
||||
}
|
||||
|
||||
|
||||
EmployeeEntity existEntity = employeeDao.getByLoginName(employeeUpdateForm.getLoginName(), null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("登录名重复");
|
||||
// 检查唯一性
|
||||
ResponseDTO<String> checkResponse = checkUniqueness(employeeId, employeeUpdateForm.getLoginName(), employeeUpdateForm.getPhone(), employeeUpdateForm.getEmail());
|
||||
if (!checkResponse.getOk()) {
|
||||
return checkResponse;
|
||||
}
|
||||
|
||||
existEntity = employeeDao.getByPhone(employeeUpdateForm.getPhone(), null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("手机号已存在");
|
||||
}
|
||||
|
||||
// 不更新密码
|
||||
EmployeeEntity entity = SmartBeanUtil.copy(employeeUpdateForm, EmployeeEntity.class);
|
||||
// 不更新密码
|
||||
entity.setLoginPwd(null);
|
||||
|
||||
// 更新数据
|
||||
@ -192,6 +187,58 @@ public class EmployeeService {
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新员工个人中心信息
|
||||
*/
|
||||
public ResponseDTO<String> updateCenter(EmployeeUpdateCenterForm updateCenterForm) {
|
||||
|
||||
Long employeeId = updateCenterForm.getEmployeeId();
|
||||
EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
|
||||
if (null == employeeEntity) {
|
||||
return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
|
||||
}
|
||||
|
||||
// 检查唯一性 登录账号不能修改则不需要检查
|
||||
ResponseDTO<String> checkResponse = checkUniqueness(employeeId, "", updateCenterForm.getPhone(), updateCenterForm.getEmail());
|
||||
if (!checkResponse.getOk()) {
|
||||
return checkResponse;
|
||||
}
|
||||
|
||||
EmployeeEntity employee = SmartBeanUtil.copy(updateCenterForm, EmployeeEntity.class);
|
||||
// 不更新密码
|
||||
employee.setLoginPwd(null);
|
||||
|
||||
// 更新数据
|
||||
employeeDao.updateById(employee);
|
||||
|
||||
// 清除员工缓存
|
||||
loginService.clearLoginEmployeeCache(employeeId);
|
||||
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查唯一性
|
||||
*/
|
||||
private ResponseDTO<String> checkUniqueness(Long employeeId, String loginName, String phone, String email) {
|
||||
EmployeeEntity existEntity = employeeDao.getByLoginName(loginName, null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("登录名重复");
|
||||
}
|
||||
|
||||
existEntity = employeeDao.getByPhone(phone, null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("手机号已存在");
|
||||
}
|
||||
|
||||
existEntity = employeeDao.getByEmail(email, null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("邮箱账号已存在");
|
||||
}
|
||||
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新登录人头像
|
||||
|
@ -46,6 +46,12 @@ public class RequestEmployee implements RequestUser {
|
||||
@Schema(description = "部门名称")
|
||||
private String departmentName;
|
||||
|
||||
@Schema(description = "职务级别ID")
|
||||
private Long positionId;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "是否禁用")
|
||||
private Boolean disabledFlag;
|
||||
|
||||
|
@ -2,6 +2,28 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao">
|
||||
|
||||
<!-- 查询结果列 -->
|
||||
<sql id="base_columns">
|
||||
t_notice.notice_id,
|
||||
t_notice.notice_type_id,
|
||||
t_notice.title,
|
||||
t_notice.all_visible_flag,
|
||||
t_notice.scheduled_publish_flag,
|
||||
t_notice.publish_time,
|
||||
t_notice.content_text,
|
||||
t_notice.content_html,
|
||||
t_notice.attachment,
|
||||
t_notice.page_view_count,
|
||||
t_notice.user_view_count,
|
||||
t_notice.source,
|
||||
t_notice.author,
|
||||
t_notice.document_number,
|
||||
t_notice.deleted_flag,
|
||||
t_notice.create_user_id,
|
||||
t_notice.update_time,
|
||||
t_notice.create_time
|
||||
</sql>
|
||||
|
||||
<!-- ================================== 可见范围相关 ================================== -->
|
||||
|
||||
<insert id="insertVisibleRange">
|
||||
@ -35,32 +57,30 @@
|
||||
<!-- 后管分页查询资讯 -->
|
||||
<select id="query" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO">
|
||||
SELECT
|
||||
t_notice.* ,
|
||||
<include refid="base_columns"/>,
|
||||
t_notice_type.notice_type_name as noticeTypeName,
|
||||
t_employee.actual_name as createUserName,
|
||||
t_department.name as departmentName
|
||||
t_employee.actual_name as createUserName
|
||||
FROM t_notice
|
||||
left join t_notice_type on t_notice_type.notice_type_id = t_notice.notice_type_id
|
||||
left join t_employee on t_notice.create_user_id = t_employee.employee_id
|
||||
left join t_department on t_employee.department_id = t_department.department_id
|
||||
LEFT JOIN t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
|
||||
LEFT JOIN t_employee on t_notice.create_user_id = t_employee.employee_id
|
||||
<where>
|
||||
<if test="query.noticeTypeId != null">
|
||||
AND t_notice_type.notice_type_id = #{query.noticeTypeId}
|
||||
</if>
|
||||
<if test="query.keywords != null and query.keywords !=''">
|
||||
<if test="query.keywords != null and query.keywords != ''">
|
||||
AND ( INSTR(t_notice.title,#{query.keywords})
|
||||
OR INSTR(t_notice.author,#{query.keywords})
|
||||
OR INSTR(t_notice.source,#{query.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="query.documentNumber != null and query.documentNumber !=''">
|
||||
<if test="query.documentNumber != null and query.documentNumber != ''">
|
||||
AND INSTR(t_notice.document_number, #{query.documentNumber})
|
||||
</if>
|
||||
<if test="query.createUserId != null">
|
||||
AND t_notice.create_user_id = #{createUserId}
|
||||
<if test="query.createUserName != null and query.createUserName != ''">
|
||||
AND t_employee.actual_name = #{query.createUserName}
|
||||
</if>
|
||||
<if test="query.deletedFlag != null">
|
||||
and t_notice.deleted_flag = #{query.deletedFlag}
|
||||
AND t_notice.deleted_flag = #{query.deletedFlag}
|
||||
</if>
|
||||
<if test="query.createTimeBegin != null">
|
||||
AND DATE_FORMAT(t_notice.create_time, '%Y-%m-%d') >= DATE_FORMAT(#{query.createTimeBegin},
|
||||
@ -84,10 +104,9 @@
|
||||
</select>
|
||||
|
||||
<!-- ================================== 通知公告【员工查看】相关 ================================== -->
|
||||
<select id="queryEmployeeNotice"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
<select id="queryEmployeeNotice" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
select
|
||||
t_notice.*,
|
||||
<include refid="base_columns"/>,
|
||||
t_notice_type.notice_type_name,
|
||||
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
|
||||
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
|
||||
@ -142,12 +161,11 @@
|
||||
</where>
|
||||
order by t_notice.publish_time desc
|
||||
</select>
|
||||
<select id="queryEmployeeNotViewNotice"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
<select id="queryEmployeeNotViewNotice" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
select * from
|
||||
(
|
||||
select
|
||||
t_notice.*,
|
||||
<include refid="base_columns"/>,
|
||||
t_notice_type.notice_type_name,
|
||||
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
|
||||
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
|
||||
@ -198,8 +216,7 @@
|
||||
) t where viewFlag = 0
|
||||
order by t.publish_time desc
|
||||
</select>
|
||||
<select id="queryNoticeViewRecordList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
|
||||
<select id="queryNoticeViewRecordList" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
|
||||
select t_notice_view_record.*,
|
||||
t_employee.actual_name as employeeName,
|
||||
t_department.name as departmentName
|
||||
|
@ -33,21 +33,19 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateDisableFlag">
|
||||
UPDATE t_employee
|
||||
SET disabled_flag = #{disabledFlag}
|
||||
WHERE employee_id = #{employeeId}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getByLoginName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
login_name = #{loginName}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -57,24 +55,33 @@
|
||||
FROM t_employee
|
||||
<where>
|
||||
actual_name = #{actualName}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByPhone" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
phone = #{phone}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getByEmail" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
email = #{email}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT *
|
||||
@ -88,22 +95,19 @@
|
||||
department_id = #{departmentId} AND deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByDepartmentId"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
<select id="selectByDepartmentId" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
department_id = #{departmentId}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectByActualName"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
<select id="selectByActualName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT * FROM t_employee
|
||||
<where>
|
||||
actual_name = #{actualName}
|
||||
@ -111,8 +115,8 @@
|
||||
<foreach collection="departmentIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -125,20 +129,19 @@
|
||||
<foreach collection="departmentIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeId" resultType="java.lang.Long">
|
||||
SELECT employee_id
|
||||
FROM t_employee
|
||||
<where>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -148,8 +151,8 @@
|
||||
FROM t_employee
|
||||
<where>
|
||||
department_id = #{departmentId}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
@ -164,7 +167,6 @@
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeById" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
@ -173,8 +175,7 @@
|
||||
where t_employee.employee_id = #{employeeId}
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeByDisabledAndDeleted"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
<select id="selectEmployeeByDisabledAndDeleted" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT
|
||||
t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
@ -196,5 +197,4 @@
|
||||
WHERE employee_id = #{employeeId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
@ -37,14 +37,14 @@ public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Enti
|
||||
/**
|
||||
* 更新删除状态
|
||||
*/
|
||||
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("deletedFlag")boolean deletedFlag);
|
||||
long updateDeleted(@Param("${primaryKeyFieldName}") ${primaryKeyJavaType} ${primaryKeyFieldName}, @Param("deletedFlag") boolean deletedFlag);
|
||||
|
||||
#end
|
||||
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
/**
|
||||
* 批量更新删除状态
|
||||
*/
|
||||
void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("deletedFlag")boolean deletedFlag);
|
||||
void batchUpdateDeleted(@Param("idList") List<${primaryKeyJavaType}> idList, @Param("deletedFlag") boolean deletedFlag);
|
||||
|
||||
#end
|
||||
#end
|
||||
|
@ -10,13 +10,13 @@ SET @parent_id = NULL;
|
||||
SELECT t_menu.menu_id INTO @parent_id FROM t_menu WHERE t_menu.menu_name = '${basic.description}';
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '查询', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:query', 1, @parent_id, 1 );
|
||||
VALUES ( '查询', 3, @parent_id, false, false, true, false, '${name.lowerCamel}:query', 1, @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '添加', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:add', 1, @parent_id, 1 );
|
||||
VALUES ( '添加', 3, @parent_id, false, false, true, false, '${name.lowerCamel}:add', 1, @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '更新', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:update', 1, @parent_id, 1 );
|
||||
VALUES ( '更新', 3, @parent_id, false, false, true, false, '${name.lowerCamel}:update', 1, @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '删除', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:delete', 1, @parent_id, 1 );
|
||||
VALUES ( '删除', 3, @parent_id, false, false, true, false, '${name.lowerCamel}:delete', 1, @parent_id, 1 );
|
||||
|
@ -28,7 +28,7 @@ public class NoticeQueryForm extends PageParam {
|
||||
private String documentNumber;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private Long createUserId;
|
||||
private String createUserName;
|
||||
|
||||
@Schema(description = "删除标识")
|
||||
private Boolean deletedFlag;
|
||||
|
@ -208,6 +208,10 @@ public class NoticeService {
|
||||
}
|
||||
|
||||
NoticeUpdateFormVO updateFormVO = SmartBeanUtil.copy(noticeEntity, NoticeUpdateFormVO.class);
|
||||
NoticeTypeVO noticeType = noticeTypeService.getByNoticeTypeId(noticeEntity.getNoticeTypeId());
|
||||
updateFormVO.setNoticeTypeName(noticeType.getNoticeTypeName());
|
||||
updateFormVO.setPublishFlag(updateFormVO.getPublishTime() != null && updateFormVO.getPublishTime().isBefore(LocalDateTime.now()));
|
||||
|
||||
if (!updateFormVO.getAllVisibleFlag()) {
|
||||
List<NoticeVisibleRangeVO> noticeVisibleRangeList = noticeDao.queryVisibleRange(noticeId);
|
||||
List<Long> employeeIdList = noticeVisibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue().equals(e.getDataType()))
|
||||
|
@ -5,7 +5,7 @@ import net.lab1024.sa.base.common.enumeration.BaseEnum;
|
||||
|
||||
|
||||
/**
|
||||
* 数据范围 种类
|
||||
* 数据可见范围类型
|
||||
*
|
||||
* @Author 1024创新实验室: 罗伊
|
||||
* @Date 2020/11/28 20:59:17
|
||||
|
@ -25,7 +25,7 @@ public class DataScopeSqlConfig {
|
||||
/**
|
||||
* join sql 具体实现类
|
||||
*/
|
||||
private Class joinSqlImplClazz;
|
||||
private Class<?> joinSqlImplClazz;
|
||||
|
||||
private String joinSql;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 数据范围
|
||||
* 数据可见范围
|
||||
*
|
||||
* @Author 1024创新实验室: 罗伊
|
||||
* @Date 2020/11/28 20:59:17
|
||||
|
@ -33,7 +33,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* @Date 2020/11/28 20:59:17
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -46,6 +46,11 @@ public class DataScopeSqlConfigService {
|
||||
|
||||
private static final String DEPARTMENT_PARAM = "#departmentIds";
|
||||
|
||||
/**
|
||||
* 用于拼接查看本人数据范围的 SQL
|
||||
*/
|
||||
private static final String CREATE_USER_ID_EQUALS = "create_user_id = ";
|
||||
|
||||
private final ConcurrentHashMap<String, DataScopeSqlConfig> dataScopeMethodMap = new ConcurrentHashMap<>();
|
||||
|
||||
@Resource
|
||||
@ -84,7 +89,6 @@ public class DataScopeSqlConfigService {
|
||||
|
||||
/**
|
||||
* 根据调用的方法获取,此方法的配置信息
|
||||
*
|
||||
*/
|
||||
public DataScopeSqlConfig getSqlConfig(String method) {
|
||||
return this.dataScopeMethodMap.get(method);
|
||||
@ -94,14 +98,23 @@ public class DataScopeSqlConfigService {
|
||||
* 组装需要拼接的sql
|
||||
*/
|
||||
public String getJoinSql(Map<String, Object> paramMap, DataScopeSqlConfig sqlConfigDTO) {
|
||||
DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType();
|
||||
String joinSql = sqlConfigDTO.getJoinSql();
|
||||
Long employeeId = SmartRequestUtil.getRequestUserId();
|
||||
if (employeeId == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType();
|
||||
DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
|
||||
|
||||
// 数据权限设置为仅本人可见时 直接返回 create_user_id = employeeId
|
||||
if (DataScopeViewTypeEnum.ME == viewTypeEnum) {
|
||||
return CREATE_USER_ID_EQUALS + employeeId;
|
||||
}
|
||||
|
||||
String joinSql = sqlConfigDTO.getJoinSql();
|
||||
|
||||
if (DataScopeWhereInTypeEnum.CUSTOM_STRATEGY == sqlConfigDTO.getDataScopeWhereInType()) {
|
||||
Class strategyClass = sqlConfigDTO.getJoinSqlImplClazz();
|
||||
Class<?> strategyClass = sqlConfigDTO.getJoinSqlImplClazz();
|
||||
if (strategyClass == null) {
|
||||
log.warn("data scope custom strategy class is null");
|
||||
return "";
|
||||
@ -111,11 +124,10 @@ public class DataScopeSqlConfigService {
|
||||
log.warn("data scope custom strategy class:{} ,bean is null", sqlConfigDTO.getJoinSqlImplClazz());
|
||||
return "";
|
||||
}
|
||||
DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
|
||||
return powerStrategy.getCondition(viewTypeEnum,paramMap, sqlConfigDTO);
|
||||
return powerStrategy.getCondition(viewTypeEnum, paramMap, sqlConfigDTO);
|
||||
}
|
||||
if (DataScopeWhereInTypeEnum.EMPLOYEE == sqlConfigDTO.getDataScopeWhereInType()) {
|
||||
List<Long> canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(dataScopeTypeEnum, employeeId);
|
||||
List<Long> canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(viewTypeEnum, employeeId);
|
||||
if (CollectionUtils.isEmpty(canViewEmployeeIds)) {
|
||||
return "";
|
||||
}
|
||||
@ -124,7 +136,7 @@ public class DataScopeSqlConfigService {
|
||||
return sql;
|
||||
}
|
||||
if (DataScopeWhereInTypeEnum.DEPARTMENT == sqlConfigDTO.getDataScopeWhereInType()) {
|
||||
List<Long> canViewDepartmentIds = dataScopeViewService.getCanViewDepartmentId(dataScopeTypeEnum, employeeId);
|
||||
List<Long> canViewDepartmentIds = dataScopeViewService.getCanViewDepartmentId(viewTypeEnum, employeeId);
|
||||
if (CollectionUtils.isEmpty(canViewDepartmentIds)) {
|
||||
return "";
|
||||
}
|
||||
|
@ -44,10 +44,9 @@ public class DataScopeViewService {
|
||||
private DepartmentService departmentService;
|
||||
|
||||
/**
|
||||
* 获取某人可以查看的所有人员信息
|
||||
* 获取某人可以查看的所有人员数据
|
||||
*/
|
||||
public List<Long> getCanViewEmployeeId(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) {
|
||||
DataScopeViewTypeEnum viewType = this.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
|
||||
public List<Long> getCanViewEmployeeId(DataScopeViewTypeEnum viewType, Long employeeId) {
|
||||
if (DataScopeViewTypeEnum.ME == viewType) {
|
||||
return this.getMeEmployeeIdList(employeeId);
|
||||
}
|
||||
@ -57,16 +56,17 @@ public class DataScopeViewService {
|
||||
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
|
||||
return this.getDepartmentAndSubEmployeeIdList(employeeId);
|
||||
}
|
||||
// 可以查看所有员工数据
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某人可以查看的所有部门信息
|
||||
* 获取某人可以查看的所有部门数据
|
||||
*/
|
||||
public List<Long> getCanViewDepartmentId(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) {
|
||||
DataScopeViewTypeEnum viewType = this.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
|
||||
public List<Long> getCanViewDepartmentId(DataScopeViewTypeEnum viewType, Long employeeId) {
|
||||
if (DataScopeViewTypeEnum.ME == viewType) {
|
||||
return this.getMeDepartmentIdList(employeeId);
|
||||
// 数据可见范围类型为本人时 不可以查看任何部门数据
|
||||
return Lists.newArrayList(0L);
|
||||
}
|
||||
if (DataScopeViewTypeEnum.DEPARTMENT == viewType) {
|
||||
return this.getMeDepartmentIdList(employeeId);
|
||||
@ -74,6 +74,7 @@ public class DataScopeViewService {
|
||||
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
|
||||
return this.getDepartmentAndSubIdList(employeeId);
|
||||
}
|
||||
// 可以查看所有部门数据
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@ -91,10 +92,16 @@ public class DataScopeViewService {
|
||||
* 根据员工id 获取各数据范围最大的可见范围 map<dataScopeType,viewType></>
|
||||
*/
|
||||
public DataScopeViewTypeEnum getEmployeeDataScopeViewType(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) {
|
||||
if (employeeId == null) {
|
||||
EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
|
||||
if (employeeEntity == null || employeeEntity.getEmployeeId() == null) {
|
||||
return DataScopeViewTypeEnum.ME;
|
||||
}
|
||||
|
||||
// 如果是超级管理员 则可查看全部
|
||||
if (employeeEntity.getAdministratorFlag()) {
|
||||
return DataScopeViewTypeEnum.ALL;
|
||||
}
|
||||
|
||||
List<Long> roleIdList = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId);
|
||||
//未设置角色 默认本人
|
||||
if (CollectionUtils.isEmpty(roleIdList)) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package net.lab1024.sa.admin.module.system.employee.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
|
||||
import net.lab1024.sa.admin.module.system.employee.domain.form.*;
|
||||
import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO;
|
||||
@ -57,11 +57,11 @@ public class EmployeeController {
|
||||
return employeeService.updateEmployee(employeeUpdateForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新登录人信息 @author 善逸")
|
||||
@PostMapping("/employee/update/login")
|
||||
public ResponseDTO<String> updateByLogin(@Valid @RequestBody EmployeeUpdateForm employeeUpdateForm) {
|
||||
employeeUpdateForm.setEmployeeId(SmartRequestUtil.getRequestUserId());
|
||||
return employeeService.updateEmployee(employeeUpdateForm);
|
||||
@Operation(summary = "更新员工个人中心信息 @author 善逸")
|
||||
@PostMapping("/employee/update/center")
|
||||
public ResponseDTO<String> updateCenter(@Valid @RequestBody EmployeeUpdateCenterForm updateCenterForm) {
|
||||
updateCenterForm.setEmployeeId(SmartRequestUtil.getRequestUserId());
|
||||
return employeeService.updateCenter(updateCenterForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新登录人头像 @author 善逸")
|
||||
@ -117,7 +117,7 @@ public class EmployeeController {
|
||||
@Operation(summary = "查询员工-根据部门id @author 卓大")
|
||||
@GetMapping("/employee/getAllEmployeeByDepartmentId/{departmentId}")
|
||||
public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(@PathVariable Long departmentId) {
|
||||
return employeeService.getAllEmployeeByDepartmentId(departmentId, Boolean.FALSE);
|
||||
return employeeService.getAllEmployeeByDepartmentId(departmentId);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询所有员工 @author 卓大")
|
||||
|
@ -34,31 +34,30 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
|
||||
*/
|
||||
List<EmployeeVO> selectEmployeeByDisabledAndDeleted(@Param("disabledFlag") Boolean disabledFlag, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
|
||||
/**
|
||||
* 更新单个
|
||||
*/
|
||||
void updateDisableFlag(@Param("employeeId") Long employeeId, @Param("disabledFlag") Boolean disabledFlag);
|
||||
|
||||
|
||||
/**
|
||||
* 通过登录名查询
|
||||
*/
|
||||
EmployeeEntity getByLoginName(@Param("loginName") String loginName,
|
||||
@Param("disabledFlag") Boolean disabledFlag);
|
||||
|
||||
EmployeeEntity getByLoginName(@Param("loginName") String loginName, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 通过姓名查询
|
||||
*/
|
||||
EmployeeEntity getByActualName(@Param("actualName") String actualName,
|
||||
@Param("disabledFlag") Boolean disabledFlag
|
||||
);
|
||||
EmployeeEntity getByActualName(@Param("actualName") String actualName, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 通过手机号查询
|
||||
*/
|
||||
EmployeeEntity getByPhone(@Param("phone") String phone, @Param("disabledFlag") Boolean disabledFlag);
|
||||
EmployeeEntity getByPhone(@Param("phone") String phone, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 通过邮箱账号查询
|
||||
*/
|
||||
EmployeeEntity getByEmail(@Param("email") String email, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 获取所有员工
|
||||
@ -67,7 +66,6 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
|
||||
|
||||
/**
|
||||
* 获取某个部门员工数
|
||||
*
|
||||
*/
|
||||
Integer countByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
@ -76,39 +74,35 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
|
||||
*/
|
||||
List<EmployeeVO> getEmployeeByIds(@Param("employeeIds") Collection<Long> employeeIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询单个员工信息
|
||||
*/
|
||||
EmployeeVO getEmployeeById(@Param("employeeId") Long employeeId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取某个部门的员工
|
||||
*/
|
||||
List<EmployeeEntity> selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag);
|
||||
|
||||
List<EmployeeEntity> selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 查询某些部门下用户名是xxx的员工
|
||||
*/
|
||||
List<EmployeeEntity> selectByActualName(@Param("departmentIdList") List<Long> departmentIdList, @Param("actualName") String actualName, @Param("disabledFlag") Boolean disabledFlag);
|
||||
|
||||
List<EmployeeEntity> selectByActualName(@Param("departmentIdList") List<Long> departmentIdList, @Param("actualName") String actualName, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 获取某批部门的员工Id
|
||||
*/
|
||||
List<Long> getEmployeeIdByDepartmentIdList(@Param("departmentIds") List<Long> departmentIds, @Param("disabledFlag") Boolean disabledFlag);
|
||||
List<Long> getEmployeeIdByDepartmentIdList(@Param("departmentIds") List<Long> departmentIds, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 获取所有
|
||||
*/
|
||||
List<Long> getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("disabledFlag") Boolean disabledFlag);
|
||||
List<Long> getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 获取某个部门的员工Id
|
||||
*/
|
||||
List<Long> getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag);
|
||||
List<Long> getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
|
||||
|
||||
/**
|
||||
* 员工重置密码
|
||||
|
@ -4,9 +4,9 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.base.common.enumeration.GenderEnum;
|
||||
import net.lab1024.sa.base.common.swagger.SchemaEnum;
|
||||
import net.lab1024.sa.base.common.util.SmartVerificationUtil;
|
||||
import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import net.lab1024.sa.base.common.util.SmartVerificationUtil;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
@ -51,17 +51,19 @@ public class EmployeeAddForm {
|
||||
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
@Schema(description = "邮箱账号")
|
||||
@NotNull(message = "邮箱账号不能为空")
|
||||
@Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱账号格式不正确")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "职务级别ID")
|
||||
private Long positionId;
|
||||
|
||||
@Schema(description = "角色列表")
|
||||
private List<Long> roleIdList;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Length(max = 30, message = "备注最多200字符")
|
||||
@Length(max = 200, message = "备注最多200字符")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "职务级别ID")
|
||||
private Long positionId;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,58 @@
|
||||
package net.lab1024.sa.admin.module.system.employee.domain.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.lab1024.sa.base.common.enumeration.GenderEnum;
|
||||
import net.lab1024.sa.base.common.swagger.SchemaEnum;
|
||||
import net.lab1024.sa.base.common.util.SmartVerificationUtil;
|
||||
import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
|
||||
/**
|
||||
* 更新员工个人中心信息
|
||||
*
|
||||
* @Author 1024创新实验室: 开云
|
||||
* @Date 2021-12-20 21:06:49
|
||||
* @Wechat zhuoda1024
|
||||
* @Email lab1024@163.com
|
||||
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeUpdateCenterForm {
|
||||
|
||||
@Schema(hidden = true)
|
||||
private Long employeeId;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
@NotNull(message = "姓名不能为空")
|
||||
@Length(max = 30, message = "姓名最多30字符")
|
||||
private String actualName;
|
||||
|
||||
@SchemaEnum(GenderEnum.class)
|
||||
@CheckEnum(value = GenderEnum.class, message = "性别错误")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
@NotNull(message = "手机号不能为空")
|
||||
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "邮箱账号")
|
||||
@NotNull(message = "邮箱账号不能为空")
|
||||
@Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱账号格式不正确")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "职务级别ID")
|
||||
private Long positionId;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Length(max = 200, message = "备注最多200字符")
|
||||
private String remark;
|
||||
}
|
@ -168,19 +168,14 @@ public class EmployeeService {
|
||||
return ResponseDTO.userErrorParam("部门不存在");
|
||||
}
|
||||
|
||||
|
||||
EmployeeEntity existEntity = employeeDao.getByLoginName(employeeUpdateForm.getLoginName(), null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("登录名重复");
|
||||
// 检查唯一性
|
||||
ResponseDTO<String> checkResponse = checkUniqueness(employeeId, employeeUpdateForm.getLoginName(), employeeUpdateForm.getPhone(), employeeUpdateForm.getEmail());
|
||||
if (!checkResponse.getOk()) {
|
||||
return checkResponse;
|
||||
}
|
||||
|
||||
existEntity = employeeDao.getByPhone(employeeUpdateForm.getPhone(), null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("手机号已存在");
|
||||
}
|
||||
|
||||
// 不更新密码
|
||||
EmployeeEntity entity = SmartBeanUtil.copy(employeeUpdateForm, EmployeeEntity.class);
|
||||
// 不更新密码
|
||||
entity.setLoginPwd(null);
|
||||
|
||||
// 更新数据
|
||||
@ -192,6 +187,57 @@ public class EmployeeService {
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新员工个人中心信息
|
||||
*/
|
||||
public ResponseDTO<String> updateCenter(EmployeeUpdateCenterForm updateCenterForm) {
|
||||
|
||||
Long employeeId = updateCenterForm.getEmployeeId();
|
||||
EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
|
||||
if (null == employeeEntity) {
|
||||
return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
|
||||
}
|
||||
|
||||
// 检查唯一性 登录账号不能修改则不需要检查
|
||||
ResponseDTO<String> checkResponse = checkUniqueness(employeeId, "", updateCenterForm.getPhone(), updateCenterForm.getEmail());
|
||||
if (!checkResponse.getOk()) {
|
||||
return checkResponse;
|
||||
}
|
||||
|
||||
EmployeeEntity employee = SmartBeanUtil.copy(updateCenterForm, EmployeeEntity.class);
|
||||
// 不更新密码
|
||||
employee.setLoginPwd(null);
|
||||
|
||||
// 更新数据
|
||||
employeeDao.updateById(employee);
|
||||
|
||||
// 清除员工缓存
|
||||
loginService.clearLoginEmployeeCache(employeeId);
|
||||
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查唯一性
|
||||
*/
|
||||
private ResponseDTO<String> checkUniqueness(Long employeeId, String loginName, String phone, String email) {
|
||||
EmployeeEntity existEntity = employeeDao.getByLoginName(loginName, null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("登录名重复");
|
||||
}
|
||||
|
||||
existEntity = employeeDao.getByPhone(phone, null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("手机号已存在");
|
||||
}
|
||||
|
||||
existEntity = employeeDao.getByEmail(email, null);
|
||||
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
|
||||
return ResponseDTO.userErrorParam("邮箱账号已存在");
|
||||
}
|
||||
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新登录人头像
|
||||
@ -337,11 +383,8 @@ public class EmployeeService {
|
||||
/**
|
||||
* 获取某个部门的员工信息
|
||||
*/
|
||||
public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(Long departmentId, Boolean disabledFlag) {
|
||||
List<EmployeeEntity> employeeEntityList = employeeDao.selectByDepartmentId(departmentId, disabledFlag);
|
||||
if (disabledFlag != null) {
|
||||
employeeEntityList = employeeEntityList.stream().filter(e -> e.getDisabledFlag().equals(disabledFlag)).collect(Collectors.toList());
|
||||
}
|
||||
public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(Long departmentId) {
|
||||
List<EmployeeEntity> employeeEntityList = employeeDao.selectByDepartmentId(departmentId, Boolean.FALSE);
|
||||
|
||||
if (CollectionUtils.isEmpty(employeeEntityList)) {
|
||||
return ResponseDTO.ok(Collections.emptyList());
|
||||
@ -382,7 +425,7 @@ public class EmployeeService {
|
||||
* 根据登录名获取员工
|
||||
*/
|
||||
public EmployeeEntity getByLoginName(String loginName) {
|
||||
return employeeDao.getByLoginName(loginName, null);
|
||||
return employeeDao.getByLoginName(loginName, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -46,6 +46,12 @@ public class RequestEmployee implements RequestUser {
|
||||
@Schema(description = "部门名称")
|
||||
private String departmentName;
|
||||
|
||||
@Schema(description = "职务级别ID")
|
||||
private Long positionId;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "是否禁用")
|
||||
private Boolean disabledFlag;
|
||||
|
||||
|
@ -2,6 +2,28 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao">
|
||||
|
||||
<!-- 查询结果列 -->
|
||||
<sql id="base_columns">
|
||||
t_notice.notice_id,
|
||||
t_notice.notice_type_id,
|
||||
t_notice.title,
|
||||
t_notice.all_visible_flag,
|
||||
t_notice.scheduled_publish_flag,
|
||||
t_notice.publish_time,
|
||||
t_notice.content_text,
|
||||
t_notice.content_html,
|
||||
t_notice.attachment,
|
||||
t_notice.page_view_count,
|
||||
t_notice.user_view_count,
|
||||
t_notice.source,
|
||||
t_notice.author,
|
||||
t_notice.document_number,
|
||||
t_notice.deleted_flag,
|
||||
t_notice.create_user_id,
|
||||
t_notice.update_time,
|
||||
t_notice.create_time
|
||||
</sql>
|
||||
|
||||
<!-- ================================== 可见范围相关 ================================== -->
|
||||
|
||||
<insert id="insertVisibleRange">
|
||||
@ -35,32 +57,30 @@
|
||||
<!-- 后管分页查询资讯 -->
|
||||
<select id="query" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO">
|
||||
SELECT
|
||||
t_notice.* ,
|
||||
<include refid="base_columns"/>,
|
||||
t_notice_type.notice_type_name as noticeTypeName,
|
||||
t_employee.actual_name as createUserName,
|
||||
t_department.name as departmentName
|
||||
t_employee.actual_name as createUserName
|
||||
FROM t_notice
|
||||
left join t_notice_type on t_notice_type.notice_type_id = t_notice.notice_type_id
|
||||
left join t_employee on t_notice.create_user_id = t_employee.employee_id
|
||||
left join t_department on t_employee.department_id = t_department.department_id
|
||||
LEFT JOIN t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
|
||||
LEFT JOIN t_employee on t_notice.create_user_id = t_employee.employee_id
|
||||
<where>
|
||||
<if test="query.noticeTypeId != null">
|
||||
AND t_notice_type.notice_type_id = #{query.noticeTypeId}
|
||||
</if>
|
||||
<if test="query.keywords != null and query.keywords !=''">
|
||||
<if test="query.keywords != null and query.keywords != ''">
|
||||
AND ( INSTR(t_notice.title,#{query.keywords})
|
||||
OR INSTR(t_notice.author,#{query.keywords})
|
||||
OR INSTR(t_notice.source,#{query.keywords})
|
||||
)
|
||||
</if>
|
||||
<if test="query.documentNumber != null and query.documentNumber !=''">
|
||||
<if test="query.documentNumber != null and query.documentNumber != ''">
|
||||
AND INSTR(t_notice.document_number, #{query.documentNumber})
|
||||
</if>
|
||||
<if test="query.createUserId != null">
|
||||
AND t_notice.create_user_id = #{createUserId}
|
||||
<if test="query.createUserName != null and query.createUserName != ''">
|
||||
AND t_employee.actual_name = #{query.createUserName}
|
||||
</if>
|
||||
<if test="query.deletedFlag != null">
|
||||
and t_notice.deleted_flag = #{query.deletedFlag}
|
||||
AND t_notice.deleted_flag = #{query.deletedFlag}
|
||||
</if>
|
||||
<if test="query.createTimeBegin != null">
|
||||
AND DATE_FORMAT(t_notice.create_time, '%Y-%m-%d') >= DATE_FORMAT(#{query.createTimeBegin},
|
||||
@ -84,10 +104,9 @@
|
||||
</select>
|
||||
|
||||
<!-- ================================== 通知公告【员工查看】相关 ================================== -->
|
||||
<select id="queryEmployeeNotice"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
<select id="queryEmployeeNotice" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
select
|
||||
t_notice.*,
|
||||
<include refid="base_columns"/>,
|
||||
t_notice_type.notice_type_name,
|
||||
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
|
||||
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
|
||||
@ -142,12 +161,11 @@
|
||||
</where>
|
||||
order by t_notice.publish_time desc
|
||||
</select>
|
||||
<select id="queryEmployeeNotViewNotice"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
<select id="queryEmployeeNotViewNotice" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
|
||||
select * from
|
||||
(
|
||||
select
|
||||
t_notice.*,
|
||||
<include refid="base_columns"/>,
|
||||
t_notice_type.notice_type_name,
|
||||
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
|
||||
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
|
||||
@ -198,8 +216,7 @@
|
||||
) t where viewFlag = 0
|
||||
order by t.publish_time desc
|
||||
</select>
|
||||
<select id="queryNoticeViewRecordList"
|
||||
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
|
||||
<select id="queryNoticeViewRecordList" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
|
||||
select t_notice_view_record.*,
|
||||
t_employee.actual_name as employeeName,
|
||||
t_department.name as departmentName
|
||||
|
@ -33,21 +33,19 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateDisableFlag">
|
||||
UPDATE t_employee
|
||||
SET disabled_flag = #{disabledFlag}
|
||||
WHERE employee_id = #{employeeId}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getByLoginName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
login_name = #{loginName}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -57,24 +55,33 @@
|
||||
FROM t_employee
|
||||
<where>
|
||||
actual_name = #{actualName}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByPhone" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
phone = #{phone}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getByEmail" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
email = #{email}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT *
|
||||
@ -88,22 +95,19 @@
|
||||
department_id = #{departmentId} AND deleted_flag = #{deletedFlag}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByDepartmentId"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
<select id="selectByDepartmentId" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT *
|
||||
FROM t_employee
|
||||
<where>
|
||||
department_id = #{departmentId}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectByActualName"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
<select id="selectByActualName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
|
||||
SELECT * FROM t_employee
|
||||
<where>
|
||||
actual_name = #{actualName}
|
||||
@ -111,8 +115,8 @@
|
||||
<foreach collection="departmentIdList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -125,20 +129,19 @@
|
||||
<foreach collection="departmentIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeId" resultType="java.lang.Long">
|
||||
SELECT employee_id
|
||||
FROM t_employee
|
||||
<where>
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -148,8 +151,8 @@
|
||||
FROM t_employee
|
||||
<where>
|
||||
department_id = #{departmentId}
|
||||
<if test="disabledFlag != null">
|
||||
AND disabled_flag = #{disabledFlag}
|
||||
<if test="deletedFlag != null">
|
||||
AND deleted_flag = #{deletedFlag}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
@ -164,7 +167,6 @@
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeById" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
@ -173,8 +175,7 @@
|
||||
where t_employee.employee_id = #{employeeId}
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeByDisabledAndDeleted"
|
||||
resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
<select id="selectEmployeeByDisabledAndDeleted" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
|
||||
SELECT
|
||||
t_employee.*,
|
||||
t_department.name AS departmentName
|
||||
@ -196,5 +197,4 @@
|
||||
WHERE employee_id = #{employeeId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
@ -40,7 +40,7 @@ public class MapperVariableService extends CodeGenerateBaseVariableService {
|
||||
List<String> columnNameList = queryField.getColumnNameList();
|
||||
if (columnNameList.size() == 1) {
|
||||
// AND INSTR(t_notice.title,#{query.keywords})
|
||||
stringBuilder.append(" AND INSTR(")
|
||||
stringBuilder.append("AND INSTR(")
|
||||
.append(form.getTableName()).append(".").append(queryField.getColumnNameList().get(0))
|
||||
.append(",#{queryForm.")
|
||||
.append(queryField.getFieldName())
|
||||
@ -48,21 +48,21 @@ public class MapperVariableService extends CodeGenerateBaseVariableService {
|
||||
} else {
|
||||
for (int i = 0; i < columnNameList.size(); i++) {
|
||||
if (i == 0) {
|
||||
stringBuilder.append("AND ( INSTR(")
|
||||
stringBuilder.append("AND (\n INSTR(")
|
||||
.append(form.getTableName()).append(".").append(queryField.getColumnNameList().get(i))
|
||||
.append(",#{queryForm.")
|
||||
.append(queryField.getFieldName())
|
||||
.append("})");
|
||||
} else {
|
||||
// OR INSTR(t_notice.author,#{query.keywords})
|
||||
stringBuilder.append("\n OR INSTR(")
|
||||
stringBuilder.append("\n OR INSTR(")
|
||||
.append(form.getTableName()).append(".").append(queryField.getColumnNameList().get(i))
|
||||
.append(",#{queryForm.")
|
||||
.append(queryField.getFieldName())
|
||||
.append("})");
|
||||
}
|
||||
}
|
||||
stringBuilder.append("\n )");
|
||||
stringBuilder.append("\n )");
|
||||
}
|
||||
fieldMap.put("likeStr", stringBuilder.toString());
|
||||
} else if (CodeQueryFieldQueryTypeEnum.DICT.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
|
@ -36,10 +36,10 @@ export const employeeApi = {
|
||||
return postRequest('/employee/update', params);
|
||||
},
|
||||
/**
|
||||
* 更新登录人信息
|
||||
* 更新员工个人中心信息
|
||||
*/
|
||||
updateByLogin: (params) => {
|
||||
return postRequest('/employee/update/login', params);
|
||||
updateCenter: (params) => {
|
||||
return postRequest('/employee/update/center', params);
|
||||
},
|
||||
/**
|
||||
* 更新登录人头像
|
||||
@ -77,25 +77,22 @@ export const employeeApi = {
|
||||
updateEmployeePassword: (param) => {
|
||||
return postEncryptRequest('/employee/update/password', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取密码复杂度
|
||||
*/
|
||||
getPasswordComplexityEnabled: () => {
|
||||
return getRequest('/employee/getPasswordComplexityEnabled');
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新员工禁用状态
|
||||
*/
|
||||
updateDisabled: (employeeId) => {
|
||||
return getRequest(`/employee/update/disabled/${employeeId}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询员工-根据部门id
|
||||
*/
|
||||
queryEmployeeByDeptId: (departmentId) => {
|
||||
return getRequest(`/employee/query/dept/${departmentId}`);
|
||||
return getRequest(`/employee/getAllEmployeeByDepartmentId/${departmentId}`);
|
||||
},
|
||||
};
|
||||
|
@ -9,7 +9,11 @@
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" :options="optionList" @change="handleChange" />
|
||||
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" @change="handleChange" :disabled="disabled">
|
||||
<a-checkbox v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -22,19 +26,32 @@
|
||||
type: String,
|
||||
default: '200px',
|
||||
},
|
||||
// 禁用整个多选框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
// ------------ 枚举数据 加载和构建 ------------
|
||||
|
||||
const optionList = ref([]);
|
||||
function buildOptionList() {
|
||||
const valueDescList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
const valueList = smartEnumPlugin.getValueDescList(props.enumName);
|
||||
optionList.value = valueList.map((e) => Object.assign({}, { value: e.value, label: e.desc }));
|
||||
}
|
||||
|
||||
onMounted(buildOptionList);
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
// ------------ 数据选中 事件及其相关 ------------
|
||||
|
||||
@ -43,11 +60,14 @@
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除这些选项
|
||||
selectValue.value = newValue.filter((item) => !props.hiddenOption.includes(item) && !props.disabledOption.includes(item));
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function handleChange(value) {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
|
@ -10,15 +10,15 @@
|
||||
-->
|
||||
<template>
|
||||
<template v-if="isButton">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid">
|
||||
<a-radio-button v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid" :disabled="disabled">
|
||||
<a-radio-button v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange">
|
||||
<a-radio v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" :disabled="disabled">
|
||||
<a-radio v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
@ -26,7 +26,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { ref, watch, onMounted, getCurrentInstance } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
enumName: String,
|
||||
@ -43,19 +43,44 @@
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 禁用整个单选框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
const valueDescList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除该选项
|
||||
selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function handleChange(e) {
|
||||
emit('update:value', e.target.value);
|
||||
emit('change', e.target.value);
|
||||
|
@ -19,18 +19,18 @@
|
||||
@change="handleChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-select-option v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { ref, watch, onMounted, getCurrentInstance } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
enumName: String,
|
||||
value: [Number,String],
|
||||
value: [Number, String],
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%',
|
||||
@ -43,23 +43,44 @@
|
||||
type: String,
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用整个下拉选择框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
const valueDescList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除该选项
|
||||
selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function handleChange(value) {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
|
@ -18,6 +18,7 @@
|
||||
:allowClear="true"
|
||||
:size="size"
|
||||
@change="onChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in dictKeyCodeList" :key="item.keyCode" :value="item.keyCode">
|
||||
{{ item.keyName }}
|
||||
@ -27,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch, defineExpose } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
defineExpose({
|
||||
@ -49,7 +50,7 @@
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用标识
|
||||
disabledFlag: {
|
||||
disabled: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
|
@ -20,7 +20,12 @@
|
||||
@change="onChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in dictValueList" :key="item.valueCode" :value="item.valueCode">
|
||||
<a-select-option
|
||||
v-for="item in dictValueList"
|
||||
:key="item.valueCode"
|
||||
:value="item.valueCode"
|
||||
:disabled="disabledOption.includes(item.valueCode)"
|
||||
>
|
||||
{{ item.valueName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@ -28,7 +33,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
const props = defineProps({
|
||||
@ -50,10 +55,21 @@
|
||||
type: String,
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用整个下拉选择框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项字典值编码
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项字典值编码
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
// -------------------------- 查询 字典数据 --------------------------
|
||||
@ -61,7 +77,7 @@
|
||||
const dictValueList = ref([]);
|
||||
async function queryDict() {
|
||||
let res = await dictApi.valueList(props.keyCode);
|
||||
dictValueList.value = res.data;
|
||||
dictValueList.value = res.data.filter((item) => !props.hiddenOption.includes(item.valueCode));
|
||||
}
|
||||
|
||||
onMounted(queryDict);
|
||||
@ -69,26 +85,24 @@
|
||||
// -------------------------- 选中 相关、事件 --------------------------
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(value) => {
|
||||
selectValue.value = value;
|
||||
}
|
||||
(newValue) => {
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除这些选项
|
||||
if (Array.isArray(newValue)) {
|
||||
selectValue.value = newValue.filter((item) => !props.disabledOption.includes(item) && !props.hiddenOption.includes(item));
|
||||
} else {
|
||||
selectValue.value = props.hiddenOption.includes(newValue) || props.disabledOption.includes(newValue) ? undefined : newValue;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function onChange(value) {
|
||||
if (!value) {
|
||||
emit('update:value', []);
|
||||
emit('change', []);
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
} else {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
}
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
}
|
||||
</script>
|
||||
|
@ -68,7 +68,15 @@
|
||||
// 原始表格列数据(复制一份最原始的columns集合,以供后续各个地方使用)
|
||||
let originalColumn = _.cloneDeep(props.modelValue);
|
||||
|
||||
onMounted(buildUserTableColumns);
|
||||
onMounted(() => {
|
||||
buildUserTableColumns();
|
||||
// 监听全屏事件 解决按下 ESC 退出全屏 fullScreenFlag 未改变导致下次第一下点击全屏无效的问题
|
||||
addEventListener('fullscreenchange', (event) => {
|
||||
if (document.fullscreenElement === null) {
|
||||
fullScreenFlag.value = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//构建用户的数据列
|
||||
async function buildUserTableColumns() {
|
||||
|
@ -9,46 +9,70 @@
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<a-modal :width="700" :open="visible" title="设置列" :destroyOnClose="true" :closable="false">
|
||||
<a-alert type="info" show-icon class="smart-margin-bottom10">
|
||||
<template #icon><smile-outlined /></template>
|
||||
<template #message> 可以通过拖拽行直接修改顺序哦;( <pushpin-outlined />为固定列,不可拖拽 )</template>
|
||||
</a-alert>
|
||||
<a-table
|
||||
id="smartTableColumnModalTable"
|
||||
rowKey="columnKey"
|
||||
row-class-name="column-row"
|
||||
:columns="tableColumns"
|
||||
:dataSource="tableData"
|
||||
:rowSelection="{ checkStrictly: false, selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
size="small"
|
||||
bordered
|
||||
>
|
||||
<template #bodyCell="{ text, record, index, column }">
|
||||
<template v-if="column.dataIndex === 'title'">
|
||||
<a-button type="text" :class="record.fixed ? '' : 'handle'" size="small" style="width: 100%; text-align: left">
|
||||
<template #icon v-if="!record.fixed"> <drag-outlined /> </template>
|
||||
<template #icon v-if="record.fixed"> <pushpin-outlined /> </template>
|
||||
{{ text }}
|
||||
</a-button>
|
||||
<a-modal :width="800" :open="visible" title="设置列" :destroyOnClose="true" :closable="false">
|
||||
<div v-if="!tableId">
|
||||
<a-alert type="error" show-icon class="smart-margin-bottom10">
|
||||
<template #message> 您尚未设置 TableOperator 组件的 tableId</template>
|
||||
</a-alert>
|
||||
<a-alert type="error" class="smart-margin-bottom10">
|
||||
<template #message>
|
||||
1. 请在 src\constants\support\table-id-const.js 中配置 tableId 常量
|
||||
<br />
|
||||
<br />
|
||||
2. 在自己的业务表格页面组件中使用如下:
|
||||
<br />
|
||||
导入: import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
<br />
|
||||
使用: {{ '<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.XXX" :refresh="queryData" />' }}
|
||||
<br />
|
||||
<br />
|
||||
3. 具体用法可参考员工管理
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'width'">
|
||||
<a-input-number v-model:value="record.width" style="width: 90px; margin-left: 10px; margin-right: 3px" size="small" />px
|
||||
</a-alert>
|
||||
</div>
|
||||
<div v-else>
|
||||
<a-alert type="info" show-icon class="smart-margin-bottom10">
|
||||
<template #icon><smile-outlined /></template>
|
||||
<template #message> 可以通过拖拽行直接修改顺序哦;( <pushpin-outlined />为固定列,不可拖拽 )</template>
|
||||
</a-alert>
|
||||
<a-table
|
||||
id="smartTableColumnModalTable"
|
||||
rowKey="columnKey"
|
||||
row-class-name="column-row"
|
||||
:columns="tableColumns"
|
||||
:dataSource="tableData"
|
||||
:rowSelection="{ checkStrictly: false, selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
size="small"
|
||||
bordered
|
||||
>
|
||||
<template #bodyCell="{ text, record, index, column }">
|
||||
<template v-if="column.dataIndex === 'title'">
|
||||
<a-button type="text" :class="record.fixed ? '' : 'handle'" size="small" style="width: 100%; text-align: left">
|
||||
<template #icon>
|
||||
<drag-outlined v-if="!record.fixed" />
|
||||
<pushpin-outlined v-else />
|
||||
</template>
|
||||
{{ text }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'width'">
|
||||
<a-input-number v-model:value="record.width" style="width: 90px; margin-left: 10px; margin-right: 3px" size="small" />px
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operate'">
|
||||
<div class="smart-table-operate" v-if="!record.fixed">
|
||||
<a-button @click="up(index)" v-show="index > 0" type="link" class="handle" size="small" style="margin-right: 12px"> 上移 </a-button>
|
||||
<a-button @click="down(index)" type="link" class="handle" size="small" v-show="index !== tableData.length - 1"> 下移</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operate'">
|
||||
<div class="smart-table-operate" v-if="!record.fixed">
|
||||
<a-button @click="up(index)" v-show="index > 0" type="link" class="handle" size="small" style="margin-right: 12px"> 上移 </a-button>
|
||||
<a-button @click="down(index)" type="link" class="handle" size="small" v-show="index !== tableData.length - 1"> 下移</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<a-button key="back" @click="hide">取消</a-button>
|
||||
<a-button key="submit" type="primary" :loading="submitLoading" @click="save">保存</a-button>
|
||||
<a-button key="back" :loading="submitLoading" @click="reset" danger style="margin-left: 20px">恢复默认</a-button>
|
||||
<a-button v-if="tableId" key="submit" type="primary" :loading="submitLoading" @click="save">保存</a-button>
|
||||
<a-button v-if="tableId" key="back" :loading="submitLoading" @click="reset" danger style="margin-left: 20px">恢复默认</a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
</template>
|
||||
@ -67,7 +91,7 @@
|
||||
defineExpose({ show });
|
||||
|
||||
// ---------------- 显示 / 隐藏 --------------------
|
||||
let tableId = 1;
|
||||
let tableId = null;
|
||||
const visible = ref(false);
|
||||
//显示
|
||||
function show(columns, showTableId) {
|
||||
@ -83,6 +107,9 @@
|
||||
|
||||
//获取用户的列数据
|
||||
async function getUserTableColumns(tableId, columns) {
|
||||
if (!tableId) {
|
||||
return;
|
||||
}
|
||||
SmartLoading.show();
|
||||
let userTableColumnArray = [];
|
||||
try {
|
||||
|
@ -21,7 +21,7 @@ export function privilegeDirective(el, binding) {
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
// 如果有权限,删除节点
|
||||
// 如果没有权限,删除节点
|
||||
if (!_.some(userPointsList, ['webPerms', binding.value])) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import _ from 'lodash';
|
||||
|
||||
const privilege = (value) => {
|
||||
// 超级管理员
|
||||
@ -19,7 +20,7 @@ const privilege = (value) => {
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
return userPointsList && userPointsList.includes(value);
|
||||
return _.some(userPointsList, ['apiPerms', value]);
|
||||
};
|
||||
|
||||
export default {
|
||||
|
@ -73,7 +73,7 @@ export const useUserStore = defineStore({
|
||||
}
|
||||
return localRead(localKey.USER_TOKEN);
|
||||
},
|
||||
getNeedUpdatePwdFlag(state){
|
||||
getNeedUpdatePwdFlag(state) {
|
||||
return state.needUpdatePwdFlag;
|
||||
},
|
||||
//是否初始化了 路由
|
||||
@ -206,7 +206,7 @@ export const useUserStore = defineStore({
|
||||
// @ts-ignore
|
||||
menuTitle: route.meta.title,
|
||||
menuQuery: route.query,
|
||||
menuIcon:route.meta?.icon,
|
||||
menuIcon: route.meta?.icon,
|
||||
// @ts-ignore
|
||||
fromMenuName: from.name,
|
||||
fromMenuQuery: from.query,
|
||||
|
@ -11,17 +11,17 @@
|
||||
<a-card style="margin-bottom: 15px" size="small">
|
||||
<a-descriptions :title="noticeDetail.title" :column="4" size="small">
|
||||
<template #extra>
|
||||
<a-button v-if="!noticeDetail.publishFlag" type="primary" size="small" @click="onEdit">编辑</a-button>
|
||||
<a-button type="primary" size="small" @click="onEdit">编辑</a-button>
|
||||
</template>
|
||||
<a-descriptions-item label="分类">{{ noticeDetail.noticeTypeName }}</a-descriptions-item>
|
||||
<a-descriptions-item label="文号">{{ noticeDetail.documentNumber }}</a-descriptions-item>
|
||||
<a-descriptions-item label="文号">{{ noticeDetail.documentNumber ? noticeDetail.documentNumber : '无' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="来源">{{ noticeDetail.source }}</a-descriptions-item>
|
||||
<a-descriptions-item label="作者">{{ noticeDetail.author }}</a-descriptions-item>
|
||||
<a-descriptions-item label="页面浏览量">{{ noticeDetail.pageViewCount }}</a-descriptions-item>
|
||||
<a-descriptions-item label="用户浏览量">{{ noticeDetail.userViewCount }}</a-descriptions-item>
|
||||
<a-descriptions-item label="创建时间">{{ noticeDetail.createTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="发布时间">{{ noticeDetail.publishTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="定时发布">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="发布状态">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="删除状态">{{ noticeDetail.deletedFlag ? '已删除' : '未删除' }}</a-descriptions-item>
|
||||
<a-descriptions-item v-if="!$lodash.isEmpty(noticeDetail.attachment)" label="附件">
|
||||
<div class="file-list">
|
||||
|
@ -35,7 +35,7 @@
|
||||
</a-button-group>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row"> </a-row>
|
||||
<a-row class="smart-query-form-row" />
|
||||
</a-form>
|
||||
|
||||
<a-card size="small" :bordered="false">
|
||||
|
@ -28,7 +28,7 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="创建人" class="smart-query-form-item">
|
||||
<a-input style="width: 100px" v-model:value="queryForm.createUserId" placeholder="创建人" />
|
||||
<a-input style="width: 100px" v-model:value="queryForm.createUserName" placeholder="创建人" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="是否删除" class="smart-query-form-item">
|
||||
@ -91,6 +91,9 @@
|
||||
<template v-if="column.dataIndex === 'title'">
|
||||
<a @click="toDetail(record.noticeId)">{{ text }}</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'documentNumber'">
|
||||
{{ text ? text : '无' }}
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'allVisibleFlag'"> {{ text ? '全部可见' : '部分可见' }} </template>
|
||||
<template v-else-if="column.dataIndex === 'publishFlag'">
|
||||
{{ text ? '已发布' : '待发布' }}
|
||||
@ -145,7 +148,7 @@
|
||||
noticeTypeId: undefined, //分类
|
||||
keywords: '', //标题、作者、来源
|
||||
documentNumber: '', //文号
|
||||
createUserId: undefined, //创建人
|
||||
createUserName: undefined, //创建人
|
||||
deletedFlag: undefined, //删除标识
|
||||
createTimeBegin: null, //创建-开始时间
|
||||
createTimeEnd: null, //创建-截止时间
|
||||
@ -195,7 +198,7 @@
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '发布',
|
||||
title: '发布状态',
|
||||
dataIndex: 'publishFlag',
|
||||
width: 80,
|
||||
},
|
||||
|
@ -199,7 +199,7 @@
|
||||
function setData(tableColumns, config) {
|
||||
//------------- 更新基础信息 -----------------
|
||||
if (config.insertAndUpdate) {
|
||||
formData.isSupportInsertAndUpdate = config.insertAndUpdate.isSupportInsertAndUpdate ? config.insertAndUpdate.isSupportInsertAndUpdate : true;
|
||||
formData.isSupportInsertAndUpdate = config.insertAndUpdate.isSupportInsertAndUpdate;
|
||||
formData.pageType = config.insertAndUpdate.pageType;
|
||||
formData.width = config.insertAndUpdate.width;
|
||||
formData.countPerLine = config.insertAndUpdate.countPerLine;
|
||||
|
@ -107,7 +107,8 @@
|
||||
<template v-if="column.dataIndex === 'enabledFlag'">
|
||||
<a-switch
|
||||
v-model:checked="record.enabledFlag"
|
||||
checked-children="已启用" un-checked-children="已禁用"
|
||||
checked-children="已启用"
|
||||
un-checked-children="已禁用"
|
||||
@change="(checked) => handleEnabledUpdate(checked, record)"
|
||||
:loading="record.enabledLoading"
|
||||
/>
|
||||
@ -117,31 +118,31 @@
|
||||
<a-button v-privilege="'support:job:update'" @click="openUpdateModal(record)" type="link">编辑</a-button>
|
||||
<a-button v-privilege="'support:job:execute'" type="link" @click="openExecuteModal(record)">执行</a-button>
|
||||
<a-button v-privilege="'support:job:log:query'" @click="openJobLogModal(record.jobId, record.jobName)" type="link">记录</a-button>
|
||||
<a-button danger v-privilege="'support:job:log:delete'" @click="confirmDelete(record.jobId, record.jobName)" type="link">删除</a-button>
|
||||
<a-button danger v-privilege="'support:job:log:delete'" @click="confirmDelete(record.jobId, record.jobName)" type="link"
|
||||
>删除</a-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="queryJobList"
|
||||
@showSizeChange="queryJobList"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="queryJobList"
|
||||
@showSizeChange="queryJobList"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="已删除任务"><DeletedJobList /></a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
|
||||
</a-card>
|
||||
|
||||
<!-- 表单操作 -->
|
||||
@ -152,7 +153,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {message, Modal} from 'ant-design-vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { jobApi } from '/@/api/support/job-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
@ -163,7 +164,7 @@
|
||||
import { TRIGGER_TYPE_ENUM } from '/@/constants/support/job-const.js';
|
||||
import JobFormModal from './components/job-form-modal.vue';
|
||||
import JobLogListModal from './components/job-log-list-modal.vue';
|
||||
import {SmartLoading} from "/@/components/framework/smart-loading/index.js";
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading/index.js';
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
@ -241,6 +242,8 @@
|
||||
},
|
||||
]);
|
||||
|
||||
const activeKey = ref('1');
|
||||
|
||||
// ---------------- 查询数据 -----------------------
|
||||
|
||||
const queryFormState = {
|
||||
@ -333,7 +336,7 @@
|
||||
|
||||
// ------------------------------------ 删除操作 -------------------------------------
|
||||
|
||||
function confirmDelete(jobId, jobName){
|
||||
function confirmDelete(jobId, jobName) {
|
||||
Modal.confirm({
|
||||
title: '警告',
|
||||
content: `确定要删除【${jobName}】任务吗?`,
|
||||
@ -347,15 +350,15 @@
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteJob(jobId){
|
||||
try{
|
||||
async function deleteJob(jobId) {
|
||||
try {
|
||||
SmartLoading.show();
|
||||
await jobApi.deleteJob(jobId);
|
||||
message.success('删除成功!');
|
||||
queryJobList();
|
||||
}catch (e){
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
}finally {
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,16 @@
|
||||
<a-form-item label="登录账号" name="loginName">
|
||||
<a-input class="form-item" v-model:value.trim="form.loginName" placeholder="请输入登录账号" disabled />
|
||||
</a-form-item>
|
||||
<a-form-item label="部门" name="departmentId">
|
||||
<DepartmentTreeSelect
|
||||
class="form-item"
|
||||
ref="departmentTreeSelect"
|
||||
width="100%"
|
||||
:init="false"
|
||||
v-model:value="form.departmentId"
|
||||
disabled
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="员工名称" name="actualName">
|
||||
<a-input class="form-item" v-model:value.trim="form.actualName" placeholder="请输入员工名称" />
|
||||
</a-form-item>
|
||||
@ -20,8 +30,11 @@
|
||||
<a-form-item label="手机号码" name="phone">
|
||||
<a-input class="form-item" v-model:value.trim="form.phone" placeholder="请输入手机号码" />
|
||||
</a-form-item>
|
||||
<a-form-item label="部门" name="departmentId">
|
||||
<DepartmentTreeSelect class="form-item" ref="departmentTreeSelect" width="100%" :init="false" v-model:value="form.departmentId" />
|
||||
<a-form-item label="邮箱" name="email">
|
||||
<a-input v-model:value.trim="form.email" placeholder="请输入邮箱" />
|
||||
</a-form-item>
|
||||
<a-form-item label="职务" name="positionId">
|
||||
<PositionSelect v-model:value="form.positionId" placeholder="请选择职务" />
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="remark">
|
||||
<a-textarea class="form-item" v-model:value="form.remark" placeholder="请输入备注" :rows="4" />
|
||||
@ -65,6 +78,7 @@
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { regular } from '/@/constants/regular-const.js';
|
||||
import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue';
|
||||
import PositionSelect from '/@/components/system/position-select/index.vue';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
import { loginApi } from '/@/api/system/login-api.js';
|
||||
import { useUserStore } from '/@/store/modules/system/user.js';
|
||||
@ -93,10 +107,12 @@
|
||||
phone: '',
|
||||
// 部门id
|
||||
departmentId: undefined,
|
||||
// 是否启用
|
||||
disabledFlag: undefined,
|
||||
// 邮箱
|
||||
email: undefined,
|
||||
// 职务级别
|
||||
positionId: undefined,
|
||||
// 是否禁用
|
||||
disabledFlag: undefined,
|
||||
// 备注
|
||||
remark: '',
|
||||
};
|
||||
@ -111,7 +127,7 @@
|
||||
{ pattern: regular.phone, message: '请输入正确的手机号码', trigger: 'blur' },
|
||||
],
|
||||
gender: [{ required: true, message: '性别不能为空' }],
|
||||
departmentId: [{ required: true, message: '部门不能为空' }],
|
||||
email: [{ required: true, message: '请输入邮箱' }],
|
||||
};
|
||||
// 头像地址
|
||||
let avatarUrl = ref();
|
||||
@ -128,12 +144,13 @@
|
||||
form.employeeId = data.employeeId;
|
||||
form.loginName = data.loginName;
|
||||
form.actualName = data.actualName;
|
||||
form.email = data.email;
|
||||
form.gender = data.gender;
|
||||
form.phone = data.phone;
|
||||
form.departmentId = data.departmentId;
|
||||
form.disabledFlag = data.disabledFlag;
|
||||
form.email = data.email;
|
||||
form.positionId = data.positionId;
|
||||
form.remark = data.remark;
|
||||
form.disabledFlag = data.disabledFlag;
|
||||
// 头像展示
|
||||
avatarUrl.value = data.avatar;
|
||||
} catch (e) {
|
||||
@ -187,7 +204,7 @@
|
||||
async function updateEmployee() {
|
||||
SmartLoading.show();
|
||||
try {
|
||||
await employeeApi.updateByLogin(form);
|
||||
await employeeApi.updateCenter(form);
|
||||
message.success('更新成功');
|
||||
// 重新获取详情,刷新整体缓存
|
||||
await getLoginInfo();
|
||||
|
@ -119,6 +119,7 @@
|
||||
phone: undefined,
|
||||
roleIdList: undefined,
|
||||
positionId: undefined,
|
||||
email: undefined,
|
||||
};
|
||||
|
||||
let form = reactive(_.cloneDeep(formDefault));
|
||||
|
@ -29,7 +29,7 @@
|
||||
let props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
defineEmits(['update:value']);
|
||||
|
@ -30,7 +30,7 @@
|
||||
const props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
|
@ -21,7 +21,7 @@
|
||||
const props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
|
@ -36,10 +36,10 @@ export const employeeApi = {
|
||||
return postRequest('/employee/update', params);
|
||||
},
|
||||
/**
|
||||
* 更新登录人信息
|
||||
* 更新员工个人中心信息
|
||||
*/
|
||||
updateByLogin: (params) => {
|
||||
return postRequest('/employee/update/login', params);
|
||||
updateCenter: (params) => {
|
||||
return postRequest('/employee/update/center', params);
|
||||
},
|
||||
/**
|
||||
* 更新登录人头像
|
||||
@ -77,25 +77,22 @@ export const employeeApi = {
|
||||
updateEmployeePassword: (param) => {
|
||||
return postEncryptRequest('/employee/update/password', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取密码复杂度
|
||||
*/
|
||||
getPasswordComplexityEnabled: () => {
|
||||
return getRequest('/employee/getPasswordComplexityEnabled');
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新员工禁用状态
|
||||
*/
|
||||
updateDisabled: (employeeId) => {
|
||||
return getRequest(`/employee/update/disabled/${employeeId}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询员工-根据部门id
|
||||
*/
|
||||
queryEmployeeByDeptId: (departmentId) => {
|
||||
return getRequest(`/employee/query/dept/${departmentId}`);
|
||||
return getRequest(`/employee/getAllEmployeeByDepartmentId/${departmentId}`);
|
||||
},
|
||||
};
|
||||
|
@ -9,7 +9,11 @@
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" :options="optionList" @change="handleChange" />
|
||||
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" @change="handleChange" :disabled="disabled">
|
||||
<a-checkbox v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -22,19 +26,32 @@
|
||||
type: String,
|
||||
default: '200px',
|
||||
},
|
||||
// 禁用整个多选框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
// ------------ 枚举数据 加载和构建 ------------
|
||||
|
||||
const optionList = ref([]);
|
||||
function buildOptionList() {
|
||||
const valueDescList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
const valueList = smartEnumPlugin.getValueDescList(props.enumName);
|
||||
optionList.value = valueList.map((e) => Object.assign({}, { value: e.value, label: e.desc }));
|
||||
}
|
||||
|
||||
onMounted(buildOptionList);
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
// ------------ 数据选中 事件及其相关 ------------
|
||||
|
||||
@ -43,11 +60,14 @@
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除这些选项
|
||||
selectValue.value = newValue.filter((item) => !props.hiddenOption.includes(item) && !props.disabledOption.includes(item));
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function handleChange(value) {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
|
@ -10,15 +10,15 @@
|
||||
-->
|
||||
<template>
|
||||
<template v-if="isButton">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid">
|
||||
<a-radio-button v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid" :disabled="disabled">
|
||||
<a-radio-button v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange">
|
||||
<a-radio v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" :disabled="disabled">
|
||||
<a-radio v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
@ -26,7 +26,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { ref, watch, onMounted, getCurrentInstance } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
enumName: String,
|
||||
@ -43,17 +43,42 @@
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 禁用整个单选框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const valueDescList = ref([]);
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除该选项
|
||||
selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
function handleChange(e) {
|
||||
|
@ -19,18 +19,18 @@
|
||||
@change="handleChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-select-option v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { ref, watch, onMounted, getCurrentInstance} from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
enumName: String,
|
||||
value: [Number,String],
|
||||
value: [Number, String],
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%',
|
||||
@ -43,21 +43,42 @@
|
||||
type: String,
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用整个下拉选择框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const valueDescList = ref([]);
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除该选项
|
||||
selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
function handleChange(value) {
|
||||
|
@ -18,6 +18,7 @@
|
||||
:allowClear="true"
|
||||
:size="size"
|
||||
@change="onChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in dictKeyCodeList" :key="item.keyCode" :value="item.keyCode">
|
||||
{{ item.keyName }}
|
||||
@ -27,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch, defineExpose } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
defineExpose({
|
||||
@ -49,7 +50,7 @@
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用标识
|
||||
disabledFlag: {
|
||||
disabled: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
|
@ -20,7 +20,7 @@
|
||||
@change="onChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in dictValueList" :key="item.valueCode" :value="item.valueCode">
|
||||
<a-select-option v-for="item in dictValueList" :key="item.valueCode" :value="item.valueCode" :disabled="disabledOption.includes(item.valueCode)">
|
||||
{{ item.valueName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@ -28,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
const props = defineProps({
|
||||
@ -50,10 +50,21 @@
|
||||
type: String,
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用整个下拉选择框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项字典值编码
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项字典值编码
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
// -------------------------- 查询 字典数据 --------------------------
|
||||
@ -61,7 +72,7 @@
|
||||
const dictValueList = ref([]);
|
||||
async function queryDict() {
|
||||
let res = await dictApi.valueList(props.keyCode);
|
||||
dictValueList.value = res.data;
|
||||
dictValueList.value = res.data.filter((item) => !props.hiddenOption.includes(item.valueCode));
|
||||
}
|
||||
|
||||
onMounted(queryDict);
|
||||
@ -69,26 +80,24 @@
|
||||
// -------------------------- 选中 相关、事件 --------------------------
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(value) => {
|
||||
selectValue.value = value;
|
||||
}
|
||||
(newValue) => {
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除这些选项
|
||||
if (Array.isArray(newValue)) {
|
||||
selectValue.value = newValue.filter((item) => !props.disabledOption.includes(item) && !props.hiddenOption.includes(item));
|
||||
} else {
|
||||
selectValue.value = props.hiddenOption.includes(newValue) || props.disabledOption.includes(newValue) ? undefined : newValue;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function onChange(value) {
|
||||
if (!value) {
|
||||
emit('update:value', []);
|
||||
emit('change', []);
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
} else {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
}
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
}
|
||||
</script>
|
||||
|
@ -21,7 +21,7 @@ export function privilegeDirective(el: { parentNode: { removeChild: (arg0: any)
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
// 如果有权限,删除节点
|
||||
// 如果没有权限,删除节点
|
||||
if (!_.some(userPointsList, ['webPerms', binding.value])) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
*/
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { App } from 'vue';
|
||||
import _ from 'lodash';
|
||||
|
||||
const privilege = (value: string) => {
|
||||
// 超级管理员
|
||||
@ -20,7 +21,7 @@ const privilege = (value: string) => {
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
return userPointsList && userPointsList.includes(value);
|
||||
return _.some(userPointsList, ['apiPerms', value]);
|
||||
};
|
||||
|
||||
export default {
|
||||
|
@ -11,17 +11,17 @@
|
||||
<a-card style="margin-bottom: 15px" size="small">
|
||||
<a-descriptions :title="noticeDetail.title" :column="4" size="small">
|
||||
<template #extra>
|
||||
<a-button v-if="!noticeDetail.publishFlag" type="primary" size="small" @click="onEdit">编辑</a-button>
|
||||
<a-button type="primary" size="small" @click="onEdit">编辑</a-button>
|
||||
</template>
|
||||
<a-descriptions-item label="分类">{{ noticeDetail.noticeTypeName }}</a-descriptions-item>
|
||||
<a-descriptions-item label="文号">{{ noticeDetail.documentNumber }}</a-descriptions-item>
|
||||
<a-descriptions-item label="文号">{{ noticeDetail.documentNumber ? noticeDetail.documentNumber : '无' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="来源">{{ noticeDetail.source }}</a-descriptions-item>
|
||||
<a-descriptions-item label="作者">{{ noticeDetail.author }}</a-descriptions-item>
|
||||
<a-descriptions-item label="页面浏览量">{{ noticeDetail.pageViewCount }}</a-descriptions-item>
|
||||
<a-descriptions-item label="用户浏览量">{{ noticeDetail.userViewCount }}</a-descriptions-item>
|
||||
<a-descriptions-item label="创建时间">{{ noticeDetail.createTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="发布时间">{{ noticeDetail.publishTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="定时发布">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="发布状态">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="删除状态">{{ noticeDetail.deletedFlag ? '已删除' : '未删除' }}</a-descriptions-item>
|
||||
<a-descriptions-item v-if="!$lodash.isEmpty(noticeDetail.attachment)" label="附件">
|
||||
<div class="file-list">
|
||||
|
@ -35,7 +35,7 @@
|
||||
</a-button-group>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row"> </a-row>
|
||||
<a-row class="smart-query-form-row" />
|
||||
</a-form>
|
||||
|
||||
<a-card size="small" :bordered="false">
|
||||
|
@ -28,7 +28,7 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="创建人" class="smart-query-form-item">
|
||||
<a-input style="width: 100px" v-model:value="queryForm.createUserId" placeholder="创建人" />
|
||||
<a-input style="width: 100px" v-model:value="queryForm.createUserName" placeholder="创建人" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="是否删除" class="smart-query-form-item">
|
||||
@ -91,6 +91,9 @@
|
||||
<template v-if="column.dataIndex === 'title'">
|
||||
<a @click="toDetail(record.noticeId)">{{ text }}</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'documentNumber'">
|
||||
{{ text ? text : '无' }}
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'allVisibleFlag'"> {{ text ? '全部可见' : '部分可见' }} </template>
|
||||
<template v-else-if="column.dataIndex === 'publishFlag'">
|
||||
{{ text ? '已发布' : '待发布' }}
|
||||
@ -145,7 +148,7 @@
|
||||
noticeTypeId: undefined, //分类
|
||||
keywords: '', //标题、作者、来源
|
||||
documentNumber: '', //文号
|
||||
createUserId: undefined, //创建人
|
||||
createUserName: undefined, //创建人
|
||||
deletedFlag: undefined, //删除标识
|
||||
createTimeBegin: null, //创建-开始时间
|
||||
createTimeEnd: null, //创建-截止时间
|
||||
@ -195,7 +198,7 @@
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '发布',
|
||||
title: '发布状态',
|
||||
dataIndex: 'publishFlag',
|
||||
width: 80,
|
||||
},
|
||||
|
@ -124,24 +124,22 @@
|
||||
</a-table>
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="queryJobList"
|
||||
@showSizeChange="queryJobList"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="queryJobList"
|
||||
@showSizeChange="queryJobList"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="已删除任务"><DeletedJobList /></a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
|
||||
</a-card>
|
||||
|
||||
<!-- 表单操作 -->
|
||||
@ -152,7 +150,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {message, Modal} from 'ant-design-vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { jobApi } from '/@/api/support/job-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
@ -163,7 +161,7 @@
|
||||
import { TRIGGER_TYPE_ENUM } from '/@/constants/support/job-const.js';
|
||||
import JobFormModal from './components/job-form-modal.vue';
|
||||
import JobLogListModal from './components/job-log-list-modal.vue';
|
||||
import {SmartLoading} from "/@/components/framework/smart-loading/index.js";
|
||||
import { SmartLoading } from "/@/components/framework/smart-loading/index.js";
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
@ -241,6 +239,8 @@
|
||||
},
|
||||
]);
|
||||
|
||||
const activeKey = ref('1');
|
||||
|
||||
// ---------------- 查询数据 -----------------------
|
||||
|
||||
const queryFormState = {
|
||||
|
@ -11,6 +11,9 @@
|
||||
<a-form-item label="登录账号" name="loginName">
|
||||
<a-input class="form-item" v-model:value.trim="form.loginName" placeholder="请输入登录账号" disabled />
|
||||
</a-form-item>
|
||||
<a-form-item label="部门" name="departmentId">
|
||||
<DepartmentTreeSelect class="form-item" ref="departmentTreeSelect" width="100%" :init="false" v-model:value="form.departmentId" disabled />
|
||||
</a-form-item>
|
||||
<a-form-item label="员工名称" name="actualName">
|
||||
<a-input class="form-item" v-model:value.trim="form.actualName" placeholder="请输入员工名称" />
|
||||
</a-form-item>
|
||||
@ -20,8 +23,11 @@
|
||||
<a-form-item label="手机号码" name="phone">
|
||||
<a-input class="form-item" v-model:value.trim="form.phone" placeholder="请输入手机号码" />
|
||||
</a-form-item>
|
||||
<a-form-item label="部门" name="departmentId">
|
||||
<DepartmentTreeSelect class="form-item" ref="departmentTreeSelect" width="100%" :init="false" v-model:value="form.departmentId" />
|
||||
<a-form-item label="邮箱" name="email">
|
||||
<a-input v-model:value.trim="form.email" placeholder="请输入邮箱" />
|
||||
</a-form-item>
|
||||
<a-form-item label="职务" name="positionId">
|
||||
<PositionSelect v-model:value="form.positionId" placeholder="请选择职务" />
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="remark">
|
||||
<a-textarea class="form-item" v-model:value="form.remark" placeholder="请输入备注" :rows="4" />
|
||||
@ -65,6 +71,7 @@
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { regular } from '/@/constants/regular-const.js';
|
||||
import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue';
|
||||
import PositionSelect from '/@/components/system/position-select/index.vue';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
import { loginApi } from '/@/api/system/login-api.js';
|
||||
import { useUserStore } from '/@/store/modules/system/user.js';
|
||||
@ -93,10 +100,12 @@
|
||||
phone: '',
|
||||
// 部门id
|
||||
departmentId: undefined,
|
||||
// 是否启用
|
||||
disabledFlag: undefined,
|
||||
// 邮箱
|
||||
email: undefined,
|
||||
// 职务级别
|
||||
positionId: undefined,
|
||||
// 是否禁用
|
||||
disabledFlag: undefined,
|
||||
// 备注
|
||||
remark: '',
|
||||
};
|
||||
@ -111,7 +120,7 @@
|
||||
{ pattern: regular.phone, message: '请输入正确的手机号码', trigger: 'blur' },
|
||||
],
|
||||
gender: [{ required: true, message: '性别不能为空' }],
|
||||
departmentId: [{ required: true, message: '部门不能为空' }],
|
||||
email: [{ required: true, message: '请输入邮箱' }],
|
||||
};
|
||||
// 头像地址
|
||||
let avatarUrl = ref();
|
||||
@ -128,12 +137,13 @@
|
||||
form.employeeId = data.employeeId;
|
||||
form.loginName = data.loginName;
|
||||
form.actualName = data.actualName;
|
||||
form.email = data.email;
|
||||
form.gender = data.gender;
|
||||
form.phone = data.phone;
|
||||
form.departmentId = data.departmentId;
|
||||
form.disabledFlag = data.disabledFlag;
|
||||
form.email = data.email;
|
||||
form.positionId = data.positionId;
|
||||
form.remark = data.remark;
|
||||
form.disabledFlag = data.disabledFlag;
|
||||
// 头像展示
|
||||
avatarUrl.value = data.avatar;
|
||||
} catch (e) {
|
||||
@ -187,7 +197,7 @@
|
||||
async function updateEmployee() {
|
||||
SmartLoading.show();
|
||||
try {
|
||||
await employeeApi.updateByLogin(form);
|
||||
await employeeApi.updateCenter(form);
|
||||
message.success('更新成功');
|
||||
// 重新获取详情,刷新整体缓存
|
||||
await getLoginInfo();
|
||||
|
@ -119,6 +119,7 @@
|
||||
phone: undefined,
|
||||
roleIdList: undefined,
|
||||
positionId: undefined,
|
||||
email: undefined,
|
||||
};
|
||||
|
||||
let form = reactive(_.cloneDeep(formDefault));
|
||||
|
@ -29,7 +29,7 @@
|
||||
let props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
defineEmits(['update:value']);
|
||||
|
@ -30,7 +30,7 @@
|
||||
const props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
|
@ -21,7 +21,7 @@
|
||||
const props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
|
@ -243,7 +243,7 @@ CREATE TABLE `t_employee` (
|
||||
`avatar` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
|
||||
`gender` tinyint(1) NOT NULL DEFAULT 0 COMMENT '性别',
|
||||
`phone` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码',
|
||||
`department_id` int(0) NOT NULL COMMENT '部门id',
|
||||
`department_id` bigint(0) NOT NULL COMMENT '部门id',
|
||||
`position_id` bigint(0) NULL DEFAULT NULL COMMENT '职务ID',
|
||||
`email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '邮箱',
|
||||
`disabled_flag` tinyint unsigned NOT NULL COMMENT '是否被禁用 0否1是',
|
||||
@ -300,7 +300,7 @@ CREATE TABLE `t_file` (
|
||||
`file_size` int(0) NULL DEFAULT NULL COMMENT '文件大小',
|
||||
`file_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件key,用于文件下载',
|
||||
`file_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件类型',
|
||||
`creator_id` int(0) NULL DEFAULT NULL COMMENT '创建人,即上传人',
|
||||
`creator_id` bigint(0) NULL DEFAULT NULL COMMENT '创建人,即上传人',
|
||||
`creator_user_type` int(0) NULL DEFAULT NULL COMMENT '创建人用户类型',
|
||||
`creator_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人姓名',
|
||||
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次更新时间',
|
||||
@ -465,7 +465,7 @@ CREATE TABLE `t_login_fail` (
|
||||
DROP TABLE IF EXISTS `t_login_log`;
|
||||
CREATE TABLE `t_login_log` (
|
||||
`login_log_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`user_id` int(0) NOT NULL COMMENT '用户id',
|
||||
`user_id` bigint(0) NOT NULL COMMENT '用户id',
|
||||
`user_type` int(0) NOT NULL COMMENT '用户类型',
|
||||
`user_name` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
|
||||
`login_ip` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户ip',
|
||||
@ -1016,8 +1016,8 @@ INSERT INTO `t_role` VALUES (37, '财务', NULL, '', '2019-08-30 09:31:16', '201
|
||||
DROP TABLE IF EXISTS `t_role_data_scope`;
|
||||
CREATE TABLE `t_role_data_scope` (
|
||||
`id` bigint(0) NOT NULL AUTO_INCREMENT,
|
||||
`data_scope_type` int(0) NOT NULL COMMENT '数据范围id',
|
||||
`view_type` int(0) NOT NULL COMMENT '数据范围类型',
|
||||
`data_scope_type` int(0) NOT NULL COMMENT '数据范围类型',
|
||||
`view_type` int(0) NOT NULL COMMENT '数据可见范围类型',
|
||||
`role_id` bigint(0) NOT NULL COMMENT '角色id',
|
||||
`update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
|
||||
`create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
|
Loading…
Reference in New Issue
Block a user