From 92ce7d104ce175cf869bdf9ee87ce4123805050e Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 29 十月 2025 20:17:32 +0800
Subject: [PATCH] 班级考勤统计

---
 src/views/classAttendance/index.vue |   90 +++++---------------------------------------
 1 files changed, 11 insertions(+), 79 deletions(-)

diff --git a/src/views/classAttendance/index.vue b/src/views/classAttendance/index.vue
index ec1c844..4039d56 100644
--- a/src/views/classAttendance/index.vue
+++ b/src/views/classAttendance/index.vue
@@ -12,7 +12,7 @@
             </div>
         </div>
         <div style="height: calc(100vh - 168px)">
-            <el-table v-loading="listLoading" :data="list" element-loading-text="Loading" @expand-change="expandChange"
+            <el-table v-loading="listLoading" :data="list" element-loading-text="Loading"
                 fit height="100%">
                 <el-table-column label="鐝骇" prop="className" width="180">
                 </el-table-column>
@@ -40,7 +40,7 @@
 </template>
 
 <script>
-import { getData } from "@/api/attendance";
+import { findClassAttendance } from "@/api/class";
 
 export default {
     filters: {
@@ -72,7 +72,7 @@
                     index: 0, //蹇呴��
                     size: 10, //姣忛〉鐨勫ぇ灏忋�傞粯璁�20
                     sorts: {
-                        name: "p.name,CONVERT(s.begin_time,date)", //鎺掑簭瀛楁鍚嶇О
+                        name: "id, a.staff_name", //鎺掑簭瀛楁鍚嶇О
                         direction: "ASC", //鎺掑簭鏂瑰悜
                     },
                 },
@@ -157,89 +157,21 @@
             this.listLoading = true;
             this.data.beginDate = this.dateRange[0].replaceAll("-", "/");
             this.data.endDate = this.dateRange[1].replaceAll("-", "/");
-            this.list = [{ "className": "涓�鐝�", "A1": "90%", "A2": 1, "A3": 0, "A4": 0 },
-            { "className": "浜岀彮", "A1": "90%", "A2": 1, "A3": 0, "A4": 0 },
-            { "className": "涓夌彮", "A1": "90%", "A2": 1, "A3": 0, "A4": 0 },
-            { "className": "鍥涚彮", "A1": "90%", "A2": 1, "A3": 0, "A4": 0 }
-            ]
-            this.listLoading = false;
-            // getData(this.data).then((response) => {
-            //     this.list = response.data.findPlayerAttendanceSummary.ls;
-            //     this.total = response.data.findPlayerAttendanceSummary.pageOut.total;
-            //     this.listLoading = false;
-            // });
+            this.data.staffId = JSON.parse(localStorage.getItem("selectStaff")).id;
+            findClassAttendance(this.data).then((response) => {
+                this.list = response.data.findClassAttendance.ls;
+                this.total = response.data.findClassAttendance.pageOut.total;
+                this.listLoading = false;
+            });
         },
         handleSizeChange(val) {
             this.data.pageIn.size = val;
-            this.handleClick();
+            this.fetchData();
         },
         handleCurrentChange(val) {
             this.data.pageIn.index = val - 1;
-            this.handleClick();
+            this.fetchData();
         },
-        handleClick(tab, event) {
-            this.data.staffId = JSON.parse(localStorage.getItem("selectStaff")).id;
-            if (this.activeName == "pendingFees") {
-                this.listLoading = true;
-                getRenew(this.data).then((response) => {
-                    this.list = response.data.findRenewPlayerAcc.ls;
-                    this.total = response.data.findRenewPlayerAcc.pageOut.total;
-                    this.listLoading = false;
-                });
-            } else if (this.activeName == "expired") {
-                this.listLoading = true;
-                getExpire(this.data).then((response) => {
-                    this.list = response.data.findPlayerExpire.ls;
-                    this.total = response.data.findPlayerExpire.pageOut.total;
-                    this.listLoading = false;
-                });
-            } else if (this.activeName == "all") {
-                this.fetchData();
-            } else if (this.activeName == "deactivated") {
-                this.listLoading = true;
-                let data = {
-                    itemType: "PLAYER",
-                    staffId: JSON.parse(localStorage.getItem("selectStaff")).id,
-                    keyword: this.data.keyword,
-                    pageIn: { ...this.data.pageIn },
-                };
-                getDeleted(data).then((response) => {
-                    this.list = response.data.findDeletedItem.ls;
-                    this.total = response.data.findDeletedItem.pageOut.total;
-                    this.listLoading = false;
-                });
-            }
-        },
-        goDetails(row) {
-            this.$router.push({
-                name: "StudentDetails",
-                query: {
-                    id: row.id,
-                },
-            });
-        },
-        showCreate() {
-            this.$refs.studentCreate.showDialog();
-        },
-        changeType(type) {
-            switch (type) {
-                case 0:
-                    return "鐝";
-                case 1:
-                    return "绾﹁";
-                case 2:
-                    return "鍦哄湴";
-                default:
-                    return "-";
-            }
-        },
-        expandChange(row, expandedRows, expanded) {
-            this.studentList = [{ "studentName": "瀛﹀憳", "a1": "90%", "a2": 1, "a3": 0, "a4": 0 },
-            { "studentName": "瀛﹀憳", "a1": "90%", "a2": 1, "a3": 0, "a4": 0 },
-            { "studentName": "瀛﹀憳", "a1": "90%", "a2": 1, "a3": 0, "a4": 0 }
-            ]
-            this.studentLoading = false
-        }
     },
 };
 </script>
\ No newline at end of file

--
Gitblit v1.8.0