zhaowei
2024-11-13 1c21609a31e43427b29816d43d230fcf2830cdc0
src/components/layouts/TabLayout.vue
@@ -14,11 +14,12 @@
      @change="changePage"
      @tabClick="tabCallBack"
      @edit="editPage">
      <a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList" :closable="!(page.meta.title=='首页')">
      <a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList"
                  :closable="!(page.meta.title=='首页')">
        <span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span>
      </a-tab-pane>
    </a-tabs>
    <div style="margin: 12px 12px 0;">
    <div :style="{padding:$route.meta.title=='首页'?'0':'12px 12px 0'}">
      <!-- update-begin-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
      <keep-alive v-if="multipage">
        <router-view v-if="reloadFlag"/>
@@ -41,7 +42,7 @@
  import { triggerWindowResizeEvent } from '@/utils/util'
  import Vue from 'vue'
  import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
  import registerApps from "@/qiankun";
  import registerApps from '@/qiankun'
  const indexKey = '/dashboard/analysis'
@@ -72,7 +73,7 @@
      return{
        closeCurrent:this.closeCurrent,
        changeTitle: this.changeTitle,
        changeTabTitle: this.changeTabTitle,
        changeTabTitle: this.changeTabTitle
      }
    },
    /* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
@@ -101,8 +102,8 @@
      if (process.env.VUE_APP_QIANKUN == 'true') {
        //update-begin-author:zyf date:20211129 for:qiankun 注册子应用
        if (!window.qiankunStarted) {
          window.qiankunStarted = true;
          registerApps();
          window.qiankunStarted = true
          registerApps()
        }
        //update-end-author:zyf date:20211129 for:qiankun 注册子应用
      }
@@ -157,7 +158,7 @@
        if (this.multipage && this.linkList.indexOf(indexKey) === -1) {
          this.addIndexToFirst()
        }
      },
      }
      // update-end-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG
    },
    methods: {
@@ -183,7 +184,7 @@
       * @param title 要修改的新标题
       */
      changeTitle(title) {
        let projectTitle = "中国航发成发"
        let projectTitle = '中国航发成发'
        // 首页特殊处理
        if (this.$route.path === indexKey) {
          document.title = projectTitle
@@ -231,7 +232,7 @@
          this.$message.warning('这是最后一页,不能再关闭了啦')
          return
        }
        console.log("this.pageList ",this.pageList );
        console.log('this.pageList ', this.pageList)
        let removeRoute = this.pageList.filter(item => item.fullPath == key)
        this.pageList = this.pageList.filter(item => item.fullPath !== key)
        let index = this.linkList.indexOf(key)
@@ -244,8 +245,8 @@
        let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || []
        if (removeRoute && removeRoute[0]) {
          let componentName = removeRoute[0].meta.componentName
          console.log("key: ", key);
          console.log("componentName: ", componentName);
          console.log('key: ', key)
          console.log('componentName: ', componentName)
          if(cacheRouterArray.includes(componentName)){
            cacheRouterArray.splice(cacheRouterArray.findIndex(item => item === componentName), 1)
            Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
@@ -301,7 +302,7 @@
      },
      /* update_begin author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
      closeCurrent(){
        this.remove(this.activePage);
        this.remove(this.activePage)
      },
      /* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
      closeOthers(pageKey) {
@@ -359,7 +360,7 @@
      //update-begin-author:taoyan date:20191008 for:路由刷新
      routeReload(){
        this.reloadFlag = false
        let ToggleMultipage = "ToggleMultipage"
        let ToggleMultipage = 'ToggleMultipage'
        this.$store.dispatch(ToggleMultipage,false)
        this.$nextTick(()=>{
          this.$store.dispatch(ToggleMultipage,true)
@@ -370,7 +371,7 @@
      //新增一个返回方法
      excuteCallback(callback){
        callback()
      },
      }
    }
  }
</script>