zuozhengqing
2024-01-03 2e99f3e099c8541808312eae125c7af5a498e122
src/router/index.js
@@ -168,14 +168,27 @@
router.afterEach((to, from, next) => {
  if ((to.path === "/overview/overviewList" || to.path === "/productManage/productList") && to.params.name) {
    console.log(from, next)
    to.meta.title = to.params.name
    // document.title = to.meta.title
  } else if (to.name === "inboundOutboundDetail") {
    to.meta.title = "入库明细报表"
    // document.title = to.meta.title
  if(window.sessionStorage.getItem('routeName')){
    if(to.path === "/overview/overviewList"&&to.meta.title!="采购入库"){
      window.sessionStorage.setItem("routeName",to.params.name)
      to.meta.title=to.params.name
    }else if(to.meta.title==="采购入库"){
      to.meta.title = window.sessionStorage.getItem('routeName');
    }
  }else{
    if ((to.path === "/overview/overviewList" || to.path === "/productManage/productList") && to.params.name) {
      console.log(from, next)
      window.sessionStorage.setItem("routeName",to.params.name)
      to.meta.title = window.sessionStorage.getItem('routeName');
      // document.title = to.meta.title
    } else if (to.name === "inboundOutboundDetail") {
      to.meta.title = "入库明细报表"
      // document.title = to.meta.title
    }else{
      // window.sessionStorage.removeItem("routeName")
    }
  }
})
// router.beforeEach((to, from, next) => {
// must call `next`