王旭
2022-10-13 6ba67905ae3e502103a940f5f6f907e8f491ae62
用户角色授权页面接口对接
已修改6个文件
84 ■■■■■ 文件已修改
src/api/api.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/lang/en.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/lang/zh.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/customElMenu.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/navMenu.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/api.js
@@ -230,3 +230,23 @@
      pageSize
  );
}
//根据角色查询用户
export function roleUserselectByPageForRole(params) {
  //请求地址
  return request.get('/roleUser/selectByPageAndCount', { params: params });
}
//用户角色删除
export function roleUserdeletes(params) {
  //请求地址
  return request.get('/roleUser/deletes', { params: params });
}
//根据角色部门查询用户
export function userselectByPageForRole(params) {
  //请求地址
  return request.get('/user/selectByPageForRole', { params: params });
}
// 用户角色新增多选
export function roleUserinserts(params) {
  //请求地址
  return request.post('/roleUser/inserts',  params );
}
src/assets/lang/en.js
@@ -104,6 +104,15 @@
  operatManage: {
    operatManage: 'Operat Manage',
    ResourceLog: 'Resource Log',
    UserRoleAuthorization:"User Role Authorization",
    UserRoleAuthorizationObj:{
      RoleTable: 'Role Table',
      userTable: 'user Table',
      Added: 'Added',
      delete: 'delete',
      serialNumber: 'serial Number',
      name: 'name',
    },
    ELM: {
      username: 'username',
      ownedSystem: 'ownedSystem',
src/assets/lang/zh.js
@@ -106,6 +106,15 @@
  operatManage: {
    operatManage: '运维管理',
    ResourceLog: '资源日志',
    UserRoleAuthorization:"用户角色授权",
    UserRoleAuthorizationObj:{
      RoleTable: '角色表',
      userTable: '用户表',
      Added: '新增',
      delete: '删除',
      serialNumber: '编号',
      name: '名称',
    },
    ELM: {
      username: '用户名称',
      ownedSystem: '所属系统',
src/components/customElMenu.vue
@@ -14,7 +14,7 @@
      <el-menu-item
        v-else
        :key="item.id"
        :index="item.url == null ? null : item.url + ''"
        :index="item.url == null ? item.id.toString() : item.url + ''"
      >
        <span slot="title">{{
          $store.state.lang == "zh" ? item.cnName : item.enName
src/components/navMenu.vue
@@ -67,7 +67,20 @@
  mounted() {
    this.getMenuTree();
  },
  computed: {},
  computed: {
    // 我们使用计算属性来获取到当前点击的菜单的路由路径,然后设置default-active中的值
    // 使得菜单在载入时就能对应高亮
    // activeIndex() {
    //   const route = this.$route;
    //   const { meta, path } = route;
    //   // if set path, the sidebar will highlight the path you set
    //   // 可以在路由配置文件中设置自定义的路由路径到meta.activeMenu属性中,来控制菜单自定义高亮显示
    //   if (meta.activeMenu) {
    //     return meta.activeMenu;
    //   }
    //   return path;
    // },
  },
  methods: {
    getMenuTree() {
      //获取目录树最大ID,新建节点使用
@@ -160,9 +173,18 @@
  },
  watch: {
    $route() {
      this.activeIndex = this.$route.path;
      let str = this.$route.path;
      if (str[0] == "/") {
        this.activeIndex = str.slice(1);
      }
    },
  },
  created() {
    let str = this.$route.path;
    if (str[0] == "/") {
      this.activeIndex = str.slice(1);
    }
  },
};
</script>
<style lang="less" scoped>
src/router/index.js
@@ -37,6 +37,15 @@
import groupManage from '../views/userManage/groupManage.vue'; // 用户管理模块
import authorityManage from '@/views/userManage/authorityManage.vue'; //用户管理-权限管理
import resourceManage from '@/views/userManage/resourceManage.vue'; //用户管理-资源管理
import userRoleAuthorization from '@/views/AuthorizationManagement/userRoleAuthorization.vue'; //系统管理-
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
// 群组管理
Vue.use(VueRouter);
@@ -337,6 +346,15 @@
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
      {
        path: '/userRoleAuthorization',
        component: userRoleAuthorization,
        name: 'userRoleAuthorization',
        meta: {
          title: '用户角色授权',
          requireAuth: true, // 标识该路由是否需要登录
        },
      },
    ],
  },