Compare commits

...

3 Commits

Author SHA1 Message Date
mashuo 2a586bfac8
Pre Merge pull request !402 from mashuo/springboot3 2025-04-17 07:42:33 +00:00
RuoYi 3a61e8df5a 优化角色禁用不允许分配 2025-04-17 15:42:20 +08:00
RuoYi 9d242f0182 update status name 2025-04-17 15:42:03 +08:00
3 changed files with 16 additions and 9 deletions

View File

@ -56,8 +56,8 @@ public class SysUser extends BaseEntity
/** 密码 */
private String password;
/** 号状态0正常 1停用 */
@Excel(name = "号状态", readConverterExp = "0=正常,1=停用")
/** 号状态0正常 1停用 */
@Excel(name = "号状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志0代表存在 2代表删除 */
@ -297,6 +297,7 @@ public class SysUser extends BaseEntity
{
this.roleId = roleId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -10,7 +10,7 @@
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="登录账号" prop="userName">
<el-input v-model="form.userName" disabled />
<el-input v-model="form.userName" disabled />
</el-form-item>
</el-col>
</el-row>
@ -20,10 +20,10 @@
<el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
<el-table-column label="序号" type="index" align="center">
<template slot-scope="scope">
<span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
<span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
<el-table-column type="selection" :reserve-selection="true" :selectable="checkSelectable" width="55" />
<el-table-column label="角色编号" align="center" prop="roleId" />
<el-table-column label="角色名称" align="center" prop="roleName" />
<el-table-column label="权限字符" align="center" prop="roleKey" />
@ -52,14 +52,14 @@ export default {
name: "AuthRole",
data() {
return {
//
//
loading: true,
//
total: 0,
pageNum: 1,
pageSize: 10,
//
roleIds:[],
roleIds: [],
//
roles: [],
//
@ -88,7 +88,9 @@ export default {
methods: {
/** 单击选中行数据 */
clickRow(row) {
this.$refs.table.toggleRowSelection(row);
if (this.checkSelectable(row)) {
this.$refs.table.toggleRowSelection(row);
}
},
//
handleSelectionChange(selection) {
@ -98,6 +100,10 @@ export default {
getRowKey(row) {
return row.roleId;
},
//
checkSelectable(row) {
return row.status === "0" ? true : false;
},
/** 提交按钮 */
submitForm() {
const userId = this.form.userId;

View File

@ -52,7 +52,7 @@ create table sys_user (
sex char(1) default '0' comment '用户性别0男 1女 2未知',
avatar varchar(100) default '' comment '头像地址',
password varchar(100) default '' comment '密码',
status char(1) default '0' comment '号状态0正常 1停用',
status char(1) default '0' comment '号状态0正常 1停用',
del_flag char(1) default '0' comment '删除标志0代表存在 2代表删除',
login_ip varchar(128) default '' comment '最后登录IP',
login_date datetime comment '最后登录时间',