소스 검색

首页样式调整

yanghao 1 주 전
부모
커밋
e7313912a7
4개의 변경된 파일92개의 추가작업 그리고 179개의 파일을 삭제
  1. 8 0
      api/ruiduReport.js
  2. 2 2
      config/env.dev.js
  3. 0 4
      pages/entry/index.vue
  4. 82 173
      pages/ruiDuReport/daily-detail.vue

+ 8 - 0
api/ruiduReport.js

@@ -16,6 +16,14 @@ export function getRuiduReportSummary(params) {
   });
 }
 
+export function getRuiduReportTeamSummary(params) {
+  return request({
+    url: "/pms/iot-rd-daily-report/reportTeamSummary",
+    method: "get",
+    params,
+  });
+}
+
 export function getRuiduReportTeamPage(params) {
   return request({
     url: "/pms/iot-rd-daily-report/teamReports",

+ 2 - 2
config/env.dev.js

@@ -1,7 +1,7 @@
 // 开发环境配置
 export default {
-  // apiUrl: "http://192.168.188.198:48080",
-  apiUrl: "https://iot.deepoil.cc:5443",
+  // apiUrl: "https://iot.deepoil.cc:5443",
+  apiUrl: "http://192.168.188.86:48080",
   // apiUrl: "https://aims.deepoil.cc", //正式
   apiUrlSuffix: "/admin-api",
   // 其他开发环境配置...

+ 0 - 4
pages/entry/index.vue

@@ -22,10 +22,6 @@
           </view>
           <view class="profile-main">
             <view class="greeting">{{ greetingText }},{{ displayName }}</view>
-            <view class="project-pill">
-              <text class="project-name">{{ projectName }}</text>
-              <uni-icons type="down" size="13" color="#ffffff" />
-            </view>
           </view>
           <view
             class="notice-wrap"

+ 82 - 173
pages/ruiDuReport/daily-detail.vue

@@ -116,7 +116,7 @@
                         v-else-if="day.reports && day.reports.length"
                         class="report-list">
                         <view
-                          v-for="item in filteredReports(day.reports)"
+                          v-for="item in day.reports"
                           :key="item.id"
                           class="report-card">
                           <view class="simple-card-content">
@@ -131,11 +131,6 @@
                             >
                           </view>
                         </view>
-                        <view
-                          v-if="!filteredReports(day.reports).length"
-                          class="empty-text"
-                          >没有符合搜索条件的日报</view
-                        >
                       </view>
                       <view v-else class="empty-text">当日暂无日报</view>
                     </view>
@@ -179,13 +174,13 @@
             <view v-for="well in team.wells" :key="well.id" class="tree-item">
               <view
                 class="level-title well-title"
-                @click="toggleWell(team, well)">
+                @click="toggleWell(well)">
                 <view class="well-icon"
                   ><uni-icons type="location-filled" size="17" color="#356fea"
                 /></view>
                 <view class="level-main">
                   <text class="well-name">{{ well.name }}</text>
-                  <text class="level-desc">最近更新 {{ well.latestDate }}</text>
+                  <text class="level-desc">共 {{ well.reportCount }} 份日报</text>
                 </view>
                 <text class="date-count">{{ well.reportCount }}份</text>
                 <view class="arrow-box" :class="{ opened: well.open }"
@@ -200,41 +195,11 @@
                   :content-text="reportLoadingText" />
                 <view v-else class="report-list">
                   <view
-                    v-for="item in filteredReports(well.reports)"
+                    v-for="item in well.reports"
                     :key="item.id"
                     class="report-card">
-                    <view class="card-head">
-                      <view class="card-heading">
-                        <text class="card-title">{{ item.reportName }}</text>
-                        <text class="card-time">{{ item.createTime }}</text>
-                      </view>
-                      <text
-                        class="status-tag"
-                        :class="statusClass(item.auditStatus)"
-                        >{{ auditStatusText(item.auditStatus) }}</text
-                      >
-                    </view>
-                    <view class="card-body">
-                      <view class="info-row"
-                        ><text class="info-label">带班干部</text
-                        ><text class="info-value">{{
-                          item.responsiblePersonNames
-                        }}</text></view
-                      >
-                      <view class="info-row"
-                        ><text class="info-label">队伍</text
-                        ><text class="info-value">{{ team.name }}</text></view
-                      >
-                      <view class="info-row"
-                        ><text class="info-label">井号</text
-                        ><text class="info-value">{{ well.name }}</text></view
-                      >
-                      <view class="info-row"
-                        ><text class="info-label">任务</text
-                        ><text class="info-value">{{
-                          item.taskName
-                        }}</text></view
-                      >
+                    <view class="simple-card-content">
+                      <text class="card-title">{{ item.reportName }}</text>
                     </view>
                     <view class="card-actions">
                       <button
@@ -243,20 +208,12 @@
                         @click.stop="navigatorDetail(item)"
                         >查看详情</button
                       >
-                      <button
-                        v-if="item.status === 0"
-                        class="action-btn fill-btn"
-                        type="primary"
-                        size="mini"
-                        @click.stop="navigatorEdit(item)"
-                        >立即填写</button
-                      >
                     </view>
                   </view>
                   <view
-                    v-if="well.reports && !filteredReports(well.reports).length"
+                    v-if="well.reports && !well.reports.length"
                     class="empty-text"
-                    >没有符合搜索条件的日报</view
+                    >该井号暂无日报</view
                   >
                 </view>
               </view>
@@ -273,6 +230,13 @@
       <text>暂无日报数据</text>
     </view>
 
+    <view
+      v-if="currentView === 1 && !teamLoading && !teams.length"
+      class="empty-page">
+      <uni-icons type="folder-add" size="42" color="#b7c1d1" />
+      <text>暂无队伍日报数据</text>
+    </view>
+
     <UniFab
       :pattern="fabPattern"
       horizontal="right"
@@ -336,7 +300,10 @@
 import { computed, onMounted, onUnmounted, reactive, ref } from "vue";
 import DaTree from "@/components/da-tree/index.vue";
 import UniFab from "@/uni_modules/uni-fab/components/uni-fab/uni-fab.vue";
-import { getRuiduReportSummary } from "@/api/ruiduReport";
+import {
+  getRuiduReportSummary,
+  getRuiduReportTeamSummary,
+} from "@/api/ruiduReport";
 import { specifiedSimpleDepts } from "@/api";
 import { getDeptId } from "@/utils/auth";
 
@@ -582,77 +549,6 @@ const createReports = (year, month, dayInfo) => {
   return reports.slice(0, dayInfo.reportCount);
 };
 
-const createTeamList = () => [
-  {
-    id: "team-01",
-    name: "掘进一队",
-    wellCount: 3,
-    reportCount: 9,
-    open: false,
-    loading: false,
-    wells: null,
-  },
-  {
-    id: "team-02",
-    name: "掘进二队",
-    wellCount: 2,
-    reportCount: 6,
-    open: false,
-    loading: false,
-    wells: null,
-  },
-  {
-    id: "team-03",
-    name: "机电队",
-    wellCount: 3,
-    reportCount: 9,
-    open: false,
-    loading: false,
-    wells: null,
-  },
-];
-
-const createWells = (team) => {
-  const wellNames = {
-    "team-01": ["主斜井1号井", "副斜井2号井", "回风立井3号井"],
-    "team-02": ["东翼1号井", "东翼2号井"],
-    "team-03": ["中央1号井", "西翼2号井", "辅助3号井"],
-  };
-  const names = wellNames[team.id] || [];
-  return names.map((name, index) => ({
-    id: `${team.id}-well-${index + 1}`,
-    name,
-    latestDate:
-      index === 0
-        ? "2026-07-11"
-        : `2026-07-${String(10 - index).padStart(2, "0")}`,
-    reportCount: 3,
-    open: false,
-    loading: false,
-    reports: null,
-  }));
-};
-
-const createWellReports = (team, well) => {
-  const dates = [well.latestDate, "2026-07-10", "2026-07-09"];
-  return dates.map((date, index) => {
-    const day = Number(date.slice(-2));
-    return {
-      id: `${well.id}-${date}`,
-      reportName: `${team.name} ${well.name} 2026年7月${day}日 日报详情`,
-      responsiblePersonNames: index === 0 ? "张建国、李明" : "王海涛",
-      contractName: "瑞都矿井建设工程",
-      taskName: index % 2 === 0 ? "井下掘进及支护" : "设备巡检与维护",
-      createTime: `${date} ${index === 0 ? "08:30" : "09:15"}`,
-      auditStatus: index === 2 ? 10 : 20,
-      nonProductFlag: true,
-      status: 1,
-      projectId: "P001",
-      taskId: `T00${index + 1}`,
-    };
-  });
-};
-
 const normalizeSummaryData = (data) =>
   (Array.isArray(data) ? data : [])
     .map((yearItem) => {
@@ -726,6 +622,42 @@ const normalizeSummaryData = (data) =>
     })
     .sort((a, b) => Number(b.id) - Number(a.id));
 
+const normalizeTeamSummaryData = (data) =>
+  (Array.isArray(data) ? data : []).map((teamItem, teamIndex) => {
+    const teamName = teamItem.teamName || "未分配队伍";
+    const wells = (Array.isArray(teamItem.wells) ? teamItem.wells : []).map(
+      (wellItem, wellIndex) => ({
+        ...wellItem,
+        id:
+          wellItem.taskId ||
+          `${teamName}-${wellItem.wellName || wellIndex}`,
+        name: wellItem.wellName || "未命名井号",
+        reportCount: Number(wellItem.reportCount || 0),
+        filledCount: Number(wellItem.filledCount || 0),
+        unfilledCount: Number(wellItem.unfilledCount || 0),
+        open: false,
+        loading: false,
+        reports: (Array.isArray(wellItem.reports)
+          ? wellItem.reports
+          : []
+        ).map((report) => ({
+          ...report,
+          reportName: report.reportName || "未命名日报",
+        })),
+      })
+    );
+    return {
+      ...teamItem,
+      id: `${teamName}-${teamIndex}`,
+      name: teamName,
+      wellCount: Number(teamItem.wellCount || wells.length),
+      reportCount: Number(teamItem.reportCount || 0),
+      open: false,
+      loading: false,
+      wells,
+    };
+  });
+
 const visibleYears = computed(() => years.value);
 
 const toggleYear = async (year) => {
@@ -758,70 +690,30 @@ const toggleDay = async (year, month, day) => {
   }
 };
 
-const loadTeams = async () => {
-  if (teams.value.length || teamLoading.value) return;
-  teamLoading.value = true;
-  teams.value = await mockRequest(createTeamList(), 700);
-  teamLoading.value = false;
-};
-
 const handleViewChange = (index) => {
   currentView.value = index;
-  if (index === 1) loadTeams();
 };
 
-const toggleTeam = async (team) => {
+const toggleTeam = (team) => {
   team.open = !team.open;
-  if (team.open && !team.wells && !team.loading) {
-    team.loading = true;
-    team.wells = await mockRequest(createWells(team));
-    team.loading = false;
-  }
 };
 
-const toggleWell = async (team, well) => {
+const toggleWell = (well) => {
   well.open = !well.open;
-  if (well.open && !well.reports && !well.loading) {
-    well.loading = true;
-    well.reports = await mockRequest(createWellReports(team, well), 750);
-    well.loading = false;
-  }
 };
 
 const searchList = async () => {
   searchKey.value = orderName.value.trim();
-  await queryReportSummary({
+  const params = {
     createTime: getCurrentYearRange(),
     searchKey: searchKey.value || undefined,
-  });
-};
-
-const filteredReports = (reports) => {
-  if (!searchKey.value) return reports;
-  return reports.filter((item) =>
-    [
-      item.reportName,
-      item.contractName,
-      item.taskName,
-      item.responsiblePersonNames,
-    ]
-      .join(" ")
-      .toLowerCase()
-      .includes(searchKey.value.toLowerCase())
-  );
+  };
+  await Promise.all([
+    queryReportSummary(params),
+    queryReportTeamSummary(params),
+  ]);
 };
 
-const auditStatusText = (status) =>
-  ({ 0: "待提交", 10: "待审批", 20: "审批通过", 30: "审批拒绝" })[status] ||
-  "未知";
-const statusClass = (status) =>
-  ({
-    0: "status-gray",
-    10: "status-blue",
-    20: "status-green",
-    30: "status-red",
-  })[status] || "status-gray";
-
 const navigatorDetail = (item) => {
   const url =
     item.projectId === null && item.taskId === null
@@ -867,14 +759,18 @@ const applyFilter = async () => {
   orderName.value = "";
   searchKey.value = "";
   closeFilterPopup();
-  await queryReportSummary({
+  const params = {
     contractName: filterForm.contractName || undefined,
     taskName: filterForm.taskName || undefined,
     deptId: filterForm.deptId || undefined,
     createTime: filterForm.createTime?.length
       ? filterForm.createTime
       : getCurrentYearRange(),
-  });
+  };
+  await Promise.all([
+    queryReportSummary(params),
+    queryReportTeamSummary(params),
+  ]);
 };
 
 async function queryReportSummary(params = {}) {
@@ -889,7 +785,20 @@ async function queryReportSummary(params = {}) {
   }
 };
 
+const queryReportTeamSummary = async (params) => {
+  teamLoading.value = true;
+  try {
+    const response = await getRuiduReportTeamSummary(params);
+    teams.value =
+      response?.code === 0 ? normalizeTeamSummaryData(response.data) : [];
+    console.log("[reportTeamSummary] 返回结果:", response);
+  } finally {
+    teamLoading.value = false;
+  }
+};
+
 queryReportSummary({ createTime: getCurrentYearRange() });
+queryReportTeamSummary();
 onMounted(loadDeptOptions);
 onUnmounted(() => timers.forEach((timer) => clearTimeout(timer)));
 </script>