优化页面功能

This commit is contained in:
izory 2021-10-11 15:23:28 +08:00
parent ae1f491807
commit d5db4ebd00
3 changed files with 11 additions and 11 deletions

View File

@ -124,7 +124,7 @@ namespace ZR.Admin.WebApi.Controllers.System
/// <param name="sysRoleDto"></param> /// <param name="sysRoleDto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPut("dataScope")] [HttpPut("dataScope")]
[ActionPermissionFilter(Permission = "system:role:update")] [ActionPermissionFilter(Permission = "system:role:authorize")]
[Log(Title = "角色管理", BusinessType = BusinessType.UPDATE)] [Log(Title = "角色管理", BusinessType = BusinessType.UPDATE)]
public IActionResult DataScope([FromBody] SysRole sysRoleDto) public IActionResult DataScope([FromBody] SysRole sysRoleDto)
{ {

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">{{title}}管理系统</h3> <h3 class="title">{{title}}后台管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />

View File

@ -9,8 +9,8 @@
<el-col :span="20"> <el-col :span="20">
<el-form style="display:flex" :inline="true" @submit.native.prevent> <el-form style="display:flex" :inline="true" @submit.native.prevent>
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleGetUserTable" v-hasPermi="['system:roleusers:add']">添加用户</el-button> <el-button type="primary" plain size="mini" icon="el-icon-plus" @click="handleGetUserTable" v-hasPermi="['system:roleusers:add']">添加用户</el-button>
<el-button type="danger" size="mini" @click="handleDelete" v-hasPermi="['system:roleusers:del']">删除用户</el-button> <el-button type="danger" plain size="mini" icon="el-icon-circle-close" @click="cancelAuthUserAll" v-hasPermi="['system:roleusers:del']">批量取消授权</el-button>
</el-form-item> </el-form-item>
<el-form-item style="margin-left:auto"> <el-form-item style="margin-left:auto">
<el-input v-model="search" placeholder="请输入用户名称" clearable prefix-icon="el-icon-search" /> <el-input v-model="search" placeholder="请输入用户名称" clearable prefix-icon="el-icon-search" />
@ -39,14 +39,14 @@
<!-- 添加或修改菜单对话框 --> <!-- 添加或修改菜单对话框 -->
<el-dialog title="添加用户" :visible.sync="open" append-to-body :close-on-click-modal="false" @close="cancel"> <el-dialog title="添加用户" :visible.sync="open" append-to-body :close-on-click-modal="false" @close="cancel">
<el-form style="display:flex" :inline="true" @submit.native.prevent> <!-- <el-form style="display:flex" :inline="true" @submit.native.prevent>
<el-form-item style="margin-left:auto"> <el-form-item style="margin-left:auto">
<el-input v-model="search" placeholder="请输入用户名称" clearable prefix-icon="el-icon-search" /> <el-input v-model="search" placeholder="请输入用户名称" clearable prefix-icon="el-icon-search" />
</el-form-item> </el-form-item>
</el-form> </el-form> -->
<el-row> <el-row>
<el-col> <el-col>
<el-table ref="userTable" v-loading="loadingUser" :data="dataUserTable.filter(data => !search || data.userId.toLowerCase().includes(search.toLowerCase()) || data.userName.toLowerCase().includes(search.toLowerCase()))" row-key="userId" stripe border :height="tableHeight*0.5"> <el-table ref="userTable" v-loading="loadingUser" :data="dataUserTable" row-key="userId" stripe border :height="tableHeight*0.5">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column prop="userId" align="center" label="用户编号" width="150" /> <el-table-column prop="userId" align="center" label="用户编号" width="150" />
<el-table-column prop="userName" align="center" label="用户名称" width="150" /> <el-table-column prop="userName" align="center" label="用户名称" width="150" />
@ -106,7 +106,6 @@ export default {
// //
this.loadingRole = true; this.loadingRole = true;
listRole({ pageSize: 50 }).then((response) => { listRole({ pageSize: 50 }).then((response) => {
console.log(response);
this.dataRoleTable = response.data.result; this.dataRoleTable = response.data.result;
this.handleRoleTableSelection(this.dataRoleTable[0]); this.handleRoleTableSelection(this.dataRoleTable[0]);
this.$refs.roleTable.setCurrentRow(this.dataRoleTable[0]); this.$refs.roleTable.setCurrentRow(this.dataRoleTable[0]);
@ -122,13 +121,14 @@ export default {
this.loadingRoleUser = false; this.loadingRoleUser = false;
}); });
}, },
// //
handleDelete() { cancelAuthUserAll() {
this.delSelections = []; this.delSelections = [];
this.$refs.roleUserTable.selection.forEach((element) => { this.$refs.roleUserTable.selection.forEach((element) => {
this.delSelections.push(element.userId); this.delSelections.push(element.userId);
}); });
if (this.delSelections.length === 0) { if (this.delSelections.length === 0) {
console.log('未选中')
return; return;
} }
this.$confirm( this.$confirm(
@ -156,6 +156,7 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
//
handleCancelPerm(row) { handleCancelPerm(row) {
this.delSelections = []; this.delSelections = [];
this.delSelections.push(row.userId); this.delSelections.push(row.userId);
@ -183,7 +184,6 @@ export default {
this.open = true; this.open = true;
this.loadingUser = true; this.loadingUser = true;
getExcludeUsers(this.roleId).then((response) => { getExcludeUsers(this.roleId).then((response) => {
console.log(response);
this.dataUserTable = response.data; this.dataUserTable = response.data;
this.loadingUser = false; this.loadingUser = false;
}); });