| | |
| | | import productRouter from "./product/index.js" // 产品 |
| | | import operateRouter from "./operate/index.js" // 操作 |
| | | import warehouseManageRouter from "./warehouseManage/index.js" // 仓库管理 |
| | | import reportRouter from "./report/index.js" // 报表 |
| | | |
| | | Vue.use(Router) |
| | | const login = (resolve) => require(["@/views/other/login/index"], resolve) |
| | |
| | | const productManage = (resolve) => require(["@/views/productManage/index"], resolve) // 产品 |
| | | const operate = (resolve) => require(["@/views/operate/index"], resolve) // 操作 |
| | | const warehouseManage = (resolve) => require(["@/views/warehouseManage/index"], resolve) // 仓库管理 |
| | | const reportForm = (resolve) => require(["@/views/reportForm/index"], resolve) // 报表 |
| | | |
| | | export const routes = [ |
| | | { |
| | |
| | | children: warehouseManageRouter, |
| | | meta: { |
| | | title: "仓库管理", |
| | | isAllways: true |
| | | } |
| | | }, |
| | | { |
| | | path: "reportForm", // 报表 |
| | | name: "reportForm", |
| | | component: reportForm, |
| | | children: reportRouter, |
| | | meta: { |
| | | title: "报表", |
| | | isAllways: true |
| | | } |
| | | } |
| | |
| | | const router = createRouter() |
| | | |
| | | router.afterEach((to, from, next) => { |
| | | if ((to.path === "/overview/overviewList" || to.path === "/reportForm/inOutboundDetail") && to.query.name) { |
| | | console.log(to, "to") |
| | | if ((to.path === "/overview/overviewList" || to.path === "/productManage/productList") && to.params.name) { |
| | | console.log(from, next) |
| | | to.meta.title = to.query.name |
| | | document.title = to.meta.title |
| | | to.meta.title = to.params.name |
| | | // document.title = to.meta.title |
| | | } else if (to.name === "inboundOutboundDetail") { |
| | | to.meta.title = "出入库明细" |
| | | // document.title = to.meta.title |
| | | } |
| | | }) |
| | | // router.beforeEach((to, from, next) => { |