From d01295c254063b3349a86a4474e04a62b284bd19 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 24 三月 2026 16:26:07 +0800
Subject: [PATCH] 一些配置

---
 Code/WCS/WIDESEAWCS_Client/src/views/Index.vue |   92 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 74 insertions(+), 18 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Client/src/views/Index.vue b/Code/WCS/WIDESEAWCS_Client/src/views/Index.vue
index 553d045..94e55a7 100644
--- a/Code/WCS/WIDESEAWCS_Client/src/views/Index.vue
+++ b/Code/WCS/WIDESEAWCS_Client/src/views/Index.vue
@@ -151,7 +151,7 @@
       otherTabs: true,
       menuLeft: 0,
       menuTop: 0,
-      //  contextMenuVisible: false, // 鍙抽敭鍏抽棴鏄�/闅�
+      //  contextMenuVisible: false, // 鍙抽敭鍏抽棴鏄惁鍙
     };
   },
   setup(props, context) {
@@ -178,21 +178,21 @@
     ]);
     const links = ref([
       // {
-      //   text: "妗嗘灦瑙嗛",
+      //   text: "妗嗘灦瑙嗛鏁欑▼",
       //   path: "https://www.cctalk.com/m/group/90268531",
       //   id: -3,
       // },
-      // { text: "澶у睆鏁版嵁", path: "/bigdata", id: -3 },
+      // { text: "澶ф暟鎹�", path: "/bigdata", id: -3 },
       // {
       //   text: "妗嗘灦鏂囨。",
       //   path: "http://v2.volcore.xyz/document/guide",
       //   id: -2,
       // },   {
-      //   text: "妗嗘灦浼佷笟鐗�",
+      //   text: "妗嗘灦浜у搧",
       //   path: "http://pro.volcore.xyz/",
       //   id: 10,
       // },
-      { text: "涓汉涓績", path: "/UserInfo", id: -1, icon: "el-icon-s-custom" },
+      { text: "涓汉淇℃伅", path: "/UserInfo", id: -1, icon: "el-icon-s-custom" },
       {
         text: "瀹夊叏閫�鍑�",
         path: "/login",
@@ -274,11 +274,11 @@
         navigation.push({
           //  orderNo: String(navigation.length),// 搴忓彿
           id: item.id + "",
-          name: item.name || item.text || "鏃犳爣棰�",
+          name: item.name || item.text || "鏃犳爣绛�",
           path: item.path,
           query: item.query, //2021.03.20淇鑷畾涔変簩娆℃墦寮�$tabs鏃跺弬鏁颁涪澶辩殑闂
         });
-        //鏂版墦寮�鐨則ab绉昏嚦鏈�鍚庝竴涓�夐」
+        //鏂板缓鎵撳紑鐨則ab閫変腑鍒版渶鍚庝竴涓�夐」
         selectId.value = navigation.length - 1 + "";
       } else {
         selectId.value = _index + "";
@@ -290,7 +290,7 @@
         // this.$router.push(item);
       }
       currentMenuId.value = item.id * 1;
-      // tab鑿滃崟缁戝畾鍙抽敭浜嬩欢
+      // tab鍙抽敭鑿滃崟缁戝畾鐐瑰嚮浜嬩欢
       proxy.$nextTick(function (e) {
         proxy.bindRightClickMenu(true);
       });
@@ -399,7 +399,7 @@
         visibleItem.right = selectMenuIndex.value != navigation.length - 1;
         //鍙湁涓や釜鑿滃崟鏃朵笉鏄剧ず鍏抽棴宸﹁竟
         visibleItem.left = navigation.length != 2;
-        //鍙湁涓や釜鑿滃崟鏃朵笉鏄剧ず鍏抽棴鍏朵粬
+        //鍙湁涓や釜鑿滃崟鏃朵笉鏄剧ず鍏抽棴鍏朵粬鑿滃崟
         visibleItem.other = navigation.length != 2;
       }
       contextMenuVisible.value = true;
@@ -422,7 +422,7 @@
       });
     };
     /**
-     * 鍏抽棴鍏跺畠鏍囩椤�
+     * 鍏抽棴鍏朵粬鏍囩椤�
      * @param {*} par 鍏抽棴绫诲瀷(left,right,other)
      */
     const closeTabs = (value) => {
@@ -457,7 +457,7 @@
           break;
         }
         default: {
-          //鍏抽棴鎵�鏈�
+          //鍏抽棴鎵�鏈夋爣绛�
           navigation.splice(1, navigation.length);
           toHome();
           break;
@@ -473,7 +473,7 @@
     watch(
       () => contextMenuVisible.value,
       (newVal, oldVal) => {
-        // 鐩戣
+        // 鐩戣 contextMenuVisible 鐨勫彉鍖栵紝娣诲姞鎴栫Щ闄ょ偣鍑讳簨浠剁洃鍚櫒
         if (newVal) {
           document.body.addEventListener("click", closeTabsMenu);
         } else {
@@ -485,6 +485,61 @@
     /**
      * 绯荤粺鍒涘缓寮�濮�
      */
+    /**
+     * 鏂规硶鐩殑锛氳ˉ榻愬悗绔彍鍗曟湭閰嶇疆鏃剁殑鏂伴〉闈㈠叆鍙o紝閬垮厤鏂板椤甸潰鏃犲叆鍙c��
+     * 鍙傛暟鍚箟锛歞ata 涓哄悗绔繑鍥炵殑鑿滃崟鏁扮粍銆�
+     * 杩斿洖鍊硷細杩斿洖琛ラ綈鍚庣殑鑿滃崟鏁扮粍銆�
+     * 鍏抽敭閫昏緫锛氫粎鍦ㄨ彍鍗曚腑涓嶅瓨鍦ㄧ浉鍚� url 鏃惰拷鍔犻粯璁よ彍鍗曪紝閬垮厤瑕嗙洊宸叉湁閰嶇疆銆�
+     * 寮傚父澶勭悊锛氳鏂规硶浠呮搷浣滃唴瀛樻暟鎹紝涓嶆秹鍙婂閮ㄨ皟鐢紝寮傚父鐢变笂灞傛祦绋嬬粺涓�鎹曡幏銆�
+     */
+    const ensureBuiltinMenus = (data) => {
+      const menus = Array.isArray(data) ? data : [];
+      const exists = (url) => menus.some((m) => (m.url || "") === url);
+      const maxId = menus.reduce((max, item) => {
+        const current = Number(item.id);
+        return Number.isFinite(current) ? Math.max(max, current) : max;
+      }, 0);
+
+      const defaultMenus = [
+        {
+          id: maxId + 1001,
+          name: "绉熸埛绠$悊",
+          url: "/Sys_Tenant",
+          parentId: 0,
+          icon: "el-icon-office-building",
+          enable: 1,
+          tableName: "Sys_Tenant",
+          permission: ["Search", "Add", "Update", "Delete"],
+        },
+        {
+          id: maxId + 1002,
+          name: "浠诲姟鍘嗗彶",
+          url: "/taskHty",
+          parentId: 0,
+          icon: "el-icon-time",
+          enable: 1,
+          tableName: "taskHty",
+          permission: ["Search", "Export"],
+        },
+        {
+          id: maxId + 1003,
+          name: "璋冨害鎺у埗",
+          url: "/scheduler",
+          parentId: 0,
+          icon: "el-icon-video-play",
+          enable: 1,
+          tableName: "scheduler",
+          permission: ["Search", "Update"],
+        },
+      ];
+
+      defaultMenus.forEach((menu) => {
+        if (!exists(menu.url)) {
+          menus.push(menu);
+        }
+      });
+      return menus;
+    };
     const created = () => {
       let _theme = localStorage.getItem("vol3_theme");
       if (_theme) {
@@ -501,6 +556,7 @@
       Object.assign(_config.$tabs, { open: open, close: close });
 
       http.get("api/Sys_Menu/getTreeMenu", {}, true).then((data) => {
+        data = ensureBuiltinMenus(data);
         data.push({ id: "1", name: "棣栭〉", url: "/home" }); // 涓轰簡鑾峰彇閫変腑id浣跨敤
         data.forEach((d) => {
           d.path = (d.url || "").replace("/Manager", "");
@@ -513,7 +569,7 @@
         menuOptions.value = data;
         permissionInited.value = true;
 
-        //寮�鍚秷鎭帹閫侊紙main.js涓缃槸鍚﹀紑鍚痵ignalR锛�2022.05.05
+         //寮�鍚秷鎭帹閫侊紙main.js涓缃槸鍚﹀紑鍚痵ignalR锛�2022.05.05
         if (_config.$global.signalR) {
           MessageConfig(http, (result) => {
             messageList.unshift(result);
@@ -532,7 +588,7 @@
           item = links.value.find((x) => {
             return x.path == router.currentRoute.value.path; //this.$route.path;
           });
-          //鏌ユ壘鏈�鍚庝竴娆¤烦杞殑椤甸潰
+          //鏌ユ壘鏈�鍚庤闂殑椤甸潰
           if (!item) {
             item = getItem();
           }
@@ -579,7 +635,7 @@
     };
   },
   /**
-   * 鎸傝浇閽╁瓙鍑芥暟
+   * 鎸傝浇瀹屾垚鍚庢墽琛岀殑鍑芥暟
    */
   mounted() {
     let _date = showTime();
@@ -594,9 +650,9 @@
 
   methods: {
     /**
-     * 缁戝畾鍙抽敭浜嬩欢
-     * @param {*} enable 鏄惁鍚敤鍙抽敭浜嬩欢[true:鍚敤;false:绂佺敤;]
-     * @param {*} $event 浜嬩欢
+     * 缁戝畾鍙抽敭鑿滃崟浜嬩欢
+     * @param {*} enable 鏄惁鍚敤鍙抽敭鑿滃崟浜嬩欢[true:鍚敤;false:绂佺敤;]
+     * @param {*} $event 浜嬩欢瀵硅薄
      */
     bindRightClickMenu(enable) {
       if (!enable) return;

--
Gitblit v1.9.3