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