💬 修改角色字段roleName为roleCode

This commit is contained in:
bunny 2025-07-13 22:33:10 +08:00
parent 04e4a15136
commit 7652b505f7
6 changed files with 23 additions and 22 deletions

View File

@ -19,9 +19,9 @@ public class RoleDto {
@Schema(name = "id", title = "主键ID")
private Long id;
@Schema(name = "roleName", title = "角色名称")
@NotBlank(message = "角色名称不能为空")
private String roleName;
@Schema(name = "roleCode", title = "角色码")
@NotBlank(message = "角色不能为空")
private String roleCode;
@Schema(name = "description", title = "角色描述")
@NotBlank(message = "角色描述不能为空")

View File

@ -14,8 +14,8 @@ import lombok.experimental.Accessors;
@Schema(name = "Role对象", title = "系统角色表", description = "系统角色表的实体类对象")
public class RoleEntity extends BaseEntity {
@Schema(name = "roleName", title = "角色名称")
private String roleName;
@Schema(name = "roleCode", title = "角色码")
private String roleCode;
@Schema(name = "description", title = "角色描述")
private String description;

View File

@ -21,8 +21,8 @@ public class RoleVo {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@Schema(name = "roleName", title = "角色名称")
private String roleName;
@Schema(name = "roleCode", title = "角色名称")
private String roleCode;
@Schema(name = "description", title = "角色描述")
private String description;

View File

@ -5,7 +5,7 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.spring.step2.domain.entity.RoleEntity">
<id column="id" property="id"/>
<id column="role_name" property="roleName"/>
<id column="role_name" property="roleCode"/>
<id column="description" property="description"/>
<id column="remark" property="remark"/>
<id column="create_time" property="createTime"/>
@ -30,8 +30,8 @@
<if test="dto.id != null and dto.id != ''">
and id like CONCAT('%',#{dto.id},'%')
</if>
<if test="dto.roleName != null and dto.roleName != ''">
and role_name like CONCAT('%',#{dto.roleName},'%')
<if test="dto.roleCode != null and dto.roleCode != ''">
and role_code like CONCAT('%',#{dto.roleCode},'%')
</if>
<if test="dto.description != null and dto.description != ''">
and description like CONCAT('%',#{dto.description},'%')

View File

@ -1,8 +1,8 @@
const DialogRole = {
const DialogRole = defineComponent({
name: "DialogRole",
template: `
<div class="modal fade" id="roleBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
aria-labelledby="roleBackdropLabel" aria-hidden="true" ref="modalRef">
aria-labelledby="roleBackdropLabel" ref="modalRef">
<div class="modal-dialog">
<div class="modal-content">
@ -16,9 +16,9 @@ const DialogRole = {
<!-- 内容 -->
<div class="modal-body">
<div class="mb-3">
<label class="form-label" for="dialogRoleName"><i class="fas fa-user-alt me-1"></i></label>
<input autocomplete="false" class="form-control" id="dialogRoleName" placeholder="请输入角色名"
type="text" v-model="form.roleName" required>
<label class="form-label" for="dialogRoleCode"><i class="fas fa-user-alt me-1"></i></label>
<input autocomplete="false" class="form-control" id="dialogRoleCode" placeholder="请输入角色名"
type="text" v-model="form.roleCode" required>
<div class="form-text">在这里输入你的角色名</div>
</div>
<div class="mb-3">
@ -94,4 +94,4 @@ const DialogRole = {
this.modalInstance.dispose();
}
}
};
});

View File

@ -44,9 +44,9 @@
<form @reset="onRest" @submit.prevent="onSearch">
<div class="row g-3 align-items-center">
<div class="col-md-4">
<label class="form-label" for="roleName"><i class="fas fa-user-alt me-1"></i>角色名</label>
<input autocomplete="false" class="form-control" id="roleName" placeholder="请输入角色名"
type="text" v-model="searchForm.roleName">
<label class="form-label" for="roleCode"><i class="fas fa-user-alt me-1"></i>角色名</label>
<input autocomplete="false" class="form-control" id="roleCode" placeholder="请输入角色名"
type="text" v-model="searchForm.roleCode">
</div>
<div class="col-md-4">
<label class="form-label" for="description"><i class="fas fa-text-width me-1"></i>描述</label>
@ -98,7 +98,7 @@
<tbody>
<tr :key="role.id" v-for="(role,index) in dataList">
<th scope="row">{{index + 1}}</th>
<td>{{role.roleName}}</td>
<td>{{role.roleCode}}</td>
<td>{{role.description}}</td>
<td>{{role.remark}}</td>
<td>{{formatDate(role.createTime)}}</td>
@ -142,7 +142,7 @@
return {
// 查询表单
searchForm: ref({
roleName: undefined,
roleCode: undefined,
description: undefined,
remark: undefined,
pageNo: 1,
@ -181,8 +181,9 @@
/* 重制表单 */
onRest() {
this.searchForm.roleName = undefined;
this.searchForm.roleCode = undefined;
this.searchForm.description = undefined;
this.searchForm.remark = undefined;
this.onSearch();
},