Commit 32bfb3c3 by xue_wengang

权限管理

parent 11cbbb36
......@@ -12,13 +12,13 @@
@editMenu="editMenu"
@selectionChange="selectionChange"
>
<template #btnGroup="scope" v-if="isPremission >= 0">
<template #btnGroup="scope" v-if="isPremission >= 0 || isAdmin">
<span style="margin-right: 16px" @click="edit(scope.scope)" class="edit"
>编辑</span
>
<span @click="dele(scope.scope)" class="dele">删除</span>
</template>
<template #listOperation="scope" v-if="isPremission >= 0">
<template #listOperation="scope" v-if="isPremission >= 0 || isAdmin ">
<span class="flTtitle Add" @click="add(scope.scope)">
<i class="el-icon-plus"></i>新增</span
>
......@@ -123,13 +123,17 @@ export default {
selectedId: [],
selectedTree: [],
isPremission: false,
isAdmin: false,
};
},
created() {
this.$store.commit("user/SET_Menu", this.Menu);
debugger;
this.isPremission = JSON.parse(sessionStorage.getItem("userInfo"))
.permission.split(",")
.findIndex((item) => item == "A0000");
this.isAdmin =
JSON.parse(sessionStorage.getItem("userInfo")).permission == "admin";
this.getTree();
},
methods: {
......@@ -279,18 +283,18 @@ export default {
</style>
<style scoped lang="scss">
@import "@/assets/styles/rightContent.scss";
.Add {
.Add {
width: 64px;
height: 24px;
background: #FFFFFF;
border: 1px solid #007AFF;
background: #ffffff;
border: 1px solid #007aff;
opacity: 1;
border-radius: 4px;
text-align: center;
align-items: center;
font-size: 12px !important;
font-weight: 400 !important;
color: #007AFF !important;
color: #007aff !important;
cursor: pointer;
}
}
</style>
......@@ -12,13 +12,13 @@
@toInfor="toInfor"
@selectionChange="selectionChange"
>
<template #listOperation="scope" v-if="isPremission >= 0">
<template #listOperation="scope" v-if="isPremission >= 0 || isAdmin">
<span class="hbyps" @click="editMenu(scope.scope)"> 菜单配置</span>
<span class="flTtitle Add" @click="add(scope.scope)">
<i class="el-icon-plus"></i>新增</span
>
</template>
<template #btnGroup="scope" v-if="isPremission >= 0">
<template #btnGroup="scope" v-if="isPremission >= 0 || isAdmin">
<span style="margin-right: 16px" @click="edit(scope.scope)" class="edit"
>编辑</span
>
......@@ -128,6 +128,7 @@ export default {
checkAll: false,
selec: [],
isPremission: false,
isAdmin: false,
};
},
created() {
......@@ -135,6 +136,8 @@ export default {
this.isPremission = JSON.parse(sessionStorage.getItem("userInfo"))
.permission.split(",")
.findIndex((item) => item == "A0000");
this.isAdmin =
JSON.parse(sessionStorage.getItem("userInfo")).permission == "admin";
this.getTree();
},
methods: {
......
......@@ -13,7 +13,7 @@
@selectionChange="selectionChange"
@handleSwitch="handleSwitch"
>
<template #listOperation="scope" v-if="isPremission >= 0">
<template #listOperation="scope" v-if="isPremission >= 0 || isAdmin">
<span class="hbyps" @click="editRole(scope.scope)"> 角色配置</span>
<span class="flTtitle Add" @click="add(scope.scope)">
<i class="el-icon-plus"></i>新增</span
......@@ -30,10 +30,10 @@
@click="editMa(scope.scope)"
class="edit"
style="margin-right: 16px"
v-if="isPremission >= 0"
v-if="isPremission >= 0 || isAdmin"
>修改密码</span
>
<span @click="dele(scope.scope)" class="dele" v-if="isPremission >= 0"
<span @click="dele(scope.scope)" class="dele" v-if="isPremission >= 0 || isAdmin"
>删除</span
>
<span @click="edit(scope.scope)" class="edit">编辑</span>
......@@ -219,6 +219,7 @@ export default {
isPremission: false,
identitycard: "",
selec: [],
isAdmin: false,
};
},
created() {
......@@ -231,6 +232,8 @@ export default {
this.identitycard = JSON.parse(
sessionStorage.getItem("userInfo")
).identitycard;
this.isAdmin =
JSON.parse(sessionStorage.getItem("userInfo")).permission == "admin";
this.getTree();
this.getThead();
},
......@@ -242,7 +245,7 @@ export default {
this.checkAll = false;
},
getThead() {
if (this.isPremission >= 0) {
if (this.isPremission >= 0 || this.isAdmin) {
let obj = {
label: "用户状态",
prop: "openFlag",
......@@ -316,7 +319,7 @@ export default {
this.$refs.tree.setCheckedKeys([]);
this.checkAll = false;
this.selec = [];
this.selectedTree = []
this.selectedTree = [];
});
} else {
this.$message.error("请选择用户权限");
......@@ -376,7 +379,7 @@ export default {
});
},
edit(obj) {
if (this.identitycard == obj.row.identitycard || this.isPremission >= 0) {
if (this.identitycard == obj.row.identitycard || this.isPremission >= 0 || this.isAdmin) {
this.$router.pushToTab({
path: "/addXg",
query: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment