From b8c062434216ec7959f566c7c821223145795182 Mon Sep 17 00:00:00 2001
From: pengjun <158915633@qq.com>
Date: Mon, 26 Feb 2024 17:07:16 +0800
Subject: [PATCH] menuinfo
---
.../customerOrg/customerOrgTree.vue | 22 +-
src/components/menuPage/MenuPageEdit.vue | 17 +-
src/components/menuPage/MenuPageSet.vue | 240 ++++++++++++++++++
src/router/index.js | 1 -
src/store/index.js | 14 +-
src/utlis/tree.js | 5 +
src/views/Home.vue | 2 +-
src/views/menuPage/menuPage.vue | 2 +-
src/views/user-list/Role.vue | 57 +++--
src/views/user-list/UserList.vue | 36 ++-
10 files changed, 370 insertions(+), 26 deletions(-)
create mode 100644 src/components/menuPage/MenuPageSet.vue
diff --git a/src/components/customerOrg/customerOrgTree.vue b/src/components/customerOrg/customerOrgTree.vue
index 5f63cf1..2b798fc 100644
--- a/src/components/customerOrg/customerOrgTree.vue
+++ b/src/components/customerOrg/customerOrgTree.vue
@@ -7,7 +7,23 @@
+ @node-click="treeclick" highlight-current ref="customerOrgTree">
+
+
+
+
+
+
+
{{ node.label }}
+
+
+
+
@@ -164,4 +180,8 @@ export default {
diff --git a/src/components/menuPage/MenuPageEdit.vue b/src/components/menuPage/MenuPageEdit.vue
index 605d417..7551e4a 100644
--- a/src/components/menuPage/MenuPageEdit.vue
+++ b/src/components/menuPage/MenuPageEdit.vue
@@ -35,7 +35,7 @@
-
+
+
+
+
+
+
@@ -76,7 +85,7 @@
-
+
+
+
+
+
@@ -156,11 +170,16 @@ import {
permissionconntro,
} from "@/request/ruquset";
import { getapi } from "@/api/api";
+
+import { mapState } from "vuex";
+import MenuPageSet from "../../components/menuPage/MenuPageSet.vue";
+
export default {
+ components: {
+ MenuPageSet,
+ },
data() {
return {
- tableHeight: window.innerHeight - 220, //表格动态高度
- screenHeight: window.innerHeight, //内容区域高度
allChecked: false, //所有权限
allIndeterminate: false,
allCheckedLength: 0,
@@ -192,26 +211,25 @@ export default {
currenItem: [],
title: "",
activeTab: "0",
+ choosedRoleId:'', //当前选中(操作的角色id)
};
},
+
+ computed: {
+ ...mapState(["window", "dialogWin", "dataTransOpts", "customerOrg" ]),
+ tableHeight(){
+ return this.window.pageHeight - 200
+ }
+ },
+
created() {
this.getbolkeall();
},
mounted() {
- window.onresize(() => {
- return (() => {
- // window.innerHeight:浏览器的可用高度
- window.screenHeight = window.innerHeight;
- this.screenHeight = window.screenHeight;
- })();
- });
+
},
watch: {
- // 监听screenHeight从而改变table的高度
- screenHeight(val) {
- this.screenHeight = val;
- this.tableHeight = this.screenHeight - 220;
- },
+
},
methods: {
//新增角色弹框
@@ -450,6 +468,15 @@ export default {
console.log(res);
});
},
+
+ // 设置菜单权限
+ btnMenuPageSet(row){
+ this.dataTransOpts.tableS.adp_roles.id = row.id
+ this.dialogWin.MenuPageSet = true
+ setTimeout(() => {
+ this.dataTransOpts.refresh.role_menu_info.M++
+ }, 20);
+ },
},
};
diff --git a/src/views/user-list/UserList.vue b/src/views/user-list/UserList.vue
index 596ae69..f2b8aba 100644
--- a/src/views/user-list/UserList.vue
+++ b/src/views/user-list/UserList.vue
@@ -69,6 +69,9 @@
修改密码
+ 菜单权限
@@ -483,6 +486,16 @@
>
+
+
+
+
+
@@ -507,6 +520,8 @@ import { mapState } from "vuex";
import { isValid } from "@/utlis/validate";
import { getapi, postapi } from "@/api/api";
import { tcdate, deepCopy ,objCopy } from "../../utlis/proFunc";
+import MenuPageSet from "../../components/menuPage/MenuPageSet.vue";
+
// let validatePassword = (rule, value, callback) => {
// var reg1 =
@@ -520,8 +535,11 @@ import { tcdate, deepCopy ,objCopy } from "../../utlis/proFunc";
// callback();
// }
// };
-let validatePassword = /^[a-zA-Z0-9@\$\^\.\*\\?]\{6,15}$/;
+// let validatePassword = /^[a-zA-Z0-9@\$\^\.\*\\?]\{6,15}$/;
export default {
+ components: {
+ MenuPageSet,
+ },
data() {
return {
treedata: [],
@@ -553,6 +571,10 @@ export default {
option: [],
crdetcascader: [], //绑定组织显示
+ dialogParams:{
+ MenuPageSet:{opra:'role'} //默认角色
+ },
+
//表单校验
rules: {
password: [
@@ -645,7 +667,7 @@ export default {
};
},
computed: {
- ...mapState(["window","changepassword"]),
+ ...mapState(["window","dialogWin", "dataTransOpts", "changepassword"]),
},
created() {
this.password = this.changepassword;
@@ -705,6 +727,16 @@ export default {
this.passwordid = row.id;
this.usersName = row.userName;
},
+ // 查看用户菜单权限
+ btnMenu(row){
+ this.dialogParams.MenuPageSet.opra = 'user'
+ this.dataTransOpts.tableS.adp_users.id = row.id
+ this.dialogWin.MenuPageSet = true
+ setTimeout(() => {
+ this.dataTransOpts.refresh.role_menu_info.M++
+ }, 20);
+ },
+
//新增选择的
ischesc() {
console.log("333", this.$refs.tree.getCheckedKeys(true));