diff --git a/src/api/index.js b/src/api/index.js index dbc39c8..ad5a019 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -83,8 +83,8 @@ export default { queryDatabaseInfo:`${host1}/data/data/dataRecord/queryDatabaseInfo`, queryDatabaseInfoByMonth:`${host1}/data/data/dataRecord/queryDatabaseInfoByMonth`, saveRecord:`${host1}/data/data/dataRecord/saveRecord`, - databaseInfoExport:`${host1}/data/data/dataRecord/data/databaseInfoExport`, - databaseInfoByMonthExport:`${host1}/data/data/dataRecord/data/databaseInfoByMonthExport`, + databaseInfoExport:`${host1}/data/data/dataRecord/databaseInfoExport`, + databaseInfoByMonthExport:`${host1}/data/data/dataRecord/databaseInfoByMonthExport`, onlineNumber:`${host1}/data/data/dataRecord/onlineNumber`, getProductInfoBySchoolId:`${host1}/data/data/product/getProductInfoBySchoolId`, } \ No newline at end of file diff --git a/src/components/breadcrumb/index.vue b/src/components/breadcrumb/index.vue deleted file mode 100644 index cf1c54c..0000000 --- a/src/components/breadcrumb/index.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index a569caf..e1d88f0 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -2,13 +2,12 @@
- - +
@@ -20,6 +19,15 @@
+
+ +
+
+ +
@@ -32,20 +40,23 @@ export default { data() { return { token: util.local.get(Setting.tokenKey), - isUser: false + isLogin: this.$route.path == '/login', + userName: '', + isUser: false, + showSetting: true }; }, components: { navbar }, computed: { ...mapState('user', [ - 'avatar','userName','isManager','schoolId' + 'avatar','isManager','schoolId' ]), ...mapState('auth', [ 'routes' ]) }, mounted(){ - if(this.token) (this.userName && this.avatar) || this.getUserInfo() + this.token && this.getUserInfo() }, methods: { ...mapActions('user', [ @@ -58,11 +69,11 @@ export default { this.isUser = isManager let mg = this.$route.query.mg if(mg && atob(decodeURI(mg)) === 'true'){ - isManager = false + this.showSetting = false } + this.userName = userInfo.userName this.setInfo({ avatar: userInfo.userAvatars, - userName: userInfo.userName, schoolId: res.userAccount.schoolId, }) this.setManager(isManager) @@ -80,15 +91,26 @@ export default { title: '首页' }) }, - toManager(){ - let route = this.$router.resolve({ - path: this.routes[0].name, - query: { - mg: btoa(true), - schoolId: btoa(this.schoolId), - } + toLogin(){ + this.$refs.nav.jump({ + index: '/login', + title: '登录' }) - window.open(route.href) + }, + toManager(){ + let routes = this.routes + if(routes.length){ + let route = this.$router.resolve({ + path: this.routes[0].name, + query: { + mg: btoa(true), + schoolId: btoa(this.schoolId), + } + }) + window.open(route.href) + }else{ + util.warningMsg('该角色未开放模块,请联系管理员') + } }, userCommand(command){ if(command == 'person'){ @@ -120,13 +142,12 @@ export default { } } + .search{ + cursor: pointer; + } .action{ display: inline-flex; align-items: center; - .icon{ - margin-right: 30px; - cursor: pointer; - } .user-wrap { display: inline-flex; align-items: center; @@ -143,5 +164,18 @@ export default { } } } + .login{ + display: inline-flex; + align-items: center; + cursor: pointer; + &:hover{ + opacity: .9; + } + span{ + margin-left: 10px; + color: #000; + font-size: 14px; + } + } } \ No newline at end of file diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue index ff32be8..cac645c 100644 --- a/src/layouts/navbar/index.vue +++ b/src/layouts/navbar/index.vue @@ -17,15 +17,14 @@ export default { managerStr: this.$route.query.mg, isManager: false, active: this.$route.path, - defaultMenus: [ - { - index: '/index/list', - title: '首页' - },{ - index: '/data/list', - title: '数据' - } - ], + defaultMenus: [{ + index: '/index/list', + title: '首页' + }], + dataMenu: [{ + index: '/data/list', + title: '数据' + }], managerMenus: [ { index: '/stat/list', @@ -63,6 +62,8 @@ export default { this.isManager = true this.setManager(false) } + }else{ + this.menus = this.defaultMenus } }, methods: { @@ -83,7 +84,7 @@ export default { this.menus = this.defaultMenus } }else{ - this.menus = this.defaultMenus + this.menus = [...this.defaultMenus,...this.dataMenu] } }, jump(item){ @@ -95,7 +96,9 @@ export default { let routes = res.permissions[0].children Setting.dynamicRoute && addRoutes(routes) this.initMenu() - }).catch(err => {}) + }).catch(err => { + this.menus = this.defaultMenus + }) }, } }; diff --git a/src/pages/index/list/index.vue b/src/pages/index/list/index.vue index 22b4b3a..0831466 100644 --- a/src/pages/index/list/index.vue +++ b/src/pages/index/list/index.vue @@ -9,7 +9,7 @@
-
+
热门下载: