重命名電廠詳細頁面,並更新相關路由與選單配置
This commit is contained in:
parent
0e767795be
commit
b605bb3036
@ -35,7 +35,7 @@ function findMenuItem(route) {
|
||||
}
|
||||
// 動態路由(如 /plant/:id)
|
||||
if (
|
||||
child.routeName === "PlantDetail" &&
|
||||
child.routeName === "PlantInfo" &&
|
||||
route.path &&
|
||||
route.path.startsWith("/plant/")
|
||||
) {
|
||||
@ -58,7 +58,7 @@ function buildBreadcrumb(route) {
|
||||
},
|
||||
];
|
||||
let itemTitle = match.item.title;
|
||||
if (route.name === "PlantDetail" && route.params.id) {
|
||||
if (route.name === "PlantInfo" && route.params.id) {
|
||||
const plantNames = {
|
||||
"1": "四磺子坪",
|
||||
"2": "宜蘭大清水",
|
||||
|
||||
@ -27,21 +27,21 @@ export const menuConfig = [
|
||||
id: 'plant-1',
|
||||
title: '四磺子坪',
|
||||
path: '/plant/1',
|
||||
routeName: 'PlantDetail',
|
||||
routeName: 'PlantInfo',
|
||||
params: { id: 1 }
|
||||
},
|
||||
{
|
||||
id: 'plant-2',
|
||||
title: '宜蘭大清水',
|
||||
path: '/plant/2',
|
||||
routeName: 'PlantDetail',
|
||||
routeName: 'PlantInfo',
|
||||
params: { id: 2 }
|
||||
},
|
||||
{
|
||||
id: 'plant-3',
|
||||
title: '宜蘭小清水',
|
||||
path: '/plant/3',
|
||||
routeName: 'PlantDetail',
|
||||
routeName: 'PlantInfo',
|
||||
params: { id: 3 }
|
||||
}
|
||||
]
|
||||
|
||||
@ -2,7 +2,7 @@ import { createRouter, createWebHashHistory } from "vue-router";
|
||||
import Home from "../views/Home.vue";
|
||||
import PlantsOverview from "../views/PlantsOverview.vue";
|
||||
import PlantReport from "../views/PlantReport.vue";
|
||||
import PlantDetail from "../views/PlantDetail.vue";
|
||||
import PlantInfo from "../views/PlantInfo.vue";
|
||||
|
||||
const routes = [
|
||||
{
|
||||
@ -29,8 +29,8 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: "/plant/:id",
|
||||
name: "PlantDetail",
|
||||
component: PlantDetail,
|
||||
name: "PlantInfo",
|
||||
component: PlantInfo,
|
||||
meta: {
|
||||
title: "電廠詳細",
|
||||
menuGroup: "factory-info",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user