Commit 6973fcf5 by caoyanzhi

接口联调

parent a9410e9a
import getFetch from './getFetch'; import getFetch from './getFetch';
const api = { const api = {
addRole: '/add-role', // 新增角色 addRole: {
url: '/add-role',
method: 'post',
useFormData: true
}, // 新增角色
delRole: '/role-del', // 删除角色 delRole: '/role-del', // 删除角色
editRole: '/role-edit', // 编辑角色 editRole: {
url: '/role-edit',
method: 'post',
useFormData: true
}, // 编辑角色
roleDetail: '/role-detail', // 角色详情 roleDetail: '/role-detail', // 角色详情
roleList: '/role-list', // 角色列表 roleList: '/role-list', // 角色列表
menuList: '/menu-list', // 菜单列表 menuList: '/menu-list', // 菜单列表
......
<template> <template>
<div class="menu-tree"> <div class="menu-tree">
<ul class="first-menu"> <ul class="first-menu">
<li class="no-data" v-if="menuList.length == 0">暂无数据</li>
<li :class="['first-menu-item', { active: el.menuId == activeMenuId }]" v-for="el in menuList" :key="el.menuId" @click="onMenuChange(el)"> <li :class="['first-menu-item', { active: el.menuId == activeMenuId }]" v-for="el in menuList" :key="el.menuId" @click="onMenuChange(el)">
{{ el.menuName }} {{ el.menuName }}
</li> </li>
</ul> </ul>
<div class="all-menu"> <div class="all-menu">
<el-checkbox v-model="isSelectAll" @change="onSelectAll">全选</el-checkbox> <el-checkbox v-if="treeData.length > 0" v-model="isSelectAll" @change="onSelectAll">全选</el-checkbox>
<el-tree <el-tree
:data="treeData" :data="treeData"
show-checkbox show-checkbox
...@@ -52,8 +53,8 @@ export default { ...@@ -52,8 +53,8 @@ export default {
methods: { methods: {
// 左侧一级节点改变时,切换右侧的树数据 // 左侧一级节点改变时,切换右侧的树数据
onMenuChange(menuData) { onMenuChange(menuData) {
this.activeMenuId = menuData.menuId; this.activeMenuId = menuData ? menuData.menuId : '';
this.treeData = [ menuData ]; this.treeData = menuData ? [ menuData ] : [];
this.$nextTick(this.checkSelectAll); this.$nextTick(this.checkSelectAll);
}, },
// 判断当前tree是否全选,并更新全选按钮的状态 // 判断当前tree是否全选,并更新全选按钮的状态
...@@ -120,6 +121,13 @@ export default { ...@@ -120,6 +121,13 @@ export default {
background-color: #fff; background-color: #fff;
} }
} }
.no-data {
padding-top: 20px;
text-align: center;
font-size: 14px;
color: @gray03;
line-height: 60px;
}
} }
.all-menu { .all-menu {
padding: 20px 0 0 20px; padding: 20px 0 0 20px;
......
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