Commit 32bfb3c3 by xue_wengang

权限管理

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