From 5e851678cc02257bbbd179446de36082430ca5bc Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 13 四月 2026 15:12:04 +0800
Subject: [PATCH] feat(MES): 添加Mes_Log扩展逻辑

---
 Code/WMS/WIDESEA_WMSClient/src/components/MesLogStatistics.vue |  128 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 128 insertions(+), 0 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSClient/src/components/MesLogStatistics.vue b/Code/WMS/WIDESEA_WMSClient/src/components/MesLogStatistics.vue
new file mode 100644
index 0000000..e0cf815
--- /dev/null
+++ b/Code/WMS/WIDESEA_WMSClient/src/components/MesLogStatistics.vue
@@ -0,0 +1,128 @@
+<template>
+  <div class="mes-log-statistics">
+    <el-row :gutter="16">
+      <el-col :span="6">
+        <el-card shadow="hover" class="stat-card stat-primary">
+          <div class="stat-content">
+            <div class="stat-label">鎬昏皟鐢ㄦ鏁�</div>
+            <div class="stat-value">{{ statistics.totalCount }}</div>
+            <div class="stat-unit">娆�</div>
+          </div>
+        </el-card>
+      </el-col>
+      <el-col :span="6">
+        <el-card shadow="hover" class="stat-card" :class="statistics.successRate >= 90 ? 'stat-success' : 'stat-warning'">
+          <div class="stat-content">
+            <div class="stat-label">鎴愬姛鐜�</div>
+            <div class="stat-value">{{ statistics.successRate }}%</div>
+            <div class="stat-sub">
+              鎴愬姛: {{ statistics.successCount }} / 澶辫触: {{ statistics.failedCount }}
+            </div>
+          </div>
+        </el-card>
+      </el-col>
+      <el-col :span="6">
+        <el-card shadow="hover" class="stat-card stat-info">
+          <div class="stat-content">
+            <div class="stat-label">骞冲潎鑰楁椂</div>
+            <div class="stat-value">{{ Math.round(statistics.avgElapsedMs) }}</div>
+            <div class="stat-unit">ms</div>
+          </div>
+        </el-card>
+      </el-col>
+      <el-col :span="6">
+        <el-card shadow="hover" class="stat-card stat-secondary">
+          <div class="stat-content">
+            <div class="stat-label">浠婃棩璋冪敤</div>
+            <div class="stat-value">{{ statistics.todayCount }}</div>
+            <div class="stat-unit">娆�</div>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { ref, onMounted } from "vue";
+import http from "@/api/http.js";
+
+export default {
+  name: "MesLogStatistics",
+  emits: ["refresh"],
+  setup(props, { emit }) {
+    const statistics = ref({
+      totalCount: 0,
+      successCount: 0,
+      failedCount: 0,
+      successRate: 0,
+      avgElapsedMs: 0,
+      todayCount: 0
+    });
+
+    const fetchStatistics = async () => {
+      try {
+        const res = await http.get("/api/MesLog/statistics");
+        if (res.status) {
+          statistics.value = res.data;
+          emit("refresh");
+        }
+      } catch (error) {
+        console.error("鑾峰彇缁熻鏁版嵁澶辫触:", error);
+      }
+    };
+
+    onMounted(() => {
+      fetchStatistics();
+    });
+
+    return {
+      statistics,
+      fetchStatistics
+    };
+  }
+};
+</script>
+
+<style scoped>
+.mes-log-statistics {
+  margin-bottom: 16px;
+}
+
+.stat-card {
+  text-align: center;
+}
+
+.stat-content {
+  padding: 8px 0;
+}
+
+.stat-label {
+  font-size: 14px;
+  color: #909399;
+  margin-bottom: 8px;
+}
+
+.stat-value {
+  font-size: 28px;
+  font-weight: bold;
+  margin-bottom: 4px;
+}
+
+.stat-unit {
+  font-size: 12px;
+  color: #909399;
+}
+
+.stat-sub {
+  font-size: 12px;
+  color: #606266;
+  margin-top: 4px;
+}
+
+.stat-primary .stat-value { color: #409EFF; }
+.stat-success .stat-value { color: #67C23A; }
+.stat-warning .stat-value { color: #E6A23C; }
+.stat-info .stat-value { color: #909399; }
+.stat-secondary .stat-value { color: #909399; }
+</style>

--
Gitblit v1.9.3