优化角色模板
This commit is contained in:
@@ -3,7 +3,8 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="title">选择模板,快速创建好角色</div>
|
<div class="title">选择模板,快速创建好角色</div>
|
||||||
<div class="role_template">
|
<div class="role_template">
|
||||||
<div class="item" v-for="item in list" :key="item.id" @click="selectRoleHandle(item)">
|
<div class="item" :class="{ active: item.cehcked }" v-for="item in list" :key="item.id"
|
||||||
|
@click="selectRoleHandle(item)">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
@@ -84,6 +85,11 @@ async function submitHandle() {
|
|||||||
await saveByTemplate({
|
await saveByTemplate({
|
||||||
id: item.id
|
id: item.id
|
||||||
})
|
})
|
||||||
|
ElNotification({
|
||||||
|
title: '注意',
|
||||||
|
message: '角色创建成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
emits('success')
|
emits('success')
|
||||||
visible.value = false
|
visible.value = false
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -125,6 +131,10 @@ onMounted(() => {
|
|||||||
padding: 14px 18px;
|
padding: 14px 18px;
|
||||||
transition: all .3s ease-in-out;
|
transition: all .3s ease-in-out;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
border-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-color: var(--el-color-primary);
|
border-color: var(--el-color-primary);
|
||||||
@@ -144,6 +154,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
.role_list {
|
.role_list {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
gap: 2px;
|
||||||
|
|
||||||
div {
|
div {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -154,6 +165,10 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.rl_r {
|
.rl_r {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<!-- <el-table-column label="操作人" prop=""></el-table-column> -->
|
<!-- <el-table-column label="操作人" prop=""></el-table-column> -->
|
||||||
<el-table-column label="操作" width="250">
|
<el-table-column label="操作" width="250">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button link type="primary" @click="handleOpenAssignPermDialog(scope.row)"
|
<el-button link type="success" @click="handleOpenAssignPermDialog(scope.row)"
|
||||||
v-if="scope.row.pid !== null">分配权限</el-button>
|
v-if="scope.row.pid !== null">分配权限</el-button>
|
||||||
<el-button link type="primary" @click="addTempateDialogRef.show(2, scope.row)" v-else>添加角色</el-button>
|
<el-button link type="primary" @click="addTempateDialogRef.show(2, scope.row)" v-else>添加角色</el-button>
|
||||||
<el-button link type="primary" @click="addTempateDialogRef.show(2, scope.row, 2)"
|
<el-button link type="primary" @click="addTempateDialogRef.show(2, scope.row, 2)"
|
||||||
@@ -156,7 +156,7 @@ function handlePlatformTypeChange(e) {
|
|||||||
|
|
||||||
// 打开分配菜单菜单弹窗
|
// 打开分配菜单菜单弹窗
|
||||||
async function handleOpenAssignPermDialog(row) {
|
async function handleOpenAssignPermDialog(row) {
|
||||||
const roleId = row.id;
|
const roleId = row.roleId;
|
||||||
dialog.row = row;
|
dialog.row = row;
|
||||||
if (roleId) {
|
if (roleId) {
|
||||||
assignPermDialogVisible.value = true;
|
assignPermDialogVisible.value = true;
|
||||||
@@ -288,8 +288,11 @@ const permTreeRef = ref(null)
|
|||||||
// 分配菜单菜单提交
|
// 分配菜单菜单提交
|
||||||
async function handleAssignPermSubmit() {
|
async function handleAssignPermSubmit() {
|
||||||
try {
|
try {
|
||||||
const roleId = checkedRole.value.roleId;
|
const roleId = checkedRole.value.id;
|
||||||
const name = checkedRole.value.name;
|
const name = checkedRole.value.name;
|
||||||
|
|
||||||
|
console.log(roleId, name);
|
||||||
|
|
||||||
if (roleId) {
|
if (roleId) {
|
||||||
const checkedMenuIds = permTreeRef
|
const checkedMenuIds = permTreeRef
|
||||||
.value.getCheckedNodes(false, true)
|
.value.getCheckedNodes(false, true)
|
||||||
|
|||||||
@@ -21,7 +21,8 @@
|
|||||||
end-placeholder="结束时间" @change="timeChange" />
|
end-placeholder="结束时间" @change="timeChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="searchHandle">搜索</el-button>
|
<el-button type="primary" :loading="tableData.loading" icon="Search" @click="searchHandle">搜索</el-button>
|
||||||
|
<el-button :loading="tableData.loading" icon="Refresh" @click="resetHandle">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -206,6 +207,19 @@ function searchHandle() {
|
|||||||
goodsRecordTotalAjax()
|
goodsRecordTotalAjax()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetHandle() {
|
||||||
|
time.value = []
|
||||||
|
queryForm.startTime = ''
|
||||||
|
queryForm.endTime = ''
|
||||||
|
queryForm.pointsGoodsName = ''
|
||||||
|
queryForm.goodsCategory = ''
|
||||||
|
queryForm.receiveType = ''
|
||||||
|
queryForm.status = ''
|
||||||
|
|
||||||
|
goodsRecordPageAjax();
|
||||||
|
goodsRecordTotalAjax()
|
||||||
|
}
|
||||||
|
|
||||||
// 分页大小发生变化
|
// 分页大小发生变化
|
||||||
function handleSizeChange(e) {
|
function handleSizeChange(e) {
|
||||||
tableData.size = e;
|
tableData.size = e;
|
||||||
|
|||||||
Reference in New Issue
Block a user