From a7b61db74b00d7902c0e1b344a481f352b31876a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 20 五月 2026 13:22:33 +0800
Subject: [PATCH] 进销存pro 1.首页及登录页样式微调 2.添加系统架构图页面 3.优化头部搜索菜单栏功能 4.首页快捷功能跳转路由修改
---
src/views/index.vue | 96 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 82 insertions(+), 14 deletions(-)
diff --git a/src/views/index.vue b/src/views/index.vue
index f3e6db3..3b9182b 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -7,17 +7,13 @@
</el-avatar>
<div class="welcome-text">
<div class="welcome-title">
- 鏅氫笂濂斤紝{{ userStore.nickName || userStore.name || "瓒呯骇绠$悊鍛�" }} 馃憢
+ {{ greetingText }}锛寋{ userStore.nickName || userStore.name || "瓒呯骇绠$悊鍛�" }} 馃憢
</div>
<div class="welcome-subtitle">涓撴敞宸ヤ笟鏁板瓧鍖栵紝鍔╁姏鏅洪�犲崌绾�</div>
</div>
</div>
<div class="welcome-meta">
<div class="meta-time digital-number">{{ nowTime }}</div>
- <div class="meta-extra">
- <span class="meta-date">{{ nowDate }}</span>
- <span class="meta-weather">{{ weatherText }}</span>
- </div>
<div class="meta-tip">MES / MOM 鐢熶骇杩愯惀椹鹃┒鑸�</div>
</div>
</section>
@@ -355,6 +351,7 @@
UserFilled,
} from "@element-plus/icons-vue";
import Echarts from "@/components/Echarts/echarts.vue";
+import usePermissionStore from "@/store/modules/permission";
import useUserStore from "@/store/modules/user.js";
import {
analysisCustomerContractAmounts,
@@ -369,6 +366,7 @@
const router = useRouter();
const userStore = useUserStore();
+const permissionStore = usePermissionStore();
const defaultWelcomeAvatar = new URL("../assets/images/profile.jpg", import.meta.url).href;
const nowTime = ref("");
@@ -377,6 +375,16 @@
const weatherText = "澶氫簯 28掳C";
const nowDate = computed(() => (nowTime.value ? nowTime.value.slice(0, 10) : dayjs().format("YYYY-MM-DD")));
+
+const greetingText = computed(() => {
+ const hour = dayjs().hour();
+ if (hour < 6) return "鍑屾櫒濂�";
+ if (hour < 9) return "鏃╀笂濂�";
+ if (hour < 12) return "涓婂崍濂�";
+ if (hour < 14) return "涓崍濂�";
+ if (hour < 18) return "涓嬪崍濂�";
+ return "鏅氫笂濂�";
+});
const welcomeAvatar = computed(() =>
welcomeAvatarLoadFailed.value || !userStore.avatar ? defaultWelcomeAvatar : userStore.avatar
@@ -901,16 +909,74 @@
},
]);
-const quickEntries = [
- { label: "鐢熶骇鎺掍骇", icon: Calendar, path: "/productionManagement/productionDispatching" },
- { label: "宸ュ簭鎶ュ伐", icon: EditPen, path: "/productionManagement/productionReporting" },
- { label: "鐢熶骇璁㈠崟", icon: Tickets, path: "/productionManagement/productionOrder" },
- { label: "鐗╂枡榻愬", icon: Box, path: "/productionManagement/workOrderManagement" },
- { label: "璐ㄩ噺妫�楠�", icon: Checked, path: "/qualityManagement/processInspection" },
- { label: "璁惧绠$悊", icon: Tools, path: "/equipmentManagement/deviceInfo" },
- { label: "搴撳瓨鏌ヨ", icon: Search, path: "/inventoryManagement/stockManage" },
- { label: "鏁版嵁鎶ヨ〃", icon: DataAnalysis, path: "/reportAnalysis/reportManagement" },
+const quickEntryConfigs = [
+ { label: "涓荤敓浜ц鍒�", icon: Calendar, titles: ["涓荤敓浜ц鍒�"], fallbackPath: "/productionPlan/productionPlan" },
+ { label: "鐢熶骇璁㈠崟", icon: Tickets, titles: ["鐢熶骇璁㈠崟"], fallbackPath: "/productionManagement/productionOrder" },
+ { label: "鐢熶骇鎶ュ伐", icon: EditPen, titles: ["鐢熶骇鎶ュ伐"], fallbackPath: "/productionManagement/productionReporting" },
+ { label: "璁惧鍙拌处", icon: Tools, titles: ["璁惧鍙拌处"], fallbackPath: "/equipmentManagement/ledger" },
+ { label: "閿�鍞彴璐�", icon: DataLine, titles: ["閿�鍞彴璐�"], fallbackPath: "/salesManagement/salesLedger" },
+ { label: "閲囪喘鍙拌处", icon: ShoppingCartFull, titles: ["閲囪喘鍙拌处"], fallbackPath: "/procurementManagement/procurementLedger" },
+ { label: "鍛樺伐鍙拌处", icon: UserFilled, titles: ["鍛樺伐鍙拌处", "鍦ㄨ亴鍛樺伐鍙拌处"], fallbackPath: "/personnelManagement/employeeRecord" },
+ { label: "搴撳瓨绠$悊", icon: Box, titles: ["搴撳瓨绠$悊"], fallbackPath: "/inventoryManagement/stockManage" },
];
+
+const normalizeMenuTitle = (title) => String(title || "").replace(/\s+/g, "").trim();
+
+const resolveRoutePath = (route, parentPath = "") => {
+ const currentPath = String(route?.path || "").trim();
+ if (!currentPath) return parentPath || "";
+ if (/^(https?:)?\/\//.test(currentPath)) return currentPath;
+ if (currentPath.startsWith("/")) return currentPath;
+ const basePath = parentPath && parentPath !== "/" ? parentPath.replace(/\/$/, "") : "";
+ return `${basePath}/${currentPath}`.replace(/\/+/g, "/");
+};
+
+const collectAccessibleRoutes = (routes = [], parentPath = "") => {
+ const items = [];
+ (routes || []).forEach((route) => {
+ if (!route) return;
+ const fullPath = resolveRoutePath(route, parentPath);
+ const title = route.meta?.title ?? route.title ?? "";
+ if (title && fullPath && !String(route.redirect || "").includes("noRedirect")) {
+ items.push({
+ title: normalizeMenuTitle(title),
+ path: fullPath,
+ });
+ }
+ if (Array.isArray(route.children) && route.children.length > 0) {
+ items.push(...collectAccessibleRoutes(route.children, fullPath));
+ }
+ });
+ return items;
+};
+
+const accessibleMenuRoutes = computed(() => {
+ const routePool =
+ permissionStore.defaultRoutes?.length > 0
+ ? permissionStore.defaultRoutes
+ : permissionStore.sidebarRouters?.length > 0
+ ? permissionStore.sidebarRouters
+ : permissionStore.routes;
+ return collectAccessibleRoutes(routePool || []);
+});
+
+const quickEntries = computed(() =>
+ quickEntryConfigs
+ .map((item) => {
+ const targetRoute = accessibleMenuRoutes.value.find((route) =>
+ item.titles.some((title) => route.title === normalizeMenuTitle(title))
+ );
+ const resolvedPath = targetRoute?.path || "";
+ return resolvedPath
+ ? {
+ label: item.label,
+ icon: item.icon,
+ path: resolvedPath,
+ }
+ : null;
+ })
+ .filter(Boolean)
+);
const updateNowTime = () => {
nowTime.value = dayjs().format("YYYY-MM-DD HH:mm:ss");
@@ -1074,6 +1140,7 @@
};
const goToQuick = (path) => {
+ if (!path) return;
router.push(path).catch(() => {});
};
@@ -1107,6 +1174,7 @@
flex-direction: column;
gap: 16px;
overflow-x: clip;
+ margin-top: 10px;
}
.digital-number {
--
Gitblit v1.9.3