|
|
@@ -4,8 +4,8 @@
|
|
|
import { formatMenus, toTreeData, formatTreeData } from 'ele-admin';
|
|
|
import { USER_MENUS } from '@/config/setting';
|
|
|
import { getResourcesTree } from '@/api/layout';
|
|
|
-import {getCurrentUserAuthorityDeptAPI} from "@/api/login";
|
|
|
-import { getCurrentUser,setCurrentUser } from '@/utils/token-util';
|
|
|
+import { getCurrentUserAuthorityDeptAPI } from '@/api/login';
|
|
|
+import { getCurrentUser, setCurrentUser } from '@/utils/token-util';
|
|
|
|
|
|
const formatRouter = (list) => {
|
|
|
let menuList = []; // menuType
|
|
|
@@ -52,7 +52,7 @@ export default {
|
|
|
authoritiesRouter: [],
|
|
|
// 当前登录用户的角色
|
|
|
roles: [],
|
|
|
- currentObj:{},
|
|
|
+ currentObj: {},
|
|
|
taskObj: {}, //工序对象
|
|
|
// 当前登录用户的数据权限部门数据
|
|
|
authorityDept: {}
|
|
|
@@ -128,8 +128,11 @@ export default {
|
|
|
// },
|
|
|
//动态路由
|
|
|
async fetchUserInfo({ commit }) {
|
|
|
- let currentUser = getCurrentUser()
|
|
|
- const result = await getResourcesTree({groupId:currentUser.currentGroupId,roleId:currentUser.currentRoleId}).catch(() => {});
|
|
|
+ let currentUser = getCurrentUser();
|
|
|
+ const result = await getResourcesTree({
|
|
|
+ groupId: currentUser.currentGroupId,
|
|
|
+ roleId: currentUser.currentRoleId
|
|
|
+ }).catch(() => {});
|
|
|
const list = result.filter((i) => i.path === '/page-mes');
|
|
|
if (!list.length) {
|
|
|
return {};
|
|
|
@@ -150,20 +153,20 @@ export default {
|
|
|
// 用户菜单, 过滤掉按钮类型并转为 children 形式
|
|
|
const { menus, homePath } = formatMenus(
|
|
|
USER_MENUS ??
|
|
|
- toTreeData({
|
|
|
- data: menuList,
|
|
|
- idField: 'id',
|
|
|
- parentIdField: 'parentId'
|
|
|
- })
|
|
|
+ toTreeData({
|
|
|
+ data: menuList,
|
|
|
+ idField: 'id',
|
|
|
+ parentIdField: 'parentId'
|
|
|
+ })
|
|
|
);
|
|
|
// 用户路由按钮
|
|
|
const { menus: authoritiesRouter } = formatMenus(
|
|
|
USER_MENUS ??
|
|
|
- toTreeData({
|
|
|
- data: authorities.filter((i) => i.path),
|
|
|
- idField: 'id',
|
|
|
- parentIdField: 'parentId'
|
|
|
- })
|
|
|
+ toTreeData({
|
|
|
+ data: authorities.filter((i) => i.path),
|
|
|
+ idField: 'id',
|
|
|
+ parentIdField: 'parentId'
|
|
|
+ })
|
|
|
);
|
|
|
console.log('menus--', menus);
|
|
|
commit('setMenus', menus);
|
|
|
@@ -210,6 +213,6 @@ export default {
|
|
|
},
|
|
|
setTaskObj({ commit }, value) {
|
|
|
commit('setTaskObj', value);
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
};
|