|
@@ -9,7 +9,11 @@ import { Search } from "@element-plus/icons-vue";
|
|
|
import addRole from "./components/addRole.vue";
|
|
|
import addPerson from "./components/addPerson.vue";
|
|
|
import { getDeleteUserApi } from "@/api/userSetting";
|
|
|
-import { getMenuList, getMenuListCodeForRole } from "@/api/menu";
|
|
|
+import {
|
|
|
+ getMenuList,
|
|
|
+ getMenuListCodeForRole,
|
|
|
+ postAddMenuList
|
|
|
+} from "@/api/menu";
|
|
|
import { postPageRole, postDelRole, postPageUserByRole } from "@/api/roles";
|
|
|
import pngcaret from "@/assets/icon-png/caret-right-small.svg";
|
|
|
import UserPageTable from "@/components/UserPageTable/index.vue";
|
|
@@ -88,7 +92,6 @@ const lookRoles = item => {
|
|
|
rolesList.rolesName = item.roleName;
|
|
|
Object.assign(rolesList.addPerson, item);
|
|
|
postPageUserByRoleApi();
|
|
|
- // getMenuListApi();
|
|
|
getMenuListCodeForRoleApi(item);
|
|
|
};
|
|
|
// 添加角色
|
|
@@ -136,8 +139,12 @@ const activeName = ref("first");
|
|
|
|
|
|
// 添加角色组成员
|
|
|
const AddRolesPerson = () => {
|
|
|
- addPersonRef.value.open(rolesList.addPerson);
|
|
|
- addPersonShow.value = true;
|
|
|
+ if (rolesList.rolesName) {
|
|
|
+ addPersonRef.value.open(rolesList.addPerson);
|
|
|
+ addPersonShow.value = true;
|
|
|
+ } else {
|
|
|
+ ElMessage.warning("请先选择角色");
|
|
|
+ }
|
|
|
};
|
|
|
// 删除角色组成员
|
|
|
const deltetePerson = item => {
|
|
@@ -164,6 +171,7 @@ const paramsPageUser = reactive({
|
|
|
pageSize: 10,
|
|
|
roleName: "",
|
|
|
roleCode: "",
|
|
|
+ realName: "",
|
|
|
userCodes: []
|
|
|
});
|
|
|
const total = ref(0);
|
|
@@ -183,8 +191,23 @@ const handleClick = (tab, event) => {
|
|
|
};
|
|
|
const getMenuListApi = async () => {
|
|
|
const { code, data } = await getMenuList();
|
|
|
- // console.log("菜单", data);
|
|
|
+ console.log("菜单", data);
|
|
|
};
|
|
|
+getMenuListApi();
|
|
|
+// const postAddMenuListApi = async () => {
|
|
|
+// const { code } = await postAddMenuList({
|
|
|
+// menuName: "用户组",
|
|
|
+// menuType: "menu",
|
|
|
+// parentCode: "menu340273914200596480",
|
|
|
+// orderNum: 2,
|
|
|
+// url: "",
|
|
|
+// moduleUrl: "/background/framework/users/index",
|
|
|
+// icon: "",
|
|
|
+// remark: "",
|
|
|
+// menuCode: ""
|
|
|
+// });
|
|
|
+// };
|
|
|
+// postAddMenuListApi();
|
|
|
const getMenuListCodeForRoleApi = async item => {
|
|
|
console.log("item", item);
|
|
|
const { code, data } = await getMenuListCodeForRole({
|
|
@@ -320,16 +343,19 @@ const handleCurrentChange = val => {
|
|
|
>新增角色</el-button
|
|
|
>
|
|
|
</div>
|
|
|
- <div v-if="rolesList.rolesName" class="box-right">
|
|
|
+ <!-- <div v-if="rolesList.rolesName" class="box-right"> -->
|
|
|
+ <div class="box-right">
|
|
|
<h3>{{ rolesList.rolesName }}</h3>
|
|
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
|
<el-tab-pane label="成员管理" name="first">
|
|
|
<div class="flex justify-between mb-3">
|
|
|
<el-input
|
|
|
+ v-model="paramsPageUser.realName"
|
|
|
placeholder="搜索姓名"
|
|
|
class="mb-2"
|
|
|
style="max-width: 300px"
|
|
|
:prefix-icon="Search"
|
|
|
+ @change="postPageUserByRoleApi"
|
|
|
/>
|
|
|
<el-button type="primary" @click="AddRolesPerson"
|
|
|
>添加成员</el-button
|