diff --git a/package.json b/package.json index 5afbd0b..992614f 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "animate.css": "3.5.2", "axios": "^0.16.2", "babel-polyfill": "^6.23.0", - "echarts": "^3.7.1", + "echarts": "^3.5.1", "element-ui": "^1.4.3", "eventsource-polyfill": "^0.9.6", "font-awesome": "^4.7.0", diff --git a/src/api.js b/src/api.js index ed3400b..2a59b69 100644 --- a/src/api.js +++ b/src/api.js @@ -39,11 +39,6 @@ export const SYS_USER_PAGE = CONTEXT + '/sys/user/page'; export const SYS_USER_ROLE = CONTEXT + '/sys/user/roleIds'; export const SYS_SET_USER_ROLE = CONTEXT + '/sys/user/setRoles'; - -export const UPLOAD_FORM_FILE = CONTEXT + '/upload/imageUpload'; -export const UPLOAD_FORM_FILE_TEMP = CONTEXT + '/upload/formFile'; -export const UPLOAD_FORM_FILE_BATCH = CONTEXT + '/upload/batch'; - export const MSG_TOP_TEN = CONTEXT + '/messageList'; export const TEST_DATA = CONTEXT + '/static/data/data.json'; diff --git a/src/components/sideMenu.vue b/src/components/sideMenu.vue index 7ff7053..f11692c 100644 --- a/src/components/sideMenu.vue +++ b/src/components/sideMenu.vue @@ -5,7 +5,7 @@ + theme="light" router :collapse="sidebar.collapsed&&!device.isMobile" @select="handleSelect"> @@ -16,7 +16,7 @@ + theme="light" router :collapse="sidebar.collapsed&&!device.isMobile" @select="handleSelect"> @@ -112,7 +112,7 @@ } .main-sidebar { - background-color: #324157; + background-color: #ffffff; position: fixed; top: 50px; left: 0; @@ -129,6 +129,12 @@ .expandSide { width: 230px; } + .el-menu,.el-submenu .el-menu{ + background-color: #ffffff; + } + .el-menu-item:hover,.el-submenu .el-menu-item:hover,.el-submenu__title:hover{ + background-color: #eeeeee; + } .el-menu-vertical-demo .el-submenu .el-menu-item { height: 45px; @@ -149,7 +155,7 @@ } .vue-scrollbar{ - background-color: #324157 !important; + background-color: #ffffff !important; height: calc(100vh - 50px) } diff --git a/src/main.js b/src/main.js index 2b35943..c34c7eb 100644 --- a/src/main.js +++ b/src/main.js @@ -90,7 +90,7 @@ axios.interceptors.response.use( error => { if (error.response) { //全局ajax错误信息提示 - // Element.MessageBox({type:"error",message:error.response.data,title:"温馨提示"}); + Element.MessageBox({type:"error",message:error.response.data,title:"温馨提示"}); } return Promise.reject(error); }); diff --git a/src/mock/common.js b/src/mock/common.js index 5eec7fb..e27ee65 100644 --- a/src/mock/common.js +++ b/src/mock/common.js @@ -18,11 +18,86 @@ let listData = Mock.mock({ ], }) +const resourceList = [{"id":52,"parentId":null,"sort":0,"name":"登录","code":"/login","type":3,"usable":"1","remarks":"","children":[]}, + {"id":68,"parentId":null,"sort":0,"name":"仪表盘","code":"/index","type":1,"usable":"1","remarks":"","children":[]}, + {"id":69,"parentId":null,"sort":0,"name":"系统管理","code":"/sys","type":1,"usable":"1","remarks":"","children":[{"id":82,"parentId":69,"sort":0,"name":"资源管理","code":"/sys/resource","type":1,"usable":"1","remarks":"","children":[{"id":99,"parentId":82,"sort":0,"name":"/sys/resource/get","code":"/sys/resource/get","type":3,"usable":"1","remarks":"","children":[]}, + {"id":100,"parentId":82,"sort":0,"name":"/sys/resource/update","code":"/sys/resource/update","type":3,"usable":"1","remarks":"","children":[]}, + {"id":101,"parentId":82,"sort":0,"name":"/sys/resource/delete","code":"/sys/resource/delete","type":3,"usable":"1","remarks":"","children":[]}, + {"id":102,"parentId":82,"sort":0,"name":"/sys/resource/add","code":"/sys/resource/add","type":3,"usable":"1","remarks":"","children":[]}, + {"id":103,"parentId":82,"sort":0,"name":"/sys/resource/page","code":"/sys/resource/page","type":3,"usable":"1","remarks":"","children":[]}, + {"id":104,"parentId":82,"sort":0,"name":"/sys/resource/list","code":"/sys/resource/list","type":3,"usable":"1","remarks":"","children":[]}, + {"id":105,"parentId":82,"sort":0,"name":"/sys/resource/list2","code":"/sys/resource/list2","type":3,"usable":"1","remarks":"","children":[]}]}, + {"id":70,"parentId":69,"sort":1,"name":"菜单管理","code":"/sys/menuList","type":1,"usable":"1","remarks":"","children":[{"id":83,"parentId":70,"sort":0,"name":"/sys/menu/get","code":"/sys/menu/get","type":3,"usable":"1","remarks":"","children":[]}, + {"id":84,"parentId":70,"sort":0,"name":"/sys/menu/update","code":"/sys/menu/update","type":3,"usable":"1","remarks":"","children":[]}, + {"id":85,"parentId":70,"sort":0,"name":"/sys/menu/delete","code":"/sys/menu/delete","type":3,"usable":"1","remarks":"","children":[]}, + {"id":86,"parentId":70,"sort":0,"name":"/sys/menu/add","code":"/sys/menu/add","type":3,"usable":"1","remarks":"","children":[]}, + {"id":87,"parentId":70,"sort":0,"name":"/sys/menu/page","code":"/sys/menu/page","type":3,"usable":"1","remarks":"","children":[]}, + {"id":88,"parentId":70,"sort":0,"name":"/sys/menu/list","code":"/sys/menu/list","type":3,"usable":"1","remarks":"","children":[]}, + {"id":89,"parentId":70,"sort":0,"name":"/sys/menu/list2","code":"/sys/menu/list2","type":3,"usable":"1","remarks":"","children":[]}]}, + {"id":71,"parentId":69,"sort":3,"name":"角色管理","code":"/sys/roleList","type":1,"usable":"1","remarks":"","children":[{"id":90,"parentId":71,"sort":0,"name":"/sys/role/get","code":"/sys/role/get","type":3,"usable":"1","remarks":"","children":[]}, + {"id":91,"parentId":71,"sort":0,"name":"/sys/role/update","code":"/sys/role/update","type":3,"usable":"1","remarks":"","children":[]}, + {"id":92,"parentId":71,"sort":0,"name":"/sys/role/delete","code":"/sys/role/delete","type":3,"usable":"1","remarks":"","children":[]}, + {"id":93,"parentId":71,"sort":0,"name":"/sys/role/add","code":"/sys/role/add","type":3,"usable":"1","remarks":"","children":[]}, + {"id":94,"parentId":71,"sort":0,"name":"/sys/role/page","code":"/sys/role/page","type":3,"usable":"1","remarks":"","children":[]}, + {"id":95,"parentId":71,"sort":0,"name":"/sys/role/list","code":"/sys/role/list","type":3,"usable":"1","remarks":"","children":[]}, + {"id":96,"parentId":71,"sort":0,"name":"/sys/role/list2","code":"/sys/role/list2","type":3,"usable":"1","remarks":"","children":[]}, + {"id":97,"parentId":71,"sort":0,"name":"/sys/role/resources","code":"/sys/role/resources","type":3,"usable":"1","remarks":"","children":[]}, + {"id":98,"parentId":71,"sort":0,"name":"/sys/role/setResources","code":"/sys/role/setResources","type":3,"usable":"1","remarks":"","children":[]}]}, + {"id":72,"parentId":69,"sort":6,"name":"用户管理","code":"/sys/userList","type":1,"usable":"1","remarks":"","children":[{"id":106,"parentId":72,"sort":0,"name":"/sys/user/get","code":"/sys/user/get","type":3,"usable":"1","remarks":"","children":[]}, + {"id":107,"parentId":72,"sort":0,"name":"/sys/user/add","code":"/sys/user/add","type":3,"usable":"1","remarks":"","children":[]}, + {"id":108,"parentId":72,"sort":0,"name":"/sys/user/update","code":"/sys/user/update","type":3,"usable":"1","remarks":"","children":[]}, + {"id":109,"parentId":72,"sort":0,"name":"/sys/user/delete","code":"/sys/user/delete","type":3,"usable":"1","remarks":"","children":[]}, + {"id":110,"parentId":72,"sort":0,"name":"/sys/user/page","code":"/sys/user/page","type":3,"usable":"1","remarks":"","children":[]}, + {"id":111,"parentId":72,"sort":0,"name":"/sys/user/roleIds","code":"/sys/user/roleIds","type":3,"usable":"1","remarks":"","children":[]}, + {"id":112,"parentId":72,"sort":0,"name":"/sys/user/setRoles","code":"/sys/user/setRoles","type":3,"usable":"1","remarks":"","children":[]}]}]}] -let database = listData.data +const menuList = [ + {"id":1,"parentId":null,"sort":0,"name":"仪表盘","href":"/index","icon":"fa fa-dashboard","children":[], + "isShow":"1"}, + {"id":31,"parentId":null,"sort":1,"name":"测试1","href":"/test/1","icon":"fa fa-upload","children": + [ + {"id":92,"parentId":31,"sort":0,"name":"测试1-1","href":"/test/1/1","icon":"fa fa-bank","children":[ + {"id":912,"parentId":92,"sort":0,"name":"测试1-1-1","href":"/test/1/1/1","icon":"fa fa-bank","children":[],"isShow":"1"}, + {"id":913,"parentId":92,"sort":0,"name":"测试1-1-2","href":"/test/1/1/2","icon":"fa fa-area-chart","children":[],"isShow":"1"} + ],"isShow":"1"}, + {"id":93,"parentId":31,"sort":0,"name":"测试1-2","href":"/test/1/2","icon":"fa fa-area-chart","children":[],"isShow":"1"} + ] + ,"isShow":"1"}, + {"id":102,"parentId":null,"sort":3,"name":"测试2","href":"/test/2","icon":"fa fa-download","children": + [ + {"id":103,"parentId":102,"sort":0,"name":"测试2-1","href":"/test/2/1","icon":"fa fa-image","children":[],"isShow":"1"} + ] + ,"isShow":"1"}, + {"id":6,"parentId":null,"sort":6,"name":"系统管理","href":"/sys","icon":"fa fa-cog","children": + [ + {"id":108,"parentId":6,"sort":0,"name":" 资源管理","href":"/sys/resource","icon":"fa fa-database","children":[],"isShow":"1"}, + {"id":7,"parentId":6,"sort":1,"name":"菜单管理","href":"/sys/menuList","icon":"fa fa-navicon","children":[],"isShow":"1"}, + {"id":8,"parentId":6,"sort":2,"name":"角色管理","href":"/sys/roleList","icon":"fa fa-universal-access","children":[],"isShow":"1"}, + {"id":9,"parentId":6,"sort":3,"name":"用户管理","href":"/sys/userList","icon":"fa fa-user-plus","children":[],"isShow":"1"} + ] + ,"isShow":"1"}] + +const roleList = [ + {"id":26,"delFlag":0,"parentId":null,"sort":0,"name":"超级管理员","enName":"super_manager","usable":"1","remarks":"","children":[]}, + {"id":27,"delFlag":0,"parentId":null,"sort":1,"name":"客服主管","enName":"server_manager","usable":"1","remarks":"","children":[ + {"id":28,"delFlag":0,"parentId":27,"sort":0,"name":"售后客服","enName":"server1","usable":"1","remarks":"","children":[]}, + {"id":29,"delFlag":0,"parentId":27,"sort":1,"name":"售前客服","enName":"server2","usable":"1","remarks":"","children":[]} + ]} +] + + let database = listData.data module.exports = { 'GET /messageList': function (req, res) { res.status(200).json(database) }, + 'GET /sys/resource/list':function (req, res) { + res.status(200).json(resourceList) + }, + 'GET /sys/menu/list':function (req, res) { + res.status(200).json(menuList) + }, + 'GET /sys/role/list':function (req, res) { + res.status(200).json(roleList) + }, } diff --git a/src/mock/user.js b/src/mock/user.js index 390fe79..b5bb420 100644 --- a/src/mock/user.js +++ b/src/mock/user.js @@ -15,7 +15,7 @@ let usersListData = Mock.mock({ email: '@email', createTime: '@datetime', avatar () { - return Mock.Random.image('100x100', Mock.Random.color(), '#757575', 'png', this.name.substr(0, 1)) + return Mock.Random.image('100x100', Mock.Random.color(), '#757575', 'png', this.nickName.substr(0, 1)) }, delFlag:0, status:1, diff --git a/src/pages/layout/header.vue b/src/pages/layout/header.vue index f53754d..f52e529 100644 --- a/src/pages/layout/header.vue +++ b/src/pages/layout/header.vue @@ -18,7 +18,7 @@
  • - +

    {{item.title}}

  • @@ -143,6 +143,7 @@ .main-header a { text-decoration: none; + color: #108ee9; } .main-header { @@ -152,6 +153,7 @@ z-index: 9999; animation-name: slideInDown; animation-fill-mode: both; + color: #108ee9; } .main-header .navbar .sidebar-toggle { @@ -168,7 +170,7 @@ } .main-header .navbar .sidebar-toggle:hover { - color: #fff; + /*color: #fff;*/ } .main-header .logo { @@ -208,8 +210,9 @@ border: none; min-height: 50px; border-radius: 0; - background-color: #3c8dbc; - color: #ffffff; + /*background-color: #3c8dbc;*/ + background-color: #ffffff; + /*color: #ffffff;*/ } .layout-top-nav .main-header .navbar { @@ -226,31 +229,31 @@ } .main-header .navbar .sidebar-toggle { - color: #ffffff; + /*color: #ffffff;*/ display: block; } .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; + /*color: #f6f6f6;*/ background: rgba(0, 0, 0, 0.1); } .main-header .navbar .sidebar-toggle { - color: #fff; + /*color: #fff;*/ } .main-header .navbar .sidebar-toggle:hover { - background-color: #367fa9; + /*background-color: #367fa9;*/ } .main-header .logo { - background-color: #367fa9; - color: #ffffff; + /*background-color: #367fa9;*/ + /*color: #ffffff;*/ border-bottom: 0 solid transparent; } .main-header .logo:hover { - background-color: #357ca5; + /*background-color: #357ca5;*/ } @media (max-width: 800px) { @@ -277,8 +280,8 @@ display: none; } .main-header.closeLogo .sidebar-toggle { - background-color: #367fa9; - color: #f6f6f6; + /*background-color: #367fa9;*/ + /*color: #f6f6f6;*/ background: rgba(0, 0, 0, 0.1); } @@ -296,7 +299,7 @@ .navbar-custom-menu .el-dropdown-link{ cursor: pointer; - color: #ffffff; + /*color: #ffffff;*/ height: 50px; padding: 13px 5px; min-width: 50px; @@ -324,7 +327,7 @@ .el-dropdown-menu .header-pic{ text-align: center; - background-color: #3c8dbc; + background-color: #108ee9; padding: 20px; } .el-dropdown-menu .header-pic img{ diff --git a/src/pages/sys/menu.vue b/src/pages/sys/menu.vue index b656ee5..cd1c55d 100644 --- a/src/pages/sys/menu.vue +++ b/src/pages/sys/menu.vue @@ -213,9 +213,9 @@ } }, load(){ - this.$http.get(api.TEST_DATA) + this.$http.get(api.SYS_MENU_LIST) .then(res => { - this.menuTree = res.data.menuList; + this.menuTree = res.data; }).catch((error) => { console.log(error) }) diff --git a/src/pages/sys/resource.vue b/src/pages/sys/resource.vue index d793994..0a19353 100644 --- a/src/pages/sys/resource.vue +++ b/src/pages/sys/resource.vue @@ -198,9 +198,8 @@ } }, load(){ - this.$http.get(api.TEST_DATA) + this.$http.get(api.SYS_RESOURCE_LIST) .then(res=>{ - res.data = res.data.resourceList; this.resourceTree = []; this.resourceTree.push(...res.data) }).catch((error) => { diff --git a/src/pages/sys/role.vue b/src/pages/sys/role.vue index 8789706..9ee0795 100644 --- a/src/pages/sys/role.vue +++ b/src/pages/sys/role.vue @@ -199,9 +199,8 @@ }) }, load(){ - this.$http.get(api.TEST_DATA) + this.$http.get(api.SYS_ROLE_LIST) .then(res => { - res.data = res.data.roleList; this.roleTree = []; this.roleTree.push(...res.data) }).catch((error) => { diff --git a/src/store/index.js b/src/store/index.js index e7487ae..77589bf 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -66,8 +66,8 @@ const store = new Vuex.Store({ //异步的函数 toggleLoading: ({commit}) => commit(types.TOGGLE_LOADING), loadMenuList: ({commit}) => { - Vue.axios.get(api.TEST_DATA).then(res => { - commit(types.LOAD_MENU, res.data.menuList); + Vue.axios.get(api.SYS_MENU_LIST).then(res => { + commit(types.LOAD_MENU, res.data); }).catch(exp => commit(types.LOAD_MENU, defaultMenu)); }, changeCurrentMenu: ({state,commit},{path,matched,fullPath}) => {