mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-11-04 10:57:10 +08:00 
			
		
		
		
	优化:将列表排序由按修改时间降序调整为按创建时间降序(避免修改后数据记录移动),将列表中的审计信息由“修改人”、“修改时间”调整展示为“创建人”、“创建时间”,后续涉及完整审计信息将在详情中统一展示
This commit is contained in:
		@@ -36,20 +36,20 @@ public class BaseDetailVO extends BaseVO {
 | 
				
			|||||||
    private static final long serialVersionUID = 1L;
 | 
					    private static final long serialVersionUID = 1L;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 创建人
 | 
					     * 修改人
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @JsonIgnore
 | 
					    @JsonIgnore
 | 
				
			||||||
    private Long createUser;
 | 
					    private Long updateUser;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 创建人
 | 
					     * 修改人
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Schema(description = "创建人")
 | 
					    @Schema(description = "修改人")
 | 
				
			||||||
    private String createUserString;
 | 
					    private String updateUserString;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 创建时间
 | 
					     * 修改时间
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Schema(description = "创建时间")
 | 
					    @Schema(description = "修改时间")
 | 
				
			||||||
    private LocalDateTime createTime;
 | 
					    private LocalDateTime updateTime;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,20 +37,20 @@ public class BaseVO implements Serializable {
 | 
				
			|||||||
    private static final long serialVersionUID = 1L;
 | 
					    private static final long serialVersionUID = 1L;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 修改人
 | 
					     * 创建人
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @JsonIgnore
 | 
					    @JsonIgnore
 | 
				
			||||||
    private Long updateUser;
 | 
					    private Long createUser;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 修改人
 | 
					     * 创建人
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Schema(description = "修改人")
 | 
					    @Schema(description = "创建人")
 | 
				
			||||||
    private String updateUserString;
 | 
					    private String createUserString;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 修改时间
 | 
					     * 创建时间
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Schema(description = "修改时间")
 | 
					    @Schema(description = "创建时间")
 | 
				
			||||||
    private LocalDateTime updateTime;
 | 
					    private LocalDateTime createTime;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -154,6 +154,6 @@ public class LogServiceImpl implements LogService {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        logVO.setCreateUserString(
 | 
					        logVO.setCreateUserString(
 | 
				
			||||||
            ExceptionUtils.exToNull(() -> userService.getById(logVO.getCreateUser())).getNickname());
 | 
					            ExceptionUtils.exToNull(() -> userService.getById(createUser)).getNickname());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -64,7 +64,7 @@ public class DeptServiceImpl extends
 | 
				
			|||||||
    public List<DeptVO> list(DeptQuery query) {
 | 
					    public List<DeptVO> list(DeptQuery query) {
 | 
				
			||||||
        QueryWrapper<DeptDO> queryWrapper = QueryHelper.build(query);
 | 
					        QueryWrapper<DeptDO> queryWrapper = QueryHelper.build(query);
 | 
				
			||||||
        queryWrapper.lambda().orderByAsc(DeptDO::getParentId).orderByAsc(DeptDO::getDeptSort)
 | 
					        queryWrapper.lambda().orderByAsc(DeptDO::getParentId).orderByAsc(DeptDO::getDeptSort)
 | 
				
			||||||
            .orderByDesc(DeptDO::getUpdateTime);
 | 
					            .orderByDesc(DeptDO::getCreateTime);
 | 
				
			||||||
        List<DeptDO> deptList = baseMapper.selectList(queryWrapper);
 | 
					        List<DeptDO> deptList = baseMapper.selectList(queryWrapper);
 | 
				
			||||||
        List<DeptVO> list = BeanUtil.copyToList(deptList, DeptVO.class);
 | 
					        List<DeptVO> list = BeanUtil.copyToList(deptList, DeptVO.class);
 | 
				
			||||||
        list.forEach(this::fill);
 | 
					        list.forEach(this::fill);
 | 
				
			||||||
@@ -174,11 +174,11 @@ public class DeptServiceImpl extends
 | 
				
			|||||||
     *            部门信息
 | 
					     *            部门信息
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    private void fill(DeptVO deptVO) {
 | 
					    private void fill(DeptVO deptVO) {
 | 
				
			||||||
        Long updateUser = deptVO.getUpdateUser();
 | 
					        Long createUser = deptVO.getCreateUser();
 | 
				
			||||||
        if (updateUser == null) {
 | 
					        if (createUser == null) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        deptVO.setUpdateUserString(
 | 
					        deptVO.setCreateUserString(
 | 
				
			||||||
            ExceptionUtils.exToNull(() -> userService.getById(deptVO.getUpdateUser())).getNickname());
 | 
					            ExceptionUtils.exToNull(() -> userService.getById(createUser)).getNickname());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,8 +8,8 @@ export interface DeptRecord {
 | 
				
			|||||||
  deptSort: number;
 | 
					  deptSort: number;
 | 
				
			||||||
  description: string;
 | 
					  description: string;
 | 
				
			||||||
  status?: number;
 | 
					  status?: number;
 | 
				
			||||||
  updateUserString: string;
 | 
					  createUserString: string;
 | 
				
			||||||
  updateTime: string;
 | 
					  createTime: string;
 | 
				
			||||||
  children: Array<DeptRecord>,
 | 
					  children: Array<DeptRecord>,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -369,12 +369,12 @@
 | 
				
			|||||||
      dataIndex: 'description',
 | 
					      dataIndex: 'description',
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      title: '修改人',
 | 
					      title: '创建人',
 | 
				
			||||||
      dataIndex: 'updateUserString',
 | 
					      dataIndex: 'createUserString',
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      title: '修改时间',
 | 
					      title: '创建时间',
 | 
				
			||||||
      dataIndex: 'updateTime',
 | 
					      dataIndex: 'createTime',
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      title: '操作',
 | 
					      title: '操作',
 | 
				
			||||||
@@ -502,8 +502,8 @@
 | 
				
			|||||||
    deptSort: 999,
 | 
					    deptSort: 999,
 | 
				
			||||||
    description: '',
 | 
					    description: '',
 | 
				
			||||||
    status: undefined,
 | 
					    status: undefined,
 | 
				
			||||||
    updateUserString: '',
 | 
					    createUserString: '',
 | 
				
			||||||
    updateTime: '',
 | 
					    createTime: '',
 | 
				
			||||||
    children: [],
 | 
					    children: [],
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  const rules = computed((): Record<string, FieldRule[]> => {
 | 
					  const rules = computed((): Record<string, FieldRule[]> => {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user