|
@@ -0,0 +1,76 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+
|
|
|
|
|
+ <el-button type="primary" @click="addGroup()" style="margin-top: 15px;margin-right: 30px;float: left">添加角色</el-button>
|
|
|
|
|
+ <div style="clear: both;"></div>
|
|
|
|
|
+ <div style="margin-bottom: 15px"></div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-table :data="list" border style="width: 100%" v-loading="loading">
|
|
|
|
|
+ <el-table-column prop="name" label="角色名称" width="220px"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="uid" label="操作" width="320px">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button type="text" @click="delData(scope.row)">删除角色</el-button>
|
|
|
|
|
+ <el-button type="text" @click="editGroup(scope.row)">编辑角色</el-button>
|
|
|
|
|
+ <el-button type="text" @click="menuDialogShow(scope.row)">权限管理</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog title="角色管理" :visible.sync="addDialog" width="400px">
|
|
|
|
|
+ <el-form :model="add_form" label-width="70px">
|
|
|
|
|
+ <el-form-item label="角色名称">
|
|
|
|
|
+ <el-input v-model="add_form.name" autocomplete="off"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button size="medium" @click="addDialog = false">取消</el-button>
|
|
|
|
|
+ <el-button size="medium" type="primary" @click="formAdd">确定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog title="权限菜单" :visible.sync="menuDialog" custom-class="mall_list" lock-scroll width="70%">
|
|
|
|
|
+ <el-table :data="menuData" style="width: 100%;margin-bottom: 20px;" row-key="id" border :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
|
|
|
|
+ <el-table-column prop="title" label="权限名称" ></el-table-column>
|
|
|
|
|
+ <el-table-column prop="show" label="访问权限">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span style="color:red;cursor:pointer" @click="closeMenu(scope.row,1)" v-if="scope.row.show == '1'">已禁用</span>
|
|
|
|
|
+ <span style="color:green;cursor:pointer" @click="closeMenu(scope.row,2)" v-else >已开启</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script src="./js/group.js"></script>
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+.count-list {
|
|
|
|
|
+ padding-bottom: 10px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+}
|
|
|
|
|
+/deep/ .mall_list .el-dialog {
|
|
|
|
|
+ margin: 5vh auto !important;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/ .mall_list .el-dialog__body {
|
|
|
|
|
+ height: 70vh;
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/ .el-dialog{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ margin:0 !important;
|
|
|
|
|
+ position:absolute;
|
|
|
|
|
+ top:50%;
|
|
|
|
|
+ left:50%;
|
|
|
|
|
+ transform:translate(-50%,-50%);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+h3 {
|
|
|
|
|
+ margin: 20px 0 20px;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|