From e7d45b61ad438bb96c0d0d7f17923f024a1e6aaf Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 18 三月 2026 14:05:29 +0800
Subject: [PATCH] 进销存升级app 1.工作台图标替换

---
 src/pages/works.vue |  227 +++++++++++---------------------------------------------
 1 files changed, 45 insertions(+), 182 deletions(-)

diff --git a/src/pages/works.vue b/src/pages/works.vue
index a9b6939..333eaf5 100644
--- a/src/pages/works.vue
+++ b/src/pages/works.vue
@@ -1,42 +1,5 @@
 <template>
   <view class="content">
-    <!--    <view class="header-section">-->
-    <!--      <view class="currentFactory">-->
-    <!--        <up-text type="primary"-->
-    <!--                 :text="userStore.currentFactoryName"-->
-    <!--                 @click="show = true"-->
-    <!--                 size="18"-->
-    <!--                 class="factoryName"-->
-    <!--                 suffixIcon="arrow-right"-->
-    <!--                 :iconStyle="iconStyle"></up-text>-->
-    <!--      </view>-->
-    <!--      <up-picker :show="show"-->
-    <!--                 :columns="factoryList"-->
-    <!--                 @confirm="changeFactory"-->
-    <!--                 @cancel="show = false"></up-picker>-->
-    <!--    </view>-->
-<!--    <view class="hero-section">-->
-<!--      <view class="bg-img">-->
-<!--        <view class="hero-content">-->
-<!--          &lt;!&ndash; 棰勭暀锛氬鍚庣画闇�瑕佸彲鍦ㄦ鏀� logo 鎴栫畝鐭彁绀� &ndash;&gt;-->
-<!--        </view>-->
-<!--        <view class="hero-wave"></view>-->
-<!--      </view>-->
-<!--    </view>-->
-    <!--		<view class="notice-section">-->
-    <!--			<view class="notice">-->
-    <!--				<view class="notice-content">-->
-    <!--					<view class="notice-left">-->
-    <!--						<text class="notice-status">閫氱煡</text>-->
-    <!--					</view>-->
-    <!--					<view class="notice-separator"></view>-->
-    <!--					<view class="notice-right">-->
-    <!--						<text class="notice-label">{{currentStatus}}</text>-->
-    <!--						<text class="notice-text">褰撴棩閿�鍞澶囨暟:<text class="notice-number">{{number}}<text class="notice-unit">涓�</text></text></text>-->
-    <!--					</view>-->
-    <!--				</view>-->
-    <!--			</view>-->
-    <!--		</view>-->
     <!-- 钀ラ攢绠$悊妯″潡 -->
     <view class="common-module marketing-module"
           v-if="hasMarketingItems">
@@ -289,7 +252,7 @@
       label: "鏉ョエ鍙拌处",
     },
     {
-      icon: "/static/images/icon/fukuanjingji.svg",
+      icon: "/static/images/icon/fukuandengji.svg",
       label: "浠樻鐧昏",
     },
     {
@@ -331,66 +294,66 @@
   ]);
   const safetyItems = reactive([
     {
-      icon: "/static/images/icon/caigoutaizhang.svg",
+      icon: "/static/images/icon/guichengzizhi.svg",
       label: "瑙勭▼涓庤祫璐�",
     },
     {
-      icon: "/static/images/icon/caigoutaizhang.svg",
+      icon: "/static/images/icon/weixianyuan.svg",
       label: "鍗遍櫓婧愬彴璐�",
     },
     {
-      icon: "/static/images/icon/caigoutaizhang.svg",
+      icon: "/static/images/icon/weixianzuoye.svg",
       label: "鍗遍櫓浣滀笟瀹℃壒",
     },
     {
-      icon: "/static/images/icon/guzhangfenxi@2x.svg",
+      icon: "/static/images/icon/yinhuanpaicha.svg",
       label: "闅愭偅鎺掓煡涓婃姤",
     },
     {
-      icon: "/static/images/icon/guzhangfenxi@2x.svg",
+      icon: "/static/images/icon/weixianwuliao.svg",
       label: "鍗遍櫓鐗╂枡绠℃帶",
     },
     {
-      icon: "/static/images/icon/guzhangfenxi@2x.svg",
+      icon: "/static/images/icon/yingjiyuan.svg",
       label: "搴旀�ラ妗堟煡闃�",
     },
     {
-      icon: "/static/images/icon/guzhangfenxi@2x.svg",
+      icon: "/static/images/icon/shigushangbao.svg",
       label: "浜嬫晠涓婃姤璁板綍",
     },
     {
-      icon: "/static/images/icon/guzhangfenxi@2x.svg",
+      icon: "/static/images/icon/anquanpeixun.svg",
       label: "瀹夊叏鍩硅鑰冩牳",
     },
   ]);
   // 鍗忓悓鍔炲叕鍔熻兘鏁版嵁
   const collaborationItems = reactive([
     {
-      icon: "/static/images/icon/baoxiaoguanli.svg",
+      icon: "/static/images/icon/xietongshenpi.svg",
       label: "鍗忓悓瀹℃壒",
     },
     {
-      icon: "/static/images/icon/huiyiliebiao@2x.svg",
+      icon: "/static/images/icon/huiyiguanli.svg",
       label: "浼氳绠$悊",
     },
     {
-      icon: "/static/images/icon/tongzhigonggao@2x.svg",
+      icon: "/static/images/icon/tongzhigonggao.svg",
       label: "閫氱煡鍏憡",
     },
     {
-      icon: "/static/images/icon/zhishiku@2x.svg",
+      icon: "/static/images/icon/zhishiku.svg",
       label: "鐭ヨ瘑搴�",
     },
     {
-      icon: "/static/images/icon/yongyinguanli@2x.svg",
+      icon: "/static/images/icon/yongyinguanli.svg",
       label: "鐢ㄥ嵃绠$悊",
     },
     {
-      icon: "/static/images/icon/guizhangzhidu@2x.svg",
+      icon: "/static/images/icon/guizhangzhidu.svg",
       label: "瑙勭珷鍒跺害",
     },
     {
-      icon: "/static/images/icon/kehubaifang@2x.svg",
+      icon: "/static/images/icon/kehubaifang.svg",
       label: "瀹㈡埛鎷滆",
     },
   ]);
@@ -410,7 +373,7 @@
     //   label: "宸ュ簭鎺掍骇",
     // },
     {
-      icon: "/static/images/icon/shengchanbaogong@2x.svg",
+      icon: "/static/images/icon/shengchanbaogong.svg",
       label: "鐢熶骇鎶ュ伐",
     },
     // {
@@ -426,19 +389,19 @@
     // 	label: '璁惧鍙拌处',
     // },
     {
-      icon: "/static/images/icon/shbeibaoxiu@2x.svg",
+      icon: "/static/images/icon/yunxingguanli.svg",
       label: "杩愯绠$悊",
     },
     {
-      icon: "/static/images/icon/shbeibaoxiu@2x.svg",
+      icon: "/static/images/icon/shebeibaoxiu.svg",
       label: "璁惧鎶ヤ慨",
     },
     {
-      icon: "/static/images/icon/shbeibaoyang@2x.svg",
+      icon: "/static/images/icon/shebeibaoyang.svg",
       label: "璁惧淇濆吇",
     },
     {
-      icon: "/static/images/icon/xunjianshangchuan@2x.svg",
+      icon: "/static/images/icon/xunjianshangchuan.svg",
       label: "璁惧宸℃",
     },
   ]);
@@ -924,11 +887,9 @@
     const collectMenuTitles = routes => {
       if (!Array.isArray(routes)) return;
       routes.forEach(route => {
-        // 鏀堕泦褰撳墠璺敱鐨勬爣棰�
         if (route.meta && route.meta.title) {
           allowedMenuTitles.add(route.meta.title);
         }
-        // 閫掑綊澶勭悊瀛愯矾鐢�
         if (route.children && route.children.length > 0) {
           collectMenuTitles(route.children);
         }
@@ -936,130 +897,32 @@
     };
     collectMenuTitles(routers);
 
-    // 杩囨护钀ラ攢绠$悊鑿滃崟
-    const originalMarketing = [
-      { icon: "/static/images/icon/xiaoshoutaizhang.svg", label: "閿�鍞彴璐�" },
-      { icon: "/static/images/icon/kaipiaodengji.svg", label: "寮�绁ㄧ櫥璁�" },
-      { icon: "/static/images/icon/kaipiaotaizhang.svg", label: "寮�绁ㄥ彴璐�" },
-      { icon: "/static/images/icon/huikuandengji.svg", label: "鍥炴鐧昏" },
-      { icon: "/static/images/icon/huikuanliushui.svg", label: "鍥炴娴佹按" },
-      { icon: "/static/images/icon/kehuwanglai.svg", label: "瀹㈡埛寰�鏉�" },
-    ];
-    const filteredMarketing = originalMarketing.filter(item => {
-      return allowedMenuTitles.has(item.label);
-    });
-    marketingItems.splice(0, marketingItems.length, ...filteredMarketing);
+    // 瀹氫箟鑿滃崟閰嶇疆鏄犲皠
+    const menuMapping = {
+      collaboration: { target: collaborationItems, specialMapping: { "瑙勭珷鍒跺害": "瑙勭珷鍒跺害绠$悊" } },
+    };
 
-    // 杩囨护鍗忓悓鍔炲叕鑿滃崟
-    const originalCollaboration = [
-      { icon: "/static/images/icon/baoxiaoguanli.svg", label: "鍗忓悓瀹℃壒" },
-      { icon: "/static/images/icon/huiyiliebiao@2x.svg", label: "浼氳绠$悊" },
-      { icon: "/static/images/icon/tongzhigonggao@2x.svg", label: "閫氱煡鍏憡" },
-      { icon: "/static/images/icon/zhishiku@2x.svg", label: "鐭ヨ瘑搴�" },
-      { icon: "/static/images/icon/yongyinguanli@2x.svg", label: "鐢ㄥ嵃绠$悊" },
-      { icon: "/static/images/icon/guizhangzhidu@2x.svg", label: "瑙勭珷鍒跺害" },
-      { icon: "/static/images/icon/kehubaifang@2x.svg", label: "瀹㈡埛鎷滆" },
-    ];
-    const filteredCollaboration = originalCollaboration.filter(item => {
-      // 澶勭悊鏍囬涓嶅畬鍏ㄥ尮閰嶇殑鎯呭喌
-      let matched = allowedMenuTitles.has(item.label);
-      // 鐗规畩澶勭悊锛氳绔犲埗搴� -> 瑙勭珷鍒跺害绠$悊
-      if (!matched && item.label === "瑙勭珷鍒跺害") {
-        matched = allowedMenuTitles.has("瑙勭珷鍒跺害绠$悊");
-      }
-      return matched;
-    });
-    collaborationItems.splice(
-      0,
-      collaborationItems.length,
-      ...filteredCollaboration
-    );
+    // 閫氱敤杩囨护鍑芥暟
+    const filterArray = (targetArray, specialMapping) => {
+      const filtered = targetArray.filter(item => {
+        let matched = allowedMenuTitles.has(item.label);
+        if (specialMapping && !matched && specialMapping[item.label]) {
+          matched = allowedMenuTitles.has(specialMapping[item.label]);
+        }
+        return matched;
+      });
+      targetArray.splice(0, targetArray.length, ...filtered);
+    };
 
-    // 杩囨护閲囪喘绠$悊鑿滃崟
-    const originalPurchase = [
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "閲囪喘鍙拌处" },
-      { icon: "/static/images/icon/laipiaodengji.svg", label: "鏉ョエ鐧昏" },
-      { icon: "/static/images/icon/laipiaotaizhang.svg", label: "鏉ョエ鍙拌处" },
-      { icon: "/static/images/icon/fukuanjingji.svg", label: "浠樻鐧昏" },
-      { icon: "/static/images/icon/fukuanliushui.svg", label: "浠樻娴佹按" },
-      {
-        icon: "/static/images/icon/gongyingshangwanglai@2x.svg",
-        label: "渚涘簲鍟嗗線鏉�",
-      },
-    ];
-    const filteredPurchase = originalPurchase.filter(item => {
-      return allowedMenuTitles.has(item.label);
-    });
-    purchaseItems.splice(0, purchaseItems.length, ...filteredPurchase);
-
-    // 杩囨护瀹夊叏鐢熶骇鑿滃崟
-    const originalSafety = [
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "瑙勭▼涓庤祫璐�" },
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "鍗遍櫓婧愬彴璐�" },
-      {
-        icon: "/static/images/icon/caigoutaizhang.svg",
-        label: "鍗遍櫓浣滀笟瀹℃壒",
-      },
-      { icon: "/static/images/icon/guzhangfenxi@2x.svg", label: "闅愭偅鎺掓煡涓婃姤" },
-      { icon: "/static/images/icon/guzhangfenxi@2x.svg", label: "鍗遍櫓鐗╂枡绠℃帶" },
-      { icon: "/static/images/icon/guzhangfenxi@2x.svg", label: "搴旀�ラ妗堟煡闃�" },
-      { icon: "/static/images/icon/guzhangfenxi@2x.svg", label: "浜嬫晠涓婃姤璁板綍" },
-      { icon: "/static/images/icon/guzhangfenxi@2x.svg", label: "瀹夊叏鍩硅鑰冩牳" },
-    ];
-    const filteredSafety = originalSafety.filter(item => {
-      return allowedMenuTitles.has(item.label);
-    });
-    safetyItems.splice(0, safetyItems.length, ...filteredSafety);
-
-    // 杩囨护浜哄姏璧勬簮鑿滃崟
-    const originalHumanResources = [
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "鎵撳崱绛惧埌" },
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "浜哄憳钖祫" },
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "鍚堝悓绠$悊" },
-    ];
-    const filteredHumanResources = originalHumanResources.filter(item => {
-      return allowedMenuTitles.has(item.label);
-    });
-    humanResourcesItems.splice(
-      0,
-      humanResourcesItems.length,
-      ...filteredHumanResources
-    );
-
-    // 杩囨护璐ㄩ噺绠$悊鑿滃崟
-    const originalQuality = [
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "鍘熸潗鏂欐楠�" },
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "杩囩▼妫�楠�" },
-      { icon: "/static/images/icon/caigoutaizhang.svg", label: "鍑哄巶妫�楠�" },
-    ];
-    const filteredQuality = originalQuality.filter(item => {
-      return allowedMenuTitles.has(item.label);
-    });
-    qualityItems.splice(0, qualityItems.length, ...filteredQuality);
-
-    // 杩囨护鐢熶骇绠℃帶鑿滃崟
-    const originalProduction = [
-      {
-        icon: "/static/images/icon/shengchanbaogong@2x.svg",
-        label: "鐢熶骇鎶ュ伐",
-      },
-    ];
-    const filteredProduction = originalProduction.filter(item => {
-      return allowedMenuTitles.has(item.label);
-    });
-    productionItems.splice(0, productionItems.length, ...filteredProduction);
-
-    // 杩囨护璁惧绠$悊鑿滃崟
-    const originalEquipment = [
-      { icon: "/static/images/icon/shbeibaoxiu@2x.svg", label: "杩愯绠$悊" },
-      { icon: "/static/images/icon/shbeibaoxiu@2x.svg", label: "璁惧鎶ヤ慨" },
-      { icon: "/static/images/icon/shbeibaoyang@2x.svg", label: "璁惧淇濆吇" },
-      { icon: "/static/images/icon/xunjianshangchuan@2x.svg", label: "璁惧宸℃" },
-    ];
-    const filteredEquipment = originalEquipment.filter(item => {
-      return allowedMenuTitles.has(item.label);
-    });
-    equipmentItems.splice(0, equipmentItems.length, ...filteredEquipment);
+    // 杩囨护鍚勪釜妯″潡
+    filterArray(marketingItems);
+    filterArray(purchaseItems);
+    filterArray(collaborationItems, menuMapping.collaboration.specialMapping);
+    filterArray(safetyItems);
+    filterArray(humanResourcesItems);
+    filterArray(qualityItems);
+    filterArray(productionItems);
+    filterArray(equipmentItems);
   };
 
   // 妫�鏌ユā鍧楁槸鍚︽湁鑿滃崟椤归渶瑕佹樉绀�

--
Gitblit v1.9.3