mirror of
				https://gitee.com/lab1024/smart-admin.git
				synced 2025-11-04 10:23:43 +08:00 
			
		
		
		
	@@ -1,9 +1,11 @@
 | 
				
			|||||||
package net.lab1024.sa.admin.module.business.goods.domain.form;
 | 
					package net.lab1024.sa.admin.module.business.goods.domain.form;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 | 
				
			||||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
					import io.swagger.v3.oas.annotations.media.Schema;
 | 
				
			||||||
import lombok.Data;
 | 
					import lombok.Data;
 | 
				
			||||||
import net.lab1024.sa.admin.module.business.goods.constant.GoodsStatusEnum;
 | 
					import net.lab1024.sa.admin.module.business.goods.constant.GoodsStatusEnum;
 | 
				
			||||||
import net.lab1024.sa.base.common.domain.PageParam;
 | 
					import net.lab1024.sa.base.common.domain.PageParam;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.common.json.deserializer.DictValueVoDeserializer;
 | 
				
			||||||
import net.lab1024.sa.base.common.swagger.SchemaEnum;
 | 
					import net.lab1024.sa.base.common.swagger.SchemaEnum;
 | 
				
			||||||
import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
 | 
					import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
 | 
				
			||||||
import org.hibernate.validator.constraints.Length;
 | 
					import org.hibernate.validator.constraints.Length;
 | 
				
			||||||
@@ -32,6 +34,7 @@ public class GoodsQueryForm extends PageParam {
 | 
				
			|||||||
    private Integer goodsStatus;
 | 
					    private Integer goodsStatus;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Schema(description = "产地")
 | 
					    @Schema(description = "产地")
 | 
				
			||||||
 | 
					    @JsonDeserialize(using = DictValueVoDeserializer.class)
 | 
				
			||||||
    private String place;
 | 
					    private String place;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Schema(description = "上架状态")
 | 
					    @Schema(description = "上架状态")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -199,7 +199,7 @@ public class GoodsService {
 | 
				
			|||||||
                        GoodsExcelVO.builder()
 | 
					                        GoodsExcelVO.builder()
 | 
				
			||||||
                                .goodsStatus(SmartEnumUtil.getEnumDescByValue(e.getGoodsStatus(), GoodsStatusEnum.class))
 | 
					                                .goodsStatus(SmartEnumUtil.getEnumDescByValue(e.getGoodsStatus(), GoodsStatusEnum.class))
 | 
				
			||||||
                                .categoryName(categoryQueryService.queryCategoryName(e.getCategoryId()))
 | 
					                                .categoryName(categoryQueryService.queryCategoryName(e.getCategoryId()))
 | 
				
			||||||
                                .place(dictCacheService.selectValueNameByValueCode(e.getPlace()))
 | 
					                                .place(Arrays.stream(e.getPlace().split(",")).map(code -> dictCacheService.selectValueNameByValueCode(code)).collect(Collectors.joining(",")))
 | 
				
			||||||
                                .price(e.getPrice())
 | 
					                                .price(e.getPrice())
 | 
				
			||||||
                                .goodsName(e.getGoodsName())
 | 
					                                .goodsName(e.getGoodsName())
 | 
				
			||||||
                                .remark(e.getRemark())
 | 
					                                .remark(e.getRemark())
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -114,4 +114,14 @@ public interface NoticeDao extends BaseMapper<NoticeEntity> {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    void updateViewRecord(@Param("noticeId")Long noticeId, @Param("employeeId")Long requestEmployeeId,@Param("ip") String ip, @Param("userAgent")String userAgent);
 | 
					    void updateViewRecord(@Param("noticeId")Long noticeId, @Param("employeeId")Long requestEmployeeId,@Param("ip") String ip, @Param("userAgent")String userAgent);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 更新 浏览量
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param noticeId 通知 id
 | 
				
			||||||
 | 
					     * @param pageViewCountIncrement 页面浏览量的增量
 | 
				
			||||||
 | 
					     * @param userViewCountIncrement 用户浏览量的增量
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    void updateViewCount(@Param("noticeId")Long noticeId,@Param("pageViewCountIncrement") Integer pageViewCountIncrement, @Param("userViewCountIncrement")Integer userViewCountIncrement);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,10 +52,10 @@ public class NoticeEmployeeService {
 | 
				
			|||||||
    public ResponseDTO<PageResult<NoticeEmployeeVO>> queryList(Long requestEmployeeId, NoticeEmployeeQueryForm noticeEmployeeQueryForm) {
 | 
					    public ResponseDTO<PageResult<NoticeEmployeeVO>> queryList(Long requestEmployeeId, NoticeEmployeeQueryForm noticeEmployeeQueryForm) {
 | 
				
			||||||
        Page<?> page = SmartPageUtil.convert2PageQuery(noticeEmployeeQueryForm);
 | 
					        Page<?> page = SmartPageUtil.convert2PageQuery(noticeEmployeeQueryForm);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //获取请求人的 部门及其子部门
 | 
					 | 
				
			||||||
        List<Long> employeeDepartmentIdList = Lists.newArrayList();
 | 
					        List<Long> employeeDepartmentIdList = Lists.newArrayList();
 | 
				
			||||||
        EmployeeEntity employeeEntity = employeeService.getById(requestEmployeeId);
 | 
					        EmployeeEntity employeeEntity = employeeService.getById(requestEmployeeId);
 | 
				
			||||||
        if (employeeEntity.getDepartmentId() != null) {
 | 
					        // 如果不是管理员 则获取请求人的 部门及其子部门
 | 
				
			||||||
 | 
					        if (!employeeEntity.getAdministratorFlag() && employeeEntity.getDepartmentId() != null) {
 | 
				
			||||||
            employeeDepartmentIdList = departmentService.selfAndChildrenIdList(employeeEntity.getDepartmentId());
 | 
					            employeeDepartmentIdList = departmentService.selfAndChildrenIdList(employeeEntity.getDepartmentId());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -106,8 +106,15 @@ public class NoticeEmployeeService {
 | 
				
			|||||||
        long viewCount = noticeDao.viewRecordCount(noticeId, requestEmployeeId);
 | 
					        long viewCount = noticeDao.viewRecordCount(noticeId, requestEmployeeId);
 | 
				
			||||||
        if (viewCount == 0) {
 | 
					        if (viewCount == 0) {
 | 
				
			||||||
            noticeDao.insertViewRecord(noticeId, requestEmployeeId, ip, userAgent, 1);
 | 
					            noticeDao.insertViewRecord(noticeId, requestEmployeeId, ip, userAgent, 1);
 | 
				
			||||||
 | 
					            // 该员工对于这个通知是第一次查看 页面浏览量+1 用户浏览量+1
 | 
				
			||||||
 | 
					            noticeDao.updateViewCount(noticeId, 1, 1);
 | 
				
			||||||
 | 
					            noticeDetailVO.setPageViewCount(noticeDetailVO.getPageViewCount() + 1);
 | 
				
			||||||
 | 
					            noticeDetailVO.setUserViewCount(noticeDetailVO.getUserViewCount() + 1);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            noticeDao.updateViewRecord(noticeId, requestEmployeeId, ip, userAgent);
 | 
					            noticeDao.updateViewRecord(noticeId, requestEmployeeId, ip, userAgent);
 | 
				
			||||||
 | 
					            // 该员工对于这个通知不是第一次查看 页面浏览量+1 用户浏览量+0
 | 
				
			||||||
 | 
					            noticeDao.updateViewCount(noticeId, 1, 0);
 | 
				
			||||||
 | 
					            noticeDetailVO.setPageViewCount(noticeDetailVO.getPageViewCount() + 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return ResponseDTO.ok(noticeDetailVO);
 | 
					        return ResponseDTO.ok(noticeDetailVO);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,8 +60,11 @@ public class EmployeeManager extends ServiceImpl<EmployeeDao, EmployeeEntity> {
 | 
				
			|||||||
        // 保存员工 获得id
 | 
					        // 保存员工 获得id
 | 
				
			||||||
        employeeDao.updateById(employee);
 | 
					        employeeDao.updateById(employee);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (CollectionUtils.isNotEmpty(roleIdList)) {
 | 
					        if (CollectionUtils.isEmpty(roleIdList)) {
 | 
				
			||||||
            List<RoleEmployeeEntity> roleEmployeeList = roleIdList.stream().map(e -> new RoleEmployeeEntity(e, employee.getEmployeeId())).collect(Collectors.toList());
 | 
					            // 删除员工角色
 | 
				
			||||||
 | 
					            this.updateEmployeeRole(employee.getEmployeeId(), null);
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            List<RoleEmployeeEntity> roleEmployeeList = roleIdList.stream().map(roleId -> new RoleEmployeeEntity(roleId, employee.getEmployeeId())).collect(Collectors.toList());
 | 
				
			||||||
            this.updateEmployeeRole(employee.getEmployeeId(), roleEmployeeList);
 | 
					            this.updateEmployeeRole(employee.getEmployeeId(), roleEmployeeList);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,7 @@ import net.lab1024.sa.admin.module.system.role.domain.form.RoleEmployeeQueryForm
 | 
				
			|||||||
import net.lab1024.sa.admin.module.system.role.domain.vo.RoleEmployeeVO;
 | 
					import net.lab1024.sa.admin.module.system.role.domain.vo.RoleEmployeeVO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import java.util.Set;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -50,7 +51,7 @@ public interface RoleEmployeeDao extends BaseMapper<RoleEmployeeEntity> {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 查询角色下的人员id
 | 
					     * 查询角色下的人员id
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    List<Long> selectEmployeeIdByRoleIdList(@Param("roleIdList") List<Long> roleIdList);
 | 
					    Set<Long> selectEmployeeIdByRoleIdList(@Param("roleIdList") List<Long> roleIdList);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -79,5 +80,10 @@ public interface RoleEmployeeDao extends BaseMapper<RoleEmployeeEntity> {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 批量删除某个角色下的某批用户的关联关系
 | 
					     * 批量删除某个角色下的某批用户的关联关系
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    void batchDeleteEmployeeRole(@Param("roleId") Long roleId,@Param("employeeIds")List<Long> employeeIds);
 | 
					    void batchDeleteEmployeeRole(@Param("roleId") Long roleId, @Param("employeeIds") Set<Long> employeeIds);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 判断某个角色下是否存在用户
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    Integer existsByRoleId(@Param("roleId") Long roleId);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ import lombok.Data;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import javax.validation.constraints.NotEmpty;
 | 
					import javax.validation.constraints.NotEmpty;
 | 
				
			||||||
import javax.validation.constraints.NotNull;
 | 
					import javax.validation.constraints.NotNull;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.Set;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 角色的员工更新
 | 
					 * 角色的员工更新
 | 
				
			||||||
@@ -25,6 +25,6 @@ public class RoleEmployeeUpdateForm {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Schema(description = "员工id集合")
 | 
					    @Schema(description = "员工id集合")
 | 
				
			||||||
    @NotEmpty(message = "员工id不能为空")
 | 
					    @NotEmpty(message = "员工id不能为空")
 | 
				
			||||||
    protected List<Long> employeeIdList;
 | 
					    protected Set<Long> employeeIdList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,11 +3,7 @@ package net.lab1024.sa.admin.module.system.role.manager;
 | 
				
			|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
					import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
				
			||||||
import net.lab1024.sa.admin.module.system.role.dao.RoleEmployeeDao;
 | 
					import net.lab1024.sa.admin.module.system.role.dao.RoleEmployeeDao;
 | 
				
			||||||
import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEmployeeEntity;
 | 
					import net.lab1024.sa.admin.module.system.role.domain.entity.RoleEmployeeEntity;
 | 
				
			||||||
import org.apache.commons.collections4.CollectionUtils;
 | 
					 | 
				
			||||||
import org.springframework.stereotype.Service;
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
import org.springframework.transaction.annotation.Transactional;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import java.util.List;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 角色员工 manager
 | 
					 * 角色员工 manager
 | 
				
			||||||
@@ -16,20 +12,9 @@ import java.util.List;
 | 
				
			|||||||
 * @Date 2022-04-08 21:53:04
 | 
					 * @Date 2022-04-08 21:53:04
 | 
				
			||||||
 * @Wechat zhuoda1024
 | 
					 * @Wechat zhuoda1024
 | 
				
			||||||
 * @Email lab1024@163.com
 | 
					 * @Email lab1024@163.com
 | 
				
			||||||
 * @Copyright  <a href="https://1024lab.net">1024创新实验室</a>
 | 
					 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@Service
 | 
					@Service
 | 
				
			||||||
public class RoleEmployeeManager extends ServiceImpl<RoleEmployeeDao, RoleEmployeeEntity> {
 | 
					public class RoleEmployeeManager extends ServiceImpl<RoleEmployeeDao, RoleEmployeeEntity> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					 | 
				
			||||||
     * 保存 角色员工
 | 
					 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
    @Transactional(rollbackFor = Throwable.class)
 | 
					 | 
				
			||||||
    public void saveRoleEmployee(Long roleId, List<RoleEmployeeEntity> roleEmployeeList) {
 | 
					 | 
				
			||||||
        this.getBaseMapper().deleteByRoleId(roleId);
 | 
					 | 
				
			||||||
        if (CollectionUtils.isNotEmpty(roleEmployeeList)) {
 | 
					 | 
				
			||||||
            this.saveBatch(roleEmployeeList);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
package net.lab1024.sa.admin.module.system.role.service;
 | 
					package net.lab1024.sa.admin.module.system.role.service;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
					import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
				
			||||||
 | 
					import com.google.common.collect.Lists;
 | 
				
			||||||
import net.lab1024.sa.admin.module.system.department.dao.DepartmentDao;
 | 
					import net.lab1024.sa.admin.module.system.department.dao.DepartmentDao;
 | 
				
			||||||
import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity;
 | 
					import net.lab1024.sa.admin.module.system.department.domain.entity.DepartmentEntity;
 | 
				
			||||||
import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO;
 | 
					import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO;
 | 
				
			||||||
@@ -20,12 +21,12 @@ import net.lab1024.sa.base.common.util.SmartBeanUtil;
 | 
				
			|||||||
import net.lab1024.sa.base.common.util.SmartPageUtil;
 | 
					import net.lab1024.sa.base.common.util.SmartPageUtil;
 | 
				
			||||||
import org.apache.commons.collections4.CollectionUtils;
 | 
					import org.apache.commons.collections4.CollectionUtils;
 | 
				
			||||||
import org.springframework.stereotype.Service;
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
import org.springframework.transaction.annotation.Transactional;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.annotation.Resource;
 | 
					import javax.annotation.Resource;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
import java.util.Map;
 | 
					import java.util.Map;
 | 
				
			||||||
import java.util.Objects;
 | 
					import java.util.Objects;
 | 
				
			||||||
 | 
					import java.util.Set;
 | 
				
			||||||
import java.util.stream.Collectors;
 | 
					import java.util.stream.Collectors;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -88,7 +89,6 @@ public class RoleEmployeeService {
 | 
				
			|||||||
     * 移除员工角色
 | 
					     * 移除员工角色
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					 | 
				
			||||||
    public ResponseDTO<String> removeRoleEmployee(Long employeeId, Long roleId) {
 | 
					    public ResponseDTO<String> removeRoleEmployee(Long employeeId, Long roleId) {
 | 
				
			||||||
        if (null == employeeId || null == roleId) {
 | 
					        if (null == employeeId || null == roleId) {
 | 
				
			||||||
            return ResponseDTO.userErrorParam();
 | 
					            return ResponseDTO.userErrorParam();
 | 
				
			||||||
@@ -112,16 +112,21 @@ public class RoleEmployeeService {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public ResponseDTO<String> batchAddRoleEmployee(RoleEmployeeUpdateForm roleEmployeeUpdateForm) {
 | 
					    public ResponseDTO<String> batchAddRoleEmployee(RoleEmployeeUpdateForm roleEmployeeUpdateForm) {
 | 
				
			||||||
        Long roleId = roleEmployeeUpdateForm.getRoleId();
 | 
					        Long roleId = roleEmployeeUpdateForm.getRoleId();
 | 
				
			||||||
        List<Long> employeeIdList = roleEmployeeUpdateForm.getEmployeeIdList();
 | 
					
 | 
				
			||||||
        // 保存新的角色员工
 | 
					        // 已选择的员工id列表
 | 
				
			||||||
        List<RoleEmployeeEntity> roleEmployeeList = null;
 | 
					        Set<Long> selectedEmployeeIdList = roleEmployeeUpdateForm.getEmployeeIdList();
 | 
				
			||||||
        if (CollectionUtils.isNotEmpty(employeeIdList)) {
 | 
					        // 数据库里已有的员工id列表
 | 
				
			||||||
            roleEmployeeList = employeeIdList.stream()
 | 
					        Set<Long> dbEmployeeIdList = roleEmployeeDao.selectEmployeeIdByRoleIdList(Lists.newArrayList(roleId));
 | 
				
			||||||
 | 
					        // 从已选择的员工id列表里 过滤数据库里不存在的 即需要添加的员工 id
 | 
				
			||||||
 | 
					        Set<Long> addEmployeeIdList = selectedEmployeeIdList.stream().filter(id -> !dbEmployeeIdList.contains(id)).collect(Collectors.toSet());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 添加角色员工
 | 
				
			||||||
 | 
					        if (CollectionUtils.isNotEmpty(addEmployeeIdList)) {
 | 
				
			||||||
 | 
					            List<RoleEmployeeEntity> roleEmployeeList = addEmployeeIdList.stream()
 | 
				
			||||||
                    .map(employeeId -> new RoleEmployeeEntity(roleId, employeeId))
 | 
					                    .map(employeeId -> new RoleEmployeeEntity(roleId, employeeId))
 | 
				
			||||||
                    .collect(Collectors.toList());
 | 
					                    .collect(Collectors.toList());
 | 
				
			||||||
 | 
					            roleEmployeeManager.saveBatch(roleEmployeeList);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        // 保存数据
 | 
					 | 
				
			||||||
        roleEmployeeManager.saveRoleEmployee(roleId, roleEmployeeList);
 | 
					 | 
				
			||||||
        return ResponseDTO.ok();
 | 
					        return ResponseDTO.ok();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,6 +65,11 @@ public class RoleService {
 | 
				
			|||||||
        if (null == roleEntity) {
 | 
					        if (null == roleEntity) {
 | 
				
			||||||
            return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
 | 
					            return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        // 当没有员工绑定这个角色时才可以删除
 | 
				
			||||||
 | 
					        Integer exists = roleEmployeeDao.existsByRoleId(roleId);
 | 
				
			||||||
 | 
					        if (exists != null) {
 | 
				
			||||||
 | 
					            return ResponseDTO.error(UserErrorCode.ALREADY_EXIST, "该角色下存在员工,无法删除");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        roleDao.deleteById(roleId);
 | 
					        roleDao.deleteById(roleId);
 | 
				
			||||||
        roleMenuDao.deleteByRoleId(roleId);
 | 
					        roleMenuDao.deleteByRoleId(roleId);
 | 
				
			||||||
        roleEmployeeDao.deleteByRoleId(roleId);
 | 
					        roleEmployeeDao.deleteByRoleId(roleId);
 | 
				
			||||||
@@ -86,7 +91,7 @@ public class RoleService {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        existRoleEntity = roleDao.getByRoleCode(roleUpdateForm.getRoleCode());
 | 
					        existRoleEntity = roleDao.getByRoleCode(roleUpdateForm.getRoleCode());
 | 
				
			||||||
        if (null != existRoleEntity) {
 | 
					        if (null != existRoleEntity && !existRoleEntity.getRoleId().equals(roleUpdateForm.getRoleId())) {
 | 
				
			||||||
            return ResponseDTO.userErrorParam("角色编码重复,重复的角色为:" + existRoleEntity.getRoleName());
 | 
					            return ResponseDTO.userErrorParam("角色编码重复,重复的角色为:" + existRoleEntity.getRoleName());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,7 @@
 | 
				
			|||||||
                INSTR(goods_name,#{query.searchWord})
 | 
					                INSTR(goods_name,#{query.searchWord})
 | 
				
			||||||
            </if>
 | 
					            </if>
 | 
				
			||||||
            <if test="query.place != null">
 | 
					            <if test="query.place != null">
 | 
				
			||||||
                AND place = #{query.place}
 | 
					                AND INSTR(place,#{query.place})
 | 
				
			||||||
            </if>
 | 
					            </if>
 | 
				
			||||||
            <if test="query.goodsStatus != null">
 | 
					            <if test="query.goodsStatus != null">
 | 
				
			||||||
                AND goods_status = #{query.goodsStatus}
 | 
					                AND goods_status = #{query.goodsStatus}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,69 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
					 | 
				
			||||||
<mapper namespace="net.lab1024.sa.admin.module.business.notice.NoticeDao">
 | 
					 | 
				
			||||||
    <update id="updateWatchAmount">
 | 
					 | 
				
			||||||
        UPDATE t_notice
 | 
					 | 
				
			||||||
        SET watch_amount = watch_amount + 1
 | 
					 | 
				
			||||||
        WHERE notice_id = #{noticeId}
 | 
					 | 
				
			||||||
    </update>
 | 
					 | 
				
			||||||
    <update id="batchDeleteNotice">
 | 
					 | 
				
			||||||
        UPDATE t_notice
 | 
					 | 
				
			||||||
        SET deleted_flag = #{deletedFlag}
 | 
					 | 
				
			||||||
        WHERE notice_id IN
 | 
					 | 
				
			||||||
        <foreach collection="noticeIdList" open="(" close=")" separator="," item="item">
 | 
					 | 
				
			||||||
            #{item}
 | 
					 | 
				
			||||||
        </foreach>
 | 
					 | 
				
			||||||
    </update>
 | 
					 | 
				
			||||||
    <update id="updateNotice">
 | 
					 | 
				
			||||||
        UPDATE t_notice
 | 
					 | 
				
			||||||
        SET notice_type         = #{noticeType},
 | 
					 | 
				
			||||||
            notice_belong_type  = #{noticeBelongType},
 | 
					 | 
				
			||||||
            notice_title        = #{noticeTitle},
 | 
					 | 
				
			||||||
            notice_content      = #{noticeContent},
 | 
					 | 
				
			||||||
            link_address        = #{linkAddress},
 | 
					 | 
				
			||||||
            cover_file_key      = #{coverFileKey},
 | 
					 | 
				
			||||||
            accessory_file_keys = #{accessoryFileKeys},
 | 
					 | 
				
			||||||
            top_flag            = #{topFlag},
 | 
					 | 
				
			||||||
            publish_time        = #{publishTime},
 | 
					 | 
				
			||||||
            disabled_flag       = #{disabledFlag}
 | 
					 | 
				
			||||||
        WHERE notice_id = #{noticeId}
 | 
					 | 
				
			||||||
    </update>
 | 
					 | 
				
			||||||
    <select id="queryPage" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO">
 | 
					 | 
				
			||||||
        SELECT t_notice.*,
 | 
					 | 
				
			||||||
        t_employee.actual_name AS createUserName
 | 
					 | 
				
			||||||
        FROM t_notice
 | 
					 | 
				
			||||||
        LEFT JOIN t_employee  ON t_notice.create_user_id = t_employee.employee_id
 | 
					 | 
				
			||||||
        <where>
 | 
					 | 
				
			||||||
            t_notice.deleted_flag = #{queryForm.deletedFlag}
 | 
					 | 
				
			||||||
            <if test="queryForm.keywords != null and queryForm.keywords != ''">
 | 
					 | 
				
			||||||
                AND (INSTR(t_notice.notice_title,#{queryForm.keywords}) OR INSTR(t_employee.actual_name,#{queryForm.keywords}))
 | 
					 | 
				
			||||||
            </if>
 | 
					 | 
				
			||||||
            <if test="queryForm.noticeType != null">
 | 
					 | 
				
			||||||
                AND t_notice.notice_type = #{queryForm.noticeType}
 | 
					 | 
				
			||||||
            </if>
 | 
					 | 
				
			||||||
            <if test="queryForm.noticeBelongType != null">
 | 
					 | 
				
			||||||
                AND t_notice.notice_belong_type = #{queryForm.noticeBelongType}
 | 
					 | 
				
			||||||
            </if>
 | 
					 | 
				
			||||||
            <if test="queryForm.startTime != null">
 | 
					 | 
				
			||||||
                AND DATE_FORMAT(t_notice.publish_time, '%Y-%m-%d') >= #{queryForm.startTime}
 | 
					 | 
				
			||||||
            </if>
 | 
					 | 
				
			||||||
            <if test="queryForm.endTime != null">
 | 
					 | 
				
			||||||
                AND DATE_FORMAT(t_notice.publish_time, '%Y-%m-%d') <= #{queryForm.endTime}
 | 
					 | 
				
			||||||
            </if>
 | 
					 | 
				
			||||||
            <if test="queryForm.disabledFlag != null">
 | 
					 | 
				
			||||||
                AND t_notice.disabled_flag = #{queryForm.disabledFlag}
 | 
					 | 
				
			||||||
            </if>
 | 
					 | 
				
			||||||
        </where>
 | 
					 | 
				
			||||||
        <if test="queryForm.sortItemList == null or queryForm.sortItemList.size == 0">
 | 
					 | 
				
			||||||
            ORDER BY t_notice.top_flag DESC,t_notice.publish_time DESC
 | 
					 | 
				
			||||||
        </if>
 | 
					 | 
				
			||||||
    </select>
 | 
					 | 
				
			||||||
    <select id="getDetail" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO">
 | 
					 | 
				
			||||||
        SELECT tn.*,
 | 
					 | 
				
			||||||
               e.actual_name AS createUserName
 | 
					 | 
				
			||||||
        FROM t_notice tn
 | 
					 | 
				
			||||||
                 LEFT JOIN t_employee e ON tn.create_user_id = e.employee_id
 | 
					 | 
				
			||||||
        WHERE tn.notice_id = #{noticeId}
 | 
					 | 
				
			||||||
          AND tn.deleted_flag = #{deletedFlag}
 | 
					 | 
				
			||||||
    </select>
 | 
					 | 
				
			||||||
</mapper>
 | 
					 | 
				
			||||||
@@ -242,5 +242,11 @@
 | 
				
			|||||||
        where notice_id = #{noticeId}
 | 
					        where notice_id = #{noticeId}
 | 
				
			||||||
          and employee_id = #{employeeId}
 | 
					          and employee_id = #{employeeId}
 | 
				
			||||||
    </update>
 | 
					    </update>
 | 
				
			||||||
 | 
					    <update id="updateViewCount">
 | 
				
			||||||
 | 
					        update t_notice
 | 
				
			||||||
 | 
					        set page_view_count = page_view_count + #{pageViewCountIncrement},
 | 
				
			||||||
 | 
					            user_view_count = user_view_count + #{userViewCountIncrement}
 | 
				
			||||||
 | 
					        where notice_id = #{noticeId}
 | 
				
			||||||
 | 
					    </update>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</mapper>
 | 
					</mapper>
 | 
				
			||||||
@@ -138,4 +138,12 @@
 | 
				
			|||||||
            #{item}
 | 
					            #{item}
 | 
				
			||||||
        </foreach>
 | 
					        </foreach>
 | 
				
			||||||
    </delete>
 | 
					    </delete>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <select id="existsByRoleId" resultType="java.lang.Integer">
 | 
				
			||||||
 | 
					        SELECT 1
 | 
				
			||||||
 | 
					        FROM t_role_employee er
 | 
				
			||||||
 | 
					        WHERE er.role_id = #{roleId}
 | 
				
			||||||
 | 
					        LIMIT 1
 | 
				
			||||||
 | 
					    </select>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</mapper>
 | 
					</mapper>
 | 
				
			||||||
@@ -28,19 +28,19 @@ public class DictValueVoDeserializer extends JsonDeserializer<String> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
 | 
					    public String deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
 | 
				
			||||||
        List<DictValueVO> list = new ArrayList<>();
 | 
					        List<String> list = new ArrayList<>();
 | 
				
			||||||
        ObjectCodec objectCodec = jsonParser.getCodec();
 | 
					        ObjectCodec objectCodec = jsonParser.getCodec();
 | 
				
			||||||
        JsonNode listOrObjectNode = objectCodec.readTree(jsonParser);
 | 
					        JsonNode listOrObjectNode = objectCodec.readTree(jsonParser);
 | 
				
			||||||
        String deserialize = "";
 | 
					        String deserialize = "";
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            if (listOrObjectNode.isArray()) {
 | 
					            if (listOrObjectNode.isArray()) {
 | 
				
			||||||
                for (JsonNode node : listOrObjectNode) {
 | 
					                for (JsonNode node : listOrObjectNode) {
 | 
				
			||||||
                    list.add(objectCodec.treeToValue(node, DictValueVO.class));
 | 
					                    list.add(node.asText());
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                list.add(objectCodec.treeToValue(listOrObjectNode, DictValueVO.class));
 | 
					                list.add(listOrObjectNode.asText());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            deserialize = list.stream().map(DictValueVO::getValueCode).collect(Collectors.joining(","));
 | 
					            deserialize = String.join(",", list);
 | 
				
			||||||
        } catch (Exception e) {
 | 
					        } catch (Exception e) {
 | 
				
			||||||
            log.error(e.getMessage(), e);
 | 
					            log.error(e.getMessage(), e);
 | 
				
			||||||
            deserialize = listOrObjectNode.asText();
 | 
					            deserialize = listOrObjectNode.asText();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,6 @@ import org.apache.commons.collections4.CollectionUtils;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
import java.util.stream.Collectors;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 分页工具类
 | 
					 * 分页工具类
 | 
				
			||||||
@@ -32,6 +31,10 @@ public class SmartPageUtil {
 | 
				
			|||||||
    public static Page<?> convert2PageQuery(PageParam pageParam) {
 | 
					    public static Page<?> convert2PageQuery(PageParam pageParam) {
 | 
				
			||||||
        Page<?> page = new Page<>(pageParam.getPageNum(), pageParam.getPageSize());
 | 
					        Page<?> page = new Page<>(pageParam.getPageNum(), pageParam.getPageSize());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (pageParam.getSearchCount() != null) {
 | 
				
			||||||
 | 
					            page.setSearchCount(pageParam.getSearchCount());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        List<PageParam.SortItem> sortItemList = pageParam.getSortItemList();
 | 
					        List<PageParam.SortItem> sortItemList = pageParam.getSortItemList();
 | 
				
			||||||
        if (CollectionUtils.isEmpty(sortItemList)) {
 | 
					        if (CollectionUtils.isEmpty(sortItemList)) {
 | 
				
			||||||
            return page;
 | 
					            return page;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,10 +7,12 @@ import com.alibaba.druid.support.http.StatViewServlet;
 | 
				
			|||||||
import com.alibaba.druid.support.http.WebStatFilter;
 | 
					import com.alibaba.druid.support.http.WebStatFilter;
 | 
				
			||||||
import com.alibaba.druid.support.spring.stat.DruidStatInterceptor;
 | 
					import com.alibaba.druid.support.spring.stat.DruidStatInterceptor;
 | 
				
			||||||
import com.baomidou.mybatisplus.annotation.DbType;
 | 
					import com.baomidou.mybatisplus.annotation.DbType;
 | 
				
			||||||
 | 
					import com.baomidou.mybatisplus.core.config.GlobalConfig;
 | 
				
			||||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
 | 
					import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
 | 
				
			||||||
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
 | 
					import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
 | 
				
			||||||
import lombok.extern.slf4j.Slf4j;
 | 
					import lombok.extern.slf4j.Slf4j;
 | 
				
			||||||
import net.lab1024.sa.base.common.domain.DataScopePlugin;
 | 
					import net.lab1024.sa.base.common.domain.DataScopePlugin;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.handler.MybatisPlusFillHandler;
 | 
				
			||||||
import org.apache.ibatis.plugin.Interceptor;
 | 
					import org.apache.ibatis.plugin.Interceptor;
 | 
				
			||||||
import org.apache.ibatis.session.SqlSessionFactory;
 | 
					import org.apache.ibatis.session.SqlSessionFactory;
 | 
				
			||||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
 | 
					import org.springframework.aop.support.DefaultPointcutAdvisor;
 | 
				
			||||||
@@ -144,6 +146,8 @@ public class DataSourceConfig {
 | 
				
			|||||||
            pluginsList.add(dataScopePlugin);
 | 
					            pluginsList.add(dataScopePlugin);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        factoryBean.setPlugins(pluginsList.toArray(new Interceptor[pluginsList.size()]));
 | 
					        factoryBean.setPlugins(pluginsList.toArray(new Interceptor[pluginsList.size()]));
 | 
				
			||||||
 | 
					        // 添加字段自动填充处理
 | 
				
			||||||
 | 
					        factoryBean.setGlobalConfig(new GlobalConfig().setBanner(false).setMetaObjectHandler(new MybatisPlusFillHandler()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return factoryBean.getObject();
 | 
					        return factoryBean.getObject();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.PropertyAccessor;
 | 
				
			|||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
 | 
					import com.fasterxml.jackson.databind.DeserializationFeature;
 | 
				
			||||||
import com.fasterxml.jackson.databind.ObjectMapper;
 | 
					import com.fasterxml.jackson.databind.ObjectMapper;
 | 
				
			||||||
import com.fasterxml.jackson.databind.SerializationFeature;
 | 
					import com.fasterxml.jackson.databind.SerializationFeature;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
 | 
				
			||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 | 
					import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 | 
				
			||||||
import org.springframework.context.annotation.Bean;
 | 
					import org.springframework.context.annotation.Bean;
 | 
				
			||||||
import org.springframework.context.annotation.Configuration;
 | 
					import org.springframework.context.annotation.Configuration;
 | 
				
			||||||
@@ -43,7 +44,8 @@ public class RedisConfig {
 | 
				
			|||||||
                .setSerializationInclusion(JsonInclude.Include.NON_NULL);
 | 
					                .setSerializationInclusion(JsonInclude.Include.NON_NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
 | 
					        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
 | 
				
			||||||
        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
 | 
					        // enableDefaultTyping 官方已弃用 所以改为 activateDefaultTyping
 | 
				
			||||||
 | 
					        om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL);
 | 
				
			||||||
        jackson2JsonRedisSerializer.setObjectMapper(om);
 | 
					        jackson2JsonRedisSerializer.setObjectMapper(om);
 | 
				
			||||||
        RedisTemplate<String, Object> template = new RedisTemplate<>();
 | 
					        RedisTemplate<String, Object> template = new RedisTemplate<>();
 | 
				
			||||||
        template.setConnectionFactory(factory);
 | 
					        template.setConnectionFactory(factory);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,40 @@
 | 
				
			|||||||
 | 
					package net.lab1024.sa.base.handler;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
 | 
				
			||||||
 | 
					import lombok.extern.slf4j.Slf4j;
 | 
				
			||||||
 | 
					import org.apache.ibatis.reflection.MetaObject;
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Component;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Mybatis Plus 插入或者更新时指定字段设置值
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author zhoumingfa
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Component
 | 
				
			||||||
 | 
					@Slf4j
 | 
				
			||||||
 | 
					public class MybatisPlusFillHandler implements MetaObjectHandler {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static final String CREATE_TIME = "createTime";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static final String UPDATE_TIME = "updateTime";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void insertFill(MetaObject metaObject) {
 | 
				
			||||||
 | 
					        if (metaObject.hasSetter(CREATE_TIME)) {
 | 
				
			||||||
 | 
					            this.fillStrategy(metaObject, CREATE_TIME, LocalDateTime.now());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (metaObject.hasSetter(UPDATE_TIME)) {
 | 
				
			||||||
 | 
					            this.fillStrategy(metaObject, UPDATE_TIME, LocalDateTime.now());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void updateFill(MetaObject metaObject) {
 | 
				
			||||||
 | 
					        if (metaObject.hasSetter(UPDATE_TIME)) {
 | 
				
			||||||
 | 
					            this.fillStrategy(metaObject, UPDATE_TIME, LocalDateTime.now());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -41,7 +41,7 @@ public enum CodeFrontComponentEnum implements BaseEnum {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public Object getValue() {
 | 
					    public String getValue() {
 | 
				
			||||||
        return value;
 | 
					        return value;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,6 @@ public class CodeGeneratorConfigForm {
 | 
				
			|||||||
    @Schema(description = "表名")
 | 
					    @Schema(description = "表名")
 | 
				
			||||||
    private String tableName;
 | 
					    private String tableName;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Valid
 | 
					    @Valid
 | 
				
			||||||
    @NotNull(message = "基础信息不能为空")
 | 
					    @NotNull(message = "基础信息不能为空")
 | 
				
			||||||
    @Schema(description = "基础信息")
 | 
					    @Schema(description = "基础信息")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,8 +39,8 @@ public class CodeInsertAndUpdateField {
 | 
				
			|||||||
    @Schema(description = "更新标识")
 | 
					    @Schema(description = "更新标识")
 | 
				
			||||||
    private Boolean updateFlag;
 | 
					    private Boolean updateFlag;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @SchemaEnum(value = CodeGeneratorPageTypeEnum.class)
 | 
					    @SchemaEnum(value = CodeFrontComponentEnum.class)
 | 
				
			||||||
    @CheckEnum(value = CodeFrontComponentEnum.class, message = "3.增加、修改  增加、修改 组件类型 枚举值错误", required = true)
 | 
					    @CheckEnum(value = CodeFrontComponentEnum.class, message = "3.增加、修改 组件类型 枚举值错误", required = true)
 | 
				
			||||||
    private String frontComponent;
 | 
					    private String frontComponent;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,16 +13,13 @@ import net.lab1024.sa.base.common.util.SmartStringUtil;
 | 
				
			|||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.entity.CodeGeneratorConfigEntity;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.entity.CodeGeneratorConfigEntity;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.*;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.*;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.backend.ControllerVariableService;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.backend.DaoVariableService;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.backend.*;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.backend.ManagerVariableService;
 | 
					 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.backend.ServiceVariableService;
 | 
					 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.backend.domain.*;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.backend.domain.*;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.front.ApiVariableService;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.front.ApiVariableService;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.front.ConstVariableService;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.front.ConstVariableService;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.front.FormVariableService;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.front.FormVariableService;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.front.ListVariableService;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.front.ListVariableService;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
 | 
					 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.util.CodeGeneratorTool;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.util.CodeGeneratorTool;
 | 
				
			||||||
import org.apache.commons.collections4.CollectionUtils;
 | 
					import org.apache.commons.collections4.CollectionUtils;
 | 
				
			||||||
import org.apache.velocity.Template;
 | 
					import org.apache.velocity.Template;
 | 
				
			||||||
@@ -36,7 +33,7 @@ import javax.annotation.PostConstruct;
 | 
				
			|||||||
import java.io.File;
 | 
					import java.io.File;
 | 
				
			||||||
import java.io.OutputStream;
 | 
					import java.io.OutputStream;
 | 
				
			||||||
import java.io.StringWriter;
 | 
					import java.io.StringWriter;
 | 
				
			||||||
import java.nio.charset.Charset;
 | 
					import java.nio.charset.StandardCharsets;
 | 
				
			||||||
import java.util.*;
 | 
					import java.util.*;
 | 
				
			||||||
import java.util.stream.Collectors;
 | 
					import java.util.stream.Collectors;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -47,7 +44,7 @@ import java.util.stream.Collectors;
 | 
				
			|||||||
 * @Date 2022-06-30 22:15:38
 | 
					 * @Date 2022-06-30 22:15:38
 | 
				
			||||||
 * @Wechat zhuoda1024
 | 
					 * @Wechat zhuoda1024
 | 
				
			||||||
 * @Email lab1024@163.com
 | 
					 * @Email lab1024@163.com
 | 
				
			||||||
 * @Copyright  <a href="https://1024lab.net">1024创新实验室</a>
 | 
					 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Service
 | 
					@Service
 | 
				
			||||||
@@ -70,6 +67,8 @@ public class CodeGeneratorTemplateService {
 | 
				
			|||||||
        map.put("java/manager/Manager.java", new ManagerVariableService());
 | 
					        map.put("java/manager/Manager.java", new ManagerVariableService());
 | 
				
			||||||
        map.put("java/dao/Dao.java", new DaoVariableService());
 | 
					        map.put("java/dao/Dao.java", new DaoVariableService());
 | 
				
			||||||
        map.put("java/mapper/Mapper.xml", new MapperVariableService());
 | 
					        map.put("java/mapper/Mapper.xml", new MapperVariableService());
 | 
				
			||||||
 | 
					        // 菜单 SQL
 | 
				
			||||||
 | 
					        map.put("java/sql/Menu.sql", new MenuVariableService());
 | 
				
			||||||
        // 前端
 | 
					        // 前端
 | 
				
			||||||
        map.put("js/api.js", new ApiVariableService());
 | 
					        map.put("js/api.js", new ApiVariableService());
 | 
				
			||||||
        map.put("js/const.js", new ConstVariableService());
 | 
					        map.put("js/const.js", new ConstVariableService());
 | 
				
			||||||
@@ -94,6 +93,7 @@ public class CodeGeneratorTemplateService {
 | 
				
			|||||||
                String fileName = templateFile.startsWith("java") ? upperCamel + templateSplit[templateSplit.length - 1] : lowerHyphen + "-" + templateSplit[templateSplit.length - 1];
 | 
					                String fileName = templateFile.startsWith("java") ? upperCamel + templateSplit[templateSplit.length - 1] : lowerHyphen + "-" + templateSplit[templateSplit.length - 1];
 | 
				
			||||||
                String fullPathFileName = templateFile.replaceAll(templateSplit[templateSplit.length - 1], fileName);
 | 
					                String fullPathFileName = templateFile.replaceAll(templateSplit[templateSplit.length - 1], fileName);
 | 
				
			||||||
                fullPathFileName = fullPathFileName.replaceAll("java/", "java/" + basic.getModuleName().toLowerCase() + "/");
 | 
					                fullPathFileName = fullPathFileName.replaceAll("java/", "java/" + basic.getModuleName().toLowerCase() + "/");
 | 
				
			||||||
 | 
					                fullPathFileName = fullPathFileName.replaceAll("js/", "js/" + lowerHyphen + "/");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                String fileContent = generate(tableName, templateFile, codeGeneratorConfigEntity);
 | 
					                String fileContent = generate(tableName, templateFile, codeGeneratorConfigEntity);
 | 
				
			||||||
                File file = new File(uuid + "/" + fullPathFileName);
 | 
					                File file = new File(uuid + "/" + fullPathFileName);
 | 
				
			||||||
@@ -129,7 +129,7 @@ public class CodeGeneratorTemplateService {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ZipUtil.zip(outputStream, Charset.forName("utf-8"), false, null, dir);
 | 
					        ZipUtil.zip(outputStream, StandardCharsets.UTF_8, false, null, dir);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        FileUtil.del(dir);
 | 
					        FileUtil.del(dir);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.module.support.codegenerator.service.variable;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.google.common.base.CaseFormat;
 | 
					import com.google.common.base.CaseFormat;
 | 
				
			||||||
import net.lab1024.sa.base.common.util.SmartStringUtil;
 | 
					import net.lab1024.sa.base.common.util.SmartStringUtil;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.module.support.codegenerator.constant.CodeFrontComponentEnum;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdate;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdate;
 | 
				
			||||||
@@ -17,7 +18,7 @@ import java.util.stream.Collectors;
 | 
				
			|||||||
 * @Date 2022/9/29 17:20:41
 | 
					 * @Date 2022/9/29 17:20:41
 | 
				
			||||||
 * @Wechat zhuoda1024
 | 
					 * @Wechat zhuoda1024
 | 
				
			||||||
 * @Email lab1024@163.com
 | 
					 * @Email lab1024@163.com
 | 
				
			||||||
 * @Copyright  <a href="https://1024lab.net">1024创新实验室</a>
 | 
					 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
public abstract class CodeGenerateBaseVariableService {
 | 
					public abstract class CodeGenerateBaseVariableService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -43,13 +44,13 @@ public abstract class CodeGenerateBaseVariableService {
 | 
				
			|||||||
        String upperCamelName = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_CAMEL, form.getBasic().getModuleName());
 | 
					        String upperCamelName = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_CAMEL, form.getBasic().getModuleName());
 | 
				
			||||||
        ArrayList<String> list = new ArrayList<>();
 | 
					        ArrayList<String> list = new ArrayList<>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.entity." + upperCamelName + "Entity;" );
 | 
					        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.entity." + upperCamelName + "Entity;");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "AddForm;" );
 | 
					        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "AddForm;");
 | 
				
			||||||
        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "UpdateForm;" );
 | 
					        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "UpdateForm;");
 | 
				
			||||||
        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "QueryForm;" );
 | 
					        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.form." + upperCamelName + "QueryForm;");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.vo." + upperCamelName + "VO;" );
 | 
					        list.add("import " + form.getBasic().getJavaPackageName() + ".domain.vo." + upperCamelName + "VO;");
 | 
				
			||||||
        return list;
 | 
					        return list;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -88,43 +89,33 @@ public abstract class CodeGenerateBaseVariableService {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        CodeInsertAndUpdateField field = first.get();
 | 
					        CodeInsertAndUpdateField field = first.get();
 | 
				
			||||||
        return SmartStringUtil.contains(field.getFrontComponent(), "Upload" );
 | 
					        return SmartStringUtil.equals(field.getFrontComponent(), CodeFrontComponentEnum.FILE_UPLOAD.getValue());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 是否为 枚举
 | 
					     * 是否为 字典
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    protected boolean isDict(String columnName, CodeGeneratorConfigForm form) {
 | 
					    protected boolean isDict(String columnName, CodeGeneratorConfigForm form) {
 | 
				
			||||||
        List<CodeField> fields = form.getFields();
 | 
					        CodeField codeField = getCodeField(columnName, form);
 | 
				
			||||||
        if (CollectionUtils.isEmpty(fields)) {
 | 
					        return codeField != null && codeField.getDict() != null;
 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        Optional<CodeField> first = fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst();
 | 
					 | 
				
			||||||
        if (first.isPresent()) {
 | 
					 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        CodeField codeField = first.get();
 | 
					 | 
				
			||||||
        return codeField.getDict() != null;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 是否为 枚举
 | 
					     * 是否为 枚举
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    protected boolean isEnum(String columnName, CodeGeneratorConfigForm form) {
 | 
					    protected boolean isEnum(String columnName, CodeGeneratorConfigForm form) {
 | 
				
			||||||
 | 
					        CodeField codeField = getCodeField(columnName, form);
 | 
				
			||||||
 | 
					        return codeField != null && codeField.getEnumName() != null;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private CodeField getCodeField(String columnName, CodeGeneratorConfigForm form) {
 | 
				
			||||||
        List<CodeField> fields = form.getFields();
 | 
					        List<CodeField> fields = form.getFields();
 | 
				
			||||||
        if (CollectionUtils.isEmpty(fields)) {
 | 
					        if (CollectionUtils.isEmpty(fields)) {
 | 
				
			||||||
            return false;
 | 
					            return null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Optional<CodeField> first = fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst();
 | 
					        Optional<CodeField> first = fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst();
 | 
				
			||||||
        if (first.isPresent()) {
 | 
					        return first.orElse(null);
 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        CodeField codeField = first.get();
 | 
					 | 
				
			||||||
        return codeField.getEnumName() != null;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,27 @@
 | 
				
			|||||||
 | 
					package net.lab1024.sa.base.module.support.codegenerator.service.variable.backend;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.HashMap;
 | 
				
			||||||
 | 
					import java.util.Map;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 目前暂时没用到 这是一个空实现
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author zhoumingfa
 | 
				
			||||||
 | 
					 * @date 2024/8/13
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					public class MenuVariableService extends CodeGenerateBaseVariableService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public boolean isSupport(CodeGeneratorConfigForm form) {
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public Map<String, Object> getInjectVariablesMap(CodeGeneratorConfigForm form) {
 | 
				
			||||||
 | 
					        return new HashMap<>(2);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.module.support.codegenerator.service.variable.backen
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import cn.hutool.core.bean.BeanUtil;
 | 
					import cn.hutool.core.bean.BeanUtil;
 | 
				
			||||||
import net.lab1024.sa.base.common.util.SmartStringUtil;
 | 
					import net.lab1024.sa.base.common.util.SmartStringUtil;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.module.support.codegenerator.constant.CodeFrontComponentEnum;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdate;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdate;
 | 
				
			||||||
@@ -100,7 +101,6 @@ public class AddFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
            //字典
 | 
					            //字典
 | 
				
			||||||
            if (SmartStringUtil.isNotEmpty(codeField.getDict())) {
 | 
					            if (SmartStringUtil.isNotEmpty(codeField.getDict())) {
 | 
				
			||||||
                finalFieldMap.put("dict", "\n    @JsonDeserialize(using = DictValueVoDeserializer.class)");
 | 
					                finalFieldMap.put("dict", "\n    @JsonDeserialize(using = DictValueVoDeserializer.class)");
 | 
				
			||||||
@@ -109,7 +109,7 @@ public class AddFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //文件上传
 | 
					            //文件上传
 | 
				
			||||||
            if (SmartStringUtil.contains(field.getFrontComponent(), "Upload")) {
 | 
					            if (CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(field.getFrontComponent())) {
 | 
				
			||||||
                finalFieldMap.put("file", "\n    @JsonDeserialize(using = FileKeyVoDeserializer.class)");
 | 
					                finalFieldMap.put("file", "\n    @JsonDeserialize(using = FileKeyVoDeserializer.class)");
 | 
				
			||||||
                packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
 | 
					                packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
 | 
				
			||||||
                packageList.add("import net.lab1024.sa.base.common.json.deserializer.FileKeyVoDeserializer;");
 | 
					                packageList.add("import net.lab1024.sa.base.common.json.deserializer.FileKeyVoDeserializer;");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
 | 
				
			|||||||
 * @Date 2022/9/29 17:20:41
 | 
					 * @Date 2022/9/29 17:20:41
 | 
				
			||||||
 * @Wechat zhuoda1024
 | 
					 * @Wechat zhuoda1024
 | 
				
			||||||
 * @Email lab1024@163.com
 | 
					 * @Email lab1024@163.com
 | 
				
			||||||
 * @Copyright  <a href="https://1024lab.net">1024创新实验室</a>
 | 
					 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class EntityVariableService extends CodeGenerateBaseVariableService {
 | 
					public class EntityVariableService extends CodeGenerateBaseVariableService {
 | 
				
			||||||
@@ -54,14 +54,21 @@ public class EntityVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
        // mybatis plus
 | 
					        // mybatis plus
 | 
				
			||||||
        result.add("import com.baomidou.mybatisplus.annotation.TableName;");
 | 
					        result.add("import com.baomidou.mybatisplus.annotation.TableName;");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 自动填充注解
 | 
				
			||||||
 | 
					        boolean existCreateAndUpdate = fields.stream().anyMatch(e -> "create_time".equals(e.getColumnName()) || "update_time".equals(e.getColumnName()));
 | 
				
			||||||
 | 
					        if (existCreateAndUpdate) {
 | 
				
			||||||
 | 
					            result.add("import com.baomidou.mybatisplus.annotation.FieldFill;");
 | 
				
			||||||
 | 
					            result.add("import com.baomidou.mybatisplus.annotation.TableField;");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //主键
 | 
					        //主键
 | 
				
			||||||
        boolean isExistPrimaryKey = fields.stream().filter(e -> e.getPrimaryKeyFlag() != null && e.getPrimaryKeyFlag()).findFirst().isPresent();
 | 
					        boolean isExistPrimaryKey = fields.stream().anyMatch(e -> e.getPrimaryKeyFlag() != null && e.getPrimaryKeyFlag());
 | 
				
			||||||
        if (isExistPrimaryKey) {
 | 
					        if (isExistPrimaryKey) {
 | 
				
			||||||
            result.add("import com.baomidou.mybatisplus.annotation.TableId;");
 | 
					            result.add("import com.baomidou.mybatisplus.annotation.TableId;");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //自增
 | 
					        //自增
 | 
				
			||||||
        boolean isExistAutoIncrease = fields.stream().filter(e -> e.getAutoIncreaseFlag() != null && e.getAutoIncreaseFlag()).findFirst().isPresent();
 | 
					        boolean isExistAutoIncrease = fields.stream().anyMatch(e -> e.getAutoIncreaseFlag() != null && e.getAutoIncreaseFlag());
 | 
				
			||||||
        if (isExistAutoIncrease) {
 | 
					        if (isExistAutoIncrease) {
 | 
				
			||||||
            result.add("import com.baomidou.mybatisplus.annotation.IdType;");
 | 
					            result.add("import com.baomidou.mybatisplus.annotation.IdType;");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,19 +3,20 @@ package net.lab1024.sa.base.module.support.codegenerator.service.variable.backen
 | 
				
			|||||||
import cn.hutool.core.bean.BeanUtil;
 | 
					import cn.hutool.core.bean.BeanUtil;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdateField;
 | 
					 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeQueryField;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeQueryField;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
 | 
				
			||||||
import org.apache.commons.collections4.CollectionUtils;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.*;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					import java.util.HashMap;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import java.util.Map;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @Author 1024创新实验室-主任:卓大
 | 
					 * @Author 1024创新实验室-主任:卓大
 | 
				
			||||||
 * @Date 2022/9/29 17:20:41
 | 
					 * @Date 2022/9/29 17:20:41
 | 
				
			||||||
 * @Wechat zhuoda1024
 | 
					 * @Wechat zhuoda1024
 | 
				
			||||||
 * @Email lab1024@163.com
 | 
					 * @Email lab1024@163.com
 | 
				
			||||||
 * @Copyright  <a href="https://1024lab.net">1024创新实验室</a>
 | 
					 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class MapperVariableService extends CodeGenerateBaseVariableService {
 | 
					public class MapperVariableService extends CodeGenerateBaseVariableService {
 | 
				
			||||||
@@ -39,55 +40,47 @@ public class MapperVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
                List<String> columnNameList = queryField.getColumnNameList();
 | 
					                List<String> columnNameList = queryField.getColumnNameList();
 | 
				
			||||||
                if (columnNameList.size() == 1) {
 | 
					                if (columnNameList.size() == 1) {
 | 
				
			||||||
                    // AND INSTR(t_notice.title,#{query.keywords})
 | 
					                    // 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(form.getTableName()).append(".").append(queryField.getColumnNameList().get(0))
 | 
				
			||||||
                            .append(",#{queryForm." )
 | 
					                            .append(",#{queryForm.")
 | 
				
			||||||
                            .append(queryField.getFieldName())
 | 
					                            .append(queryField.getFieldName())
 | 
				
			||||||
                            .append("})" );
 | 
					                            .append("})");
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    for (int i = 0; i < columnNameList.size(); i++) {
 | 
					                    for (int i = 0; i < columnNameList.size(); i++) {
 | 
				
			||||||
                        if (i == 0) {
 | 
					                        if (i == 0) {
 | 
				
			||||||
                            stringBuilder.append("AND ( INSTR(" )
 | 
					                            stringBuilder.append("AND ( INSTR(")
 | 
				
			||||||
                                    .append(form.getTableName()).append("." ).append(queryField.getColumnNameList().get(i))
 | 
					                                    .append(form.getTableName()).append(".").append(queryField.getColumnNameList().get(i))
 | 
				
			||||||
                                    .append(",#{queryForm." )
 | 
					                                    .append(",#{queryForm.")
 | 
				
			||||||
                                    .append(queryField.getFieldName())
 | 
					                                    .append(queryField.getFieldName())
 | 
				
			||||||
                                    .append("})" );
 | 
					                                    .append("})");
 | 
				
			||||||
                        } else {
 | 
					                        } else {
 | 
				
			||||||
                            // OR INSTR(t_notice.author,#{query.keywords})
 | 
					                            // 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(form.getTableName()).append(".").append(queryField.getColumnNameList().get(i))
 | 
				
			||||||
                                    .append(",#{queryForm." )
 | 
					                                    .append(",#{queryForm.")
 | 
				
			||||||
                                    .append(queryField.getFieldName())
 | 
					                                    .append(queryField.getFieldName())
 | 
				
			||||||
                                    .append("})" );
 | 
					                                    .append("})");
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    stringBuilder.append("\n            )" );
 | 
					                    stringBuilder.append("\n            )");
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                fieldMap.put("likeStr", stringBuilder.toString());
 | 
					                fieldMap.put("likeStr", stringBuilder.toString());
 | 
				
			||||||
            }else{
 | 
					            } else if (CodeQueryFieldQueryTypeEnum.DICT.equalsValue(queryField.getQueryTypeEnum())) {
 | 
				
			||||||
                fieldMap.put("columnName",queryField.getColumnNameList().get(0));
 | 
					                String stringBuilder = "AND INSTR(" +
 | 
				
			||||||
 | 
					                        form.getTableName() + "." + queryField.getColumnNameList().get(0) +
 | 
				
			||||||
 | 
					                        ",#{queryForm." +
 | 
				
			||||||
 | 
					                        queryField.getFieldName() +
 | 
				
			||||||
 | 
					                        "})";
 | 
				
			||||||
 | 
					                fieldMap.put("likeStr", stringBuilder);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else {
 | 
				
			||||||
 | 
					                fieldMap.put("columnName", queryField.getColumnNameList().get(0));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        variablesMap.put("queryFields", finalQueryFiledList);
 | 
					        variablesMap.put("queryFields", finalQueryFiledList);
 | 
				
			||||||
        variablesMap.put("daoClassName", form.getBasic().getJavaPackageName() + ".dao." + form.getBasic().getModuleName() + "Dao" );
 | 
					        variablesMap.put("daoClassName", form.getBasic().getJavaPackageName() + ".dao." + form.getBasic().getModuleName() + "Dao");
 | 
				
			||||||
        return variablesMap;
 | 
					        return variablesMap;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public List<String> getPackageList(List<CodeInsertAndUpdateField> fields, CodeGeneratorConfigForm form) {
 | 
					 | 
				
			||||||
        if (CollectionUtils.isEmpty(fields)) {
 | 
					 | 
				
			||||||
            return new ArrayList<>();
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        HashSet<String> packageList = new HashSet<>();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //1、javabean相关的包
 | 
					 | 
				
			||||||
        packageList.addAll(getJavaBeanImportClass(form));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //2、dao
 | 
					 | 
				
			||||||
        packageList.add("import " + form.getBasic().getJavaPackageName() + ".dao." + form.getBasic().getModuleName() + "Dao;" );
 | 
					 | 
				
			||||||
        return new ArrayList<>(packageList);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.module.support.codegenerator.service.variable.backen
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import cn.hutool.core.bean.BeanUtil;
 | 
					import cn.hutool.core.bean.BeanUtil;
 | 
				
			||||||
import net.lab1024.sa.base.common.util.SmartEnumUtil;
 | 
					import net.lab1024.sa.base.common.util.SmartEnumUtil;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.common.util.SmartStringUtil;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
				
			||||||
@@ -18,7 +19,7 @@ import java.util.stream.Collectors;
 | 
				
			|||||||
 * @Date 2022/9/29 17:20:41
 | 
					 * @Date 2022/9/29 17:20:41
 | 
				
			||||||
 * @Wechat zhuoda1024
 | 
					 * @Wechat zhuoda1024
 | 
				
			||||||
 * @Email lab1024@163.com
 | 
					 * @Email lab1024@163.com
 | 
				
			||||||
 * @Copyright  <a href="https://1024lab.net">1024创新实验室</a>
 | 
					 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class QueryFormVariableService extends CodeGenerateBaseVariableService {
 | 
					public class QueryFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			||||||
@@ -41,14 +42,11 @@ public class QueryFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public ImmutablePair<List<String>, List<Map<String, Object>>> getPackageListAndFields(CodeGeneratorConfigForm form) {
 | 
					    public ImmutablePair<List<String>, List<Map<String, Object>>> getPackageListAndFields(CodeGeneratorConfigForm form) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        List<CodeQueryField> fields = form.getQueryFields();
 | 
					        List<CodeQueryField> fields = form.getQueryFields();
 | 
				
			||||||
        if (CollectionUtils.isEmpty(fields)) {
 | 
					 | 
				
			||||||
            return ImmutablePair.of(new ArrayList<>(), new ArrayList<>());
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        HashSet<String> packageList = new HashSet<>();
 | 
					        HashSet<String> packageList = new HashSet<>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * 1、LocalDate、LocalDateTime、BigDecimal 类型的包名
 | 
					         * 1、LocalDate、LocalDateTime、BigDecimal 类型的包名
 | 
				
			||||||
         * 2、排序
 | 
					         * 2、排序
 | 
				
			||||||
@@ -75,9 +73,6 @@ public class QueryFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
            CodeField codeField = null;
 | 
					            CodeField codeField = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            switch (queryTypeEnum) {
 | 
					            switch (queryTypeEnum) {
 | 
				
			||||||
                case LIKE:
 | 
					 | 
				
			||||||
                    finalFieldMap.put("javaType", "String");
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
                case EQUAL:
 | 
					                case EQUAL:
 | 
				
			||||||
                    codeField = getCodeFieldByColumnName(field.getColumnNameList().get(0), form);
 | 
					                    codeField = getCodeFieldByColumnName(field.getColumnNameList().get(0), form);
 | 
				
			||||||
                    if (codeField == null) {
 | 
					                    if (codeField == null) {
 | 
				
			||||||
@@ -109,6 +104,14 @@ public class QueryFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                    finalFieldMap.put("javaType", codeField.getJavaType());
 | 
					                    finalFieldMap.put("javaType", codeField.getJavaType());
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
 | 
					                case DICT:
 | 
				
			||||||
 | 
					                    codeField = getCodeFieldByColumnName(field.getColumnNameList().get(0), form);
 | 
				
			||||||
 | 
					                    if (SmartStringUtil.isNotEmpty(codeField.getDict())) {
 | 
				
			||||||
 | 
					                        finalFieldMap.put("dict", "\n    @JsonDeserialize(using = DictValueVoDeserializer.class)");
 | 
				
			||||||
 | 
					                        packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
 | 
				
			||||||
 | 
					                        packageList.add("import net.lab1024.sa.base.common.json.deserializer.DictValueVoDeserializer;");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    finalFieldMap.put("javaType", "String");
 | 
				
			||||||
                default:
 | 
					                default:
 | 
				
			||||||
                    finalFieldMap.put("javaType", "String");
 | 
					                    finalFieldMap.put("javaType", "String");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@@ -116,12 +119,11 @@ public class QueryFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
            finalFieldList.add(finalFieldMap);
 | 
					            finalFieldList.add(finalFieldMap);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
        // lombok
 | 
					        // lombok
 | 
				
			||||||
        packageList.add("import lombok.Data;");
 | 
					        packageList.add("import lombok.Data;");
 | 
				
			||||||
 | 
					        packageList.add("import lombok.EqualsAndHashCode;");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        List<String> packageNameList = packageList.stream().filter(Objects::nonNull).collect(Collectors.toList());
 | 
					        List<String> packageNameList = packageList.stream().filter(Objects::nonNull).sorted().collect(Collectors.toList());
 | 
				
			||||||
        Collections.sort(packageNameList);
 | 
					 | 
				
			||||||
        return ImmutablePair.of(packageNameList, finalFieldList);
 | 
					        return ImmutablePair.of(packageNameList, finalFieldList);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.module.support.codegenerator.service.variable.backen
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import cn.hutool.core.bean.BeanUtil;
 | 
					import cn.hutool.core.bean.BeanUtil;
 | 
				
			||||||
import net.lab1024.sa.base.common.util.SmartStringUtil;
 | 
					import net.lab1024.sa.base.common.util.SmartStringUtil;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.module.support.codegenerator.constant.CodeFrontComponentEnum;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdate;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdate;
 | 
				
			||||||
@@ -18,7 +19,7 @@ import java.util.stream.Collectors;
 | 
				
			|||||||
 * @Date 2022/9/29 17:20:41
 | 
					 * @Date 2022/9/29 17:20:41
 | 
				
			||||||
 * @Wechat zhuoda1024
 | 
					 * @Wechat zhuoda1024
 | 
				
			||||||
 * @Email lab1024@163.com
 | 
					 * @Email lab1024@163.com
 | 
				
			||||||
 * @Copyright  <a href="https://1024lab.net">1024创新实验室</a>
 | 
					 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class UpdateFormVariableService extends CodeGenerateBaseVariableService {
 | 
					public class UpdateFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			||||||
@@ -42,7 +43,7 @@ public class UpdateFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
                        return false;
 | 
					                        return false;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if(Boolean.TRUE.equals(codeField.getPrimaryKeyFlag())){
 | 
					                    if (Boolean.TRUE.equals(codeField.getPrimaryKeyFlag())) {
 | 
				
			||||||
                        e.setRequiredFlag(true);
 | 
					                        e.setRequiredFlag(true);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -123,7 +124,7 @@ public class UpdateFormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //文件上传
 | 
					            //文件上传
 | 
				
			||||||
            if (SmartStringUtil.contains(field.getFrontComponent(), "Upload")) {
 | 
					            if (CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(field.getFrontComponent())) {
 | 
				
			||||||
                finalFieldMap.put("file", "\n    @JsonDeserialize(using = FileKeyVoDeserializer.class)");
 | 
					                finalFieldMap.put("file", "\n    @JsonDeserialize(using = FileKeyVoDeserializer.class)");
 | 
				
			||||||
                packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
 | 
					                packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
 | 
				
			||||||
                packageList.add("import net.lab1024.sa.base.common.json.deserializer.FileKeyVoDeserializer;");
 | 
					                packageList.add("import net.lab1024.sa.base.common.json.deserializer.FileKeyVoDeserializer;");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,7 @@ import java.util.stream.Collectors;
 | 
				
			|||||||
 * @Date 2022/9/29 17:20:41
 | 
					 * @Date 2022/9/29 17:20:41
 | 
				
			||||||
 * @Wechat zhuoda1024
 | 
					 * @Wechat zhuoda1024
 | 
				
			||||||
 * @Email lab1024@163.com
 | 
					 * @Email lab1024@163.com
 | 
				
			||||||
 * @Copyright  <a href="https://1024lab.net">1024创新实验室</a>
 | 
					 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class VOVariableService extends CodeGenerateBaseVariableService {
 | 
					public class VOVariableService extends CodeGenerateBaseVariableService {
 | 
				
			||||||
@@ -87,16 +87,16 @@ public class VOVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            //字典
 | 
					            //字典
 | 
				
			||||||
            if (isDict(field.getColumnName(), form)) {
 | 
					            if (isDict(field.getColumnName(), form)) {
 | 
				
			||||||
                finalFieldMap.put("dict", "\n    @JsonDeserialize(using = DictValueVoDeserializer.class)");
 | 
					                finalFieldMap.put("dict", "\n    @JsonSerialize(using = DictValueVoSerializer.class)");
 | 
				
			||||||
                packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
 | 
					                packageList.add("import com.fasterxml.jackson.databind.annotation.JsonSerialize;");
 | 
				
			||||||
                packageList.add("import net.lab1024.sa.base.common.json.deserializer.DictValueVoDeserializer;");
 | 
					                packageList.add("import net.lab1024.sa.base.common.json.serializer.DictValueVoSerializer;");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //文件上传
 | 
					            //文件上传
 | 
				
			||||||
            if (isFile(field.getColumnName(), form)) {
 | 
					            if (isFile(field.getColumnName(), form)) {
 | 
				
			||||||
                finalFieldMap.put("file", "\n    @JsonDeserialize(using = FileKeyVoDeserializer.class)");
 | 
					                finalFieldMap.put("file", "\n    @JsonSerialize(using = FileKeyVoSerializer.class)");
 | 
				
			||||||
                packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
 | 
					                packageList.add("import com.fasterxml.jackson.databind.annotation.JsonSerialize;");
 | 
				
			||||||
                packageList.add("import net.lab1024.sa.base.common.json.deserializer.FileKeyVoDeserializer;");
 | 
					                packageList.add("import net.lab1024.sa.base.common.json.serializer.FileKeyVoSerializer;");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            packageList.add(getJavaPackageName(codeField.getJavaType()));
 | 
					            packageList.add(getJavaPackageName(codeField.getJavaType()));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,19 +57,20 @@ public class FormVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            fieldsVariableList.add(objectMap);
 | 
					            fieldsVariableList.add(objectMap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (CodeFrontComponentEnum.ENUM_SELECT.getValue().equals(field.getFrontComponent())) {
 | 
					            if (CodeFrontComponentEnum.ENUM_SELECT.equalsValue(field.getFrontComponent())) {
 | 
				
			||||||
                frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
 | 
					                frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (CodeFrontComponentEnum.BOOLEAN_SELECT.getValue().equals(field.getFrontComponent())) {
 | 
					            if (CodeFrontComponentEnum.BOOLEAN_SELECT.equalsValue(field.getFrontComponent())) {
 | 
				
			||||||
                frontImportSet.add("import BooleanSelect from '/@/components/framework/boolean-select/index.vue';");
 | 
					                frontImportSet.add("import BooleanSelect from '/@/components/framework/boolean-select/index.vue';");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (CodeFrontComponentEnum.DICT_SELECT.getValue().equals(field.getFrontComponent())) {
 | 
					            if (CodeFrontComponentEnum.DICT_SELECT.equalsValue(field.getFrontComponent())) {
 | 
				
			||||||
                frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';");
 | 
					                frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (CodeFrontComponentEnum.FILE_UPLOAD.getValue().equals(field.getFrontComponent())) {
 | 
					            if (CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(field.getFrontComponent())) {
 | 
				
			||||||
 | 
					                frontImportSet.add("import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';");
 | 
				
			||||||
                frontImportSet.add("import FileUpload from '/@/components/support/file-upload/index.vue';");
 | 
					                frontImportSet.add("import FileUpload from '/@/components/support/file-upload/index.vue';");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 | 
				
			|||||||
import com.google.common.base.CaseFormat;
 | 
					import com.google.common.base.CaseFormat;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeQueryField;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeQueryField;
 | 
				
			||||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
 | 
					import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -35,19 +36,23 @@ public class ListVariableService extends CodeGenerateBaseVariableService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        for (CodeQueryField queryField : queryFields) {
 | 
					        for (CodeQueryField queryField : queryFields) {
 | 
				
			||||||
            Map<String, Object> objectMap = BeanUtil.beanToMap(queryField);
 | 
					            Map<String, Object> objectMap = BeanUtil.beanToMap(queryField);
 | 
				
			||||||
            variableList.add(objectMap);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if("Enum".equals(queryField.getQueryTypeEnum())){
 | 
					            CodeField codeField = getCodeFieldByColumnName(queryField.getColumnNameList().get(0), form);
 | 
				
			||||||
 | 
					            objectMap.put("frontEnumName", codeField.getEnumName());
 | 
				
			||||||
 | 
					            objectMap.put("dict", codeField.getDict());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if(CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum())){
 | 
				
			||||||
                frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
 | 
					                frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if("Dict".equals(queryField.getQueryTypeEnum())){
 | 
					            if(CodeQueryFieldQueryTypeEnum.DICT.equalsValue(queryField.getQueryTypeEnum())){
 | 
				
			||||||
                frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';");
 | 
					                frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if(CodeQueryFieldQueryTypeEnum.DATE_RANGE.getValue().equals(queryField.getQueryTypeEnum())){
 | 
					            if(CodeQueryFieldQueryTypeEnum.DATE_RANGE.equalsValue(queryField.getQueryTypeEnum())){
 | 
				
			||||||
                frontImportSet.add("import { defaultTimeRanges } from '/@/lib/default-time-ranges';");
 | 
					                frontImportSet.add("import { defaultTimeRanges } from '/@/lib/default-time-ranges';");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            variableList.add(objectMap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        variablesMap.put("queryFields",variableList);
 | 
					        variablesMap.put("queryFields",variableList);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -142,6 +142,8 @@ public class SmartJobExecutor implements Runnable {
 | 
				
			|||||||
        logEntity.setSuccessFlag(true);
 | 
					        logEntity.setSuccessFlag(true);
 | 
				
			||||||
        // 执行开始时间
 | 
					        // 执行开始时间
 | 
				
			||||||
        logEntity.setExecuteStartTime(executeTime);
 | 
					        logEntity.setExecuteStartTime(executeTime);
 | 
				
			||||||
 | 
					        logEntity.setExecuteEndTime(executeTime);
 | 
				
			||||||
 | 
					        logEntity.setExecuteTimeMillis(0L);
 | 
				
			||||||
        logEntity.setCreateName(executorName);
 | 
					        logEntity.setCreateName(executorName);
 | 
				
			||||||
        logEntity.setIp(SmartIpUtil.getLocalFirstIp());
 | 
					        logEntity.setIp(SmartIpUtil.getLocalFirstIp());
 | 
				
			||||||
        logEntity.setProcessId(SmartJobUtil.getProcessId());
 | 
					        logEntity.setProcessId(SmartJobUtil.getProcessId());
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ package ${packageName};
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import lombok.AllArgsConstructor;
 | 
					import lombok.AllArgsConstructor;
 | 
				
			||||||
import lombok.Getter;
 | 
					import lombok.Getter;
 | 
				
			||||||
 | 
					import net.lab1024.sa.base.common.enumeration.BaseEnum;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * ${enumDesc}
 | 
					 * ${enumDesc}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ package ${packageName};
 | 
				
			|||||||
#foreach ($importClass in $importPackageList)
 | 
					#foreach ($importClass in $importPackageList)
 | 
				
			||||||
$importClass
 | 
					$importClass
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
 | 
					import cn.dev33.satoken.annotation.SaCheckPermission;
 | 
				
			||||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
 | 
					import net.lab1024.sa.base.common.domain.ResponseDTO;
 | 
				
			||||||
import net.lab1024.sa.base.common.domain.PageResult;
 | 
					import net.lab1024.sa.base.common.domain.PageResult;
 | 
				
			||||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
					import org.springframework.web.bind.annotation.PostMapping;
 | 
				
			||||||
@@ -23,7 +24,7 @@ import javax.validation.Valid;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@RestController
 | 
					@RestController
 | 
				
			||||||
@Tag(name = "")
 | 
					@Tag(name = "${basic.description}")
 | 
				
			||||||
public class ${name.upperCamel}Controller {
 | 
					public class ${name.upperCamel}Controller {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Resource
 | 
					    @Resource
 | 
				
			||||||
@@ -31,6 +32,7 @@ public class ${name.upperCamel}Controller {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Operation(summary = "分页查询 @author ${basic.backendAuthor}")
 | 
					    @Operation(summary = "分页查询 @author ${basic.backendAuthor}")
 | 
				
			||||||
    @PostMapping("/${name.lowerCamel}/queryPage")
 | 
					    @PostMapping("/${name.lowerCamel}/queryPage")
 | 
				
			||||||
 | 
					    @SaCheckPermission("${name.lowerCamel}:query")
 | 
				
			||||||
    public ResponseDTO<PageResult<${name.upperCamel}VO>> queryPage(@RequestBody @Valid ${name.upperCamel}QueryForm queryForm) {
 | 
					    public ResponseDTO<PageResult<${name.upperCamel}VO>> queryPage(@RequestBody @Valid ${name.upperCamel}QueryForm queryForm) {
 | 
				
			||||||
        return ResponseDTO.ok(${name.lowerCamel}Service.queryPage(queryForm));
 | 
					        return ResponseDTO.ok(${name.lowerCamel}Service.queryPage(queryForm));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -38,12 +40,14 @@ public class ${name.upperCamel}Controller {
 | 
				
			|||||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
 | 
					#if($insertAndUpdate.isSupportInsertAndUpdate)
 | 
				
			||||||
    @Operation(summary = "添加 @author ${basic.backendAuthor}")
 | 
					    @Operation(summary = "添加 @author ${basic.backendAuthor}")
 | 
				
			||||||
    @PostMapping("/${name.lowerCamel}/add")
 | 
					    @PostMapping("/${name.lowerCamel}/add")
 | 
				
			||||||
 | 
					    @SaCheckPermission("${name.lowerCamel}:add")
 | 
				
			||||||
    public ResponseDTO<String> add(@RequestBody @Valid ${name.upperCamel}AddForm addForm) {
 | 
					    public ResponseDTO<String> add(@RequestBody @Valid ${name.upperCamel}AddForm addForm) {
 | 
				
			||||||
        return ${name.lowerCamel}Service.add(addForm);
 | 
					        return ${name.lowerCamel}Service.add(addForm);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Operation(summary = "更新 @author ${basic.backendAuthor}")
 | 
					    @Operation(summary = "更新 @author ${basic.backendAuthor}")
 | 
				
			||||||
    @PostMapping("/${name.lowerCamel}/update")
 | 
					    @PostMapping("/${name.lowerCamel}/update")
 | 
				
			||||||
 | 
					    @SaCheckPermission("${name.lowerCamel}:update")
 | 
				
			||||||
    public ResponseDTO<String> update(@RequestBody @Valid ${name.upperCamel}UpdateForm updateForm) {
 | 
					    public ResponseDTO<String> update(@RequestBody @Valid ${name.upperCamel}UpdateForm updateForm) {
 | 
				
			||||||
        return ${name.lowerCamel}Service.update(updateForm);
 | 
					        return ${name.lowerCamel}Service.update(updateForm);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -53,6 +57,7 @@ public class ${name.upperCamel}Controller {
 | 
				
			|||||||
    #if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
					    #if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
				
			||||||
    @Operation(summary = "批量删除 @author ${basic.backendAuthor}")
 | 
					    @Operation(summary = "批量删除 @author ${basic.backendAuthor}")
 | 
				
			||||||
    @PostMapping("/${name.lowerCamel}/batchDelete")
 | 
					    @PostMapping("/${name.lowerCamel}/batchDelete")
 | 
				
			||||||
 | 
					    @SaCheckPermission("${name.lowerCamel}:delete")
 | 
				
			||||||
    public ResponseDTO<String> batchDelete(@RequestBody ValidateList<${primaryKeyJavaType}> idList) {
 | 
					    public ResponseDTO<String> batchDelete(@RequestBody ValidateList<${primaryKeyJavaType}> idList) {
 | 
				
			||||||
        return ${name.lowerCamel}Service.batchDelete(idList);
 | 
					        return ${name.lowerCamel}Service.batchDelete(idList);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -61,6 +66,7 @@ public class ${name.upperCamel}Controller {
 | 
				
			|||||||
    #if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
					    #if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
				
			||||||
    @Operation(summary = "单个删除 @author ${basic.backendAuthor}")
 | 
					    @Operation(summary = "单个删除 @author ${basic.backendAuthor}")
 | 
				
			||||||
    @GetMapping("/${name.lowerCamel}/delete/{${primaryKeyFieldName}}")
 | 
					    @GetMapping("/${name.lowerCamel}/delete/{${primaryKeyFieldName}}")
 | 
				
			||||||
 | 
					    @SaCheckPermission("${name.lowerCamel}:delete")
 | 
				
			||||||
    public ResponseDTO<String> batchDelete(@PathVariable ${primaryKeyJavaType} ${primaryKeyFieldName}) {
 | 
					    public ResponseDTO<String> batchDelete(@PathVariable ${primaryKeyJavaType} ${primaryKeyFieldName}) {
 | 
				
			||||||
        return ${name.lowerCamel}Service.delete(${primaryKeyFieldName});
 | 
					        return ${name.lowerCamel}Service.delete(${primaryKeyFieldName});
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,14 +38,15 @@ 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
 | 
					#end
 | 
				
			||||||
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
					#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
 | 
					 | 
				
			||||||
#end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#end
 | 
				
			||||||
 | 
					#end
 | 
				
			||||||
 | 
					#end
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,13 +20,19 @@ public class ${name.upperCamel}Entity {
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * $field.label
 | 
					     * $field.label
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
#if($field.primaryKeyFlag && $field.autoIncreaseFlag)
 | 
					    #if($field.primaryKeyFlag && $field.autoIncreaseFlag)
 | 
				
			||||||
    @TableId(type = IdType.AUTO)
 | 
					    @TableId(type = IdType.AUTO)
 | 
				
			||||||
#end
 | 
					    #end
 | 
				
			||||||
#if($field.primaryKeyFlag && !$field.autoIncreaseFlag)
 | 
					    #if($field.primaryKeyFlag && !$field.autoIncreaseFlag)
 | 
				
			||||||
    @TableId
 | 
					    @TableId
 | 
				
			||||||
#end
 | 
					    #end
 | 
				
			||||||
 | 
					    #if($field.columnName == "create_time")
 | 
				
			||||||
 | 
					    @TableField(fill = FieldFill.INSERT)
 | 
				
			||||||
 | 
					    #end
 | 
				
			||||||
 | 
					    #if($field.columnName == "update_time")
 | 
				
			||||||
 | 
					    @TableField(fill = FieldFill.INSERT_UPDATE)
 | 
				
			||||||
 | 
					    #end
 | 
				
			||||||
    private $field.javaType $field.fieldName;
 | 
					    private $field.javaType $field.fieldName;
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,8 @@ $importClass
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Data
 | 
					@Data
 | 
				
			||||||
public class ${name.upperCamel}QueryForm extends PageParam{
 | 
					@EqualsAndHashCode(callSuper = false)
 | 
				
			||||||
 | 
					public class ${name.upperCamel}QueryForm extends PageParam {
 | 
				
			||||||
#foreach ($field in $fields)
 | 
					#foreach ($field in $fields)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if($field.isEnum)
 | 
					#if($field.isEnum)
 | 
				
			||||||
@@ -35,4 +36,4 @@ public class ${name.upperCamel}QueryForm extends PageParam{
 | 
				
			|||||||
#end
 | 
					#end
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,14 +17,8 @@ public class ${name.upperCamel}VO {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#foreach ($field in $fields)
 | 
					#foreach ($field in $fields)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if($field.isEnum)
 | 
					    ${field.apiModelProperty}$!{field.notEmpty}$!{field.dict}$!{field.file}
 | 
				
			||||||
    ${field.apiModelProperty}
 | 
					 | 
				
			||||||
    private $field.javaType $field.fieldName;
 | 
					    private $field.javaType $field.fieldName;
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
#if(!$field.isEnum)
 | 
					 | 
				
			||||||
    ${field.apiModelProperty}$!{field.dict}$!{field.file}
 | 
					 | 
				
			||||||
    private $field.javaType $field.fieldName;
 | 
					 | 
				
			||||||
#end
 | 
					 | 
				
			||||||
#end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,10 +2,17 @@
 | 
				
			|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
					<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
				
			||||||
<mapper namespace="${daoClassName}">
 | 
					<mapper namespace="${daoClassName}">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- 查询结果列 -->
 | 
				
			||||||
 | 
					    <sql id="base_columns">
 | 
				
			||||||
 | 
					        #foreach ($field in $fields)
 | 
				
			||||||
 | 
					        ${tableName}.${field.columnName}#if($foreach.hasNext),#end
 | 
				
			||||||
 | 
					        #end
 | 
				
			||||||
 | 
					    </sql>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- 分页查询 -->
 | 
					    <!-- 分页查询 -->
 | 
				
			||||||
    <select id="queryPage" resultType="${basic.javaPackageName}.domain.vo.${name.upperCamel}VO">
 | 
					    <select id="queryPage" resultType="${basic.javaPackageName}.domain.vo.${name.upperCamel}VO">
 | 
				
			||||||
        SELECT
 | 
					        SELECT
 | 
				
			||||||
        *
 | 
					        <include refid="base_columns"/>
 | 
				
			||||||
        FROM ${tableName}
 | 
					        FROM ${tableName}
 | 
				
			||||||
#if($queryFields.size() > 0)
 | 
					#if($queryFields.size() > 0)
 | 
				
			||||||
        <where>
 | 
					        <where>
 | 
				
			||||||
@@ -16,22 +23,27 @@
 | 
				
			|||||||
                ${queryField.likeStr}
 | 
					                ${queryField.likeStr}
 | 
				
			||||||
            </if>
 | 
					            </if>
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
#if(${queryField.queryTypeEnum} == "Equal" || ${queryField.queryTypeEnum} == "Enum" || ${queryField.queryTypeEnum} == "Dict")
 | 
					#if(${queryField.queryTypeEnum} == "Dict")
 | 
				
			||||||
 | 
					            <if test="queryForm.${queryField.fieldName} != null and queryForm.${queryField.fieldName} != ''">
 | 
				
			||||||
 | 
					                ${queryField.likeStr}
 | 
				
			||||||
 | 
					            </if>
 | 
				
			||||||
 | 
					#end
 | 
				
			||||||
 | 
					#if(${queryField.queryTypeEnum} == "Equal" || ${queryField.queryTypeEnum} == "Enum")
 | 
				
			||||||
            <if test="queryForm.${queryField.fieldName} != null">
 | 
					            <if test="queryForm.${queryField.fieldName} != null">
 | 
				
			||||||
                AND ${tableName}.${queryField.columnName} = #{queryForm.${queryField.fieldName}}
 | 
					                AND ${tableName}.${queryField.columnName} = #{queryForm.${queryField.fieldName}}
 | 
				
			||||||
            </if>
 | 
					            </if>
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
#if(${queryField.queryTypeEnum} == "Date")
 | 
					#if(${queryField.queryTypeEnum} == "Date")
 | 
				
			||||||
            <if test="queryForm.${queryField.fieldName} != null">
 | 
					            <if test="queryForm.${queryField.fieldName} != null">
 | 
				
			||||||
                AND DATE_FORMAT(${tableName}.${queryField.columnName}, '%Y-%m-%d') = #{queryForm.${queryField.fieldName}}
 | 
					                AND ${tableName}.${queryField.columnName} = #{queryForm.${queryField.fieldName}}
 | 
				
			||||||
            </if>
 | 
					            </if>
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
#if(${queryField.queryTypeEnum} == "DateRange")
 | 
					#if(${queryField.queryTypeEnum} == "DateRange")
 | 
				
			||||||
            <if test="queryForm.${queryField.fieldName}Begin != null">
 | 
					            <if test="queryForm.${queryField.fieldName}Begin != null">
 | 
				
			||||||
                AND DATE_FORMAT(${tableName}.${queryField.columnName}, '%Y-%m-%d') >= #{queryForm.${queryField.fieldName}Begin}
 | 
					                AND ${tableName}.${queryField.columnName} >= #{queryForm.${queryField.fieldName}Begin}
 | 
				
			||||||
            </if>
 | 
					            </if>
 | 
				
			||||||
            <if test="queryForm.${queryField.fieldName}End != null">
 | 
					            <if test="queryForm.${queryField.fieldName}End != null">
 | 
				
			||||||
                AND DATE_FORMAT(${tableName}.${queryField.columnName}, '%Y-%m-%d') <= #{queryForm.${queryField.fieldName}End}
 | 
					                AND ${tableName}.${queryField.columnName} <= #{queryForm.${queryField.fieldName}End}
 | 
				
			||||||
            </if>
 | 
					            </if>
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
@@ -39,21 +51,10 @@
 | 
				
			|||||||
#end
 | 
					#end
 | 
				
			||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if($dao.deletedFieldUpperName != $null)
 | 
					 | 
				
			||||||
    <update id="batchUpdate${dao.deletedFieldUpperName}">
 | 
					 | 
				
			||||||
        update ${mapper.tableName} set ${mapper.deletedColumnName} = #{deletedFlag}
 | 
					 | 
				
			||||||
        where ${mapper.mainKeyColumnName} in
 | 
					 | 
				
			||||||
        <foreach collection="idList" open="(" close=")" separator="," item="item">
 | 
					 | 
				
			||||||
            #{item}
 | 
					 | 
				
			||||||
        </foreach>
 | 
					 | 
				
			||||||
    </update>
 | 
					 | 
				
			||||||
#end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#if($deleteInfo.isSupportDelete)
 | 
					#if($deleteInfo.isSupportDelete)
 | 
				
			||||||
### 假删除
 | 
					### 假删除
 | 
				
			||||||
#if(!${deleteInfo.isPhysicallyDeleted})
 | 
					#if(!${deleteInfo.isPhysicallyDeleted})
 | 
				
			||||||
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
					#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
				
			||||||
 | 
					 | 
				
			||||||
    <update id="batchUpdateDeleted">
 | 
					    <update id="batchUpdateDeleted">
 | 
				
			||||||
        update ${tableName} set deleted_flag = #{deletedFlag}
 | 
					        update ${tableName} set deleted_flag = #{deletedFlag}
 | 
				
			||||||
        where ${primaryKeyColumnName} in
 | 
					        where ${primaryKeyColumnName} in
 | 
				
			||||||
@@ -71,4 +72,5 @@
 | 
				
			|||||||
#end
 | 
					#end
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
</mapper>
 | 
					
 | 
				
			||||||
 | 
					</mapper>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -64,7 +64,7 @@ public class ${name.upperCamel}Service {
 | 
				
			|||||||
#end
 | 
					#end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if($deleteInfo.isSupportDelete)
 | 
					#if($deleteInfo.isSupportDelete)
 | 
				
			||||||
    #if($deleteInfo.deleteEnum == "BATCH" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
					    #if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 批量删除
 | 
					     * 批量删除
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -97,7 +97,7 @@ public class ${name.upperCamel}Service {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### 真删除 or 假删除
 | 
					### 真删除 or 假删除
 | 
				
			||||||
#if(!${deleteInfo.isPhysicallyDeleted})
 | 
					#if(!${deleteInfo.isPhysicallyDeleted})
 | 
				
			||||||
        ${name.lowerCamel}Dao.updateDeleted(${primaryKeyFieldName},true);
 | 
					        ${name.lowerCamel}Dao.updateDeleted(${primaryKeyFieldName}, true);
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
#if(${deleteInfo.isPhysicallyDeleted})
 | 
					#if(${deleteInfo.isPhysicallyDeleted})
 | 
				
			||||||
        ${name.lowerCamel}Dao.deleteById(${primaryKeyFieldName});
 | 
					        ${name.lowerCamel}Dao.deleteById(${primaryKeyFieldName});
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,22 @@
 | 
				
			|||||||
 | 
					# 默认是按前端工程文件的 /views/business 文件夹的路径作为前端组件路径,如果你没把生成的 .vue 前端代码放在 /views/business 下,
 | 
				
			||||||
 | 
					# 那就根据自己实际情况修改下面 SQL 的 path,component 字段值,避免执行 SQL 后菜单无法访问。
 | 
				
			||||||
 | 
					# 如果你一切都是按照默认,那么下面的 SQL 基本不用改
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSERT INTO t_menu ( menu_name, menu_type, parent_id, path, component, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, create_user_id )
 | 
				
			||||||
 | 
					VALUES ( '${basic.description}', 2, 0, '/${name.lowerHyphenCamel}/list', '/business/${name.lowerHyphenCamel}/${name.lowerHyphenCamel}-list.vue', false, false, true, false, 1, 1 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 按菜单名称查询该菜单的 menu_id 作为按钮权限的 父菜单ID 与 功能点关联菜单ID
 | 
				
			||||||
 | 
					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 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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 );
 | 
				
			||||||
@@ -8,7 +8,7 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <a-$!{insertAndUpdate.pageType}
 | 
					  <a-$!{insertAndUpdate.pageType}
 | 
				
			||||||
      :title="form.$!{primaryKeyFieldName} ? '编辑' : '添加'"
 | 
					      :title="form.$!{primaryKeyFieldName} ? '编辑' : '添加'"
 | 
				
			||||||
      width="$!{insertAndUpdate.width}"
 | 
					      :width="$!{insertAndUpdate.width}"
 | 
				
			||||||
      :open="visibleFlag"
 | 
					      :open="visibleFlag"
 | 
				
			||||||
      #if($!{insertAndUpdate.pageType} == 'drawer')
 | 
					      #if($!{insertAndUpdate.pageType} == 'drawer')
 | 
				
			||||||
      @close="onClose"
 | 
					      @close="onClose"
 | 
				
			||||||
@@ -19,124 +19,121 @@
 | 
				
			|||||||
      :destroyOnClose="true"
 | 
					      :destroyOnClose="true"
 | 
				
			||||||
  >
 | 
					  >
 | 
				
			||||||
    <a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }" >
 | 
					    <a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }" >
 | 
				
			||||||
        #if($insertAndUpdate.countPerLine == 1)
 | 
					#if($insertAndUpdate.countPerLine == 1)
 | 
				
			||||||
          <a-row>
 | 
					  #foreach ($field in $formFields)
 | 
				
			||||||
              #foreach ($field in $formFields)
 | 
					      #if($field.frontComponent == "Input")
 | 
				
			||||||
                  #if($field.frontComponent == "Input")
 | 
					        <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					          <a-input style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
				
			||||||
                      <a-input style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					      #if($field.frontComponent == "InputNumber")
 | 
				
			||||||
                  #if($field.frontComponent == "InputNumber")
 | 
					        <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					          <a-input-number style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
				
			||||||
                      <a-input-number style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					      #if($field.frontComponent == "Textarea")
 | 
				
			||||||
                  #if($field.frontComponent == "Textarea")
 | 
					        <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					          <a-textarea style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
				
			||||||
                      <a-textarea style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					      #if($field.frontComponent == "BooleanSelect")
 | 
				
			||||||
                  #if($field.frontComponent == "BooleanSelect")
 | 
					        <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					          <BooleanSelect v-model:value="form.${field.fieldName}" style="width: 100%" />
 | 
				
			||||||
                      <BooleanSelect v-model:value="form.${field.fieldName}" style="width: 100%" />
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					      #if($field.frontComponent == "SmartEnumSelect")
 | 
				
			||||||
                  #if($field.frontComponent == "SmartEnumSelect")
 | 
					        <a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})"  name="${field.fieldName}">
 | 
					          <SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
 | 
				
			||||||
                      <SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					      #if($field.frontComponent == "DictSelect")
 | 
				
			||||||
                  #if($field.frontComponent == "DictSelect")
 | 
					        <a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})"  name="${field.fieldName}">
 | 
					          <DictSelect width="100%" v-model:value="form.${field.fieldName}" keyCode="$!{field.dict}" placeholder="$!{field.label}"/>
 | 
				
			||||||
                      <DictSelect width="100%" v-model:value="form.${field.fieldName}" keyCode="$!{field.dict}" placeholder="$!{field.label}"/>
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					      #if($field.frontComponent == "Date")
 | 
				
			||||||
                  #if($field.frontComponent == "Date")
 | 
					        <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					          <a-date-picker valueFormat="YYYY-MM-DD" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}"/>
 | 
				
			||||||
                      <a-date-picker valueFormat="YYYY-MM-DD" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}"/>
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					      #if($field.frontComponent == "DateTime")
 | 
				
			||||||
                  #if($field.frontComponent == "DateTime")
 | 
					        <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					          <a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}" />
 | 
				
			||||||
                      <a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}" />
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					      #if($field.frontComponent == "FileUpload")
 | 
				
			||||||
                  #if($field.frontComponent == "Upload")
 | 
					        <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
                    <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					          <FileUpload
 | 
				
			||||||
                      <FileUpload
 | 
					              :defaultFileList="form.$!{field.fieldName}"
 | 
				
			||||||
                          :defaultFileList="form.$!{field.fieldName}"
 | 
					              :folder="FILE_FOLDER_TYPE_ENUM.COMMON.value"
 | 
				
			||||||
                          :folder="FILE_FOLDER_TYPE_ENUM.COMMON.value"
 | 
					              buttonText="上传 $!{field.label}"
 | 
				
			||||||
                          buttonText="上传 $!{field.label}"
 | 
					              listType="text"
 | 
				
			||||||
                          listType="text"
 | 
					              @change="e => form.$!{field.fieldName} = e"
 | 
				
			||||||
                          @change="e => form.$!{field.fieldName} = e"
 | 
					          />
 | 
				
			||||||
                      />
 | 
					        </a-form-item>
 | 
				
			||||||
                    </a-form-item>
 | 
					      #end
 | 
				
			||||||
                  #end
 | 
					  #end
 | 
				
			||||||
              #end
 | 
					#end
 | 
				
			||||||
          </a-row>
 | 
					    #if($insertAndUpdate.countPerLine > 1)
 | 
				
			||||||
 | 
					      <a-row>
 | 
				
			||||||
 | 
					          #set($span=24 / $!insertAndUpdate.countPerLine )
 | 
				
			||||||
 | 
					      #foreach ($field in $formFields)
 | 
				
			||||||
 | 
					        <a-col :span="$!{span}">
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "Input")
 | 
				
			||||||
 | 
					          <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
 | 
					            <a-input style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
				
			||||||
 | 
					          </a-form-item>
 | 
				
			||||||
        #end
 | 
					        #end
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "InputNumber")
 | 
				
			||||||
        #if($insertAndUpdate.countPerLine > 1)
 | 
					          <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
          <a-row>
 | 
					            <a-input-number style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
				
			||||||
              #set($span=24 / $!insertAndUpdate.countPerLine )
 | 
					          </a-form-item>
 | 
				
			||||||
              #foreach ($field in $formFields)
 | 
					 | 
				
			||||||
                <a-col :span="$!{span}">
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "Input")
 | 
					 | 
				
			||||||
                      <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <a-input style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "InputNumber")
 | 
					 | 
				
			||||||
                      <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <a-input-number style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "Textarea")
 | 
					 | 
				
			||||||
                      <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <a-textarea style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "BooleanSelect")
 | 
					 | 
				
			||||||
                      <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <BooleanSelect v-model:value="form.${field.fieldName}" style="width: 100%" />
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "SmartEnumSelect")
 | 
					 | 
				
			||||||
                      <a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "DictSelect")
 | 
					 | 
				
			||||||
                      <a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <DictSelect width="100%" v-model:value="form.${field.fieldName}" keyCode="$!{field.dict}" placeholder="$!{field.label}"/>
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "Date")
 | 
					 | 
				
			||||||
                      <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <a-date-picker valueFormat="YYYY-MM-DD" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}"/>
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "DateTime")
 | 
					 | 
				
			||||||
                      <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}" />
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                    #if($field.frontComponent == "Upload")
 | 
					 | 
				
			||||||
                      <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
					 | 
				
			||||||
                        <FileUpload
 | 
					 | 
				
			||||||
                            :defaultFileList="form.$!{field.fieldName}"
 | 
					 | 
				
			||||||
                            :folder="FILE_FOLDER_TYPE_ENUM.COMMON.value"
 | 
					 | 
				
			||||||
                            buttonText="上传 $!{field.label}"
 | 
					 | 
				
			||||||
                            listType="text"
 | 
					 | 
				
			||||||
                            @change="e => form.$!{field.fieldName} = e"
 | 
					 | 
				
			||||||
                        />
 | 
					 | 
				
			||||||
                      </a-form-item>
 | 
					 | 
				
			||||||
                    #end
 | 
					 | 
				
			||||||
                </a-col>
 | 
					 | 
				
			||||||
              #end
 | 
					 | 
				
			||||||
          </a-row>
 | 
					 | 
				
			||||||
        #end
 | 
					        #end
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "Textarea")
 | 
				
			||||||
 | 
					          <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
 | 
					            <a-textarea style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
 | 
				
			||||||
 | 
					          </a-form-item>
 | 
				
			||||||
 | 
					        #end
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "BooleanSelect")
 | 
				
			||||||
 | 
					          <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
 | 
					            <BooleanSelect v-model:value="form.${field.fieldName}" style="width: 100%" />
 | 
				
			||||||
 | 
					          </a-form-item>
 | 
				
			||||||
 | 
					        #end
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "SmartEnumSelect")
 | 
				
			||||||
 | 
					          <a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})"  name="${field.fieldName}">
 | 
				
			||||||
 | 
					            <SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
 | 
				
			||||||
 | 
					          </a-form-item>
 | 
				
			||||||
 | 
					        #end
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "DictSelect")
 | 
				
			||||||
 | 
					          <a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})"  name="${field.fieldName}">
 | 
				
			||||||
 | 
					            <DictSelect width="100%" v-model:value="form.${field.fieldName}" keyCode="$!{field.dict}" placeholder="$!{field.label}"/>
 | 
				
			||||||
 | 
					          </a-form-item>
 | 
				
			||||||
 | 
					        #end
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "Date")
 | 
				
			||||||
 | 
					          <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
 | 
					            <a-date-picker valueFormat="YYYY-MM-DD" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}"/>
 | 
				
			||||||
 | 
					          </a-form-item>
 | 
				
			||||||
 | 
					        #end
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "DateTime")
 | 
				
			||||||
 | 
					          <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
 | 
					            <a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}" />
 | 
				
			||||||
 | 
					          </a-form-item>
 | 
				
			||||||
 | 
					        #end
 | 
				
			||||||
 | 
					        #if($field.frontComponent == "FileUpload")
 | 
				
			||||||
 | 
					          <a-form-item label="$!{field.label}"  name="${field.fieldName}">
 | 
				
			||||||
 | 
					            <FileUpload
 | 
				
			||||||
 | 
					                :defaultFileList="form.$!{field.fieldName}"
 | 
				
			||||||
 | 
					                :folder="FILE_FOLDER_TYPE_ENUM.COMMON.value"
 | 
				
			||||||
 | 
					                buttonText="上传 $!{field.label}"
 | 
				
			||||||
 | 
					                listType="text"
 | 
				
			||||||
 | 
					                @change="e => form.$!{field.fieldName} = e"
 | 
				
			||||||
 | 
					            />
 | 
				
			||||||
 | 
					          </a-form-item>
 | 
				
			||||||
 | 
					        #end
 | 
				
			||||||
 | 
					        </a-col>
 | 
				
			||||||
 | 
					      #end
 | 
				
			||||||
 | 
					      </a-row>
 | 
				
			||||||
 | 
					    #end
 | 
				
			||||||
    </a-form>
 | 
					    </a-form>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <template #footer>
 | 
					    <template #footer>
 | 
				
			||||||
@@ -154,9 +151,9 @@
 | 
				
			|||||||
  import { SmartLoading } from '/@/components/framework/smart-loading';
 | 
					  import { SmartLoading } from '/@/components/framework/smart-loading';
 | 
				
			||||||
  import { $!{name.lowerCamel}Api } from '/@/api/business/$!{name.lowerHyphenCamel}/$!{name.lowerHyphenCamel}-api';
 | 
					  import { $!{name.lowerCamel}Api } from '/@/api/business/$!{name.lowerHyphenCamel}/$!{name.lowerHyphenCamel}-api';
 | 
				
			||||||
  import { smartSentry } from '/@/lib/smart-sentry';
 | 
					  import { smartSentry } from '/@/lib/smart-sentry';
 | 
				
			||||||
      #foreach ($import in $frontImportList)
 | 
					  #foreach ($import in $frontImportList)
 | 
				
			||||||
          $!{import}
 | 
					  $!{import}
 | 
				
			||||||
      #end
 | 
					  #end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // ------------------------ 事件 ------------------------
 | 
					  // ------------------------ 事件 ------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -171,6 +168,10 @@
 | 
				
			|||||||
    if (rowData && !_.isEmpty(rowData)) {
 | 
					    if (rowData && !_.isEmpty(rowData)) {
 | 
				
			||||||
      Object.assign(form, rowData);
 | 
					      Object.assign(form, rowData);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    // 使用字典时把下面这注释修改成自己的字典字段 有多个字典字段就复制多份同理修改 不然打开表单时不显示字典初始值
 | 
				
			||||||
 | 
					    // if (form.status && form.status.length > 0) {
 | 
				
			||||||
 | 
					    //   form.status = form.status.map((e) => e.valueCode);
 | 
				
			||||||
 | 
					    // }
 | 
				
			||||||
    visibleFlag.value = true;
 | 
					    visibleFlag.value = true;
 | 
				
			||||||
    nextTick(() => {
 | 
					    nextTick(() => {
 | 
				
			||||||
      formRef.value.clearValidate();
 | 
					      formRef.value.clearValidate();
 | 
				
			||||||
@@ -188,9 +189,8 @@
 | 
				
			|||||||
  const formRef = ref();
 | 
					  const formRef = ref();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const formDefault = {
 | 
					  const formDefault = {
 | 
				
			||||||
          $!{primaryKeyFieldName}: undefined,
 | 
					 | 
				
			||||||
      #foreach ($field in $formFields)
 | 
					      #foreach ($field in $formFields)
 | 
				
			||||||
              $!{field.fieldName}: undefined, //$!{field.label}
 | 
					      $!{field.fieldName}: undefined, //$!{field.label}
 | 
				
			||||||
      #end
 | 
					      #end
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -198,9 +198,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const rules = {
 | 
					  const rules = {
 | 
				
			||||||
      #foreach ($field in $formFields)
 | 
					      #foreach ($field in $formFields)
 | 
				
			||||||
          #if($field.requiredFlag)
 | 
					      #if($field.requiredFlag)
 | 
				
			||||||
                  $!{field.fieldName}: [{ required: true, message: '$!{field.label} 必填' }],
 | 
					      $!{field.fieldName}: [{ required: true, message: '$!{field.label} 必填' }],
 | 
				
			||||||
          #end
 | 
					      #end
 | 
				
			||||||
      #end
 | 
					      #end
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,7 +72,7 @@
 | 
				
			|||||||
                </a-button>
 | 
					                </a-button>
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Batch"||$deleteInfo.deleteEnum == "SingleAndBatch"))
 | 
					#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Batch"||$deleteInfo.deleteEnum == "SingleAndBatch"))
 | 
				
			||||||
                <a-button @click="confirmBatchDelete" type="danger" size="small" :disabled="selectedRowKeyList.length == 0">
 | 
					                <a-button @click="confirmBatchDelete" type="primary" danger size="small" :disabled="selectedRowKeyList.length == 0">
 | 
				
			||||||
                    <template #icon>
 | 
					                    <template #icon>
 | 
				
			||||||
                        <DeleteOutlined />
 | 
					                        <DeleteOutlined />
 | 
				
			||||||
                    </template>
 | 
					                    </template>
 | 
				
			||||||
@@ -88,18 +88,32 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        <!---------- 表格 begin ----------->
 | 
					        <!---------- 表格 begin ----------->
 | 
				
			||||||
        <a-table
 | 
					        <a-table
 | 
				
			||||||
                size="small"
 | 
					            size="small"
 | 
				
			||||||
                :dataSource="tableData"
 | 
					            :dataSource="tableData"
 | 
				
			||||||
                :columns="columns"
 | 
					            :columns="columns"
 | 
				
			||||||
                rowKey="$!{primaryKeyFieldName}"
 | 
					            rowKey="$!{primaryKeyFieldName}"
 | 
				
			||||||
                bordered
 | 
					            bordered
 | 
				
			||||||
                :loading="tableLoading"
 | 
					            :loading="tableLoading"
 | 
				
			||||||
                :pagination="false"
 | 
					            :pagination="false"
 | 
				
			||||||
#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Batch"||$deleteInfo.deleteEnum == "SingleAndBatch"))
 | 
					#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Batch"||$deleteInfo.deleteEnum == "SingleAndBatch"))
 | 
				
			||||||
                :row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
 | 
					            :row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
        >
 | 
					        >
 | 
				
			||||||
            <template #bodyCell="{ text, record, column }">
 | 
					            <template #bodyCell="{ text, record, column }">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						    <!-- 有图片预览时 注释解开并把下面的'picture'修改成自己的图片字段名即可 -->
 | 
				
			||||||
 | 
					              <!-- <template v-if="column.dataIndex === 'picture'">
 | 
				
			||||||
 | 
					                  <FilePreview :fileList="text" type="picture" />
 | 
				
			||||||
 | 
					                </template> -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						    <!-- 使用字典时 注释解开并把下面的'dict'修改成自己的字典字段名即可 有多个字典字段就复制多份同理修改 不然不显示字典 -->
 | 
				
			||||||
 | 
					              <!-- 方便修改tag的颜色 orange green purple success processing error default warning -->
 | 
				
			||||||
 | 
					              <!-- <template v-if="column.dataIndex === 'dict'">
 | 
				
			||||||
 | 
					                <a-tag color="cyan">
 | 
				
			||||||
 | 
					                  {{ text && text.length > 0 ? text.map((e) => e.valueName).join(',') : '暂无' }}
 | 
				
			||||||
 | 
					                </a-tag>
 | 
				
			||||||
 | 
					              </template> -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <template v-if="column.dataIndex === 'action'">
 | 
					                <template v-if="column.dataIndex === 'action'">
 | 
				
			||||||
                    <div class="smart-table-operate">
 | 
					                    <div class="smart-table-operate">
 | 
				
			||||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
 | 
					#if($insertAndUpdate.isSupportInsertAndUpdate)
 | 
				
			||||||
@@ -116,17 +130,17 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        <div class="smart-query-table-page">
 | 
					        <div class="smart-query-table-page">
 | 
				
			||||||
            <a-pagination
 | 
					            <a-pagination
 | 
				
			||||||
                    showSizeChanger
 | 
					                showSizeChanger
 | 
				
			||||||
                    showQuickJumper
 | 
					                showQuickJumper
 | 
				
			||||||
                    show-less-items
 | 
					                show-less-items
 | 
				
			||||||
                    :pageSizeOptions="PAGE_SIZE_OPTIONS"
 | 
					                :pageSizeOptions="PAGE_SIZE_OPTIONS"
 | 
				
			||||||
                    :defaultPageSize="queryForm.pageSize"
 | 
					                :defaultPageSize="queryForm.pageSize"
 | 
				
			||||||
                    v-model:current="queryForm.pageNum"
 | 
					                v-model:current="queryForm.pageNum"
 | 
				
			||||||
                    v-model:pageSize="queryForm.pageSize"
 | 
					                v-model:pageSize="queryForm.pageSize"
 | 
				
			||||||
                    :total="total"
 | 
					                :total="total"
 | 
				
			||||||
                    @change="queryData"
 | 
					                @change="queryData"
 | 
				
			||||||
                    @showSizeChange="queryData"
 | 
					                @showSizeChange="queryData"
 | 
				
			||||||
                    :show-total="(total) => `共${total}条`"
 | 
					                :show-total="(total) => `共${total}条`"
 | 
				
			||||||
            />
 | 
					            />
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -145,6 +159,8 @@
 | 
				
			|||||||
#foreach ($import in $frontImportList)
 | 
					#foreach ($import in $frontImportList)
 | 
				
			||||||
    $!{import}
 | 
					    $!{import}
 | 
				
			||||||
#end
 | 
					#end
 | 
				
			||||||
 | 
					    //import FilePreview from '/@/components/support/file-preview/index.vue'; // 图片预览组件
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // ---------------------------- 表格列 ----------------------------
 | 
					    // ---------------------------- 表格列 ----------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const columns = ref([
 | 
					    const columns = ref([
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -61,7 +61,6 @@
 | 
				
			|||||||
  watch(
 | 
					  watch(
 | 
				
			||||||
    () => props.modelValue,
 | 
					    () => props.modelValue,
 | 
				
			||||||
    (nVal) => {
 | 
					    (nVal) => {
 | 
				
			||||||
      console.log(nVal);
 | 
					 | 
				
			||||||
      editorHtml.value = nVal;
 | 
					      editorHtml.value = nVal;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,9 +27,13 @@
 | 
				
			|||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
  import { computed, onMounted, ref, watch } from 'vue';
 | 
					  import { computed, onMounted, ref, watch, defineExpose } from 'vue';
 | 
				
			||||||
  import { dictApi } from '/src/api/support/dict-api';
 | 
					  import { dictApi } from '/src/api/support/dict-api';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  defineExpose({
 | 
				
			||||||
 | 
					    queryDict,
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const props = defineProps({
 | 
					  const props = defineProps({
 | 
				
			||||||
    value: [Array, String],
 | 
					    value: [Array, String],
 | 
				
			||||||
    placeholder: {
 | 
					    placeholder: {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -64,24 +64,6 @@
 | 
				
			|||||||
    dictValueList.value = res.data;
 | 
					    dictValueList.value = res.data;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const values = computed(() => {
 | 
					 | 
				
			||||||
    if (!props.value) {
 | 
					 | 
				
			||||||
      return [];
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (!Array.isArray(props.value)) {
 | 
					 | 
				
			||||||
      console.error('valueList is not array!!!');
 | 
					 | 
				
			||||||
      return [];
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    let res = [];
 | 
					 | 
				
			||||||
    if (props.value && props.value.length > 0) {
 | 
					 | 
				
			||||||
      props.value.forEach((element) => {
 | 
					 | 
				
			||||||
        res.push(element.valueCode);
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      return res;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return res;
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  onMounted(queryDict);
 | 
					  onMounted(queryDict);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // -------------------------- 选中 相关、事件 --------------------------
 | 
					  // -------------------------- 选中 相关、事件 --------------------------
 | 
				
			||||||
@@ -96,21 +78,16 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const emit = defineEmits(['update:value', 'change']);
 | 
					  const emit = defineEmits(['update:value', 'change']);
 | 
				
			||||||
  function onChange(value) {
 | 
					  function onChange(value) {
 | 
				
			||||||
    let selected = [];
 | 
					 | 
				
			||||||
    if (!value) {
 | 
					    if (!value) {
 | 
				
			||||||
      emit('update:value', selected);
 | 
					      emit('update:value', []);
 | 
				
			||||||
      emit('change', selected);
 | 
					      emit('change', []);
 | 
				
			||||||
      return selected;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (Array.isArray(props.value)) {
 | 
					    if (Array.isArray(value)) {
 | 
				
			||||||
      let valueList = dictValueList.value.filter((e) => value.includes(e.valueCode));
 | 
					      emit('update:value', value);
 | 
				
			||||||
      valueList = valueList.map((e) => e.valueCode);
 | 
					      emit('change', value);
 | 
				
			||||||
      emit('update:value', valueList);
 | 
					 | 
				
			||||||
      emit('change', valueList);
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      let findValue = dictValueList.value.find((e) => e.valueCode === value);
 | 
					      emit('update:value', [value]);
 | 
				
			||||||
      emit('update:value', findValue.valueCode);
 | 
					      emit('change', [value]);
 | 
				
			||||||
      emit('change', findValue.valueCode);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,7 +40,7 @@
 | 
				
			|||||||
      </a-row>
 | 
					      </a-row>
 | 
				
			||||||
    </a-form>
 | 
					    </a-form>
 | 
				
			||||||
    <a-table
 | 
					    <a-table
 | 
				
			||||||
      :row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
 | 
					      :row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange, getCheckboxProps: getCheckboxProps }"
 | 
				
			||||||
      :loading="tableLoading"
 | 
					      :loading="tableLoading"
 | 
				
			||||||
      size="small"
 | 
					      size="small"
 | 
				
			||||||
      :columns="columns"
 | 
					      :columns="columns"
 | 
				
			||||||
@@ -95,6 +95,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const visible = ref(false);
 | 
					  const visible = ref(false);
 | 
				
			||||||
  async function showModal(selectEmployeeId) {
 | 
					  async function showModal(selectEmployeeId) {
 | 
				
			||||||
 | 
					    originalRowKeyList.value = selectEmployeeId || [];
 | 
				
			||||||
    selectedRowKeyList.value = selectEmployeeId || [];
 | 
					    selectedRowKeyList.value = selectEmployeeId || [];
 | 
				
			||||||
    visible.value = true;
 | 
					    visible.value = true;
 | 
				
			||||||
    onSearch();
 | 
					    onSearch();
 | 
				
			||||||
@@ -144,8 +145,9 @@
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // ----------------------- 员工表格选择 ---------------------
 | 
					  // ----------------------- 员工表格选择 ---------------------
 | 
				
			||||||
 | 
					  const originalRowKeyList = ref([]);
 | 
				
			||||||
  let selectedRowKeyList = ref([]);
 | 
					  let selectedRowKeyList = ref([]);
 | 
				
			||||||
  const hasSelected = computed(() => selectedRowKeyList.value.length > 0);
 | 
					  const hasSelected = computed(() => selectedRowKeyList.value.length !== originalRowKeyList.value.length);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function onSelectChange(selectedRowKeys) {
 | 
					  function onSelectChange(selectedRowKeys) {
 | 
				
			||||||
    selectedRowKeyList.value = selectedRowKeys;
 | 
					    selectedRowKeyList.value = selectedRowKeys;
 | 
				
			||||||
@@ -156,10 +158,19 @@
 | 
				
			|||||||
      message.warning('请选择角色人员');
 | 
					      message.warning('请选择角色人员');
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    emits('selectData', selectedRowKeyList.value);
 | 
					    // 过滤出新选择的人员id
 | 
				
			||||||
 | 
					    const newEmployeeIdList = selectedRowKeyList.value.filter((id) => !originalRowKeyList.value.includes(id));
 | 
				
			||||||
 | 
					    emits('selectData', newEmployeeIdList);
 | 
				
			||||||
    closeModal();
 | 
					    closeModal();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function getCheckboxProps(record) {
 | 
				
			||||||
 | 
					    return {
 | 
				
			||||||
 | 
					      // 角色员工列表的添加员工弹窗中 禁止添加选择已存在该角色的员工
 | 
				
			||||||
 | 
					      disabled: originalRowKeyList.value.includes(record.employeeId),
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // ----------------------- 员工表格渲染 ---------------------
 | 
					  // ----------------------- 员工表格渲染 ---------------------
 | 
				
			||||||
  const tableData = ref([]);
 | 
					  const tableData = ref([]);
 | 
				
			||||||
  //字段
 | 
					  //字段
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,4 +30,6 @@ export default {
 | 
				
			|||||||
  HOME_QUICK_ENTRY: `${KEY_PREFIX}home_quick_entry`,
 | 
					  HOME_QUICK_ENTRY: `${KEY_PREFIX}home_quick_entry`,
 | 
				
			||||||
  // 通知信息已读
 | 
					  // 通知信息已读
 | 
				
			||||||
  NOTICE_READ: `${KEY_PREFIX}notice_read`,
 | 
					  NOTICE_READ: `${KEY_PREFIX}notice_read`,
 | 
				
			||||||
 | 
					  // 待办
 | 
				
			||||||
 | 
					  TO_BE_DONE: `${KEY_PREFIX}to_be_done`,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,6 @@
 | 
				
			|||||||
  import { computed, ref, onMounted } from 'vue';
 | 
					  import { computed, ref, onMounted } from 'vue';
 | 
				
			||||||
  import { loginApi } from '/src/api/system/login-api';
 | 
					  import { loginApi } from '/src/api/system/login-api';
 | 
				
			||||||
  import { useUserStore } from '/@/store/modules/system/user';
 | 
					  import { useUserStore } from '/@/store/modules/system/user';
 | 
				
			||||||
  import { localClear } from '/@/utils/local-util';
 | 
					 | 
				
			||||||
  import { smartSentry } from '/@/lib/smart-sentry';
 | 
					  import { smartSentry } from '/@/lib/smart-sentry';
 | 
				
			||||||
  import HeaderResetPassword from './header-reset-password-modal/index.vue';
 | 
					  import HeaderResetPassword from './header-reset-password-modal/index.vue';
 | 
				
			||||||
  import { useRouter } from 'vue-router';
 | 
					  import { useRouter } from 'vue-router';
 | 
				
			||||||
@@ -53,7 +52,6 @@
 | 
				
			|||||||
    } catch (e) {
 | 
					    } catch (e) {
 | 
				
			||||||
      smartSentry.captureError(e);
 | 
					      smartSentry.captureError(e);
 | 
				
			||||||
    } finally {
 | 
					    } finally {
 | 
				
			||||||
      localClear();
 | 
					 | 
				
			||||||
      useUserStore().logout();
 | 
					      useUserStore().logout();
 | 
				
			||||||
      location.reload();
 | 
					      location.reload();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,44 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <a-modal v-model:open="showFlag" :width="800" title="消息内容" :destroyOnClose="true" @ok="showFlag = false">
 | 
				
			||||||
 | 
					    <a-descriptions bordered :column="2" size="small">
 | 
				
			||||||
 | 
					      <a-descriptions-item :labelStyle="{ width: '80px' }" :span="1" label="类型"
 | 
				
			||||||
 | 
					        >{{ $smartEnumPlugin.getDescByValue('MESSAGE_TYPE_ENUM', messageDetail.messageType) }}
 | 
				
			||||||
 | 
					      </a-descriptions-item>
 | 
				
			||||||
 | 
					      <a-descriptions-item :labelStyle="{ width: '120px' }" :span="1" label="发送时间">{{ messageDetail.createTime }}</a-descriptions-item>
 | 
				
			||||||
 | 
					      <a-descriptions-item :labelStyle="{ width: '80px' }" :span="2" label="标题">{{ messageDetail.title }}</a-descriptions-item>
 | 
				
			||||||
 | 
					      <a-descriptions-item :labelStyle="{ width: '80px' }" :span="2" label="内容">
 | 
				
			||||||
 | 
					        <pre>{{ messageDetail.content }}</pre>
 | 
				
			||||||
 | 
					      </a-descriptions-item>
 | 
				
			||||||
 | 
					    </a-descriptions>
 | 
				
			||||||
 | 
					  </a-modal>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					<script setup>
 | 
				
			||||||
 | 
					  import { reactive, ref } from 'vue';
 | 
				
			||||||
 | 
					  import { messageApi } from '/@/api/support/message-api.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const emit = defineEmits(['refresh']);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const messageDetail = reactive({
 | 
				
			||||||
 | 
					    messageType: '',
 | 
				
			||||||
 | 
					    title: '',
 | 
				
			||||||
 | 
					    content: '',
 | 
				
			||||||
 | 
					    createTime: '',
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const showFlag = ref(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function show(data) {
 | 
				
			||||||
 | 
					    Object.assign(messageDetail, data);
 | 
				
			||||||
 | 
					    showFlag.value = true;
 | 
				
			||||||
 | 
					    read(data);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  async function read(message) {
 | 
				
			||||||
 | 
					    if (!message.readFlag) {
 | 
				
			||||||
 | 
					      await messageApi.updateReadFlag(message.messageId);
 | 
				
			||||||
 | 
					      emit('refresh');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  defineExpose({ show });
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
@@ -9,26 +9,33 @@
 | 
				
			|||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <a-dropdown trigger="click" v-model:open="show">
 | 
					  <div>
 | 
				
			||||||
    <a-button type="text" @click="queryMessage" style="padding: 4px 5px">
 | 
					    <a-popover v-model:open="show" trigger="contextmenu" placement="bottomLeft" @openChange="() => (show = true)">
 | 
				
			||||||
      <a-badge :count="unreadMessageCount">
 | 
					      <a-button type="text" @click="showMessage" style="padding: 4px 5px">
 | 
				
			||||||
        <div style="width: 26px; height: 26px">
 | 
					        <a-badge :count="unreadMessageCount + toBeDoneCount">
 | 
				
			||||||
          <BellOutlined :style="{ fontSize: '16px' }" />
 | 
					          <div style="width: 26px; height: 26px">
 | 
				
			||||||
        </div>
 | 
					            <BellOutlined :style="{ fontSize: '16px' }" />
 | 
				
			||||||
      </a-badge>
 | 
					          </div>
 | 
				
			||||||
    </a-button>
 | 
					        </a-badge>
 | 
				
			||||||
 | 
					      </a-button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <template #overlay>
 | 
					      <template #content>
 | 
				
			||||||
      <a-card class="message-container" :bodyStyle="{ padding: 0 }">
 | 
					        <!-- 为了能在点击查看消息详情弹窗的同时防止消息气泡卡片关闭 所以加了一个手动关闭按钮 -->
 | 
				
			||||||
 | 
					        <a-button type="text" @click="closeMessage" style="padding: 4px 5px"> 关闭 </a-button>
 | 
				
			||||||
        <a-spin :spinning="loading">
 | 
					        <a-spin :spinning="loading">
 | 
				
			||||||
          <a-tabs class="dropdown-tabs" centered :tabBarStyle="{ textAlign: 'center' }" style="width: 300px">
 | 
					          <a-tabs class="dropdown-tabs" centered :tabBarStyle="{ textAlign: 'center' }" style="width: 300px">
 | 
				
			||||||
            <a-tab-pane tab="未读消息" key="message">
 | 
					            <a-tab-pane key="message">
 | 
				
			||||||
 | 
					              <template #tab>
 | 
				
			||||||
 | 
					                未读消息
 | 
				
			||||||
 | 
					                <a-badge :count="unreadMessageCount" showZero :offset="[0, -20]" />
 | 
				
			||||||
 | 
					              </template>
 | 
				
			||||||
              <a-list class="tab-pane" size="small">
 | 
					              <a-list class="tab-pane" size="small">
 | 
				
			||||||
                <a-list-item v-for="item in messageList" :key="item.messageId">
 | 
					                <a-list-item v-for="item in messageList" :key="item.messageId">
 | 
				
			||||||
                  <a-list-item-meta>
 | 
					                  <a-list-item-meta>
 | 
				
			||||||
                    <template #title>
 | 
					                    <template #title>
 | 
				
			||||||
                      <div class="title">
 | 
					                      <div class="title">
 | 
				
			||||||
                        <a @click="gotoMessage">{{ item.title }}</a>
 | 
					                        <a-badge status="error" />
 | 
				
			||||||
 | 
					                        <a @click="showMessageDetail(item)">{{ item.title }}</a>
 | 
				
			||||||
                      </div>
 | 
					                      </div>
 | 
				
			||||||
                    </template>
 | 
					                    </template>
 | 
				
			||||||
                    <template #description>
 | 
					                    <template #description>
 | 
				
			||||||
@@ -36,16 +43,34 @@
 | 
				
			|||||||
                    </template>
 | 
					                    </template>
 | 
				
			||||||
                  </a-list-item-meta>
 | 
					                  </a-list-item-meta>
 | 
				
			||||||
                </a-list-item>
 | 
					                </a-list-item>
 | 
				
			||||||
 | 
					                <a-list-item v-if="unreadMessageCount > 3">
 | 
				
			||||||
 | 
					                  <a-button type="text" @click="gotoMessage" style="padding: 4px 5px"> ... 查看更多 </a-button>
 | 
				
			||||||
 | 
					                </a-list-item>
 | 
				
			||||||
              </a-list>
 | 
					              </a-list>
 | 
				
			||||||
            </a-tab-pane>
 | 
					            </a-tab-pane>
 | 
				
			||||||
            <a-tab-pane tab="待办工作" key="todo">
 | 
					            <a-tab-pane key="to_be_done">
 | 
				
			||||||
              <a-list class="tab-pane" />
 | 
					              <template #tab>
 | 
				
			||||||
 | 
					                待办工作
 | 
				
			||||||
 | 
					                <a-badge :count="toBeDoneCount" showZero :offset="[0, -20]" />
 | 
				
			||||||
 | 
					              </template>
 | 
				
			||||||
 | 
					              <a-list class="tab-pane" size="small" :locale="{ emptyText: '暂无待办' }">
 | 
				
			||||||
 | 
					                <a-list-item v-for="(item, index) in toBeDoneList" :key="index">
 | 
				
			||||||
 | 
					                  <a-list-item-meta>
 | 
				
			||||||
 | 
					                    <template #title>
 | 
				
			||||||
 | 
					                      <a-badge status="error" />
 | 
				
			||||||
 | 
					                      <a-tag v-if="item.starFlag" color="red">重要</a-tag>
 | 
				
			||||||
 | 
					                      <span>{{ item.title }}</span>
 | 
				
			||||||
 | 
					                    </template>
 | 
				
			||||||
 | 
					                  </a-list-item-meta>
 | 
				
			||||||
 | 
					                </a-list-item>
 | 
				
			||||||
 | 
					              </a-list>
 | 
				
			||||||
            </a-tab-pane>
 | 
					            </a-tab-pane>
 | 
				
			||||||
          </a-tabs>
 | 
					          </a-tabs>
 | 
				
			||||||
        </a-spin>
 | 
					        </a-spin>
 | 
				
			||||||
      </a-card>
 | 
					      </template>
 | 
				
			||||||
    </template>
 | 
					    </a-popover>
 | 
				
			||||||
  </a-dropdown>
 | 
					    <MessageDetailModal ref="messageDetailModalRef" @refresh="queryMessage" />
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
@@ -57,19 +82,27 @@
 | 
				
			|||||||
  import dayjs from 'dayjs';
 | 
					  import dayjs from 'dayjs';
 | 
				
			||||||
  import { theme } from 'ant-design-vue';
 | 
					  import { theme } from 'ant-design-vue';
 | 
				
			||||||
  import { useRouter } from 'vue-router';
 | 
					  import { useRouter } from 'vue-router';
 | 
				
			||||||
 | 
					  import MessageDetailModal from './header-message-detail-modal.vue';
 | 
				
			||||||
 | 
					  import localKey from '/@/constants/local-storage-key-const';
 | 
				
			||||||
 | 
					  import { localRead } from '/@/utils/local-util';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { useToken } = theme;
 | 
					  const { useToken } = theme;
 | 
				
			||||||
  const { token } = useToken();
 | 
					  const { token } = useToken();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  defineExpose({ showMessage });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  function showMessage() {
 | 
					 | 
				
			||||||
    show.value = true;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  const loading = ref(false);
 | 
					  const loading = ref(false);
 | 
				
			||||||
  const show = ref(false);
 | 
					  const show = ref(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 点击按钮打开消息气泡卡片的同时刷新消息
 | 
				
			||||||
 | 
					  function showMessage() {
 | 
				
			||||||
 | 
					    show.value = true;
 | 
				
			||||||
 | 
					    queryMessage();
 | 
				
			||||||
 | 
					    loadToBeDoneList();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function closeMessage() {
 | 
				
			||||||
 | 
					    show.value = false;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // ------------------------- 查询消息  -------------------------
 | 
					  // ------------------------- 查询消息  -------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // 未读消息
 | 
					  // 未读消息
 | 
				
			||||||
@@ -90,6 +123,8 @@
 | 
				
			|||||||
        readFlag: false,
 | 
					        readFlag: false,
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      messageList.value = responseModel.data.list;
 | 
					      messageList.value = responseModel.data.list;
 | 
				
			||||||
 | 
					      // 若中途有新消息了 打开列表也能及时更新未读数量
 | 
				
			||||||
 | 
					      useUserStore().queryUnreadMessageCount();
 | 
				
			||||||
    } catch (e) {
 | 
					    } catch (e) {
 | 
				
			||||||
      smartSentry.captureError(e);
 | 
					      smartSentry.captureError(e);
 | 
				
			||||||
    } finally {
 | 
					    } finally {
 | 
				
			||||||
@@ -97,12 +132,41 @@
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const messageDetailModalRef = ref();
 | 
				
			||||||
 | 
					  function showMessageDetail(data) {
 | 
				
			||||||
 | 
					    messageDetailModalRef.value.show(data);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const router = useRouter();
 | 
					  const router = useRouter();
 | 
				
			||||||
  function gotoMessage() {
 | 
					  function gotoMessage() {
 | 
				
			||||||
    show.value = false;
 | 
					    show.value = false;
 | 
				
			||||||
    router.push({ path: '/account', query: { menuId: 'message' } });
 | 
					    router.push({ path: '/account', query: { menuId: 'message' } });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // ------------------------- 待办工作  -------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 待办工作数
 | 
				
			||||||
 | 
					  const toBeDoneCount = computed(() => {
 | 
				
			||||||
 | 
					    return useUserStore().toBeDoneCount;
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 待办工作列表
 | 
				
			||||||
 | 
					  const toBeDoneList = ref([]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const loadToBeDoneList = async () => {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					      loading.value = true;
 | 
				
			||||||
 | 
					      let localToBeDoneList = localRead(localKey.TO_BE_DONE);
 | 
				
			||||||
 | 
					      if (localToBeDoneList) {
 | 
				
			||||||
 | 
					        toBeDoneList.value = JSON.parse(localToBeDoneList).filter((e) => !e.doneFlag);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    } catch (err) {
 | 
				
			||||||
 | 
					      smartSentry.captureError(err);
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					      loading.value = false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // ------------------------- 时间计算  -------------------------
 | 
					  // ------------------------- 时间计算  -------------------------
 | 
				
			||||||
  function timeago(dateStr) {
 | 
					  function timeago(dateStr) {
 | 
				
			||||||
    let dateTimeStamp = dayjs(dateStr).toDate().getTime();
 | 
					    let dateTimeStamp = dayjs(dateStr).toDate().getTime();
 | 
				
			||||||
@@ -181,12 +245,13 @@
 | 
				
			|||||||
    cursor: pointer;
 | 
					    cursor: pointer;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .message-container {
 | 
					 | 
				
			||||||
    border: #eeeeee solid 1px;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .dropdown-tabs {
 | 
					  .dropdown-tabs {
 | 
				
			||||||
    background-color: @base-bg-color;
 | 
					    background-color: @base-bg-color;
 | 
				
			||||||
    border-radius: 4px;
 | 
					    border-radius: 4px;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .tab-pane {
 | 
				
			||||||
 | 
					    height: 250px;
 | 
				
			||||||
 | 
					    overflow-y: auto;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,7 @@
 | 
				
			|||||||
      </a-form-item>
 | 
					      </a-form-item>
 | 
				
			||||||
      <a-form-item :label="$t('setting.color')">
 | 
					      <a-form-item :label="$t('setting.color')">
 | 
				
			||||||
        <div class="color-container">
 | 
					        <div class="color-container">
 | 
				
			||||||
          <template v-for="(item, index) in themeColors">
 | 
					          <template v-for="(item, index) in themeColors" :key="index">
 | 
				
			||||||
            <div v-if="index === formState.colorIndex" class="color">
 | 
					            <div v-if="index === formState.colorIndex" class="color">
 | 
				
			||||||
              <CheckSquareFilled :style="{ color: item.primaryColor, fontSize: '22px' }" />
 | 
					              <CheckSquareFilled :style="{ color: item.primaryColor, fontSize: '22px' }" />
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
@@ -34,7 +34,7 @@
 | 
				
			|||||||
              >
 | 
					              >
 | 
				
			||||||
                <path
 | 
					                <path
 | 
				
			||||||
                  d="M128 160.01219c0-17.67619 14.336-32.01219 32.01219-32.01219h704c17.65181 0 31.98781 14.336 31.98781 32.01219v704c0 17.65181-14.336 31.98781-32.01219 31.98781H160.036571a31.98781 31.98781 0 0 1-32.01219-32.01219V160.036571z"
 | 
					                  d="M128 160.01219c0-17.67619 14.336-32.01219 32.01219-32.01219h704c17.65181 0 31.98781 14.336 31.98781 32.01219v704c0 17.65181-14.336 31.98781-32.01219 31.98781H160.036571a31.98781 31.98781 0 0 1-32.01219-32.01219V160.036571z"
 | 
				
			||||||
                ></path>
 | 
					                />
 | 
				
			||||||
              </svg>
 | 
					              </svg>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </template>
 | 
					          </template>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,12 +57,6 @@
 | 
				
			|||||||
    headerSetting.value.show();
 | 
					    headerSetting.value.show();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //消息通知
 | 
					 | 
				
			||||||
  const headerMessage = ref();
 | 
					 | 
				
			||||||
  function showMessage() {
 | 
					 | 
				
			||||||
    headerMessage.value.showMessage();
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  //帮助文档
 | 
					  //帮助文档
 | 
				
			||||||
  function showHelpDoc() {
 | 
					  function showHelpDoc() {
 | 
				
			||||||
    useAppConfigStore().showHelpDoc();
 | 
					    useAppConfigStore().showHelpDoc();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,8 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
import { message, Modal } from 'ant-design-vue';
 | 
					import { message, Modal } from 'ant-design-vue';
 | 
				
			||||||
import axios from 'axios';
 | 
					import axios from 'axios';
 | 
				
			||||||
import { localClear, localRead } from '/@/utils/local-util';
 | 
					import { localRead } from '/@/utils/local-util';
 | 
				
			||||||
 | 
					import { useUserStore } from '/@/store/modules/system/user';
 | 
				
			||||||
import { decryptData, encryptData } from './encrypt';
 | 
					import { decryptData, encryptData } from './encrypt';
 | 
				
			||||||
import { DATA_TYPE_ENUM } from '../constants/common-const';
 | 
					import { DATA_TYPE_ENUM } from '../constants/common-const';
 | 
				
			||||||
import _ from 'lodash';
 | 
					import _ from 'lodash';
 | 
				
			||||||
@@ -25,7 +26,7 @@ const smartAxios = axios.create({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// 退出系统
 | 
					// 退出系统
 | 
				
			||||||
function logout() {
 | 
					function logout() {
 | 
				
			||||||
  localClear();
 | 
					  useUserStore().logout();
 | 
				
			||||||
  location.href = '/';
 | 
					  location.href = '/';
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,7 @@ import { PAGE_PATH_404, PAGE_PATH_LOGIN } from '/@/constants/common-const';
 | 
				
			|||||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
 | 
					import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
 | 
				
			||||||
import SmartLayout from '../layout/index.vue';
 | 
					import SmartLayout from '../layout/index.vue';
 | 
				
			||||||
import { useUserStore } from '/@/store/modules/system/user';
 | 
					import { useUserStore } from '/@/store/modules/system/user';
 | 
				
			||||||
import { localClear, localRead } from '/@/utils/local-util';
 | 
					import { localRead } from '/@/utils/local-util';
 | 
				
			||||||
import _ from 'lodash';
 | 
					import _ from 'lodash';
 | 
				
			||||||
import LocalStorageKeyConst from '/@/constants/local-storage-key-const.js';
 | 
					import LocalStorageKeyConst from '/@/constants/local-storage-key-const.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -41,7 +41,7 @@ router.beforeEach(async (to, from, next) => {
 | 
				
			|||||||
  // 验证登录
 | 
					  // 验证登录
 | 
				
			||||||
  const token = localRead(LocalStorageKeyConst.USER_TOKEN);
 | 
					  const token = localRead(LocalStorageKeyConst.USER_TOKEN);
 | 
				
			||||||
  if (!token) {
 | 
					  if (!token) {
 | 
				
			||||||
    localClear();
 | 
					    useUserStore().logout();
 | 
				
			||||||
    next({ path: PAGE_PATH_LOGIN });
 | 
					    next({ path: PAGE_PATH_LOGIN });
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,10 +12,10 @@ import { defineStore } from 'pinia';
 | 
				
			|||||||
import localKey from '/@/constants/local-storage-key-const';
 | 
					import localKey from '/@/constants/local-storage-key-const';
 | 
				
			||||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
 | 
					import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
 | 
				
			||||||
import { MENU_TYPE_ENUM } from '/@/constants/system/menu-const';
 | 
					import { MENU_TYPE_ENUM } from '/@/constants/system/menu-const';
 | 
				
			||||||
import { localClear, localRead, localSave } from '/@/utils/local-util';
 | 
					 | 
				
			||||||
import LocalStorageKeyConst from '/@/constants/local-storage-key-const';
 | 
					 | 
				
			||||||
import { messageApi } from '/@/api/support/message-api.js';
 | 
					import { messageApi } from '/@/api/support/message-api.js';
 | 
				
			||||||
import { smartSentry } from '/@/lib/smart-sentry.js';
 | 
					import { smartSentry } from '/@/lib/smart-sentry.js';
 | 
				
			||||||
 | 
					import { localRead, localSave, localRemove } from '/@/utils/local-util';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const useUserStore = defineStore({
 | 
					export const useUserStore = defineStore({
 | 
				
			||||||
  id: 'userStore',
 | 
					  id: 'userStore',
 | 
				
			||||||
@@ -61,13 +61,15 @@ export const useUserStore = defineStore({
 | 
				
			|||||||
    keepAliveIncludes: [],
 | 
					    keepAliveIncludes: [],
 | 
				
			||||||
    // 未读消息数量
 | 
					    // 未读消息数量
 | 
				
			||||||
    unreadMessageCount: 0,
 | 
					    unreadMessageCount: 0,
 | 
				
			||||||
 | 
					    // 待办工作数
 | 
				
			||||||
 | 
					    toBeDoneCount: 0,
 | 
				
			||||||
  }),
 | 
					  }),
 | 
				
			||||||
  getters: {
 | 
					  getters: {
 | 
				
			||||||
    getToken(state) {
 | 
					    getToken(state) {
 | 
				
			||||||
      if (state.token) {
 | 
					      if (state.token) {
 | 
				
			||||||
        return state.token;
 | 
					        return state.token;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      return localRead(LocalStorageKeyConst.USER_TOKEN);
 | 
					      return localRead(localKey.USER_TOKEN);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    //是否初始化了 路由
 | 
					    //是否初始化了 路由
 | 
				
			||||||
    getMenuRouterInitFlag(state) {
 | 
					    getMenuRouterInitFlag(state) {
 | 
				
			||||||
@@ -115,7 +117,9 @@ export const useUserStore = defineStore({
 | 
				
			|||||||
      this.tagNav = [];
 | 
					      this.tagNav = [];
 | 
				
			||||||
      this.userInfo = {};
 | 
					      this.userInfo = {};
 | 
				
			||||||
      this.unreadMessageCount = 0;
 | 
					      this.unreadMessageCount = 0;
 | 
				
			||||||
      localClear();
 | 
					      localRemove(localKey.USER_TOKEN);
 | 
				
			||||||
 | 
					      localRemove(localKey.USER_POINTS);
 | 
				
			||||||
 | 
					      localRemove(localKey.USER_TAG_NAV);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    // 查询未读消息数量
 | 
					    // 查询未读消息数量
 | 
				
			||||||
    async queryUnreadMessageCount() {
 | 
					    async queryUnreadMessageCount() {
 | 
				
			||||||
@@ -126,6 +130,16 @@ export const useUserStore = defineStore({
 | 
				
			|||||||
        smartSentry.captureError(e);
 | 
					        smartSentry.captureError(e);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    async queryToBeDoneList() {
 | 
				
			||||||
 | 
					      try {
 | 
				
			||||||
 | 
					        let localToBeDoneList = localRead(localKey.TO_BE_DONE);
 | 
				
			||||||
 | 
					        if (localToBeDoneList) {
 | 
				
			||||||
 | 
					          this.toBeDoneCount = JSON.parse(localToBeDoneList).filter((e) => !e.doneFlag).length;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      } catch (err) {
 | 
				
			||||||
 | 
					        smartSentry.captureError(err);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    //设置登录信息
 | 
					    //设置登录信息
 | 
				
			||||||
    setUserLoginInfo(data) {
 | 
					    setUserLoginInfo(data) {
 | 
				
			||||||
      // 用户基本信息
 | 
					      // 用户基本信息
 | 
				
			||||||
@@ -157,6 +171,8 @@ export const useUserStore = defineStore({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      // 获取用户未读消息
 | 
					      // 获取用户未读消息
 | 
				
			||||||
      this.queryUnreadMessageCount();
 | 
					      this.queryUnreadMessageCount();
 | 
				
			||||||
 | 
					      // 获取待办工作数
 | 
				
			||||||
 | 
					      this.queryToBeDoneList();
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    setToken(token) {
 | 
					    setToken(token) {
 | 
				
			||||||
      this.token = token;
 | 
					      this.token = token;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,3 +19,7 @@ export const localRead = (key) => {
 | 
				
			|||||||
export const localClear = () => {
 | 
					export const localClear = () => {
 | 
				
			||||||
  localStorage.clear();
 | 
					  localStorage.clear();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const localRemove = (key) => {
 | 
				
			||||||
 | 
					  localStorage.removeItem(key);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,7 @@
 | 
				
			|||||||
        <SmartEnumSelect enum-name="GOODS_STATUS_ENUM" v-model:value="form.goodsStatus" />
 | 
					        <SmartEnumSelect enum-name="GOODS_STATUS_ENUM" v-model:value="form.goodsStatus" />
 | 
				
			||||||
      </a-form-item>
 | 
					      </a-form-item>
 | 
				
			||||||
      <a-form-item label="产地" name="place">
 | 
					      <a-form-item label="产地" name="place">
 | 
				
			||||||
        <DictSelect key-code="GODOS_PLACE" v-model:value="form.place" />
 | 
					        <DictSelect width="100%" key-code="GODOS_PLACE" v-model:value="form.place" mode="tags" />
 | 
				
			||||||
      </a-form-item>
 | 
					      </a-form-item>
 | 
				
			||||||
      <a-form-item label="上架状态" name="shelvesFlag">
 | 
					      <a-form-item label="上架状态" name="shelvesFlag">
 | 
				
			||||||
        <a-radio-group v-model:value="form.shelvesFlag">
 | 
					        <a-radio-group v-model:value="form.shelvesFlag">
 | 
				
			||||||
@@ -80,7 +80,7 @@
 | 
				
			|||||||
    //商品状态
 | 
					    //商品状态
 | 
				
			||||||
    goodsStatus: GOODS_STATUS_ENUM.APPOINTMENT.value,
 | 
					    goodsStatus: GOODS_STATUS_ENUM.APPOINTMENT.value,
 | 
				
			||||||
    //产地
 | 
					    //产地
 | 
				
			||||||
    place: undefined,
 | 
					    place: [],
 | 
				
			||||||
    //商品价格
 | 
					    //商品价格
 | 
				
			||||||
    price: undefined,
 | 
					    price: undefined,
 | 
				
			||||||
    //上架状态
 | 
					    //上架状态
 | 
				
			||||||
@@ -107,9 +107,8 @@
 | 
				
			|||||||
      Object.assign(form, rowData);
 | 
					      Object.assign(form, rowData);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (form.place && form.place.length > 0) {
 | 
					    if (form.place && form.place.length > 0) {
 | 
				
			||||||
      form.place = form.place[0].valueCode;
 | 
					      form.place = form.place.map((e) => e.valueCode);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    console.log(form);
 | 
					 | 
				
			||||||
    visible.value = true;
 | 
					    visible.value = true;
 | 
				
			||||||
    nextTick(() => {
 | 
					    nextTick(() => {
 | 
				
			||||||
      formRef.value.clearValidate();
 | 
					      formRef.value.clearValidate();
 | 
				
			||||||
@@ -127,14 +126,10 @@
 | 
				
			|||||||
      .then(async () => {
 | 
					      .then(async () => {
 | 
				
			||||||
        SmartLoading.show();
 | 
					        SmartLoading.show();
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
          let params = _.cloneDeep(form);
 | 
					 | 
				
			||||||
          if (params.place && Array.isArray(params.place) && params.place.length > 0) {
 | 
					 | 
				
			||||||
            params.place = params.place[0].valueCode;
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
          if (form.goodsId) {
 | 
					          if (form.goodsId) {
 | 
				
			||||||
            await goodsApi.updateGoods(params);
 | 
					            await goodsApi.updateGoods(form);
 | 
				
			||||||
          } else {
 | 
					          } else {
 | 
				
			||||||
            await goodsApi.addGoods(params);
 | 
					            await goodsApi.addGoods(form);
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          message.success(`${form.goodsId ? '修改' : '添加'}成功`);
 | 
					          message.success(`${form.goodsId ? '修改' : '添加'}成功`);
 | 
				
			||||||
          onClose();
 | 
					          onClose();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -109,7 +109,7 @@
 | 
				
			|||||||
    >
 | 
					    >
 | 
				
			||||||
      <template #bodyCell="{ text, record, column }">
 | 
					      <template #bodyCell="{ text, record, column }">
 | 
				
			||||||
        <template v-if="column.dataIndex === 'place'">
 | 
					        <template v-if="column.dataIndex === 'place'">
 | 
				
			||||||
          <span>{{ text && text.length > 0 ? text[0].valueName : '' }}</span>
 | 
					          <span>{{ text && text.length > 0 ? text.map((e) => e.valueName).join(',') : '' }}</span>
 | 
				
			||||||
        </template>
 | 
					        </template>
 | 
				
			||||||
        <template v-if="column.dataIndex === 'goodsStatus'">
 | 
					        <template v-if="column.dataIndex === 'goodsStatus'">
 | 
				
			||||||
          <span>{{ $smartEnumPlugin.getDescByValue('GOODS_STATUS_ENUM', text) }}</span>
 | 
					          <span>{{ $smartEnumPlugin.getDescByValue('GOODS_STATUS_ENUM', text) }}</span>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ import { convertUpperCamel } from '/@/utils/str-util';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// -------------------------------- java 类型 --------------------------------
 | 
					// -------------------------------- java 类型 --------------------------------
 | 
				
			||||||
export const JavaTypeMap = new Map();
 | 
					export const JavaTypeMap = new Map();
 | 
				
			||||||
 | 
					JavaTypeMap.set('bit', 'Boolean');
 | 
				
			||||||
JavaTypeMap.set('int', 'Integer');
 | 
					JavaTypeMap.set('int', 'Integer');
 | 
				
			||||||
JavaTypeMap.set('tinyint', 'Integer');
 | 
					JavaTypeMap.set('tinyint', 'Integer');
 | 
				
			||||||
JavaTypeMap.set('smallint', 'Integer');
 | 
					JavaTypeMap.set('smallint', 'Integer');
 | 
				
			||||||
@@ -37,6 +38,7 @@ export function getJavaType(dataType) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// -------------------------------- js 类型 --------------------------------
 | 
					// -------------------------------- js 类型 --------------------------------
 | 
				
			||||||
export const JsTypeMap = new Map();
 | 
					export const JsTypeMap = new Map();
 | 
				
			||||||
 | 
					JsTypeMap.set('bit', 'Boolean');
 | 
				
			||||||
JsTypeMap.set('int', 'Number');
 | 
					JsTypeMap.set('int', 'Number');
 | 
				
			||||||
JsTypeMap.set('tinyint', 'Number');
 | 
					JsTypeMap.set('tinyint', 'Number');
 | 
				
			||||||
JsTypeMap.set('smallint', 'Number');
 | 
					JsTypeMap.set('smallint', 'Number');
 | 
				
			||||||
@@ -56,11 +58,10 @@ JsTypeMap.set('date', 'Date');
 | 
				
			|||||||
JsTypeMap.set('datetime', 'Date');
 | 
					JsTypeMap.set('datetime', 'Date');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const JsTypeList = [
 | 
					export const JsTypeList = [
 | 
				
			||||||
 | 
					  'Boolean', //
 | 
				
			||||||
  'Number', //
 | 
					  'Number', //
 | 
				
			||||||
  'String', //
 | 
					  'String', //
 | 
				
			||||||
  'Date', //
 | 
					  'Date', //
 | 
				
			||||||
  'Boolean', //
 | 
					 | 
				
			||||||
  'String', //
 | 
					 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function getJsType(dataType) {
 | 
					export function getJsType(dataType) {
 | 
				
			||||||
@@ -70,8 +71,9 @@ export function getJsType(dataType) {
 | 
				
			|||||||
// -------------------------------- 前端组件 --------------------------------
 | 
					// -------------------------------- 前端组件 --------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const FrontComponentMap = new Map();
 | 
					export const FrontComponentMap = new Map();
 | 
				
			||||||
 | 
					FrontComponentMap.set('bit', 'BooleanSelect');
 | 
				
			||||||
FrontComponentMap.set('int', 'InputNumber');
 | 
					FrontComponentMap.set('int', 'InputNumber');
 | 
				
			||||||
FrontComponentMap.set('tinyint', 'BooleanSelect');
 | 
					FrontComponentMap.set('tinyint', 'InputNumber');
 | 
				
			||||||
FrontComponentMap.set('smallint', 'InputNumber');
 | 
					FrontComponentMap.set('smallint', 'InputNumber');
 | 
				
			||||||
FrontComponentMap.set('integer', 'InputNumber');
 | 
					FrontComponentMap.set('integer', 'InputNumber');
 | 
				
			||||||
FrontComponentMap.set('year', 'Date');
 | 
					FrontComponentMap.set('year', 'Date');
 | 
				
			||||||
@@ -84,7 +86,7 @@ FrontComponentMap.set('varchar', 'Input');
 | 
				
			|||||||
FrontComponentMap.set('tinytext', 'Input');
 | 
					FrontComponentMap.set('tinytext', 'Input');
 | 
				
			||||||
FrontComponentMap.set('text', 'Textarea');
 | 
					FrontComponentMap.set('text', 'Textarea');
 | 
				
			||||||
FrontComponentMap.set('longtext', 'Textarea');
 | 
					FrontComponentMap.set('longtext', 'Textarea');
 | 
				
			||||||
FrontComponentMap.set('blob', 'Upload');
 | 
					FrontComponentMap.set('blob', 'FileUpload');
 | 
				
			||||||
FrontComponentMap.set('date', 'Date');
 | 
					FrontComponentMap.set('date', 'Date');
 | 
				
			||||||
FrontComponentMap.set('datetime', 'DateTime');
 | 
					FrontComponentMap.set('datetime', 'DateTime');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -131,6 +133,7 @@ export const JAVA_FILE_LIST = [
 | 
				
			|||||||
  'Dao.java', //
 | 
					  'Dao.java', //
 | 
				
			||||||
  'Mapper.xml', //
 | 
					  'Mapper.xml', //
 | 
				
			||||||
  ...JAVA_DOMAIN_FILE_LIST,
 | 
					  ...JAVA_DOMAIN_FILE_LIST,
 | 
				
			||||||
 | 
					  'Menu.sql', //
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// -------------------------------- 枚举enum --------------------------------
 | 
					// -------------------------------- 枚举enum --------------------------------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -68,11 +68,12 @@
 | 
				
			|||||||
    if (deletedFlagColumn) {
 | 
					    if (deletedFlagColumn) {
 | 
				
			||||||
      deleteFlagColumnName.value = deletedFlagColumn.columnName;
 | 
					      deleteFlagColumnName.value = deletedFlagColumn.columnName;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    console.log(deletedFlagColumn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //表单
 | 
					    //表单
 | 
				
			||||||
    let deleteInfo = config.delete;
 | 
					    let deleteInfo = config.deleteInfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    formData.isSupportDelete = deleteInfo && deleteInfo.isSupportDelete ? deleteInfo.isSupportDelete : true;
 | 
					    formData.isSupportDelete = deleteInfo ? deleteInfo.isSupportDelete : true;
 | 
				
			||||||
    formData.isPhysicallyDeleted = deleteInfo && deleteInfo.isPhysicallyDeleted ? deleteInfo.isPhysicallyDeleted : !deletedFlagColumn;
 | 
					    formData.isPhysicallyDeleted = deleteInfo && deleteInfo.isPhysicallyDeleted ? deleteInfo.isPhysicallyDeleted : !deletedFlagColumn;
 | 
				
			||||||
    formData.deleteEnum = deleteInfo && deleteInfo.deleteEnum ? deleteInfo.deleteEnum : CODE_DELETE_ENUM.SINGLE_AND_BATCH.value;
 | 
					    formData.deleteEnum = deleteInfo && deleteInfo.deleteEnum ? deleteInfo.deleteEnum : CODE_DELETE_ENUM.SINGLE_AND_BATCH.value;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,10 @@
 | 
				
			|||||||
  <a-alert :closable="true" message="请务必将每一个字段的 “ 字段名词 ” 填写完整!!!" type="success" show-icon>
 | 
					  <a-alert :closable="true" message="请务必将每一个字段的 “ 字段名词 ” 填写完整!!!" type="success" show-icon>
 | 
				
			||||||
    <template #icon><smile-outlined /></template>
 | 
					    <template #icon><smile-outlined /></template>
 | 
				
			||||||
  </a-alert>
 | 
					  </a-alert>
 | 
				
			||||||
 | 
					  <!-- 为了方便再配置时中途新增字典后 可以重新刷新字典下拉 (需要先随便选择一个字典后才能看到最新的字典) -->
 | 
				
			||||||
 | 
					  <div style="float: right; padding: 10px 0px">
 | 
				
			||||||
 | 
					    <a-button type="primary" @click="refreshDict">刷新字典</a-button>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
  <a-table
 | 
					  <a-table
 | 
				
			||||||
    :scroll="{ x: 1300 }"
 | 
					    :scroll="{ x: 1300 }"
 | 
				
			||||||
    size="small"
 | 
					    size="small"
 | 
				
			||||||
@@ -64,7 +68,7 @@
 | 
				
			|||||||
      </template>
 | 
					      </template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <template v-if="column.dataIndex === 'dict'">
 | 
					      <template v-if="column.dataIndex === 'dict'">
 | 
				
			||||||
        <DictKeySelect v-model:value="record.dict" />
 | 
					        <DictKeySelect ref="dictRef" v-model:value="record.dict" />
 | 
				
			||||||
      </template>
 | 
					      </template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <template v-if="column.dataIndex === 'enumName'">
 | 
					      <template v-if="column.dataIndex === 'enumName'">
 | 
				
			||||||
@@ -81,6 +85,11 @@
 | 
				
			|||||||
  import { convertUpperCamel, convertLowerCamel } from '/@/utils/str-util';
 | 
					  import { convertUpperCamel, convertLowerCamel } from '/@/utils/str-util';
 | 
				
			||||||
  import _ from 'lodash';
 | 
					  import _ from 'lodash';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const dictRef = ref();
 | 
				
			||||||
 | 
					  function refreshDict() {
 | 
				
			||||||
 | 
					    dictRef.value.queryDict();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //------------------------ 全局数据 ---------------------
 | 
					  //------------------------ 全局数据 ---------------------
 | 
				
			||||||
  const tableInfo = inject('tableInfo');
 | 
					  const tableInfo = inject('tableInfo');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -75,11 +75,9 @@
 | 
				
			|||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
  import _ from 'lodash';
 | 
					 | 
				
			||||||
  import Sortable from 'sortablejs';
 | 
					  import Sortable from 'sortablejs';
 | 
				
			||||||
  import { inject, nextTick, ref } from 'vue';
 | 
					  import { inject, nextTick, ref } from 'vue';
 | 
				
			||||||
  import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
 | 
					  import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
 | 
				
			||||||
  import { SmartLoading } from '/@/components/framework/smart-loading';
 | 
					 | 
				
			||||||
  import { CODE_QUERY_FIELD_QUERY_TYPE_ENUM } from '/@/constants/support/code-generator-const';
 | 
					  import { CODE_QUERY_FIELD_QUERY_TYPE_ENUM } from '/@/constants/support/code-generator-const';
 | 
				
			||||||
  import { convertLowerCamel } from '/@/utils/str-util';
 | 
					  import { convertLowerCamel } from '/@/utils/str-util';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -130,12 +128,13 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const tableColumns = ref([]);
 | 
					  const tableColumns = ref([]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  let rowKeyCounter = 1;
 | 
				
			||||||
  //初始化设置数据
 | 
					  //初始化设置数据
 | 
				
			||||||
  function setData(tableColumnInfos, config) {
 | 
					  function setData(tableColumnInfos, config) {
 | 
				
			||||||
    rowKeyCounter = 1;
 | 
					    rowKeyCounter = 1;
 | 
				
			||||||
    let data = config && config.queryFields ? config.queryFields : [];
 | 
					    let data = config && config.queryFields ? config.queryFields : [];
 | 
				
			||||||
    for (let index = 0; index < data.length; index++) {
 | 
					    for (let index = 0; index < data.length; index++) {
 | 
				
			||||||
      data[index].rowKey = 'rowKey' + (index + 1);
 | 
					      data[index].rowKey = 'rowKey' + rowKeyCounter;
 | 
				
			||||||
      rowKeyCounter++;
 | 
					      rowKeyCounter++;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    tableData.value = data;
 | 
					    tableData.value = data;
 | 
				
			||||||
@@ -147,7 +146,6 @@
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // -------------------  增加、删除 -------------------
 | 
					  // -------------------  增加、删除 -------------------
 | 
				
			||||||
  let rowKeyCounter = 1;
 | 
					 | 
				
			||||||
  function addQuery() {
 | 
					  function addQuery() {
 | 
				
			||||||
    tableData.value.push({
 | 
					    tableData.value.push({
 | 
				
			||||||
      rowKey: 'rowKey' + rowKeyCounter,
 | 
					      rowKey: 'rowKey' + rowKeyCounter,
 | 
				
			||||||
@@ -155,13 +153,19 @@
 | 
				
			|||||||
      fieldName: '',
 | 
					      fieldName: '',
 | 
				
			||||||
      queryTypeEnum: '',
 | 
					      queryTypeEnum: '',
 | 
				
			||||||
      columnNameList: null,
 | 
					      columnNameList: null,
 | 
				
			||||||
      width: '',
 | 
					      width: '200px',
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    rowKeyCounter++;
 | 
					    rowKeyCounter++;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function onDelete(index) {
 | 
					  function onDelete(index) {
 | 
				
			||||||
    _.pullAt(tableData.value, index);
 | 
					    // 以这种方式删除 列表才会重新渲染
 | 
				
			||||||
 | 
					    const tempList = [...tableData.value];
 | 
				
			||||||
 | 
					    tempList.splice(index, 1);
 | 
				
			||||||
 | 
					    tableData.value = [];
 | 
				
			||||||
 | 
					    nextTick(() => {
 | 
				
			||||||
 | 
					      tableData.value = tempList;
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //初始化拖拽
 | 
					  //初始化拖拽
 | 
				
			||||||
@@ -173,6 +177,10 @@
 | 
				
			|||||||
      ghostClass: 'smart-ghost-class', //设置拖拽停靠样式类名
 | 
					      ghostClass: 'smart-ghost-class', //设置拖拽停靠样式类名
 | 
				
			||||||
      chosenClass: 'smart-ghost-class', //设置选中样式类名
 | 
					      chosenClass: 'smart-ghost-class', //设置选中样式类名
 | 
				
			||||||
      handle: '.handle',
 | 
					      handle: '.handle',
 | 
				
			||||||
 | 
					      onEnd: ({ oldIndex, newIndex }) => {
 | 
				
			||||||
 | 
					        const oldRow = tableData.value.splice(oldIndex, 1)[0];
 | 
				
			||||||
 | 
					        tableData.value.splice(newIndex, 0, oldRow);
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -211,36 +219,16 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // 获取表单数据
 | 
					  // 获取表单数据
 | 
				
			||||||
  function getFieldsForm() {
 | 
					  function getFieldsForm() {
 | 
				
			||||||
    let result = [];
 | 
					    let result = tableData.value.map((item) => {
 | 
				
			||||||
    let trList = document.querySelectorAll('#smartCodeQueryFieldsTable tbody .column-row');
 | 
					      return {
 | 
				
			||||||
    if (trList && trList.length === 0) {
 | 
					        label: item.label,
 | 
				
			||||||
      return result;
 | 
					        width: item.width,
 | 
				
			||||||
    }
 | 
					        fieldName: item.fieldName,
 | 
				
			||||||
 | 
					        queryTypeEnum: item.queryTypeEnum,
 | 
				
			||||||
    for (let tr of trList) {
 | 
					        // 字符串转为数组
 | 
				
			||||||
      let rowKey = tr.getAttribute('data-row-key');
 | 
					        columnNameList: item.columnNameList && typeof item.columnNameList === 'string' ? [item.columnNameList] : item.columnNameList,
 | 
				
			||||||
      if (!rowKey) {
 | 
					 | 
				
			||||||
        continue;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      if (rowKey && rowKey.indexOf('rowKey') === -1) {
 | 
					 | 
				
			||||||
        continue;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      let index = parseInt(rowKey.substring(6));
 | 
					 | 
				
			||||||
      let tableItem = tableData.value[index - 1];
 | 
					 | 
				
			||||||
      let obj = {
 | 
					 | 
				
			||||||
        queryTypeEnum: tableItem.queryTypeEnum,
 | 
					 | 
				
			||||||
        label: tableItem.label,
 | 
					 | 
				
			||||||
        fieldName: tableItem.fieldName,
 | 
					 | 
				
			||||||
        columnNameList: tableItem.columnNameList,
 | 
					 | 
				
			||||||
        width: tableItem.width,
 | 
					 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
      // 字符串转为数组
 | 
					    });
 | 
				
			||||||
      if (obj.columnNameList && typeof obj.columnNameList === 'string') {
 | 
					 | 
				
			||||||
        obj.columnNameList = [obj.columnNameList];
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      result.push(obj);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,7 @@
 | 
				
			|||||||
    title="代码配置"
 | 
					    title="代码配置"
 | 
				
			||||||
    style=""
 | 
					    style=""
 | 
				
			||||||
    :open="visibleFlag"
 | 
					    :open="visibleFlag"
 | 
				
			||||||
    :width="1000"
 | 
					    :width="1500"
 | 
				
			||||||
    :footerStyle="{ textAlign: 'right' }"
 | 
					    :footerStyle="{ textAlign: 'right' }"
 | 
				
			||||||
    @close="onClose"
 | 
					    @close="onClose"
 | 
				
			||||||
    :maskClosable="false"
 | 
					    :maskClosable="false"
 | 
				
			||||||
@@ -175,7 +175,7 @@
 | 
				
			|||||||
      let insertAndUpdateValidated = await insertAndUpdateRef.value.validateForm();
 | 
					      let insertAndUpdateValidated = await insertAndUpdateRef.value.validateForm();
 | 
				
			||||||
      let deleteValidated = await deleteRef.value.validateForm();
 | 
					      let deleteValidated = await deleteRef.value.validateForm();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (!basicValidated || !insertAndUpdateValidated || !deleteValidated ) {
 | 
					      if (!basicValidated || !insertAndUpdateValidated || !deleteValidated) {
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -201,7 +201,7 @@
 | 
				
			|||||||
      onClose();
 | 
					      onClose();
 | 
				
			||||||
    } catch (e) {
 | 
					    } catch (e) {
 | 
				
			||||||
      smartSentry.captureError(e);
 | 
					      smartSentry.captureError(e);
 | 
				
			||||||
    }finally{
 | 
					    } finally {
 | 
				
			||||||
      SmartLoading.hide();
 | 
					      SmartLoading.hide();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,7 +11,7 @@
 | 
				
			|||||||
  <a-drawer
 | 
					  <a-drawer
 | 
				
			||||||
    title="代码预览"
 | 
					    title="代码预览"
 | 
				
			||||||
    :open="visibleFlag"
 | 
					    :open="visibleFlag"
 | 
				
			||||||
    :width="1200"
 | 
					    :width="1500"
 | 
				
			||||||
    :footerStyle="{ textAlign: 'right' }"
 | 
					    :footerStyle="{ textAlign: 'right' }"
 | 
				
			||||||
    :bodyStyle="{ padding: '8px 24px' }"
 | 
					    :bodyStyle="{ padding: '8px 24px' }"
 | 
				
			||||||
    @close="onClose"
 | 
					    @close="onClose"
 | 
				
			||||||
@@ -37,9 +37,9 @@
 | 
				
			|||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
  import { computed, nextTick, ref, watch } from 'vue';
 | 
					  import { computed, nextTick, ref } from 'vue';
 | 
				
			||||||
  import { codeGeneratorApi } from '/@/api/support/code-generator-api';
 | 
					  import { codeGeneratorApi } from '/@/api/support/code-generator-api';
 | 
				
			||||||
  import { JAVA_FILE_LIST, LANGUAGE_LIST, JS_FILE_LIST,TS_FILE_LIST, JAVA_DOMAIN_FILE_LIST } from '../../code-generator-util';
 | 
					  import { JAVA_FILE_LIST, LANGUAGE_LIST, JS_FILE_LIST, TS_FILE_LIST } from '../../code-generator-util';
 | 
				
			||||||
  import { smartSentry } from '/@/lib/smart-sentry';
 | 
					  import { smartSentry } from '/@/lib/smart-sentry';
 | 
				
			||||||
  import { lineNumbersBlock } from '/@/lib/highlight-line-number';
 | 
					  import { lineNumbersBlock } from '/@/lib/highlight-line-number';
 | 
				
			||||||
  import hljs from 'highlight.js';
 | 
					  import hljs from 'highlight.js';
 | 
				
			||||||
@@ -74,11 +74,11 @@
 | 
				
			|||||||
  // ------------------ 标签页 ------------------
 | 
					  // ------------------ 标签页 ------------------
 | 
				
			||||||
  const languageType = ref(LANGUAGE_LIST[0]);
 | 
					  const languageType = ref(LANGUAGE_LIST[0]);
 | 
				
			||||||
  const tabList = computed(() => {
 | 
					  const tabList = computed(() => {
 | 
				
			||||||
    if(languageType.value === LANGUAGE_LIST[0]){
 | 
					    if (languageType.value === LANGUAGE_LIST[0]) {
 | 
				
			||||||
      return JS_FILE_LIST;
 | 
					      return JS_FILE_LIST;
 | 
				
			||||||
    }else if(languageType.value === LANGUAGE_LIST[1]){
 | 
					    } else if (languageType.value === LANGUAGE_LIST[1]) {
 | 
				
			||||||
      return TS_FILE_LIST;
 | 
					      return TS_FILE_LIST;
 | 
				
			||||||
    }else{
 | 
					    } else {
 | 
				
			||||||
      return JAVA_FILE_LIST;
 | 
					      return JAVA_FILE_LIST;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
@@ -86,21 +86,21 @@
 | 
				
			|||||||
  const fileKey = ref(tabList.value[0]);
 | 
					  const fileKey = ref(tabList.value[0]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function getLanguage() {
 | 
					  function getLanguage() {
 | 
				
			||||||
    if(languageType.value === LANGUAGE_LIST[0]){
 | 
					    if (languageType.value === LANGUAGE_LIST[0]) {
 | 
				
			||||||
      return 'javascript';
 | 
					      return 'javascript';
 | 
				
			||||||
    }else if(languageType.value === LANGUAGE_LIST[1]){
 | 
					    } else if (languageType.value === LANGUAGE_LIST[1]) {
 | 
				
			||||||
      return 'typescript';
 | 
					      return 'typescript';
 | 
				
			||||||
    }else{
 | 
					    } else {
 | 
				
			||||||
      return 'java';
 | 
					      return 'java';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function onChangeLanguageType(e){
 | 
					  function onChangeLanguageType(e) {
 | 
				
			||||||
    if(e.target.value === LANGUAGE_LIST[0]){
 | 
					    if (e.target.value === LANGUAGE_LIST[0]) {
 | 
				
			||||||
      fileKey.value = JS_FILE_LIST[0];
 | 
					      fileKey.value = JS_FILE_LIST[0];
 | 
				
			||||||
    }else if(e.target.value === LANGUAGE_LIST[1]){
 | 
					    } else if (e.target.value === LANGUAGE_LIST[1]) {
 | 
				
			||||||
      fileKey.value = TS_FILE_LIST[0];
 | 
					      fileKey.value = TS_FILE_LIST[0];
 | 
				
			||||||
    }else{
 | 
					    } else {
 | 
				
			||||||
      fileKey.value = JAVA_FILE_LIST[0];
 | 
					      fileKey.value = JAVA_FILE_LIST[0];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    onChangeTab(fileKey.value);
 | 
					    onChangeTab(fileKey.value);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -270,7 +270,7 @@
 | 
				
			|||||||
  // 下载文件
 | 
					  // 下载文件
 | 
				
			||||||
  async function download(file) {
 | 
					  async function download(file) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
      await fileApi.downLoadFile(file.fileName, file.fileKey);
 | 
					      await fileApi.downLoadFile(file.fileKey);
 | 
				
			||||||
    } catch (e) {
 | 
					    } catch (e) {
 | 
				
			||||||
      smartSentry.captureError(e);
 | 
					      smartSentry.captureError(e);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,7 @@
 | 
				
			|||||||
      </a-form-item>
 | 
					      </a-form-item>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <a-form-item label="类型" class="smart-query-form-item">
 | 
					      <a-form-item label="类型" class="smart-query-form-item">
 | 
				
			||||||
        <smart-enum-select v-model:value="queryForm.messageType" placeholder="消息类型" enum-name="MESSAGE_TYPE_ENUM" />
 | 
					        <smart-enum-select style="width: 150px" v-model:value="queryForm.messageType" placeholder="消息类型" enum-name="MESSAGE_TYPE_ENUM" />
 | 
				
			||||||
      </a-form-item>
 | 
					      </a-form-item>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <a-form-item label="消息时间" class="smart-query-form-item">
 | 
					      <a-form-item label="消息时间" class="smart-query-form-item">
 | 
				
			||||||
@@ -43,7 +43,7 @@
 | 
				
			|||||||
  </a-form>
 | 
					  </a-form>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <a-table size="small" :dataSource="tableData" :columns="columns" rowKey="messageId" :pagination="false" bordered>
 | 
					  <a-table size="small" :dataSource="tableData" :columns="columns" rowKey="messageId" :pagination="false" bordered>
 | 
				
			||||||
    <template #bodyCell="{ text, record, index, column }">
 | 
					    <template #bodyCell="{ text, record, column }">
 | 
				
			||||||
      <template v-if="column.dataIndex === 'messageType'">
 | 
					      <template v-if="column.dataIndex === 'messageType'">
 | 
				
			||||||
        <span>{{ $smartEnumPlugin.getDescByValue('MESSAGE_TYPE_ENUM', text) }}</span>
 | 
					        <span>{{ $smartEnumPlugin.getDescByValue('MESSAGE_TYPE_ENUM', text) }}</span>
 | 
				
			||||||
      </template>
 | 
					      </template>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,7 +49,6 @@
 | 
				
			|||||||
</script>
 | 
					</script>
 | 
				
			||||||
<style lang="less" scoped>
 | 
					<style lang="less" scoped>
 | 
				
			||||||
  .card-container {
 | 
					  .card-container {
 | 
				
			||||||
    background-color: #fff;
 | 
					 | 
				
			||||||
    height: 100%;
 | 
					    height: 100%;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .title {
 | 
					    .title {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,158 +0,0 @@
 | 
				
			|||||||
<!--
 | 
					 | 
				
			||||||
  * 已办/代办
 | 
					 | 
				
			||||||
  * 
 | 
					 | 
				
			||||||
  * @Author:    1024创新实验室-主任:卓大 
 | 
					 | 
				
			||||||
  * @Date:      2022-09-12 22:34:00 
 | 
					 | 
				
			||||||
  * @Wechat:    zhuda1024 
 | 
					 | 
				
			||||||
  * @Email:     lab1024@163.com 
 | 
					 | 
				
			||||||
  * @Copyright  1024创新实验室 ( https://1024lab.net ),Since 2012 
 | 
					 | 
				
			||||||
  *
 | 
					 | 
				
			||||||
-->
 | 
					 | 
				
			||||||
<template>
 | 
					 | 
				
			||||||
  <default-home-card icon="Star" title="已办待办">
 | 
					 | 
				
			||||||
    <div style="height: 280px">
 | 
					 | 
				
			||||||
      <div class="center column">
 | 
					 | 
				
			||||||
        <a-space direction="vertical" style="width: 100%">
 | 
					 | 
				
			||||||
          <div v-for="(item, index) in toDoList" :key="index" :class="['to-do', { done: item.doneFlag }]">
 | 
					 | 
				
			||||||
            <a-checkbox v-model:checked="item.doneFlag">
 | 
					 | 
				
			||||||
              <span class="task">{{ item.title }}</span>
 | 
					 | 
				
			||||||
            </a-checkbox>
 | 
					 | 
				
			||||||
            <div class="star-icon" @click="itemStar(item)">
 | 
					 | 
				
			||||||
              <StarFilled v-if="item.starFlag" style="color: #ff8c00" />
 | 
					 | 
				
			||||||
              <StarOutlined v-else style="color: #c0c0c0" />
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </div>
 | 
					 | 
				
			||||||
          <div v-for="(item, index) in doneList" :key="index" :class="['to-do', { done: item.doneFlag }]">
 | 
					 | 
				
			||||||
            <a-checkbox v-model:checked="item.doneFlag">
 | 
					 | 
				
			||||||
              <span class="task">{{ item.title }}</span>
 | 
					 | 
				
			||||||
            </a-checkbox>
 | 
					 | 
				
			||||||
            <div class="star-icon" @click="itemStar(item)">
 | 
					 | 
				
			||||||
              <StarFilled v-if="item.starFlag" style="color: #ff8c00" />
 | 
					 | 
				
			||||||
              <StarOutlined v-else style="color: #c0c0c0" />
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          </div>
 | 
					 | 
				
			||||||
        </a-space>
 | 
					 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
  </default-home-card>
 | 
					 | 
				
			||||||
</template>
 | 
					 | 
				
			||||||
<script setup>
 | 
					 | 
				
			||||||
  import DefaultHomeCard from '/@/views/system/home/components/default-home-card.vue';
 | 
					 | 
				
			||||||
  import { computed, ref } from 'vue';
 | 
					 | 
				
			||||||
  import dayjs from 'dayjs';
 | 
					 | 
				
			||||||
  import { message } from 'ant-design-vue';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  let taskList = ref([
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      title: '周五下班前需要提交周报',
 | 
					 | 
				
			||||||
      doneFlag: true,
 | 
					 | 
				
			||||||
      starFlag: true,
 | 
					 | 
				
			||||||
      starTime: 0,
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      title: '为SmartAdmin前端小组分配任务',
 | 
					 | 
				
			||||||
      doneFlag: false,
 | 
					 | 
				
			||||||
      starFlag: false,
 | 
					 | 
				
			||||||
      starTime: 0,
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      title: '跟进团建内容事宜',
 | 
					 | 
				
			||||||
      doneFlag: false,
 | 
					 | 
				
			||||||
      starFlag: true,
 | 
					 | 
				
			||||||
      starTime: 0,
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      title: '跟进客户定制一个软件平台',
 | 
					 | 
				
			||||||
      doneFlag: false,
 | 
					 | 
				
			||||||
      starFlag: false,
 | 
					 | 
				
			||||||
      starTime: 0,
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      title: '下个版本的需求确认',
 | 
					 | 
				
			||||||
      doneFlag: false,
 | 
					 | 
				
			||||||
      starFlag: false,
 | 
					 | 
				
			||||||
      starTime: 0,
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      title: '线上版本发布',
 | 
					 | 
				
			||||||
      doneFlag: true,
 | 
					 | 
				
			||||||
      starFlag: true,
 | 
					 | 
				
			||||||
      starTime: dayjs().unix(),
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      title: '周一财务报销',
 | 
					 | 
				
			||||||
      doneFlag: true,
 | 
					 | 
				
			||||||
      starFlag: false,
 | 
					 | 
				
			||||||
      starTime: 0,
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  ]);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  let toDoList = computed(() => {
 | 
					 | 
				
			||||||
    return taskList.value.filter((e) => !e.doneFlag).sort((a, b) => b.starTime - a.starTime);
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  let doneList = computed(() => {
 | 
					 | 
				
			||||||
    return taskList.value.filter((e) => e.doneFlag);
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  function itemStar(item) {
 | 
					 | 
				
			||||||
    item.starFlag = !item.starFlag;
 | 
					 | 
				
			||||||
    if (item.starFlag) {
 | 
					 | 
				
			||||||
      item.starTime = dayjs().unix();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  //-------------------------任务新建-----------------------
 | 
					 | 
				
			||||||
  let taskTitle = ref('');
 | 
					 | 
				
			||||||
  function addTask() {
 | 
					 | 
				
			||||||
    if (!taskTitle.value) {
 | 
					 | 
				
			||||||
      message.warn('请输入任务标题');
 | 
					 | 
				
			||||||
      return;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    let data = {
 | 
					 | 
				
			||||||
      title: taskTitle.value,
 | 
					 | 
				
			||||||
      doneFlag: false,
 | 
					 | 
				
			||||||
      starFlag: false,
 | 
					 | 
				
			||||||
      starTime: 0,
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    taskList.value.unshift(data);
 | 
					 | 
				
			||||||
    taskTitle.value = '';
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
</script>
 | 
					 | 
				
			||||||
<style lang="less" scoped>
 | 
					 | 
				
			||||||
  .center {
 | 
					 | 
				
			||||||
    display: flex;
 | 
					 | 
				
			||||||
    justify-content: center;
 | 
					 | 
				
			||||||
    height: 100%;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    &.column {
 | 
					 | 
				
			||||||
      flex-direction: column;
 | 
					 | 
				
			||||||
      width: 100%;
 | 
					 | 
				
			||||||
      padding: 0 10px;
 | 
					 | 
				
			||||||
      justify-content: flex-start;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  .to-do {
 | 
					 | 
				
			||||||
    width: 100%;
 | 
					 | 
				
			||||||
    border: 1px solid #d3d3d3;
 | 
					 | 
				
			||||||
    border-radius: 4px;
 | 
					 | 
				
			||||||
    padding: 4px;
 | 
					 | 
				
			||||||
    display: flex;
 | 
					 | 
				
			||||||
    align-items: center;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    .star-icon {
 | 
					 | 
				
			||||||
      margin-left: auto;
 | 
					 | 
				
			||||||
      cursor: pointer;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    &.done {
 | 
					 | 
				
			||||||
      text-decoration: line-through;
 | 
					 | 
				
			||||||
      color: #8c8c8c;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      .task {
 | 
					 | 
				
			||||||
        color: #8c8c8c;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
</style>
 | 
					 | 
				
			||||||
@@ -0,0 +1,177 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					  * 待办工作
 | 
				
			||||||
 | 
					  * 
 | 
				
			||||||
 | 
					  * @Author:    1024创新实验室-主任:卓大 
 | 
				
			||||||
 | 
					  * @Date:      2022-09-12 22:34:00
 | 
				
			||||||
 | 
					  * @Copyright  1024创新实验室 ( https://1024lab.net ),Since 2012 
 | 
				
			||||||
 | 
					  *
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <default-home-card extra="添加" icon="StarTwoTone" title="待办工作" @extraClick="showAddToBeDone">
 | 
				
			||||||
 | 
					    <div style="height: 280px">
 | 
				
			||||||
 | 
					      <div class="center column">
 | 
				
			||||||
 | 
					        <a-space direction="vertical" style="width: 100%">
 | 
				
			||||||
 | 
					          <a-empty v-if="$lodash.isEmpty(toBeDoneList)" description="暂无待办工作" />
 | 
				
			||||||
 | 
					          <div v-for="(item, index) in toDoList" :key="index" :class="['to-do', { done: item.doneFlag }]">
 | 
				
			||||||
 | 
					            <a-checkbox v-model:checked="item.doneFlag" @change="handleCheckbox">
 | 
				
			||||||
 | 
					              <span class="task">{{ item.title }}</span>
 | 
				
			||||||
 | 
					            </a-checkbox>
 | 
				
			||||||
 | 
					            <div v-if="!item.doneFlag" class="star-icon" @click="itemStar(item)">
 | 
				
			||||||
 | 
					              <StarFilled v-if="item.starFlag" style="color: #ff8c00" />
 | 
				
			||||||
 | 
					              <StarOutlined v-else style="color: #c0c0c0" />
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					            <close-circle-outlined class="delete-icon" @click="toDelete(item)" />
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					          <div v-for="(item, index) in doneList" :key="index" :class="['to-do', { done: item.doneFlag }]">
 | 
				
			||||||
 | 
					            <a-checkbox v-model:checked="item.doneFlag" @change="handleCheckbox">
 | 
				
			||||||
 | 
					              <span class="task">{{ item.title }}</span>
 | 
				
			||||||
 | 
					            </a-checkbox>
 | 
				
			||||||
 | 
					            <div v-if="!item.doneFlag" class="star-icon" @click="itemStar(item)">
 | 
				
			||||||
 | 
					              <StarFilled v-if="item.starFlag" style="color: #ff8c00" />
 | 
				
			||||||
 | 
					              <StarOutlined v-else style="color: #c0c0c0" />
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					            <close-circle-outlined class="delete-icon" @click="toDelete(item)" />
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					        </a-space>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  </default-home-card>
 | 
				
			||||||
 | 
					  <ToBeDoneModal ref="toBeDoneModalRef" @addToBeDone="addToBeDone" />
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					<script setup>
 | 
				
			||||||
 | 
					  import DefaultHomeCard from '/@/views/system/home/components/default-home-card.vue';
 | 
				
			||||||
 | 
					  import ToBeDoneModal from './to-be-done-modal.vue';
 | 
				
			||||||
 | 
					  import localKey from '/@/constants/local-storage-key-const';
 | 
				
			||||||
 | 
					  import { localRead, localSave } from '/@/utils/local-util';
 | 
				
			||||||
 | 
					  import { useUserStore } from '/@/store/modules/system/user.js';
 | 
				
			||||||
 | 
					  import { computed, ref, onMounted } from 'vue';
 | 
				
			||||||
 | 
					  import { Modal } from 'ant-design-vue';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  let toBeDoneList = ref([]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  onMounted(() => {
 | 
				
			||||||
 | 
					    initTaskList();
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function initTaskList() {
 | 
				
			||||||
 | 
					    let localTaskList = localRead(localKey.TO_BE_DONE);
 | 
				
			||||||
 | 
					    if (localTaskList) {
 | 
				
			||||||
 | 
					      toBeDoneList.value = JSON.parse(localTaskList);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  let toDoList = computed(() => {
 | 
				
			||||||
 | 
					    return toBeDoneList.value.filter((e) => !e.doneFlag);
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  let doneList = computed(() => {
 | 
				
			||||||
 | 
					    return toBeDoneList.value.filter((e) => e.doneFlag);
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function handleCheckbox(e) {
 | 
				
			||||||
 | 
					    localSave(localKey.TO_BE_DONE, JSON.stringify(toBeDoneList.value));
 | 
				
			||||||
 | 
					    useUserStore().toBeDoneCount = toDoList.value.length;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function itemStar(data) {
 | 
				
			||||||
 | 
					    data.starFlag = !data.starFlag;
 | 
				
			||||||
 | 
					    // 将取消 star 的删除掉
 | 
				
			||||||
 | 
					    const index = toBeDoneList.value.findIndex((item) => item.title === data.title);
 | 
				
			||||||
 | 
					    toBeDoneList.value.splice(index, 1);
 | 
				
			||||||
 | 
					    if (data.starFlag) {
 | 
				
			||||||
 | 
					      // 最新添加标记star的移动到第一位
 | 
				
			||||||
 | 
					      toBeDoneList.value.unshift(data);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      // 取消标记star的移动到最后一个标记 star 的后面添加
 | 
				
			||||||
 | 
					      const lastStarIndex = toBeDoneList.value.findLastIndex((item) => item.starFlag);
 | 
				
			||||||
 | 
					      toBeDoneList.value.splice(lastStarIndex + 1, 0, data);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    localSave(localKey.TO_BE_DONE, JSON.stringify(toBeDoneList.value));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  //-------------------------任务新建-----------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  let toBeDoneModalRef = ref();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function showAddToBeDone() {
 | 
				
			||||||
 | 
					    toBeDoneModalRef.value.showModal();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 添加待办工作
 | 
				
			||||||
 | 
					  function addToBeDone(data) {
 | 
				
			||||||
 | 
					    toBeDoneList.value.push(data);
 | 
				
			||||||
 | 
					    localSave(localKey.TO_BE_DONE, JSON.stringify(toBeDoneList.value));
 | 
				
			||||||
 | 
					    useUserStore().toBeDoneCount = toDoList.value.length;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function toDelete(data) {
 | 
				
			||||||
 | 
					    if (!data.doneFlag) {
 | 
				
			||||||
 | 
					      Modal.confirm({
 | 
				
			||||||
 | 
					        title: '提示',
 | 
				
			||||||
 | 
					        content: '确定要删除吗?',
 | 
				
			||||||
 | 
					        okText: '删除',
 | 
				
			||||||
 | 
					        okType: 'danger',
 | 
				
			||||||
 | 
					        onOk() {
 | 
				
			||||||
 | 
					          deleteToBeDone(data);
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        cancelText: '取消',
 | 
				
			||||||
 | 
					        onCancel() {},
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      deleteToBeDone(data);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 删除待办工作
 | 
				
			||||||
 | 
					  function deleteToBeDone(data) {
 | 
				
			||||||
 | 
					    const index = toBeDoneList.value.findIndex((item) => item.title === data.title);
 | 
				
			||||||
 | 
					    toBeDoneList.value.splice(index, 1);
 | 
				
			||||||
 | 
					    localSave(localKey.TO_BE_DONE, JSON.stringify(toBeDoneList.value));
 | 
				
			||||||
 | 
					    useUserStore().toBeDoneCount = toDoList.value.length;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style lang="less" scoped>
 | 
				
			||||||
 | 
					  .center {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    justify-content: center;
 | 
				
			||||||
 | 
					    height: 100%;
 | 
				
			||||||
 | 
					    overflow-y: auto;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    &.column {
 | 
				
			||||||
 | 
					      flex-direction: column;
 | 
				
			||||||
 | 
					      width: 100%;
 | 
				
			||||||
 | 
					      padding: 0 10px;
 | 
				
			||||||
 | 
					      justify-content: flex-start;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .to-do {
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					    border: 1px solid #d3d3d3;
 | 
				
			||||||
 | 
					    border-radius: 4px;
 | 
				
			||||||
 | 
					    padding: 4px;
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    align-items: center;
 | 
				
			||||||
 | 
					    .star-icon {
 | 
				
			||||||
 | 
					      margin-left: auto;
 | 
				
			||||||
 | 
					      cursor: pointer;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    &.done {
 | 
				
			||||||
 | 
					      text-decoration: line-through;
 | 
				
			||||||
 | 
					      color: #8c8c8c;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      .task {
 | 
				
			||||||
 | 
					        color: #8c8c8c;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .delete-icon {
 | 
				
			||||||
 | 
					    color: #f08080;
 | 
				
			||||||
 | 
					    padding-left: 10px;
 | 
				
			||||||
 | 
					    top: -5px;
 | 
				
			||||||
 | 
					    right: -5px;
 | 
				
			||||||
 | 
					    float: right;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@@ -0,0 +1,65 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <div>
 | 
				
			||||||
 | 
					    <a-modal v-model:open="visible" title="新建待办" @close="onClose">
 | 
				
			||||||
 | 
					      <a-form ref="formRef" :model="form" :rules="rules">
 | 
				
			||||||
 | 
					        <a-form-item label="标题" name="title">
 | 
				
			||||||
 | 
					          <a-input v-model:value="form.title" placeholder="请输入标题" />
 | 
				
			||||||
 | 
					        </a-form-item>
 | 
				
			||||||
 | 
					      </a-form>
 | 
				
			||||||
 | 
					      <template #footer>
 | 
				
			||||||
 | 
					        <a-button @click="onClose">取消</a-button>
 | 
				
			||||||
 | 
					        <a-button type="primary" @click="onSubmit">确定</a-button>
 | 
				
			||||||
 | 
					      </template>
 | 
				
			||||||
 | 
					    </a-modal>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					<script setup>
 | 
				
			||||||
 | 
					  import { reactive, ref } from 'vue';
 | 
				
			||||||
 | 
					  import { message } from 'ant-design-vue';
 | 
				
			||||||
 | 
					  import _ from 'lodash';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  defineExpose({
 | 
				
			||||||
 | 
					    showModal,
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const emit = defineEmits(['addToBeDone']);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 组件ref
 | 
				
			||||||
 | 
					  const formRef = ref();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const formDefault = {
 | 
				
			||||||
 | 
					    title: undefined,
 | 
				
			||||||
 | 
					    doneFlag: false,
 | 
				
			||||||
 | 
					    starFlag: false,
 | 
				
			||||||
 | 
					    starTime: 0,
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					  let form = reactive({ ...formDefault });
 | 
				
			||||||
 | 
					  const rules = {
 | 
				
			||||||
 | 
					    title: [{ required: true, message: '标题不能为空' }],
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const visible = ref(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function showModal() {
 | 
				
			||||||
 | 
					    visible.value = true;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function onClose() {
 | 
				
			||||||
 | 
					    Object.assign(form, formDefault);
 | 
				
			||||||
 | 
					    visible.value = false;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function onSubmit() {
 | 
				
			||||||
 | 
					    formRef.value
 | 
				
			||||||
 | 
					      .validate()
 | 
				
			||||||
 | 
					      .then(() => {
 | 
				
			||||||
 | 
					        emit('addToBeDone', _.cloneDeep(form));
 | 
				
			||||||
 | 
					        onClose();
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					      .catch((error) => {
 | 
				
			||||||
 | 
					        console.log('error', error);
 | 
				
			||||||
 | 
					        message.error('参数验证错误,请仔细填写表单数据!');
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style lang="less" scoped></style>
 | 
				
			||||||
@@ -70,7 +70,7 @@
 | 
				
			|||||||
  import HomeNotice from './home-notice.vue';
 | 
					  import HomeNotice from './home-notice.vue';
 | 
				
			||||||
  import HomeQuickEntry from './components/quick-entry/home-quick-entry.vue';
 | 
					  import HomeQuickEntry from './components/quick-entry/home-quick-entry.vue';
 | 
				
			||||||
  import OfficialAccountCard from './components/official-account-card.vue';
 | 
					  import OfficialAccountCard from './components/official-account-card.vue';
 | 
				
			||||||
  import ToBeDoneCard from './components/to-be-done-card.vue';
 | 
					  import ToBeDoneCard from './components/to-be-done-card/home-to-be-done.vue';
 | 
				
			||||||
  import ChangelogCard from './components/changelog-card.vue';
 | 
					  import ChangelogCard from './components/changelog-card.vue';
 | 
				
			||||||
  import Gauge from './components/echarts/gauge.vue';
 | 
					  import Gauge from './components/echarts/gauge.vue';
 | 
				
			||||||
  import Category from './components/echarts/category.vue';
 | 
					  import Category from './components/echarts/category.vue';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -61,7 +61,7 @@
 | 
				
			|||||||
          <a-switch v-model:checked="form.visibleFlag" checked-children="显示" un-checked-children="不显示" />
 | 
					          <a-switch v-model:checked="form.visibleFlag" checked-children="显示" un-checked-children="不显示" />
 | 
				
			||||||
        </a-form-item>
 | 
					        </a-form-item>
 | 
				
			||||||
        <a-form-item label="禁用状态" name="frameFlag">
 | 
					        <a-form-item label="禁用状态" name="frameFlag">
 | 
				
			||||||
          <a-switch v-model:checked="form.disabledFlag" checked-children="启用" un-checked-children="禁用" />
 | 
					          <a-switch v-model:checked="form.disabledFlag" :checkedValue="false" :unCheckedValue="true" checked-children="启用" un-checked-children="禁用" />
 | 
				
			||||||
        </a-form-item>
 | 
					        </a-form-item>
 | 
				
			||||||
      </template>
 | 
					      </template>
 | 
				
			||||||
      <!--      目录 菜单 end   -->
 | 
					      <!--      目录 菜单 end   -->
 | 
				
			||||||
@@ -74,7 +74,7 @@
 | 
				
			|||||||
          <MenuTreeSelect ref="contextMenuTreeSelect" v-model:value="form.contextMenuId" />
 | 
					          <MenuTreeSelect ref="contextMenuTreeSelect" v-model:value="form.contextMenuId" />
 | 
				
			||||||
        </a-form-item>
 | 
					        </a-form-item>
 | 
				
			||||||
        <a-form-item label="功能点状态" name="frameFlag">
 | 
					        <a-form-item label="功能点状态" name="frameFlag">
 | 
				
			||||||
          <a-switch v-model:checked="form.disabledFlag" checked-children="启用" un-checked-children="禁用" />
 | 
					          <a-switch v-model:checked="form.disabledFlag" :checkedValue="false" :unCheckedValue="true" checked-children="启用" un-checked-children="禁用" />
 | 
				
			||||||
        </a-form-item>
 | 
					        </a-form-item>
 | 
				
			||||||
        <a-form-item label="权限类型" name="permsType">
 | 
					        <a-form-item label="权限类型" name="permsType">
 | 
				
			||||||
          <a-radio-group v-model:value="form.permsType">
 | 
					          <a-radio-group v-model:value="form.permsType">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -168,7 +168,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  async function addRoleEmployee() {
 | 
					  async function addRoleEmployee() {
 | 
				
			||||||
    let res = await roleApi.getRoleAllEmployee(selectRoleId.value);
 | 
					    let res = await roleApi.getRoleAllEmployee(selectRoleId.value);
 | 
				
			||||||
    let selectedIdList = res.data.map((e) => e.roleId) || [];
 | 
					    let selectedIdList = res.data.map((e) => e.employeeId) || [];
 | 
				
			||||||
    selectEmployeeModal.value.showModal(selectedIdList);
 | 
					    selectEmployeeModal.value.showModal(selectedIdList);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,7 @@ export const fileApi = {
 | 
				
			|||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * 下载文件流(根据fileKey) @author 胡克
 | 
					   * 下载文件流(根据fileKey) @author 胡克
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  downLoadFile: (fileName, fileKey) => {
 | 
					  downLoadFile: (fileKey) => {
 | 
				
			||||||
    return getDownload(fileName, '/support/file/downLoad', { fileKey });
 | 
					    return getDownload('/support/file/downLoad', { fileKey });
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -270,7 +270,7 @@ function view(file) {
 | 
				
			|||||||
// 下载文件
 | 
					// 下载文件
 | 
				
			||||||
async function download(file) {
 | 
					async function download(file) {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    await fileApi.downLoadFile(file.fileName, file.fileKey);
 | 
					    await fileApi.downLoadFile(file.fileKey);
 | 
				
			||||||
  } catch (e) {
 | 
					  } catch (e) {
 | 
				
			||||||
    smartSentry.captureError(e);
 | 
					    smartSentry.captureError(e);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user