From 5613854c274aa10e05d51bedbb2d13ff89543144 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 10 二月 2026 15:19:57 +0800
Subject: [PATCH] 菜单名修改
---
src/pages/index.vue | 170 +++++++++++++++++++++++++++++++++++++++-----------------
src/pages.json | 4
src/pages/cooperativeOffice/collaborativeApproval/index.vue | 2
src/pages/safeProduction/emergencyPlanReview/index.vue | 2
4 files changed, 122 insertions(+), 56 deletions(-)
diff --git a/src/pages.json b/src/pages.json
index ac4a912..e2560fd 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -671,7 +671,7 @@
{
"path": "pages/safeProduction/safeQualifications/index",
"style": {
- "navigationBarTitleText": "瑙勭▼璧勮川",
+ "navigationBarTitleText": "瑙勭▼涓庤祫璐�",
"navigationStyle": "custom"
}
},
@@ -783,7 +783,7 @@
{
"path": "pages/safeProduction/hazardousMaterialsControl/index",
"style": {
- "navigationBarTitleText": "鍗遍櫓鐗╂枡",
+ "navigationBarTitleText": "鍗遍櫓鐗╂枡绠℃帶",
"navigationStyle": "custom"
}
},
diff --git a/src/pages/cooperativeOffice/collaborativeApproval/index.vue b/src/pages/cooperativeOffice/collaborativeApproval/index.vue
index 6c3defa..21a3f7b 100644
--- a/src/pages/cooperativeOffice/collaborativeApproval/index.vue
+++ b/src/pages/cooperativeOffice/collaborativeApproval/index.vue
@@ -158,7 +158,7 @@
5: "閲囪喘绠$悊",
6: "鎶ヤ环绠$悊",
7: "鍙戣揣瀹℃壒",
- 8: "鍗遍櫓浣滀笟绠$悊",
+ 8: "鍗遍櫓浣滀笟瀹℃壒",
};
return titleMap[type] || "瀹℃壒绠$悊";
};
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 3955450..a9bf210 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -38,7 +38,8 @@
<!-- </view>-->
<!-- </view>-->
<!-- 钀ラ攢绠$悊妯″潡 -->
- <view class="common-module marketing-module" v-if="hasMarketingItems">
+ <view class="common-module marketing-module"
+ v-if="hasMarketingItems">
<view class="module-header">
<view class="module-title-container">
<text class="module-title">钀ラ攢绠$悊</text>
@@ -62,7 +63,8 @@
</view>
</view>
<!-- <!– 閲囪喘绠$悊妯″潡 –>-->
- <view class="common-module purchase-module" v-if="hasPurchaseItems">
+ <view class="common-module purchase-module"
+ v-if="hasPurchaseItems">
<view class="module-header">
<view class="module-title-container">
<text class="module-title">閲囪喘绠$悊</text>
@@ -86,7 +88,8 @@
</view>
</view>
<!-- <!– 鍗忓悓鍔炲叕妯″潡 –> -->
- <view class="common-module collaboration-module" v-if="hasCollaborationItems">
+ <view class="common-module collaboration-module"
+ v-if="hasCollaborationItems">
<view class="module-header">
<view class="module-title-container">
<text class="module-title">鍗忓悓鍔炲叕</text>
@@ -110,7 +113,8 @@
</view>
</view>
<!-- 瀹夊叏鐢熶骇妯″潡 -->
- <view class="common-module collaboration-module" v-if="hasSafetyItems">
+ <view class="common-module collaboration-module"
+ v-if="hasSafetyItems">
<view class="module-header">
<view class="module-title-container">
<text class="module-title">瀹夊叏鐢熶骇</text>
@@ -134,7 +138,8 @@
</view>
</view>
<!-- 浜哄姏璧勬簮妯″潡 -->
- <view class="common-module collaboration-module" v-if="hasHumanResourcesItems">
+ <view class="common-module collaboration-module"
+ v-if="hasHumanResourcesItems">
<view class="module-header">
<view class="module-title-container">
<text class="module-title">浜哄姏璧勬簮</text>
@@ -158,7 +163,8 @@
</view>
</view>
<!-- 鐢熶骇绠℃帶妯″潡 -->
- <view class="common-module equipment-module" v-if="hasProductionItems">
+ <view class="common-module equipment-module"
+ v-if="hasProductionItems">
<view class="module-header">
<view class="module-title-container">
<text class="module-title">鐢熶骇绠℃帶</text>
@@ -182,7 +188,8 @@
</view>
</view>
<!-- 璁惧绠$悊妯″潡 -->
- <view class="common-module equipment-module" v-if="hasEquipmentItems">
+ <view class="common-module equipment-module"
+ v-if="hasEquipmentItems">
<view class="module-header">
<view class="module-title-container">
<text class="module-title">璁惧绠$悊</text>
@@ -306,7 +313,7 @@
const safetyItems = reactive([
{
icon: "/static/images/icon/caigoutaizhang@2x.png",
- label: "瑙勭▼璧勮川",
+ label: "瑙勭▼涓庤祫璐�",
},
{
icon: "/static/images/icon/caigoutaizhang@2x.png",
@@ -314,27 +321,27 @@
},
{
icon: "/static/images/icon/caigoutaizhang@2x.png",
- label: "鍗遍櫓浣滀笟",
+ label: "鍗遍櫓浣滀笟瀹℃壒",
},
{
icon: "/static/images/icon/guzhangfenxi@2x.png",
- label: "闅愭偅鎺掓煡",
+ label: "闅愭偅鎺掓煡涓婃姤",
},
{
icon: "/static/images/icon/guzhangfenxi@2x.png",
- label: "鍗遍櫓鐗╂枡",
+ label: "鍗遍櫓鐗╂枡绠℃帶",
},
{
icon: "/static/images/icon/guzhangfenxi@2x.png",
- label: "搴旀�ラ妗�",
+ label: "搴旀�ラ妗堟煡闃�",
},
{
icon: "/static/images/icon/guzhangfenxi@2x.png",
- label: "浜嬫晠涓婃姤",
+ label: "浜嬫晠涓婃姤璁板綍",
},
{
icon: "/static/images/icon/guzhangfenxi@2x.png",
- label: "瀹夊叏鍩硅",
+ label: "瀹夊叏鍩硅鑰冩牳",
},
]);
// 鍗忓悓鍔炲叕鍔熻兘鏁版嵁
@@ -659,7 +666,7 @@
url: "/pages/equipmentManagement/verification/index",
});
break;
- case "瑙勭▼璧勮川":
+ case "瑙勭▼涓庤祫璐�":
uni.navigateTo({
url: "/pages/safeProduction/safeQualifications/index",
});
@@ -669,32 +676,32 @@
url: "/pages/safeProduction/hazardSourceLedger/index",
});
break;
- case "鍗遍櫓浣滀笟":
+ case "鍗遍櫓浣滀笟瀹℃壒":
uni.navigateTo({
url: "/pages/cooperativeOffice/collaborativeApproval/index8",
});
break;
- case "闅愭偅鎺掓煡":
+ case "闅愭偅鎺掓煡涓婃姤":
uni.navigateTo({
url: "/pages/safeProduction/dangerInvestigation/index",
});
break;
- case "鍗遍櫓鐗╂枡":
+ case "鍗遍櫓鐗╂枡绠℃帶":
uni.navigateTo({
url: "/pages/safeProduction/hazardousMaterialsControl/index",
});
break;
- case "搴旀�ラ妗�":
+ case "搴旀�ラ妗堟煡闃�":
uni.navigateTo({
url: "/pages/safeProduction/emergencyPlanReview/index",
});
break;
- case "浜嬫晠涓婃姤":
+ case "浜嬫晠涓婃姤璁板綍":
uni.navigateTo({
url: "/pages/safeProduction/accidentReportingRecord/index",
});
break;
- case "瀹夊叏鍩硅":
+ case "瀹夊叏鍩硅鑰冩牳":
uni.navigateTo({
url: "/pages/safeProduction/safetyTrainingAssessment/index",
});
@@ -848,13 +855,16 @@
};
function loginSuccess(result) {
// 鑾峰彇璺敱鏉冮檺
- userStore.getRouters().then(() => {
- console.log("璺敱鏉冮檺鑾峰彇鎴愬姛");
- // 杩囨护鑿滃崟椤�
- filterMenuItemsByRoutes();
- }).catch(error => {
- console.error("鑾峰彇璺敱鏉冮檺澶辫触:", error);
- });
+ userStore
+ .getRouters()
+ .then(() => {
+ console.log("璺敱鏉冮檺鑾峰彇鎴愬姛");
+ // 杩囨护鑿滃崟椤�
+ filterMenuItemsByRoutes();
+ })
+ .catch(error => {
+ console.error("鑾峰彇璺敱鏉冮檺澶辫触:", error);
+ });
uni.reLaunch({
url: "/pages/index",
});
@@ -870,16 +880,16 @@
// 鏍规嵁璺敱鏉冮檺杩囨护鑿滃崟椤�
const filterMenuItemsByRoutes = () => {
const routers = userStore.routers || [];
-
+
// 濡傛灉娌℃湁璺敱鏉冮檺鏁版嵁锛屼笉杩涜杩囨护锛堟樉绀烘墍鏈夎彍鍗曪級
if (!routers || routers.length === 0) {
console.log("鏆傛棤璺敱鏉冮檺鏁版嵁锛屾樉绀烘墍鏈夎彍鍗�");
return;
}
-
+
// 鏀堕泦鎵�鏈夋湁鏉冮檺鐨勮彍鍗曟爣棰橈紙鏍规嵁 meta.title锛�
const allowedMenuTitles = new Set();
- const collectMenuTitles = (routes) => {
+ const collectMenuTitles = routes => {
if (!Array.isArray(routes)) return;
routes.forEach(route => {
// 鏀堕泦褰撳墠璺敱鐨勬爣棰�
@@ -895,8 +905,24 @@
collectMenuTitles(routers);
console.log("鍏佽鐨勮彍鍗曟爣棰�:", Array.from(allowedMenuTitles));
- console.log("杩囨护鍓� - 钀ラ攢绠$悊:", marketingItems.length, "閲囪喘绠$悊:", purchaseItems.length, "鍗忓悓鍔炲叕:", collaborationItems.length);
- console.log("杩囨护鍓� - 瀹夊叏鐢熶骇:", safetyItems.length, "浜哄姏璧勬簮:", humanResourcesItems.length, "鐢熶骇绠℃帶:", productionItems.length, "璁惧绠$悊:", equipmentItems.length);
+ console.log(
+ "杩囨护鍓� - 钀ラ攢绠$悊:",
+ marketingItems.length,
+ "閲囪喘绠$悊:",
+ purchaseItems.length,
+ "鍗忓悓鍔炲叕:",
+ collaborationItems.length
+ );
+ console.log(
+ "杩囨护鍓� - 瀹夊叏鐢熶骇:",
+ safetyItems.length,
+ "浜哄姏璧勬簮:",
+ humanResourcesItems.length,
+ "鐢熶骇绠℃帶:",
+ productionItems.length,
+ "璁惧绠$悊:",
+ equipmentItems.length
+ );
// 杩囨护钀ラ攢绠$悊鑿滃崟
const originalMarketing = [
@@ -931,7 +957,11 @@
}
return matched;
});
- collaborationItems.splice(0, collaborationItems.length, ...filteredCollaboration);
+ collaborationItems.splice(
+ 0,
+ collaborationItems.length,
+ ...filteredCollaboration
+ );
// 杩囨护閲囪喘绠$悊鑿滃崟
const originalPurchase = [
@@ -940,7 +970,10 @@
{ icon: "/static/images/icon/laipiaotaizhang@2x.png", label: "鏉ョエ鍙拌处" },
{ icon: "/static/images/icon/fukuanjingji@2x.png", label: "浠樻鐧昏" },
{ icon: "/static/images/icon/fukuanliushui@2x.png", label: "浠樻娴佹按" },
- { icon: "/static/images/icon/gongyingshangwanglai@2x.png", label: "渚涘簲鍟嗗線鏉�" },
+ {
+ icon: "/static/images/icon/gongyingshangwanglai@2x.png",
+ label: "渚涘簲鍟嗗線鏉�",
+ },
];
const filteredPurchase = originalPurchase.filter(item => {
return allowedMenuTitles.has(item.label);
@@ -949,14 +982,17 @@
// 杩囨护瀹夊叏鐢熶骇鑿滃崟
const originalSafety = [
- { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "瑙勭▼璧勮川" },
+ { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "瑙勭▼涓庤祫璐�" },
{ icon: "/static/images/icon/caigoutaizhang@2x.png", label: "鍗遍櫓婧愬彴璐�" },
- { icon: "/static/images/icon/caigoutaizhang@2x.png", label: "鍗遍櫓浣滀笟" },
- { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "闅愭偅鎺掓煡" },
- { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "鍗遍櫓鐗╂枡" },
- { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "搴旀�ラ妗�" },
- { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "浜嬫晠涓婃姤" },
- { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "瀹夊叏鍩硅" },
+ {
+ icon: "/static/images/icon/caigoutaizhang@2x.png",
+ label: "鍗遍櫓浣滀笟瀹℃壒",
+ },
+ { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "闅愭偅鎺掓煡涓婃姤" },
+ { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "鍗遍櫓鐗╂枡绠℃帶" },
+ { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "搴旀�ラ妗堟煡闃�" },
+ { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "浜嬫晠涓婃姤璁板綍" },
+ { icon: "/static/images/icon/guzhangfenxi@2x.png", label: "瀹夊叏鍩硅鑰冩牳" },
];
const filteredSafety = originalSafety.filter(item => {
return allowedMenuTitles.has(item.label);
@@ -971,11 +1007,19 @@
const filteredHumanResources = originalHumanResources.filter(item => {
return allowedMenuTitles.has(item.label);
});
- humanResourcesItems.splice(0, humanResourcesItems.length, ...filteredHumanResources);
+ humanResourcesItems.splice(
+ 0,
+ humanResourcesItems.length,
+ ...filteredHumanResources
+ );
// 杩囨护鐢熶骇绠℃帶鑿滃崟
const originalProduction = [
- { icon: "/static/images/icon/shengchanbaogong@2x.png", label: "鐢熶骇鎶ュ伐", bgColor: "#673AB7" },
+ {
+ icon: "/static/images/icon/shengchanbaogong@2x.png",
+ label: "鐢熶骇鎶ュ伐",
+ bgColor: "#673AB7",
+ },
];
const filteredProduction = originalProduction.filter(item => {
return allowedMenuTitles.has(item.label);
@@ -994,9 +1038,28 @@
});
equipmentItems.splice(0, equipmentItems.length, ...filteredEquipment);
- console.log("杩囨护鍚� - 钀ラ攢绠$悊:", marketingItems.length, "閲囪喘绠$悊:", purchaseItems.length, "鍗忓悓鍔炲叕:", collaborationItems.length);
- console.log("杩囨护鍚� - 瀹夊叏鐢熶骇:", safetyItems.length, "浜哄姏璧勬簮:", humanResourcesItems.length, "鐢熶骇绠℃帶:", productionItems.length, "璁惧绠$悊:", equipmentItems.length);
- console.log("鐢熶骇绠℃帶鑿滃崟椤�:", productionItems.map(item => item.label));
+ console.log(
+ "杩囨护鍚� - 钀ラ攢绠$悊:",
+ marketingItems.length,
+ "閲囪喘绠$悊:",
+ purchaseItems.length,
+ "鍗忓悓鍔炲叕:",
+ collaborationItems.length
+ );
+ console.log(
+ "杩囨护鍚� - 瀹夊叏鐢熶骇:",
+ safetyItems.length,
+ "浜哄姏璧勬簮:",
+ humanResourcesItems.length,
+ "鐢熶骇绠℃帶:",
+ productionItems.length,
+ "璁惧绠$悊:",
+ equipmentItems.length
+ );
+ console.log(
+ "鐢熶骇绠℃帶鑿滃崟椤�:",
+ productionItems.map(item => item.label)
+ );
};
// 妫�鏌ユā鍧楁槸鍚︽湁鑿滃崟椤归渶瑕佹樉绀�
@@ -1011,11 +1074,14 @@
onMounted(() => {
// 姣忔杩涘叆棣栭〉閮藉己鍒跺埛鏂扮敤鎴蜂俊鎭拰璺敱鏉冮檺锛屼笉鍋氭湰鍦扮紦瀛樺垽鏂�
userStore.getInfo().then(() => {
- userStore.getRouters().then(() => {
- filterMenuItemsByRoutes();
- }).catch(error => {
- console.error("鑾峰彇璺敱鏉冮檺澶辫触:", error);
- });
+ userStore
+ .getRouters()
+ .then(() => {
+ filterMenuItemsByRoutes();
+ })
+ .catch(error => {
+ console.error("鑾峰彇璺敱鏉冮檺澶辫触:", error);
+ });
});
getUserLoginFacotryList();
// 鍚姩閫氱煡鐘舵�佸畾鏃跺櫒
diff --git a/src/pages/safeProduction/emergencyPlanReview/index.vue b/src/pages/safeProduction/emergencyPlanReview/index.vue
index f575002..3b7df20 100644
--- a/src/pages/safeProduction/emergencyPlanReview/index.vue
+++ b/src/pages/safeProduction/emergencyPlanReview/index.vue
@@ -1,7 +1,7 @@
<template>
<view class="emergency-plan-review">
<!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
- <PageHeader title="搴旀�ラ妗堝鏍�"
+ <PageHeader title="搴旀�ラ妗堟煡闃�"
@back="goBack" />
<!-- 鎼滅储鍜岀瓫閫夊尯鍩� -->
<view class="search-section">
--
Gitblit v1.9.3