diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index ec7feb0..00c61f1 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -55,17 +55,12 @@ import navbar from '../navbar' import { mapState, mapActions } from 'vuex' import Setting from '@/setting' import util from '@/libs/util' -import bus from '@/libs/bus' export default { data() { return { token: util.local.get(Setting.tokenKey), isLogin: this.$route.path == '/login', - isData: this.$route.path == '/data/list', customer: this.$route.query.customer, - rendered: false, - keyword: '', - searchTimer: null, showSetting: true, id: '', schoolName: '', @@ -86,25 +81,6 @@ export default { 'routes' ]) }, - watch: { - keyword: function(val) { - clearTimeout(this.searchTimer) - if (!this.rendered) { - this.searchTimer = setTimeout(() => { - bus.$emit('initData', this.keyword) - }, 500) - } - this.rendered = false - }, - '$route'(to, from) { - let isData = this.$route.path == '/data/list' - if (isData) { - this.rendered = true - this.keyword = '' - } - this.isData = isData - } - }, mounted() { // 如果是客户,则存到store里去,因为客户是没有用户信息的,上面要根据这个值来判断显示与否 if (this.customer) { @@ -146,6 +122,7 @@ export default { this.showSetting = false }, toIndex() { + // 如果是在首页,直接刷新页面,否则,跳转到首页,并且重置进入后台的图标 if (this.$route.path === '/index/list') { location.reload() } else { @@ -166,13 +143,13 @@ export default { let route = this.$router.resolve({ path: this.routes[0].name, query: { - mg: btoa(true), + mg: btoa(true), // 后台的标识 schoolId: btoa(this.schoolId), - customer: btoa(this.isCustomer), + customer: btoa(this.isCustomer), // 客户标识 userName: this.userName } }) - window.open(route.href) + window.open(route.href) // 后台要打开新标签页 } else { // 如果接口返回的后台角色权限为空,则表示没有给该角色开放任何模块权限,直接提示用户未开放 util.warningMsg('该角色未开放模块,请联系管理员') diff --git a/src/pages/data/list/index.vue b/src/pages/data/list/index.vue index a757643..1fff713 100644 --- a/src/pages/data/list/index.vue +++ b/src/pages/data/list/index.vue @@ -77,7 +77,7 @@ :with-header="false" :visible.sync="previewVisible">