From 8d4a66c31aa0f6418403ade8a780f27c9fa9d921 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 10 二月 2026 17:43:30 +0800
Subject: [PATCH] 消息列表
---
src/pages/index.vue | 165 ++++++++++++++++++++++++++++++++----------------------
1 files changed, 98 insertions(+), 67 deletions(-)
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 81a0c94..1b20903 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,39 +676,44 @@
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",
});
break;
case "鎵撳崱绛惧埌":
uni.navigateTo({
- url: "/pages/attendance/checkin",
+ url: "/pages/humanResources/attendance/checkin",
+ });
+ break;
+ case "浜哄憳钖祫":
+ uni.navigateTo({
+ url: "/pages/humanResources/monthlyStatistics/index",
});
break;
default:
@@ -806,8 +818,6 @@
return;
}
}
-
- console.log(orderRow, "orderRow======@@@@@@@@");
// 鎵爜鎴愬姛鍚庤烦杞埌鐢熶骇鎶ュ伐椤甸潰锛屽苟浼犻�抩rderRow鍙傛暟
uni.navigateTo({
url: `/pages/productionManagement/productionReport/index?orderRow=${orderRow}`,
@@ -843,13 +853,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",
});
@@ -865,16 +878,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 => {
// 鏀堕泦褰撳墠璺敱鐨勬爣棰�
@@ -888,10 +901,6 @@
});
};
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);
// 杩囨护钀ラ攢绠$悊鑿滃崟
const originalMarketing = [
@@ -926,7 +935,11 @@
}
return matched;
});
- collaborationItems.splice(0, collaborationItems.length, ...filteredCollaboration);
+ collaborationItems.splice(
+ 0,
+ collaborationItems.length,
+ ...filteredCollaboration
+ );
// 杩囨护閲囪喘绠$悊鑿滃崟
const originalPurchase = [
@@ -935,7 +948,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);
@@ -944,14 +960,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);
@@ -966,11 +985,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);
@@ -988,10 +1015,6 @@
return allowedMenuTitles.has(item.label);
});
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));
};
// 妫�鏌ユā鍧楁槸鍚︽湁鑿滃崟椤归渶瑕佹樉绀�
@@ -1006,11 +1029,14 @@
onMounted(() => {
// 姣忔杩涘叆棣栭〉閮藉己鍒跺埛鏂扮敤鎴蜂俊鎭拰璺敱鏉冮檺锛屼笉鍋氭湰鍦扮紦瀛樺垽鏂�
userStore.getInfo().then(() => {
- userStore.getRouters().then(() => {
- filterMenuItemsByRoutes();
- }).catch(error => {
- console.error("鑾峰彇璺敱鏉冮檺澶辫触:", error);
- });
+ userStore
+ .getRouters()
+ .then(() => {
+ filterMenuItemsByRoutes();
+ })
+ .catch(error => {
+ console.error("鑾峰彇璺敱鏉冮檺澶辫触:", error);
+ });
});
getUserLoginFacotryList();
// 鍚姩閫氱煡鐘舵�佸畾鏃跺櫒
@@ -1023,7 +1049,7 @@
.content {
background: #f6f7fb;
min-height: 100vh;
- padding: 12px;
+ // padding: 12px;
/* 涓烘墍鏈夎澶囪缃熀纭�padding-top锛堝寘鍚畨鍏ㄥ尯锛� */
padding-top: calc(env(safe-area-inset-top) + 30px);
position: relative;
@@ -1097,6 +1123,7 @@
}
.hero-section {
+ margin: 0 12px;
margin-bottom: 12px;
animation: fadeInUp 0.6s ease-out 0.1s both;
}
@@ -1149,7 +1176,9 @@
.hero-content {
position: relative;
z-index: 1;
+
padding: 14px 14px 18px 14px;
+ margin: 0 12px;
height: 100%;
}
.hero-wave {
@@ -1325,7 +1354,7 @@
.common-module {
margin-bottom: 12px;
background: linear-gradient(135deg, #ffffff 0%, #f9fbff 100%);
- border-radius: 14px;
+ // border-radius: 14px;
padding: 12px;
box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
border: none;
@@ -1603,8 +1632,9 @@
.common-module {
margin-bottom: 12px;
background: #ffffff;
- border-radius: 16px;
- padding: 12px;
+ // border-radius: 16px;
+ // padding: 0px;
+ padding: 12px 0;
box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
border: 1px solid rgba(148, 163, 184, 0.18);
position: relative;
@@ -1653,7 +1683,8 @@
}
.module-header {
- margin-bottom: 10px;
+ margin-bottom: 18px;
+ padding-left: 18px;
display: flex;
align-items: center;
justify-content: space-between;
@@ -1678,8 +1709,8 @@
}
.icon-container {
- width: 52px;
- height: 52px;
+ width: 48px;
+ height: 48px;
border-radius: 14px;
display: flex;
align-items: center;
@@ -1726,9 +1757,9 @@
}
.item-label {
- font-size: 12px;
+ font-size: 22rpx;
margin-top: 4px;
- margin-bottom: 6px;
+ margin-bottom: 20px;
}
.grid-text {
font-size: 0.875rem;
--
Gitblit v1.9.3