modified: src/App.vue
modified: src/main.js
new file: src/utils/EventBus.js
new file: src/utils/GlobalClickMixin.js
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import GlobalClickMixin from "@/utils/GlobalClickMixin"; |
| | | export default { |
| | | mixins: [GlobalClickMixin], // 浣跨敤娣峰叆 |
| | | name: 'App', |
| | | mounted() { |
| | | document.title = "瑁呭鐢电紗 lims 绯荤粺" |
| | |
| | | .breadcrumb-container{ |
| | | height: 40px; |
| | | } |
| | | |
| | | .app-main{ |
| | | margin-top: 41px !important; |
| | | } |
| | |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .el-dialog__header,.el-message-box__header { |
| | | .el-dialog__header, |
| | | .el-message-box__header { |
| | | box-sizing: border-box; |
| | | height: 46px; |
| | | border-bottom: 1px solid rgb(238, 238, 238); |
| | |
| | | import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n |
| | | import VueClipboard from 'vue-clipboard2' |
| | | Vue.use(VueClipboard) |
| | | |
| | | import '@/styles/index.scss' // global css |
| | | |
| | | import App from './App' |
| | |
| | | router, |
| | | store, |
| | | render: h => h(App) |
| | | }) |
| | | }); |
对比新文件 |
| | |
| | | // EventBus.js |
| | | import Vue from 'vue'; |
| | | export const EventBus = new Vue(); |
对比新文件 |
| | |
| | | import { EventBus } from './EventBus.js'; |
| | | |
| | | export default { |
| | | mounted() { |
| | | this.$el.addEventListener('click', this.$_handleGlobalClick); |
| | | }, |
| | | beforeDestroy() { |
| | | this.$el.removeEventListener('click', this.$_handleGlobalClick); |
| | | }, |
| | | methods: { |
| | | $_handleGlobalClick(event) { |
| | | if (event.target.tagName === 'SPAN'||event.target.tagName==='BUTTON') { |
| | | if(sessionStorage.getItem('user')===undefined&&sessionStorage.getItem('user')===null){ |
| | | return; |
| | | } |
| | | let user=JSON.parse(sessionStorage.getItem('user')); |
| | | if(user.account === 'admin'&&user.sessionLayerId === 'f5c8bcb7d5a0fd27e2323280f7e98cad'){ |
| | | return; |
| | | } |
| | | // console.log(this.$router.currentRoute); |
| | | // console.log(user.role.roleMenuList); |
| | | // console.log(event.target.innerText); |
| | | } |
| | | } |
| | | } |
| | | }; |