From d0953e3142fd2ed95438ed141d6be1748c0aa22e Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 01 四月 2026 17:34:36 +0800
Subject: [PATCH] 工艺路线已批准不可修改

---
 src/views/index.vue |  628 +++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 373 insertions(+), 255 deletions(-)

diff --git a/src/views/index.vue b/src/views/index.vue
index 03bda77..bd0d274 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -2,9 +2,9 @@
   <div class="home-page">
     <div class="top-bar">
       <div class="user-box">
-        <!-- <img :src="userStore.avatar"
+        <img :src="userStore.avatar"
              class="avatar"
-             alt="" /> -->
+             alt="" />
         <div>
           <div class="hello">{{ userStore.roleName || "绯荤粺绠$悊鍛�" }}锛屼綘濂�</div>
           <div class="sub">鐧诲綍鏃堕棿锛歿{ userStore.currentLoginTime }}</div>
@@ -16,9 +16,9 @@
                    type="primary"
                    plain
                    @click="refreshDashboardData">鍒锋柊鏁版嵁</el-button>
-        <el-button size="small"
+        <!-- <el-button size="small"
                    plain
-                   @click="configDialogVisible = true">棣栭〉閰嶇疆</el-button>
+                   @click="configDialogVisible = true">棣栭〉閰嶇疆</el-button> -->
       </div>
     </div>
     <div class="content-grid">
@@ -40,7 +40,7 @@
             </el-button>
           </div>
         </section>
-        <section class="section-card">
+        <!-- <section class="section-card">
           <div class="section-title">閲嶇偣寰呭姙</div>
           <div class="todo-row"
                v-for="todo in todos"
@@ -49,7 +49,7 @@
                     :type="todo.type">{{ todo.level }}</el-tag>
             <span>{{ todo.title }}</span>
           </div>
-        </section>
+        </section> -->
         <section class="section-card">
           <div class="section-title">缁忚惀鍏虫敞</div>
           <div class="focus-row"
@@ -61,33 +61,17 @@
         </section>
         <section class="section-card flex-fill-card">
           <div class="section-title-row">
-            <div class="section-title">浠婃棩寰呭鐞�</div>
+            <div class="section-title">浠婂勾閿�鍞噾棰濆垎鏋�</div>
             <el-radio-group v-model="pendingFilter"
                             size="small">
-              <el-radio-button label="all">鍏ㄩ儴</el-radio-button>
-              <el-radio-button label="mine">鎴戠殑</el-radio-button>
-              <el-radio-button label="high">楂樹紭鍏�</el-radio-button>
+              <el-radio-button label="mine">鏉挎潗</el-radio-button>
+              <el-radio-button label="high">鐮屽潡</el-radio-button>
             </el-radio-group>
           </div>
-          <div class="task-row"
-               v-for="task in filteredPendingTasks"
-               :key="task.id">
-            <div class="task-left">
-              <el-tag size="small"
-                      :type="task.type">{{ task.level }}</el-tag>
-              <span class="task-title">{{ task.title }}</span>
-            </div>
-            <el-button link
-                       type="primary"
-                       @click="goTo(task.path)">鍘诲鐞�</el-button>
-          </div>
-          <el-empty v-if="filteredPendingTasks.length === 0"
-                    description="鏆傛棤寰呭鐞嗕簨椤�"
-                    :image-size="80" />
         </section>
       </div>
       <div class="right-col">
-        <section class="section-card"
+        <!-- <section class="section-card"
                  v-if="isSectionVisible('trendCards')">
           <div class="section-title">鏈�杩�7澶╁叧閿寚鏍囪秼鍔�</div>
           <div class="trend-cards">
@@ -111,7 +95,7 @@
               </div>
             </div>
           </div>
-        </section>
+        </section> -->
         <section class="section-card"
                  v-if="isSectionVisible('planTrend')">
           <div class="section-title-row">
@@ -137,35 +121,25 @@
              v-if="isSectionVisible('qualityChart') || isSectionVisible('costChart')">
           <section class="section-card"
                    v-if="isSectionVisible('qualityChart')">
-            <div class="section-title-row">
-              <div class="section-title">璐ㄦ寮傚父鍒嗗竷</div>
-              <el-radio-group v-model="chartRangeQuality"
-                              size="small"
-                              @change="loadQualityData">
-                <el-radio-button :label="1">鍛�</el-radio-button>
-                <el-radio-button :label="2">鏈�</el-radio-button>
-                <el-radio-button :label="3">瀛e害</el-radio-button>
-              </el-radio-group>
-            </div>
+            <div class="section-title">浠婂勾鑳借�楃敤閲忚秼鍔�</div>
             <Echarts :chartStyle="chartStyle"
                      :grid="grid"
                      :tooltip="barTooltip"
-                     :xAxis="qualityXAxis"
+                     :xAxis="energyConsumptionXAxis"
                      :yAxis="valueYAxis"
-                     :series="qualitySeries"
+                     :series="energyConsumptionSeries"
                      style="height: 260px" />
           </section>
           <section class="section-card"
                    v-if="isSectionVisible('costChart')">
-            <div class="section-title">鑳借�椾笌鎴愭湰缁撴瀯</div>
+            <div class="section-title">浠婂勾鑳借�楃被鍨嬪崰姣�</div>
             <Echarts :chartStyle="chartStyle"
-                     :legend="costLegend"
                      :tooltip="pieTooltip"
-                     :series="costSeries"
+                     :series="energyTypeSeries"
                      style="height: 260px" />
           </section>
         </div>
-        <section class="section-card"
+        <!-- <section class="section-card"
                  v-if="isSectionVisible('warningCenter')">
           <div class="section-title">寮傚父棰勮涓績</div>
           <div class="warning-row"
@@ -183,7 +157,7 @@
           <el-empty v-if="warningList.length === 0"
                     description="鏆傛棤寮傚父棰勮"
                     :image-size="80" />
-        </section>
+        </section> -->
         <section class="section-card mini-table-wrap"
                  v-if="isSectionVisible('planTable')">
           <div class="section-title">鐢熶骇璁″垝鎵ц鏄庣粏</div>
@@ -299,6 +273,7 @@
     qualityInspectionStatistics,
     nonComplianceWarning,
   } from "@/api/viewIndex.js";
+  import { energyConsumptionDetailStatistics } from "@/api/energyManagement/energyType";
 
   const router = useRouter();
   const userStore = useUserStore();
@@ -543,6 +518,150 @@
     },
   ]);
 
+  // 鑳借�楃被鍨嬪崰姣旀暟鎹�
+  const energyTypeSeries = reactive([
+    {
+      type: "pie",
+      radius: ["40%", "70%"],
+      center: ["50%", "50%"],
+      avoidLabelOverlap: false,
+      itemStyle: {
+        borderRadius: 10,
+        borderColor: "#fff",
+        borderWidth: 2,
+      },
+      label: {
+        show: true,
+        formatter: "{b}: {d}%",
+      },
+      data: [
+        { value: 0, name: "姘�", itemStyle: { color: "#409EFF" } },
+        { value: 0, name: "鐢�", itemStyle: { color: "#E6A23C" } },
+        { value: 0, name: "姘�", itemStyle: { color: "#F56C6C" } },
+      ],
+    },
+  ]);
+
+  // 鑳借�楃敤閲忚秼鍔垮浘琛�
+  const energyConsumptionXAxis = reactive({
+    type: "category",
+    data: [],
+    axisLabel: {
+      rotate: 45,
+    },
+  });
+
+  const energyConsumptionSeries = reactive([
+    {
+      name: "鐢ㄦ按閲�",
+      type: "bar",
+      data: [],
+      itemStyle: { color: "#409EFF" },
+    },
+    {
+      name: "鐢ㄧ數閲�",
+      type: "bar",
+      data: [],
+      itemStyle: { color: "#E6A23C" },
+    },
+    {
+      name: "鐢ㄦ皵閲�",
+      type: "bar",
+      data: [],
+      itemStyle: { color: "#67C23A" },
+    },
+  ]);
+
+  // 妯℃嫙鑳借�楁暟鎹�
+  const energyData = reactive({
+    water: 120,
+    electricity: 350,
+    gas: 80,
+  });
+
+  // 鏇存柊鑳借�楃被鍨嬪崰姣斿浘琛ㄥ拰鑳借�楃敤閲忚秼鍔垮浘琛�
+  const updateEnergyTypeChart = () => {
+    // 鏋勫缓鍙傛暟锛氫粖骞寸殑骞村垵鍒板勾鏈互鍙婂ぉ鏁�
+    const currentYear = new Date().getFullYear();
+    const params = {
+      startDate: `${currentYear}-01-01`,
+      endDate: `${currentYear}-12-31`,
+      days: 365,
+      state: "骞�",
+    };
+
+    // 璋冪敤鎺ュ彛鑾峰彇鏁版嵁
+    energyConsumptionDetailStatistics(params)
+      .then(res => {
+        if (res.code === 200) {
+          const data = res.data;
+          // 澶勭悊鑳借�楃被鍨嬪崰姣旀暟鎹�
+          const energyTypeData = data.energyCostDtos || [];
+
+          // 璁$畻鍚勮兘鑰楃被鍨嬬殑鎬绘秷鑰楅噺
+          let total = 0;
+          const typeMap = {
+            姘�: 0,
+            鐢�: 0,
+            姘�: 0,
+          };
+
+          // 鍑嗗鑳借�楃敤閲忚秼鍔垮浘琛ㄦ暟鎹�
+          const dates = [];
+          const waterConsumptionData = [];
+          const electricityConsumptionData = [];
+          const gasConsumptionData = [];
+
+          energyTypeData.forEach(item => {
+            // 鏀堕泦鏃ユ湡鍜屽悇鑳借�楃被鍨嬫暟鎹�
+            if (item.meterReadingDate) {
+              dates.push(item.meterReadingDate);
+              waterConsumptionData.push(item.waterConsumption || 0);
+              electricityConsumptionData.push(item.electricityConsumption || 0);
+              gasConsumptionData.push(item.gasConsumption || 0);
+            }
+
+            // 璁$畻鎬绘秷鑰楅噺
+            if (item.waterConsumption)
+              typeMap.姘� += Number(item.waterConsumption);
+            if (item.electricityConsumption)
+              typeMap.鐢� += Number(item.electricityConsumption);
+            if (item.gasConsumption) typeMap.姘� += Number(item.gasConsumption);
+          });
+
+          total = typeMap.姘� + typeMap.鐢� + typeMap.姘�;
+
+          // 鏇存柊鑳借�楃被鍨嬪崰姣斿浘琛ㄦ暟鎹�
+          energyTypeSeries[0].data = [
+            {
+              value: total > 0 ? ((typeMap.姘� / total) * 100).toFixed(2) : 0,
+              name: "姘�",
+              itemStyle: { color: "#409EFF" },
+            },
+            {
+              value: total > 0 ? ((typeMap.鐢� / total) * 100).toFixed(2) : 0,
+              name: "鐢�",
+              itemStyle: { color: "#E6A23C" },
+            },
+            {
+              value: total > 0 ? ((typeMap.姘� / total) * 100).toFixed(2) : 0,
+              name: "姘�",
+              itemStyle: { color: "#F56C6C" },
+            },
+          ];
+
+          // 鏇存柊鑳借�楃敤閲忚秼鍔垮浘琛ㄦ暟鎹�
+          energyConsumptionXAxis.data = dates;
+          energyConsumptionSeries[0].data = waterConsumptionData;
+          energyConsumptionSeries[1].data = electricityConsumptionData;
+          energyConsumptionSeries[2].data = gasConsumptionData;
+        }
+      })
+      .catch(err => {
+        console.error("鑾峰彇鑳借�楁暟鎹紓甯革細", err);
+      });
+  };
+
   const planTable = reactive([]);
   const recentTrendCards = reactive([
     {
@@ -715,102 +834,100 @@
   };
 
   const loadHomeTodos = async () => {
-    try {
-      const res = await homeTodos();
-      const list = Array.isArray(res?.data) ? res.data : [];
-      const mapped = list.slice(0, 4).map((item, idx) => {
-        const text =
-          item?.approveReason || item?.approveTypeName || `寰呭鐞嗕簨椤� ${idx + 1}`;
-        const levelType = idx === 0 ? "danger" : idx <= 2 ? "warning" : "success";
-        const level = idx === 0 ? "楂�" : idx <= 2 ? "涓�" : "浣�";
-        return { level, title: text, type: levelType };
-      });
-      updateArray(todos, mapped);
-      const pendingMapped = list.slice(0, 4).map((item, idx) => {
-        const title =
-          item?.approveReason || item?.approveTypeName || `寰呭鐞嗕簨椤� ${idx + 1}`;
-        const path = inferTodoPath(item);
-        return {
-          id: item?.id || `${idx}-${title}`,
-          title,
-          level: idx === 0 ? "楂�" : idx <= 2 ? "涓�" : "浣�",
-          type: idx === 0 ? "danger" : idx <= 2 ? "warning" : "success",
-          path,
-          ownerId: item?.approveUserId || item?.userId || "",
-          ownerName: item?.approveUserName || item?.userName || "",
-        };
-      });
-      updateArray(pendingTasks, pendingMapped);
-    } catch (error) {
-      console.error("homeTodos鎺ュ彛鑾峰彇澶辫触:", error);
-    }
+    // try {
+    //   const res = await homeTodos();
+    //   const list = Array.isArray(res?.data) ? res.data : [];
+    //   const mapped = list.slice(0, 4).map((item, idx) => {
+    //     const text =
+    //       item?.approveReason || item?.approveTypeName || `寰呭鐞嗕簨椤� ${idx + 1}`;
+    //     const levelType = idx === 0 ? "danger" : idx <= 2 ? "warning" : "success";
+    //     const level = idx === 0 ? "楂�" : idx <= 2 ? "涓�" : "浣�";
+    //     return { level, title: text, type: levelType };
+    //   });
+    //   updateArray(todos, mapped);
+    //   const pendingMapped = list.slice(0, 4).map((item, idx) => {
+    //     const title =
+    //       item?.approveReason || item?.approveTypeName || `寰呭鐞嗕簨椤� ${idx + 1}`;
+    //     const path = inferTodoPath(item);
+    //     return {
+    //       id: item?.id || `${idx}-${title}`,
+    //       title,
+    //       level: idx === 0 ? "楂�" : idx <= 2 ? "涓�" : "浣�",
+    //       type: idx === 0 ? "danger" : idx <= 2 ? "warning" : "success",
+    //       path,
+    //       ownerId: item?.approveUserId || item?.userId || "",
+    //       ownerName: item?.approveUserName || item?.userName || "",
+    //     };
+    //   });
+    //   updateArray(pendingTasks, pendingMapped);
+    // } catch (error) {
+    //   console.error("homeTodos鎺ュ彛鑾峰彇澶辫触:", error);
+    // }
   };
 
   const loadOrderAndProgress = async () => {
-    try {
-      const [orderRes, progressRes] = await Promise.allSettled([
-        orderCount(),
-        getProgressStatistics(),
-      ]);
-
-      if (orderRes.status === "fulfilled") {
-        const items = Array.isArray(orderRes.value?.data)
-          ? orderRes.value.data
-          : [];
-        const byName = Object.fromEntries(
-          items.map(i => [String(i?.name || "").replace(/\s/g, ""), i?.value])
-        );
-        businessFocus[0].value = `${
-          pickFirstNumber(byName, ["鐢熶骇璁㈠崟鏁�", "鐢熶骇璁㈠崟鎬绘暟", "鎬昏鍗曟暟"]) || 0
-        } 鍗昤;
-        businessFocus[1].value = `${
-          pickFirstNumber(byName, ["宸插畬鎴愯鍗曟暟"]) || 0
-        } 鍗昤;
-        businessFocus[2].value = `${
-          pickFirstNumber(byName, ["寰呯敓浜ц鍗曟暟", "鏈畬鎴愯鍗曟暟"]) || 0
-        } 鍗昤;
-        businessFocus[3].value = `${
-          pickFirstNumber(byName, ["閮ㄥ垎瀹屾垚璁㈠崟鏁�"]) || 0
-        } 鍗昤;
-      }
-
-      if (progressRes.status === "fulfilled") {
-        const p = progressRes.value?.data || {};
-        const detail = Array.isArray(p.completedOrderDetails)
-          ? p.completedOrderDetails
-          : [];
-        const rows = detail.slice(0, 6).map((item, index) => {
-          const qty = pickFirstNumber(item, ["quantity", "planQuantity"]);
-          const done = pickFirstNumber(item, [
-            "completeQuantity",
-            "completedQuantity",
-          ]);
-          return {
-            planNo: item.npsNo || item.productionPlanNo || `NO-${index + 1}`,
-            product: item.productCategory || item.productName || "-",
-            qty,
-            issued: done,
-            status:
-              qty > 0 && done >= qty ? "宸插畬鎴�" : done > 0 ? "鎵ц涓�" : "寰呬笅鍙�",
-          };
-        });
-        updateArray(planTable, rows);
-        setTrendCard(
-          "planIssued",
-          detail
-            .slice(-7)
-            .map(i =>
-              pickFirstNumber(i, [
-                "completeQuantity",
-                "completedQuantity",
-                "issueNum",
-              ])
-            )
-        );
-      }
-    } catch (error) {
-      console.error("orderCount/getProgressStatistics鎺ュ彛鑾峰彇澶辫触:", error);
-    }
+    // try {
+    //   const [orderRes, progressRes] = await Promise.allSettled([
+    //     orderCount(),
+    //     getProgressStatistics(),
+    //   ]);
+    //   if (orderRes.status === "fulfilled") {
+    //     const items = Array.isArray(orderRes.value?.data)
+    //       ? orderRes.value.data
+    //       : [];
+    //     const byName = Object.fromEntries(
+    //       items.map(i => [String(i?.name || "").replace(/\s/g, ""), i?.value])
+    //     );
+    //     businessFocus[0].value = `${
+    //       pickFirstNumber(byName, ["鐢熶骇璁㈠崟鏁�", "鐢熶骇璁㈠崟鎬绘暟", "鎬昏鍗曟暟"]) || 0
+    //     } 鍗昤;
+    //     businessFocus[1].value = `${
+    //       pickFirstNumber(byName, ["宸插畬鎴愯鍗曟暟"]) || 0
+    //     } 鍗昤;
+    //     businessFocus[2].value = `${
+    //       pickFirstNumber(byName, ["寰呯敓浜ц鍗曟暟", "鏈畬鎴愯鍗曟暟"]) || 0
+    //     } 鍗昤;
+    //     businessFocus[3].value = `${
+    //       pickFirstNumber(byName, ["閮ㄥ垎瀹屾垚璁㈠崟鏁�"]) || 0
+    //     } 鍗昤;
+    //   }
+    //   if (progressRes.status === "fulfilled") {
+    //     const p = progressRes.value?.data || {};
+    //     const detail = Array.isArray(p.completedOrderDetails)
+    //       ? p.completedOrderDetails
+    //       : [];
+    //     const rows = detail.slice(0, 6).map((item, index) => {
+    //       const qty = pickFirstNumber(item, ["quantity", "planQuantity"]);
+    //       const done = pickFirstNumber(item, [
+    //         "completeQuantity",
+    //         "completedQuantity",
+    //       ]);
+    //       return {
+    //         planNo: item.npsNo || item.productionPlanNo || `NO-${index + 1}`,
+    //         product: item.productCategory || item.productName || "-",
+    //         qty,
+    //         issued: done,
+    //         status:
+    //           qty > 0 && done >= qty ? "宸插畬鎴�" : done > 0 ? "鎵ц涓�" : "寰呬笅鍙�",
+    //       };
+    //     });
+    //     updateArray(planTable, rows);
+    //     setTrendCard(
+    //       "planIssued",
+    //       detail
+    //         .slice(-7)
+    //         .map(i =>
+    //           pickFirstNumber(i, [
+    //             "completeQuantity",
+    //             "completedQuantity",
+    //             "issueNum",
+    //           ])
+    //         )
+    //     );
+    //   }
+    // } catch (error) {
+    //   console.error("orderCount/getProgressStatistics鎺ュ彛鑾峰彇澶辫触:", error);
+    // }
   };
 
   const inferTodoPath = todo => {
@@ -827,112 +944,112 @@
   };
 
   const loadPlanTrend = async () => {
-    try {
-      const res = await processDataProductionStatistics({
-        type: chartRangePlan.value,
-      });
-      const list = Array.isArray(res?.data) ? res.data : [];
-      planXAxis[0].data = list.map(
-        (i, index) => i.processName || `宸ュ簭${index + 1}`
-      );
-      planSeries[0].data = list.map(i =>
-        pickFirstNumber(i, ["totalInput", "input", "planNum"])
-      );
-      planSeries[1].data = list.map(i =>
-        pickFirstNumber(i, ["totalOutput", "output", "issueNum"])
-      );
-      planSeries[2].data = list.map(i =>
-        pickFirstNumber(i, ["totalScrap", "scrap", "completeNum"])
-      );
-    } catch (error) {
-      console.error("processDataProductionStatistics鎺ュ彛鑾峰彇澶辫触:", error);
-    }
+    // try {
+    //   const res = await processDataProductionStatistics({
+    //     type: chartRangePlan.value,
+    //   });
+    //   const list = Array.isArray(res?.data) ? res.data : [];
+    //   planXAxis[0].data = list.map(
+    //     (i, index) => i.processName || `宸ュ簭${index + 1}`
+    //   );
+    //   planSeries[0].data = list.map(i =>
+    //     pickFirstNumber(i, ["totalInput", "input", "planNum"])
+    //   );
+    //   planSeries[1].data = list.map(i =>
+    //     pickFirstNumber(i, ["totalOutput", "output", "issueNum"])
+    //   );
+    //   planSeries[2].data = list.map(i =>
+    //     pickFirstNumber(i, ["totalScrap", "scrap", "completeNum"])
+    //   );
+    // } catch (error) {
+    //   console.error("processDataProductionStatistics鎺ュ彛鑾峰彇澶辫触:", error);
+    // }
   };
 
   const loadQualityData = async () => {
-    try {
-      const res = await qualityInspectionStatistics({
-        type: chartRangeQuality.value,
-      });
-      const data = res?.data || {};
-      const items = Array.isArray(data.item) ? data.item : [];
-      if (items.length > 0) {
-        qualityXAxis[0].data = items.map(i => i.date || i.name || "-");
-        qualitySeries[0].data = items.map(i =>
-          pickFirstNumber(i, [
-            "supplierNum",
-            "processNum",
-            "factoryNum",
-            "totalNum",
-          ])
-        );
-        setTrendCard(
-          "qualityRaw",
-          items.map(i => pickFirstNumber(i, ["supplierNum"]))
-        );
-        setTrendCard(
-          "qualityProcess",
-          items.map(i => pickFirstNumber(i, ["processNum"]))
-        );
-        setTrendCard(
-          "qualityFactory",
-          items.map(i => pickFirstNumber(i, ["factoryNum"]))
-        );
-      } else {
-        qualityXAxis[0].data = ["鏉ユ枡妫�", "杩囩▼妫�", "鎴愬搧妫�"];
-        qualitySeries[0].data = [
-          pickFirstNumber(data, ["supplierNum"]),
-          pickFirstNumber(data, ["processNum"]),
-          pickFirstNumber(data, ["factoryNum"]),
-        ];
-        setTrendCard("qualityRaw", [pickFirstNumber(data, ["supplierNum"])]);
-        setTrendCard("qualityProcess", [pickFirstNumber(data, ["processNum"])]);
-        setTrendCard("qualityFactory", [pickFirstNumber(data, ["factoryNum"])]);
-      }
-      businessFocus[4].value = `${pickFirstNumber(data, [
-        "supplierNum",
-        "totalNum",
-      ])} 鏉;
-      businessFocus[5].value = `${pickFirstNumber(data, ["processNum"])} 鏉;
-    } catch (error) {
-      console.error("qualityInspectionStatistics鎺ュ彛鑾峰彇澶辫触:", error);
-    }
+    // try {
+    //   const res = await qualityInspectionStatistics({
+    //     type: chartRangeQuality.value,
+    //   });
+    //   const data = res?.data || {};
+    //   const items = Array.isArray(data.item) ? data.item : [];
+    //   if (items.length > 0) {
+    //     qualityXAxis[0].data = items.map(i => i.date || i.name || "-");
+    //     qualitySeries[0].data = items.map(i =>
+    //       pickFirstNumber(i, [
+    //         "supplierNum",
+    //         "processNum",
+    //         "factoryNum",
+    //         "totalNum",
+    //       ])
+    //     );
+    //     setTrendCard(
+    //       "qualityRaw",
+    //       items.map(i => pickFirstNumber(i, ["supplierNum"]))
+    //     );
+    //     setTrendCard(
+    //       "qualityProcess",
+    //       items.map(i => pickFirstNumber(i, ["processNum"]))
+    //     );
+    //     setTrendCard(
+    //       "qualityFactory",
+    //       items.map(i => pickFirstNumber(i, ["factoryNum"]))
+    //     );
+    //   } else {
+    //     qualityXAxis[0].data = ["鏉ユ枡妫�", "杩囩▼妫�", "鎴愬搧妫�"];
+    //     qualitySeries[0].data = [
+    //       pickFirstNumber(data, ["supplierNum"]),
+    //       pickFirstNumber(data, ["processNum"]),
+    //       pickFirstNumber(data, ["factoryNum"]),
+    //     ];
+    //     setTrendCard("qualityRaw", [pickFirstNumber(data, ["supplierNum"])]);
+    //     setTrendCard("qualityProcess", [pickFirstNumber(data, ["processNum"])]);
+    //     setTrendCard("qualityFactory", [pickFirstNumber(data, ["factoryNum"])]);
+    //   }
+    //   businessFocus[4].value = `${pickFirstNumber(data, [
+    //     "supplierNum",
+    //     "totalNum",
+    //   ])} 鏉;
+    //   businessFocus[5].value = `${pickFirstNumber(data, ["processNum"])} 鏉;
+    // } catch (error) {
+    //   console.error("qualityInspectionStatistics鎺ュ彛鑾峰彇澶辫触:", error);
+    // }
   };
 
   const loadWarningCenter = async () => {
-    try {
-      const res = await nonComplianceWarning();
-      const list = Array.isArray(res?.data) ? res.data : [];
-      const mapped = list.slice(0, 6).map((item, idx) => {
-        const levelNum = toNumber(item.level ?? item.warningLevel ?? 2);
-        const levelType =
-          levelNum >= 3 ? "danger" : levelNum === 2 ? "warning" : "info";
-        const levelText = levelNum >= 3 ? "楂�" : levelNum === 2 ? "涓�" : "浣�";
-        const title =
-          item.name || item.title || item.paramName || `寮傚父棰勮 ${idx + 1}`;
-        const text = `${title}${item.processName || ""}${
-          item.orderNo || ""
-        }`.toLowerCase();
-        const path = text.includes("璐ㄦ")
-          ? routePathMap.processInspection
-          : text.includes("璁㈠崟")
-          ? routePathMap.order
-          : routePathMap.processInspection ||
-            routePathMap.order ||
-            routePathMap.plan;
-        return {
-          id: item.id || `${idx}-${title}`,
-          levelType,
-          levelText,
-          title,
-          path,
-        };
-      });
-      updateArray(warningList, mapped);
-    } catch (error) {
-      console.error("nonComplianceWarning鎺ュ彛鑾峰彇澶辫触:", error);
-      updateArray(warningList, []);
-    }
+    // try {
+    //   const res = await nonComplianceWarning();
+    //   const list = Array.isArray(res?.data) ? res.data : [];
+    //   const mapped = list.slice(0, 6).map((item, idx) => {
+    //     const levelNum = toNumber(item.level ?? item.warningLevel ?? 2);
+    //     const levelType =
+    //       levelNum >= 3 ? "danger" : levelNum === 2 ? "warning" : "info";
+    //     const levelText = levelNum >= 3 ? "楂�" : levelNum === 2 ? "涓�" : "浣�";
+    //     const title =
+    //       item.name || item.title || item.paramName || `寮傚父棰勮 ${idx + 1}`;
+    //     const text = `${title}${item.processName || ""}${
+    //       item.orderNo || ""
+    //     }`.toLowerCase();
+    //     const path = text.includes("璐ㄦ")
+    //       ? routePathMap.processInspection
+    //       : text.includes("璁㈠崟")
+    //       ? routePathMap.order
+    //       : routePathMap.processInspection ||
+    //         routePathMap.order ||
+    //         routePathMap.plan;
+    //     return {
+    //       id: item.id || `${idx}-${title}`,
+    //       levelType,
+    //       levelText,
+    //       title,
+    //       path,
+    //     };
+    //   });
+    //   updateArray(warningList, mapped);
+    // } catch (error) {
+    //   console.error("nonComplianceWarning鎺ュ彛鑾峰彇澶辫触:", error);
+    //   updateArray(warningList, []);
+    // }
   };
 
   const initSectionConfig = () => {
@@ -964,32 +1081,33 @@
   };
 
   const loadCostComposition = async () => {
-    try {
-      const res = await expenseCompositionAnalysis({ type: 1 });
-      const list = Array.isArray(res?.data) ? res.data : [];
-      const mapped = list.map(i => ({
-        name: i.name || "鏈懡鍚�",
-        value: pickFirstNumber(i, ["value", "amount", "cost"]),
-      }));
-      costSeries[0].data = mapped;
-    } catch (error) {
-      console.error("expenseCompositionAnalysis鎺ュ彛鑾峰彇澶辫触:", error);
-    }
+    // try {
+    //   const res = await expenseCompositionAnalysis({ type: 1 });
+    //   const list = Array.isArray(res?.data) ? res.data : [];
+    //   const mapped = list.map(i => ({
+    //     name: i.name || "鏈懡鍚�",
+    //     value: pickFirstNumber(i, ["value", "amount", "cost"]),
+    //   }));
+    //   costSeries[0].data = mapped;
+    // } catch (error) {
+    //   console.error("expenseCompositionAnalysis鎺ュ彛鑾峰彇澶辫触:", error);
+    // }
   };
 
   const refreshDashboardData = () => {
-    loadHomeTodos();
-    loadOrderAndProgress();
-    loadPlanTrend();
-    loadQualityData();
-    loadCostComposition();
-    loadWarningCenter();
+    // loadHomeTodos();
+    // loadOrderAndProgress();
+    // loadPlanTrend();
+    // loadQualityData();
+    // loadCostComposition();
+    // loadWarningCenter();
+    updateEnergyTypeChart();
     lastUpdatedAt.value = new Date().toLocaleString();
   };
 
   onMounted(() => {
     // initSectionConfig();
-    // refreshDashboardData();
+    refreshDashboardData();
   });
 </script>
 

--
Gitblit v1.9.3