Fixiaobai
2023-09-01 6ee26b5dcd3312ef1c673ac52f75a352ffb8457e
	modified:   src/App.vue
modified: src/main.js
new file: src/utils/EventBus.js
new file: src/utils/GlobalClickMixin.js
已修改2个文件
已添加2个文件
38 ■■■■■ 文件已修改
src/App.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/EventBus.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/GlobalClickMixin.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue
@@ -5,7 +5,9 @@
</template>
<script>
import GlobalClickMixin from "@/utils/GlobalClickMixin";
export default {
    mixins: [GlobalClickMixin], // 浣跨敤娣峰叆
  name: 'App',
    mounted() {
        document.title = "瑁呭鐢电紗 lims 绯荤粺"
@@ -21,6 +23,7 @@
    .breadcrumb-container{
        height: 40px;
    }
    .app-main{
        margin-top: 41px !important;
    }
@@ -35,7 +38,8 @@
        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);
src/main.js
@@ -9,7 +9,6 @@
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'
@@ -61,4 +60,4 @@
  router,
  store,
  render: h => h(App)
})
});
src/utils/EventBus.js
对比新文件
@@ -0,0 +1,3 @@
// EventBus.js
import Vue from 'vue';
export const EventBus = new Vue();
src/utils/GlobalClickMixin.js
对比新文件
@@ -0,0 +1,26 @@
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);
          }
    }
  }
};